Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
dff2b78
feat(review): content-anchored incremental rounds for the local revie…
wenshao Aug 21, 2026
ee54f8b
fix(review): close nine Criticals, most of them my own last round's
wenshao Aug 21, 2026
0810d06
fix(review): close round 2 — the cache rename's fallout, and the stop…
wenshao Aug 22, 2026
91d93cb
fix(review): close round 3 — the cache records the gate's identity, a…
github-actions[bot] Aug 22, 2026
87b769b
fix(review): close round 4 — the named-path flow's six dead ends
github-actions[bot] Aug 22, 2026
c661806
fix(review): close round 5 — including a gate of mine that could neve…
wenshao Aug 22, 2026
feb55b5
fix(review): close round 6 — the five Criticals the re-read of HEAD s…
github-actions[bot] Aug 22, 2026
b295232
fix(review): close round 7 — and stop enumerating the fail-closed list
wenshao Aug 23, 2026
ecf5fea
merge: keep both sets of SKILL guards
wenshao Aug 23, 2026
af708af
fix(review): close round 8 — the four shapes the last fixes left open
wenshao Aug 23, 2026
575d136
fix(review): close round 9 — date a stop's blockers; key the local ca…
wenshao Aug 23, 2026
8192762
fix(review): close round 10 — date each stop blocker against its own …
wenshao Aug 23, 2026
df533ff
fix(review): close round 11 — date blockers on bytes; certify vanishe…
wenshao Aug 23, 2026
3b916d6
fix(review): close round 12 — attribute landed fixes, date by regime,…
github-actions[bot] Aug 24, 2026
4142065
Merge origin/main into review-incremental-anchor
wenshao Aug 24, 2026
e6aa683
fix(review): close round 13 — pay the isolation test's import cost at…
github-actions[bot] Aug 24, 2026
99fff42
Merge branch 'review/local-content-anchor' of https://github.com/Qwen…
qwen-code-dev-bot Aug 24, 2026
1f0fb94
refactor(review): drop the stop-round blocker-dating chain
wenshao Aug 24, 2026
7774eb3
Merge remote round-12/13 autofix commits, keeping the chain deleted
wenshao Aug 24, 2026
b13eb13
Merge remote-tracking branch 'origin/main' into p1
wenshao Aug 24, 2026
4a24ca5
fix(review): close round 14 — certify what git diff cannot see, split…
github-actions[bot] Aug 24, 2026
5dba419
fix(review): close round 15 — withhold the candidate under visibility…
github-actions[bot] Aug 25, 2026
dc74e83
fix(review): close round 15 review — bracket the visibility oracle, g…
wenshao Aug 25, 2026
c723d5f
fix(review): close round 16 — withhold the incremental stops under --…
github-actions[bot] Aug 25, 2026
af521c5
fix(review): gate decided stops on a composed re-rule verdict (#9941)
wenshao Aug 25, 2026
0d11241
Revert "fix(review): gate decided stops on a composed re-rule verdict…
wenshao Aug 25, 2026
2f050a6
Merge remote-tracking branch 'origin/main' into p1
wenshao Aug 25, 2026
0cf1b07
fix(cli): drop duplicate getCurrentCustomTitle key that breaks npm ci
wenshao Aug 25, 2026
8b81762
fix(cli): drop the second duplicate key too (getSessionDisplayName)
wenshao Aug 25, 2026
2e03ecd
Merge branch 'main' into review/local-content-anchor
qwen-code-dev-bot Aug 25, 2026
9443811
test(review): pin the visibility oracle's sample count
wenshao Aug 25, 2026
49c2db3
Merge remote-tracking branch 'origin/review/local-content-anchor' int…
wenshao Aug 25, 2026
79dfd58
fix(review): close round 17 — restore the merged-away fake, publish t…
wenshao Aug 26, 2026
eef3c34
fix(review): close round 18 — ask git for the cone, make the cap idem…
wenshao Aug 26, 2026
0f70270
fix(review): close round 19 — only ENOENT is absence, undecodable is …
wenshao Aug 26, 2026
518d26f
fix(review): close round 20 — bool-typed fileMode, no directory in th…
wenshao Aug 26, 2026
146ab25
fix(review): close round 21 — measure the pointer, ride the skipped l…
wenshao Aug 27, 2026
60bb3ce
fix(review): close round 22 — a gitlink's identity is real, on both s…
wenshao Aug 27, 2026
e94892e
Merge remote-tracking branch 'origin/main' into p1
wenshao Aug 27, 2026
f1d9c62
fix(review): close round 23 — withhold over the dropped-out set, excl…
wenshao Aug 27, 2026
f425a8c
fix(review): keep this run's stop sidecar across its own cleanup
wenshao Aug 27, 2026
917e1d4
Merge remote-tracking branch 'origin/main' into p1
wenshao Aug 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,878 changes: 1,878 additions & 0 deletions packages/cli/src/commands/review/capture-local.incremental.test.ts

Large diffs are not rendered by default.

72 changes: 72 additions & 0 deletions packages/cli/src/commands/review/capture-local.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { DEADLINE_ENV } from './lib/deadline.js';

const captureMock = vi.hoisted(() => vi.fn());
const settingsMock = vi.hoisted(() => vi.fn(() => ({ merged: {} })));
const visibilityMock = vi.hoisted(() => vi.fn((): string[] | null => []));
vi.mock('../../config/settings.js', async (orig) => ({
...(await orig<Record<string, unknown>>()),
loadSettings: settingsMock,
Expand All @@ -27,6 +28,15 @@ vi.mock('./lib/local-diff.js', async (orig) => ({
...(await orig<Record<string, unknown>>()),
captureLocalDiff: captureMock,
}));
// The git layer is tested elsewhere (the integration suites run a real
// repository); the scratch directory here is not one. The visibility-bit
// oracle answers "no tracked path carries a bit" — the shape a clean tree
// has — because without an answer the stops must fail closed, and the
// tests below pin the clean claim.
vi.mock('./lib/local-anchor.js', async (orig) => ({
...(await orig<Record<string, unknown>>()),
invisibleTrackedPaths: visibilityMock,
}));

const { captureLocalCommand } = await import('./capture-local.js');

Expand Down Expand Up @@ -69,6 +79,8 @@ beforeEach(() => {
cwd = process.cwd();
process.chdir(dir);
errs = [];
visibilityMock.mockReset();
visibilityMock.mockReturnValue([] as string[]);
vi.spyOn(process.stderr, 'write').mockImplementation((chunk) => {
errs.push(String(chunk));
return true;
Expand All @@ -83,6 +95,40 @@ afterEach(() => {
rmSync(dir, { recursive: true, force: true });
});

describe('capture-local — the re-captures\u2019 skipped lists ride the guard', () => {
it('withholds the stop when only a RE-capture skipped content', () => {
// R21-2: the sampling loop kept only `.diff` from re-captures 1 and 2 —
// an unreviewable file entering the window lands in `skipped`, never in
// the diff BYTES, so the byte comparison read "held still" and the
// decided stops fired over content two of the three captures skipped.
// Skip-set movement is tree movement.
let call = 0;
captureMock.mockImplementation(() => {
call += 1;
return {
diff: Buffer.from('', 'utf8'),
untracked: [],
skipped:
call === 1
? []
: [{ path: 'huge.bin', bytes: 1, reason: 'over the cap' }],
unbornHead: false,
repoRoot: dir,
};
});
run('plan.json');

const plan = JSON.parse(readFileSync(join(dir, 'plan.json'), 'utf8'));
expect(plan.nothingToReview).toBeUndefined();
expect(existsSync(join(dir, '.qwen/tmp/qwen-review-local-stop.json'))).toBe(
false,
);
expect(errs.join('')).toContain(
'the working tree changed while the capture was being hashed',
);
});
});

describe('capture-local (command boundary)', () => {
it('writes the diff and a plan the review can read', () => {
capture();
Expand Down Expand Up @@ -209,6 +255,32 @@ describe('capture-local (command boundary)', () => {
expect(plan.effort).toBeUndefined();
});

it('withholds the cache candidate when the visibility bits cannot be enumerated', () => {
// The candidate records the identity of the tree this round reviewed;
// an oracle the capture cannot run leaves that identity uncertified, so
// the write fails closed exactly like the decided stops do.
capture();
visibilityMock.mockReturnValue(null);
run('plan.json');
expect(
existsSync(join(dir, '.qwen/tmp/qwen-review-local-cache-candidate.json')),
).toBe(false);
expect(errs.join('')).toContain('could not be enumerated');
});

it('withholds the cache candidate while tracked paths carry a visibility bit', () => {
// `hash-object` reads through a set --assume-unchanged/--skip-worktree
// bit while `git diff` cannot see the edit it hides — the candidate
// would record the identity of bytes this round never reviewed.
capture();
visibilityMock.mockReturnValue(['src/pay.ts']);
run('plan.json');
expect(
existsSync(join(dir, '.qwen/tmp/qwen-review-local-cache-candidate.json')),
).toBe(false);
expect(errs.join('')).toContain('the cache candidate is withheld');
});

it('escapes a filename carrying terminal control characters', () => {
// A filename is workspace-controlled, and git permits an ESC or a newline in
// one. Printed raw it can forge a second warning line or drive the user's
Expand Down
Loading
Loading