fix(nudge): fire tier-2/3 distillation nudges on block COUNT, not summary token mass - #162
Merged
Merged
Conversation
…mary token mass tier2Trigger/tier3Trigger existed in config but decideNudge never read them: the non-pressure path gated T2 on t2Pen >= 1.5x nudgeGrowthTokens AND t2Pen > t1Eff. Summaries are ~10:1 condensed by design, so t2Pen almost never beats the 1.5x gate, and any fresh raw content keeps t1Eff larger — the T2 nudge effectively never fired and tier-1 blocks piled up forever (billion-context-pi#224). Count-based trigger (active tier-1 blocks >= tier2Trigger, default 5) now ORs with the token-mass path. T1 raw compression keeps priority; per-tier growthFloor cadence still applies; diagnostics list count-ready tiers and their cadence blocks.
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)In your adapter project: npm install acp-kernel@pr-162Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf acp-kernel-pr162.tgz
npm install ./packageThis comment is automatically updated on each push. |
…-branch indentation Review follow-ups (2 independent agent reviews, both approve-with-nits): - add tiers.enabled=false arbitration test so a future refactor cannot hoist the count check outside the tiers guard - dedent the diagnostics else-branch to match surrounding style
Owner
Author
Agent reviews (2 independent reviewers)Both verdicts: approve-with-nits. Follow-ups applied in 58863c7. Correctness review — verified
Design review — highlights
Nits addressed in 58863c7
Noted, not blocking
|
This was referenced Aug 25, 2026
Merged
Owner
Author
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)In your adapter project: npm install acp-kernel@pr-162Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf acp-kernel-pr162.tgz
npm install ./packageThis comment is automatically updated on each push. |
Owner
Author
|
[system] ❌ ework-daemon crashed (exit 143). Try posting again or @ework-daemon to retry. |
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.
Problem (billion-context-pi#224)
tier2Trigger/tier3Trigger(defaults 5 / 10) existed in config and validation, butdecideNudgenever read them. The non-pressure path gated T2 on:Summaries are ~10:1 condensed by design, so
t2Penalmost never reaches the 1.5x gate, and any fresh raw content keepst1Efflarger than the summary total. Net effect: the T2 nudge effectively never fires and tier-1 blocks accumulate indefinitely — the user-visible "t2 永不触发" in billion-context-pi#224.Empirical repro on 0.0.45 defaults (1M limit): 10 tier-1 blocks with ~1K-token summaries + raw messages present → no nudge (
max compressible 17136 < threshold 50000); 80 blocks → T1 wins; only the corner case (all raw already compressed) fired T2.Fix
>= tier2Trigger(T3: tier-2 blocks>= tier3Trigger) now ORs with the existing token-mass path.nudgeGrowthTokens(fresh content still gets compressed first).growthFloorcadence still throttles re-firing.T2 5 blocks (count); cadence-blocked tiers showblocked: T2 (cadence).TierConfigdocstrings document the count semantics.Verification
tests/nudge.test.ts: count-triggered T2 (fires with 5 blocks despite ~500-token summary mass), negative below trigger, T1-priority preserved, cadence respected, count-triggered T3.tsc --noEmitclean; build clean.T2 distill ready: 10 tier-1 blocks >= tier2Trigger 5; scenario B (large raw pending) still routes to T1.