Repository navigation
perf(disk-hygiene): read the engine once per hook launch and state the measured share - #2869
Conversation
…e measured share Close the disk-hygiene half of the hook-budget conformance gap (issue 2853, the sibling of guardrails' issue 1403/2663 under the issue 1809 budget adoption): - The always-on Bash|PowerShell launcher recovered MIN_PYTHON with two separate full-file sed passes over the ~3,500-line engine, neither stopping at the match. It now runs one sed whose address-block q terminates the read at the MIN_PYTHON line. hygiene.MIN_PYTHON stays the floor's single origin (PR 1028); VersionFloorTests' shape/count lock still passes. - run-python-hook.test.sh gains a behavioral contract: a recording sed shim proves one launch reads the engine exactly once, and replaying the recorded argv against a two-floor fixture proves the read stops at the first match instead of scanning to EOF. - README's trust-surface record replaces the launch-count sentence with the share measured by the hook-budget convention's method (2026-08-16, Windows 11 + Git Bash, 32 runs per variant): about 190 ms per shell tool call for the engine-gate hook, of which the engine read accounts for about 24 ms (13 percent) single-read, down from about 38 ms (19 percent) two-pass. - hooks.json "timeout": 60 is unchanged, per the issue's third criterion. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Claude finished @kyle-sexton's task in 3m 54s —— View job Code review complete
Scope: correctness and maintainability per What I checked
Note: I could not execute the test suite myself (this lane's tools are read-only: |
|
Claude finished @kyle-sexton's task in 1m 36s —— View job Claude finished the security review
Security reviewReviewed all 5 changed files ( No security issues found. Notes from the review, for the record:
This lane is scoped to security only (logic flaws, injection, trust-boundary, Actions risk) — no code-quality/style feedback given per this lane's remit; |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c29742281
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Last security-reviewed head: |
|
Claude has reviewed this PR 2 times. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
…current wall Review follow-up on PR 2869: the hook-budget convention measures matching hooks as parallel wall (max of the set under spawn contention, launched with & + wait), not a sum. Replace the naive 2x doubling with the measured concurrent pair wall (60 pairs, three N=20 batches: about 320-410 ms, about 1.3-1.5x the same-batch single wall) and widen the single-hook figure to the observed cross-batch range (92 runs, about 190-300 ms). Co-Authored-By: Claude Fable 5 <[email protected]>
|
Claude finished @kyle-sexton's task in 2m 19s —— View job Code review complete
Scope: correctness and maintainability per the What changed since the prior review (this run covers head
Carried forward from the prior review of
I could not execute the test suite or the measurement script myself (this lane's tools are |
Closes #2853
What
The disk-hygiene half of the hook-budget conformance gap (sibling of the guardrails item, issue 1403 / issue 2663, under the issue 1809 budget adoption):
Bash|PowerShelllauncher recoveredMIN_PYTHONwith two separate full-filesedpasses over the ~3,500-line engine, neither stopping at the match. It now runs onesedwhose address-blockqterminates the read at theMIN_PYTHONline. Note the obvious one-liner (s///p;/^MIN_PYTHON/q) does NOT stop —q's address sees the already-substituted pattern space — which is why the block form is used.hygiene.MIN_PYTHONstays the floor's single origin (PR 1028);VersionFloorTestsstill passes.run-python-hook.test.shnow proves, via a recordingsedshim plus an argv replay against a two-floor fixture (first floor(3, 14), last line(9, 99)), that one launch reads the engine exactly once and that the read stops at the first match instead of scanning to EOF. Fixture floors are deliberately not 3/11 so the hardcoded fallback cannot masquerade as a pass.docs/conventions/hook-budget/README.md—EPOCHREALTIMEwall-clock around direct hook invocation with a benign payload, Windows 11 + Git Bash (the convention's binding host), 2026-08-16: the engine-gate hook costs ~190–300 ms per shell tool call across batches (92 single runs; ~19–30% of the <= 1 s typical per-tool-call ceiling). Per the review thread, the two-registration set (plugin hook +cleanskill frontmatter belt) was measured as a concurrent parallel wall (&+wait, 60 pairs): ~320–410 ms, ~1.3–1.5x the same-batch single wall rather than a naive 2x. Of the single-hook cost, the engine read accounts for ~24 ms (~13%) in the single-read form, down from ~38 ms (~19% of a ~205 ms hook) in the two-pass form.hooks.json"timeout": 60is unchanged, per the issue's third criterion.Verification
run-python-hook.test.sh: all 17 assertions pass locally (Windows 11 + Git Bash).test_hygiene.VersionFloorTests: 3/3 OK under CPython 3.14.7.qgenuinely fires on the original pattern space.sedreaders, so a future launcher that added a second read viacat/awk/stdin-redirectedsedwould not be caught by the exactly-once assertion; and the stop-at-EOF replay is necessary-but-not-sufficient (a range-addressed0,/floor/program would print one line yet read to EOF). The committed program is neither shape.Related
MIN_PYTHONas the single origin and thesedparse; this PR keeps that contract intact.docs/conventions/hook-budget/README.md— the measurement method and budget this PR conforms to.feat/2851-per-child-rollup) — lands after this PR and also touches the disk-hygiene CHANGELOG and manifest; this PR does not touchhygiene.pyor its tests.🤖 Generated with Claude Code
https://claude.ai/code/session_01RPRAvSLuRmR6rPQeCvdok6