Repository navigation
Anchor status: read-only view of anchoring debt (ticket 0010) - #321
Merged
Merged
Conversation
cog anchor status --scan <dir> reports the anchoring state of every sealed bundle without acting: anchored, anchored with a stale marker, pending (recorded debt), or unanchored with no marker at all — the silent-debt class left by emission while anchoring was unconfigured. It also sweeps for stale and orphaned pending-anchor markers. Reconcile's read-only sibling by construction: same candidate scan, same per-kind request builders, same root shape gate, same chain-verified AnchorSet fold (a tampered log refuses to report). The status path opens no Anchorer, never creates a missing log (missing log is a loud error pointing at `cog anchor init`), and never writes or deletes markers — enforced by a full-tree byte-snapshot test. Debt is information, not failure: exit is zero once the scan completes; nonzero is reserved for operational errors. Gating on debt stays --require-anchor's future job. Ticket 0010; implemented by Codex (gpt-5.5), reviewed by Claude. Validation: cog-cli anchor tests 32/32, cargo fmt --check clean, cargo clippy --workspace --all-targets -D warnings clean, cargo tree -i magpie-log = cog-anchor sole direct dependent. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cog anchor status --anchor-key … --anchor-log … --scan <dir>— the read-only sibling of reconcile. It reports, without acting, the anchoring state of every sealed bundle in the tree:anchored/anchored_stale_marker(debt already paid; the marker is reported, not deleted — cleanup stays reconcile's job)pending(unanchored with apending-anchor.jsonmarker: recorded debt)unanchored_silent(unanchored with no marker — the class left by sealing while anchoring was unconfigured, where emission writes only a notice; surfacing these is half the command's point)Read-only is the invariant, not a preference. The status path opens no
Anchorer, never creates a missing log (anchor_status_log_missingis a loud error pointing atcog anchor init— a wrong path must not masquerade as an empty estate), and contains no filesystem mutation calls. A test snapshots the log bytes and every file in the scan tree before/after and asserts byte-identity. TheAnchorSetfold replays a chain-verified log, so a tampered log refuses to report — same refusal reconcile has.Exit policy: zero once the scan completes, regardless of debt — debt is information; gating on it is
--require-anchor's future job (queued from 0007b). Nonzero is reserved for operational errors (unconfigured, missing key, missing/tampered log, unreadable scan). Unparseable/ambiguous bundles are reported and counted, exit zero, same rationale as reconcile.No new machinery: reuses reconcile's candidate scan, per-kind request builders, root shape gate,
AnchorSet::from_log,read_verifying_key,pending_anchor_marker_path, andresolve_anchor_paths. No changes tocog-anchoror any domain crate.Ticket:
.agent-runs/pending/0010-anchor-status.md. Implemented by Codex (gpt-5.5, run20260705T152744Z-196300694), reviewed by Claude — no reviewer fixes needed this time.Validation (reviewer-run):
cargo test -p cog-cli anchor32/32 (6 new status tests);cargo fmt --checkclean;cargo clippy --workspace --all-targets -- -D warningsclean;cargo tree -i magpie-log→ cog-anchor sole direct dependent. Full workspace shows only the 7 pre-existingstyle_plansnapshot failures on native Windows (identical on clean main).🤖 Generated with Claude Code