Repository navigation
Conversation
Yehonal
left a comment
There was a problem hiding this comment.
Not ready: 2 blocking findings at head 58b57be. The CAS change looks right on reading, but CI test is red and the new tests do not run, so none of it is proven yet.
Blocking
- The new regression test fails on every case (11/11).
test/managed-block-metadata-cas.test.ts:27writes the install manifest withrevision: "pending", andwriteInstallManifestrejects it (ZodError: revision … >=16 characters,src/install/manifest.ts:124). I reproduced it locally on this head and CI shows the same. Other fixtures use e.g."pending-fixture-revision"(run-as-metadata.test.ts:54). Because the fixture never gets past setup, there is currently no evidence that the 8,593-byte case fails onmainand passes here. - Two
ownership-handoff-audittests fail in CI.vi.spyOn(fs, "open")attest/ownership-handoff-audit.test.ts:78throwsCannot spy on export "open". Module namespace is not configurable in ESM. The "preview is read-only" proof therefore does not run. Usevi.mock("node:fs/promises", …)with a passthrough, or compare tree snapshots plus anstrace-free check such as a read-only directory, instead of spying on the namespace.
What I checked by reading (looks correct, pending green tests)
- CAS block vs block. Guards with
managedBlockcompareexactManagedInstructionBlockSnapshot(...).hashwithguard.hash. The snapshot digest, theshaformat checks, the full canonicalmanagedBlockcomparison and the inventory revision guard are all still there. - No weakening elsewhere. Whole-file and no-block guards still use
transport.hashPath.retire-stale,migrate-legacy,handoff-auditandreleasenever setmanagedBlock, so they keep the whole-file path. Onlyadopt-legacynow stores the block hash. - Preview.
previewMetadataJournalrefuses journals with operations or completions, runs the guards withreadOnly, and takes no lock or write in the code I read. This is the part to re-check once the test actually runs.
Question, not blocking by itself. A journal created before this change (like the existing partial 28e2a9b0) holds a whole-file guard.hash together with managedBlock. After this PR the CAS compares that value with the block hash and would still fail. The PR text mentions resolving older block guards from the verified inventory, but that logic is not in this head (maybe in the expected b9c4c19). Please make sure the final head covers it, with a test that loads such a legacy journal.
Re-review on the next head once test is green.
Generated by Claude Code
Managed instruction metadata transactions compared a recorded block hash with the whole live file hash, rejecting valid files containing surrounding guidance. Compute the CAS hash from the selected live block, preserve exact snapshot and inventory checks, and resolve older block guards from their verified inventory. Entire-file guards retain file hashing.
Add
mutation recover-runtime --dry-runand matching previews onmutation recoverandmutation finalizefor guarded zero-operation metadata partials. The preview reads receipt-bound journals and guards without locks, writes, or revision-provider calls; it identifies runtime recovery as the required next command and leaves normal partial-finalization refusal intact.Regression coverage includes 8,593 bytes before a managed block, block/file hash separation, altered blocks and snapshots, legacy journals without a selector, and API/CLI previews with unchanged files and rejected write calls. Validation runs in CI (typecheck, build, full test suite and CLI smoke checks).
No merge or runtime installation is included.