Skip to content

feat(memory): add scoped user-controlled memory records - #6970

Merged
chinawch007 merged 3 commits into
apache:rust-previewfrom
chinawch007:feat/ordinary-memory-pr1
Nov 17, 2026
Merged

chinawch007 merged 3 commits into
apache:rust-previewfrom
chinawch007:feat/ordinary-memory-pr1

Conversation

@chinawch007

Copy link
Copy Markdown
Contributor

Summary

Add durable, user-controlled memory records to the Agent Host on rust-preview, including provenance tied to the exact body version. Users can save, correct, pin, delete and explicitly restore an item; revision checks reject stale edits, and state survives restart.

Refs #6959

  • Store records, immutable assertions, semantic/time metadata, correction relationships and incrementally paginated evidence in the existing Root database. Manual input retains its actual Host operation as its source.
  • Resolve selected conversation text through memorySource. changeMemory.add_evidence verifies the owned message, immutable fact identity, fingerprint and exact UTF-8 span at commit. Evidence stays attached to its original assertion when the body changes; appending evidence preserves management mode and priority timestamps.
  • Enforce Host/Agent and personal/project scope, commit-time workspace bindings, both model-read switches and an immutable session Incognito boundary inherited by derived sessions. Models cannot use the user-management mutation path.
  • Reuse Host mutation receipts and recovery, expose bounded detail/list/history/evidence APIs, and update generated SDK declarations and bilingual technical documentation.

user_always records the user's management choice. Model context projection, semantic reconciliation, Recall integration, automatic extraction and the full management UI remain subsequent PRs. Verified provenance establishes the authenticity of a quotation; it does not claim semantic entailment.

Migration and retention

Root migrations 43–45 add records, assertion metadata and evidence associations. Existing PR1 databases retain their bodies; unknown metadata becomes unspecified, and existing user-operation sources are backfilled into the evidence table. This does not import main's earlier memory database.

Delete suppresses records and their versions, removes always mode, and retains matching content without a TTL. Ordinary detail, list, history and evidence APIs hide suppressed bodies. Explicit restore creates a new assertion and source; it does not expose suppressed history. Receipts retain IDs and revisions without another readable body copy. Incognito restricts memory use and sourcing; it does not erase chat history.

Verification

  • Library tests: 53 passed across facts (32), API (2), state (14) and app-client (5), including existing-data migration, evidence validation/versioning, deletion visibility and client operation recovery.
  • Complete native library suite: 105/105 passed. preset_execution_uses_durable_role_and_explicit_model_selection encountered Application channel ended before a complete frame; it then passed two consecutive isolated nextest runs without a code or timeout change. The initial interruption remains undiagnosed.
  • Final memory/project-scope regression filter: 5/5 passed, covering real Host/Agent boundaries, conversation evidence, Incognito and fork inheritance, original receipt recovery, restart and project binding checks (plus one inventory test matched by the filter).
  • cargo check --offline -p maka-app-client -p maka-cli -p maka-workbench --tests -j 1: passed.
  • Generated SDK consistency (5 files), SDK acceptance/product bundle TypeScript, cargo fmt --all -- --check, diff whitespace and staged new-file ASF headers: passed.

Repository-wide just check and all CI shards were not run. The suite checklist below remains unchecked because the complete native invocation returned a failure, despite successful isolated reruns.

AI use

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

Tool(s) and scope: OpenAI Codex contributed to implementation, tests, technical documentation and this PR description. Material implementation commits carry Generated-by: Codex; preserve the trailer in the squash commit.

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

Add Root-backed memory management with revision checks, versioned user sources, suppression retention, scoped access and body-free Host receipts. Connect memory preferences and client recovery, with Host and storage coverage.

Generated-by: Codex
@chinawch007
chinawch007 merged commit 9ac917f into apache:rust-preview Nov 17, 2026
3 of 9 checks passed
M4n5ter added a commit that referenced this pull request Nov 17, 2026
… targets

- Rebase onto rust-preview (#6970) and document scoped memory records and create.incognito in plugins/agent/README*.

- Fix stale test commands in products/maka/README*, products/maka/bundle/README*, and scripts/rust/README*.

- Fix --browser chromium placement in platform/computer-use/README*, MCP config paths (.maka/mcp.json / .agents/mcp.json), summarize.py --output flag, OperationObserved enum name, Node.js 24+ prerequisite, and CLI README parity.

Generated-by: Maka (Antigravity / Gemini)
Astro-Han added a commit that referenced this pull request Nov 17, 2026
#6970 added the required `incognito` field to `Create`, while #6958
added a `Create` literal for the SessionCreate tool without it, so
rust-preview stopped compiling. The tool does not let the model opt in;
`creation_policy` still makes a child incognito when its caller is.

Generated-by: Claude Code
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