Repository navigation
feat(memory): add Dreaming in propose mode, an approval list nothing applies - #35789
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the flag is opt-in and defaults to Notes
[DESIGN-REVIEWED] c96f91c Description read[DESCRIPTION-READ] f70c3759eabde6a975037b75f646645187bbca6460dbeba515ee11d18767c300 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS One premise to recheck: a key-word work-state classifier that Notes
What this change shipsInventory (10 items) — 9 justifiedIntent: let an operator collect a nightly list of proposed memory cleanups (duplicates, stale rows) without anything being changed, so a later apply decision has data. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] c96f91c Description read[DESCRIPTION-READ] 2dd032c6f55f437dccf95384798e3d6fcc1f35034e6ccd78c83893899b977d7b That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
9648450 to
349fe90
Compare
|
self-added: no
|
Code change approver recommendation: A person should decideWhy: the decider thinks the change is probably fine but estimates a 28% chance that this change introduces a defect, above the 12% limit for approving on its own. Approving. The flag defaults to off, and propose writes only memory_dream:* keys in memory_meta, in one BEGIN IMMEDIATE transaction. A pure gate re-reads each cited row while that transaction is open. Taught and quoted (L1/L2) rows are never folded and never reach the model. The model call is tool-free, quotes the rules as data, and a merged sentence that adds new content words is refused. Going back to off, cancellation, interrupted runs, manual requests and per-store failures are all handled. CLI list opens the file read-only and sanitises its output. Config, parser, baseline and docs are complete. The earlier blocking finding (spec vs code on which turns count as busy) is fixed at this head: the spec now matches the code. Every CI check, including the tests, was still pending, so no test results were seen. Remaining concerns are design trade-offs, recorded below as non-blocking notes. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
1aa7bcc to
55e9aaa
Compare
|
self-added: no
|
55e9aaa to
80d3431
Compare
|
self-added: no
|
|
self-added: no
|
bolichen97
left a comment
There was a problem hiding this comment.
Thanks. I read the whole product diff on this head. The scope matches the signed Dreaming review-surface RFC (#35288): memory.dream defaults to off, unknown values read as off, off returns from gateway_visit after reading only the flag, and propose writes only memory_dream:* keys in memory_meta inside one transaction. No memory row, revision or record metadata is written, and L1/L2 rows are never in changes or sent to the model. Checks are all green.
One blocker: this project does not accept new regex in product code, and memory_dream.py adds two:
_STATE_KEY = re.compile(...), used byis_work_state_key._DIGITS = re.compile(r"[0-9]+"), used byfamily_of.
Please replace both with plain string code and drop import re:
is_work_state_key: split the key afterproject.on.and_into parts. For each part, take the text before its first ASCII digit and check it against afrozensetof the state words. Check the two-word entries (pr_number,pr_status,next_action,next_step,next_steps,in_progress) by joining each pair of neighbouring parts with_.family_of: walk the key one character at a time and write#once for each run of characters in"0123456789". For example, useitertools.groupby(key, lambda c: c in "0123456789"). ReturnNonewhen no run was found.
The existing tests for work state and numbered families should cover the change as they are. Everything else looks good to me, and I will approve once the regexes are gone.
80d3431 to
c1dc118
Compare
|
@bolichen97 Thanks. Both regexes are gone on head c1dc118, and
The existing work-state and numbered-family tests pass unchanged (48 passed in |
c1dc118 to
f3f5448
Compare
f3f5448 to
43a1c0c
Compare
|
Re the Opus 5.5 blocking finding at A failed merge call now returns the same interrupt marker as a timed-out call ( |
|
@bolichen97 Both regexes are gone ( |
43a1c0c to
4e31299
Compare
|
@bolichen97 Rebased onto main to clear a conflict in |
4e31299 to
7c7aa19
Compare
|
Re the Opus 5.5 blocking finding at
|
7c7aa19 to
486ea92
Compare
486ea92 to
c96f91c
Compare
|
Re the Opus 5.5 finding at |
bolichen97
left a comment
There was a problem hiding this comment.
Thanks, approving. Both regexes are gone and import re is dropped from memory_dream.py. I re-read the product changes between the head I reviewed (80d3431) and this one:
is_work_state_keysplits the part afterproject.on./_, cuts each part at its first ASCII digit and checks it against_STATE_WORDS, with neighbouring pairs against_STATE_PAIRS. That matches the same keys the old pattern did, including a word followed by a digit (pr2,next_steps3).family_ofusesitertools.groupbyover"0123456789"and returnsNonewith no run, as before.- A failed merge call now returns
_TIMED_OUT, so the run stops and the watermark stays before that pair, and the next run asks again rather than skipping it. person_turn_runningnow reads the gateway's own_in_flight_work_countscensus. It counts background turns too, which only makes runs rarer, and any failure still reads as busy.kirocrew memorywith no verb prints usage without opening, and so creating, a store.- The watchdog and Slack field changes in
section_builders.pyand the help-text tweak come from the rebase onto main.
The direction is the one signed on #35288, memory.dream still defaults to off, and propose still writes only memory_dream:* meta. All checks are green.
Problem / Motivation
Goal: Ship the memory RFC's stage R6 (Maintain: Dreaming) in
proposemode only, behindmemory.dream, defaultoff: an idle-time pass that writes an approval list and never changes a memory row.Admit, Identify and Select slow the rule pool's growth and order what is shown, but none of them shrinks it. The measured rule pools are 172,873 and 162,683 characters against a 37,000 cap. RFC section 7 makes Maintain (Dreaming) the only stage that may change existing rows, and says it ships last, in
proposemode only.Why it matters
R6 is not signed, and it is the higher-risk stage: the only one that would change stored rows and the only one where a model proposes edits. Its pass metric (RFC 7.9) needs approval lists, logged refusals and decline/open rates before anyone can decide to apply anything. Without a propose-only pass that produces them, that decision has no data. With the flag
offthis PR changes nothing.Not a goal
applymode, nopropose_conflictreview items, no Memory page filter or notification, no wake check (RFC 7.7, 7.8). Those come with the stage that applies.confirm,flag,correctandsupersedefrom session excerpts. It is a follow-up.What changed (motivation → approach → change)
R6 ships propose-only and off by default, so its sign-off can read real approval lists.
memory.dream:off(default) orpropose. Unknown values read asoff. Underoffthe gateway's repair loop reads the flag and nothing else.kirocrew memory dream runasks for a run now; the gateway still takes the lock and waits for idle.leader_fold; the 0.90-0.95 band; work-stateproject.*keys; numbered key families; legacy rule-tier L3 lessons proposedon_topic. User-taught (L1) and user-quoted (L2) rows are leaders that are never folded or sent to the model. A copy with a NOT-clause its partner lacks is not proposed; an uncertain pair with no merge is still judged on its tier.memory_metaonly, ids and counts plus a proposed merged sentence, under the kind-routing caps. Nothing is applied.kirocrew memory dream listprints it read-only.Where:
src/kiro_crew/memory_dream.py(the pass);src/kiro_crew/slack/gateway_runtime/memory_lifecycle.py(repair-loop hook);src/kiro_crew/cli_commands_memory.py,src/kiro_crew/cli_parser_agent.py(memory dream run|list),src/kiro_crew/cli_commands.py(facade forward);src/kiro_crew/config/memory_sections.py,src/kiro_crew/config/section_builders.py,config-baseline.json;docs/request-for-change/rfc-memory-injection.md;docs/system-specs/modules/cli.md,docs/system-specs/modules/config.md,docs/system-specs/modules/memory-skills-hooks.md;src/kiro_crew/docs/configuration.md,src/kiro_crew/docs/memory-and-learning.md.R6 is not signed in the RFC (section 6, "Signed scope": only R1 is signed). This PR ships it
off, propose-only, so its sign-off can read the lists it produces.Modes
memory.dreamhas one mode per row. This PR shipsoffandproposeonly. The other two are follow-up PRs and are not in this one; until they land, any other value reads asoff.off(default)proposememory_dream:*keys inmemory_meta. Never changes a memory row.shadow_applyapplyshadow_applypasses and a person approving the batch. Runs the same wake check on the real store and reverts from revisions on failure.Moving between modes:
kirocrew config set memory.dream <mode>. Back to off at any time:kirocrew config set memory.dream off. No restart: the gateway's memory repair loop reads the flag live.proposeleaves only itsmemory_dream:*keys behind, so going back tooffleaves every memory row as it was.Local comparison
kirocrew config set memory.dream propose(back withkirocrew config set memory.dream off). No restart: the gateway's memory repair loop reads it live.kirocrew memory dream run. It leaves~/.kiro/crew/memory-dream.request; the gateway's next memory visit (within a minute) runs every open store once, under~/.kiro/crew/memory-dream.lock, only while no chat turn is running.memory_metatable, keysmemory_dream:proposals,memory_dream:runs,memory_dream:stateandmemory_dream:counts:<day>. The default store is~/.kiro/crew/memory.db; a private store is~/.kiro/crew/memory_stores/<store>/memory.db. No other row changes.kirocrew memory dream list(add--store <name>or--json), orBackwards compatibility
Compatible: the setting defaults to
off, which reads nothing but the flag; the repair loop, consolidation and every write are unchanged.kirocrew memory dreamis a new verb.Removes nothing:
proposewrites only newmemory_dream:keys inmemory_meta; no memory row, revision or record metadata is written, retired or re-tiered.Tests
test/test_memory_dream.py(48 tests):off, unknown values (includingapply) readoff;off: a visit reads nothing (the data home and store listing raise if touched) and schedules nothing;memory_store, the default store without, and an unreadable store kind skips the model;Determinism: rows get strictly increasing stamps and runs take a fixed clock, so no assertion rests on the wall clock. 10 serial runs, a shuffled order, and
-n 4besidetest_memory_lesson_dedup.py, all green.Manual verification
N/A — unit coverage sufficient: the flag defaults to
off, and a run is started per install after merge with the commands above.Related Issues
Part of #34242
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)