Skip to content

feat: uteke memory loop — harness-level recall + remember - #90

Merged
ajianaz merged 1 commit into
developfrom
feat/uteke-memory
Sep 18, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/uteke-memory

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

What

Cross-session memory as owner-configured harness behavior (--memory uteke / TOLE_MEMORY), not model tools: pre-turn recall injection + post-session summary, namespace repo-<dir> per ecosystem convention. (Supersedes #81/#89 — both orphaned by the Branch-Naming branch rename; identical changes on a fresh branch so CI fires cleanly.)

Why

The memory tools (uteke_recall/uteke_document) only fire if the model chooses to call them — cross-session continuity needs the harness to close the loop itself: inject relevant memory before the first turn, store a summary when the session settles. tole's equivalent of Hermes Mode C; the piece that makes sessions feel alive.

Changes

  • tole-core/memory.rs: recall/remember_session/format_recall_block over the uteke CLI (scrubbed env, hard timeout, argv-only); fenced injection block with explicit origin/extent markers; single truncation choke point at format time; argv-safe namespace sanitization; fake-binary e2e tests pin the CLI contract
  • CLI: --memory uteke flag (env fallback TOLE_MEMORY, namespace override TOLE_MEMORY_NAMESPACE); injection on the first turn of a fresh session (run/chat); summary on settle (run Final / clean chat exit)
  • Amplification guard (caught in live E2E round 1): the stored summary uses the PRE-injection prompt — otherwise recalled memory gets re-stored inside the summary
  • Host knobs (workspace/mcp/memory) bundled into HostConfig; the too_many_arguments allow is gone
  • Trust notes: host-initiated on both ends (model cannot trigger/suppress); every failure degrades to stderr and the turn proceeds

Testing

  • fmt / clippy -D warnings / test --workspace ✅ locally (8 new memory tests; 103 green in core)
  • Live E2E (release binary, scratch namespace, real bifrost provider): seeded fact recalled → correct answers; summary verified in store with no echo; durable JSONL contains the fenced block; test memories cleaned up afterwards
  • cora review --staged: No issues found

@ajianaz

ajianaz commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

Status: all local gates pass (fmt/clippy/test, cora review clean, live E2E verified), but repo-wide GitHub Actions has not fired any workflow since 2026-09-18 02:12 UTC — pushes, PR creations, and renames after that point produced zero runs (including CLA/PR Checks that fire on every PR). This looks like an org-level Actions policy/pause or a delivery issue, not a problem with this branch. Merge gate (CI green before squash) stays unfulfilled on purpose — merge once Actions fires again; re-run by pushing any commit to this branch.

Cross-session memory as owner-configured harness behavior, not model
tools: the model can neither trigger nor suppress the loop.

- Pre-turn recall (--memory uteke / TOLE_MEMORY): on the first turn of
  a fresh session, prompt-relevant memories are recalled from the
  owner's uteke store and injected into the user message inside a
  clearly marked fenced block; the durable log stores exactly what the
  provider saw. Truncation happens at the single format choke point.
- Post-session remember: when a session settles with a final answer, a
  compact summary (--type context, tags tole,session) lands in the
  namespace. The summary stores the PRE-injection prompt — storing the
  injected block would echo recalled memory back into the store
  (amplification, caught in live E2E round 1 and fixed).
- Namespace follows the ecosystem repo-<dir> convention
  (TOLE_MEMORY_NAMESPACE overrides, argv-safe sanitization); every
  failure degrades to stderr and the turn proceeds without memory.
- Host knobs (workspace / mcp_server / memory) bundled into a shared
  HostConfig so command signatures stop growing per feature; the
  clippy too_many_arguments allow is gone.
- memory.rs: fake-binary e2e tests pin the exact CLI argv contract for
  recall and remember; sanitization and fence formatting unit-tested.

Live E2E (release binary, real uteke store via scratch namespace +
bifrost provider): injected recall answered a fact only present in
memory (BUAH NAGA / Tuesday); summary verified in the store, no echo;
test memories cleaned up afterwards.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 173f949 into develop Sep 18, 2026
16 checks passed
@ajianaz
ajianaz deleted the feat/uteke-memory branch September 18, 2026 03:11
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