Skip to content

test(hooks): fail closed on probe drift and collect transcript phases - #371

Merged
entelecheia merged 3 commits into
mainfrom
diag/367-transcript-phases
Nov 11, 2026
Merged

entelecheia merged 3 commits into
mainfrom
diag/367-transcript-phases

Conversation

@entelecheia

@entelecheia entelecheia commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Refs #367.

The SessionStart stage probe now validates all 32 literal anchors across six current sources before measurement and checks a separate runtime error receipt after every invocation. Missing or duplicate anchors name the anchor and source file and fail the step even when bin/amem.js catches the import error. Stale notice/context and worker anchors are updated. Cheap unit tests enumerate every anchor, compile the transformed sources and prove that a zero-exit caller cannot hide an anchor failure. The existing five cold attempts, full-foreign diagnostic and timing policy are retained.

A separate reported-only transcript runner observes the same Stop, SessionEnd and 100-title StopBurst workload shape, preserving the published executable's real clock and deadlines. src/ and scripts/measure-transcript-budget.ts are byte-identical to main. The strict transcript command remains the gate. The new CI step runs on both hosted OSes after the strict performance steps, with its own reported-only result and observer-cost summary. It adds no budget advisory, retry or limit change.

Numeric phase receipts cover bootstrap/import, worker spawn and entry, metadata, scan and cursor open/commit/close, first replay, CaptureStore open/drain/transactions/close, stop/live-RSS/kill/reap/output/abandon, accounting/final RSS, variant append, metric sampling/write and the exit event. Parent and worker timestamps bracket first-drain-to-metric directly, including the 254-262 ms interval from the Linux evidence. CPU user/system endpoints and matched first/last interval deltas are retained. Missing or count-mismatched intervals remain null.

Observation is bounded: two paired logical runs per event, at most 64 resumptions, a cooperative two-minute whole-run cap, eight processes per invocation, 4096 marks/process, and 64 fixed 512-byte numeric slots/process. Each phase retains first/last/count/CPU values. Completed slot writes remain readable after SIGKILL; malformed or torn receipts fail instead of inventing a complete trace (there is no claim of atomic interrupted overwrite). Every invocation has a concise receipt; full details retain each first observed call and the eight largest observed wall/drain intervals. Truncation and incomplete coverage are explicit.

Within this separate diagnostic, uninstrumented and observed arms alternate order and retain the strict harness's warm-home policy and fresh-home StopBurst policy. Inline recording/loader costs are labeled lower bounds, with paired first-call wall deltas labeled noncausal because deadline-dependent completed work differs. No delta is subtracted from any strict result. Observed cleanup uses recorded worker PIDs/groups; uninstrumented helper-command census is labeled separately rather than fabricating PID coverage. Surviving/unknown owned cleanup retains its fixture and fails the diagnostic.

Validation:

  • Remote Bun 1.4.2 at 9f2ec81: typecheck, boundary (172 source files), 10 focused tests / 362 assertions passed. Repaired stage probe reached known work (cold attempt0 completed72.30ms) and its separate full-foreign case. Unit controls include a killed observer, malformed/torn slots, source drift hidden by a zero-exit bin, actual native bootstrap and an injected270ms worker-close stall correctly bracketed by >=250ms receipts.
  • Coverage follow-up e986e8d: bounded real runner exited0 with 43 total calls; all25 observed calls captured worker entry, scan, first drain and matching metric; no truncated traces; control and observed each completed6/6 logical runs. Output292573bytes/13details. Measured record+loader lower bounds1.98-3.46ms/call (median2.43); paired first-call deltas-1.57 to13.82ms. This is fixture/observer evidence, not hosted acceptance or an attribution of the historical delay.
  • Final head e986e8db74531ca659b6588d80aa6f46174b8be3, remote Bun 1.4.2: typecheck, boundary (172 source files) and pack dry-run (182 files) passed. Full suite: 3,688 pass, 26 existing platform skips, 0 fail; 50,817 assertions, 3,714 tests across 339 files (1369.46 s); verify exited 0 in 1384 s. Full log: scratchpad/temp/task217/full-e986e8d.log, SHA-256 7efeb51a58f68d88f7b7177671f284165ff3244dc8328704cd6174905e2fe7ad.
  • Independent read-only review found no remaining material blocker after unique invocation-directory and exact numeric-schema corrections.

AC1's exact historical substage, the fix decision and AC3's ten hosted main passes per OS remain open. This PR collects future evidence; it does not claim the wall misses are resolved.

Retirement condition: remove the reported-only transcript phase diagnostic, its exact-source phase anchors and unit controls, and its CI step when #367 closes. Ordinary product refactors must update these anchors while the diagnostic remains in use. The repaired SessionStart probe keeps its fail-closed drift guard.

Copilot AI balanced review requested due to automatic review settings November 11, 2026 03:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T03:15:07.465552Z e986e8d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@entelecheia
entelecheia merged commit 6f9ade6 into main Nov 11, 2026
27 of 36 checks passed
@entelecheia
entelecheia deleted the diag/367-transcript-phases branch November 11, 2026 05:50
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.

2 participants