Repository navigation
feat(rules): acp_rule persistent reminders (compress.rules) - #750
Conversation
[bot] 🏷 PR review — acp_rule wire injection: 3 real bugs found, already fixed on the branch; merge is blocked only on the kernel release chain. What I verified
Bugs found (all in
Current branch state
Remaining blockers (per your dependency note — unchanged)
Diff hygiene otherwise: focused, no unrelated files, no lockfile churn. The remaining hunks (config cascade, persist whitelist, plugin manifest, docs) reviewed clean. 修了三个真实 bug(anthropic 线把工具数组当单个工具塞进 tools 列表、openai/responses 两条线根本没注入 acp_rule、plugin 门控 |
|
PR 队列扫描更新(issue #1020): 判定:阻塞,需 acp-kernel 先行,不关闭。 尝试了完整 rebase 到当前 master:代码层冲突( 后续路径:acp-kernel 实现 rules API 并发版 → 本 repo pin bump → 重新 rebase(本地已验证的合流方案可直接复用)。跟踪 issue:#749。 |
Status confirmed independently — blocker is real and unchanged; no branch action taken. I re-verified the queue-scan verdict against live sources rather than trusting the report:
So: agree with the judgment — stays open, nothing to fix on this repo's side until the kernel ships. Next steps unchanged: acp-kernel #283 merged + published → pin-bump commit here → rebase onto master (the manually resolved conflict set — One process nit to flag: the cited tracking issue #749 was closed as "completed" on Sep 15, six days before this scan, while the PR it tracks is still blocked. Either re-open it to keep the follow-up path traceable there, or treat this PR (#750) as the tracker going forward — as it stands, "跟踪 issue:#749" points at a closed issue. 中文摘要:独立复核确认阻塞属实(acp-kernel#283 仍未合并,npm 上 0.0.79 与 0.1.0-pr.157.11 两个包均无任何 rules API 符号),PR 保持打开不动代码,只等内核发版后做 pin bump + rebase;另发现跟踪 issue #749 已被提前关闭为 completed,需 owner 决定重开或改以本 PR 为跟踪入口。 |
|
Kernel-side status: the blocking reconciliation is now up as acp-kernel#332 (branch import { addRule, listRules, formatRulesList, resolveRuleLimits } from "acp-kernel";Verified end-to-end against the packed kernel dist (not just src): Remaining steps to unblock this PR:
Same applies to #637 (kernel#223 already merged in kernel master 043cc68 — only the release + pin bump remain). |
aefe017 to
12d3923
Compare
Rebase executed and verified — step 3 from your plan is done ahead of the release. Branch state: Verification against "Imports should compile as-is" was close but not quite — the reconciled kernel drifted from the old pr.283 artifact in four ways, all handled:
Conflict resolution notes: Remaining steps (unchanged): acp-kernel#332 merges + releases → one-line pin bump here (exact version per the pin rule) + lockfile refresh + rebuild → mergeable. One option if you want green CI before the stable release: I can push a pin to 中文摘要:PR 已 rebase 到当前 master 并针对 #332 的预发布版(0.0.79-pr.332.197)全量验证通过(typecheck/测试 2018 过 0 挂/build),期间适配了 kernel API 漂移(wire 工具对象改本地合成、rule id 与报错文案变化);剩余步骤为 kernel#332 合并发版后一行 pin bump,即可合并。 |
… + plugin injection
- anthropic: injectTool accepted a single extra tool; the call site passed an [absorb?, rule?] array, which was pushed as ONE nested element into the tools list (typecheck error TS2345, would break the Anthropic API). Generalized the helper to an extras array with per-name dedup. - openai: rulesActive was computed but never used — acp_rule was never injected and storeEffectiveRules was missing, so the plugin execution gate silently fell back to base config. - responses: same gap — no acp_rule in the injected tool set, no storeEffectiveRules. Gate mirrors absorb (skip on compaction-trigger requests and text protocol, which has no native tool surface). - tests/rules-wire.test.ts: real-HTTP wire coverage for injection on all three wires (on/off/dedup against client-supplied tools).
…ettings doc block The rules bullet addition re-indented the existing absorb lines (2 -> 3 spaces); keep the doc-block diff purely additive.
12d3923 to
b7207f8
Compare
|
Unblocked: kernel 0.0.80 is live ( Pre-flight on the rebased head: typecheck PASS · tests 2020/2020 (2 gated E2E skips; includes this PR's rules-feature suite) · build PASS. The kernel imports ( Ready for review/merge. |
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-750Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr750.tgz
npm install -g packageInstall instructions are refreshed on each push. |
- ranxianglei#223 protectedLatestTools: collectLatestProtected / isMessageLatestProtected — kernel primitive for 'protect only the latest instance of a tool' - ranxianglei#332 acp_rule rules API: RULE_TOOL_NAME, DEFAULT_RULE_LIMITS, addRule/listRules/removeRule/clearRules, resolveRuleLimits, formatRulesForPrompt/formatRulesList, CompressionState.rules?/nextRuleId?, Config.rules? Unblocks ranxianglei#750 (acp_rule feature) and ranxianglei#637 (todo/capsule continuity) for rebase.
Master gained two injection-point features after this branch diverged: ranxianglei#750 (acp_rule persistent reminders) and ranxianglei#816 (per-wire tool prompt overrides). The anthropic/openai/responses wires both honor them at their injection points; the Google wire silently dropped both. - synthesize RULE_TOOL_GOOGLE in compress-tool.ts (the kernel ships RULE_TOOL_NAME only, same situation as the other three shapes) and inject it when rules are enabled, mirroring the other three sites; - pass surface?.toolPrompts into injectGoogleTool so ranxianglei#816 overrides apply on the fourth wire as well.
Closes #749
Three-repo implementation of ranxianglei/billion-context-pi#433 — this is the billion-context side (kernel: acp-kernel#283; pi adapter: branch on ranxianglei/billion-context-pi).
What
Opt-in
acp_ruletool support: persistent principle-level reminders the model records that survive every compression fold.rules?: booleanscalar on CompressSettings — three-level cascade (global → provider → model, deepest wins), off by default; maps to kernelConfig.rules = { enabled }effectiveRulesConfig)ruleto record, omit the argument to list; no remove/clear actionsALWAYS_PROTECTED_TOOLSincludesacp_rule) — no client-side logicpersist.tsmergeStatewhitelistPre-flight
npm run typecheckcleannpm test: 1456 pass / 0 fail / 2 skipped (newtests/rules.test.ts, 13 tests)npm run buildsuccessDependency note
CI will fail until acp-kernel #283 merges and publishes (this branch pins
acp-kernel@0.0.69, which predates the rules API; local validation used a dist overlay). Follow-up pin bump commit before merge.