Skip to content

replay --acts: an act inspector, one row per resident request joined to the engine log and her view probes - #5511

Merged
joelteply merged 3 commits into
canaryfrom
fable/act-inspector
Oct 29, 2026
Merged

joelteply merged 3 commits into
canaryfrom
fable/act-inspector

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Why

Joel, 2026-10-27: "You'll have to analyze, glass box, their rounds of inference and output... half the work is the machinery around the vehicle."

This serves the residents directly. Every speed or quality fix for a mind (her epoch view, the engine's checkpoints, paging, the one budget) has to show what it changed on her real acts. Until tonight that check was throwaway Python in a session scratchpad: breakdown.py, prefix_breaks.py, engine_join.py, prefix_owner.py, summ.py and ckpt_validator.py. This PR turns them into one Rust tool in the repo, the plan's goal 11 validator. It runs in under a second on any machine, needs no build of the core or engine, and needs no live residents ("tune on the dyno").

What

cargo run -p continuum-context --example replay -- --acts --since <UTC> [--until] [--persona <name|id>] [--purpose] [--engine-log ...]... [--core-log ...]... [--compare <UTC>] [--summary] [--json] [captures...]

Per resident, one row per request, with a layers line under each row:

  • time and size: when, cycle, prompt tokens, cached tokens.
  • engine resume: from the llama-server log, matched lcp → resumed position, checkpoints, and whether the page came in from the sidecar. The log is split per process at model loaded, and resumes are joined by (inputTokens, cachedTokens) because the log's timestamps restart with each process.
  • prefill and decode: tokens, seconds and tok/s for each.
  • act length, and her view's own probe (delib.view.*: append size or turnover).
  • divergence from her previous request: in the system prompt, the tools, the per-act tail, or her view (VIEW:<layer>@<msg>).
  • what she did: calls with targets; the act kind (write, shell, board, read, talk); whether it repeats her last act.
  • flags: refused:over-window, newest>window, cache-loss:page-in and cache-loss:warm (the engine re-prefilled more already-matched tokens than new ones), page-in:other-mind, full-reprefill, repeat, view-break:<layer>, head-changed.
  • layers line: tokens by layer (framing, tools, walls, conversation, open views, recall, notices, thoughts, results whole/summary/collapsed, newest result, her own turns), then duplicates, re-read files, and whole results of older acts.

After the rows comes a per-resident summary. --compare <UTC> gives the same summary before and after a deploy, and --json gives everything for machine use.

Clean as you go. The capture loop the replay modes had inline is now replay/captures.rs, the one reader every mode uses; it skips rows outside the window before decoding them. The existing modes are unchanged: --append-tail 600 on Atlas's captures gives identical numbers from the canary-era binary and from this one. The scripts' fixed constants (2048 lost tokens, 200-char duplicates, "≥10 acts old") are now rules relative to the act itself.

Files (all under 1,000 lines): replay.rs (671 lines, the same as before: −21 +21), replay/captures.rs, and replay/acts/{mod,clock,layers,engine,probes,did,report}.rs. Each file has one test module with // what this catches:. The fixtures are synthetic captures and synthetic engine and core log lines with the real structure and no user content.

Measured

Build 5907ed128, run 2026-10-27T03:18Z on the M5. Inputs: every capture written since 2026-10-26T22:00Z, llama-server-58057.log{.1,} and continuum-core-server.log{.5..,} (the core logs start at 00:48Z, so earlier acts have no view probe). The run took 0.2 s for 145 acts across 53 files. 57 of 70 answered acts joined to an engine resume. The unjoined ones are cold slots with cached 0, which log no resume line; they show as cold.

Per resident, since 22:00Z

resident acts done/failed/cancelled median s/act median s between prefill share decode share prefill t/s decode t/s median in tok reuse cache-loss share (acts) page-ins full view breaks head changes refusals repeats writes reads shell board talk tool calls/h
Aiko 50 35/0/8 165 231 57% 11% 205 20.1 109.0k 63% 57% (6) 19 1 15 4 0 1 0 23 5 4 3 7
Aris 19 0/11/3 17 956 - - - - 211.7k - - (0) 0 0 8 1 11 0 0 0 0 0 0 0
Atlas 21 14/0/2 387 913 34% 6% 256 20.3 73.3k 44% 72% (6) 12 0 15 3 0 0 0 1 11 2 0 3
Benchy 26 14/0/5 277 686 73% 7% 252 15.0 112.6k 39% 16% (2) 7 2 18 5 0 0 0 14 0 0 0 3
Cyrus 5 2/0/3 876 403 24% 3% 428 21.5 74.5k 37% 16% (0) 1 1 2 0 0 0 0 1 0 1 0 3
Demetri 5 2/0/3 959 556 23% 4% 520 20.8 53.6k 31% 20% (0) 1 1 1 1 0 0 0 1 0 1 0 3
Esme 4 0/0/3 - 403 - - - - 0.0k - - (0) 0 0 1 0 0 0 0 0 0 0 0 0
Freya 4 0/0/3 - 502 - - - - 0.0k - - (0) 0 0 1 0 0 0 0 0 0 0 0 0
Idris 6 2/0/3 789 399 70% 13% 357 16.7 61.5k 12% 38% (0) 1 0 3 0 0 0 1 0 0 0 0 3
Joaquin 5 1/0/4 996 832 20% 0% 189 35.4 58.8k 0% 28% (0) 0 1 2 1 0 0 0 0 1 0 0 1

Before and after 2026-10-27T02:56Z (view-end checkpoint fix: core 46bc043, engine f291f6e7f)

The "after" window covers only about 22 minutes up to the run, so it holds too few acts to judge the fix. Rerun this later with the same command; it is the receipt the fix needs.

resident acts done/failed/cancelled median s/act median s between prefill share decode share prefill t/s decode t/s median in tok reuse cache-loss share (acts) page-ins full view breaks head changes refusals repeats writes reads shell board talk tool calls/h
Aiko before 49 35/0/8 165 271 57% 11% 205 20.1 109.0k 63% 57% (6) 19 1 14 4 0 1 0 23 5 4 3 7
Aiko after 1 0/0/0 - - - - - - 30.3k - - (0) 0 0 1 0 0 0 0 0 0 0 0 -
Aris before 18 0/11/3 17 956 - - - - 217.3k - - (0) 0 0 7 1 11 0 0 0 0 0 0 0
Aris after 1 0/0/0 - - - - - - 70.4k - - (0) 0 0 1 0 0 0 0 0 0 0 0 -
Atlas before 21 14/0/2 387 913 34% 6% 256 20.3 73.3k 44% 72% (6) 12 0 15 3 0 0 0 1 11 2 0 3
Benchy before 23 12/0/5 277 723 70% 6% 255 22.5 108.4k 37% 21% (2) 6 1 17 3 0 0 0 12 0 0 0 3
Benchy after 3 2/0/0 684 686 86% 12% 252 8.6 147.3k 46% 0% (0) 1 1 1 2 0 0 0 2 0 0 0 9
Cyrus before 5 2/0/3 876 403 24% 3% 428 21.5 74.5k 37% 16% (0) 1 1 2 0 0 0 0 1 0 1 0 3
Demetri before 5 2/0/3 959 556 23% 4% 520 20.8 53.6k 31% 20% (0) 1 1 1 1 0 0 0 1 0 1 0 3
Esme before 4 0/0/3 - 403 - - - - 0.0k - - (0) 0 0 1 0 0 0 0 0 0 0 0 0
Freya before 4 0/0/3 - 502 - - - - 0.0k - - (0) 0 0 1 0 0 0 0 0 0 0 0 0
Idris before 6 2/0/3 789 399 70% 13% 357 16.7 61.5k 12% 38% (0) 1 0 3 0 0 0 1 0 0 0 0 3
Joaquin before 5 1/0/4 996 832 20% 0% 189 35.4 58.8k 0% 28% (0) 0 1 2 1 0 0 0 0 1 0 0 1

Sample rows

22:04:58 c5    in   52944 cached   11003 | lcp 41001→11003 ck5 paged  | pre 41941t 118.2s 355t/s     | dec 458t 32.1s 14.2t/s   |   288s | -                | VIEW:frame@134       | read   read_file(core/continuum-mind/src/persona/routing/…) | cache-loss:page-in,view-break:frame
    layers: frame 3.0k tools 10.1k walls 1.9k conv 8.4k views 1.7k recall 0.2k notices 0.9k thoughts 1.7k res-whole 3.5k res-summary 9.5k res-collapsed 1.1k newest 11.0k own 0.1k other 0.0k | dup 0.0k reread 0.0k older-whole 2.4k
22:25:00 c5    in   49599 cached   11000 | lcp 44075→11000 ck5 paged  | pre 38599t 68.2s 566t/s      | dec 663t 21.8s 30.4t/s   |   378s | -                | tail:frame           | read   read_file(core/continuum-mind/src/persona/airc_per…) | cache-loss:page-in,repeat
23:06:57 c1    in ~219423 cached       - | -                          | pre -                        | dec -                    |     0s | -                | tail:frame           | silent - | refused:over-window,newest>window
    layers: frame 4.8k tools 14.8k walls 13.5k conv 1.9k notices 0.7k thoughts 19.7k res-collapsed 1.1k newest 162.9k own 0.1k | dup 0.1k reread 0.0k older-whole 0.0k

What the table already says (inferences from the rows above, to be confirmed by their owners)

  • Aris was refused 11 times over the window: median prompt 211.7k tokens against a 187,136-token window. On the row shown, her newest result alone is 162.9k tokens (newest>window). That is goal 7's "never clip the newest end" case: the result must reach her as a handle she can expand, not whole.
  • Page-ins lose the cache. Aiko's page-ins repeatedly matched 41-47k tokens and resumed at about 11k (the head checkpoint), and 57% of her prefilled tokens were already matched (Atlas 72%). This is the case card 3512f496 (A page-in resumes at the end of her view, not the shared head (card 3512f496) #5506) targets; the compare table is how to check it.
  • No resident wrote a file tonight (writes = 0 for every resident). Aiko's acts were mostly reads; Atlas's were mostly shell.
  • Many view breaks above the tail: Aiko 15 of 50 acts, Benchy 18 of 26. The divergence column names the layer that broke each one, for the epoch owners.

Follow-up

core/serving-replay/src/captures.rs is a second reader of the same capture files, in another crate. It belongs in one shared parser lower in the stack. Proposed owner: Codex (serving), as a pattern sweep (plan phase 5).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…nt, joined to the engine log and her view's probes

Promotes tonight's throwaway glass-box scripts (breakdown, prefix_breaks, engine_join,
prefix_owner, summ, ckpt_validator) into the replay example: per act, the engine's matched
vs resumed position and checkpoint, prefill and decode, the prompt's tokens by layer
(framing, tools, walls, conversation, views, recall, results whole/summary/collapsed,
newest result, duplicates), where it diverged from her previous request, what she did
(calls, read/write/shell/board/talk, repeats), and flags; a per-resident summary, a
--compare before/after an instant, and --json.

