Repository navigation
fix(prompts): mark stale summary line-numbers/snippets AND carried user directives as historical - #492
fix(prompts): mark stale summary line-numbers/snippets AND carried user directives as historical#492ranxianglei wants to merge 2 commits into
Conversation
The HOW TO COMPRESS KEEP VERBATIM rules told summarizers to record file line numbers and key code lines verbatim, with no staleness caveat. A later model treats those as directly-editable facts, but they drift once the file changes after the block is written - the mechanism behind edit oldText drift -> rejected batches -> replay dead-loops (billion-context-pi#592). Add a single dual-sided rule under KEEP VERBATIM: line numbers/snippets are POINT-IN-TIME snapshots as of block creation; treat them as navigation hints, not editable ground truth; re-read/grep before building an edit oldText from them. Re-pin the three byte-stable prompt fixtures. Refs ranxianglei/billion-context-pi#592
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)In your adapter project: npm install acp-kernel@pr-492Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf acp-kernel-pr492.tgz
npm install ./packageThis comment is automatically updated on each push. |
[bot] 🏷 Reviewed PR #492 (branch What I verified
One material finding — the fix does not reach the lean-pack Tier-1 surface
That matters because the motivating incident bcp#592 lives in billion-context-pi — precisely the host the lean pack serves. If the Pi host runs the lean pack, this PR fixes the default contract but leaves the incident's actual surface uncovered. Your scoping note covers T2/T3 correctly (they drop line numbers by design — verified: Two options — your call (deciding input: does the Pi host actually select
I have not edited anything (CI green, no request to change); flagging for your decision since this is load-bearing prompt surface. Structured seven-question review
VerdictCorrectly self-labelled as not an auto-merge candidate — it touches §7.3 load-bearing prompt surface (#7), which stays human-gated. Direction is sound, implementation is clean and minimal, CI is green. Recommend holding merge until you settle the lean-pack question (option A, or documented exclusion + follow-up B). Once that's resolved, it's ready to merge. |
…ectives line unconditional
Sub-defect 2 of billion-context-pi#592 (same root cause as sub-1: summary loses temporal/structural metadata -> model treats history as present). In howToCompressRules: (a) imperative/nudge user messages carried into a summary must keep their ref plus a [HISTORICAL] prefix and be rewritten in past tense so no command tone survives; (b) the Open objectives line is now emitted unconditionally ('(none)' fallback) so a weak model cannot silently skip the field.
Fixes billion-context-pi#592 (sub-defects 1 + 2, write-side).
Same root cause for both: a compression summary loses temporal/structural metadata, so a later model treats history as present.
Sub-1 — stale code artifacts used as facts
Line numbers & code snippets recorded in a summary are POINT-IN-TIME snapshots; they drift once the file is edited afterwards. Rule added under KEEP VERBATIM telling the model to treat them as navigation hints only and re-read/grep the file before building an edit's oldText (or checking current content against a summary snippet).
Sub-2 — stale user directives re-executed as current
Two rules added to howToCompressRules:
[HISTORICAL]prefix; an imperative one must ALSO be rewritten in past tense ("was asked to X") so no command tone survives. Never render a carried directive in present/imperative voice — that reads as a live order.Open objectives:line is now emitted UNCONDITIONALLY ((none)when nothing remains open) so a weak model cannot silently skip the field and its absence is never ambiguous.Scope
HOW_TO_COMPRESS_RULES(src/compression-rules.ts) + regenerates the 3 byte-stable prompt fixtures. No wire format, no pipeline node, no config/default change.Verification (local, targeted — full suite on CI)
tsc --noEmitcleannode --import tsx --test tests/surface-config.test.ts tests/packs.test.ts tests/nudge-text.test.ts→ 63 pass / 0 fail (includes the byte-stable fixture comparison and the existing open-objectives guardrail tests)prettier --check src/compression-rules.tsclean