Repository navigation
Replace hook CPU cutoff with deterministic work bounds (T15) - #256
Merged
Merged
Conversation
erickb336
marked this pull request as ready for review
October 17, 2026 00:19
This was referenced Oct 17, 2026
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.
Closes #255
Sage task T15
The existing one-megabyte hook check failed CI at 5,140 ms against a 5,000 ms CPU cutoff. This change measures filesystem work instead of machine speed and removes fastest-of-three retries. It preserves all seven input shapes, both roles and their permission outcomes. Production hook code is unchanged.
Each handler runs once. The test counts filesystem probes, submitted path characters and repeated operation/path probes. A broad 120-second child timeout remains only as a deadlock guard. Two disposable-plugin mutations prove the test detects an unbounded ancestor walk and a missing prefix cache, with specific work-limit diagnostics. Parser input never runs as a shell command.
Validation on 56f9d8f:
npm run build: built 311 files.npm run check: passed; 4 timing annotations remain.npm test: tests 1480, pass 1480, fail 0, cancelled 0; 306293 ms.All test commands use fake ps, pgrep and kill first on PATH. This measures the four intercepted synchronous filesystem-probe families, not every parser algorithm or wall-clock latency. One original long-word agent case retains its existing fail-closed result. No new live-provider behavior is claimed. Other timing tests remain outside this repair.