Skip to content

Anchor status: read-only view of anchoring debt (ticket 0010) - #321

Merged
noctem-o merged 1 commit into
mainfrom
seam/0010-anchor-status
Jul 5, 2026
Merged

noctem-o merged 1 commit into
mainfrom
seam/0010-anchor-status

Conversation

@noctem-o

@noctem-o noctem-o commented Jul 5, 2026

Copy link
Copy Markdown
Owner

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 a pending-anchor.json marker: 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)
  • plus a sweep for orphaned markers whose run directory is missing or manifest-less

Read-only is the invariant, not a preference. The status path opens no Anchorer, never creates a missing log (anchor_status_log_missing is a loud error pointing at cog 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. The AnchorSet fold 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, and resolve_anchor_paths. No changes to cog-anchor or any domain crate.

Ticket: .agent-runs/pending/0010-anchor-status.md. Implemented by Codex (gpt-5.5, run 20260705T152744Z-196300694), reviewed by Claude — no reviewer fixes needed this time.

Validation (reviewer-run): cargo test -p cog-cli anchor 32/32 (6 new status tests); cargo fmt --check clean; cargo clippy --workspace --all-targets -- -D warnings clean; cargo tree -i magpie-log → cog-anchor sole direct dependent. Full workspace shows only the 7 pre-existing style_plan snapshot failures on native Windows (identical on clean main).

🤖 Generated with Claude Code

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>
@noctem-o
noctem-o merged commit 4a169f6 into main Jul 5, 2026
1 check passed
@noctem-o
noctem-o deleted the seam/0010-anchor-status branch July 5, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant