Skip to content

feat(decisions): let Jev narrow what the memory_recall tool returns - #12492

Merged
chenmingwei23 merged 2 commits into
mainfrom
feat/decisions-memory-recall
Sep 22, 2026
Merged

chenmingwei23 merged 2 commits into
mainfrom
feat/decisions-memory-recall

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

The gap

The agent recalls memory on demand, through the memory_recall tool: the tool calls GET /api/memory/recall, the route calls VectorMemoryStore.recall, and that searches episodes by vector similarity, drops what falls under the length-aware cosine relevance gate, and bounds the survivors with its own fit walk.

Similarity is a useful first pass and a poor last one. An entry that happens to share the question's words comes back whether or not it answers it — and every returned episode is paid for twice, once out of the tool's response budget and again out of the model's window.

What this adds

A fourth Jev decision point, memory.recall. When the tool runs its search, the point asks the oracle the second question, per candidate: keep this one, or drop it. The tool returns Jev's kept set.

memory · recalled: 6 · Jev kept: 3 (0.81, 210 ms) · saved 2.1K chars

Where the seam is, and where it deliberately is not

VectorMemoryStore.recall(keep=...), armed by handlers/memory_member._memory_recall_keep. The recall route is the one place with all three things the point needs: the session key (from X-Session-Key, which the MCP tool sends), the event loop, and the run_in_embed_pool call that puts recall on the worker thread the point must run from.

Not on get_episodic_context. An earlier revision of this PR put it there, and a reviewer was right that it made the feature unreachable: prompt assembly asks MemoryStore.get_context for preferences with include_activity=False, and that same flag gates episodic retrieval, so that block is not built on any live path. That flag is deliberate — #11996 moved recalled material to the tool — so the fix was to follow the recall, not to re-enable the block.

A keep= parameter on a path nothing walks is a second door the next reader takes for a live one, so there is none. Three assertions pin that it stays absent, along with get_context's carried hook and ContextBuilder's hook builder.

A subset, enforced twice

It cannot reorder — a keep/drop answer says nothing about rank.

It cannot widen, and that takes two enforcement points. _kept_episodes refuses an answer naming a row the search did not rank. And the hook is offered the rows fit already selected rather than the raw result: without that ordering, dropping a high-ranked episode frees budget that a lower-ranked one — one fit had already excluded — then fits into, which is the hook adding a memory the response would never have carried, reached without naming an unranked row.

A row the point's own screen dropped is returned unconditionally — capped out past MAX_CANDIDATES, or carrying an unusable id. Nobody decided about it, so nobody may drop it. In a plain filter "past the cap" and "Jev said no" are the same thing.

Every refusal returns the similarity result unchanged: the point off, the scope unconsented, the session unsampled, a partial or out-of-domain answer, a timeout, a transport failure, no usable loop.

Reachability, proven

test_decisions_memory_recall_reachable.py drives the whole chain from the route inward — a real keystone with memory_text: true, a real store with seeded episodes, a real config, the real gate, run_in_embed_pool — and fakes only the HTTP transport to the oracle. 20 tests, all passing. This is the row one real tool recall writes:

{
  "point": "memory.recall",
  "turn_id": "235c3c03d3ed4962",
  "session": "a957be5e6509",
  "ts": "2026-09-21T11:14:37.856378+00:00",
  "baseline_keys": ["mem-one", "mem-two", "mem-three"],
  "jev_keys": ["mem-one", "mem-three"],
  "agree": false,
  "p": 0.6333333333333333,
  "candidates": 3,
  "chars_saved": 55,
  "message_chars": 29,
  "latency_ms": 3,
  "scrubbed": false,
  "error": null,
  "answers": null
}

Plus the gate's own call row ahead of it, sharing the turn_id, carrying candidates: 3 and the three keep/drop/keep answers. chars_saved: 55 is the dropped episode's text; p is the mean keep probability.

A second consent, because this is a new category

A recalled memory is not the text the main switch describes. That consent is recorded against a message excerpt the owner just typed and skill descriptions this build shipped. A recalled memory is text the agent wrote down turns or days ago, about work the owner was not reviewing when they flipped the switch.

So the keystone records memory_text, default FALSE, on the terms tool_args shipped on: written on enable, cleared on disable, an omitted PUT field preserving the recorded value inside the writer's own lock, a truthy stand-in refused with 400. An install consented before the scope existed is inert for this point.

POINTS_NEEDING_TOOL_ARGS becomes POINT_EGRESS_SCOPES, a map of point → (reader name, what it sends, which switch grants it). The reader is a name resolved at call time, not a captured function: late binding is what every other consent read in the gate does, and a captured reference is a second handle the module cannot patch — which is how the first attempt silently bypassed a test's monkeypatch.

A scope-only PUT omits enabled entirely and the writer preserves the recorded flag and endpoint (KEEP_ENABLED). Sending even the value the card just read is a write against a switch the owner did not touch, and a read taken before a concurrent revoking PUT re-commits a consent that had been withdrawn. The governance ceiling is held against whether a write grants rather than against enabled, so a scope grant under a pin is 403 while a revoke stays available. One scopePending freezes every switch on the card while any scope write is outstanding, and each scope carries its own error notice with a hand-off.

Only for a live dashboard surface

The membership test is read twice, for two different jobs. On the event loop, before the search is dispatched, it is a cheap refusal that keeps a request the seam will not serve from paying for the gate's import graph. The read that gates the egress is a predicate handed to the hook and re-evaluated inside kept_memories, on the worker thread, immediately before anything would be sent — because the first read happens before the search, and a tab closed during the search takes the slot out of the published set while a decision built on the earlier answer is still in flight. This is the one gate where the difference is sending versus not sending.

The call site's condition, not the seam's: the egress is snippets of the member's own recalled memories, and the receipt rides a reply someone is looking at. A cron, a sub-agent, an integration and any session whose tab is closed have no such reader.

The test is membership of session_surface.dashboard_surfaced_keys(), the set _sync_dashboard_slots republishes from state._slots whenever the slot table changes. A channel-born session with its dashboard tab open does qualify — a channel-born slot contributes its channel key — which is the intended reading: the owner is reading that conversation in the dashboard.

Deliberately not has_dashboard_surface, whose first test is a dashboard: prefix answered before observed state is consulted. A retained or archived slot keeps its key and has no open tab, so the prefix would send recalled memory about a conversation nobody is watching. The published set empties when a slot leaves state._slots, and it is empty before the first publish, so it fails closed.

The wait is bounded, and it fits inside the request

gate.timeout_secs() caps the provider call (provider.timeout_ms, default 1000 ms) and the caller's wait is that plus 0.5 s of scheduling slack — then held under the time actually remaining on the request this decision runs inside. That last cap is the protection, and it is derived rather than declared.

GET /api/memory/recall is bounded at executors.RECALL_TIMEOUT_SECS (9 s) and answers 504 memory_recall_timeout past it. A fixed 7 s ceiling left 2 s of headroom — and the search runs before the judge does, inside that same request. A cold store, a rebuilt index or a slow embedding spends that 2 s, and then a full 7 s wait ends past the deadline: the tool answers with an error instead of the memories the search had already found, which is the one direction this seam's promise must not fail in. No constant can see that, because the thing it has to subtract is elapsed time.

So _remaining_budget() reads the enclosing EmbeddingWork — visible on the worker thread because run_in_embed_pool submits the search with copy_context().run — and _wait_budget() returns the smaller of the provider's budget and what is left. The 0.5 s slack is withheld from that remainder rather than spent: the judge answering is not the end of the request, since the store still has to finish and the route still has to bound and serialize, so a wait that ran to the deadline itself would turn a judge that answered in time into a 504 anyway. One quantity serves both ends of that slack, so there is no second number to keep in step.

A remainder at or below zero is a refusal, on exactly the terms every other Jev failure here takes: nothing is sent, no receipt is held, and the similarity result goes back unnarrowed. MAX_WAIT_SECS (7 s) stays as the ceiling where no deadline is in force — kept_memories is reachable from outside the bounded route — and as a belt on a hand-edited timeout_ms.

What each number means

Four different things shorten a recall, and every number on the receipt names exactly one of them. Settled in one place — the point's module docstring — and followed by every producer and every string.

Number Means
candidates Offered. The rows put in front of the oracle: already selected by the store's fit walk, capped at 20, screened for a usable id.
baseline_keys What the recall returns without this point.
jev_keys Kept by Jev. The decision's own output, in the search's order. Never narrowed into the set that shipped.
bounded_omitted Dropped by bounding. How many of jev_keys the response budget then removed. Absent when it removed none.
chars_saved Memory text Jev's narrowing removed. Both arms measured on the same rows before redaction and before bounding.

Two consequences, and they are the point of writing it down.

len(jev_keys) - bounded_omitted is what arrived, so the two numbers add up and each removal stays attributable to whoever made it. Counting the budget's drop inside the kept list is what made the header read "Jev kept 1" beside a row saying "2 that Jev kept did not fit" — arithmetic a reader cannot close.

Removed by redaction is a quantity this receipt deliberately does not carry. It is the same scrubbing applied to whatever ships, it is no part of what Jev decided, and because both arms of chars_saved are measured before it runs, the scrubber's substitutions are absent from the difference by construction rather than subtracted by hand. baseline_chars and jev_chars both ride the row so a reader can check the subtraction.

One writer

commit_receipt is the only thing that writes or publishes a receipt, and it takes the completed payload as an argument. That is structural rather than conventional: a caller cannot reach it without the finished response in hand, and the writer — not the caller — checks that something was held, that the payload carries a delivered retrieval, and that the request has not been abandoned.

Three separate call sites leaked a receipt for a recall the caller never got, each time because the guard sat beside the call instead of inside it. delivered_outcome and publish_outcome are no longer reachable names, and a test asserts they are gone and that payload is a required keyword argument.

The record

baseline_keys and jev_keys, never baseline/jev — those two names are what readDecisionStrip requires, so a memory record spelling them would be drawn as a skill selection holding memory ids. Naming each list for what it holds makes the three records on meta.decisions_strip decline each other on shape as well as on point.

