fix: plan mode traces the plan, not the git diff

Codex adversarial review caught that plan-eng-review was inheriting
"git diff origin/<base>...HEAD" from the shared resolver, but plan mode
reviews a plan document, not a code diff. Plan mode now says:
"Trace every codepath in the plan" and "Read the plan document."

Ship and review modes keep the git diff instruction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-20 08:41:23 -07:00
parent 451d7c2fc1
commit aa9f186b99
4 changed files with 27 additions and 12 deletions
+15 -5
View File
@@ -1313,13 +1313,23 @@ find . -name '*.test.*' -o -name '*.spec.*' -o -name '*_test.*' -o -name '*_spec
Store this number for the PR body.`);
}
// ── Codepath tracing methodology (shared) ──
// ── Codepath tracing methodology (shared, with mode-specific source) ──
const traceSource = mode === 'plan'
? `**Step 1. Trace every codepath in the plan:**
Read the plan document. For each new feature, service, endpoint, or component described, trace how data will flow through the code — don't just list planned functions, actually follow the planned execution:`
: `**${mode === 'ship' ? '1' : 'Step 1'}. Trace every codepath changed** using \`git diff origin/<base>...HEAD\`:
Read every changed file. For each one, trace how data flows through the code — don't just list functions, actually follow the execution:`;
const traceStep1 = mode === 'plan'
? `1. **Read the plan.** For each planned component, understand what it does and how it connects to existing code.`
: `1. **Read the diff.** For each changed file, read the full file (not just the diff hunk) to understand context.`;
sections.push(`
**${mode === 'ship' ? '1' : 'Step 1'}. Trace every codepath changed** using \`git diff origin/<base>...HEAD\`:
${traceSource}
Read every changed file. For each one, trace how data flows through the code — don't just list functions, actually follow the execution:
1. **Read the diff.** For each changed file, read the full file (not just the diff hunk) to understand context.
${traceStep1}
2. **Trace data flow.** Starting from each entry point (route handler, exported function, event listener, component render), follow the data through every branch:
- Where does input come from? (request params, props, database, API call)
- What transforms it? (validation, mapping, computation)