Repository navigation
land: engram-catalog-startup - #498
Merged
Merged
Conversation
The daemon (subc and standalone) now writes <storage root>/engram-catalog.json once at startup, derived from the per-harness backups folders that exist at that moment (device-local filetree entries, keeping the ids of the hand-written catalog). The write is atomic, skipped when the bytes match, refused for dev/test builds pointed at the account's real storage, and never fails startup. Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
…ib.rs Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
The startup catalog now declares, for whatever exists at write time: - aft.db as device-local page-db with writer_interaction read-transaction-live (ENGRAM's agreed wording; sidecars are never declared on their own); - trusted-filter-projects.json as a device-local single-file filetree; - per-harness checkpoints and bash-tasks, the root-level legacy copies, logs, diagnostics, caches and generated shims as excluded, each with a reason. Undo backups (<harness>/backups, backups.parked-*) are now excluded with the reason "earlier copies of edited files; may include secrets", by decision, under exactly the ids they had before, so ENGRAM records the change on the same entries. The class lives in UNDO_BACKUPS_CLASS. todays_backup_folders_keep_todays_entry_ids keeps asserting the same ids and paths but now expects the excluded class and reason; the old golden bytes test became a_backups_only_tree_renders_exact_bytes for the same reason. Two fixes to the writer: - the catalog is written only when the storage root's folder is named aft; ENGRAM looks only at <fleet data home>/<module id>/ and rejects a module_id that differs from the folder name, so an AFT_STORAGE_DIR elsewhere now gets one info log and no file; - ids are kept per path from the catalog already on disk, so removing one of two MCP folders that share a readable client name no longer renames the survivor. Fresh ids avoid kept ones; an unreadable or malformed previous catalog starts ids fresh with a warning. only_folders_that_exist_are_declared used semantic/backups as its "not a harness" fixture; semantic is now an excluded cache, so the fixture is not-a-harness/backups (same property). Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
The startup catalog runs before a fresh machine has aft.db, so the db entry stayed absent until the next daemon restart. App::open_db now refreshes the catalog after it creates the database file (outside the database slot lock). write_catalog_at_startup is renamed refresh_catalog since it is no longer startup-only. Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.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.
Accepted agent delivery; branch-keyed search descriptor included.
Summary by cubic
The daemon now writes the ENGRAM backup catalog (
engram-catalog.json), so a freshly provisioned machine is covered without a hand-written file. Previously the catalog only existed when written manually; now every subc and standalone startup derives it from what is on disk, and sensitive folders are no longer captured.aft.dbis captured page by page, and creating the database refreshes the catalog so a fresh machine's database is declared right away instead of at the next restart. Undo history, checkpoints, task output, logs, diagnostics, caches, and generated shims are declared excluded with a reason.aft/backups-mcp-claude-code), so ENGRAM records the switch to excluded on the same entries. Ids are otherwise kept per path from the catalog already on disk, so removing a folder never renames a survivor.aft, since ENGRAM looks nowhere else. The write is atomic, skipped when the bytes are unchanged, refused for dev/test builds pointed at the account's real storage, and never stops startup on failure.Written for commit 4eb289d. Summary will update on new commits.


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues were found.Summary
The daemon now writes
engram-catalog.jsonat startup from paths that exist on disk.All three earlier findings are addressed: unsupported roots are skipped, surviving folders keep their IDs, and newly created databases are declared.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Daemon starts] --> B[Write catalog for existing paths] B --> C[Accept requests] C --> D[Open aft.db] D --> E{File was missing?} E -->|Yes| F[Refresh catalog with database entry] E -->|No| G[Reuse existing catalog]Reviews (3) · Last reviewed commit: "engram catalog: declare aft.db as soon a..." · Reviewed by Greptile