Rows travel by identity, never copied, because the store judges membership with id(); a RowT TypeVar carries that relation through the signatures rather than widening to Mapping, which broke the seam's own type.

On a record carrying an error the count and the panel's list title name the fallback (kept after fallback, Kept (fallback)): the decision did not land and the shipped recall came back whole, so crediting Jev beside "Decision failed" would name an actor that chose nothing.

No new route, and no new config beyond the point name in gate.DECISION_POINT_NAMES.

How to enable

Settings → Developer → Feature Previews → Decisions (Jev), and the second switch under it, Also send snippets of recalled memories so Jev can drop the ones that do not help. Both are required.

Screenshots

Captured from the real built SPA behind website/scripts/capture-memory-recall-strip.mjs and capture-decisions-memory-scope.mjs — fixtures answer the network, so the readers, the transcript virtualizer, the Settings card and the strip run exactly as in production.

Each frame's row was read back off the live DOM through the capture script's own selectors and click order, so the caption-to-asset mapping is measured rather than assumed. That check exists because it failed once: appending the payload-bounded fixture made it a third data-agree=false row, so the kept-none caption sat over the bounded row and the bounded caption sat over a collapsed strip. Rows are now selected by the state each frame is of (data-agree and data-bounded), never by DOM order alone.

Twelve frames, all from the current head.

Collapsed, Jev narrowed the recall. Each number carries its own word on the line: a bare 0.81 beside a duration reads as a second duration, and chars alone does not say chars of what.

Light Dark

Expanded. Both id lists, the offered count, the egress, the latency, the scope sentence, and the second thumbs pair. Each pair names the act it rates and where in the sequence it sits — Rate the search (before Jev) against Rate Jev's narrowing — because two names for adjacent steps read as one step.

Light Dark

Expanded, Jev kept nothing. The floor of the range: Jev kept: 0, so the panel names the empty kept list (no memories) rather than drawing a blank where the ids go, and the saving is the largest the turn could have.

Light Dark

Expanded, the response budget dropped two of the three Jev kept. The header stays the decision's count and the row carries both numbers in one wording, so the subtraction closes where a reader sees it: kept 3, two did not fit, one arrived.

Expanded, the decision failed. The recall came back whole, the second count and the panel title name the fallback rather than crediting Jev, and the error surface names the category. The Jev thumbs are gone — the judge chose nothing — and a sentence says the search still ran, because the remaining pair otherwise sits under "Decision failed" reading as an invitation to rate something that did not happen.

Settings › Developer › Feature Previews, recalled-memory scope granted. The only state that draws the memory.recall row in "What Jev decides while this is on" — that list is gated per scope. It is listed because it is the one point there that changes what a tool returns.

The same card with all three scopes at their default OFF — the state every already-consented install is in. The note above them enumerates all three, in the order they render.

Light Dark

The scope write refused. The PUT is answered 500, so the recalled-memory switch stays at its recorded value and its own notice says so — a separate node per scope, and the message names the switch, because with three of them "Could not save this switch" identified none.

Recording — collapsed to expanded and back. The stills show the two ends of the toggle; this shows the motion between them: the chevron turning, the panel opening under the line it belongs to rather than displacing the reply above it, and the row settling at a height the virtualized transcript keeps stable.

memory-recall-strip-toggle.webm

Tested

  • test/test_decisions_memory_recall_reachable.py — 24 tests: the whole chain from the route inward, a row logged, the oracle asked, the kept subset returned, the outcome published for the strip, the two gates (unsurfaced session, unconsented scope) and a failing oracle each returning the recall whole, the four ways a receipt must NOT survive (a late answer, a discarded generation, a refused retry, a failed route), a request whose deadline had already passed, a payload the response budget shortened, a search that eats most of the budget leaving the judge a shortened wait, a request with no time left refusing to ask at all, and a tab closed DURING the search sending nothing, plus the three absent prompt-assembly seams.
  • test/test_decisions_memory_recall.py — 71 tests: the decision, every refusal, the complement reading of a drop probability, the threshold, ordinal question ids, the menu's caps and key screen, the redaction order, both arms on the row, the publish hook, the store's fallbacks, the identity coupling and a revert-verify of the apply.
  • website/src/test/MemoryRecallStrip.test.tsx — 42 tests, including the failed record offering no rating of a pick that did not happen, the two pairs named for the act each rates, the search-ran note, the scope sentence and the Dropped to fit row.
  • website/src/pages/settings/decisionsCard.test.tsx — 63 tests, including the egress note's own count asserted against the scope switches drawn, each refused write naming its switch, and the memory.recall row appearing with its scope and absent without it.
  • test/test_decisions_memory_recall_apply.py — 8 tests against a real store: the kept subset in the response, the switch-off result unchanged, and the budget applied before the hook.
  • test/test_decisions_memory_text_scope.py — 36 tests for the consent scope, including the scope-only PUT, endpoint preservation and the grant-vs-revoke ceiling.
  • website/src/pages/settings/decisionsCard.test.tsx — 47, src/test/MemoryRecallStrip.test.tsx — 33, plus the contract and style suites.
  • Regression scope green: 1753 passed / 14 skipped across the decisions, vector-memory, episodic-admission, context, memory-handler, posture, settingref and feature-map suites; 257 frontend across 16 files including all 95 locale style tests.
  • mypy src/kiro_crew/ clean over 1665 files. tsc, eslint, black, isort, flake8, docs_lint, check_feature_map, 19/19 i18n checks, and the comment-history gate.

Docs

docs/system-specs/modules/decisions.md §9 (the shared POINT_EGRESS_SCOPES mechanism) and §11 (rewritten for the tool path, with the record fixture the frontend contract test parses); src/kiro_crew/docs/decisions.md (the user-facing section and the enable instructions naming both switches); docs/feature-map/README.md (the strip row, retargeted, plus a new Recalled-memory egress consent row).

Not verified here

No real TypeSafe round trip — the provider mapping is exercised against a fake oracle and the existing loopback tests, so this does not establish real service latency or account compatibility.

Follow-ups

Two findings from review are real readings of the code and are tracked in #12532 rather than fixed here, both because the honest fix is larger than this PR and because neither is an egress or a permission:

  • A restored slot is in the published surface set before a browser connects. chat_persistence._restore_recent_sessions_steps fills state._slots and then calls _sync_dashboard_slots, so a session the owner had open is surfaced at boot with nobody yet looking at it. A per-viewer signal would have to be threaded from the websocket layer, and every other consumer of that registry reads the slot table the same way. Strictly narrower than the archived-slot case this PR closes: a restored slot is one the dashboard will draw.
  • The outcome row is built before the payload's final bounding. bound_recall_payload can still drop a tail episode after the hook has answered, so jev_keys and chars_saved can overstate what the response carried — never understate. The character cap is largely pre-satisfied because fit measures the same rendered lines; the live trigger is the 16 KiB transport budget, which fit does not see. An exact record would have to be derived from the final payload, moving the point's record construction into the store or the route.

@iamwhatever
iamwhatever requested review from a team and buluoray September 21, 2026 08:47
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 6a6e24d874858b7d4cd0308c33f0fda94afb29ab — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Verify one real oracle round trip through memory_recall — provider latency and account compatibility are faked here, per the PR's own "Not verified" note.

[DESIGN-REVIEWED] 6a6e24d

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — 🟡 CONCERNS

UX-level review of 6a6e24d874858b7d4cd0308c33f0fda94afb29ab — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

Identical thumbs pairs rate different things ("I could easily click the wrong one"), and "Jev kept: 3" beside "2 did not fit" reads contradictory.

Watch

  • Two VerdictThumbs pairs in one panel ("Rate Jev's narrowing" header, "Rate the search (before Jev)" body) render identically; the blind reader said they "look like the same thumbs-up control shown twice, and I could easily click the wrong one" — a wrong click silently files a verdict against the wrong arm, on every expanded panel. Fix: differentiate by wording that names the object ("Rate the memories Jev kept" / "Rate what the search found") and/or placement adjacent to the list each rates.
  • On a bounded record (shot-07) the header stays "Jev kept: 3" while the body says "2 of the 3 Jev kept did not fit the response"; the reader: "so was 3 kept, or 1? The header and body seem to disagree unless you read carefully." Hits every budget-bounded recall, friction each time. Smallest fix: have memory_bounded_value state the net ("2 of the 3 Jev kept were dropped for space; 1 reached the reply").
  • "narrowing" in memory_rate_jev made the reader hesitate at the header thumbs ("I don't know what 'narrowing' means") — jargon on the row's only interactive rating; the label fix above resolves it.

Suggestions

  • memory_latest_note names "the decision log" with no way to reach it (reader: "nothing… shows me where that log is"); link the phrase to the log surface or name the page.

[UX-REVIEWED] 6a6e24d

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of 6a6e24d874858b7d4cd0308c33f0fda94afb29ab — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

saveDecisionsScope takes over every scope write yet the old scope-only arm of saveDecisionsConsent — including its brand-new memoryText parameter — ships dead.

