Repository navigation
feat(decisions): shadow-score auto-compaction with Jev and show what it would keep - #12496
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the App bundle ceiling bump: main alone is already 1,712 B over budget, so this PR absorbs another PR's drift into its own gate change. Suggestions
[DESIGN-REVIEWED] 120219b |
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The keep line's numbers confuse a cold reader: the "(+140 not scored)" total is ambiguous, and "would keep" beside a failure notice reads as contradiction. Watch
Suggestions
[UX-REVIEWED] 120219b |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Confirm #12516 is a real, live design effort: this feature's whole reason to exist is feeding that decision, and its cost (up to ~40 judge requests per compaction) is paid now. What this change shipsInventory (10 items) — 10 justifiedIntent: Let a consenting owner see, at each automatic compaction, which tool calls an oracle would have kept — producing the data the live keep-list design (#12516) needs — without changing any compaction. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 120219b |
GPT 5.6 Review — ✅ no blocking findings (all downgraded on adjudication)GPT 5.6 flagged blocking issues on This comment is updated in place on each push. Review detailsBLOCKING -- src/kiro_crew/decisions/points/compaction_keep.py:459 -- The row cap reports a truncated tail as the whole transcript Adjudication (Opus 4.8) — is blocking on each finding proportionate?F1 — Conditions: a session transcript must exceed MAX_ROWS=4000 rows ( Recovery/effect ( Harm rung: LOW — an informational undercount on an experimental "what it would keep" surface, only when a transcript exceeds 4000 rows, self-consistent and non-persistent. The real fix threads a new omitted-row count across False positive or not applicable? A repository writer can comment: |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/decisions/points/compaction_keep.py:307 -- companion credential patterns bypass redaction
BLOCKING -- website/src/pages/settings/FeaturePreviewsSection.tsx:233 -- scope update can undo consent revocation
BLOCKING -- src/kiro_crew/decisions/points/compaction_keep.py:449 -- injected rows corrupt character percentages
[BLOCK-MERGE] e346d26 |
e346d26 to
f1c668c
Compare
|
[operator: iamwhatever] Dispositions for the round-1 and round-2 findings, all on Fixed in this pushGPT F3 / GPT round-2 #1 / GPT F2 / GPT F1 / Design Review / UX Review BLOCK — no rendered evidence. Closed on the previous push: Not fixed here, deliberatelyGPT round-2 #2 / First Principles CONCERNS — the sizing evidence points at nothing anyone can open. Fair, and worth stating plainly rather than arguing: the Verified locally on
|
|
[operator: iamwhatever] Screenshot evidence for |
GPT 5.6 Review —
|
|
[operator: iamwhatever] Round 3 on
|
GPT 5.6 Review —
|
b670dfd to
cdc0379
Compare
|
All three on (1) The admission clip ran before redaction — real, and mine
The admission bound now goes through Two tests:
Revert-verified: restoring the slice fails the straddling case. Lengths are still taken from the RAW value, before both the redaction and the clip, so (2)
|
2f36042 to
15d2a06
Compare
|
Rebased onto The conflict —
|
| variant | entry |
|---|---|
| as committed | DROPPED |
disabled back on one line |
DROPPED |
| comment removed from the props | KEPT |
So the formatting was innocent and the prose was the cause. The reasoning now lives above the element, where the scanner never reads it — which also means no future edit to that paragraph can drop the entry again. The condition itself is unchanged.
With that, the generated files are byte-identical to what the rebased commit already carried, and the guard passes.
(2) Frontend Tests (1) — the skip was one I created, so it is gone rather than accounted
settingsCoverage.test.ts reported FeaturePreviewsSection.tsx: skipped 1 (accounted 0). Not one of the three switches: every label in the file is a literal i18nT('…').
tagStartRe is a regex over the raw source, and my new comment spelled the primitive with its leading angle bracket. The extractor matched that prose as an element, found no label, and counted a dynamic-label skip. Reworded to name the primitive without the bracket, and the comment says why so the next editor does not put it back.
That is why there is no new EXPECTED_DYNAMIC_SKIPS entry: the right fix was to stop manufacturing the skip, not to record it. Repo-wide skips are back to 18 = 16 + 1 + 1, all pre-existing and all accounted.
Worth a separate issue, not this PR
extractJsxProps reading quotes inside // and /* */ comment spans is a live trap for every settings panel: one apostrophe in a comment placed among an element's props silently removes that setting from search, and the only signal is a SKIP (ceiling) warning in generator output nobody reads. I have not touched the shared script — changing its scanning could move other files' entries — but say the word and I will open it.
Verified locally after the rebase
gen:settings (212 entries, 18 skips, generated files unchanged); settingsCoverage.test.ts + settingsRegistry.test.ts 17 pass; 219 vitest across the 11 locale style suites (with I18N_BASE_REF set so [changed-values] ran), the settings card, the keep line, the spec contract and both settings-extract suites; i18n:check exit 0, all sub-gates ok; 128 pytest across the three compaction suites; eslint. git diff origin/main...HEAD --stat lists 44 files, all this branch's.
15d2a06 to
484ec18
Compare
|
Head The class, not the linespan= The finding named two lines; the fixable thing is the SHAPE of a scope write. A body carrying
The last row is the one that matters for the omission not being a widening: accepting an absent Both revert-verified: making the writer treat a scope write as enabling fails 2 route tests; putting the switch back in the client's body fails 2 body tests. The four existing card assertions moved from The rebase carried #12267Main moved 11 commits mid-round and span= Verified nothing of #12267 was lost by counting its own symbols on both sides rather than by reading the diff: One process note, since it bit me: my first splice of the contract test cut main's Dispositions
Verified locally366 pytest across the six decisions suites; 1292 pytest on the |
|
[operator: iamwhatever] Round 12 — the three reds on
Attribution was measured on a pristine
So main fits and this surface is what tips it. The ceiling moves by exactly that 2,761 B delta, rounded up to the table's whole-KB unit: 3533 → 3536 KB (+3,072 B). The number is in the commit body. Two things worth recording rather than leaving implied. The entry's comment says "measured 3364.4 KB … ~5% headroom", and main now measures 3531.4 KB — the documented margin has been consumed by ~167 KB of main-side growth without the entry being re-measured, so its real headroom was 0.045%, not 5%. I did not restore the 5% the entry's own convention prescribes: that is a re-measure of main's drift, not this surface's cost, and widening a shared ceiling beyond my own delta inside a frozen PR is not mine to do. The consequence is that at 1,646 B of remaining headroom the next app-core addition trips this entry again — the same recurrence the
The decisive evidence is the shard map.
Enumerated both shards on both trees: shard 3 collects the same 332 files and shard 6 the same 362 files on this branch as on Both failure mechanisms are environmental and readable in the traceback, not assertions about product behaviour:
I cannot run Windows here, so I am not claiming either is a proven flake; the claim is narrower and sufficient: the two shards collect identical file sets to main's, so nothing test-side in this branch reaches them. Both are yours to rerun. Unchanged and confirmed in the diff: the consent-restore fix. A scope write omits Verified locally on the rebased tree: 366 pytest across the six touched backend files, 131 vitest across the six touched suites, |
…it would keep Adds a SHADOW decision point `compaction.keep`: when Crew compacts a session it asks Jev which tool calls it would keep, records the answer, and shows it on the compaction card. Nothing about the compaction changes -- the point is measurement only, behind its own consent scope, off by default. The App chunk's bundle budget moves 3533 -> 3538 KB. Measured, not estimated, by building pristine main in its own worktree and then this branch on top: main @ 20261b7 alone builds the chunk at 3,619,504 B against the 3533 KB (3,617,792 B) ceiling, so main exceeds it by 1,712 B with no PR code in the tree; this surface adds 2,761 B of first-party code, for a merge result of 3,622,265 B. The new ceiling covers both parts and leaves 647 B of headroom. It is deliberately NOT restored to the ~5% margin that entry's comment prescribes: main's drift consumed that margin and re-measuring it is a separate change, not this surface's cost.
|
[operator: iamwhatever] Rebased onto main The App bundle ceiling had to move again, and most of it is not this PRI re-derived the delta on the new main rather than carrying the previous absolute number forward. Two analyze builds: pristine main in its own detached worktree, then this branch on top of it.
The first row is the finding: That is why raising the entry by exactly my measured delta does not clear it: 3533 KB + 2,761 B rounds to 3536 KB, which my branch still exceeds by 1,401 B, because main has already spent 1,712 B of the budget. The ceiling therefore moves to 3538 KB (3,622,912 B), which covers both parts and leaves 647 B of headroom. The entry comment and the commit body both name the split — 1,712 B main's drift, 2,761 B this surface's — rather than presenting the whole move as this PR's cost. I deliberately did not restore the ~5% margin that entry's older lines prescribe. Doing that is a re-measure of main's growth, which is a different change from this one. The consequence is that 647 B of headroom will not survive the next app-core addition, which is the same recurrence the Only Still in the diffThe consent-restore fix is intact and unchanged by the rebase: a scope toggle sends no Verified locally on the rebased tree133 pytest across the three compaction test files, 204 vitest across 16 files (the keep line, the strip contract, the consent scope body, the decisions settings card, settings coverage, and all 11 locale style suites), |
GPT 5.6 Review —
|
buluoray
left a comment
There was a problem hiding this comment.
Verified at head 120219bf. Not approving, and neither reason is a defect in this code. Both are decisions above a reviewer's pay grade, so I am leaving them with the maintainer rather than settling them by approving.
What leaves the machine
Answering this first because it is the whole review. The body POSTed to https://api.typesafe.ai/v1/systemone (impl_jev.py:189-197, allow_redirects=False) carries a state built by compaction_keep.build_state from ConversationLog().read_messages(session_key) -- the session's own JSONL. Concretely:
messages:userandassistanttext, verbatim at the first three rungs (text_share1.0, 1.0, 1.0), head+tail halved and quartered at the last two. Not the current turn -- every turn of this slot's conversation up to the pre-compaction boundary, newestMAX_ROWS= 4000.calls: each tool call'stoolname and itsinput, redacted then clipped tostage.input_chars(1000 → 200 → 60), up toMAX_CALLS= 1000.- Tool results are never sent at any stage --
result_placeholder(chars)yieldsok, N chars (omitted). That is the widest omission in the seam and it keeps the largest half of a transcript local.
Admission clip is MAX_FIELD_CHARS = 4096 per retained string, redact-then-clip (correct order -- a slice placed inside a secret leaves a fragment neither pattern matches). STATE_TOKEN_CEILING = 25,000 tokens picks the first fitting rung; a transcript that never fits sends nothing.
The gate chain is sound and I verified each link: sealed keystone (decisions_consent.json, a _CREW_SECRET_LEAVES / _CREW_READONLY_LEAVES leaf, unreadable ⇒ off), permits() requiring enabled is True plus a verbatim endpoint match, scrub_reason over the same json.dumps rendering the wire uses with no interposed rewrite, and a third scope consented_compaction on a strict data.get("compaction") is True -- "true" and 1 both read False, and an unreadable scope refuses. A tool_args-only install is inert here.
I mutation-verified the scope guard on scratch copies rather than taking it on trust:
permits(endpoint) with compaction=False : True # switch+endpoint fine; refusal is purely the scope
is_enabled compaction=False (BASELINE) : False # refused
is_enabled compaction=True : True # permitted
is_enabled compaction=False (MUTATED) : True # guard neutralized -> flips to permitted
is_enabled compaction=False (RESTORED) : False
Load-bearing, not decorative.
And it is shadow-only -- no third-party score can discard local data. I looked for a write path and there is none: score_compaction → publish_record → take_record, consumed only by dashboard/state.py:_on_compacted to attach meta["decisions_strip"] to a display notice row. _shadow_score_compaction is an un-awaited create_task at the top of _compact_session, so the compaction proceeds on its own coroutine before any arm is chosen. A missing record just yields no card line. That was my largest worry going in and it is cleanly answered.
Why I am not approving
One: this is a bigger egress category than the memory-content point, and that one is still undecided. I deferred #12492 to the maintainer because it was the first point to send text the user had stored in a previous session rather than typed in the current turn. This sends strictly more: the whole conversation, both sides, verbatim at the first three rungs.
And calls[].input is not only command lines. I traced the plumbing: the transcript row's input is _redact_tool_field(event.tool_input) (chat_runner.py:3114), i.e. the tool's own argument payload, and for an edit tool that payload is the content -- derive_edit_diff (acp/_dispatch.py:505-560) renders a create's content/fileText/text as a whole-file addition and a strReplace's oldStr/newStr as a replace hunk. So up to 1000 characters of a file the agent wrote can travel, per call, for up to 1000 calls, under the 25,000-token ceiling.
Redaction covers credentials and exfiltration URLs -- routed through redact_via_context so a companion's own patterns apply, and dropping the field outright on a composition failure, which is the right direction. It does not cover source code or private prose, and it is not meant to. The docstring is explicit and, I think, correct that a credential in a tool argument is ordinary (an aws command, a curl header) and that refusing on it would mean the point never fires on the transcripts most worth measuring. I am not disputing any of that. I am saying the category -- conversation text plus authored file content leaving the machine -- is a product call, and it is the kind that gets decided by default when a reviewer approves a clean implementation.
Two: GPT 5.6 has no verdict on this head, and the green rollup hides it. The check-run reports SUCCESS while the comment says: "GPT 5.6 did not produce a complete verdict for 120219bf…; inspect the workflow logs and re-run it." The same thing happened on b670dfd3, so it is not a one-off. Opus 4.8 (the other blocking-capable lane) did complete with no findings, and Design and First Principles both PASS, so this is not #12229's situation where every blocking lane was dark. But on the largest egress surface in the repo I would rather have the second one than infer it from a green tick, especially since the tick is what a triage pass reads.
UX Review's CONCERNS I verified as accurate and non-blocking: "(+140 not scored)" maps to a real calls_truncated, and the "Jev would keep 7 of 61" line reading as descriptive under a restart-failure notice is display-copy nuance. Neither touches egress or correctness.
Tests: test_decisions_compaction_keep.py + scope logic 110 passed; scope route tests 28 passed with the head handler; test_decisions_gate.py + test_decisions_consent.py 194 passed. Four cases in test_decisions_compaction_hook.py reference head dashboard/state.py I did not overlay -- overlay artifacts, and I verified that function from the diff instead.
Re-run GPT on this head and settle the category, and I will approve on the mechanism -- it is the most carefully gated of the three Jev points.
buluoray
left a comment
There was a problem hiding this comment.
Approving at head 120219bf. The egress category is now a decided question -- the maintainer has ruled that conversation content may go to Jev -- so the mechanism is what remains, and I verified it before and re-state the load-bearing parts here.
My earlier comment on this PR withheld approval for two reasons. The first is settled by that ruling. The second is not settled and I am recording it rather than letting it pass silently, because a green check-run conceals it.
What the ruling covers, stated plainly so the record is not vague. The state POSTed to https://api.typesafe.ai/v1/systemone carries user and assistant text verbatim at the first three fitting rungs, across every turn of the slot's conversation up to the pre-compaction boundary (newest MAX_ROWS = 4000), plus each tool call's input redacted and clipped to 1000 / 200 / 60 characters by rung (MAX_CALLS = 1000). Tool results never leave -- result_placeholder replaces each with ok, N chars (omitted), which keeps the largest half of a transcript local. The page's own wording for this is accurate and worth keeping as the canonical description: "a whole session transcript, the conversation text plus the INPUT of every tool call in it, with each tool RESULT replaced by its own character count so no output byte leaves."
One consequence deserves to be explicit in the record, since it is the part a consenting owner is least likely to picture: a tool call's input is the tool's own argument payload (chat_runner.py:3114 stores _redact_tool_field(event.tool_input)), and for an edit tool derive_edit_diff (acp/_dispatch.py:505-560) renders a create's content as a whole-file addition and a strReplace's oldStr/newStr as a replace hunk. So up to 1000 characters of a file the agent authored can travel, per call. Redaction covers credentials and exfiltration URLs -- through redact_via_context, so a companion's own patterns apply, and dropping the field outright on a composition failure -- and does not cover source code, which is the correct scope for a redactor and the reason the consent scope is where this decision belongs.
The scope design is the right shape and I checked each link. Sealed keystone (decisions_consent.json, a _CREW_SECRET_LEAVES / _CREW_READONLY_LEAVES leaf, unreadable reads as off), permits() requiring enabled is True plus a verbatim endpoint match, scrub_reason over the same json.dumps rendering the wire uses with no interposed rewrite, and a third independent scope on a strict data.get("compaction") is True -- "true" and 1 both read False, an unreadable scope refuses, and an already-consented tool_args install is inert here rather than retroactively signed up. That last property is the one that makes a third switch worth its cost, and the stated reason is the right one: the narrower yes was reviewed as the arguments of the one call about to run, not as everything the session has run.
I mutation-verified the scope guard rather than taking it on trust -- neutralizing _scope_consented flips the point from refused to permitted with the scope unconsented, and restoring it refuses again.
And it cannot lose local data. I went looking for a write path for the score and there is none: score_compaction → publish_record → take_record, consumed only by dashboard/state.py:_on_compacted to attach meta["decisions_strip"] to a display notice row. _shadow_score_compaction is an un-awaited create_task at the top of _compact_session, so the compaction proceeds on its own coroutine before any arm is chosen; a missing record just yields no card line. A third party scoring what compaction discards, with no ability to change what it discards, is the version of this that is safe to ship.
The open item I am approving over, recorded so it is not lost: GPT 5.6 has no verdict on this head. Its comment says so -- "did not produce a complete verdict for 120219bf…; inspect the workflow logs and re-run it" -- while the GPT 5.6 Review check-run reports SUCCESS, so the green rollup does not show it.
Two things I established that bear on what to do about it. It is not diff size: #12425 at 153 files and 4,263 additions got a real verdict. And the remedy the bot itself advertises has already been tried -- the GPT run for this head is at attempt=2 with every step reporting success, and the verdict comment has not moved since it was first posted. So a further re-run is not obviously the fix, and I did not establish the root cause.
Opus 4.8, the other blocking-capable lane, completed with no findings, and Design and First Principles both PASS. That is why this is a recorded gap rather than a hold. Closing it is a repository-writer action -- either a working re-run or /ai-review override gpt 120219bf…: <reason> -- and it is the maintainer's to take.
UX Review's CONCERNS I verified as accurate and non-blocking: "(+140 not scored)" maps to a real calls_truncated, and the "Jev would keep 7 of 61" line reading as descriptive under a restart-failure notice is display-copy nuance. Neither touches egress or correctness.
Tests: compaction-keep plus scope logic 110 passed, scope route tests 28 passed against the head handler, gate plus consent 194 passed. Four hook cases reference head dashboard/state.py I did not overlay; I verified that function from the diff instead.




















What this does
At every automatic compaction, Jev is asked — per tool call — whether the call and its result were worth keeping, and the answer is shown as one line on the compaction notice:
Nothing is kept. There is no apply path. The compaction runs byte-identically on every backend whatever Jev answers, and this PR's only product effect is one extra line on a notice plus rows in the decision log.
Why shadow rather than live
Nothing in Kiro Crew can replace a harness's message list —
LLMProviderhas no set-messages call and/compactsummarizes inside the harness process. The one place a keep-list could land is the transcript Crew re-injects after a recycle (context.build_session_replay), and that replay already admitsuser/assistant/injectrows only, so a live keep-list could only displace text inside the same 80 000-character budget. Whether that trade is worth making is a question about data nobody has. This produces the data: one row per compaction carrying what the transcript held, what today's replay keeps, and what Jev's answer would have kept.Manual
/compactis excluded by constructionThe dashboard dispatches that command as an ordinary turn through
provider.stream_command("/compact")and never calls the coordinator.test_decisions_compaction_hook.py::TestManualCompactIsExcludedpins it by asserting no caller of_compact_sessionexists outside the session layer, so the exclusion cannot be lost by a later edit without a red test.It cannot cost the compaction
The hook is at the top of
CompactionCoordinator._compact_session— the one funnel both automatic entry points reach (check_context_usage→_trigger_compaction, andcompact_if_needed) — above the Claude arm,_recycle_unmanagedand_compact_in_place, so every backend is covered.The task is created and never awaited.
test_the_outcome_is_identical_with_and_without_the_hookruns one scripted compaction twice and holds the outcome and arm equal;test_a_scoring_that_never_finishes_does_not_delay_the_compactionruns it against a scoring that hangs for an hour and asserts the compaction completes with the scoring still outstanding.Which compactions are scored
"Every backend" would be false, so the docs name the population exactly. The hook sits inside
_compact_session, which means it covers the compactions Crew itself dispatches — and a harness that compacts on its own initiative is declined by_compaction_gate_decisionbefore that funnel is ever reached./compacton kiro-cli, codex, opencode)/compactfailed, or the backend has none (deepseek)cc_managed)ACP_BACKENDS_HARNESS_MANAGED_COMPACTION)/compact_compact_sessionis never scheduledThe two harness-managed rows are not gaps to close from here: measuring either would mean a different hook on a different event, and the live design (#12516) targets the recycle path, which is exactly what this hook already covers.
What leaves the machine
ok, N chars (omitted)Redaction runs over each field in full and the clip is taken after it, because a cut placed first halves a secret into a fragment neither redactor matches. A redactor that fails yields the empty string rather than the input, and the gate's own scan still refuses the whole request for a spelling the pass missed. Registered as a sink in
security_posture.py.Fitting, and the ~8% that never fits
Five rungs from the P3 spike — inputs at 1000, then 200, then 60 characters, then the conversation text to head+tail halves, then to a quarter with each call on one line. The first rung under ~25K estimated tokens is sent, so an ordinary session pays the mildest one. The rungs admit 25% / 67% / 80% / 88% / 92% of measured sessions; the rest write a
state-too-largerow and send nothing, so the population that cannot be measured is visible rather than silently absent.One logical tool call reaches the transcript as up to three
role="tool"rows sharing onetool_call_id— the dispatch row, plus the approval path's own approved/rejected row — so the rows are folded by that id before anything is counted. A per-row count inflatedtotal_calls, sent the same input twice in the state, asked two questions about one call, and counted its characters twice in the denominator. Each field of the fold takes the first non-empty value,pinnedis the OR across the rows, and a row carrying no id gets a key of its own because two rows that name no call cannot be shown to be the same call. The fold finishes before the cap, so the cap counts calls rather than rows.Both character arms are upper bounds, and say so
chars_today_eligiblecounts the conversation rows today's recycle replay admits by role.build_session_replaythen applies per-role row quotas and an 80 000-character budget scaled by the model window, so a long session is replayed with less than this arm reports;chars_jev_eligibleinherits the bound because it seeds from that arm. So the names carry_eligibleand the card saysup to 41% of the characters.The true figure is deliberately not re-derived here. The quota walk takes a
ConversationLograther than a row list, and the budget is applied inline while formatting — so the only thing available to measure is a rendered string whose length carriesRole:prefixes and separators, which would put formatting overhead inside a content measurement and is large enough to break the<= chars_allinvariant. Re-implementing the selection in this module would be a second copy of it, free to disagree with the one that runs. Naming the bound is the honest option; the alternative was a number that quietly overstates.A third consent scope
compactionon the keystone, besidetool_args. Absent reads as not consented, an omitted PUT field preserves, disabling clears.tool_argsdoes not grant it, and that is the whole reason for a third leaf: that scope was reviewed as the arguments of the one call about to run; this sends the conversation and every tool input the session has accumulated, in a request one to two orders of magnitude larger. An owner who granted either of the other two is inert here.gate._tool_args_scopedbecomes_scope_consentedand drives both scopes off one table (_POINT_SCOPES), so a third scope is not a third predicate to forget. No new endpoint — samePUT /api/decisions/consent, and the thumbs post to the existingPOST /api/decisions/feedback.The card grows a third switch under the tool-argument one, visible only while the main switch is on: Also send the conversation and tool-call inputs so Jev can score compaction. Its description says the compaction is unchanged, that tool output is never sent, and that it starts off even for an owner who already granted the other two.
Partial answers publish nothing
Questions are 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 if any batch refuses the outcome row is written with
partial-answersand no card line is published —23 of 61over a denominator including calls nobody was asked about is a wrong number rather than an incomplete one. The frontend reader independently refuses a record whose three tallies do not sum tototal_calls.A walk that hits its 1 000-call cap is a different case and is not withheld: it keeps the newest 1 000 calls in chronological order, counts the ones it dropped as
calls_truncated, and the line states that count —Jev would keep 23 of 61 tool calls (+140 not scored)— because a bare “23 of 61” is wrong when 61 is the cap rather than the session’s call count, and drawing nothing hides a measurement that is accurate about everything it covers. The newest end is chosen rather than fallen into: a forward walk that simply stops admitting keeps the oldest calls, which are the least likely to still matter and are not what the pinned tail is chosen for. The dropped calls’ characters stay out of both arms, so the two remain one universe.Screenshots
Captured by
website/scripts/capture-decision-compaction-keep.mjsagainst the real built SPA with only the network stubbed — no gateway, no agent, no Jev call. Fourteen frames, one card per frame, each its own harness instance and its own fixture.The previous set was a picture of a folded turn
Worth stating plainly, because the fix is a lesson about what a DOM assertion proves.
TurnBlockwraps a turn's INTERIM rows in aCollapsibleSectionrendered atheight: 0; opacity: 0until it is expanded, and the fixture put a message after the compaction row — which made the compaction row interim. The card contributed no pixels at all. So two scenes whose DOM provably differed (23 of 61vs78 of 148,85%vs93%, the overflow phrase present vs absent) wrote byte-identical files, however the frame was clipped and whichever capture path took it. Every "capture strategy" agreed because none of them was photographing the card.Every assertion in the old harness passed throughout: they all read
textContent, and a folded card's text is intact.Two changes:
document.elementFromPointat the card's own centre must land inside the card. The harness also fails if any two frames come out byte-identical, so this cannot recur silently.Frames went from ~5.8 KB of blank to 19–57 KB. All twelve transcript frames are distinct, and each was matched back to its uploaded attachment by content hash rather than by upload order.
calls_truncated: 140, so the line says(+140 not scored)before the sharePer frame the harness still asserts the theme it is named for, that exactly one compaction card is in the scene, that the captured element contains the keep line, that the notice's own words are inside the captured element (a page-scoped check passed on a frame that had cut the sentence off), and that the line says what makes it that frame — including what it must not say, since a positive check alone cannot tell a frame from the one it is contrasted with.
The
withheldpass serves the SAME fixtures with the scope revoked and asserts the switch reads off and thecompaction.keeprow is absent — "it appears when granted" says nothing about what an ungranted install sees.Tested
test/test_decisions_compaction_keep.py(81) — the transcript walk, the pinning split, the ladder and its monotonicity, redaction-before-clip, no result byte at any stage, batching, the all-or-nothing batch read, the tallies and both character arms, the record store's three bounds, the gate's refusal without the scope, and the transcript boundary (a row appended after the fire is dropped; no boundary reads everything; a missing or unparseable stamp is KEPT; the boundary itself is inclusive; the row cap applies after the filter).test/test_decisions_compaction_hook.py(15) — both automatic entry points, a recycle-only backend, the hang test, a broken point, outcome equality, the absent manual caller, the stamp onto the notice row, and that the boundary the coordinator supplies precedes anything the compaction appends — both boundary tests go red whenbefore=is dropped from thecreate_taskcall.test/test_decisions_compaction_scope.py(23) — the keystone reader, writer and route, including thattool_argsdoes not grant it and that the three scopes move independently.website/src/test/CompactionKeepLine.test.tsx(25) — the reader's refusals, the line on every card shape, and the thumbs label.decisionsCard.test.tsxand the spec's fenced record held against its reader indecisionStripContract.test.ts.The 12 locale catalogs and the 11 locale style suites were run with
I18N_BASE_REFset, so the[changed-values]rules actually saw the renamed label rather than skipping.Verified locally: the decisions + compaction + posture + settingref pytest suites (1149 tests),
mypy src/kiro_crew/(1665 files), isort, flake8, black on the new files,npm run typecheck,npm run lint,npm run gen:settings,npm run i18n:check19/19 PASS, and the diff-scoped gates (brand, comment-history, focus-cue, feature-map, changelog, harness-parity, memory-store, sync-io, subprocess-encoding, agent-sdk-boundary, loop-bound-locks, acp-frame-host-data, testpaths-coverage, docs-lint).scripts/check_black_formatting.pycannot run on this host — it pins Black 26.3.1 and only 26.5.1 is installed. Every file in the diff was checked against the installed Black instead, and the baseline-exempt files were left unformatted.Docs
A section in both decisions docs stating exactly what leaves the machine (
src/kiro_crew/docs/decisions.mdfor the owner,docs/system-specs/modules/decisions.md§ 11 for the contract), and a feature-map row.The first push's three reds
All three are fixed in
e346d26a98, and two of them were real:time.monotonic()advancing between the publish and the take. Windows' monotonic has ~15.6 ms resolution, so both readings were the same value and the entry was correctly inside a<= 0.0TTL. The clock is pinned instead, and a companion case asserts an entry inside its TTL is still handed over, so the sweep cannot become "expire everything" and pass.ko.md§2.1: a 조사 after an interpolation must be written in both forms, because the particle depends on the final consonant of a value that does not exist until render.{{productName}}가→{{productName}}이(가).Follow-ups
decisions: live compaction.keep on the recycle path (consumes the shadow measurements from #12496). The decision this measurement exists to inform, so the dataset has a committed consumer rather than being collected against a maybe: option B from the spike (a keep-set threaded into_replay_rowson the recycle path only, inside the unchanged 80 000-character budget), the five things the shadow rows have to show first, the paths it deliberately excludes, and the fact that the consent copy stops being true once anything is applied and needs re-reviewing. Opened in answer to First Principles item 1.FeaturePreviewsSectionconsent-PUT contract for all scopes: a scope-only PUT carrying neitherenablednorendpoint. That is the server-side half, and it predates this PR — the same shape exists on thetool_argsswitch that shipped before it. The client-side half for this PR's own switch is fixed here: its pending write freezes the master switch, and a refused write renders the sharedErrorNotice. The equivalent guards fortool_argsare deliberately not added, because feat(decisions): let Jev narrow what the memory_recall tool returns #12492 removes the need for them rather than duplicating them.Not in this PR
The live keep-list.
_replay_rowsis untouched, so the replay is byte-identical to today — that change is #12516, and this PR's data is what decides it.