Repository navigation
fix(nudge): restore maxContextLimitPct pressure band + gate pressure nudges on effective pending (fixes #57 regressions) - #70
Merged
Conversation
…xContextLimitPct band, gate pressure nudges on effective pending
…nudges on effective pending Review fixes for #57 (two regressions): 1. The 75-95% over-limit band was deleted — maxContextLimitPct had no consumer. Restored as the pressure band: bypasses growth gate + cadence, picks the tier with the MAX pending (keeping #57's tier-aware argmax and effective-pending semantics), labeled OVER-LIMIT vs EMERGENCY by which threshold fired. 2. Emergency with zero effective pending injected every turn — and could offer sub-minCompressRange tail ranges that would be atomically rejected (the exact failure mode #57 fixes, resurfacing under pressure). Pressure nudges are now gated on effective pending > 0; the suppressed case reports why instead of spamming. Also merges master (truncate machinery, emergencyThresholdPct 0.95) into the branch: pr-57's arbitration is preserved, config keeps master's tuning + the new tier2GrowthMultiplier. 295 tests (+2 regression tests that are red on unpatched #57).
This was referenced Aug 15, 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.
Supersedes #57 (contains all of its commits via merge) — fixes the two regressions found in review (comment).
Regression 1 (high): the 75–95% band was deleted
#57 kept only
growthReady+emergencyOverridearbitration;grep overLimit|maxContextLimitPctin its compress.ts = 0 hits. Usage in the over-limit band with growth < floor stopped nudging entirely, andmaxContextLimitPctsurvived in config with no consumer.Fix: pressure band =
usage >= maxContextLimitPct(subsumes emergency): bypasses growth gate + cadence, picks the tier with the MAX pending (keeps #57's tier-aware argmax so pressure can still route to distillation), gated on effective pending. Reason labels OVER-LIMIT vs EMERGENCY by which threshold fired.Regression 2 (medium): emergency with nothing effective injected every turn
shouldInject = emergencyOverride || …fired at ≥95% with zero effective pending — and whenrecommendedRangesstill held sub-threshold tail groups, the nudge offered ranges the kernel would atomically reject (the endurance-report failure mode, resurfacing under pressure).Fix: pressure nudges gated on
bestPending > 0; the suppressed case does not inject and its reason states why (…no tier has effective compressible content…minCompressRange). The truncate node remains the independent last resort.Merge notes
emergencyThresholdPct0.95 +truncate.threshold0.95 tuning kept, not pr-57's stale 0.80).Tests
295 pass, 0 fail (+ master's two over-limit tests, kept) and two NEW regression tests that are red on unpatched #57:
Downstream: adapters are unaffected until they bump their kernel pin;
tier2GrowthMultiplieris additive config.