Repository navigation
test(hooks): fail closed on probe drift and collect transcript phases - #371
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
3 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.
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/andscripts/measure-transcript-budget.tsare 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:
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-2567efeb51a58f68d88f7b7177671f284165ff3244dc8328704cd6174905e2fe7ad.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.