Skip to content

feat(surface): configurable prompt sections, nudge sections, tool prompts, delegate prompt - #395

Merged
ranxianglei merged 3 commits into
masterfrom
2026-09-12_pi-surface-config
Sep 12, 2026
Merged

ranxianglei merged 3 commits into
masterfrom
2026-09-12_pi-surface-config

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Fixes #252

What

Exposes acp-kernel 0.0.65's surface-config layer (kernel #169 + #256) as four new acp.json keys:

Key Covers Semantics
promptSections 9 structural system-prompt sections (ACP TAGS, TOOLS, WHEN TO COMPRESS, ...) tri-state: string=replace, null=remove, omitted=default
nudgeSections guidance-class nudge texts (efficiencyNote, emergencyHeader, t2Guidance, t3Guidance) same tri-state
toolPrompts per-tool LLM text (description, paramDescriptions, promptSnippet, promptGuidelines) for compress/decompress/search_context/acp_status read synchronously at extension load — tool defs are frozen at registration; restart pi after changing
delegatePrompt ACP_DELEGATE_NOTIFICATIONS appendix (when delegate enabled) string=replace, null=remove

Safety

  • The four load-bearing compression rules stay behind the risk-gated prompts + acknowledgePromptsRisk; new keys are docs/guidance class, not gated.
  • Trigger lines, renderer labels, and tool feedback text are contract-locked (kernel 估算错误导致紧急压缩从不触发 #257 audit).
  • All four fields sanitized at applyUserConfig time; unknown keys and malformed values silently dropped.
  • toolPrompts is read once at factory time (mirrors the existing sync userConfigDisabled pattern) because pi freezes tool definitions at registration.

Byte-identity

Default system prompt and delegate appendix are fixture-pinned (tests/fixtures/pi-*.txt) — with no config, output is byte-identical to pre-change builds.

Deps

Pins acp-kernel to exact 0.0.65 (published). Local validation ran against kernel master overlay before publish, then re-validated against the registry tarball.

Tests

774 pass / 0 fail / 3 skip (env-dependent). 10 new tests in tests/surface-config.test.ts: fixture byte-identity, tri-state semantics, sanitizers, paramDescriptions schema rewrite, project-local .pi/acp.json pickup, loadUserConfig new keys. Docs: CONFIGURATION.md + CONFIGURATION.zh-CN.md.

awork added 2 commits September 12, 2026 20:17
…mpts, delegate prompt (#252)

Four new acp.json keys exposing the kernel 0.0.65 surface-config layer:

- promptSections: tri-state overrides for the 9 structural ACP system-prompt
  sections (string=replace, null=remove, omitted=default); the 4 load-bearing
  compression rules stay under the risk-gated prompts key
- nudgeSections: tri-state overrides for guidance-class nudge texts
  (efficiencyNote, emergencyHeader, t2Guidance, t3Guidance)
- toolPrompts: per-tool LLM text (description, paramDescriptions,
  promptSnippet, promptGuidelines) for compress/decompress/search_context/
  acp_status, read synchronously at extension load (tool defs frozen at
  registration)
- delegatePrompt: replace or remove the ACP_DELEGATE_NOTIFICATIONS appendix

Default system prompt and delegate appendix are byte-identical to the
pre-change output (fixture-pinned). All four fields sanitized at
applyUserConfig time; unknown keys and malformed values are dropped.
Required for the surface-config layer: applySectionOverrides and the
renderNudgeText sections parameter shipped in acp-kernel 0.0.65 (#169, #256).
@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Extension Artifact

Branch: 2026-09-12_pi-surface-config (0a317bd)

Option A — Install from npm PR tag (recommended)

pi install npm:billion-context-pi@pr-395

Each push to this PR publishes a new version under the pr-395 npm tag.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pi-pr395.tgz
pi install ./package

This comment is automatically updated on each push.

Windows runners checked the fixtures out with CRLF (core.autocrlf),
breaking the byte-identity assertions. Mark tests/fixtures as -text so
git stores and checks out the bytes verbatim.
@ranxianglei
ranxianglei merged commit 14ba7b4 into master Sep 12, 2026
9 checks passed
HangxiangMa pushed a commit to HangxiangMa/billion-context-pi that referenced this pull request Sep 21, 2026
…face-config

feat(surface): configurable prompt sections, nudge sections, tool prompts, delegate prompt
HangxiangMa pushed a commit to HangxiangMa/billion-context-pi that referenced this pull request Sep 29, 2026
Top-level acp.json key removed from the soft-protected recent zone
(kernel ranxianglei#395). Recommended remedy for the batch-read fold->re-read
loop (upstream billion-context #1198/#1277): remove only 'read',
keep decompress/search_context. Unlike the two protection keys an
empty array is a VALID max-protection escape hatch, so it is
validated separately from cleanProtectionList.

Refs ranxianglei#545
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

研究这个精简化方案billion-context-pi-lean

1 participant