Repository navigation
Conversation
Record recovered_pending_verification separately from the dispatch attempt, which keeps its failed outcome. Rows hold references only and reject updates and deletions. Refs #174
…ation A stage that omitted its structured result may advance to verification when exactly one trusted, attempt-attributed schema-2 receipt matches the repository, PR, stage, attempt and head SHA and does not contradict a BLOCKED or FAILED result. Recovered implement and resolve stages advance to review or rereview, which must confirm every claimed finding at the recovered head; a recovered review is re-dispatched once for a structured verdict. Recovery never infers APPROVED or READY_FOR_MANUAL_MERGE. Refs #174
|
Checks on head |
[CCR-20261007-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:1Initial review: PR #200 (work item #174)Status: Scope reviewedThe complete accumulated diff (982 lines, SHA-256 Project conventions applied: The change matches the stated invariant. A recovered stage only advances to verification. The verdict comes from a structured verifier result bound to the same repository, PR, stage, attempt, and head. The reviewer traced these paths:
Findings[REV-001] · low · open · - · blocks:no — The injected prompt never states the stage token the receipt must carry
The runtime appends "…with schema: 2, repo, change_request_id, stage, attempt_id…" but never says which [REV-002] · low · open · - · blocks:no — Run-line examples still show
|
| Command | Result |
|---|---|
python3 -m pytest tests/test_stage_recovery.py -q |
exit 0, 15 passed, 11 subtests passed |
python3 -m unittest discover -s tests |
exit 0, Ran 1175 tests … OK |
python3 scripts/validate-package.py |
exit 0, VALID: 15 skills … shared sections in sync |
gh api --help (flag check) |
--paginate --slurp is supported (gh 2.92.0) |
Unverified
- Windows:
StageRecoveryTestsis skipped there because theghfixture is a shebang script (only the parser test runs). Windows is covered only by the PowerShell installer CI job, not by these tests. - Real GitHub end-to-end recovery was not run. The tests drive a
ghfixture binary, so live API pagination and author metadata are unverified. - The prompt-injection text was read but not exercised against a real executor (see REV-001).
CI (head a5ceaa9)
gh pr checks 200 shows 4 passed and 0 failed or pending: Skills, manifests, and Bash installer ×2 and PowerShell installer ×2 (push and pull_request). .github/workflows/validate.yml defines these jobs and release.yml is not a PR gate. No expected check is missing.
Residual risks
- A recovered stage is trusted only as far as the same-login receipt, because
trusted_authorsis the operator's own account. The verification gate is the real control, and it is exercised by tests. - Historical comments without an
attempt_idare intentionally not recovered, as the PR states.
Verdict
APPROVED. blocking_findings: []. The three low findings can be addressed here or in a follow-up. No merge was performed.
Closes #174
Work item: #174 (depends on #172, closed via #195).
Summary
When a stage did its work but omitted its structured result, the runtime can now recover a conservative
recovered_pending_verificationstate from attempt-attributed PR-comment evidence and advance to verification instead of stopping. Recovery never infersAPPROVEDorREADY_FOR_MANUAL_MERGE.attempt_idinto implement/review/resolve/rereview prompts; skills publish a<!-- code-cycle-stage {JSON} -->receipt withrepo,change_request_id,stage,attempt_id, fullhead_sha,status, and explicitfinding_outcomes. Claimed IDs come only from this receipt, never from finding headers. Run-line examples now showschema:2; schema-1 lines stay readable.gh): reads the open PR and full paginated comment history, accepts onlyreview.trusted_authors, requires exactly one receipt matching repository, PR, stage, attempt and SHA, the checked-out head must equal the PR head, and anyBLOCKED/FAILEDreceipt or published result for that attempt vetoes recovery.implement→ review; recoveredresolve(including comment-only, no push) → rereview, whose structured result must report the recovered head and confirm or reopen every claimed ID. A reopened claim feeds the survivals ladder and normal resolution loop. A recovered review/rereview is re-dispatched once for a structured verdict; a second missing result stops.stage_recoveries(references only, triggers reject UPDATE/DELETE); thedispatch_attemptsrow staysfailed.Diagnosis
stage_not_completed; in Record verified work-item resolution outcomes #120 the fix was pushed and the PR comment published, but no structured block was emitted, so the cycle stopped and needed a manual--from rereview.run_cycle.advance→unfinished()stopped on any missing structured result (unreadable_result/no_error_report), and published evidence had no attempt attribution, so it could not be safely trusted.gitcheckout and aghfixture binary.advance()plus one append-only table; no new stage flag.implement(feature_request).Work units
WU-1scripts/telemetry.py,docs/telemetry.md,tests/test_work_item_outcomes.pytest_work_item_outcomes(schema 16)dependenton revert ofWU-2(WU-2 writes the table)WU-2scripts/review_contract.py,scripts/executors.py,scripts/run_cycle.py,skills/cc-{implement-issue,initial-review,resolve-comments,rereview}/SKILL.md,docs/review-cycle.md,CHANGELOG.md,tests/test_stage_recovery.pytests/test_stage_recovery.py(15 tests, 11 subtests): implement→review, comment-only resolve→rereview, reopened claim→second resolve + survivals, review/rereview redispatch once, unstructured verifier cannot approve, SHA/attempt/repo/PR/stage/BLOCKED rejections, untrusted & tokenless evidence, duplicate receipts, wrong verifier head/missing claim, remote head change, schema-15 upgrade,ghnon-zero exit, parserindependentVerification (agent-reported)
python3 -m pytest tests/test_stage_recovery.py -q→ exit 0, 15 passed, 11 subtests passedpython3 scripts/validate-package.py→ exit 0,VALID: 15 skills … shared sections in syncpython3 -m unittest discover -s tests→ exit 0,Ran 1175 tests … OKEnvironment: the recovery tests set their own Git identity and put a fixture
ghfirst onPATH; they share no global Git config or credentials with this machine. Theghfixture is a shebang script, soStageRecoveryTestsis skipped on Windows (the parser test still runs there). Local run was Linux/WSL only; Windows is covered only by CI.Notes
attempt_idtoken (e.g. the original Record verified work-item resolution outcomes #120 comment) is intentionally not recovered automatically, per the issue's attribution decision.