fix: announce truncated block lists in status overview; per-tier block counts (#221) - #222
fix: announce truncated block lists in status overview; per-tier block counts (#221)#222ranxianglei wants to merge 1 commit into
Conversation
…k counts (#221) The tier-distillation nudge lists every active lower-tier block uncapped, while buildStatusReport's overview silently capped the block list at 30 entries sorted by original size. Once a session accumulates >30 active blocks — exactly the condition under which T2/T3 distillation nudges fire — active target-tier blocks vanish from acp_status and the model reads the two same-source views as contradictory (bcp#330 session 01a07b3c: nudge named 11 T1 targets, status visibly showed only b31/b32), skipping the distillation and re-triggering it on the next turn. - renderOverview: explicit '... and N more blocks not shown' line with a pointer to scope:"compressed", parity with the other two views - tierBreakdown: per-tier active block counts next to token totals so the nudge's target count is checkable even when individual lines are hidden
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)In your adapter project: npm install acp-kernel@pr-222Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf acp-kernel-pr222.tgz
npm install ./packageThis comment is automatically updated on each push. |
[bot] 🏷 Review: LGTM — root cause verified against source, pre-fix failure reproduced, all checks green. Details below per triage rules. 1. Root-cause verification (all claims checked out true)"Data source is already unified" — confirmed:
"Rendering asymmetry" — confirmed:
2. Reproduction & verification (ran locally, Node v22)
3. Fix assessmentRight layer, right shape. The announcement line gives both the exact hidden count and an actionable pointer (
4. Minor observations (non-blocking)
Nothing here blocks merge. |
Root cause (verified against source)
The nudge and
acp_statusalready share one data source: within a singleprocessTurn,nudgeNoderuns on the sameio.stateaftersyncBlocksNode(src/compress.ts:466-481), anddecideNudgederivestierTargetBlocksfromactiveBlocks(state)— the exact same predicatebuildStatusReportuses (src/state.ts:41-43,src/report.ts:125-127). There is no snapshot drift inside a turn.The mismatch is a rendering asymmetry:
formatTierTargetBlocks,src/nudge-text.ts:39-49).acp_statusoverview caps its block list at 30 entries sorted by original size across all tiers (sorted.slice(0, limit),src/report.ts:201) and did so silently — no "N more" line, unlike the other two views. The header still showed the full count.So once a session accumulates >30 active blocks — which is guaranteed exactly when T2/T3 distillation nudges fire (they fire because lower-tier blocks piled up past
tier2Trigger) — some active target-tier blocks vanish from the status list while the nudge names them. In bcp#330 session01a07b3c(41 blocks): the nudge named 11 T1 targets (b31..b41), the model'sacp_statusvisibly contained only b31/b32 as T1 → "Nudge 列表再次与实际不符,跳过" → distillation skipped → T1s pile up further → nudge re-fires next turn. Repeating, self-reinforcing trust break.The two fixes proposed in the issue are both no-ops against this cause: "unify data source" is already true; "filter targetBlocks by current active blocks" is already what
pendingByTierdoes (src/compress.ts:1095-1126). The defect is on the status-rendering side, so that is where this PR acts.Changes
renderOverview: explicit... and N more blocks not shown (scope:"compressed", limit:M for full list)when the cap bites — parity withrenderUncompressedRanges/renderCompressedDrilldown.tierBreakdown: per-tier block counts alongside token totals (T1: 12.3K (35 blocks) | T2: 45K (6 blocks)) so the nudge's target count is checkable even when individual lines are hidden by the size sort.Tests
New
tests/report-truncation.test.ts(3 tests), fixture mirrors session 01a07b3c's shape (41 active = 35 T1 + 6 T2):scope:"compressed"(failed pre-fix — silent truncation reproduced);Full suite: 583 pass / 0 fail.
tsc --noEmitclean. Build OK.