mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-08-09 16:56:27 +00:00
|
Some checks failed
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:none (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run
E2E Tests / web-shell Browser Regression (push) Waiting to run
SDK Python / Classify PR (push) Has been cancelled
SDK Python / SDK Python (3.10) (push) Has been cancelled
SDK Python / SDK Python (3.11) (push) Has been cancelled
SDK Python / SDK Python (3.12) (push) Has been cancelled
* feat(review): build the Step 4 verifier and Step 5 reverse-audit prompts in code
The last change moved Step 3's agent prompts into code — the diff path, the brief,
the roster, the delivery check — because a prompt the orchestrator retypes is one
that drifts, and dogfooding proved every drift. Step 4 (verify) and Step 5 (reverse
audit) were left composing their prompts from prose. They carry the densest
methodology in the skill, and it is the methodology most costly to drop:
- the verifier's one-way, quote-the-contradiction bar on rejecting a Critical, and
its documented-intent gate — the exact rule a run skipped when it auto-posted a
false "this PR now leaks AWS/GitHub tokens" Critical over a rationale three lines
up in the diff;
- the reverse auditor's gaps-only focus and substantive receipt.
Both are now `qwen review agent-prompt --role verify` / `--role reverse-audit` —
built in code, written to a brief file the agent reads, so the launch prompt the
orchestrator carries is short and the method cannot be paraphrased away. The
verifier is a new brief kind (`output: 'verdicts'`): it gets the Exclusion Criteria
but not the finding format, because it rules on findings rather than filing them. A
Step 3B reverse auditor takes `--chunk <id>` so it reads one chunk's range, not the
whole 5 800-line diff — the range that made it the most context-starved agent in the
pipeline.
The orchestrator still supplies the one input that changes per launch — the shard's
findings for the verifier, the cumulative finding list for the auditor — above the
verbatim brief, exactly as a dimension agent gets its one-line change summary.
NOT in this change, and called out so it is not mistaken for done: these agents run
after Step 3D, so the coverage gate's roster does not reach them. Whether the
verifier and auditor actually ran and read their briefs is not yet checked from the
transcripts the way Step 3's agents are. That check is the next step.
* fix(review): scope a per-chunk reverse auditor's brief to its one chunk
Dogfooding this PR, the /review skill's own reverse-audit agent found a defect
in it. A Step 3B reverse auditor is launched `--role reverse-audit --chunk N` so
it reads one chunk's range, not the whole diff — that scoping is the whole point:
a reverse auditor handed a 5 800-line diff is the most context-starved agent in
the pipeline, on exactly the PRs where the reverse audit matters most. The launch
prompt scoped correctly. The brief did not: `buildRoleBrief` gave every diff-reading
role the full `diffReadingBlock`, which emits a read for every chunk in the plan and
says "walk it chunk by chunk". The agent is told its brief is authoritative and that
nothing in the launch message replaces it — so it would read the whole diff the
`--chunk` design exists to spare it. The brief and the launch prompt disagreed on the
one thing the feature is about.
`diffReadingBlock` now takes an optional chunk id and, when given one, reads that
chunk alone — the same range the launch prompt reads — and drops the "walk it chunk
by chunk" instruction. `buildRoleBrief` threads the chunk through, exactly as an
invariant agent's brief is already scoped to its one file.
Which role may be launched per-chunk is now declared on the brief (`acceptsChunk`),
not hardcoded in the command guard as `role !== 'reverse-audit'`. A new per-chunk
role is a data change in agent-briefs, and the guard reads the same field the brief
builder does. Tests added for the fix and the coverage the review flagged: the
scoped brief reads one chunk not all; the handler accepts the one legal role+chunk
combo and keys its record `reverse-audit--chunk-N`; a non-existent chunk id is
rejected by name rather than emitting an unusable read.
* fix(review): finish the acceptsChunk story and de-duplicate the diff-window math
A second reverse-audit pass — the /review skill run on the previous commit — found
four gaps in it. All four are addressed here.
The guard was made data-driven (`!BRIEFS[role]?.acceptsChunk`) but its error message
still said "only for reverse-audit". If a second role ever sets `acceptsChunk`, the
guard would allow it while the message denied it. The message now names the set it
read from the briefs, so it cannot drift from what the guard enforces.
The record key derived from `--file` with no guard on it, while `--chunk` was guarded.
`--role reverse-audit --chunk 14 --file foo.ts` was accepted and keyed
`reverse-audit--foo.ts` — a file the agent never reads, colliding with and masking a
real file-keyed record. `--file` is the invariant agent's one scoping input; it is now
rejected on any role that is not an invariant agent, and on `--whole-diff`, closing the
asymmetry with the `--chunk` guard.
The 1-based-line-range → `{offset, limit}` arithmetic (`startLine - 1`,
`endLine - startLine + 1`) was written out at five sites. An off-by-one fix, or a
change in how `read_file` windows, would have had to land in all five. It is now one
`diffWindow(startLine, endLine)` helper the five call.
Tests: the message names the derived set; `--file` is rejected on a non-invariant role
and on `--whole-diff`; and the verify role — the one new role whose full handler path
was untested — is driven end-to-end through the handler, keyed `verify`, with the
verdict branch of its brief (Exclusion Criteria, no finding format).
|
||
|---|---|---|
| .. | ||
| src | ||
| index.ts | ||
| package.json | ||
| test-setup.ts | ||
| tsconfig.json | ||
| vitest.config.ts | ||