Skip to content

# feat(recall): retrieve effective memories with suppression guards - #7147

Merged
chinawch007 merged 4 commits into
apache:rust-previewfrom
chinawch007:feat/ordinary-memory-pr3
Nov 21, 2026
Merged

chinawch007 merged 4 commits into
apache:rust-previewfrom
chinawch007:feat/ordinary-memory-pr3

Conversation

@chinawch007

@chinawch007 chinawch007 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A corrected or deleted memory could still turn up in a search through an old conversation or tool result. This change makes the current assertion discoverable and applies its evidence restrictions when the model follows a historical reference.

  • Extend agent.recall and the model-facing Recall tool with a separately paginated facts result. Each fact includes its scope, record revision, assertion version and readable sources. Existing title and passage matches remain available.
  • Resolve personal and project scope at read time. Search an FTS5 index of current assertions, check their validity window, and fetch a bounded page of evidence. Corrections and deletions update the index in the same transaction as the write.
  • Apply evidence restrictions to history search, source expansion, archive reads, copied attachments, tool replay and delegated-run excerpts. Live, snapshot and imported history readers share an indexed lookup for restricted ranges. History reads derive masking from the caller’s identity. Masking a quote preserves unrelated text and its original byte offsets. A stale tool result can require a fresh read.
  • Stop formatting the model-facing Recall text when the page is full. The next page resumes at the UTF-8 byte offset in output_offset. The tool still returns the full structured result for the query.
  • In Workbench, changing the query or conversation scope clears the previous result list immediately. The user's original conversation remains available for direct inspection.

Verification

At 3e5433feeb, all nine focused cargo nextest tests passed across maka-agent-state and maka-agent-native. They cover upgrade and reopen from version 50, migrated and newly written history, replay of tool aliases, partial masking of UTF-8 text, and stopping at a text page boundary while preserving the continuation offset. Rust formatting and the PR diff whitespace check passed.

The pre-refactor build also passed 113 state, facts and assistant tests, 34 selected native agent tests and the Workbench desktop test. The desktop screenshots show results from two conversations and the empty list while the new scope is loading. The contract and TypeScript checks, strict Clippy for the state and native crates, and the source-archive license check passed on that build. The full workspace just check was not run.

image image

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

OpenAI Codex contributed to the Rust implementation, migrations, regression tests, rebase and PR description. All three commits include the Generated-by: OpenAI Codex trailer.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Index current scoped assertions and resolve evidence at read time. Apply the same restrictions to historical passages, model replay, source expansion and copied attachments.

Generated-by: OpenAI Codex
Build the final Recall schema and backfill existing records directly from migration 0050. Exercise the same baseline for upgrade and replay tests.

Generated-by: OpenAI Codex
Share indexed evidence range lookups across history readers and derive redaction from the caller's scope. Stop formatting Recall text when the requested page is full while preserving byte offsets and the structured result.

Generated-by: OpenAI Codex
Create Recall projections without backfilling existing memories or history. Preserve the upgrade boundary across history rebuilds and use the recorded tool classification during replay.

Generated-by: OpenAI Codex
@chinawch007
chinawch007 merged commit 59943c5 into apache:rust-preview Nov 21, 2026
13 of 14 checks passed
M4n5ter added a commit that referenced this pull request Nov 22, 2026
…on, and retire lock race

Fix the three remaining CI failures on rust-preview:

- `maka-agent-engine` (`driver::witness::tests::*`): supply valid JSON
  `{"services": []}` for `RunSpec.tool_selection` instead of empty non-JSON
  bytes so the `agent_memory_read_alias_insert` trigger added in #7147 does
  not fail with SQLite `malformed JSON`.
- `maka-agent-native` (`ax_session_tools::universal_read_and_human_symmetric_session_tools_coordinate_rooms_and_workers`):
  align Step 7 with #7147's history-reader suppression guard—assert that the
  parent's history-resource `Read("maka://...")` omits `resultPath`/`status`
  for Agent callers, and assert via Agent `SessionRead({ sessionId: child_id })`
  that an ordinary workspace `Read("checklist.txt")` retains `resultPath`.
- `maka-cli::integration` (`initialize::public_init_persists_settings_from_stdin_and_rejects_reconfiguration`):
  wait until the retired host actually releases the `RootOwner` lock before
  testing reconfiguration rejection and reopening the store.

Generated-by: Maka (Gemini)
M4n5ter added a commit that referenced this pull request Nov 22, 2026
…es (#7151)

* fix(desktop): await pasted drafts before pane switches and submission

Restore desktop.type_text(...) at four call sites in desktop_new_session.rs
that immediately press an already-visible submit/close button or switch pane
focus after pasting, eliminating the Windows CI paste/focus race.

Closes #7067

Generated-by: Maka (Gemini)

* test(ci): fix witness JSON fixture, SessionRead suppression expectation, and retire lock race

Fix the three remaining CI failures on rust-preview:

- `maka-agent-engine` (`driver::witness::tests::*`): supply valid JSON
  `{"services": []}` for `RunSpec.tool_selection` instead of empty non-JSON
  bytes so the `agent_memory_read_alias_insert` trigger added in #7147 does
  not fail with SQLite `malformed JSON`.
- `maka-agent-native` (`ax_session_tools::universal_read_and_human_symmetric_session_tools_coordinate_rooms_and_workers`):
  align Step 7 with #7147's history-reader suppression guard—assert that the
  parent's history-resource `Read("maka://...")` omits `resultPath`/`status`
  for Agent callers, and assert via Agent `SessionRead({ sessionId: child_id })`
  that an ordinary workspace `Read("checklist.txt")` retains `resultPath`.
- `maka-cli::integration` (`initialize::public_init_persists_settings_from_stdin_and_rejects_reconfiguration`):
  wait until the retired host actually releases the `RootOwner` lock before
  testing reconfiguration rejection and reopening the store.

Generated-by: Maka (Gemini)
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