Repository navigation
feat(migration): apply reviewed graph layer manifests transactionally - #181
Merged
Merged
Conversation
The read-only inventory can now be applied only through an exact-manifest confirmation token and an explicit decision policy. Apply verifies the DB fingerprint, candidate ownership, layer and IDs before any write; takes a private 0600 SQLite snapshot under BEGIN IMMEDIATE; verifies the snapshot matches the reviewed fingerprint; moves only approved node layers in one transaction; and checks every moved and unapproved node's layer before commit. Edges are never rewritten — resulting cross-layer links are reported. Recovery is part of the commit boundary: a fsynced recovery report is staged before SQLite commits; if final installation fails the path is reported, and if writing or fsyncing the report fails the DB transaction rolls back. Snapshot reservation is exclusive and atomic, and all snapshot/report destinations are checked against the DB, WAL/SHM/journal and each other. No live base is touched by this PR. The tool is exercised only against temporary copies; running it on Hermes/Mimocode/CowAgent still requires a reviewed manifest and the separately approved MIGRATE-<database>-<manifest-sha> token.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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.
Scope
This PR completes the apply half of the graph-layer migration tool. It does not touch Hermes, Mimocode, CowAgent, or any live database.
The operator flow is now:
inventory— read-only snapshot + evidence manifest;decisionvalues in the exact manifest;confirm-token --manifest PATH— token from the exact reviewed bytes;apply --confirm TOKEN— snapshot + lock-time fingerprint + transactional move.Safety properties
BEGIN IMMEDIATEbefore the authoritative snapshot;0600snapshot reservation, SQLite backup including WAL, file+directory fsync;user → agentnode layer changes;epi_edgesnever modified;Verification
The blind verifier exercised 22 preflight/postcondition guards with mutation probes. The final cleanup verifier additionally proved:
Explicit non-goal
No live apply is performed by CI or this PR. After merge, we will run inventory with the approved marker/exclusion files, review the three manifests, then request a separate explicit write authorization before applying to each base.