Repository navigation
fix(vault): index inherited intents so clone + vault sync makes them queryable - #154
Merged
Merged
Conversation
…queryable Intent entries can reach the vault without vault_intent_create ever running: clone bootstrap and vault sync deflate inherited .vault/intents/** files straight into redb, but update_manifest_for_store leaves intent summaries to 'higher-level methods' — which never run on the receiving side. The entry existed, vault list showed it, yet intent list read an empty manifest index and bare-number references resolved to a freshly derived (wrong) prefix. vault sync (and clone bootstrap, which shares vault_record_working_copy) now reconciles manifest.intents from entry frontmatter: fills missing summaries, adopts the authoring repo's intent prefix when unset, and advances the per-author seq allocator past inherited keys so local creates cannot re-issue an inherited human key. Authoring-path summaries are never overwritten; the pass is idempotent.
graywolf336
marked this pull request as draft
August 6, 2026 22:40
…ueryable Scripts the clone → vault sync → queryable contract end to end: User A records an intent + memory, User B inherits them via change files, bootstraps, syncs, and must be able to list/show the intent under its original human key (and bare seq), see the memory, create a local intent without re-issuing an inherited key, and sync idempotently. Fails 5 assertions on unfixed dev; 11/11 with the fix.
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.
What
atomic vault syncnow rebuildmanifest.intentsfrom stored intent entries: fills in summaries the manifest is missing, adopts the authoring repo's intent prefix when the local one is unset, and advances the per-author seq allocator past inherited keys. Authoring-path summaries are never overwritten; the pass is idempotent.Why
The clone →
vault sync→ queryable flow was broken for intents. The entry arrived fine (vault list/vault show/memory listall worked) butintent listreturned nothing andintent show 1resolved a freshly derived — wrong — prefix.Root cause:
intent listreads the manifest index, and the only writer ofmanifest.intentswasvault_intent_create— which never runs on the receiving side. The ingestion path (update_manifest_for_store) deliberately leaves intent summaries to "higher-level methods" (_ => {}), so inherited intents existed in redb but were never indexed. Andvault sync's dirty-check only compares disk files vs entries, so it reported "Vault is up to date" and could never repair the gap.Reproduces on dev and on the branch off #150 (two repos +
cp+vault sync, no server needed):Test plan
ingested_intent_is_indexed_by_vault_sync— written first (failed at "inherited intent must appear in the list"), passes with the fix; covers prefix adoption, allocator advance, idempotencytests/harness/26_vault_intent_inherit.sh— scripts the full inherit → bootstrap → sync → query contract (11 assertions). Fails 5 on unfixed dev — including a real human-key collision where a local create on the receiver re-issues the inherited key — and passes 11/11 with the fix. Auto-discovered byrun_all.sh.cargo test -p atomic-repositorygreen (831 tests)intent list/intent show 1work on the receiver; a new local intent allocates the next seq