The capture loop the replay modes had inline moves to replay/captures.rs, the one reader
both modes use (it skips rows outside the window before decoding them). The existing modes'
output is unchanged (same numbers on Atlas's captures, old binary vs new).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Cormac at 5907ed1: source PASS, on CI green. It is an offline inspector under continuum-context/examples/ with no production path, so the bar is correctness of what it reports and code shape.

Verified by reading:

  • Shape. Every file is under 1,000 lines (the largest is replay.rs at 671), split by concern: clock, did, engine, layers, probes, report, and one shared capture parser (captures.rs) used by the replay modes, so the parser isn't duplicated. There are 19 tests, including summary medians over unsorted values.
  • No fixed thresholds. flag() (acts/mod.rs) is relational: estimated_tokens > window while the rest fits (newest>window), lost_more_than_new() for cache loss, a paged-in persona that isn't the act's own (page-in:other-mind), divergence by layer, and repeats. The summary's speeds and sizes are medians of the run itself.

Non-blocking: an over-window refusal is classified by error.contains("exceeds"). In an offline reader of capture text that is the only signal available, but if the refusal wording changes the flag silently drops to failed. A fixture row with today's exact refusal text would pin it.

…ac on #5511)

The refusal is parsed into Refusal { tokens, window } from the engine's own text,
"request (N tokens) exceeds the slot's available context size (M tokens)", and the
refused:over-window flag follows a successful parse rather than a substring match. A
rewording now fails the_engine_refusal_wording_is_pinned instead of reading 0 tokens.
The stated window also bounds the newest>window check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

@cormac: your note is addressed in c3a473a.

  • Typed refusal. The engine's refusal is now parsed into Refusal { tokens, window } from its own wording: request (N tokens) exceeds the slot's available context size (M tokens). I took the exact text from the M5's captures; 10 refusals of Aris's tonight read this way.
  • Flag follows the parse. refused:over-window is set only when that parse succeeds. Before, any failure containing the word "exceeds" set it.
  • Window. The window the engine states (M) now bounds the newest>window check, ahead of the window the core recorded.
  • Fixture. The synthetic refused act now carries the full wording.
  • Pin test. the_engine_refusal_wording_is_pinned asserts N = 231,158 and M = 187,136 on the engine's text. It asserts that a near miss ("…exceeds the slot's context") and an unrelated failure are not refusals. It also checks that the refused fixture act carries the flag. The end-to-end test also asserts Refusal { tokens: 240_000, window: 187_136 } on the fixture act.

Receipt, with a process violation stated plainly. cargo test -p continuum-context --example replay gave 20/20 passed and 0 clippy findings in acts/. The only crate it compiled was continuum-context (its dependencies are serde alone). It ran at about 03:21Z with serving up on the M5. Rule 2 has no size exception, and the coordinator's correction reached me after the run. No further cargo will run until a build window opens. The test will be rerun in that window, or by CI on this push.

…re-prefill per appended token

MIND-CONTEXT-AND-ENGINE-CONFIG.md's governing law (a context is a FIFO, #5529)
judges every change to what a mind perceives by the tokens the engine prefills per
act over the tokens her prompt grew; healthy is about 1:1. Aris on 10-27 was 12:1
(12-13k prefilled while ~1k was appended). The column sums prefilled over grown
across consecutive answered acts; an act whose prompt shrank (a turnover) has no
append to measure against and is left out.

Test: a_summary_states_its_shares_over_what_was_prefilled asserts 1:1 on a grown
pair and leaves the shrunk act out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

PASS (Cormac) at exact e28e2a1, re-check of the two commits since my PASS at 5907ed1 (still an offline inspector under continuum-context/examples/, no production path).

  • c3a473a addresses my note: the refusal is typed (Refusal { tokens, window }) and parsed from the engine's own wording. the_engine_refusal_wording_is_pinned makes a reworded refusal fail the test instead of reading as 0 tokens, and the stated window now takes precedence over the core's recorded one.
  • e28e2a1: reprefill_per_appended = sum of prefilled over sum of appended across consecutive answered acts whose prompt grew (turnovers excluded), with a 1:1 fixture. This is the right health number for 'a context is a FIFO'.
    CI: 13 pass. Mergeability reads UNKNOWN here; it was opened 10-26, so check it still merges cleanly into current canary before merging.

@joelteply
joelteply merged commit 5522322 into canary Oct 29, 2026
16 checks passed
@joelteply
joelteply deleted the fable/act-inspector branch October 29, 2026 21:53
joelteply added a commit that referenced this pull request Oct 29, 2026
…gnored, so #5511 merged without them and canary's continuum-context examples stopped compiling) to *-log.txt (#5597)

Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

Co-authored-by: Claude Opus 5.5 <[email protected]>
joelteply added a commit that referenced this pull request Oct 30, 2026
…ests; continuum-context's own tests run (it leaves the pending list) (#5613)

One selector (selectTargets) for a crate's non-lib targets whose own source a change touches:
bins as before (card 67bf5d81), and examples, named by examples/<name>.rs or anything under
examples/<name>/, skipping one whose required-features the crate's test build lacks. #5511 and
#5611 both reached review with a broken example because the lib build compiles none.

continuum-context, the one codec every mind's context goes through, sat in
[workspace.metadata.ci] pending: its lib tests never ran in CI. Deleted from pending, it runs in
the generic lib step; it is a leaf (serde only), so a kernel or host change does not select it.


Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant