Repository navigation
feat(nudge): persist nudge injections as display-only session entries (closes #326) - #552
ranxianglei wants to merge 1 commit into
Conversation
📦 Built Extension ArtifactBranch: Option A — Install from npm PR tag (recommended)pi install npm:billion-context-pi@pr-552Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pi-pr552.tgz
pi install ./packageThis comment is automatically updated on each push. |
[bot] 🏷 收到,开始 review PR #552。初步状态:
|
[bot] 🏷 Review complete — verified, can merge. Full audit below (issue direction → regression inventory → code → tests → diff). ① Issue direction (#326) — correct, root-cause level. Verified pre-fix state on master: zero ② Regression inventory — every pre-existing behavior the diff touches, with verdicts:
③ Code review — clean. Mark-after-success ordering means a failed append retries on the next fire (no silent loss); ④ Test validity — real teeth, not ceremony: exact-string assertions against the #326 example incl. tier/no-range variants; integration test drives actual kernel overflow (~270K sent view vs 180K window → EMERGENCY) through the real factory and asserts exactly-one-record-per-turn while emergency re-injection still reaches the model, plus new-turn → new record; log test asserts one tagged physical line per entry with escaped literals and stack co-located. These fail on pre-fix code. ⑤ Diff cleanliness — 9 files, +227/-8, every line serves #326. No unrelated churn, no whitespace noise, no lockfile drift. Verification evidence (rebased head): clean rebase onto Notes: (a) this is a 中文摘要: 审核通过——nudge 注入持久化方案打在根因上(pi 官方 display-only custom entry,零模型上下文污染,已对照 pi 0.83.0 类型定义逐条核实),唯一行为变更是 acp.log 多行值转义为单物理行(即 #326 的次要诉求,已披露);rebase 后本地三关全绿且与 CI 一致,可以合并。 |
f07dee4 to
3e00a63
Compare
3e00a63 to
40670ca
Compare
[bot] 🏷 Re-reviewed the force-pushed head ( What the new push contains: maintainer-side rebase onto current master. Verified via range-diff that it is a pure move, not a content change:
What moved on master since my last pass (v0.1.79 → v0.1.80): #215 overflow-nobody-arm, #328 post-compress-token-floor, #430/#429 surface section-whitelist retirement, release v0.1.80. None touch this PR's paths in a conflicting way; Validation on new head 24a953d (local, fresh GitHub state: CI on 24a953d — E2E ✅ CI ✅ Build Artifact ✅; PR reports Reminder from last round: close #515 as superseded once this merges. Merge stays human-side per §7.4 (feat + load-bearing wiring). 中文摘要: 复审了 force-push 后的新 head——rebase 为纯位移(代码 hunk 逐字节未变,仅行号偏移),master 新增的 #215/#328/#430 均无冲突且 acp-kernel pin 未动;新 head 上本地三关全绿(997/994/0)、CI 全绿、dist 零运行时依赖,结论不变,可以合并。 |
|
Superseded by the in-place rebase of #515 (now at 927cde2, parented directly on current master e5c2476). Verified: #515's rebased diff is line-for-line identical to this PR's content (only delta: one cosmetic blank line in src/messages.ts), plus the four union resolutions required by newer master (index.ts import with #561's liveOnlyTailCached, runtime.ts return object with sent-view metering methods, messages.ts beside #526's ACP_RULE_CUSTOM_TYPE, CHANGELOG position). CI on 927cde2: 9/9 green. This branch (based on 198149c) is now dirty/conflicting against master. Closing to leave a single canonical PR (#515) for the merge. Reopen if anything is missing. |
Supersedes #515 (original author @liu-zhengdong — full design and description below belong to them). Maintainer-side rebase onto current master 40670ca (v0.1.78, acp-kernel 0.0.94): the fork head had conflicts in src/messages.ts (
ACP_RULE_CUSTOM_TYPEfrom #526 vs this PR'sACP_NUDGE_CUSTOM_TYPE) — resolved by union.Closes #326.
Summary (from #515)
When a context-limit nudge is injected, it was previously only shown transiently via
ctx.ui.notify()(if debug mode was on), and never written to the session log. Restarts or resuming sessions would wipe all injection history, and multi-line nudge logs spilled onto un-tagged physical lines inacp.log.Changes
src/index.ts): append compact record ([ACP nudge] EMERGENCY 95% · T1 · top range m00120–m00168) viapi.appendEntry("acp-nudge", { text }); deduped per user turn viaruntime.markNudgeRecorded(); dim-box entry renderer via@earendil-works/pi-tui; zero LLM context pollution (custom entries excluded from core projection).src/log.ts): escape\r/\nin string fields — one physical line per log entry.Rebase verification (this branch)
npm run typecheck: 0 errorsenv -u BILLION_CONTEXT_PROXY npm test: 979 tests / 973 pass / 0 failnpm run build: PASS