来源: ranxianglei/billion-context-pi#433(https://github.com/ranxianglei/billion-context-pi/issues/433)实现三仓 acp_rule 时,billion-context 侧适配需独立跟踪。
What
Opt-in support for the acp_rule tool from acp-kernel (acp-kernel#283): persistent principle-level reminders the model records, which survive every compression fold.
Design (owner constraints: keep it simple, no system-prompt changes)
- Config:
rules?: boolean scalar on CompressSettings — three-level cascade (global → provider → model, deepest wins), off by default. Maps to kernel Config.rules = { enabled }.
- Tool injection: when enabled, injected on the anthropic / openai / responses native-tool wires next to absorb (same gate:
enabled && injectTool). Plugin clients get it in the manifest unconditionally (like absorb) with a per-session execution gate via effectiveRulesConfig.
- Semantics: ordinary tool, add-by-default — pass
rule to record a short reminder, omit the argument to list recorded rules. No remove/clear actions (stale-rule management = edit the session state file). Kernel validation errors are returned verbatim (no FAILED marker): empty / too long / duplicate / limit reached.
- Protection: hard protection comes free from the kernel (
ALWAYS_PROTECTED_TOOLS includes acp_rule) — the call and its result survive every fold. No client-side logic needed.
- No system-prompt changes: usage guidance lives entirely in the kernel's tool description.
- Persistence: rules live in
CompressionState.rules; added to the persist.ts mergeState whitelist so they survive restarts.
- Limits: kernel defaults 50 rules × 300 chars each.
Dependency
Requires acp-kernel #283 merged + published (wire schemas + state API). Until then this branch validates against a local dist overlay; the acp-kernel pin bump follows as a follow-up commit before merge.
来源: ranxianglei/billion-context-pi#433(https://github.com/ranxianglei/billion-context-pi/issues/433)实现三仓 acp_rule 时,billion-context 侧适配需独立跟踪。
What
Opt-in support for the
acp_ruletool from acp-kernel (acp-kernel#283): persistent principle-level reminders the model records, which survive every compression fold.Design (owner constraints: keep it simple, no system-prompt changes)
rules?: booleanscalar on CompressSettings — three-level cascade (global → provider → model, deepest wins), off by default. Maps to kernelConfig.rules = { enabled }.enabled && injectTool). Plugin clients get it in the manifest unconditionally (like absorb) with a per-session execution gate viaeffectiveRulesConfig.ruleto record a short reminder, omit the argument to list recorded rules. No remove/clear actions (stale-rule management = edit the session state file). Kernel validation errors are returned verbatim (no FAILED marker): empty / too long / duplicate / limit reached.ALWAYS_PROTECTED_TOOLSincludesacp_rule) — the call and its result survive every fold. No client-side logic needed.CompressionState.rules; added to thepersist.tsmergeStatewhitelist so they survive restarts.Dependency
Requires acp-kernel #283 merged + published (wire schemas + state API). Until then this branch validates against a local dist overlay; the
acp-kernelpin bump follows as a follow-up commit before merge.