Brief builder gives no test_changes when the project root resolves outside the worktree #1227

Open
opened 2026-10-21 21:47:58 +00:00 by jared · 0 comments
Owner

Problem

Implementation 110 (#1217) failed. Test-reviewer dispatch 859 got a brief with no test_changes or red_tests section. The orchestrator session cwd was the main checkout, not the ticket worktree. Brief::Facts#test_changes (plugins/os-sdlc/lib/os_sdlc/dispatch/brief/facts.rb:86) returns nil when @project is nil. changes.test_diff returns "" when test_paths is empty. The reviewer correctly returned verdict error.

Reproduce

n/a: needs a live implementation run with the orchestrator cwd in the main checkout and the ticket in a worktree.

Approach

The brief builder fails loudly when it cannot build test_changes for a test-reviewer. It raises an error that names the dispatch and the project root. It must not return nil or an empty diff for that role. Also take the project root from the dispatch's worktree, not from the orchestrator cwd.

Required work:

  1. Raise in test_changes when the project is missing — check: present raise in plugins/os-sdlc/lib/os_sdlc/dispatch/brief/facts.rb
  2. Resolve the project root from the dispatch's worktree — check: present worktree in plugins/os-sdlc/lib/os_sdlc/dispatch/brief/facts.rb

Acceptance criteria

  1. Given a test-reviewer dispatch with no resolvable project, when the brief builds, then it fails with an error that names the cause.
  2. Given a test-reviewer dispatch whose worktree holds test changes, when the orchestrator cwd is the main checkout, then the brief contains the test_changes section from the worktree.
  3. Given a test-reviewer dispatch with test paths that hold no diff, when the brief builds, then it fails with an error and does not give an empty section.

Owner sketch

def test_changes
  raise Failure, "no project root for #{@implementation.id}" unless @project

  diff = changes.test_diff.to_s
  raise Failure, "empty test diff in #{@project.root}" if diff.empty?

  append_unmapped_note(diff)
end

Origin

  • Trigger: Implementation 110 (#1217): dispatch 859 got no test_changes; the run failed.
  • Improvised this session: none
  • Chain: reviewer verdict error <- brief lacks test_changes <- Facts#test_changes returns nil or empty without error <- DESIGN plugins/os-sdlc/lib/os_sdlc/dispatch/brief/facts.rb
  • Root candidate: none found; searched test_changes, Brief::Facts, test-reviewer, project root, worktree cwd (#1111 related, different fault)
  • Where: plugins/os-sdlc/lib/os_sdlc/dispatch/brief/facts.rb:86
  • Session: 03befa1b-ac60-4013-8433-1e4b189d9a85
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/03befa1b-ac60-4013-8433-1e4b189d9a85.jsonl

VERDICT: CREATE

## Problem Implementation 110 (#1217) failed. Test-reviewer dispatch 859 got a brief with no `test_changes` or `red_tests` section. The orchestrator session cwd was the main checkout, not the ticket worktree. `Brief::Facts#test_changes` (`plugins/os-sdlc/lib/os_sdlc/dispatch/brief/facts.rb:86`) returns nil when `@project` is nil. `changes.test_diff` returns "" when test_paths is empty. The reviewer correctly returned verdict error. ## Reproduce n/a: needs a live implementation run with the orchestrator cwd in the main checkout and the ticket in a worktree. ## Approach The brief builder fails loudly when it cannot build `test_changes` for a test-reviewer. It raises an error that names the dispatch and the project root. It must not return nil or an empty diff for that role. Also take the project root from the dispatch's worktree, not from the orchestrator cwd. Required work: 1. Raise in `test_changes` when the project is missing — check: present `raise` in `plugins/os-sdlc/lib/os_sdlc/dispatch/brief/facts.rb` 2. Resolve the project root from the dispatch's worktree — check: present `worktree` in `plugins/os-sdlc/lib/os_sdlc/dispatch/brief/facts.rb` ## Acceptance criteria 1. Given a test-reviewer dispatch with no resolvable project, when the brief builds, then it fails with an error that names the cause. 2. Given a test-reviewer dispatch whose worktree holds test changes, when the orchestrator cwd is the main checkout, then the brief contains the `test_changes` section from the worktree. 3. Given a test-reviewer dispatch with test paths that hold no diff, when the brief builds, then it fails with an error and does not give an empty section. ## Owner sketch ```ruby def test_changes raise Failure, "no project root for #{@implementation.id}" unless @project diff = changes.test_diff.to_s raise Failure, "empty test diff in #{@project.root}" if diff.empty? append_unmapped_note(diff) end ``` ## Origin - Trigger: Implementation 110 (#1217): dispatch 859 got no test_changes; the run failed. - Improvised this session: none - Chain: reviewer verdict error <- brief lacks test_changes <- Facts#test_changes returns nil or empty without error <- DESIGN plugins/os-sdlc/lib/os_sdlc/dispatch/brief/facts.rb - Root candidate: none found; searched test_changes, Brief::Facts, test-reviewer, project root, worktree cwd (#1111 related, different fault) - Where: plugins/os-sdlc/lib/os_sdlc/dispatch/brief/facts.rb:86 - Session: 03befa1b-ac60-4013-8433-1e4b189d9a85 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/03befa1b-ac60-4013-8433-1e4b189d9a85.jsonl VERDICT: CREATE
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1227
No description provided.