Skip to content

feat: durable recovery checkpoints and quota handoff for writing stages (#503) - #554

Merged
datacas merged 13 commits into
mainfrom
feat/503-durable-checkpoints
Dec 1, 2026
Merged

datacas merged 13 commits into
mainfrom
feat/503-durable-checkpoints

Conversation

@datacas

@datacas datacas commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Closes #503
Closes #525
Absorbs #525 (its AC-1 to AC-5 are #503's AC-9 to AC-13).

Work item: #503

Summary

An interrupted implement or resolve stage now keeps its exact worktree in a durable, scoped recovery checkpoint, and a quota stop hands that same worktree to the configured fallback once, in the same stage, instead of stopping with dirty_workspace or workspace_changed.

  • scripts/recovery_checkpoints.py (new, in the runtime manifest): Git objects behind private refs/code-cycle/recovery/<id> refs, metadata in the telemetry store next to the attempt history. The intent row is written before any object, the ref after every object, and complete after the ref. Crash reconciliation and duplicate captures are idempotent. Verification, restore (clean worktree only), secret exclusion that fails closed, lifecycle retention with explicit prune --dry-run, a toolkit writer lock, and explicit single-use operator_adopted adoption.
  • scripts/cycle.py: a baseline checkpoint when an attempt opens; a checkpoint on interruption and on quota; the #525 checkpoint gate in the reroute decision; re-verification of the worktree just before the fallback starts; the writer lock around each writing attempt; adoption as the second provenance a dirty --from resume accepts; and consumption and terminal marking for retention.
  • scripts/cycle_dispatch.py: a stage whose executors all ran out of quota ends BLOCKED and names every reset time.

Diagnosis

Work units

Unit Behaviour Files Tests Verification Rollback
WU-1 Durable scoped checkpoints: capture, integrity, restore, secrets, retention, writer lock, adoption, operator CLI scripts/recovery_checkpoints.py, scripts/cycle_journal.py, scripts/runtime.manifest, scripts/run_cycle.py, docs/recovery-checkpoints.md, docs/README.md, docs/configuration.md, docs/telemetry.md tests/test_recovery_checkpoints.py (26), tests/test_run_cycle.py (KnownKeyTests) see Verification independent (9a3b6be)
WU-2 Quota handoff in writing stages (#525), writer lock and checkpoints in the stage loop, adoption on resume, BLOCKED when every executor is exhausted scripts/cycle.py, scripts/cycle_dispatch.py, scripts/telemetry.py, docs/routing.md, docs/review-cycle.md, docs/instrumentation.md, docs/capability-parity-audit.md, CHANGELOG.md tests/test_quota_handoff.py (12), tests/test_quota_resume.py (25, fixture adjusted) see Verification dependent on WU-1 (revert together, or WU-2 first); commits fbaa6ad, be91c43

Private refs that existing checkpoints created stay in local repositories after a revert, and nothing reads them. git for-each-ref refs/code-cycle/recovery/ --format='delete %(refname)' | git update-ref --stdin removes them.

Verification (agent-reported)

Head under test: be91c436bd2259e2fecd676169180d5de305e67a. Checks were frozen against AC-1 to AC-13 before they ran. Results are agent-reported (tests.version: 2).

Check Command Required Criteria Result
configured-test python3 -m unittest discover -s tests yes AC-1 to AC-13 pass: exit 0, 2856 tests, 1 skipped, 681.7 s
validate-package python3 scripts/validate-package.py yes AC-13 pass: exit 0, VALID: 16 skills
basedpyright basedpyright yes — pass: exit 0, 0 errors
unittest-default python3 -m unittest no — exit 0, 0 tests executed: discovery from the repository root finds none, so this is no evidence; configured-test covers the suite
recovery-checkpoints python3 -m unittest tests.test_recovery_checkpoints yes AC-1 to AC-7 pass: exit 0, 26 tests
quota-handoff python3 -m unittest discover -s tests -p test_quota_handoff.py yes AC-1, AC-3, AC-4, AC-8 to AC-13 pass: exit 0, 12 tests
quota-resume python3 -m unittest discover -s tests -p test_quota_resume.py yes AC-3, AC-7 pass: exit 0, 25 tests
  • An earlier full run on fbaa6ad had 1 failure and 1 error. Both came from the new modules missing from scripts/windows-test-shards.json; this was fixed in be91c43. tests.test_validate_workflow and tests.test_fast_path were then rerun (53 tests, OK), and so was the full suite above.
  • The full suite takes longer than the 600 s foreground limit. The harness moved it to the background, and its exit was awaited and read before it was reported here.
  • Assumptions shared with CI: the tests create their own temporary repositories and set a local Git identity and commit.gpgsign=false, with no global Git identity or credentials. Not shared: Windows behaviour (the lock's dead-process path and POSIX modes are skipped there) is left to the Windows CI shards.
  • AC-7 (no approval, no skipped checks, Core principle: agent capability parity - the toolkit must not restrict what the agent can run #450) is covered by the prompt and stop texts asserted in the tests, the parity-audit tests (PA-53, PA-54) and the docs. It is a contract, not a runtime behaviour that can be exercised further.

Documentation reviewed

  • Updated: docs/routing.md (new Quota handoff in a writing stage section; dirty --from resumes accept an operator adoption), docs/recovery-checkpoints.md (new owning page), docs/README.md (index), docs/review-cycle.md (interrupted writing stages; no approval, no skipped checks), docs/telemetry.md (recovery tables), docs/instrumentation.md (new reroute_reason tokens), docs/configuration.md (recovery.secret_paths, the refs and the lock as local files), docs/capability-parity-audit.md (PA-53 writer lock, PA-54 automatic-handoff stop, new broad handlers), CHANGELOG.md.
  • Reviewed, no change needed: README.md (no skill or entry point added or removed; the operator CLI is documented on its owning page, like quota_state.py), CONTRIBUTING.md, AGENTS.md, SECURITY.md, issue and PR templates, skill SKILL.md files (no stage contract changed).
  • Before this PR, none of this behaviour was documented: routing described only Route around recorded quota exhaustion and hand partial work to the fallback on resume #389's same-HEAD resume.

Residual risk and limits

  • Locks exclude other toolkit writers only. As documented, they cannot attribute edits made by an editor or another tool; the fallback re-verifies the checkpoint immediately before it starts.
  • Path and content secret exclusion reduce exposure but cannot guarantee that every secret is detected. A false positive makes a checkpoint incomplete, which stops the automatic handoff, so it fails safe.
  • Windows still has no process-group exit proof, so a quota stop there still stops.
  • The automatic handoff needs the dispatch cwd to be a Git worktree. Without one, the earlier reconciliation is unchanged, and the characterization fixture is identical.

Add scripts/recovery_checkpoints.py. A checkpoint records the exact staged,
unstaged and eligible untracked state of a worktree as Git objects behind a
private refs/code-cycle/recovery/<id> ref, built through private index files
so the real index, worktree and branch are never touched. Metadata extends
the telemetry store, bound to repository, task, change request, cycle, stage,
attempt, workspace, branch, HEAD, secret-rule digest and parent checkpoint.

Intent is persisted before any object and a checkpoint completes only after
its ref; reconcile_pending finishes or fails what a crash left, and the same
logical capture is never recorded twice. Verification reports corrupt
metadata, missing refs or objects, wrong scope, a changed HEAD and later
edits without modifying anything; restore refuses a dirty worktree.

Secret paths (versioned defaults plus code_cycle.recovery.secret_paths),
credential content (the journal's existing detector, now exposed as
contains_credential) and ignored files are never captured and fail closed;
excluded or unsupported content makes a checkpoint incomplete. Retention is
lifecycle-based with explicit, idempotent prune and --dry-run. A writer lock
excludes other toolkit writers only. Operators can inspect, restore, adopt
(operator_adopted, single use), discard, prune and unlock.
…point (#503, #525)

An implement or resolve stage in a Git worktree now takes a baseline
checkpoint when its dispatch attempt opens, and another when it is
interrupted or runs out of quota. A quota stop hands the same worktree to the
configured fallback once, in the same stage, when the checkpoint is complete,
the process exited, the starting state was known, HEAD only moved forward and
no remote or publication changed. Local commits no longer stop it with
dirty_workspace or workspace_changed. The worktree is re-verified against the
checkpoint just before the fallback starts, and the fallback is told the
checkpoint, original executor and local commit count, and that the handoff is
not functional verification.

When the fallback is exhausted as well the stop names every reset time and
the driver ends BLOCKED. Telemetry records reroute_reason checkpoint_handoff
or checkpoint_incomplete and a recovery/quota_handoff journal event with the
checkpoint, executors, heads, local commits, fingerprint and reset time.

A toolkit writer lock refuses a second toolkit writer before dispatch. A
dirty --from resume also accepts an explicit operator adoption of the exact
worktree, consumed once. Completed stages consume their checkpoints and a
closed cycle marks them terminal for explicit pruning.

Docs: routing (automatic handoff), review-cycle, instrumentation, telemetry,
configuration and the capability-parity audit (PA-53, PA-54, new handlers).
Also guard is_ancestor against a missing recovery root for basedpyright; checkpoint and root are always set together, so behaviour is unchanged.
@datacas

datacas commented Nov 29, 2026

Copy link
Copy Markdown
Owner Author

Implementation summary (#503, absorbs #525)

IMPLEMENTED on be91c436bd2259e2fecd676169180d5de305e67a.

  • New scripts/recovery_checkpoints.py: durable, scoped checkpoints behind private refs/code-cycle/recovery/<id> refs, with crash-idempotent capture, integrity verification, restore onto a clean worktree only, fail-closed secret exclusion, lifecycle retention and an explicit prune, a toolkit writer lock, and single-use operator_adopted adoption.
  • A quota stop of an implement or resolve stage hands the same worktree to the configured fallback once, from a complete checkpoint and including local commits. When every executor is exhausted, the cycle stops BLOCKED naming each reset time.
  • Verification (agent-reported): configured-test passed (2856 tests, 1 skipped). validate-package, basedpyright and the targeted modules also passed. python3 -m unittest exited 0 but executed 0 tests, so it is not evidence. Details are in the PR description.
  • Checks of the pushed head at the time of reading: Classify the change and Skills, manifests, and Bash installer were queued. The cycle's CI gate decides them.

Run: implement · profile deep_coder · requested anthropic/claude-opus-5-5 · effort high · resolved ?

@datacas

datacas commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20261130-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

REVIEW_PASSED_AWAITING_CI for be91c43; this is not an approval. The full accumulated diff (2898 lines, 21 files) was reviewed. No finding blocks approval, and 3 low findings are open.

  • REV-001 (low): stale-lock reclaim in WriterLock.acquire can move a live writer's fresh lock aside, so two writers may both hold it. Fix: re-check the holder before the rename. Test: two racing acquirers.
  • REV-002 (low): adopt --stage is stored but never matched, so an implement adoption can never be consumed and pins its checkpoints from pruning. Fix: match on stage or reject implement.
  • REV-003 (low): the BLOCKED status wiring of AC-11 (Quota exhaustion in a writing stage stops the cycle with dirty_workspace instead of handing the worktree to the fallback #525 AC-3) is untested; only its helper is. Fix: test StageDispatch.unfinished.

Local checks on this head pass: full suite 2856 tests, validate-package.py, basedpyright. CI: Windows shard 4 and the PowerShell installer failed; the CI gate decides. Security audit: skipped after triage (details below).

Review details, findings, verification, CI and receipt

Scope. CHANGELOG.md, 8 pages in docs/, scripts/{cycle,cycle_dispatch,cycle_journal,recovery_checkpoints,run_cycle,telemetry}.py, runtime.manifest, windows-test-shards.json, 4 test files. Compared with origin/main (merge base f79a121). The cc-pr-review, cc-security-review and cc-verify passes were not loaded as delegated skills; the equivalent review and verification were done inline with the repository's own tools, so the review pass ran degraded.

[REV-001] · low · open · - · blocks:no — Stale-lock reclaim can evict a live writer's lock

scripts/recovery_checkpoints.py:926-931. Two acquirers both read a dead holder. A reclaims it (os.replace to evidence) and creates its new lock with O_EXCL. B then runs os.replace(self.path, evidence) on that fresh lock, loops, creates its own lock, and both proceed as sole writer. This weakens the exclusion promised by AC-4. The same-process branch (:910-914) also lets a second WriterLock in one PID replace a held lock. Evidence: code inspection only; the interleaving was not reproduced by execution.

[REV-002] · low · open · - · blocks:no — Adoption --stage is recorded but unenforced; an implement adoption is unusable

scripts/recovery_checkpoints.py:658-671 (match_adoption has no stage filter) and scripts/cycle.py:1017-1020 (_match_handoff returns early when started_from == "implement"). adopt --stage implement is accepted, but no resume can consume it, and prunable keeps every checkpoint with an unconsumed adoption forever. A resolve resume can also consume an adoption made for another stage. docs/recovery-checkpoints.md documents the stage-less binding but lists implement as a valid --stage.

[REV-003] · low · open · - · blocks:no — AC-3 BLOCKED status is not exercised end to end

tests/test_quota_handoff.py:185 asserts the stop detail and calls quota_exhausted_everywhere(outcome) directly. Nothing runs StageDispatch.unfinished, so the status="BLOCKED" selection at scripts/cycle_dispatch.py:428 has no test. The helper also applies to every stage role, including read-only ones; docs/routing.md describes it only for writing stages.

Acceptance criteria. AC-1 to AC-13 map to checks as follows. The full suite covers all of them; tests/test_recovery_checkpoints.py covers AC-1 to AC-6, tests/test_quota_handoff.py covers AC-8 to AC-13, and tests/test_quota_resume.py covers AC-3 and AC-7. AC-7 is a contract: the prompts and stops state it, PA-53 and PA-54 record it, and no runtime behaviour beyond that can be exercised. AC-11 is covered except the wiring in REV-003.

Verification (run locally on be91c43, foreground).

Check Command Result
configured-test python3 -m unittest discover -s tests pass: exit 0, 2856 tests, 1 skipped, 637 s (the harness moved it to the background after 600 s; its exit was read)
verify:python3 scripts/validate-package.py python3 scripts/validate-package.py pass: VALID: 16 skills
verify:basedpyright basedpyright pass: 0 errors, 0 warnings
verify:python3 -m unittest python3 -m unittest exit 0 but 0 tests discovered: no evidence, configured-test covers the suite
extra python3 -m unittest discover -s tests -p test_recovery_checkpoints.py pass: 26 tests
extra ... -p test_quota_handoff.py pass: 12 tests
extra ... -p test_quota_resume.py pass: 25 tests
extra ... -p test_fast_path.py pass: 42 tests

Not verified: Windows behaviour (lock liveness probe, POSIX modes), and the REV-001 race by execution.

CI (head be91c43, policy parallel, read once). Passed: Classify the change, Skills/manifests/Bash installer, Windows test shard (windows-1, windows-2, windows-3). Failed: Windows test shard (windows-4), PowerShell installer. windows-4 is the shard that now lists test_quota_handoff and test_recovery_checkpoints; the failure log was not readable from this stage, so its cause is unknown. The latest Validate package runs on main passed. This is a CI state, not a finding.

Security triage. The deterministic rule did not fire: no CI workflow, .env/key file, agent or toolkit configuration, or sensitive label is changed. Reviewer reading: the change handles secrets only by excluding them, adds a local operator CLI and a local lock, and exposes no remote input or authorization boundary. Not a sensitive change: the security audit was skipped after triage. The secret-exclusion logic was read within the correctness pass; its limits are the documented ones (published credential formats and listed paths only).

Documentation. Owning pages updated (recovery-checkpoints.md, routing.md, review-cycle.md, telemetry.md, instrumentation.md, configuration.md, capability-parity-audit.md, docs/README.md, CHANGELOG.md); README.md correctly unchanged; the PR description lists the documentation reviewed. #450: the automatic path alone stops, and PA-53/PA-54 record no toolkit veto.

Residual risks. A pending row left by an abrupt kill is reconciled only by inspect; a reconciled row has no fingerprint, so it can never match a worktree (it fails safe). Locks cannot attribute external edits (disclosed). Credential content detection covers published token formats and private keys only.

@datacas

datacas commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

BLOCKED before triage: review finding IDs collide. PR head remains be91c436bd2259e2fecd676169180d5de305e67a. No source changes, fixes, commits or uploads were made in this attempt.

Provider-authenticated comments by datacas assign different defects to REV-001, REV-002 and REV-003. The resolver contract requires a stop rather than silently renumbering or treating the latest comment as a replacement snapshot. The coordinator needs one decision: authorize the consolidated mapping below, or explicitly supersede the earlier reviews with the latest review alone.

Collision evidence, proposed mapping, verification and receipt

Recovery evidence

Read the complete PR comments in chronological order through gh pr view, with provider authors and publication dates. The configured trusted author is datacas; all five comments are by that author. gh api graphql reports no review threads. Local branch feat/503-durable-checkpoints is clean and its HEAD equals the current PR head. The supplied accumulated diff has 2,898 lines; its contents were not reviewed because finding-state recovery stopped first. Publication preflight completed successfully inside this sandbox; it is not upload evidence.

Comment REV-001 REV-002 REV-003
First findings Adoption scope Permission rerun after quota handoff Missing driver BLOCKED test
Second review Permission rerun after quota handoff Reconciled checkpoint fingerprint Retention documentation
Third review Adoption scope Same-process lock re-entry Absent
Latest review Stale-lock reclaim Adoption scope Missing driver BLOCKED test

These are different root causes, not merely title or severity edits. The first comment also assigns REV-004 to retention documentation and REV-005 to stale-lock reclaim. Omitting those IDs in later comments does not remove them.

Proposed mapping, awaiting explicit authorization

Preserve the earliest assignment of each ID and consolidate duplicate reports by root cause:

Proposed ID Defect
REV-001 Adoption stage binding, including the unusable implement adoption
REV-002 Permission-answer rerun reuses the stale quota checkpoint
REV-003 Missing StageDispatch.unfinished BLOCKED regression test
REV-004 Retention documentation disagrees with pruning
REV-005 Stale-lock reclaim can displace a live writer
REV-006 Crash-reconciled checkpoint has no usable fingerprint
REV-007 Same-process writer-lock re-entry

This table is a proposal only. No finding was triaged, renumbered, resolved, or declared not applicable in this attempt. The source findings retain their original headers in the linked comments. No triage run line is emitted because triage did not complete.

Verification and remaining obligations

No functional verification ran; configured-test remains required and unverified. All AC-1 through AC-13 remain open in this attempt, with no executed check linked to them. Prior tests and CI are historical evidence only. No post-change review or security audit ran; no source change was made. The runtime plan has security_required=false. Existing CI failures remain undiagnosed and require investigation after recovery. No pushed-head checks are claimed.

Skill stop rule: “Return BLOCKED when two non-empty titles identify different findings with one ID, whether they appear in one trusted comment or across the trusted history.” Source: /home/datacas/.agents/skills/cc-resolve-comments/SKILL.md, Structured review state / The change-request comment is the machine-readable record.

… failure

An implement resume journals a failed adoption lookup and continues with its --continue behaviour; a writer-lock release failure is journaled instead of masking the stage outcome. The racing reclaim test marks the killed holder dead portably for Windows, and the BLOCKED wiring test passes an empty Reported. (#503)
A resume outside a Git worktree keeps its previous journal unchanged. The broad-handler inventory lists _release_writer and the second _match_handoff handler. (#503)
@datacas

datacas commented Dec 1, 2026

Copy link
Copy Markdown
Owner Author

[CCT-20261201-001] · deep_coder · anthropic/claude-opus-5-5→? · high · triaged:be91c436bd2259e2fecd676169180d5de305e67a · schema:2

RESOLVED at 1289117; this is not an approval. All 3 findings were valid and are now resolved.

  • REV-001: racing stale-lock reclaim and same-PID re-entry. Fix: an OS guard file plus an ownership token on release. Test: two racing processes; same-process replace.
  • REV-002: adoptions now bind to their stage. A clean tree with local commits is adoptable, and implement consumes its own adoption. Test: stage match per role.
  • REV-003: a test now drives StageDispatch.unfinished to BLOCKED; the routing doc covers read-only stages.

Fix-delta review follow-ups: a failed adoption lookup or lock release is journaled and never vetoes (#450).

Checks: configured-test passed with 2864 tests. basedpyright and validate-package passed. CI had not started when read.

Triage, verification, history and receipt

[CCR-20261130-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

[REV-001] · low · resolved · valid · blocks:no — Stale-lock reclaim can evict a live writer's lock

scripts/recovery_checkpoints.py WriterLock. Acquire, stale replacement, release and unlock serialize on a persistent code-cycle-writer.lock.guard (fcntl/msvcrt) plus a thread lock. Same-PID re-entry is removed, and release checks a per-instance lock_id. Reproduced on be91c43: the racing test's second writer printed acquired; it is now rejected. Commits d08d909, 80a3652 (Windows-portable reclaim assertion).

[REV-002] · low · resolved · valid · blocks:no — Adoption --stage is recorded but unenforced; an implement adoption is unusable

match_adoption filters on stage. _match_handoff looks up an adoption first for implement and resolve, including a clean tree with local commits, and only in a Git worktree. A lookup failure is journaled as adoption_lookup_failed and treated as no adoption. Reproduced on be91c43: resolve consumed an implement adoption, and an implement adoption was never consumed. Commits d08d909, 80a3652, 1289117.

[REV-003] · low · resolved · valid · blocks:no — AC-3 BLOCKED status is not exercised end to end

tests/test_quota_handoff.py drives StageDispatch.unfinished and asserts BLOCKED, dispatch_failed and both reset times. docs/routing.md states that the rule also applies to read-only stages. Commits d08d909, 80a3652.

Recovery. The prior attempt attempt-d1c7d7c4114b4a51b6ee6b18e4a8f905 left commit d08d909 unpublished, and no comment carries its receipt. That commit was reused, not recreated. The REV ID collision reported by attempt attempt-45dc5a3e… no longer exists: the trusted history now holds one review comment, so its IDs are authoritative.

Fix-delta review (base be91c43, an ancestor of HEAD; delegated pass):

  • P2: implement-resume veto on lookup failure. Fixed, with a regression test.
  • P2: Windows-flaky reclaim assertion. Fixed.
  • P3: release() could mask the stage outcome. It is now journaled as lock_release_failed, with a test.
  • P3 note: an adoption takes precedence over a quota handoff for a dirty resolve tree. This is now documented.

The full suite also caught a characterization regression: the adoption lookup ran outside a Git worktree. It is now guarded, and inventory rows were added.

Verification (agent-reported, local, foreground, head 1289117).

Check Command Result
configured-test python3 -m unittest discover -s tests pass: exit 0, 2864 tests, 1 skipped, 686 s (the harness moved it to background at 600 s; exit read)
verify:basedpyright basedpyright pass: 0 errors
verify:python3 scripts/validate-package.py python3 scripts/validate-package.py pass: VALID: 16 skills
verify:python3 -m unittest python3 -m unittest exit 0, 0 tests: no evidence
targeted recovery, quota and precheck modules pass: 88 tests

Environment: the local run shares Python, Git and POSIX with the Ubuntu CI. Windows behaviour (msvcrt guard, process liveness) was not run locally; the windows-4 shard covers it.

CI (head 1289117, policy parallel, read once): no checks were registered yet. Earlier be91c43 failures (windows-4, PowerShell installer) remain undiagnosed here; the CI gate decides.

Security: the deterministic rule did not fire (no CI, key or agent-config paths). The change is a local lock and lookup only, so the audit was skipped.

Documentation reviewed: docs/recovery-checkpoints.md was updated (guard, journal statuses, adoption precedence). docs/capability-parity-audit.md was updated (PA-53, inventory rows). docs/routing.md and docs/configuration.md were updated (guard file). README.md and AGENTS.md needed no change.

Run: resolve · profile deep_coder · requested anthropic/claude-opus-5-5 · effort high · resolved ?

…kpoints

# Conflicts:
#	docs/capability-parity-audit.md
@datacas

datacas commented Dec 1, 2026

Copy link
Copy Markdown
Owner Author

[CCT-20261201-002] · deep_coder · anthropic/claude-opus-5-5→? · high · triaged:1289117dbebe84aa2474f30e2f930a9e2a4f984b · schema:2

RESOLVED at c078143; this is not an approval. No new review findings: REV-001 to REV-003 stay resolved (no change this round).

This round: the PR was CONFLICTING with main, so no CI ran on 1289117. Merged origin/main (df69021) into the branch.

Checks: configured-test passed with 2880 tests. basedpyright and validate-package passed. CI: no checks were registered on c078143 when read, and GitHub still reported mergeability as UNKNOWN.

Triage, verification, history and receipt

[CCT-20261201-001] · deep_coder · anthropic/claude-opus-5-5→? · high · triaged:be91c436bd2259e2fecd676169180d5de305e67a · schema:2

[CCR-20261130-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

[REV-001] · low · resolved · valid · blocks:no — Stale-lock reclaim can evict a live writer's lock

No change this round. Fixed in d08d909, 80a3652 (see the previous resolution comment).

[REV-002] · low · resolved · valid · blocks:no — Adoption --stage is recorded but unenforced; an implement adoption is unusable

No change this round. Fixed in d08d909, 80a3652, 1289117.

[REV-003] · low · resolved · valid · blocks:no — AC-3 BLOCKED status is not exercised end to end

No change this round. Fixed in d08d909, 80a3652.

Triage. Triage commit 1289117. The trusted history (author datacas) holds one review comment (CCR-20261130-001). No review or rereview was published after the previous resolution, and no review threads exist. The three dispositions are frozen as valid. The only work this round was the base-branch conflict.

Merge review. The conflict resolution was compared with 1289117. The only non-base change is the PA renumbering above. main's PA-53 rows (Vetoes and the parity baseline) and the PA-53 references in docs/native-parity-runs.md refer to #550 and are unchanged. Nothing else in this branch cites PA-53 or PA-54. scripts/cycle.py and scripts/windows-test-shards.json merged automatically: main adds an MCP-tool guard in the refusal path and the test_claude_stage_refusals shard entry, and neither touches the code this PR changes. Delta base be91c43 is an ancestor of the new head. The earlier fix delta was reviewed by the previous resolution; this round adds only the merge.

Verification (agent-reported, local, foreground, head c078143).

Check Command Result
configured-test python3 -m unittest discover -s tests pass: exit 0, 2880 tests, 1 skipped, 762 s (the harness moved it to the background at 600 s; its exit was read)
verify:basedpyright basedpyright pass: 0 errors, 0 warnings
verify:python3 scripts/validate-package.py python3 scripts/validate-package.py pass: VALID: 16 skills
targeted python3 -m unittest tests.test_capability_parity_audit tests.test_precheck_causes tests.test_claude_stage_refusals tests.test_recovery_checkpoints tests.test_quota_handoff pass: 82 tests
targeted python3 -m unittest tests.test_validate_package tests.test_read_parity pass: 97 tests

Environment: the local run shares Python, Git and POSIX with the Ubuntu CI. Windows behaviour was not run locally.

Security: the deterministic rule did not fire on this round's change (documentation only); no audit.

Documentation reviewed: docs/capability-parity-audit.md was updated (renumbering). The PR description and earlier comments still name the writer lock and quota handoff PA-53 and PA-54; they now read PA-54 and PA-55 in the repository. README.md, AGENTS.md and the other owning pages needed no change.

Run: resolve · profile deep_coder · requested anthropic/claude-opus-5-5 · effort high · resolved ?

@datacas

datacas commented Dec 1, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20261201-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

REVIEW_PASSED_AWAITING_CI for c078143; this is not an approval. The full accumulated diff (3154 lines, 21 files) was reviewed again. No finding blocks approval and no new finding was found.

  • REV-001, REV-002, REV-003: resolved, each reproduced by execution (tests below), no regression found.
  • CI: windows-4 and PowerShell installer failed; their logs were not readable from this stage. The CI gate decides.
Rereview details, findings, verification, CI and receipt

[CCR-20261130-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

[REV-001] · low · resolved · valid · blocks:no — Stale-lock reclaim can evict a live writer's lock

WriterLock now serializes acquire, stale replacement, release and unlock on a persistent .guard file (OS advisory lock plus a thread lock). Same-PID re-entry is removed and release checks a per-instance lock_id. Verified: WriterLockTests.test_racing_stale_reclaim_does_not_evict_a_live_writer (second writer rejected) and test_same_process_cannot_replace_or_release_another_instances_lock pass. I found no path that re-enters the guard or deadlocks. A guard or release failure is journaled and never vetoes the stage (#450).

[REV-002] · low · resolved · valid · blocks:no — Adoption --stage is recorded but unenforced; an implement adoption is unusable

match_adoption filters on stage; _match_handoff consults adoptions for implement and resolve (clean trees with local commits included), only with a Git worktree, and treats a lookup failure as no adoption (adoption_lookup_failed). Without an adoption implement keeps its earlier behavior, and a dirty resolve without one still blocks as before. Verified: test_adoption_matches_only_the_named_stage and the stage-match tests in tests/test_quota_handoff.py pass.

[REV-003] · low · resolved · valid · blocks:no — AC-3 BLOCKED status is not exercised end to end

tests/test_quota_handoff.py now drives StageDispatch.unfinished to BLOCKED with both reset times, and docs/routing.md states that the rule also covers read-only stages. Verified by execution.

Scope of this round. Fix delta be91c43..1289117 (lock guard, adoption stage binding, journaling) and the merge of origin/main at c078143 (only docs/capability-parity-audit.md renumbering PA-53/PA-54 to PA-54/PA-55). Compared with origin/main (merge base df69021). The delegated cc-pr-review and cc-verify passes were not loaded as skills; the equivalent review and verification ran inline, so they ran degraded.

Verification (agent-reported, local, foreground, head c078143).

Check Command Result
configured-test python3 -m unittest discover -s tests pass: exit 0, 2880 tests, 1 skipped, 903 s (the harness moved it to the background after 600 s; its exit was read)
verify:basedpyright basedpyright pass: exit 0, 0 errors, 0 warnings, 0 notes
ref-8ccc5e4478464d6ddcde25c59b2c6e895e5e6f1ea520b62dd0f6b48a0bd44048 python3 scripts/validate-package.py pass: VALID: 16 skills
recovery-quota-modules python3 -m unittest tests.test_capability_parity_audit tests.test_precheck_causes tests.test_claude_stage_refusals tests.test_recovery_checkpoints tests.test_quota_handoff pass: exit 0, 82 tests (AC-1 to AC-6, AC-8 to AC-13)
quota-resume-contract python3 -m unittest discover -s tests -p test_quota_resume.py pass: exit 0, 25 tests (AC-7)
package-read-parity (optional) python3 -m unittest tests.test_validate_package tests.test_read_parity pass: exit 0, 97 tests

Not verified locally: Windows behavior (the msvcrt guard branch and process liveness). python3 -m unittest was not run: discovery from the root finds no tests, and configured-test covers the suite.

CI (head c078143, policy parallel, read once). Passed: Classify the change, Skills/manifests/Bash installer, Windows test shards 1 to 3. Failed: Windows test shard (windows-4), PowerShell installer. The same two failed on be91c43. Their logs are not readable from this stage (gh run view is outside its command table), so the cause is unknown. This is a CI state, not a finding.

Security. The deterministic rule did not fire: no CI workflow, key or env file, or agent/toolkit configuration path changed. The delta is a local lock and a local lookup. Not a sensitive change: the security audit was skipped after triage.

Documentation. docs/recovery-checkpoints.md, docs/routing.md, docs/configuration.md and docs/capability-parity-audit.md cover the delta; nothing stale found. The PR description still says PA-53/PA-54 for the writer lock and handoff; the repository now says PA-54/PA-55 (noted by the resolver).

… defaults

The windows-4 shard failed two restore tests: restore reported matches false. A checkpoint stored what Git's clean side produced and a restore took what its smudge side wrote back, so core.autocrlf=true turned LF into CRLF and core.symlinks=false checked a link out as a file.

Capture now stores changed regular files unfiltered, and restore writes those bytes back after the checkout and recreates a link Git wrote as a file. Both cases are reproduced on any platform by setting the two options in the fixture repository.

Refs #503
…d states

Fix-delta review of the exact-restore change: a fully staged worktree skipped the unfiltered store while restore still rewrote its files, and unfiltered storage bypassed clean filters such as Git LFS or an encrypting driver.

The unfiltered store now runs for staged-only files too and leaves any path with a filter attribute on its cleaned blob. The checkpoint commit declares unfiltered blobs and names the paths kept filtered; restore rewrites only what was declared, and a file it cannot rewrite keeps Git's checkout instead of raising.

Refs #503
A staged deletion, link or gitlink was listed as filtered, so a large staged removal could outgrow the commit-message argument and leave the capture pending. Only a staged-only regular file that kept its cleaned blob is listed now, the checkpoint message goes to commit-tree on standard input, and a bare filter attribute, which names no driver, no longer keeps a path filtered.

Refs #503
@datacas

datacas commented Dec 1, 2026

Copy link
Copy Markdown
Owner Author

[CCT-20261201-003] · deep_coder · openai/gpt-6.2-sol→? · high · triaged:95416a26732cea9d5372e4e652706fb2b158a8fd · schema:2

BLOCKED at e01802f. The branch was updated, and the focused checks passed. The full configured suite reached the 10-minute limit before it reported a result.

  • Checkpoint capture now gives Git the scanned bytes and preserves configured clean filters. Regression tests cover reserved-looking filter names and a file changing during capture.
  • Restore preserves emulated symlinks and handles file and directory replacements. Both cases passed real Git tests.
  • Checkpoint fingerprints now cover staged-only bytes. Adoption rechecks its linked checkpoint before consumption. Both passed focused tests.

REV-001 through REV-003 were resolved in the prior round and their regression tests passed here. GitHub reported 6 pending checks at the new head.

Triage history, verification and stage receipt

[CCT-20261201-002] · deep_coder · anthropic/claude-opus-5-5→? · high · triaged:1289117dbebe84aa2474f30e2f930a9e2a4f984b · schema:2

[CCT-20261201-001] · deep_coder · anthropic/claude-opus-5-5→? · high · triaged:be91c436bd2259e2fecd676169180d5de305e67a · schema:2

[CCR-20261130-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

[CCR-20261201-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

[REV-001] · low · resolved · valid · blocks:no — Stale-lock reclaim can evict a live writer's lock

The interprocess and same-process writer-lock tests passed at e01802f.

[REV-002] · low · resolved · valid · blocks:no — Adoption --stage is recorded but unenforced; an implement adoption is unusable

The stage-scoped adoption and single-use consumption tests passed, including revalidation against the linked checkpoint.

[REV-003] · low · resolved · valid · blocks:no — AC-3 BLOCKED status is not exercised end to end

The test still drives StageDispatch.unfinished through both quota exhaustions and checks the reported reset times. It passed at e01802f.

Review scope. Git confirmed that trusted rereview head c078143c335f1a1e5eb9699552f8778c7e3e81c8 is an ancestor. The accumulated diff was reconstructed for the actual initial PR head 95416a2 and the complete fix delta since c078143 was reviewed. The worktree already held unpublished commit 55875f0, which was retained. The final delta was uploaded and confirmed as the PR head.

Verification (agent-reported, head e01802fe80373321ff6f6a03209a5addd8ed555d).

Check Command Acceptance criteria Result
configured-test python3 -m unittest discover -s tests — Unverified after 10 minutes. Interrupted before the suite reported a result.
verify:basedpyright basedpyright — Pass · 0 errors, 0 warnings
ref-8ccc5e4478464d6ddcde25c59b2c6e895e5e6f1ea520b62dd0f6b48a0bd44048 python3 scripts/validate-package.py — Pass · 16 skills validated
recovery-quota-modules python3 -m unittest tests.test_capability_parity_audit tests.test_precheck_causes tests.test_claude_stage_refusals tests.test_recovery_checkpoints tests.test_quota_handoff AC-1, AC-2, AC-3, AC-4, AC-5, AC-6, AC-8, AC-9, AC-10, AC-11, AC-12, AC-13 Pass · 93 tests
quota-resume-contract python3 -m unittest discover -s tests -p test_quota_resume.py AC-7 Pass · 25 tests
package-read-parity python3 -m unittest tests.test_validate_package tests.test_read_parity — Pass · 97 tests
recovery-cli-and-git python3 -m unittest tests.test_recovery_checkpoints.AdoptionTests.test_cli_adopt_inspect_discard_and_help tests.test_recovery_checkpoints.CaptureAndRestoreTests.test_file_and_directory_replacements_are_captured_as_deletions_and_additions tests.test_recovery_checkpoints.CaptureAndRestoreTests.test_only_the_scanned_bytes_reach_git_when_a_file_changes — Pass · 3 tests
publication-single-read python3 -m unittest tests.test_publication_reread.ResolveKeepsItsSingleReadTests.test_a_resolve_publication_is_not_waited_for — Pass · 1 tests

The superseded full run failed the single-read publication fixture during edits to the worktree. That fixture passed when rerun on both the clean final checkout and the trusted review base. Native Windows behavior is covered by the GitHub checks. Local fixtures exercised Git's Windows checkout settings.

GitHub snapshot. The new head had 0 passed, 0 failed and 6 registered pending checks when read once.

  • Classify the change · pending
  • Skills, manifests, and Bash installer · pending
  • Windows test shard (windows-1) · pending
  • Windows test shard (windows-2) · pending
  • Windows test shard (windows-3) · pending
  • Windows test shard (windows-4) · pending
  • PowerShell installer · check run had yet to register while prerequisite shards were queued.

Security audit. Reviewed checkpoint scan-to-storage behavior, Git filter selection, symlink reads and writes, and the private Git refs. The synthetic credential exclusion and concurrent file replacement tests passed. Checkpoint locks coordinate toolkit writers. Credential detection covers the formats documented on the owning page.

Documentation reviewed. Updated docs/recovery-checkpoints.md for filter handling, staged byte fingerprints and symlink representation. The docs index, routing and capability-parity pages, readme, contributing and security policies, and GitHub templates and skill entry points still describe their respective workflows.

@datacas

datacas commented Dec 1, 2026

Copy link
Copy Markdown
Owner Author

Owner review feedback to fix in this pull request before merge. These four findings were reported on be91c43 by earlier review runs that were later superseded (see #565) and are not in the current review contract. Each must be re-checked against the current head: fix it with a regression test if it still applies, or explain with evidence why it no longer does.

medium · open · - · blocks:no — Permission rerun after a quota handoff is verified against the stale quota checkpoint

Path: scripts/cycle.py (_route_attempt, _check_checkpoint_handoff). _route_attempt runs _check_checkpoint_handoff for every number > 0 while run.checkpoint_handoff is set, and nothing clears it after the fallback starts. The stage allows a third attempt, a rerun after a permission answer (for number in range(3)). If the fallback edits the worktree and then asks for a permission, attempt 2 is verified against the quota checkpoint. The fingerprint or HEAD no longer matches, so the rerun is blocked with "the worktree is not the quota checkpoint". The result is a stop after the user already answered the permission. Evidence is from code reading; no test covers handoff followed by a permission rerun (not executed).

low · open · - · blocks:no — Checkpoint settled by reconcile_pending after a crash never verifies as matches

Path: scripts/recovery_checkpoints.py (reconcile_pending, verify). After a crash following the ref, the row is completed with fingerprint=None plus fingerprint_unrecorded, and the status stays complete. verify then compares current["fingerprint"] != None, so an untouched worktree reports fingerprint_changed and the automatic handoff gate rejects it. It fails safe, but the crash test does not assert the state. Storing the fingerprint in the commit metadata would avoid it. Code reading only.

low · open · - · blocks:no — Retention doc and code disagree on interrupted checkpoints

Path: docs/recovery-checkpoints.md, scripts/recovery_checkpoints.py (consume, prunable). The doc says interrupted checkpoints are never pruned. consume marks every complete or incomplete checkpoint of the scope consumed after a later successful stage, and prunable has no filter on kind='interrupted'. After the cycle is terminal an explicit prune can remove them. Align the doc or exclude the kind.

Documentation: docs/recovery-checkpoints.md is new, and docs/README.md, configuration.md, routing.md, telemetry.md, instrumentation.md, review-cycle.md, capability-parity-audit.md (PA-53, PA-54) and CHANGELOG.md are updated. Nothing missing was found.

Security triage: the deterministic rule did not fire (no CI, secret-file, agent-config path or label changed; the runtime plan has security_required: false). By own judgement the secret-exclusion and Git-object handling were read inline: staged, unstaged and untracked paths are excluded before objects are written, scanning fails closed, and ignored files are not captured. cc-security-review was not run, so security_audit_ran=false. No vulnerability was found.

Acceptance criteria (tests.version=2): The criteria are numbered in the order of the request. AC-1 to AC-6 (recovery, integrity, ambiguous edits, writer lock, crash injection, retention and secrets) and AC-8 to AC-13 (#525 handoff, tests, routing page) are covered by tests/test_recovery_checkpoints.py and tests/test_quota_handoff.py, which pass. AC-7 (recovery grants no approval) is covered by the docs only, with no dedicated test, so it stays open. The abrupt-termination test uses os._exit, not SIGKILL.

Checks run:

Check Result
python3 -m unittest tests.test_quota_handoff tests.test_recovery_checkpoints tests.test_quota_resume 63 tests OK
python3 scripts/validate-package.py VALID
basedpyright 0 errors, 0 warnings
python3 -m unittest discover -s tests 2,856 tests OK (1 skipped), 676 s; it outlasted the 10 min foreground limit and finished in the background

CI (parallel policy, state only): pass: Classify the change, Skills, manifests, and Bash installer, Windows test shard (windows-1/2/3). Fail: Windows test shard (windows-4) and PowerShell installer. main passes at its head. I could not read the failing job logs (gh run view is refused in this stage), so the cause is unknown.

Residual risk: REV-001 is unexecuted. The two failing Windows jobs are new on this head and need the CI gate. A lock cannot attribute edits made outside the toolkit, as the doc discloses.

ORCHESTRATION_RESULT (JSON)

ORCHESTRATION_RESULT
{"skill": "cc-initial-review", "status": "REVIEW_PASSED_AWAITING_CI", "issue_provider": "github", "issue_id": "503", "code_host": "github", "change_request_id": "554", "change_request_url": "#554", "pr_number": 554, "issue_number": 503, "head_sha": "be91c436bd2259e2fecd676169180d5de305e67a", "reviewed_head_sha": "be91c436bd2259e2fecd676169180d5de305e67a", "security_audit_ran": false, "review_run_id": "CCR-20261130-001", "reviewer": {"profile": "reviewer", "provider": "anthropic", "model_requested": "claude-sonnet-5-5", "model_resolved": null, "effort": "high"}, "plan_id": "plan-cycle-a3f8cac5ed4d443c95afb98862ec18de", "revision": 16, "digest": "f9a38a65d6fea7a83bec5718fe7c3e5aaf6227ee9f3d2ae549bb1cc246277177", "findings": [{"id": "REV-001", "severity": "medium", "status": "open", "disposition": "-", "blocks_approval": false, "category": "correctness", "path": "scripts/cycle.py", "line": 710}, {"id": "REV-002", "severity": "low", "status": "open", "disposition": "-", "blocks_approval": false, "category": "correctness", "path": "scripts/recovery_checkpoints.py", "line": 1303}, {"id": "REV-003", "severity": "low", "status": "open", "disposition": "-", "blocks_approval": false, "category": "documentation", "path": "docs/recovery-checkpoints.md", "line": 233}], "blocking_findings": [], "checks": {"head_sha": "be91c436bd2259e2fecd676169180d5de305e67a", "passed": 5, "failed": 2, "pending": 0}, "tests": {"version": 2, "conclusion": "passed", "commands": [{"command": "python3 -m unittest tests.test_quota_handoff tests.test_recovery_checkpoints tests.test_quota_resume", "result": "passed"}, {"command": "python3 scripts/validate-package.py", "result": "passed"}, {"command": "basedpyright", "result": "passed"}, {"command": "python3 -m unittest discover -s tests", "result": "passed"}], "acceptance": [{"id": "AC-1", "status": "met"}, {"id": "AC-2", "status": "met"}, {"id": "AC-3", "status": "met"}, {"id": "AC-4", "status": "met"}, {"id": "AC-5", "status": "met"}, {"id": "AC-6", "status": "met"}, {"id": "AC-7", "status": "open"}, {"id": "AC-8", "status": "met"}, {"id": "AC-9", "status": "met"}, {"id": "AC-10", "status": "met"}, {"id": "AC-11", "status": "met"}, {"id": "AC-12", "status": "met"}, {"id": "AC-13", "status": "met"}]}, "blocking": false}
END_ORCHESTRATION_RESULT

low · open · - · blocks:no — Same-process lock re-entry

Path: scripts/recovery_checkpoints.py (WriterLock.acquire, release).
When the lock file names this process's PID and host, acquire replaces it and reports success instead of ConcurrentWriter. Two recorders in one process (threads, or an embedding caller) can then both write the same worktree. The first holder's release removes the lock under the second. docs/recovery-checkpoints.md and PA-53 promise that a second toolkit writer is refused. Evidence: code inspection; the stages in the current driver run sequentially, so this is latent. Suggested fix: refuse same-PID re-entry unless the lock object is the same instance.

Acceptance criteria (AC-1 to AC-13)

Each has a check in the executed tests below (63 targeted, then the full suite).

  • AC-1, AC-2, AC-5 (crash and repeat): test_recovery_checkpoints CaptureAndRestoreTests, CrashInjectionTests (including os._exit).
  • AC-3: IntegrityTests, AdoptionTests.
  • AC-4: WriterLockTests, test_quota_handoff.WriterAndAdoptionTests; the limit is disclosed in the docs.
  • AC-6: SecretTests, SubmoduleTests, RetentionTests, test_ordinary_gc_keeps_checkpoint_objects.
  • AC-7: prompt and stop texts, PA-53, PA-54 and the docs; the automatic path stops only itself.
  • AC-8 to AC-13 (Quota exhaustion in a writing stage stops the cycle with dirty_workspace instead of handing the worktree to the fallback #525 AC-1 to AC-5): test_quota_handoff.AutomaticHandoffTests (AC-1 implement, AC-2 resolve, AC-3 both exhausted, AC-4 one reroute), docs/routing.md new section.

Security triage

The deterministic rule did not fire (no CI, secret, key, agent-configuration path or label matched). The reviewer's reading found the change handles secret exclusion, but the audit was skipped as no sensitive surface (authentication, authorization, public API, dependency) changed. The secret-exclusion code was read inline. It fails closed on path, content, size and read errors. Residual: a file rewritten between the scan and update-index is flagged changed_during_capture (checkpoint incomplete), but its object may already be in the private object store. A separate cc-security-review pass did not run.

Verification (executed in this stage, head be91c43)

Check Command Result
recovery-tests python3 -m unittest tests.test_recovery_checkpoints tests.test_quota_handoff tests.test_quota_resume pass: 63 tests, 12 s
validate-package python3 scripts/validate-package.py pass: VALID: 16 skills
basedpyright basedpyright pass: 0 errors, 0 warnings
unittest-default python3 -m unittest exit 0, 0 tests run (discovery finds none; no evidence)
configured-test python3 -m unittest discover -s tests pass: exit 0, 2856 tests, 1 skipped, 751 s. It passed the 600 s foreground limit, was moved to the background by the harness and its exit was read afterwards.

Windows behaviour (the lock's dead-process path, POSIX modes) was not executed here.

CI (read once, parallel policy; not findings)

gh pr checks 554: pass: Classify the change, Skills, manifests, and Bash installer, Windows test shard windows-1, windows-2, windows-3. fail: Windows test shard (windows-4) after 17m20s (it holds test_recovery_checkpoints and test_quota_handoff), PowerShell installer after 3 s. The failure logs are not readable in this stage (gh run view is not in the review command table), so the cause is unknown. The CI gate waits for and decides on these checks.

Documentation

docs/recovery-checkpoints.md (new), routing.md, review-cycle.md, telemetry.md, instrumentation.md, configuration.md, capability-parity-audit.md (PA-53, PA-54), README.md index and CHANGELOG.md are updated. The PR description lists the documentation reviewed. No missing page found. Capability parity (#450): the new stops cover the automatic path only; the operator can still inspect, restore, adopt or run any operation directly.

Residual risks

Locks exclude toolkit writers only (disclosed). Secret detection reduces exposure and cannot guarantee it. Windows has no process-group exit proof, so a quota stop there still stops.

The 2026-11-29 21:16 review also reported the stale-quota-checkpoint rerun (its REV-002) and the retention doc/code mismatch (its REV-004), the same issues as the first and third items above.

@datacas

datacas commented Dec 1, 2026

Copy link
Copy Markdown
Owner Author

[CCT-20261201-004] · deep_coder · openai/gpt-6.2-sol→? · high · triaged:e01802fe80373321ff6f6a03209a5addd8ed555d · schema:2

BLOCKED at 4861b1f. The fixes are on the PR and passed focused verification. The full configured suite reached the 10-minute limit before producing a result.

  • REV-004: The quota checkpoint is checked once, under the writer lock. The guarded permission retry passed.
  • REV-005: Crash recovery uses the recorded fingerprint. Abrupt-exit, changed-worktree, and legacy recovery tests passed.
  • REV-006: The docs describe when an interrupted checkpoint can be pruned. The retention regression passed.
  • REV-007: The existing writer-lock regression confirms that same-process re-entry is refused.

Three previously resolved findings retain their status.

Triage history, verification and stage receipt

[CCT-20261201-003] · deep_coder · openai/gpt-6.2-sol→? · high · triaged:95416a26732cea9d5372e4e652706fb2b158a8fd · schema:2

[CCR-20261201-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

[CCT-20261201-002] · deep_coder · anthropic/claude-opus-5-5→? · high · triaged:1289117dbebe84aa2474f30e2f930a9e2a4f984b · schema:2

[CCT-20261201-001] · deep_coder · anthropic/claude-opus-5-5→? · high · triaged:be91c436bd2259e2fecd676169180d5de305e67a · schema:2

[CCR-20261130-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

[REV-001] · low · resolved · valid · blocks:no — Stale-lock reclaim can evict a live writer's lock

[REV-002] · low · resolved · valid · blocks:no — Adoption --stage is recorded but unenforced; an implement adoption is unusable

[REV-003] · low · resolved · valid · blocks:no — AC-3 BLOCKED status is not exercised end to end

[REV-004] · medium · resolved · valid · blocks:no — Permission rerun after a quota handoff is verified against the stale quota checkpoint

scripts/cycle.py. Quota verification is one-time and now runs while the writer lock is held. Guarded permission reruns still reconcile the fallback attempt's effects. The regression originally observed two quota verifications. It now observes one across three attempts. A separate test checks that a mismatched checkpoint releases the lock and preserves the external edit. Fix commit 4861b1f.

[REV-005] · low · resolved · valid · blocks:no — Checkpoint settled by reconcile_pending after a crash never verifies as matches

scripts/recovery_checkpoints.py. The private checkpoint commit records the capture-time fingerprint before the ref is created. Reconciliation reads it, and verification checks it against the SQLite row. The abrupt-exit regression exercises an unchanged state and a later divergent state. Legacy pending refs without fingerprints retain restore support and stay unconfirmed. Fix commit 4861b1f.

[REV-006] · low · resolved · valid · blocks:no — Retention doc and code disagree on interrupted checkpoints

docs/recovery-checkpoints.md and scripts/recovery_checkpoints.py. The owning page and the method docstring now describe the existing explicit prune behavior. The test verifies an interrupted checkpoint survives consumption, cycle termination and dry run until the explicit prune actually deletes its ref. Fix commit 4861b1f.

[REV-007] · low · not_applicable · obsolete · blocks:no — Same-process lock re-entry

scripts/recovery_checkpoints.py. This duplicates the live ownership protection covered by REV-001 at the triage head. test_same_process_cannot_replace_or_release_another_instances_lock passed. A second instance sees ConcurrentWriter, and calling release on it preserves the first instance's lock record. Evidence anchor e01802f.

Review scope. The 3,596-line accumulated evidence matched the initial PR head and the supplied SHA-256. Git confirmed c078143c335f1a1e5eb9699552f8778c7e3e81c8 was an ancestor of 4861b1f. Reviewed the complete fix delta from that trusted rereview head, including the capture, restore and adoption changes already on the branch. Local verification exercised real Git repositories and SQLite stores. Native Windows behavior remains with GitHub CI.

Verification (agent-reported, version 2, local head 4861b1f).

Check Command Acceptance criteria Result
configured-test python3 -m unittest discover -s tests — Unverified · 600-second timeout
verify:basedpyright basedpyright — Pass · 0 errors, 0 warnings, 0 notes
ref-8ccc5e4478464d6ddcde25c59b2c6e895e5e6f1ea520b62dd0f6b48a0bd44048 python3 scripts/validate-package.py — Pass · 16 skills validated
recovery-quota-modules python3 -m unittest tests.test_capability_parity_audit tests.test_precheck_causes tests.test_claude_stage_refusals tests.test_recovery_checkpoints tests.test_quota_handoff AC-1, AC-2, AC-3, AC-4, AC-5, AC-6, AC-8, AC-9, AC-10, AC-11, AC-12, AC-13 Pass · 96 tests
quota-resume-contract python3 -m unittest discover -s tests -p test_quota_resume.py AC-7 Pass · 25 tests
package-read-parity python3 -m unittest tests.test_validate_package tests.test_read_parity — Pass · 97 tests
recovery-cli-and-git python3 -m unittest tests.test_recovery_checkpoints.AdoptionTests.test_cli_adopt_inspect_discard_and_help tests.test_recovery_checkpoints.CaptureAndRestoreTests.test_file_and_directory_replacements_are_captured_as_deletions_and_additions tests.test_recovery_checkpoints.CaptureAndRestoreTests.test_only_the_scanned_bytes_reach_git_when_a_file_changes — Pass · 3 tests
publication-single-read python3 -m unittest tests.test_publication_reread.ResolveKeepsItsSingleReadTests.test_a_resolve_publication_is_not_waited_for — Pass · 1 test

GitHub snapshot. One read confirmed 4861b1fc2593826d0b6edfa1855b4fb5757eb859. GitHub had registered 0 passed, 0 failed and 0 pending checks. The workflow's classification, skill and installer validation, four Windows shards, and PowerShell installer jobs were not yet registered. The cycle's parallel CI gate handles their results.

Documentation reviewed. Updated the recovery checkpoint and routing pages. The docs index, capability-parity audit, README, contributing and security policies, and GitHub issue template and skill entry points still describe the affected workflow.

Security triage. No configured trigger matched. The new checkpoint field contains the existing fingerprint digest, and the change to lock scope leaves the permission reconciliation in force. security_audit_ran=false.

The capture resolves its worktree root, so on a Windows runner whose temp directory is a short 8.3 name the scanned path never equalled the fixture's path and the file was never rewritten during the capture. Compare with os.path.samefile instead.

Refs #503
@datacas

datacas commented Dec 1, 2026

Copy link
Copy Markdown
Owner Author

[CCT-20261201-005] · deep_coder · anthropic/claude-fable-5-2→? · medium · triaged:4861b1fc2593826d0b6edfa1855b4fb5757eb859 · schema:2

RESOLVED at 984fab7; this is not an approval. The previous round stopped only because the full suite outlasted its 10-minute limit. This round ran it to completion and fixed the Windows CI failure.

  • REV-004, REV-005, REV-006 (resolved) and REV-007 (not_applicable): no code change this round. Their regression tests and the full configured suite pass on this head.
  • CI windows-4 on 4861b1f: test_only_the_scanned_bytes_reach_git_when_a_file_changes failed. Likely cause: the fixture compared path spellings, and the capture resolves the runner's temp path. Fix: os.path.samefile, test only. PowerShell installer failed only because it requires every shard.

3 findings unchanged (REV-001 to REV-003, resolved).

Checks: configured-test passed with 2894 tests; every other required check passed. CI on 984fab7, read once: 3 passed, 0 failed, 3 pending.

Triage history, verification and stage receipt

[CCT-20261201-004] · deep_coder · openai/gpt-6.2-sol→? · high · triaged:e01802fe80373321ff6f6a03209a5addd8ed555d · schema:2

[CCT-20261201-003] · deep_coder · openai/gpt-6.2-sol→? · high · triaged:95416a26732cea9d5372e4e652706fb2b158a8fd · schema:2

[CCR-20261201-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

[CCT-20261201-002] · deep_coder · anthropic/claude-opus-5-5→? · high · triaged:1289117dbebe84aa2474f30e2f930a9e2a4f984b · schema:2

[CCT-20261201-001] · deep_coder · anthropic/claude-opus-5-5→? · high · triaged:be91c436bd2259e2fecd676169180d5de305e67a · schema:2

[CCR-20261130-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

[REV-001] · low · resolved · valid · blocks:no — Stale-lock reclaim can evict a live writer's lock

No change this round.

[REV-002] · low · resolved · valid · blocks:no — Adoption --stage is recorded but unenforced; an implement adoption is unusable

No change this round.

[REV-003] · low · resolved · valid · blocks:no — AC-3 BLOCKED status is not exercised end to end

No change this round.

[REV-004] · medium · resolved · valid · blocks:no — Permission rerun after a quota handoff is verified against the stale quota checkpoint

scripts/cycle.py. Fixed in 4861b1f: the quota checkpoint is verified once, under the writer lock, and cleared before the fallback is dispatched. Re-read at the triage head and verified by test_permission_rerun_checks_fallback_effects_only (one verification across three attempts). No code change this round.

[REV-005] · low · resolved · valid · blocks:no — Checkpoint settled by reconcile_pending after a crash never verifies as matches

scripts/recovery_checkpoints.py. Fixed in 4861b1f: the checkpoint commit records the capture-time fingerprint and reconciliation restores it. Verified by the abrupt-exit test (matches, then fingerprint_changed after an edit) and the legacy-ref test. No code change this round.

[REV-006] · low · resolved · valid · blocks:no — Retention doc and code disagree on interrupted checkpoints

docs/recovery-checkpoints.md. Fixed in 4861b1f: the page and the prunable docstring describe the explicit prune of consumed interrupted checkpoints. Verified by test_interrupted_checkpoint_requires_explicit_prune_after_consumption. No code change this round.

[REV-007] · low · not_applicable · obsolete · blocks:no — Same-process lock re-entry

Disposition frozen by CCT-20261201-004. test_same_process_cannot_replace_or_release_another_instances_lock passes on this head. Evidence anchor 984fab7.

Triage. Triage commit 4861b1f. The trusted history (author datacas) holds no review after CCT-20261201-004, and no review threads were opened. All seven dispositions were already assigned and are preserved. The work of this round was the unfinished verification and the failed check of the pushed head.

CI failure on 4861b1f (run 46678160993). Windows test shard (windows-4) ran 1314 tests with one failure: the checkpoint row was complete where the test expected incomplete. The test rewrites a file after it is scanned by matching path == str(source). The capture passes a path under the resolved worktree root (the failing row names C:\Users\runneradmin\...). The fixture's path keeps the temp directory's own spelling, which on that runner is most likely the short RUNNER~1 form, so the comparison never matched and the file was never rewritten. This cause is inferred from the log and the code; the windows-4 shard of the new head confirms or refutes it. The capture code is unchanged. Commit 984fab7 compares with os.path.samefile. PowerShell installer ran only exit 1 in its step Require all Windows test shards to pass.

Fix-delta review (base c078143, an ancestor of 984fab7). The source and documentation delta was read in full: capture from scanned bytes, exact restore, staged-byte fingerprints, adoption revalidation, the single quota verification and the recorded fingerprint. The tests of 4861b1f and of this round were read; the tests added before e01802f were executed, not re-read. The pass ran inline, not as a delegated cc-code-review. No P0 or P1 finding.

Verification (agent-reported, version 2, local head 984fab75b8c2fac37596883fb7c0fc36d7a437ea).

Check Command Acceptance criteria Result
configured-test python3 -m unittest discover -s tests — Pass · exit 0, 2894 tests, 1 skipped. The harness moved the run to the background at 600 s and its exit was read.
verify:basedpyright basedpyright — Pass · 0 errors, 0 warnings, 0 notes
ref-8ccc5e4478464d6ddcde25c59b2c6e895e5e6f1ea520b62dd0f6b48a0bd44048 python3 scripts/validate-package.py — Pass · 16 skills validated
recovery-quota-modules python3 -m unittest tests.test_capability_parity_audit tests.test_precheck_causes tests.test_claude_stage_refusals tests.test_recovery_checkpoints tests.test_quota_handoff AC-1, AC-2, AC-3, AC-4, AC-5, AC-6, AC-8, AC-9, AC-10, AC-11, AC-12, AC-13 Pass · 96 tests
quota-resume-contract python3 -m unittest discover -s tests -p test_quota_resume.py AC-7 Pass · 25 tests
package-read-parity python3 -m unittest tests.test_validate_package tests.test_read_parity — Pass · 97 tests
recovery-cli-and-git python3 -m unittest tests.test_recovery_checkpoints.AdoptionTests.test_cli_adopt_inspect_discard_and_help tests.test_recovery_checkpoints.CaptureAndRestoreTests.test_file_and_directory_replacements_are_captured_as_deletions_and_additions tests.test_recovery_checkpoints.CaptureAndRestoreTests.test_only_the_scanned_bytes_reach_git_when_a_file_changes — Pass · 3 tests
publication-single-read python3 -m unittest tests.test_publication_reread.ResolveKeepsItsSingleReadTests.test_a_resolve_publication_is_not_waited_for — Pass · 1 test

The full suite also passed on 4861b1f before the test change (2894 tests, 1 skipped, 748 s). Environment: the local run shares Python, Git and POSIX with the Ubuntu job. The Windows path spelling that failed in CI cannot be reproduced locally; the windows-4 shard of 984fab7 is its evidence.

GitHub snapshot (head 984fab75b8c2fac37596883fb7c0fc36d7a437ea, policy parallel, read once): 3 passed, 0 failed, 3 pending.

  • Classify the change · pass
  • Windows test shard (windows-1) · pass
  • Windows test shard (windows-2) · pass
  • Windows test shard (windows-3) · pending
  • Windows test shard (windows-4) · pending
  • Skills, manifests, and Bash installer · pending
  • PowerShell installer · not registered yet; it waits for the shards.

Security triage. The deterministic rule did not fire: no CI workflow, key or env file, or agent or toolkit configuration path changed. This round changed one test line. security_audit_ran=false.

Documentation reviewed. docs/recovery-checkpoints.md and docs/routing.md already describe the behaviour fixed in 4861b1f. A test-only change needs no page. docs/README.md, README.md, CONTRIBUTING.md, AGENTS.md, SECURITY.md, the templates and the skill entry points needed no change.

Run: resolve · profile deep_coder · requested anthropic/claude-fable-5-2 · effort medium · resolved ?

@datacas

datacas commented Dec 1, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20261201-002] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

APPROVED for 984fab7. The full accumulated diff (3693 lines) was rereviewed, with the fix delta since c078143 read in full. No finding is open and no new finding was found. All 7 checks of this head passed.

  • REV-004, REV-005, REV-006: resolved, each reproduced by execution (single quota verification across a permission rerun; recorded fingerprint after a crash; explicit prune of an interrupted checkpoint).
  • REV-007: not_applicable; the same-process re-entry test passes.
  • 3 findings unchanged (REV-001 to REV-003, resolved).

Security audit: skipped after triage, no change.

Rereview details, findings, verification, CI and receipt

[CCR-20261201-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

[CCR-20261130-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

[REV-001] · low · resolved · valid · blocks:no — Stale-lock reclaim can evict a live writer's lock

No change this round. test_racing_stale_reclaim_does_not_evict_a_live_writer passes.

[REV-002] · low · resolved · valid · blocks:no — Adoption --stage is recorded but unenforced; an implement adoption is unusable

No change in the stage binding. The adoption lookup now verifies the adopted checkpoint (_adoption_matches) instead of comparing a start-of-attempt fingerprint, and a failed lookup or claim is caught as subprocess.SubprocessError too. The adoption tests of test_recovery_checkpoints and test_quota_handoff pass.

[REV-003] · low · resolved · valid · blocks:no — AC-3 BLOCKED status is not exercised end to end

No change this round; the StageDispatch.unfinished test passes.

[REV-004] · medium · resolved · valid · blocks:no — Permission rerun after a quota handoff is verified against the stale quota checkpoint

scripts/cycle.py:566-572. The quota checkpoint is verified once, inside the stage loop and under the writer lock; a blocked check breaks out of the try, so the finally releases the lock. run.checkpoint_handoff is cleared after the check, so the permission rerun is no longer compared with the stale checkpoint. Verified: test_permission_rerun_checks_fallback_effects_only passes (one verify call across three attempts); the mismatch test still ends blocked with the external edit preserved and the lock released.

[REV-005] · low · resolved · valid · blocks:no — Checkpoint settled by reconcile_pending after a crash never verifies as matches

scripts/recovery_checkpoints.py. The checkpoint commit records the capture-time fingerprint, reconcile_pending restores it, and verify compares it with the row. A legacy ref without a fingerprint keeps fingerprint_unrecorded, supports restore and never claims a match (fails safe). Verified: the abrupt-exit test asserts matches, then fingerprint_changed after an edit; the legacy-ref test passes.

[REV-006] · low · resolved · valid · blocks:no — Retention doc and code disagree on interrupted checkpoints

docs/recovery-checkpoints.md and prunable now agree: a complete or incomplete checkpoint, interrupted included, is prunable once discarded or consumed with a terminal cycle and no dependent checkpoint or unconsumed adoption. Verified: test_interrupted_checkpoint_requires_explicit_prune_after_consumption passes.

[REV-007] · low · not_applicable · obsolete · blocks:no — Same-process lock re-entry

Disposition frozen by CCT-20261201-004. test_same_process_cannot_replace_or_release_another_instances_lock passes.

Scope of this round. Fix delta c078143..984fab7 (7 files, 585 insertions): the quota check moved into the stage loop, capture from the scanned bytes with clean-filter paths keeping their cleaned blob, exact restore of file bytes, symlinks and file/directory replacements, staged-only bytes in the checkpoint fingerprint, and adoption revalidation against its checkpoint. I found no regression: the staged-only and unreadable-file cases keep the already-scanned staged blob and mark the checkpoint incomplete, secret scanning still runs on the exact bytes that are stored, and a restore never rewrites a path whose blob was kept filtered. The delegated cc-code-review, cc-verify passes were not loaded as skills; the equivalent review and verification ran inline, so they ran degraded.

Verification (agent-reported, local, foreground, head 984fab75b8c2fac37596883fb7c0fc36d7a437ea).

Check Command Criteria Result
configured-test python3 -m unittest discover -s tests — pass: exit 0, 2894 tests, 1 skipped, 700 s (the harness moved it to the background after 600 s; its exit was read)
verify:basedpyright basedpyright — pass: exit 0, 0 errors, 0 warnings, 0 notes
ref-8ccc5e4478464d6ddcde25c59b2c6e895e5e6f1ea520b62dd0f6b48a0bd44048 python3 scripts/validate-package.py — pass: exit 0, VALID: 16 skills
recovery-quota-modules python3 -m unittest tests.test_capability_parity_audit tests.test_precheck_causes tests.test_claude_stage_refusals tests.test_recovery_checkpoints tests.test_quota_handoff AC-1 to AC-6, AC-8 to AC-13 pass: exit 0, 96 tests
quota-resume-contract python3 -m unittest discover -s tests -p test_quota_resume.py AC-7 pass: exit 0, 25 tests
package-read-parity (optional) python3 -m unittest tests.test_validate_package tests.test_read_parity — pass: exit 0, 97 tests
recovery-cli-and-git python3 -m unittest tests.test_recovery_checkpoints.AdoptionTests.test_cli_adopt_inspect_discard_and_help tests.test_recovery_checkpoints.CaptureAndRestoreTests.test_file_and_directory_replacements_are_captured_as_deletions_and_additions tests.test_recovery_checkpoints.CaptureAndRestoreTests.test_only_the_scanned_bytes_reach_git_when_a_file_changes — pass: exit 0, 3 tests
publication-single-read (optional) python3 -m unittest tests.test_publication_reread.ResolveKeepsItsSingleReadTests.test_a_resolve_publication_is_not_waited_for — pass: exit 0, 1 test

Not verified locally: Windows behaviour (the msvcrt guard, process liveness, core.symlinks=false and autocrlf fixtures); the windows-1 to windows-4 shards cover it. python3 -m unittest was not run: discovery from the root finds no tests, and configured-test covers the suite.

CI (head 984fab7, policy parallel, read once). Passed: Classify the change, Skills/manifests/Bash installer, Windows test shard (windows-1, windows-2, windows-3, windows-4), PowerShell installer. 7 passed, 0 failed, 0 pending. The windows-4 and PowerShell installer failures of earlier heads are gone.

Security. The deterministic rule did not fire: no CI workflow, key or env file, or agent/toolkit configuration path changed. Reviewer reading of the delta: bytes are read once with O_NOFOLLOW, scanned, and the same bytes are hashed; a clean-filter path never stores raw bytes; restore writes only into regular files it opened without following links. Not a sensitive change: the security audit was skipped after triage.

Documentation. docs/recovery-checkpoints.md (filter handling, staged-byte fingerprint, retention) and docs/routing.md (permission rerun) cover the delta; nothing stale found. The PR description still names the capability-parity rows PA-53/PA-54; the repository now says PA-54/PA-55.

@datacas
datacas merged commit d33ec3b into main Dec 1, 2026
7 checks passed
@datacas
datacas deleted the feat/503-durable-checkpoints branch December 1, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant