Skip to content

feat(capacity): PagerCaptureEvent — pager control-loop capture contract (#276 slice 1) - #2064

Merged
joelteply merged 1 commit into
canaryfrom
feat/pager-capture-event
Aug 1, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/pager-capture-event

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

First slice of #276 (BigMama's pager v2 tools behind the TierPolicy seam), unblocked while her prototype sources are in transit: the capture contract both nodes bind to.

  • capacity/pager_capture.rs: PagerCaptureEvent landed verbatim from EXPERT-PAGING-CONTROL-LAW.md § CaptureEvent — one frame per decode token, performance signals + bandit decision state. Rust is the single source of truth; ts-rs generates shared/generated/pager/PagerCaptureEvent.ts (barrels regenerated via tools/generator/generate-rust-bindings.ts).
  • PagerCaptureSink trait + Noop default (zero hot-path cost until a sink is installed). JSONL drain reuses probe_file_sink facilities in the next slice with the ServingExpertPager emission.
  • Tests pin the cross-node contract: literal field-name assertions on the JSONL wire shape (a serde rename round-trips locally but silently breaks BigMama's C++ feed — this catches it first) + forward tolerance for unknown fields (node version skew is normal).

Schema fields already validated live on the fitted-K3 run tonight (fetch_mb_s caught 385→2458 MB/s; resident_experts pinned the 4416 working set; 0.33 tok/s warm matching WASTE 0.32 at rung-1).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…n capture contract (#276 slice 1)

The schema from BigMama's EXPERT-PAGING-CONTROL-LAW doc, landed verbatim
as the Rust source of truth with ts-rs generating the Positron binding
(shared/generated/pager/PagerCaptureEvent.ts + barrels). One event per
decode token: performance signals (hit_rate, fault_wait_ms, tok_per_s,
bytes_fetched_mb, fetch_mb_s, quality, composite reward) + decision
state (chosen_decay, per_arm_reward, resident_experts, tier_counts,
promotions/demotions, preference_w).

PagerCaptureSink trait with Noop default — zero hot-path cost until a
sink is installed (OBSERVABILITY-AS-SUBSTRATE doctrine); the JSONL
drain reuses probe_file_sink facilities when wired (next slice, with
the ServingExpertPager emission).

Tests pin the CROSS-NODE contract: the JSONL wire shape is what
BigMama's C++ emitter feeds and her capture slices must decode
field-for-field (literal field-name assertions catch serde renames that
round-trip locally but break her feed), plus forward tolerance for
unknown fields (version skew across nodes is normal mesh weather).

Field semantics already validated live: fetch_mb_s caught the 385→2458
MB/s pressure-relief jump, resident_experts pinned the 4416 working
set, reward is the surface the rung-2 bandit climbs.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply enabled auto-merge (squash) August 1, 2026 04:08
@joelteply
joelteply merged commit 9408c1b into canary Aug 1, 2026
@joelteply
joelteply deleted the feat/pager-capture-event branch August 1, 2026 04:08
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