fix(review): fix-range narrows only DIFF_BASE outside Step 4.8; Step 5.0 ignores this invocation's records (#3339)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
garrytanandcapy-ai[bot] committed 2026-10-25 11:08:16 +00:00
1 parent bd5f6ec865
commit 1ea548bff4
6 files changed
+54 -41

No files matched your search

+8 -8
View File
@@ -9,7 +9,7 @@
"agy/gstack-plan-design-review": 140013,
"agy/gstack-plan-devex-review": 135760,
"agy/gstack-plan-eng-review": 152626,
"agy/gstack-review": 124190,
"agy/gstack-review": 124182,
"claude/design-review": 136531,
"codex/gstack-autoplan": 130628,
"codex/gstack-design-consultation": 109452,
@@ -19,7 +19,7 @@
"codex/gstack-plan-design-review": 142466,
"codex/gstack-plan-devex-review": 138649,
"codex/gstack-plan-eng-review": 155172,
"codex/gstack-review": 125094,
"codex/gstack-review": 125086,
"copilot/gstack-autoplan": 131637,
"copilot/gstack-codex": 100235,
"copilot/gstack-design-consultation": 109536,
@@ -29,7 +29,7 @@
"copilot/gstack-plan-design-review": 140884,
"copilot/gstack-plan-devex-review": 136912,
"copilot/gstack-plan-eng-review": 153351,
"copilot/gstack-review": 125461,
"copilot/gstack-review": 125453,
"cursor/gstack-autoplan": 129278,
"cursor/gstack-design-consultation": 107222,
"cursor/gstack-design-review": 142507,
@@ -37,7 +37,7 @@
"cursor/gstack-plan-design-review": 138968,
"cursor/gstack-plan-devex-review": 134591,
"cursor/gstack-plan-eng-review": 151480,
"cursor/gstack-review": 140722,
"cursor/gstack-review": 140714,
"factory/gstack-autoplan": 131562,
"factory/gstack-codex": 100655,
"factory/gstack-design-consultation": 108670,
@@ -47,7 +47,7 @@
"factory/gstack-plan-design-review": 141749,
"factory/gstack-plan-devex-review": 137960,
"factory/gstack-plan-eng-review": 154594,
"factory/gstack-review": 144501,
"factory/gstack-review": 144493,
"gbrain/gstack-autoplan": 129815,
"gbrain/gstack-design-review": 132842,
"gbrain/gstack-land-and-deploy": 117167,
@@ -67,7 +67,7 @@
"kiro/gstack-plan-design-review": 138808,
"kiro/gstack-plan-devex-review": 134431,
"kiro/gstack-plan-eng-review": 151330,
"kiro/gstack-review": 140534,
"kiro/gstack-review": 140526,
"openclaw/gstack-autoplan": 129520,
"openclaw/gstack-design-review": 131647,
"openclaw/gstack-land-and-deploy": 116757,
@@ -82,7 +82,7 @@
"opencode/gstack-plan-design-review": 140738,
"opencode/gstack-plan-devex-review": 136812,
"opencode/gstack-plan-eng-review": 153232,
"opencode/gstack-review": 142957,
"opencode/gstack-review": 142949,
"slate/gstack-autoplan": 129159,
"slate/gstack-design-consultation": 107143,
"slate/gstack-design-review": 142414,
@@ -90,6 +90,6 @@
"slate/gstack-plan-design-review": 138888,
"slate/gstack-plan-devex-review": 134511,
"slate/gstack-plan-eng-review": 151405,
"slate/gstack-review": 140628
"slate/gstack-review": 140620
}
}
+8 -5
View File
@@ -221,16 +221,16 @@ describe('review Step 3 and Step 5.8 instructions', () => {
const step58 = skill.slice(skill.indexOf('## Step 5.8: Persist Eng Review result'), skill.indexOf('### Report the final review'));
const flat3 = step3.replace(/\s+/g, ' '), flat58 = step58.replace(/\s+/g, ' ');
test('the first pass starts full and only the pass after an edited pass narrows, with FIX_BASE replacing every base', () => {
test('the first pass starts full and only the pass after an edited pass narrows its DIFF_BASE, never Step 4.8 or other base uses', () => {
const block = step3.slice(step3.indexOf('```bash'), step3.indexOf('```', step3.indexOf('```bash') + 7));
expect(block).toContain('gstack-review-log --start review\ngit diff "$DIFF_BASE"');
expect(block).not.toContain('--fix-range');
expect(flat3).toContain('After an edited pass, start the next with `--start review --fix-range`: it prints REVIEW_START, then `FIX_BASE=<sha>`, which replaces DIFF_BASE, `origin/<base>` and `<base>` in this pass. On refusal, start a full pass.');
expect(flat3).toContain('After an edited pass, start the next with `--start review --fix-range`: it prints REVIEW_START, then `FIX_BASE=<sha>`. Wherever this pass sets DIFF_BASE outside Step 4.8, use FIX_BASE instead; Step 4.8 and every other `<base>` use stay full. On refusal, start a full pass.');
expect(skill.match(/--fix-range/g)).toHaveLength(1);
});
test('an edited pass is logged before the repeat, and a fix-range pass is never the final review', () => {
const edited = flat58.indexOf('Edited: increment CYCLES once, then fill and save the record below with `converged:false`.');
test('an edited pass is logged before the repeat, kept out of Step 5.0, and a fix-range pass is never the final review', () => {
const edited = flat58.indexOf("Edited: increment CYCLES once, then fill and save the record below with `converged:false`. Step 5.0 never treats this invocation's records as prior reviews.");
const repeat = flat58.indexOf('Below 3, repeat Steps 3–5 with a new REVIEW_START.');
const none = flat58.indexOf('No edits: after a full pass, fill the record below. A fix-range pass is never final: repeat Steps 3–5 with a full start.');
expect(edited).toBeGreaterThan(-1);
@@ -254,6 +254,9 @@ describe('review Step 3/5.8 order against the real logger', () => {
test('a committed first pass narrows the next repeat to the uncommitted fixes, then the chain returns to a full pass', () => {
const reviewed = head();
// Step 4.8 saves its attempt row before fixes, so it precedes the core row and never blocks the narrowed start.
const attempt = bin('gstack-review-log', ['--start', 'adversarial-review']).out;
expect(bin('gstack-review-log', [JSON.stringify({ skill: 'adversarial-review', status: 'clean', source: 'claude', ...clean }), '--finish', attempt]).code).toBe(0);
reviewPass(fixing, ['--start', 'review'], 'export const a = 2;\n');
expect(reviewPass(fixing, ['--start', 'review', '--fix-range'], 'export const a = 3;\n')).toBe(`FIX_BASE=${reviewed}`);
expect(gitIn(repo, `diff --name-only ${reviewed}`).trim()).toBe('a.ts');
@@ -266,7 +269,7 @@ describe('review Step 3/5.8 order against the real logger', () => {
expect(reviewFreshness(last, last.wtree)?.status).toBe('CURRENT');
});
test('a zero-edit fix-range pass is never CURRENT, so the final record needs a full pass', () => {
test('a zero-edit fix-range pass is never CURRENT even if it were logged, so the final record needs a full pass', () => {
reviewPass(fixing, ['--start', 'review'], 'export const a = 2;\n');
reviewPass(clean, ['--start', 'review', '--fix-range']);
const narrowed = rows().at(-1)!;
+1 -1
View File
@@ -249,7 +249,7 @@ test('review finalization ownership: late findings use Fix-First before the boun
expect(positions.every(position => position >= 0)).toBe(true);
expect(positions).toEqual([...positions].sort((a, b) => a - b));
expect(flat).toContain('at most 3 fix cycles');
expect(flat).toContain('Edited: increment CYCLES once, then fill and save the record below with `converged:false`. Below 3,');
expect(flat).toContain('Edited: increment CYCLES once, then fill and save the record below with `converged:false`.');
const limit = flat.slice(flat.indexOf('At 3,'), flat.indexOf('No edits:'));
expect(limit).toMatch(/then stop this invocation/i);
expectMentions(limit, [['without', 'summary', 'fourth']], 'limit');