Skip to content

feat(vault): add compact memory candidate retrieval - #124

Merged
vinceblock99 merged 1 commit into
devfrom
feat/vault-context-candidates
Jul 28, 2026
Merged

vinceblock99 merged 1 commit into
devfrom
feat/vault-context-candidates

Conversation

@vinceblock99

Copy link
Copy Markdown
Contributor

Problem

atomic vault context currently returns full memory bodies in the first retrieval call. Agent integrations must inject every returned body before deciding which memories are useful. That spends context on unselected knowledge and makes retrieved knowledge look too close to knowledge the agent actually used.

What changed

  • Adds opt-in atomic vault context ... --candidates-only.
  • Returns only ranked metadata: memory ID, kind, path, exact revision, score, and why it matched.
  • Omits bodies, previews, and prompt-ready context from candidate output.
  • Marks candidate metadata as untrusted historical data.
  • Adds an exact pull contract: atomic vault show <PATH> --revision <REVISION> --json.
  • Rejects the pull if the Vault entry changed after candidate selection, without printing the changed body.
  • Labels pulled content as untrusted historical data and includes the exact revision used.
  • Uses read-only repository access and avoids retaining full bodies in compact output mode.
  • Keeps the existing full vault context behavior as the default.

Why

This provides the CLI contract for compact push + agent pull:

  1. Push a small candidate list.
  2. Let the agent select relevant memories.
  3. Pull only the selected bodies.
  4. Preserve the exact revision for lineage and pre-build revalidation.

This reduces prompt usage while keeping candidate retrieval separate from source-memory selection. Sherpa integration will follow in a separate PR.

Testing

  • cargo test -p atomic-cli
  • cargo clippy -p atomic-cli --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • RUSTDOCFLAGS="-D warnings" cargo doc -p atomic-cli --no-deps
  • Real CLI E2E: candidate retrieval → exact pull → lowercase revision → Vault update → stale revision rejection with no body leak
  • Manual E2E: candidate retrieval → exact pull → Vault update → stale revision rejection
  • git diff --check

All 1,648 Atomic CLI unit tests and the new command-level E2E test pass.

@vinceblock99
vinceblock99 merged commit 14f3957 into dev Jul 28, 2026
8 checks passed
@vinceblock99
vinceblock99 deleted the feat/vault-context-candidates branch August 12, 2026 13:15
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.

1 participant