Not justified as shipped

  • Item 7 — duplicate of website/src/api/client.ts:saveDecisionsConsent, zero consumers: the PR adds saveDecisionsScope, migrates all three scope switches to it, and in the same diff extends saveDecisionsConsent with a memoryText? parameter nothing calls. Grepped saveDecisionsConsent( across website/src: 1 production caller remains, always passing a boolean enabled — so the enabled === undefined arm, the scope spreads, and the new parameter have 0 production consumers (only tests exercise them), leaving two spellings of one wire body to maintain.
    Subtraction: delete saveDecisionsConsent's enabled === undefined arm and its toolArgs/compaction/memoryText parameters; saveDecisionsScope is the one scope writer.
    Clears when: the dead arm and parameters are deleted, or a production caller of that spelling is named.
  • Item 8 — undeclared, rides along: the _redact_memory_field typing overloads in handlers/_shared.py appear nowhere in the description; harm-free typing rider.

What this change ships

Inventory (10 items) — 8 justified

Intent: let Jev narrow what the memory_recall tool returns to the entries worth their prompt space — an ADDITION, off by default behind two consents.

  1. Jev can drop recalled memories from the memory_recall tool's answer, subset-only, every failure returning the search result unchanged — justified
  2. A new consent switch and memory_text keystone field, default off even for already-consented installs — justified
  3. A one-line memory receipt strip under the assistant reply, expandable to both id lists with two thumbs pairs — justified
  4. Under a fleet governance pin, turning ON any scope or raising the history budget is now refused with 403 (a scope-only grant previously slipped past the pin) — justified
  5. Consent audit rows now name what the write asserted (granted/revoked/allowed) instead of the recorded state; the replaced comment's rationale survives via resources and the inversion it caused is quoted — justified
  6. Each scope switch gets its own named failure notice, and every card switch freezes while a scope write is in flight — justified
  7. Scope switches write through a new saveDecisionsScope; the old scope-only spelling stays behind — duplicate of website/src/api/client.ts:saveDecisionsConsent, zero consumers
  8. _redact_memory_field gains shape-preserving typing overloads — undeclared, rides along
  9. The episodic clip literal 1500 becomes the named EPISODIC_BLOCK_TEXT_CHARS, shared by store and receipt — justified
  10. Screenshot and recording harness scripts, the App bundle ceiling re-measured 3711→3714 KB, feature-map rows, user docs, and 13 locale files — justified

[FIRST-PRINCIPLES-REVIEWED] 6a6e24d

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ human override accepted

Human judgment by @iamwhatever overrides the GPT 5.6 finding for 6a6e24d874858b7d4cd0308c33f0fda94afb29ab; the recorded reason is authoritative for this commit.

This comment is updated in place on each push.

The model was not re-run because an authorized human decision supersedes it.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 6a6e24d874858b7d4cd0308c33f0fda94afb29ab: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 6a6e24d874858b7d4cd0308c33f0fda94afb29ab — this comment is updated in place on each push.

Review details

I have independently reviewed the core changes: the accounting refactor in memory_recall.py (baseline_chars/jev_chars measured on the same rows before redaction/bounding, chars_saved derived from them), commit_receipt as the single writer with its three fail-safe guards (pending, retrieval Mapping, _request_abandoned reading the context-carried EmbeddingWork), _bounded_omitted matching jev_keys against delivered episodes by the store "id" both sides carry, the still_watched egress re-read on the worker thread and immediately before core.decide, the _remaining_budget/_wait_budget deadline derivation with its wait <= 0 refusal returning None, the _shared.py typing-only overloads, and the frontend boundedOmitted parsing/gating with matching i18n interpolation.

The discovery pass produced no candidates, and my own falsification search surfaced no grounded defect that answers (a)/(b)/(c) at the required bar.

No findings.

[OPUS-REVIEWED] 6a6e24d

Verdict parsed from the review's SHA-scoped output markers for commit 6a6e24d874858b7d4cd0308c33f0fda94afb29ab.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 6a6e24d874858b7d4cd0308c33f0fda94afb29ab: <one-sentence reason>

@iamwhatever

Copy link
Copy Markdown
Contributor Author

[operator: iamwhatever] Screenshot evidence for the recalled-memory strip, captured from the real built SPA behind website/scripts/capture-memory-recall-strip.mjs (fixtures answer the network; readMemoryRecallRecord, the transcript virtualizer and the strip itself run as in production).

Three states, light and dark. The collapsed line is the one the spec names: memory · similarity: 6 · Jev kept: 3 (0.81, 210 ms) · saved 2.1K chars.

collapsed-narrowed-light

collapsed-narrowed-dark

collapsed-kept-all-light

collapsed-kept-all-dark

expanded-light

expanded-dark

expanded-error-light

expanded-error-dark

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for 167037c0d88d9eac1e91783d452111d7a586c324; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 167037c0d88d9eac1e91783d452111d7a586c324: <one-sentence reason>

@iamwhatever

Copy link
Copy Markdown
Contributor Author

[operator: iamwhatever] Round 1 dispositions. Head 167037c0d8. Code is frozen after this push; anything further gets a disposition, not a diff.

Fixed

GPT gate.py:62 + First Principles item 2 — recalled memory text leaves under a consent that names only messages and skill names. Real, and the sharpest finding on the PR. Fixed with a memory_text keystone scope on exactly the terms tool_args shipped on in #12253: default FALSE, written on enable, cleared on disable, an omitted PUT field preserving the recorded value through consent.KEEP_MEMORY_TEXT resolved inside the writer's own lock, a truthy stand-in refused with 400. An install consented before the scope existed is inert for this point.

POINTS_NEEDING_TOOL_ARGS generalized to POINT_EGRESS_SCOPES, a map of point → (reader name, what it sends, which switch grants it). Worth naming one thing that went wrong on the first attempt: the map originally held the reader function object, captured at import. That is a second handle on the same function which a test patching consent cannot reach, so test_every_shipped_name_is_admitted monkeypatched the module and the map kept calling the original — the test failed for the right reason and would have passed for the wrong one if the arity had lined up. The map now stores the reader's NAME and resolves it with getattr at call time, which is what every other consent read in the gate already does, and TestEveryScopeReaderResolves pins that each name resolves to a callable reading {} as False.

One deliberate divergence from the brief. You asked for a record carrying applied=false / no-consent-scope when the scope is off. I did it the tool.risk way instead — no row at all — because the scope refusal arrives as one of the gate's three cheap refusals, and those touch no disk by design: that is the property making "no consent leaves the log directory empty" checkable, and test_decisions_gate.TestDisabledPerformsNoAwait plus the empty-log-directory test pin it. Writing a row would also need the point to do its own keystone read to tell "unscoped" from "unsampled", which is the second read the gate deliberately funnels into one. The diagnostic is not lost: the once-per-point WARNING names both the category and the switch, and test_the_point_keeps_the_similarity_topk_without_the_scope asserts the log directory does not exist. Say the word if you want the row anyway and I will take it as a new round.

GPT README:89 — the feature-map says never for a channel, but has_dashboard_surface is true for a channel session open in a tab. Correct, and the doc was the wrong half. chat_utils._sync_dashboard_slots publishes effective_session_key for every open slot and its own docstring says "a channel-born slot contributes its channel key", so a Slack conversation with its tab open passes the gate.

I left the code and made the docs true, per your instruction, because the authoritative origin is not reachable in ≤10 lines: _directive_user_origin lives on the queue entry in chat_runner and ContextBuilder has no actor or origin parameter at all — grep -n "directive_user_origin\|turn_actor\|actor" src/kiro_crew/context.py returns nothing relevant. Using it means threading a parameter through build_message → build_session_context → the hook plus every caller of both, which is the plumbing you ruled out.

The corrected claim is in five places (the point's step 1, _episodic_keep_hook, spec §11, the feature-map row, the user doc), and test_a_channel_session_with_an_open_tab_gets_one now pins the behaviour so the two cannot drift again. I think the gate is right as it stands: has_dashboard_surface means "somebody has this conversation open", which is exactly the audience the receipt needs.

MemoryRecallStrip.tsx:188 ErrorNotice hand-off. Added. The strip holds no draft input and the failure category names the judge rather than the reply, so there is something for an agent to pick up and nothing to lose. Two tests: the button is there on a failure, and absent on a healthy strip.

First Principles item 7 — wire_rows. Deleted. One consumer, and it re-screened rows the one real screen had already bounded.

Design / UX / Screenshot Evidence — zero images. Eight now, in the description, from the real built SPA behind website/scripts/capture-memory-recall-strip.mjs (fixtures answer the network; the reader, the virtualizer and the strip run as in production). Three states × light/dark, each URL confirmed 200 anonymously before it went into the body. The collapsed line was read back off the live DOM as memory · similarity: 6 · Jev kept: 3 (0.81, 210 ms) · saved 2.1K chars.

Disposition, no code

Design Watch — judge latency is unbounded. Not a defect; the bound existed and was simply never written down for this point. The provider call is capped by gate.timeout_secs() (provider.timeout_ms, default 1000 ms, always finite and positive) and the caller's wait is that plus WAIT_MARGIN_SECS of 0.5 s, clamped into MIN_WAIT_SECS .. MAX_WAIT_SECS = 0.25 s .. 10 s. The clamp is the real protection: 10 s is the most a sampled turn can spend here whatever a hand-edited timeout_ms says, and expiry cancels the future and injects the similarity top-k. Same three constants as skills.select. Now stated in the description, spec §11 and the user doc — the last two because this point sits on session startup rather than on a message, which is where a reader would look for it.

Verification

955 tests across the whole test_decisions_* suite plus test_settingref_schema_fixture, test_security_posture and test_check_feature_map; 174 across the six touched frontend suites. tsc, eslint, black, isort, flake8, jscpd (0 clones), docs_lint, and 19/19 i18n checks with I18N_BASE_REF at the merge base. Locale copy for the new switch and the amended egress note in all 12 shipped locales, pseudolocale regenerated, npm run gen:settings re-run for the new toggle.

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for 167037c0d88d9eac1e91783d452111d7a586c324; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 167037c0d88d9eac1e91783d452111d7a586c324: <one-sentence reason>

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 21, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

[operator: iamwhatever] Backend Lint & Type Check fixed. Head fe73657959.

mypy was right and the annotation was the bug — mine, introduced while fixing the identity coupling.

kept_memories returns a subset of the same objects it was handed; that is exactly what vector_memory._kept_episodes judges membership on with id(). When I stopped copying the rows I widened the return type to list[Mapping[str, Any]] instead of keeping the relation. Mapping is both less true and useless at the seam: the store passes list[dict] and cannot put "some mapping" back where its own rows go, which is what context.py returning keep_hook(...) into a Callable[[list[dict]], list[dict] | None] | None tripped on.

RowT = TypeVar("RowT", bound=Mapping[str, Any])

kept_memories and screened_rows now carry the variable, so whatever row type comes in comes back out, and keep_hook closes over list[dict] and is annotated as such. The type now states what the docstrings already promised — and it encodes the identity contract, which is the one coupling here that fails silently in the safe direction.

Annotations only, no behaviour change. Verified before pushing:

  • python3 -m mypy src/kiro_crew/context.py src/kiro_crew/decisions/ — clean, 14 files
  • mypy src/kiro_crew/ (what the CI job runs) — clean, 1665 files
  • the three memory.recall suites — 117 passed, unchanged
  • black, isort, flake8 on the touched file — clean

Still frozen otherwise: this was a CI red, not a lane opinion.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 21, 2026
iamwhatever pushed a commit that referenced this pull request Sep 21, 2026
…tempt-correlated records

Three findings from the review lanes, all real.

Companion credential patterns bypassed redaction (compaction_keep.py:307). The
state is a WHOLE TRANSCRIPT and `redacted` scrubbed it with
`security.redact_credentials`, which knows only the patterns this repository
ships -- so a host that loaded a companion sent its own credential and cookie
spellings verbatim to a third party. It now routes through
`platform.context.redact_via_context`, the canonical egress shim, before the
stage's clip. The shim deliberately re-raises PlatformCompositionError so a host
that could not compose its companion cannot silently downgrade; that is caught
here and the FIELD IS DROPPED, the same direction every other arm of the function
fails in. The shipped exfiltration-URL pass runs on top. The sink entry in
security_posture names the route and the drop.

Inject rows put the character share above 100% (compaction_keep.py:449, GPT F3
UPHOLD-FENCED, corroborated independently by Opus). `chars_today` counted every
row the replay keeps -- which includes `inject` -- while `chars_all` counted only
STATE_ROLES, so an ordinary cron notification or subagent-completion event put
bytes in the numerator that the denominator skipped and the card rendered e.g.
"137% of the characters". `chars_all` now counts every row EITHER arm counts, and
`chars_today <= chars_jev <= chars_all` is stated as the invariant it is and
asserted under every answer with a large inject row present. The reader holds it
from its own side too: a share above 1 prints NO percentage rather than being
clamped, because a clamp would print a plausible number over a broken
measurement.

A straggling scoring attached to the NEXT compaction (compaction_keep.py:702, GPT
F2). The pending store was keyed by session alone, so a run that outlived its own
compaction's notice had its record popped by the following compaction on that key.
Each compaction now mints an attempt token synchronously before the task exists;
a run whose token is no longer the session's newest publishes nothing, and minting
retires whatever the previous attempt left pending -- the rule outcomes.discard
applies at the start of a turn. The rows are written either way: the observation
happened.

F1 (capped calls reported as the complete transcript) was adjudicated DOWNGRADE as
a disproportionate remedy, but the cheap half of it is worth having: the walk now
records `calls_capped`, and both the point and the reader decline to draw a line
for a capped record, because "N of M" over an M that is the cap rather than the
session's call count is a number a reader cannot tell from a right one. The
overflow rows' characters are left out of both arms, so the two stay on one
universe.

The FeaturePreviewsSection master-switch/scope-PUT race is NOT fixed here: #12492
owns it in that shared component and this branch inherits it on the next rebase.
@iamwhatever
iamwhatever force-pushed the feat/decisions-memory-recall branch from fe73657 to 3b5f0d4 Compare September 21, 2026 10:20
@iamwhatever

Copy link
Copy Markdown
Contributor Author

[operator: iamwhatever] Settings › Developer › Feature Previews, showing the new recalled-memory scope switch and the rewritten egress note. Captured from the real built SPA behind website/scripts/capture-decisions-memory-scope.mjs.

Consent is ON with BOTH scopes at their default OFF — the state every already-consented install is in, and the one that shows the most: each scope switch is drawn (they appear only while the main switch is on), each sits unchecked, and the note above them names all three egress categories.

decisions-card-light

decisions-card-dark

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 21, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

[operator: iamwhatever] Final code round. Head 3b5f0d4a32, squashed to one commit. Hard freeze after this: further lane items get dispositions only.

Fixed

PR Hygiene — 3 commits. Squashed to 1, force-pushed with a lease.

One thing worth flagging, because it nearly shipped a wrong diff: origin/main had advanced from 3017e6a219 to 1fa7f5ba50 while I worked, so git reset --soft origin/main produced a commit that reverted every change main had landed since — 60 files and 1076 deletions, including deleting test/test_pr_hygiene_guidance.py. Caught it by diffing --diff-filter=D against main before pushing. The correct sequence is soft-reset to the branch's own base, commit, then git rebase origin/main to replay forward: 47 files, no upstream deletions, and the squashed tree byte-identical to the pre-squash one.

GPT BLOCKING FeaturePreviewsSection.tsx:233 — a scope write could re-commit withdrawn consent. Real, and the worst of the batch, because the failure mode is egress turning itself back on. Flip a scope, immediately turn the seam off, and the disable lands first while the scope write lands second carrying its hardcoded enabled: true.

Fixed in both halves, since either alone leaves it open: a scope write now sends the current enabled value rather than a literal, so a losing write cannot assert a consent nobody asked for; and one shared scopePending freezes the main switch and the sibling scope switch while any scope write is outstanding, so the interleave cannot be started. Applied to tool_args and memory_text alike. The freeze is revert-verified — removing scopePending from the main switch's disabled makes the test fail, so it is not passing for an unrelated reason.

GPT vector_memory.py:4913 — the cap ran after the hook. Real, and the sharper half of "cannot widen" than the check I already had. _kept_episodes refuses an answer naming an unranked row, but the char cap ran during formatting, so dropping a high-ranked memory freed budget a lower-ranked one — one the cap had already excluded — then fitted into. The hook could add a memory the block would never have carried without ever naming an unranked row.

The cap is now derived first (_cap_admitted_episodes) and only those rows are offered. Removing rows only shortens the block (the line indices shrink), so no second pass is needed. Extracted _episode_line so the cap walk and the block measure the same string — two copies of that format drifting apart would make the cap a bound on a line nobody rendered. Verified the no-hook output is byte-identical: 394 tests across the three vector-memory suites pass unchanged.

GPT memory_recall.py:229 — unoffered rows were dropped. Real, and my test had pinned it as intended. screened_rows returned only the offered rows and injected was built from it, so a candidate past MAX_CANDIDATES was absent from the answer and therefore removed from the prompt — the point deleting a memory nobody asked about, which is the opposite of its contract. In a plain filter "past the cap" and "Jev said no" are indistinguishable.

Replaced with surviving_rows, which partitions instead of filtering: never-offered rows survive unconditionally, and only an offered row can be dropped. The baseline arm is now the whole block rather than the menu, with candidates still reporting the menu size — the two numbers answer different questions. I rewrote the test that had asserted the defect and added three more, including the realistic shape (more rows than the menu holds, every offered row dropped, the overflow still in the block).

One detail that fell out: a row with no readable id is now left out of both key lists rather than named as "", because the strip's reader refuses a list carrying an empty name and one such row would cost the whole receipt. It stays in both arms, and chars_saved measures rows rather than keys, so the saving stays exact.

UX — a failed record credited Jev with the fallback's set. Real copy defect. On error the header now reads kept after fallback: N and the panel's list is titled Kept (fallback). Retitled rather than hidden: the list is still what the prompt carried, and it was the attribution that was wrong, not the content. The saving chip gained a title ("Prompt characters the narrower memory block saved."), since the collapsed line has no room to say chars of what.

Frontend Tests — three locale style reds, all mine. fr decisions_egress had a plain space before a colon (needs U+202F); bn decisions_memory_text_desc wrote the character count in Bengali numerals; zh-CN decisions_egress stacked three 的 in one clause. I scanned every value this branch added against all three rules rather than only the reported ones — the fr and bn gates are diff-scoped and zh is whole-catalog per-clause, so the reported set is a subset by construction. Exactly three, no hidden fourth. The zh value is rewritten rather than having particles deleted out of it: genitive stacking always has a shorter native phrasing, and the full-width colon does not split a clause, so the sentence needed splitting. All 95 style tests pass.

Screenshots. Added Settings › Developer › Feature Previews, light and dark, from the real built SPA behind website/scripts/capture-decisions-memory-scope.mjs. Consent ON with both scopes at their default OFF — the state every already-consented install is in, which is also the frame that shows the most. Both URLs verified 200 anonymously before going into the body. Ten images total now.

Worth noting for anyone reusing that harness: the shared stub omits decisions_enabled, and the card fails closed on its absence, so the capture must override /api/dashboard/config or there is no card to photograph. That is the governance gate working, not a harness bug.

Disposition, no code

Thumbs labelling on the memory strip. Left as is, per your call — same pattern as the shipped skills strip, so changing it here would make the two receipts differ for no reason a reader benefits from.

Verification

123 tests across the three memory.recall suites; 631 across those plus the vector-memory, episodic-admission and context suites; 122 across the touched frontend suites plus all 95 locale style tests. mypy src/kiro_crew/ clean over 1665 files (and on context.py / vector_memory.py / decisions/ specifically). tsc, eslint on the touched files, black, isort, flake8, docs_lint, 19/19 i18n checks.

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — 🔴 changes requested (blocking)

GPT 5.6 found at least one blocking issue that must be resolved before merging 3b5f0d4a32150b12e1474d158f84c039f5927e75. Adjudication produced no [GPT-ADJUDICATED] marker for 3b5f0d4: the adjudication stage FAILED TO RUN (its raw output is in the Adjudication details block -- typically an API or setup error), so no proportionality review took place and GPT's blocking verdict stands unreviewed.

This comment is updated in place on each push.

BLOCKING -- docs/feature-map/README.md:89 -- memory recall is unreachable

| Memory decision strip | A one-line receipt ...
Fresh dashboard session -> build_session_context passes include_activity=False -> MemoryStore.get_context skips episodic retrieval and its hook -> no decision or strip occurs.
Anchor: feature-map-correctness
Fix: Invoke episodic retrieval independently of the activity-context flag.

BLOCKING -- website/src/pages/settings/FeaturePreviewsSection.tsx:232 -- scope updates can restore withdrawn consent

api.saveDecisionsConsent(view.enabled, view.configuredEndpoint, { toolArgs: value })
Scope PUT from one dashboard tab -> another tab's disable lands first -> stale enabled: true scope PUT lands second -> decision egress is re-enabled.
Anchor: residual/security
Fix: Make scope-only updates preserve the current enabled state and endpoint server-side under the consent lock.

BLOCKING -- website/src/pages/settings/FeaturePreviewsSection.tsx:230 -- scope save failures are silent

const scopeMut = useMutation({
const memoryScopeMut = useMutation({
Failed scope PUT -> mutation enters error state -> neither error is rendered -> the user receives no failure notice.
Anchor: errors-use-error-notice
Fix: Render an ErrorNotice with askAgent for both scope mutation errors.

FINDING -- src/kiro_crew/vector_memory.py:4929 -- "enumerate(kept, 1)" renumbers a V2 row after an oversized earlier row is skipped, changing its reported similarity rank and breaking fallback output compatibility -> Fix: render each kept row with its original index in results. (origin: validation)

[BLOCK-MERGE] 3b5f0d4
[GPT-REVIEWED] 3b5f0d4
False positive or not applicable? A repository writer can comment:
/ai-review override gpt 3b5f0d4a32150b12e1474d158f84c039f5927e75: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 21, 2026
iamwhatever pushed a commit that referenced this pull request Sep 21, 2026
…it would keep

At every AUTOMATIC compaction, ask Jev which of the session's tool calls were
worth keeping, and show the answer as one line on the compaction notice. Nothing
is kept: the compaction runs byte-identically on every backend whatever Jev
answers, and there is no apply path at all. What this buys is the number a live
keep-list cannot be argued about without -- today's recycle replay keeps the
conversation text alone (context.RECALL_ROLES), and 87% of a measured transcript
is tool traffic. The decision that consumes it is tracked in #12516.

Manual /compact is excluded by construction, not by a flag: the dashboard
dispatches it as an ordinary turn through provider.stream_command and never
reaches the coordinator. A test pins that no caller of _compact_session exists
outside the session layer.

The point (decisions/points/compaction_keep.py)

- Hooked at session_compaction._compact_session, the one funnel both automatic
  entry points reach, above the arm choice so every backend is covered. The task
  is created and NEVER awaited, so the compaction cannot be delayed, failed or
  altered by it -- pinned by running one scripted compaction against a scoring
  that hangs for an hour and holding the outcome equal to a stubbed-out run.
  Scored on the compactions CREW ITSELF dispatches, which is not the same as every
  backend and the docs no longer imply it is: a harness that compacts on its own
  initiative is declined by the gate before the funnel (cc_managed for Claude-Code,
  compact_unsupported for KAS), so those compactions are never scored -- there is no
  Crew-side dispatch to hang a measurement on. The spec carries the full table.
- State from ConversationLog.read_messages: conversation text verbatim, each tool
  input redacted THEN clipped, and every tool RESULT replaced by
  "ok, N chars (omitted)" -- no result byte is on the wire at any stage. First row
  and newest six pinned and never asked about.
- Redaction goes through platform.context.redact_via_context, not the bare
  baseline: the state is a whole transcript, so a baseline-only pass would send a
  companion-defined credential verbatim. The shim re-raises a composition failure
  by design; that is caught and the FIELD IS DROPPED, because a scan that did not
  complete cannot clear text for the wire. Registered as a sink in
  security_posture.
- Five fitting rungs from the P3 spike (inputs 1000/200/60, then text to half,
  then a quarter with calls on one line); the first under ~25K estimated tokens is
  sent, and the ~8% that fit nowhere write a state-too-large row and send nothing.
- One Choice per non-pinned call (drop / call / both), batched 25 per request with
  the same state each, 4 concurrent, the whole run under the shared 10s ceiling.
  A batch is all-or-nothing and a partial answer publishes nothing, because
  "23 of 61" over calls nobody was asked about is a wrong number.
- Each compaction mints an attempt token synchronously before the task exists. A
  run whose token is not the session's newest publishes nothing, so a scoring that
  straggles past its own notice cannot have its record popped by the next
  compaction on that key. An ABSENT counter is a mismatch, never a match: the cap
  evicts the oldest counters, and reading an absent one as equal would let the
  token AUTHORIZE a publish. It is subtractive -- it may only ever refuse.
- Tool ROWS are folded by tool_call_id before anything is counted. One logical call
  reaches the transcript as up to three role="tool" rows sharing one id -- the
  dispatch row, plus the approval path's approved/rejected row -- so a per-row count
  inflated total_calls, sent the same input twice, asked two questions about one
  call, and counted its characters twice in the denominator. Each field takes the
  first non-empty value and pinned is the OR across the rows; a row carrying no id
  gets a key of its own, because two rows naming no call cannot be shown to be the
  same call. The fold finishes before the cap, so the cap counts calls not rows.
- A walk past the 1000-call cap keeps the NEWEST calls, in chronological order,
  and COUNTS the ones it dropped as calls_truncated. The newest end is chosen
  rather than fallen into: a forward walk that simply stops admitting keeps the
  OLDEST, which are the least likely to still matter. The line states the count --
  "23 of 61 (+140 not scored)" -- only when it is non-zero, because a bare
  "23 of 61" is wrong when 61 is the cap and drawing nothing hides a measurement
  accurate about everything it covers.
- One outcome row per compaction: the call tallies plus chars_all,
  chars_today_eligible and chars_jev_eligible. Both arms are named for what they
  measure. The replay arm counts the rows the replay admits BY ROLE;
  build_session_replay additionally applies row quotas and an 80K character budget,
  so both arms are UPPER BOUNDS and the card says "up to". The true figure is
  deliberately not re-derived here -- the quota walk takes a ConversationLog rather
  than a row list and the budget is applied inline while formatting, so the only
  thing measurable is a rendered string carrying Role: prefixes, which would put
  formatting overhead inside a content measurement and break the invariant.
  chars_today_eligible <= chars_jev_eligible <= chars_all holds by construction, so
  chars_all counts every row EITHER arm counts -- the replay admits inject rows,
  which carry no tool call, and a denominator built from the state's roles alone
  rendered a share above 100%. The reader holds it too: a share above 1 prints no
  percentage rather than being clamped.

The third switch reports its own states

Its pending write freezes the master switch, because a scope PUT carries
`enabled: true`: flipping the scope and then revoking consent is two concurrent
writes to one keystone, and the scope one landing second restores consent the
owner just revoked. And a refused scope write renders the shared ErrorNotice
rather than snapping back in silence, which reads as the click not registering.
The equivalent guards for the tool-argument switch are deliberately absent: that
switch shipped with the same shape and #12492 is fixing it for every scope at once
server-side, so a second client-side guard here would be reverted by that change
rather than surviving it.

A third consent scope

compaction on the keystone, beside tool_args: absent reads as not consented, an
omitted PUT field preserves, disabling clears. tool_args does NOT grant it -- that
scope was reviewed as the arguments of the one call about to run, not as
everything the session has run. gate._tool_args_scoped becomes _scope_consented
and drives both scopes off one table, so a third is not a third predicate to
forget. No new endpoint.

The surface

The record is published into a bounded store the point owns (not
decisions.outcomes, whose one slot belongs to the next assistant reply and whose
discard hook a turn fires at its own start) and dashboard/state.py stamps it as
meta.decisions_strip on the compaction notice row it already appends.
CompactionKeepLine renders one line UNDER whatever the card drew -- success
notice, recycle notice, the error surface, or the summary card in either
disclosure state -- with the existing jev thumbs. No record, no line, which is
also what a scoring slower than its compaction produces.

One compaction card per screenshot frame, each scene served by its own harness
instance: sharing one harness and swapping its fixture left the previous scene's
frame composited for the next, and a frame showing four cards isolates none of
them. The capture now asserts the element it photographed contains the keep line,
the theme it is named for, and the text that makes it that frame -- including what
it must NOT say, since a positive check cannot tell a frame from the frame it is
contrasted with.

Docs: a section in both decisions docs stating exactly what leaves the machine,
and a feature-map row. Tests: the point, the hook, the scope round-trip and the
card, plus the spec's fenced record held against its reader. Screenshots: a
capture harness writing twelve frames over the real built SPA with only the
network stubbed, each asserting the words that make it that state.
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 21, 2026
iamwhatever pushed a commit that referenced this pull request Sep 21, 2026
…it would keep

At every AUTOMATIC compaction, ask Jev which of the session's tool calls were
worth keeping, and show the answer as one line on the compaction notice. Nothing
is kept: the compaction runs byte-identically on every backend whatever Jev
answers, and there is no apply path at all. What this buys is the number a live
keep-list cannot be argued about without -- today's recycle replay keeps the
conversation text alone (context.RECALL_ROLES), and 87% of a measured transcript
is tool traffic. The decision that consumes it is tracked in #12516.

Manual /compact is excluded by construction, not by a flag: the dashboard
dispatches it as an ordinary turn through provider.stream_command and never
reaches the coordinator. A test pins that no caller of _compact_session exists
outside the session layer.

The point (decisions/points/compaction_keep.py)

- Hooked at session_compaction._compact_session, the one funnel both automatic
  entry points reach, above the arm choice so every backend is covered. The task
  is created and NEVER awaited, so the compaction cannot be delayed, failed or
  altered by it -- pinned by running one scripted compaction against a scoring
  that hangs for an hour and holding the outcome equal to a stubbed-out run.
  Scored on the compactions CREW ITSELF dispatches, which is not the same as every
  backend and the docs no longer imply it is: a harness that compacts on its own
  initiative is declined by the gate before the funnel (cc_managed for Claude-Code,
  compact_unsupported for KAS), so those compactions are never scored -- there is no
  Crew-side dispatch to hang a measurement on. The spec carries the full table.
- State from ConversationLog.read_messages: conversation text verbatim, each tool
  input redacted THEN clipped, and every tool RESULT replaced by
  "ok, N chars (omitted)" -- no result byte is on the wire at any stage. First row
  and newest six pinned and never asked about.
- Redaction goes through platform.context.redact_via_context, not the bare
  baseline: the state is a whole transcript, so a baseline-only pass would send a
  companion-defined credential verbatim. The shim re-raises a composition failure
  by design; that is caught and the FIELD IS DROPPED, because a scan that did not
  complete cannot clear text for the wire. Registered as a sink in
  security_posture.
- Five fitting rungs from the P3 spike (inputs 1000/200/60, then text to half,
  then a quarter with calls on one line); the first under ~25K estimated tokens is
  sent, and the ~8% that fit nowhere write a state-too-large row and send nothing.
- One Choice per non-pinned call (drop / call / both), batched 25 per request with
  the same state each, 4 concurrent, the whole run under the shared 10s ceiling.
  A batch is all-or-nothing and a partial answer publishes nothing, because
  "23 of 61" over calls nobody was asked about is a wrong number.
- Each compaction mints an attempt token synchronously before the task exists. A
  run whose token is not the session's newest publishes nothing, so a scoring that
  straggles past its own notice cannot have its record popped by the next
  compaction on that key. An ABSENT counter is a mismatch, never a match: the cap
  evicts the oldest counters, and reading an absent one as equal would let the
  token AUTHORIZE a publish. It is subtractive -- it may only ever refuse.
- Tool ROWS are folded by tool_call_id before anything is counted. One logical call
  reaches the transcript as up to three role="tool" rows sharing one id -- the
  dispatch row, plus the approval path's approved/rejected row -- so a per-row count
  inflated total_calls, sent the same input twice, asked two questions about one
  call, and counted its characters twice in the denominator. Each field takes the
  first non-empty value and pinned is the OR across the rows; a row carrying no id
  gets a key of its own, because two rows naming no call cannot be shown to be the
  same call. The fold finishes before the cap, so the cap counts calls not rows.
- A walk past the 1000-call cap keeps the NEWEST calls, in chronological order,
  and COUNTS the ones it dropped as calls_truncated. The newest end is chosen
  rather than fallen into: a forward walk that simply stops admitting keeps the
  OLDEST, which are the least likely to still matter. The line states the count --
  "23 of 61 (+140 not scored)" -- only when it is non-zero, because a bare
  "23 of 61" is wrong when 61 is the cap and drawing nothing hides a measurement
  accurate about everything it covers.
- One outcome row per compaction: the call tallies plus chars_all,
  chars_today_eligible and chars_jev_eligible. Both arms are named for what they
  measure. The replay arm counts the rows the replay admits BY ROLE;
  build_session_replay additionally applies row quotas and an 80K character budget,
  so both arms are UPPER BOUNDS and the card says "up to". The true figure is
  deliberately not re-derived here -- the quota walk takes a ConversationLog rather
  than a row list and the budget is applied inline while formatting, so the only
  thing measurable is a rendered string carrying Role: prefixes, which would put
  formatting overhead inside a content measurement and break the invariant.
  chars_today_eligible <= chars_jev_eligible <= chars_all holds by construction, so
  chars_all counts every row EITHER arm counts -- the replay admits inject rows,
  which carry no tool call, and a denominator built from the state's roles alone
  rendered a share above 100%. The reader holds it too: a share above 1 prints no
  percentage rather than being clamped.

The third switch reports its own states

Its pending write freezes the master switch, because a scope PUT carries
`enabled: true`: flipping the scope and then revoking consent is two concurrent
writes to one keystone, and the scope one landing second restores consent the
owner just revoked. And a refused scope write renders the shared ErrorNotice
rather than snapping back in silence, which reads as the click not registering.
The equivalent guards for the tool-argument switch are deliberately absent: that
switch shipped with the same shape and #12492 is fixing it for every scope at once
server-side, so a second client-side guard here would be reverted by that change
rather than surviving it.

A third consent scope

compaction on the keystone, beside tool_args: absent reads as not consented, an
omitted PUT field preserves, disabling clears. tool_args does NOT grant it -- that
scope was reviewed as the arguments of the one call about to run, not as
everything the session has run. gate._tool_args_scoped becomes _scope_consented
and drives both scopes off one table, so a third is not a third predicate to
forget. No new endpoint.

The surface

The record is published into a bounded store the point owns (not
decisions.outcomes, whose one slot belongs to the next assistant reply and whose
discard hook a turn fires at its own start) and dashboard/state.py stamps it as
meta.decisions_strip on the compaction notice row it already appends.
CompactionKeepLine renders one line UNDER whatever the card drew -- success
notice, recycle notice, the error surface, or the summary card in either
disclosure state -- with the existing jev thumbs. No record, no line, which is
also what a scoring slower than its compaction produces.

One compaction card per screenshot frame, each scene served by its own harness
instance: sharing one harness and swapping its fixture left the previous scene's
frame composited for the next, and a frame showing four cards isolates none of
them. The capture now asserts the element it photographed contains the keep line,
the theme it is named for, and the text that makes it that frame -- including what
it must NOT say, since a positive check cannot tell a frame from the frame it is
contrasted with.

Docs: a section in both decisions docs stating exactly what leaves the machine,
and a feature-map row. Tests: the point, the hook, the scope round-trip and the
card, plus the spec's fenced record held against its reader. Screenshots: a
capture harness writing twelve frames over the real built SPA with only the
network stubbed, each asserting the words that make it that state.

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified at head c62a3296. I found no code defect, and I am deliberately not approving — the one thing I cannot settle as a reviewer is a product question, stated at the end.

The gate chain is correct and I checked it rather than took it. What goes on the wire is the user's query (text[:2000]) plus, per candidate, the text of each recalled memory, redacted then clipped to 200 chars (memory_recall.py:482-495, via screen_candidates:431 → scrubbed:366). Every layer in front of it holds:

  • consented_memory_text(state) is data.get("memory_text") is True (consent.py:216) — strict identity, its own scope separate from base consent, so a pre-existing consent is inert for this point. consent.py:348 also zeroes the scope whenever enabled is false, so the scope cannot outlive the switch above it.
  • The keystone is decisions_consent.json, sealed across the sandbox leaf sets and written only by the browser dashboard PUT — absent or unreadable resolves to off.
  • owner_turn=True has exactly one caller (memory_member._memory_recall_keep:133), itself gated on session_key in dashboard_surfaced_keys() and fail-closed on an empty set, so cron, subagent and closed-tab paths never reach it.
  • core.is_enabled(POINT) is checked before any redaction work, and the gate-level scrub_reason (gate.py:463-498) scans the exact state object that is then sent, refusing the whole request if a credential or exfil URL survives. No path between redaction and send reintroduces raw text.
  • The keep hook only narrows: identity-checked, filter-only, order preserved.

I mutation-verified the load-bearing assertion rather than trusting that it holds. Against copies of gate.py and consent.py under scratch, an early return True in _egress_scope_ok flips memory.recall from refused to enabled with no scope recorded — i.e. memory text would egress unconsented. Real tree untouched. The scope guard is load-bearing and the assertion is not vacuous.

GPT's two earlier blocking findings are genuinely fixed at this head, not narrowed. Reachability is rehomed onto the tool path (memory_member.api_memory_recall passes keep= into tier.recall, applied after fit), and the scope-only PUT no longer re-commits withdrawn consent — it defaults enabled to the recorded flag and the governance check now reads grants rather than enabled.

One real non-blocking item. The retry passes keep=keep (vector_memory.py:7786), so on _RecallSpaceChanged the hook runs a second time and each kept_memories takes a fresh _wait_budget() up to MAX_WAIT_SECS = 7.0. Two attempts can exceed RECALL_TIMEOUT_SECS = 9, so the route answers 504 instead of returning the memories it already found — which breaks the "every refusal keeps the similarity result" promise on exactly that path. TestTheWaitFitsInsideTheRoute pins only the single-attempt 7 < 9. Narrow (needs a raised provider.timeout_ms, a space-change retry, and a slow judge) and it degrades to an error with no privacy impact, so a follow-up is fine.

The question I am leaving to a maintainer. Every decision point shipped so far sends a category the user authored and can see in front of them: their own message excerpt, optionally prior turns. This is the first point whose payload is the user's stored memory content — text they wrote in some other session, possibly long ago, surfaced by similarity rather than chosen. The mechanism handles that correctly: a dedicated scope, strict identity, its own settings line ("Off until you turn it on, even if the switch above is already on"). But whether that category should leave the machine at all is a product call, not a gate-correctness call, and it is the kind of decision that gets made implicitly by a reviewer waving through a clean implementation. So: gates verified, category deferred to you.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 21, 2026
iamwhatever pushed a commit that referenced this pull request Sep 21, 2026
…it would keep

At every AUTOMATIC compaction, ask Jev which of the session's tool calls were
worth keeping, and show the answer as one line on the compaction notice. Nothing
is kept: the compaction runs byte-identically on every backend whatever Jev
answers, and there is no apply path at all. What this buys is the number a live
keep-list cannot be argued about without -- today's recycle replay keeps the
conversation text alone (context.RECALL_ROLES), and 87% of a measured transcript
is tool traffic. The decision that consumes it is tracked in #12516.

Manual /compact is excluded by construction, not by a flag: the dashboard
dispatches it as an ordinary turn through provider.stream_command and never
reaches the coordinator. A test pins that no caller of _compact_session exists
outside the session layer.

The point (decisions/points/compaction_keep.py)

- Hooked at session_compaction._compact_session, the one funnel both automatic
  entry points reach, above the arm choice so every backend is covered. The task
  is created and NEVER awaited, so the compaction cannot be delayed, failed or
  altered by it -- pinned by running one scripted compaction against a scoring
  that hangs for an hour and holding the outcome equal to a stubbed-out run.
  Scored on the compactions CREW ITSELF dispatches, which is not the same as every
  backend and the docs no longer imply it is: a harness that compacts on its own
  initiative is declined by the gate before the funnel (cc_managed for Claude-Code,
  compact_unsupported for KAS), so those compactions are never scored -- there is no
  Crew-side dispatch to hang a measurement on. The spec carries the full table.
- State from ConversationLog.read_messages: conversation text verbatim, each tool
  input redacted THEN clipped, and every tool RESULT replaced by
  "ok, N chars (omitted)" -- no result byte is on the wire at any stage. First row
  and newest six pinned and never asked about.
- Redaction goes through platform.context.redact_via_context, not the bare
  baseline: the state is a whole transcript, so a baseline-only pass would send a
  companion-defined credential verbatim. The shim re-raises a composition failure
  by design; that is caught and the FIELD IS DROPPED, because a scan that did not
  complete cannot clear text for the wire. Registered as a sink in
  security_posture.
- Five fitting rungs from the P3 spike (inputs 1000/200/60, then text to half,
  then a quarter with calls on one line); the first under ~25K estimated tokens is
  sent, and the ~8% that fit nowhere write a state-too-large row and send nothing.
- One Choice per non-pinned call (drop / call / both), batched 25 per request with
  the same state each, 4 concurrent, the whole run under the shared 10s ceiling.
  A batch is all-or-nothing and a partial answer publishes nothing, because
  "23 of 61" over calls nobody was asked about is a wrong number.
- Each compaction mints an attempt token synchronously before the task exists. A
  run whose token is not the session's newest publishes nothing, so a scoring that
  straggles past its own notice cannot have its record popped by the next
  compaction on that key. An ABSENT counter is a mismatch, never a match: the cap
  evicts the oldest counters, and reading an absent one as equal would let the
  token AUTHORIZE a publish. It is subtractive -- it may only ever refuse.
- Tool ROWS are folded by tool_call_id before anything is counted. One logical call
  reaches the transcript as up to three role="tool" rows sharing one id -- the
  dispatch row, plus the approval path's approved/rejected row -- so a per-row count
  inflated total_calls, sent the same input twice, asked two questions about one
  call, and counted its characters twice in the denominator. Each field takes the
  first non-empty value and pinned is the OR across the rows; a row carrying no id
  gets a key of its own, because two rows naming no call cannot be shown to be the
  same call. The fold finishes before the cap, so the cap counts calls not rows.
- A walk past the 1000-call cap keeps the NEWEST calls, in chronological order,
  and COUNTS the ones it dropped as calls_truncated. The newest end is chosen
  rather than fallen into: a forward walk that simply stops admitting keeps the
  OLDEST, which are the least likely to still matter. The line states the count --
  "23 of 61 (+140 not scored)" -- only when it is non-zero, because a bare
  "23 of 61" is wrong when 61 is the cap and drawing nothing hides a measurement
  accurate about everything it covers.
- One outcome row per compaction: the call tallies plus chars_all,
  chars_today_eligible and chars_jev_eligible. Both arms are named for what they
  measure. The replay arm counts the rows the replay admits BY ROLE;
  build_session_replay additionally applies row quotas and an 80K character budget,
  so both arms are UPPER BOUNDS and the card says "up to". The true figure is
  deliberately not re-derived here -- the quota walk takes a ConversationLog rather
  than a row list and the budget is applied inline while formatting, so the only
  thing measurable is a rendered string carrying Role: prefixes, which would put
  formatting overhead inside a content measurement and break the invariant.
  chars_today_eligible <= chars_jev_eligible <= chars_all holds by construction, so
  chars_all counts every row EITHER arm counts -- the replay admits inject rows,
  which carry no tool call, and a denominator built from the state's roles alone
  rendered a share above 100%. The reader holds it too: a share above 1 prints no
  percentage rather than being clamped.

The third switch reports its own states

Its pending write freezes the master switch, because a scope PUT carries
`enabled: true`: flipping the scope and then revoking consent is two concurrent
writes to one keystone, and the scope one landing second restores consent the
owner just revoked. And a refused scope write renders the shared ErrorNotice
rather than snapping back in silence, which reads as the click not registering.
The equivalent guards for the tool-argument switch are deliberately absent: that
switch shipped with the same shape and #12492 is fixing it for every scope at once
server-side, so a second client-side guard here would be reverted by that change
rather than surviving it.

A third consent scope

compaction on the keystone, beside tool_args: absent reads as not consented, an
omitted PUT field preserves, disabling clears. tool_args does NOT grant it -- that
scope was reviewed as the arguments of the one call about to run, not as
everything the session has run. gate._tool_args_scoped becomes _scope_consented
and drives both scopes off one table, so a third is not a third predicate to
forget. No new endpoint.

The surface

The record is published into a bounded store the point owns (not
decisions.outcomes, whose one slot belongs to the next assistant reply and whose
discard hook a turn fires at its own start) and dashboard/state.py stamps it as
meta.decisions_strip on the compaction notice row it already appends.
CompactionKeepLine renders one line UNDER whatever the card drew -- success
notice, recycle notice, the error surface, or the summary card in either
disclosure state -- with the existing jev thumbs. No record, no line, which is
also what a scoring slower than its compaction produces.

One compaction card per screenshot frame, each scene served by its own harness
instance: sharing one harness and swapping its fixture left the previous scene's
frame composited for the next, and a frame showing four cards isolates none of
them. The capture now asserts the element it photographed contains the keep line,
the theme it is named for, and the text that makes it that frame -- including what
it must NOT say, since a positive check cannot tell a frame from the frame it is
contrasted with.

Docs: a section in both decisions docs stating exactly what leaves the machine,
and a feature-map row. Tests: the point, the hook, the scope round-trip and the
card, plus the spec's fenced record held against its reader. Screenshots: a
capture harness writing twelve frames over the real built SPA with only the
network stubbed, each asserting the words that make it that state.
@iamwhatever
iamwhatever force-pushed the feat/decisions-memory-recall branch from c62a329 to 65c7aee Compare September 21, 2026 16:43
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for ad31fa49508d5d6c592409acc939155f2c8fb720; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt ad31fa49508d5d6c592409acc939155f2c8fb720: <one-sentence reason>

buluoray
buluoray previously approved these changes Sep 21, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at head ad31fa49. I withheld approval earlier on the category rather than on the code; the maintainer has now ruled that conversation and memory content may go to Jev, so what remains is the mechanism, and I verified that before.

The category, stated for the record. This is the point that sends the text of a recalled memory -- what the user wrote in a previous session, surfaced by similarity, redacted and clipped to 200 characters -- rather than what they typed in the turn at hand. That is a different thing from every earlier point, which is why it was worth a decision rather than an approval, and why the separate scope is correct rather than ceremonial.

The gate chain holds. consented_memory_text is a strict data.get("memory_text") is True on its own keystone field, so absent, "true" and 1 all read as not consented and an already-consented install is inert for this point rather than retroactively enrolled. consent.py:348 keeps the upper switch authoritative -- turning the main switch off zeroes the scopes, so a scope cannot outlive the consent it hangs under.

I mutation-verified the guard on scratch copies rather than reading it: making _egress_scope_ok return True early flips memory.recall from refused to permitted with no scope granted, and restoring it refuses again. Load-bearing.

One non-blocking defect I want on the record, because it trades a working feature for a worse failure. The retry path passes keep=keep (vector_memory.py:7786), so on _RecallSpaceChanged the hook runs a second time and each run takes its own MAX_WAIT_SECS = 7.0. Two of those exceed RECALL_TIMEOUT_SECS = 9, and the route then answers 504 instead of returning the memories it had already found -- which breaks the promise the design otherwise keeps, that a refusal still yields the similarity results. The existing test pins the single-run case at 7 < 9, so it cannot see this. The fix is to budget the retry against the remaining time rather than granting it a fresh 7 seconds.

Everything else I checked stands: independent scope, sealed keystone, verbatim endpoint match, and scrub_reason running over the object actually about to go on the wire.

The agent recalls memory on demand, through the `memory_recall` tool: the tool
calls `GET /api/memory/recall`, the route calls `VectorMemoryStore.recall`, and
that searches episodes by vector similarity, drops what falls under the
length-aware cosine relevance gate, and bounds the survivors with its own `fit`
walk. Similarity is the only judgement made, so a memory that is ABOUT the same
words as the question is returned whether or not it answers it -- and every
returned episode is paid for twice, once out of the tool's response budget and
again out of the model's window.

`memory.recall` asks the second question, per candidate: keep this one, or drop
it. Jev's kept set is what the tool returns.

Where the seam is, and where it deliberately is not
---------------------------------------------------
`VectorMemoryStore.recall(keep=...)`, armed by
`handlers/memory_member._memory_recall_keep`. The route is the one place with all
three things the point needs: the session key (from `X-Session-Key`, which the MCP
tool sends), the event loop, and the `run_in_embed_pool` call that puts `recall`
on the worker thread the point must run from.

NOT on `get_episodic_context`. Prompt assembly asks `MemoryStore.get_context` for
preferences with `include_activity=False`, and that same flag gates episodic
retrieval, so that block is not built on any live path -- a `keep=` parameter
there is a second door nothing opens, which the next reader would take for a live
path. So there is none, and three assertions pin that it stays absent along with
`get_context`'s carried hook and `ContextBuilder`'s hook builder.

A SUBSET, enforced twice
------------------------
It cannot reorder -- a keep/drop answer says nothing about rank. It cannot widen,
and that takes two enforcement points: `_kept_episodes` refuses an answer naming
a row the search did not rank, and the hook is offered the rows `fit` ALREADY
SELECTED rather than the raw result. Without that ordering, dropping a high-ranked
episode frees budget a lower-ranked one -- one `fit` had excluded -- then fits
into, which is the hook adding a memory the response would never have carried.

A row the point's own screen dropped, capped out past `MAX_CANDIDATES` or
carrying an unusable id, is returned unconditionally: a plain filter cannot tell
"past the cap" from "Jev said no".

Every refusal returns the similarity result unchanged: the point off, the scope
unconsented, the session unsampled, a partial or out-of-domain answer, a timeout,
a transport failure, no usable loop. The wait is bounded by `gate.timeout_secs()`
plus 0.5s of slack, clamped into 0.25s..10s.

Its own consent
---------------
A recalled memory is not the text the main switch describes: that consent is
recorded against a message excerpt the owner just typed and skill descriptions
this build shipped, while a recalled memory is text the AGENT wrote down turns or
days ago about work the owner was not reviewing. So the keystone records
`memory_text`, default FALSE, and `gate.POINT_EGRESS_SCOPES` refuses the point
without it. `POINTS_NEEDING_TOOL_ARGS` becomes that map -- point to (reader name,
what it sends, which switch grants it) -- with the reader resolved by name at call
time, because a captured function is a second handle the module cannot patch.

A scope-only PUT omits `enabled` entirely and the writer preserves the recorded
flag and endpoint (`KEEP_ENABLED`, resolved inside its own lock). Sending even the
value the card just read is a write against a switch the owner did not touch, and
a stale read re-commits a withdrawn consent. The ceiling is held against whether a
write GRANTS rather than against `enabled`, so a scope grant under a pin is 403
while a revoke stays available. One `scopePending` freezes every switch while any
scope write is outstanding, and each scope has its own error notice.

Only for a live dashboard surface
---------------------------------
The call site's condition: the egress is snippets of the member's own memories and
the receipt rides a reply someone is looking at. `has_dashboard_surface` is
observed state, so a channel-born session with its tab open qualifies -- the owner
is reading that conversation in the dashboard.

The receipt
-----------
`memory · recalled: 6 · Jev kept: 3 (0.81, 210 ms) · saved 2.1K chars`, counts
collapsed and ids expanded, a thumbs pair per side, published through
`decisions.outcomes` onto the assistant row that ends the turn. On a record
carrying an `error` the count and the list title name the FALLBACK, because the
decision did not land. The record spells its lists `baseline_keys`/`jev_keys`,
which keeps the three readers on `meta.decisions_strip` from rendering each
other's records; rows travel by identity because the store judges membership with
`id()`, carried through the signatures by a `RowT` TypeVar.

No new route and no new config beyond the point name.

Only a committed recall leaves a receipt
----------------------------------------
`_recall_once` validates the embedding generation AFTER applying the hook, and
`recall` answers a moved generation by running the whole recall again keyword-only.
So an outcome written the moment the answer arrived could describe a subset the
store then discarded, and a retried recall left two rows for one tool call.

The point now HOLDS its outcome (`kept_memories(pending=...)`) and the route
commits it (`commit_outcome`) only once the recall has come back and it is
answering with it. Only the LAST held entry is committed -- that is the attempt
whose result was returned. A late provider answer, a superseded generation, a
request that raised after the decision, a refused route: each commits nothing, so a
failure leaves no receipt at all. The gate's own call row still records a timeout,
because that is a fact an operator acts on.

The retry test makes the two attempts answer DIFFERENTLY, so "commit the last" is
distinguishable from "commit the first" -- with identical answers the assertion
passed under either, which a mutation check caught.
@iamwhatever

Copy link
Copy Markdown
Contributor Author

[operator: iamwhatever] Re-captured from a HEAD build after this round's six fixes, plus the toggle recording the UX lane asked for.

Every frame below was read back off the live DOM before upload, not checked by eye: the egress note reads Three further categories and names tool arguments, the compaction scope and recalled-memory snippets in the order the three switches render; the refused-write notice reads Could not save "Also send snippets of recalled memories so Jev can drop the ones that do not help"; and the failed record carries no Rate Jev's pick and no Jev thumbs, only the similarity pair.

These replace the older shots in the description, which predate the third scope switch.

Collapsed strip, Jev narrowed the recall, light theme

Collapsed strip, Jev narrowed the recall, dark theme

Collapsed strip, Jev kept every recalled memory

Expanded strip, light theme

Expanded strip, dark theme

Expanded strip, Jev kept nothing

Expanded strip, the decision failed, no Jev thumbs

Decisions card with all three scope switches, light theme

Decisions card with all three scope switches, dark theme

The refused scope write, the notice naming its switch

memory-recall-strip-toggle.webm

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for c3ad10a22dd624df4396041477087f367c0d810d; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt c3ad10a22dd624df4396041477087f367c0d810d: <one-sentence reason>

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for c3ad10a22dd624df4396041477087f367c0d810d; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt c3ad10a22dd624df4396041477087f367c0d810d: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for bf1532511dce546c57f6a8772db2487744800c02; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt bf1532511dce546c57f6a8772db2487744800c02: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for 42d1db2569d9f19a15a9e7c893de0d7659c45f21; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 42d1db2569d9f19a15a9e7c893de0d7659c45f21: <one-sentence reason>

@iamwhatever

Copy link
Copy Markdown
Contributor Author

[operator: iamwhatever] Re-captured from a HEAD build after this round's five fixes. Every expanded still is new — they all predated the scope note — plus two frames for states the harness had no fixture for.

Read back off the live DOM before upload, not checked by eye: the card's decides-list carries Which recalled memories reach the prompt · logged as memory.recall; the two pairs read Rate Jev's narrowing and Rate the search; the bounded panel carries Dropped to fit · 2 that Jev kept did not fit the response; and the failed panel carries The search itself ran; only Jev's narrowing failed, so this rates the memories you received. with no Jev pair at all.

Collapsed strip, Jev narrowed the recall, light

Collapsed strip, Jev narrowed the recall, dark

Expanded strip with the scope note, light

Expanded strip with the scope note, dark

Expanded strip, the response budget dropped two Jev kept

Expanded strip, decision failed, no Jev thumbs and the search-ran note

Expanded strip, Jev kept nothing

Decisions card with the recalled-memory scope granted and the memory.recall row

Decisions card, three scope switches at their default, light

Decisions card, three scope switches at their default, dark

Collapsed strip, Jev kept every recalled memory

The refused scope write, the notice naming its switch

@iamwhatever

Copy link
Copy Markdown
Contributor Author

[operator: iamwhatever] Re-captured from a HEAD build after the accounting pass. Two of the previous frames were photographing the wrong row: the harness had a locator collision, so the kept-none caption sat over the bounded row and the bounded caption sat over a collapsed strip. Rows are now selected by the state each frame is of.

Each frame's row was read back off the live DOM through the capture script's own selectors and click order, so the caption-to-asset mapping is measured rather than assumed:

  • collapsed-narrowed — Jev kept: 3, collapsed
  • expanded — Jev kept: 3, expanded
  • expanded-kept-none — Jev kept: 0, expanded (previously showed Jev kept: 1)
  • expanded-bounded — Jev kept: 3 over Dropped to fit · 2 of the 3 Jev kept did not fit the response, expanded (previously collapsed)
  • expanded-error — kept after fallback: 6, the search-ran note, no Jev pair

Collapsed strip, Jev narrowed the recall, light

Collapsed strip, Jev narrowed the recall, dark

Expanded strip, light

Expanded strip, dark

Expanded strip, Jev kept 0 of 6, light

Expanded strip, Jev kept 0 of 6, dark

Expanded strip, Jev kept 3 and 2 of those did not fit

Expanded strip, decision failed, search-ran note and no Jev thumbs

Decisions card with the memory scope granted and the memory.recall row

Decisions card, three scope switches at their default, light

Decisions card, three scope switches at their default, dark

The refused scope write, the notice naming its switch

… writer

Four rounds of findings on this receipt were all the same defect: the numbers
did not describe what happened. So this settles the accounting once, in the
point's module docstring, and makes every producer and every string follow it.

Four things shorten a recall, and each number names exactly one of them.
`candidates` is OFFERED -- the rows put in front of the oracle. `baseline_keys`
is what the recall returns without the point. `jev_keys` is KEPT BY JEV: the
decision's own output, never quietly narrowed into the set that shipped.
`bounded_omitted` is DROPPED BY BOUNDING, counted BESIDE the kept list rather
than subtracted from it, so `len(jev_keys) - bounded_omitted` is what arrived
and each removal stays attributable to whoever made it. Folding the second into
the first is what made the header read "Jev kept 1" beside a row saying "2 that
Jev kept did not fit".

`chars_saved` is the memory text JEV'S NARROWING removed and nothing else's.
Both arms are measured on the same rows at the same moment, before redaction and
before bounding, so the scrubber's substitutions are absent from the difference
by construction rather than subtracted by hand. REMOVED BY REDACTION is
therefore a quantity the receipt deliberately does not carry: it is the same
scrubbing applied to whatever ships and no part of what Jev decided.
`baseline_chars` and `jev_chars` both ride the row so a reader can check the
subtraction.

`commit_receipt` is the ONLY writer, and it takes the completed payload as an
argument. That is structural rather than conventional: a caller cannot reach it
without the finished response in hand, and the writer -- not the caller --
checks that something was held, that the payload carries a delivered
`retrieval`, and that the request has not been abandoned. `delivered_outcome`
and `publish_outcome` are not reachable names, and a test holds them gone.

The dashboard-surface gate is read on the line before `core.decide`, because
that call IS the egress: it is where snippets of the owner's own remembered
notes leave the machine. The reads in the route and in `kept_memories` are cost
savers, each happening while the answer can still change -- the owner closes the
tab, the slot leaves the published set, and a request already assembled would
still go out. Removing either of them leaves the route-level test passing on the
strength of the guard at the call, which is what says where the gate actually
is.

The strip follows the same accounting. The `Dropped to fit` row carries both
numbers in one wording, so the subtraction closes where a reader sees it. The
search pair says where it sits in the sequence (`Rate the search (before Jev)`),
because two names for adjacent steps read as one step. The saving's legend says
whose removal it counts and what it excludes.

The capture harness selects rows by the state each frame is of, so the
kept-none and payload-bounded frames photograph their own panels, and the
bounded fixture carries Jev's own three with two lost to the budget.
@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for 6a6e24d874858b7d4cd0308c33f0fda94afb29ab; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 6a6e24d874858b7d4cd0308c33f0fda94afb29ab: <one-sentence reason>

@iamwhatever

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 6a6e24d: Both residuals are the inherent window of a pre-await check rather than a missing guard -- the surface test now sits on the line before the egress call and the receipt path already refuses an abandoned request, the payload is the owner's own memory text going to the endpoint they consented to on an owner-typed turn, and closing either properly needs a cancellation scope across every point, tracked on #12532.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@iamwhatever marked the gpt AI finding as false positive, not applicable, or explicitly accepted for 6a6e24d874858b7d4cd0308c33f0fda94afb29ab.

Both residuals are the inherent window of a pre-await check rather than a missing guard -- the surface test now sits on the line before the egress call and the receipt path already refuses an abandoned request, the payload is the owner's own memory text going to the endpoint they consented to on an owner-typed turn, and closing either properly needs a cancellation scope across every point, tracked on #12532.

This decision applies only to this commit. A new push requires a new judgment.

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.

3 participants