docs/spec/review/acceptance-checks.md
Acceptance checks
Section titled “Acceptance checks”Every change to this pipeline must leave all of these passing; before opening a pull request, run the ones the change touches and any it could regress.
The implementation pipeline’s Acceptance checks preamble carries one rule
that applies here unchanged: no check may expect a particular value from
config.json. The shipped file is asserted to be valid; every fixture
supplies its own repository_review block, or mutates
test/fixtures/config-base.json. Changing a threshold, a cadence or a
reviewed repository is a configuration change, and must not oblige anyone to
edit a test.
-
--dry-runcompletes against the real repos: the stand-down and skip-guard checks are evaluated, the Script prints which repos it would review, nothing further launches, andreview-log.jsonlrecords the run. -
A second invocation while the review lock is held exits without acting; and while the implementation
lock.jsonis held by a live process, the Review Script stands down. -
Skip-guard: with today’s report directory present on a repo’s default branch —
reviews/project-review-<today>/under the shipped fallback, or whatever that repo’s own resolvedreport_directorynames (R4a) — (or an openproject-review-labelled PR for it), that repo is skipped, and themin_days_between_reviewsboundary is respected. 4b. The role guard stands this pipeline down too (R2b).test/role.test.shpasses: areview-cycle.shwithAGENT_OPS_ROLEunset or standby exits 0 with one line and writes nothing understate_dir, while--dry-runruns regardless of the role. 4c. A peer’s usage-limit hit stands this pipeline down too (R2c/R6). With a peer’s materialised log carrying alimit-hitwhoseresume_atis in the future,review-cycle.shlogs areview-stand-down, exits 0 and clones nothing; its cleanup still pushes this node’s state to its own branch (test/state-sync.test.shcovers the shared machinery). 4a. The switch stands this pipeline down too (R2a). Withagent-cycle.sh --disable 'testing'set, a plainreview-cycle.shlogs areview-stand-downcarrying the reason, exits 0, and launches noclaude;--enablerestores it. Check this against the review script specifically and not by inference fromagent-cycle.shpassing — a shared switch that only one pipeline reads is the whole failure mode R2a exists to prevent, and it looks identical to a working one until the week a review fires into a half-editedlib/. The same one-pipeline-blind hazard applies to the fleet switch, sotest/toggle.test.sh‘s offline e2e runs the realreview-cycle.shagainst a setfleet/disabled.jsonand asserts thereview-stand-downnames it. 4d. The review-branch claim gates the review (R5.0).test/review-claim.test.shpasses: against a stubbedlib/claim.shseam (CLAIM_GH) and a fail-fastgh, a lost claim logsreview-skippednaming another node and never attempts a clone; a claim error skips the same way, fail closed; a won claim proceeds (the stub recordsclaim branch <slug> review/<date> <default-branch>in that order), and when the clone then fails,release branchis invoked for the same key — the leak the implementation pipeline fixed in its own workspace path (#55) must not be reintroduced here. 4e. Per-repository resolution, and duplicate slugs refused (R1b).test/config-schema.test.shpasses:config_repository_review_reposresolves an entry carrying onlyslugto every one ofrepository_review.defaults’ values, an entry setting a key to its own value for that key alone, and an explicitnullback to the default — including themodel_keyeach resolution names, which is what an unsupported provider is reported against (R1a).config_defaultsfabricates none of the overridable keys into arepos[]entry: a schemadefaulton one would materialise it in every entry, so the entry would always “set” it anddefaultscould never apply — which is why only the properties underdefaultsmay carry one. And a config naming the sameslugtwice exitsreview-cycle.sh1 before the lock, naming the repeated slug, whilescripts/doctor.shfails on the same config through the samelib/config-schema.shfunction. Check the refusal against the review script and not by inference fromdoctor.sh:uniqueItemscannot express this rule — it compares whole objects, so two entries for one repository carrying different overrides are distinct to it — so nothing else catches it, and the run would otherwise resolve that repository from whichever entry it happened to read last. 4f. The dated stand-down is two-tier (R3.3).test/review-not-before.test.shpasses: a futurerepository_review.defaults.not_beforestands the whole cycle down before the lock, with the date on the event; and with that key empty while every configured repository’s ownnot_beforeoverride is still in the future, the cycle stands down before the lock too, logging onereview-stand-downnaming issue #342. An emptyrepository_review.reposis vacuously not a stand-down. And the converse, which is what proves the two tiers are really two: with one repository held on its own override while another is free, neither tier fires, the cycle runs, and R4’s skip-guard turns the held repository away by name with its own date while the free one goes on to be claimed. Check that case specifically — anot_beforethat had quietly stayed cycle-wide passes every other assertion in that file and fails only this one, and the failure it stands for is a repository nobody asked to hold being held by its neighbour’s date. 4g. The report directory is configurable, and unset is unchanged (R4a).test/report-directory.test.shpasses: against a stubbedgh,report_directory_find_dirsdiscovers a format string’s existing instances — folding a leading static segment (docs/) into the one listing the fixed layout always made, and still resolving a format whose date component sits in a middle segment — andreport_directory_most_recentnames the latest of them with its own date, printing nothing where none exist.report_directory_regexescapes literal regex metacharacters in a format’s surrounding text and degrades an unrecognised specifier to a wildcard rather than failing. The degraded-read signal is covered too: a stubbed listing that fails exits nonzero from both functions, a clean 404 and a listing that matched nothing exit zero, and a multi-segment format whose walk fails partway still prints the candidates it did find — which is what proves the exit status is the whole signal and the printed output unchanged. Check the caller side specifically, because it is where getting this wrong costs a cycle rather than a value: the same… | cut -f<n>shape both silent-degrade callers use is driven as its ownbashprocess (errexit is not honoured inside a command substitution, so a probe wrapped in one reports every caller as surviving), asserting that the unguarded form really is killed by errexit on a failed walk while the guarded form degrades to empty, and thatreview-cycle.shandlib/candidate-gather.sheach carry the guard at their own call site.test/config-schema.test.shcovers the resolution: a repository’s ownreport_directorywins overrepository_review.defaults’, absent it inherits, and absent from both it resolves empty rather than fabricated — which is what leavesREPORT_DIRECTORY_DEFAULTthe single fallback. Check the unset case against a test that names no directory of its own:test/gather-project-review.test.shpasses unmodified, which is what proves an installation configuring neither key reads and writes exactly the paths it did before this requirement existed.The write path’s pinning (R4a) is checked by reading
review_one, no test reaching it without a full model run:report_dirresolves throughdate -u -d "$review_date", never a freshdate -u. A fresh call passes every test above and fails only a sequential run crossing midnight UTC — where the second repository’s report folder is dated a day after the branch, claim and PR title of the same review. 4h. Instructions and context reach the review, and a broken configured path never silently narrows one (R1c, R5 step 2a).test/review-context.test.shpasses:review_context_build_jsonresolves this repository’s ownreview_instructions/review_contextintoinstructions/contextentries attributedsource: "config", in configured order and ahead of therepo_context_fileentry attributedsource: "repository"; an oversized source is capped atREVIEW_CONTEXT_SOURCE_MAX_BYTESand markedtruncated; andreview_context_sources_digestreduces both arrays to a digest per source carrying notextfield.review_context_missing_configuredreports a configured path that names no readable regular file — a directory included, which is readable and would otherwise contribute a silently empty source — and reports nothing where neither key is configured.repo_context_fileis confined to the clone’s own bytes: a..in the configured path, a symbolic link (pointing out of the clone or back into it), and a path reached through a symlinked directory each contribute nothing, while the ordinary regular file the link pointed at is admitted as usual. Check the symlink cases specifically: the configured path is the installation’s, but the file it names is under the reviewed repository’s own control, and both-randhead -cfollow a link out of the clone — a bound on the path alone leaves D7’s boundary a statement about the path rather than about the text a model is handed.test/review-context-wiring.test.shpasses, which is what proves R1c is wired rather than merely available: a brokenreview_instructionspath exits the realreview-cycle.sh1 before the lock and before any repository is touched, naming the repository, the field, the configured path and what it resolved to; a brokenreview_contextoverride on one repository’s ownrepos[]entry refuses the same way, naming that repository and not its neighbour (the sweep reads issue #342’s resolved view, notdefaultsalone); and a path that does resolve, or neither key configured at all, ends the tick 0 with no refusal. Check the refusal against the review script and not by inference fromscripts/doctor.shpassing: a sweep written but never called, or called after the lock, satisfies the unit test and doctor’s assertions alike and still reviews every configured repository against less than the operator asked for.test/config-schema.test.shcovers the rest of the configuration surface: both keys are arrays of non-empty strings, never a bare string;repo_context_fileis a bare string; all three resolve on issue #342’s rule; andscripts/doctor.shturns the same detector’s report into afail, not thewarnaprompt_overridespath earns. -
Injected-skill isolation: after a real
--once --repo poeticrun, the review PR’s diff contains the newreviews/...folder but never a newtech-debt/*.mdfile (only an existing item’s frontmatter, where R12’s resolved-item bookkeeping touched one) and not.claude/skills/project-review/— confirm the injected skill is git-excluded and absent from the PR, and confirm any debt the review surfaced landed as issues instead:gh issue list --repo Poetic-Poems/poetic --label pw::type:tech-debt --state allshows a fresh issue per finding, each named under the PR body’sDefers:section. -
Usage-limit: an injected future
limit-hitonlog.jsonlstands the review down; and a simulated limit phrase in a transcript causes alimit-hitto be written tolog.jsonl. -
One supervised full run (
--once): for each non-skipped repo it produces a labelled, ready, mergeable review PR, with every item of debt it surfaced filed as apw::type:tech-debt-labelled GitHub issue in that repo (R12), named under the PR’sDefers:section, and a cleanreview-log.jsonltrail. Report the PR URL(s) to the human; merge nothing. -
Cross-references land (R12a): for every issue that run filed which mirrors a recommendation,
gh issue view <n> --json body --jq .bodycontains itsR-NN. Check this explicitly: it is invisible in the review’s own output — the reports look complete either way — and only shows up weeks later as the implementation pipeline paying to re-investigate recommendations that are already done. -
The untrusted-content framing holds for the Reviewer-Agent too (R18).
test/prompt-untrusted-framing.test.shpasses — it lifts the canonical block from docs/spec/implementation/requirements/every-stage.md requirement 45a and pinsprompts/project-reviewer.md’s copy byte-identical alongside the implementation pipeline’s own prompts. -
A stage-health verdict for
project-reviewer(R19, agent-ops#996).test/stage-health.test.shpasses:stage_health_verdictstold the review pipeline’s own event names reads areview-log.jsonl-shaped stream correctly — including the exit-0-but-failed join over the synthetic(review id, repo)-scopedcyclefield, and that two repositories reviewed under onereviewid do not cross-contaminate each other’s verdict — while the default event names stay blind to that same stream, proving the parameter is load-bearing, not decorative; and a customSTATUS_FILENAMEwrites its own file, leaving.stage-health.jsonuntouched.test/review-stage-health-wiring.test.shpasses: the shippedreview-stage-end/review-attempt-failedcalls carrystage, the syntheticcycle, and (the genuine-failure one)stage_failure: true;cleanup()computes the verdict fromreview_log_filenarrowed to["project-reviewer"], over this stream’s own event names, into.review-stage-health.json, before the state-sync push.test/state-sync .test.shpasses:.review-stage-health.jsondoes not replicate as a raw file, and its content reaches the heartbeat asreview_stage_health, a field of its own alongsidestage_health.test/publish-dashboard.test.shandtest/dashboard-render.test.shpass:status.review_stage_healthandfleet.nodes[].review_stage_healthread verbatim from the written file and a peer’s heartbeat respectively, and the page’s Review stage health section, its own page-top banner and its own fleet-strip badge render independently ofstage_health’s own — a node whose implementation- pipeline stages are all healthy whileproject-reviewerfails must read as failing too, never masked by the other panel’s green verdict.