Repository navigation
bridge: name a manual compaction's rows from the transcript, ahead of anything later (Arkho #78, 7.158.3) - #202
Merged
Merged
Conversation
… anything later (Arkho #78, 7.157.5) The engine writes the rows of a manual compaction (the person's /compact, a command run, any plugin's $.session.compact: the bridge's compact verb, the compact tool's) through no session.append, so no hook named them and every consumer waited up to 2 s on them. Probed live on 2.1.301: an auto compaction's rows are raised; a plugin's session.compact hook sees every compaction but its own plugin's; $.session.messages() carries no uuid, but a compaction's result names its summary row by handle; the reload line passes the new module's own session.append, so it was never unnamed. Once a compaction stands (runCompaction, the compact tool through compacted(), the new session.compact hook for the rest), a hold in the post queue keeps everything later back while the child's new GET /rows reads the loop's rows past its cut, until the summary row is on disk and one poll later; their row-seens (door compaction) take the hold's place, so they go out before the next prompt's notices. DX5 gains "A compaction's rows"; its known-rows-with-no-notice paragraph shrinks to what remains.
… queued behind it (Arkho #78 review) The hold named every unnamed row past its anchor. With the poster behind, two compactions and a response between them all on disk before the first hold ran came out bound1, sum1, bound2, sum2, block-row:response: the first hold took the second's rows ahead of the response's queued notice, and the second found its summary named and added nothing. Each read is now bounded at the first row a notice of the loop queued behind the hold names (every notice since the hold is there: the poster posts nothing past a hold, and a resync that took any took the hold too); a hold no longer in the queue names nothing. What counts as named was one 1,000-row set across loops, so a subagent's traffic or a long backlog could evict a row the hold must skip, and it was named twice. Notices are remembered per loop (200 each, a subagent's forgotten at its stop), and the hold keeps a copy of its loop's as it is placed: a row named before it that the engine wrote past the cut stays known however much traffic follows. Two holds placed at the same cut (nothing of the loop between them) left the cut at the first's last row once the second named its own, since the second's anchor was no longer the cut. The hold that moves the cut now moves such a later hold's anchor with it, so the cut stays the loop's last notice and a resync keeps that hold. DX5's "A compaction's rows" states the bounded read and the anchor carried forward.
…hold of its loop (Arkho #78 review) The anchor of a later hold placed at the same cut was carried forward only when the naming hold moved the cut. With a notice of the loop queued behind both holds the cut is that notice's, so neither moved, and the later hold's copy of what was named predated the first hold's rows: once the loop's live memory lost them (200 notices of the loop in between, or a subagent that stopped meanwhile), the later hold read from the old cut and named them again, after they had gone out. What was named now travels on the hold (`named`), and a hold that names rows adds them to every later hold of its loop in the queue and carries the anchor of one placed at its own cut, whether or not the cut moved; the cut still moves only if it is still the hold's anchor. A later hold whose summary the first already named returns at once instead of polling out. A resync drops a carried hold whose loop's cut is a later notice, as its rows lie before that cut. DX5's read and cut bullets say so.
…over main's 7.158.2)
3 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Arkho board ticket #78: name the rows that reached
sminos watchand the desk with no notice, which held every consumer for up to 2 s after them. Version 7.158.3, over main's 7.158.2 (main merged at4c0f1d64).Problem
The bridge names every row the session writes from its
session.appendhook (DX5 "Row order"). DC2 left two kinds of row unnamed: the rows of a compaction the bridge runs itself, and the engine's line for a module reload. It attributed both to "a plugin's own calls pass none of its hooks." Under the consumer rule a row past the cut that nobody names is released only by a later notice of its loop, or 2 s after it reaches disk. So after an idlesminos compactthe stream towatchand the desk held for 2 s.What the engine actually does (claude 2.1.301, probed live)
An isolated probe plugin logged every
session.append, everysession.compact, and what$.session.compactand$.session.messages()return. A 5 ms disk watcher timed each row's flush. Three runs covered: a plugin's own$.session.compact,$.command.run({command: "compact"}), the person's typed/compact, an auto compaction mid-turn (CLAUDE_CODE_AUTO_COMPACT_WINDOW=70000),$.prompt.submit, and a module reload.session.append, whoever starts it. That covers a plugin's own call, a command run, and the person's/compact. The rows are the boundary, the summary,/compact's command rows, and the re-announced attachments. An auto compaction's rows are raised (doorscompactionandattachment). The person's/compactwas therefore unnamed too, and so was the model's compact tool (compact.tsx).session.compacthook: a plugin's hook sees every compaction except its own plugin's$.session.compact. It sees the person's and a command run asmanual, and the threshold's asauto.$.session.messages()carry uuids? No. It gives{role, text, toolUses}only. A compaction's result does carryhandleon each message, and the handle is the row's uuid, the summary's first. The boundary and the attachments are not messages.$.fs.readcaps at 4 MiB, so the mod cannot read a transcript's tail itself.system/informational, written throughsession.append(doornotice, originengine) about 12 ms after the new module'ssession.start, so the new module's own hook names it. Its notice lands before the new child's hello, and the hello's resync carries it as the cut.What this PR changes
compactend.GET /rows. It waits until the summary row (named byhandle) is on disk, plus one poll.row-seenwithdoor: "compaction", in disk order, in the hold's place.runCompaction; compact.tsx, through the bridge'scompacted; and a newsession.compacthook for every other compaction. Aprecomputeis skipped.skills/sminos/scripts/sminos_bridge.pygainsGET /rows?loop=&after=<uuid>: whole rows past<uuid>, read backward at most 4 MiB, 404 while the row is not on disk.docs/doperpowers/plans/2026-10-15-arkho-desk-c2-bridge.md):row-seengainsdoor: "compaction", and the routes gainGET /rows. The new subsection "A compaction's rows" states the rule. "Known rows with no notice" now lists only what remains. The Decision Log and Surprises record the engine facts.hooks/mods/README.mdis updated to match.What stays unnamed (DX5 lists it)
/compactwhere an organization manages Claude Code and the plugin is the person's own: the engine runs nosession.compacthook there.Validation Evidence
/tmp/arkho78/probe/), three isolated live runs, claude 2.1.301/tmp/p78.*tests/mods/run-mods-tests.sh(slot-wrapped)b0d9993atests/sminos/test-bridge-order.shGET /rowsincl. a half-flushed row, the 4 MiB bound and a subagent loop; the referenceConsumerreleases a named compaction's rows, none unnamed, under 1 stests/sminos/test-bridge{,-control,-requests,-export}.shtests/mods/live-walk-check.py --only terminal,bg(it spends model calls) ate14d8155compactend after them. Person's/compact: 9 rows named. Reload line: covered by the new child's cut. Notice audit on both sessions: no row without a notice, no write-order quirk, no block-row break, max flush-to-notice 0.11 s--only terminal, at8860b27btsc -p hooks/mods/tsconfig.jsonagainst the 2.1.301 typesask.tsxerrorsclaude plugin validate --json .session.compact{trigger=/^/}(with.catch, which replaysnextand does not run it again) and the managed-settings note forsession.compactdoperpowers:reviewer-high, three rounds8860b27b,1c0f8c27). Round 3: "No material findings." Verdict: correctResidue
compacted) has unit tests only. The live walk does not drive the model to callmcp__doperpowers__compact.docs/doperpowers/plans/2026-10-15-arkho-desk-c2-report.md's Residue line ("The plugin's own appends … get no notice") is DC2's record as it stood. It is left as history, and DX5 now states what holds.