Skip to content

refactor(packs): consume acp-kernel 0.0.66 pack API - #402

Closed
ranxianglei wants to merge 1 commit into
masterfrom
refactor/kernel-packs
Closed

ranxianglei wants to merge 1 commit into
masterfrom
refactor/kernel-packs

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Fixes #401

What

Migrates the adapter onto the kernel's pack layer so the mechanism has one source of truth (matching billion-context #729/#730, which already consumes the kernel API).

  • src/packs/{types,sanitize,lean,builtin,dir}.ts deleted — replaced by acp-kernel 0.0.66 exports (Pack/PackSource/PackResolver, sanitizePackSurface, builtin registry with default+lean, createDirPackSource, defaultPackSources)
  • src/prompt-pack.ts rewritten on kernel exports; consumers unchanged (mergeSurface/readToolSurfaceWithPacks/resolveActivePack; src/index.ts call sites pass Pack instead of pack.surface)
  • pi-specific data (PiPromptSections tri-state sections, per-tool prompt snippet/guidelines, delegatePrompt) rides in surface.adapters.pi — opaque to the kernel, sanitized adapter-side (piAdapterSurface)
  • source chain identical: project .pi/acp/packs > user ~/.pi/acp/packs > builtin; filename-is-identity semantics from the kernel
  • lean assertions now target kernel leanPack.adapters.pi, including the aligned recall rules (Post-compress search bounce: lean pack promotes search_context to routine recall #399/fix(packs): lean recall rules aligned with pre-lean semantics #400)
  • acp-kernel exact pin bumped 0.0.65 → 0.0.66

Verification

  • npm run typecheck clean · npm test 789 pass / 0 fail / 3 skipped (skips pre-existing) · npm run build green
  • runtime smoke: lean resolves via kernel builtin, 4 tools with cleared snippets, aligned rules present
  • 3 config.test.ts delegate tests are env-sensitive inside pi sessions (PI_ACP_DELEGATE_DEPTH) — pass with a clean env, unrelated to this change

…acks

Fixes #401

- src/packs/* deleted (229 lines): types/sanitize/lean/builtin/dir all
  live in the kernel now (acp-kernel #259/#260, v0.0.66)
- src/prompt-pack.ts rewritten on kernel exports; external surface
  (packResolver/resolveActivePack/mergeSurface/readToolSurfaceWithPacks)
  unchanged
- pi-specific surface (PiPromptSections tri-state, tool extras,
  delegatePrompt) read from surface.adapters.pi and sanitized adapter-side;
  kernel treats it as opaque data
- lean assertions moved to kernel leanPack.adapters.pi (aligned recall
  rules from #399/#400)
- acp-kernel pinned 0.0.65 -> 0.0.66 (exact)
- 792 tests: 789 pass / 0 fail / 3 skipped (pre-existing); typecheck+build green
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Extension Artifact

Branch: refactor/kernel-packs (f75b755)

Option A — Install from npm PR tag (recommended)

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

Each push to this PR publishes a new version under the pr-402 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-pr402.tgz
pi install ./package

This comment is automatically updated on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 开始 review。已拉取 refactor/kernel-packs (f75b755),正在核对 diff 整洁度、kernel 0.0.66 pack API 的消费方式、以及 typecheck/test/build 结果,稍后给出结论。

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.

Prompt-pack module duplicated: local src/packs/* reimplements what acp-kernel 0.0.66 now ships

1 participant