Repository navigation
feat(memory): type write-sessions as decision in the memory loop - #151
Merged
Merged
Conversation
Sessions that executed a Write/Destructive tool are stored to uteke with --type decision and a wrote tag; plain context sessions keep the old shape. The flag is a durable, session-scoped fact register set wherever such a tool settles (fresh execution and crash-replay), so it survives resume boundaries — the two cora findings on the first cut (in-RAM flag dying at resume; replayed writes invisible) are fixed and regression-tested. Summary content contract unchanged (prompt+answer only), so the injection-into-memory surface stays closed. Closes #143
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
ajianaz
added a commit
that referenced
this pull request
Oct 1, 2026
This was referenced Oct 2, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What (description of the change)
Memory-loop decision typing (#143): a session that executed any Write/Destructive tool is stored to uteke with
--type decisionand awrotetag; plain context sessions keep the exact old shape (--type context, tagstole,session).drive()surfaces the flag onTurnOutcome::Final { text, wrote };resume_turnreplays inherit it.fact.wrote_this_turn): set wherever such a tool settles — fresh execution AND crash-replay — and never reset by turn machinery. A session that ever wrote is a decision session, including across aborts (post-Provider 502 mid-turn wedges session at pc=Planning; recovery is interactive-only #84 pc=Final) and prompt-resumes.remember_sessionpicks type/tags from the flag. Content contract UNCHANGED: first prompt + final answer only — no raw tool output, no extra LLM call (v0 scope; injection-into-memory surface stays closed, noted indocs/threat-model.md).chat_wrote.Two cora pre-commit MAJORs on the first cut, both real, both fixed with regression tests: (1) the in-RAM flag died at resume boundaries and replayed Writes were invisible → durable session-scoped register + ReExecute-path flag set; (2) the chat summary missed writes from turns that aborted before Final → fold the durable register after every outcome.
Why (the problem you're solving)
Comprehension-debt research (Oct 2026): decision journals are the organizational antidote. Tole's memory loop already persists session summaries; typing write-sessions as
decisionmakes "recall every decision in this repo" a first-class uteke retrieval instead of an undifferentiated context stream. Smallest possible change; lands first in the 0.5 train (#143 → #145 stacks on these files).Testing (how you verified this works)
wrote=trueon Final; read-only →false; abort after a Write keeps the session flag (post-Provider 502 mid-turn wedges session at pc=Planning; recovery is interactive-only #84 semantics); Settling-crash resume inherits the flag (built via realbegin+settle_okhelpers); guarded replay of a Write tool reportswrote=trueand leaves the register true (e2e_resume); fake-binary argv asserts tole passes--type decision --tags tole,session,wrote(and the unchanged context shape otherwise).--workspace --all-targets -- -D warningsclean; fmt clean; cora review "No issues found".--memory uteke): a write mission stored the summary taggedtole,session,wrote— verified viauteke recall --jsonin the session namespace. KNOWN FLEET LIMITATION (not a tole bug): uteke CLI 0.19.0 silently normalizes--type decisiontofacton the plain (non-room) remember path — tole sends the flag correctly (unit-pinned); upstream issue filed in codecoradev/uteke. Until the CLI honors it, the reliable discriminator is thewrotetag.