Skip to content

fix: preserve failure diagnostics and recover historical admission layout - #64

Open
MarcoPorcellato wants to merge 25 commits into
mainfrom
codex/issue-63-top-level-diagnostics
Open

fix: preserve failure diagnostics and recover historical admission layout#64
MarcoPorcellato wants to merge 25 commits into
mainfrom
codex/issue-63-top-level-diagnostics

Conversation

@MarcoPorcellato

@MarcoPorcellato MarcoPorcellato commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #63.

This PR closes two related fail-closed observability and recovery gaps:

  • persists a bounded, redacted diagnostic sidecar for terminal journal failures whose coarse kind is unknown;
  • adds an explicit, hash-bound admission layout-recovery status/apply flow for the single supported historical case: a CCP-owned, plain, empty agent-tickets/ directory.

The sidecar is strict, owned, and bound to the exact terminal failed + unknown entry. The layout recovery keeps normal admission strict, requires a separately authorized exact plan digest, rebuilds the plan under queue-then-slot locks, and preserves the empty directory through a rename-only move into deterministic quarantine.

Trust claim checklist

  • No claim of native or live-host qualification is made.
  • layout-recovery status is read-only and authorizes neither apply nor a later heavy run.
  • layout-recovery apply authorizes only one exact hash-bound recovery; it does not authorize CCP run, Docker, publication, or R5.
  • Manual deletion, movement, quarantine, or reinterpretation of admission state remains unsupported.
  • not_applied and recovery_uncertain remain non-success outcomes; uncertainty is never promoted to success.

Impact and rollback

  • Runtime/trust boundary: adds a strict enum-only journal diagnostic sidecar and an explicit admission-layout recovery command. Normal admission continues to reject agent-tickets/ until a separately authorized recovery completes.
  • Concurrency/durability: recovery acquires existing queue then slot locks, releases slot then queue, revalidates under lock, uses rename only, synchronizes both parents, never overwrites/deletes, and has no EXDEV copy/delete fallback.
  • Privacy: no raw error text, absolute path, environment, command, repository, user, ticket/lease content, or secret is emitted by the new schemas.
  • Dependency/supply chain: no dependency changes.
  • Rollback: revert these commits before any live use. A future separately authorized live recovery is an append-once state transition and is not implicitly undone by reverting source.

Validation

Validated exact head: 742ac544ebaedfcc656b683424d9045da30a2b32.

  • cargo fmt --all -- --check — PASS.
  • RUSTFLAGS=-Dwarnings cargo check --locked --all-targets — PASS.
  • focused layout recovery — 18 passed.
  • focused durable filesystem — 9 passed.
  • focused recovery CLI — 3 passed.
  • agent integration contract — 2 passed.
  • cargo test --locked — 357 passed, 3 ignored/NOT_RUN.
  • git diff --check — PASS.
  • Cargo.toml / Cargo.lock diff — empty.

Explicitly not run

  • live admission layout-recovery status or apply against the platform coordinator;
  • candidate build or candidate SHA-256 qualification;
  • CCP run, Docker, network workload, receipt publication, or R5 qualification;
  • native/heavy ignored tests.

A future live apply must be separately authorized against the exact source commit, absolute candidate path, candidate SHA-256, and recovery plan SHA-256. Any later receipt run requires another exact-head authorization.

@MarcoPorcellato MarcoPorcellato changed the title fix: preserve terminal failure diagnostics fix: preserve failure diagnostics and recover historical admission layout Aug 24, 2026
@MarcoPorcellato

Copy link
Copy Markdown
Owner Author

CI status for exact head 742ac544ebaedfcc656b683424d9045da30a2b32 is intentionally still blocked on commit-bound evidence.

The workflow successfully checked out trusted base 866db18a571f55ed3d9b481d6c9c9c3bd5e98d55, then failed only while fetching the absent branch/tag ccp-evidence/742ac544ebaedfcc656b683424d9045da30a2b32. Consequently EVIDENCE_OUTCOME=failure; trusted verifier build and verification were skipped.

This is consistent with the explicit NOT-RUN boundary in the PR description: no live admission recovery, candidate build, CCP run, or evidence publication has been authorized for this head. No retry or synthetic status override was performed.

Next safe gate is a separate exact-hash authorization binding:

  • source commit 742ac544ebaedfcc656b683424d9045da30a2b32;
  • absolute candidate binary path and its SHA-256;
  • exact layout-recovery status plan SHA-256 and one apply authorization, if recovery is still required;
  • a separate authorization for the later receipt-producing CCP run and evidence publication.

MarcoPorcellato added a commit that referenced this pull request Aug 28, 2026
## Summary

- add the derived `matrix-v2-legacy-v1` compatibility profile needed to
reproduce the trusted historical Matrix V2 digests without hard-coding
expected output;
- retain current admission and terminal-cleanup behavior while binding
legacy plan, policy, runtime, and receipt provenance;
- make the two Matrix fixture tests use the reviewed writable
`CCP_TEST_ROOT` binding under a read-only repository mount.

## Exact evidence

- head: `faf587890e4f899803f027660bc66452623f405e`
- tree: `4615028176f3d594fbce0554f5e5edecfb802af1`
- candidate SHA-256:
`7cde4c2888721d72fbb8c86b4fdcc75f992050979c5175a5bf10b0cecfa7c6f8`
- plan digest:
`bc348df299ee58ecc8f7cfc7f2dc743b5c03f1a90f7e5dbff45754017955e901`
- receipt ID:
`sha256:65ff7b62fa949b549c87c1d599e76d67ebfa3edb3cc15d0cfae3972fdde236d9`
- receipt raw SHA-256:
`12f6d8988be5dc119eaa469cd3617a0f74e3416f7f66b5155d6cf3e1c1219670`
- public evidence:
`ccp-evidence/faf587890e4f899803f027660bc66452623f405e:.ccp/receipt.json`

The single generation-1 qualification passed formatting,
all-target/all-feature tests, strict Clippy, documentation, and
release-metadata checks. Candidate and installed-stable verification
both returned `PASS` for the same receipt.

## Review boundary

This PR is intentionally draft. It is 32 commits ahead of public `main`
and overlaps parts of the still-open PR #64, so it must not be made
ready or merged until that interaction is reconciled. The qualified
candidate is not installed by this PR.
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.

Diagnose v2 matrix run/verify compatibility failures with actionable evidence

1 participant