Skip to content

fix(vault): index inherited intents so clone + vault sync makes them queryable - #154

Merged
graywolf336 merged 3 commits into
devfrom
fix/vault-sync-intent-manifest
Aug 7, 2026
Merged

graywolf336 merged 3 commits into
devfrom
fix/vault-sync-intent-manifest

Conversation

@vinceblock99

@vinceblock99 vinceblock99 commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

What

atomic vault sync now rebuild manifest.intents from 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 list all worked) but intent list returned nothing and intent show 1 resolved a freshly derived — wrong — prefix.

Root cause: intent list reads the manifest index, and the only writer of manifest.intents was vault_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. And vault 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):

repo B:  vault sync      → Synced 1 vault files
         vault list      → intent entry present
         intent list     → No intents found        ← bug
         intent show 1   → 'VAULT::…::1' not found ← wrong prefix too

Test plan

  • New unit test 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, idempotency
  • New harness item tests/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 by run_all.sh.
  • Full cargo test -p atomic-repository green (831 tests)
  • CLI end-to-end: intent list / intent show 1 work on the receiver; a new local intent allocates the next seq

…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
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.
@vinceblock99
vinceblock99 marked this pull request as ready for review August 7, 2026 01:32
@graywolf336
graywolf336 merged commit 2718499 into dev Aug 7, 2026
8 checks passed
@graywolf336
graywolf336 deleted the fix/vault-sync-intent-manifest branch August 7, 2026 15:43
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.

2 participants