Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion skills/ce-code-review/references/dispatch-reviewers.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ This in-turn batch is **not** the forbidden pattern. What is banned is turning l

If the platform has no parallel sub-agent primitive at all, run the reviewers sequentially; stages, output format, and the merge pipeline are unchanged. Treat active-agent/thread/concurrency-limit spawn errors as backpressure (the host asking you to wait for capacity), not reviewer failure: a slot the host rejects for capacity stays queued and is retried in a later batch as active reviewers free capacity. A requested batch larger than the host cap clamps down to what the host accepts, dropping no reviewer. If queued reviewers cannot dispatch and neither active work nor supported release can recover capacity, proceed with the user-visible degraded/no-subagent review path. Do not shrink the roster, ask the user, or record a reviewer as failed for capacity backpressure. Record a reviewer as failed only after a successful dispatch fails, or when dispatch fails for a non-capacity reason that survives correcting the invocation. A reviewer pass performed in the parent context may contribute attributed evidence, but it is not independent: exclude it from `independent_reviewers`, never use its agreement for promotion, and name the lost independent coverage.

Before assembling any spawn prompt, read these three files from this skill's directory now: `references/subagent-template.md`, `references/diff-scope.md`, and `references/findings-schema.json`. They define the dispatch shape and the JSON contract every subagent needs, and you cannot construct a valid spawn without them. Read them and all selected persona prompt assets in one parallel read-tool wave rather than one turn per file.
Before assembling any spawn prompt, read these three files from this skill's directory now: `references/subagent-template.md`, `references/diff-scope.md`, and `references/findings-schema.json`. They define the dispatch shape and the JSON contract every subagent needs, and you cannot construct a valid spawn without them. Read each required reference and selected persona asset with its own file-read call. When the host supports parallel calls, issue them together in one message. Never join files into one shell output. On serial hosts, read one file per turn.

For each selected reviewer, and only for those, read the corresponding local prompt asset from `references/personas/<reviewer-name>.md` and spawn a generic subagent using the subagent template. Do not use `subagent_type`, typed `Agent` names, or platform-level CE agent registration. Each persona subagent receives:

Expand Down
9 changes: 8 additions & 1 deletion tests/ce-code-review-mechanics.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mkdtempSync, mkdirSync, writeFileSync, chmodSync } from "fs"
import { mkdtempSync, mkdirSync, writeFileSync, chmodSync, readFileSync } from "fs"
import { tmpdir } from "os"
import path from "path"
import { spawnSync } from "node:child_process"
Expand Down Expand Up @@ -34,6 +34,13 @@ function fixtureRepo() {
}

describe("ce-code-review deterministic mechanics", () => {
test("Stage 4 never joins dispatch assets into one shell output", () => {
const dispatch = readFileSync(path.join(SKILL_DIR, "references", "dispatch-reviewers.md"), "utf8")
const instruction = dispatch.split("Before assembling any spawn prompt,")[1]?.split("\n\n")[0] ?? ""

expect(instruction).toMatch(/never join files into one shell output/i)
})

test("scope helper counts structured text toward changed_lines and does not hard-block on markdown", () => {
const { dir, base } = fixtureRepo()
mkdirSync(path.join(dir, "docs"))
Expand Down
Loading