fix(hooks): remove interim truncation caps — reducer is the size gate#99
Merged
Conversation
PRs #95 (bash 256-char cap) and #96 (prompt 1024-char cap) were character-based pre-clamps that ran strictly upstream of the ADR-130 sentence-salience reducer. They weren't redundant — they were *starving* the reducer by chopping off the back of the input before the reducer could score it. Concrete shape of the bug, on a 4000-char `gh pr create --body "$(cat <<EOF…)"`: hook receives 4000-char CMD ↓ check-bash-pre.sh truncates to 256 chars ← cap fires here ↓ ways scan command --command "<256 chars>" ↓ reduce_for_embed("<256 chars>", 75) ← input fits, passthrough ↓ batch_embed_score("<256 chars>") The reducer's whole pitch — preserve prose distributed across the whole document — was defeated as long as the caps ran first. The caps also masked any reducer-bounds bug by clamping inputs to a safe range before the reducer could exercise its full path. ADR-130's reducer provides the size guarantee these caps were meant to provide. With the caps gone, the reducer sees the full input, scores sentence salience across it, and hands the embedder a bounded query. Custom-agent discriminator in check-task-pre.sh (PR #94) is *not* a cap — it's a "don't invoke ways scan task at all for dispatches to custom agents" gate. Unchanged. Tested live: 6.4KB bash command, 6KB task-notification prompt both run cleanly through the production hook chain, 0 SIGABRTs.
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.
Summary
Removes the character-based truncation blocks from
check-bash-pre.sh(PR #95) andcheck-prompt.sh(PR #96). They were misframed in their own commit messages as "belt and suspenders" — in practice they ran strictly upstream of the ADR-130 reducer (PR #98), starving it by chopping the input before it could score sentence salience.The custom-agent discriminator in
check-task-pre.sh(PR #94) is not a cap — it stopsways scan taskfrom running at all for dispatches to custom agents. Untouched.Why now, not after an observation window
The caps make every signal we'd want to observe worse:
Keeping them was actively delaying the observation we wanted to do.
What's still guaranteed
ADR-130's
reduce_for_embedenforces a per-hook token budget (110 for prompt/task, 75 for command, 30 for file) and bounds output regardless of input size. The CJK-aware approximate tokenizer (added in the PR #98 review fixes) prevents the Japanese/Chinese under-counting that would have been a regression here.Test plan
bash -nclean on both scriptsgh pr createthrough bash hook → 0 crashes