feat(reflect): make reflection evolution-aware (revise/close desires)#246
Closed
oratis wants to merge 1 commit into
Closed
feat(reflect): make reflection evolution-aware (revise/close desires)#246oratis wants to merge 1 commit into
oratis wants to merge 1 commit into
Conversation
Reflection could only desire_add, and was never shown the desires it already had — so it appended near-duplicates and the set only ever grew, never evolving. Two changes fix that: 1. Feed the current desires into the reflector prompt (slug + what + why + actionable), so it can target existing ones instead of guessing blind. 2. Add two operations: desire_revise (read-modify-write by slug; only the supplied fields change, bornAt/slug are identity) and desire_close (soft close: actionable=false + [CLOSED:<outcome>] progress note + journal line; the file is retained and git-tracked, so it's reversible and nothing is destroyed — preserving soul sovereignty). Guidance now tells reflection to prefer revising/closing over piling up duplicates. The close logic is factored into store.closeDesire(), shared by both reflect's desire_close op and the existing desire_close tool (which is refactored onto it — one path, no duplication). PR 2 of 3 from docs/PLAN_DESIRE_EVOLUTION_v1.0.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
oratis
force-pushed
the
claude/desire-reflect-evolve
branch
from
July 14, 2026 17:23
0c6d510 to
873aa85
Compare
This was referenced Jul 15, 2026
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.
Why
Reflection is the path that turns a conversation into a desire — but it could only
desire_add, and it was never shown the desires it already had. So it appended near-duplicates blind, and the set only ever grew. Combined with the display always surfacing the same filesystem-first actionable desire, this is a second reason the "wish" felt frozen (root cause #3 in the plan doc).What
## your current desiresblock (slug + what + why + actionable) is added to the reflector prompt, so it can target existing ones instead of guessing.desire_revise { slug, what?, why?, actionable?, heartbeat_prompt?, pursuit? }— read-modify-write by slug. Only the supplied fields change;bornAt/slugare identity; anundefinedin the patch never wipes an existing value; throws if the slug doesn't exist (no accidental create-via-revise).desire_close { slug, outcome, reflection }— soft close:actionable=false+ a[CLOSED:<outcome>]progress note + a[DESIRE_CLOSED]journal line. The file is retained and git-tracked — reversible, nothing destroyed. This is the guardrail that lets reflection prune without violating soul sovereignty.store.closeDesire(), now used by both reflect'sdesire_closeop and the pre-existingdesire_closetool (refactored onto it — removes the duplication).Design rationale (正反方辩论)
The plan doc's Debate 2 weighs append-only (protect sovereignty) vs allow revise/close (enable evolution). Decision: allow, behind four guardrails — reflection is shown existing desires (informed, not blind); close is soft; no hard-delete op exists; every change is git-committed and recoverable. Full debate in
docs/PLAN_DESIRE_EVOLUTION_v1.0.md§4 (landed in #242).Testing
src/soul/desire-evolve.test.ts— 7 tests: partial revise preserves untouched fields + identity,undefinednever wipes, dormant→actionable flip becomes auto-pursuable, soft-close retains the file + writes progress/journal notes, both throw on unknown slug.npm test: zero regressions — same 5 pre-existing failures asmain, +7 new passing tests. Typecheck clean (pre-existingimapflowoptional-dep error only).Merge order
Independent of #242, but the series reads best merged #242 → this → (PR3).
🤖 Generated with Claude Code