Skip to content

feat(status): surface meta — active pack in acp_status + /acp, sidecar audit stamp (#431) - #432

Closed
ranxianglei wants to merge 3 commits into
masterfrom
feat/status-surface-meta
Closed

ranxianglei wants to merge 3 commits into
masterfrom
feat/status-surface-meta

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Fixes #431. Depends on acp-kernel 0.0.69 (PR ranxianglei/acp-kernel#278, release ranxianglei/acp-kernel#279).

What

  • resolveSurfaceMeta() / surfaceMetaOf() in src/prompt-pack.ts: host-declared surface facts ({ pack, packVersion?, host }). Which pack is active stays host policy (kernel #730 rationale); the kernel only renders what the host declares.
  • acp_status passes meta into buildStatusReport — the overview and compressed drilldown render ACTIVE SURFACE: pack=lean v1.0.0 | host=billion-context-pi 0.1.68 (kernel-rendered, uniform across hosts; the tool is model-visible so format unity matters).
  • /acp panel version line appends · pack: <name> (host-composed string — the panel's existing version precedent).
  • SessionStateStore.setActivePack() stamped in before_agent_start (where the pack is already resolved); persisted top-level activePack in the *.acp.json sidecar on next save, read back on load. Post-hoc forensics no longer needs config-mtime archaeology (session 01a09aa0).
  • Pin acp-kernel 0.0.66 → 0.0.69; cherry-picked the lean-assertion alignment from release v0.1.69 #428 (b45b22f) so this branch tests green against the 0.0.68+ contract independent of merge order.

CI note

package-lock.json still resolves 0.0.66 on purpose: 0.0.69 is not on npm until ranxianglei/acp-kernel#279 merges (human-only). After that: npm install to refresh the lockfile here (or rebase on the next release), then CI goes green. Locally validated against the kernel branch build (804 tests pass, typecheck clean).

Merge order

  1. acp-kernel feat(guardrail): generic same-arguments tool-call loop breaker #278 → [Feature Request] 使 acp_delegate 超时和嵌套深度可配置 #279 (publishes 0.0.69)
  2. pi release v0.1.69 #428 (release v0.1.69, pin 0.0.68)
  3. this PR (+ lockfile refresh)

awork added 2 commits September 13, 2026 20:19
…follow-up)

- acpTags: 'settled history' inversion is gone; assert the fresh-user-confirmation
  guardrail wording instead
- summariesInContext: kernel now ships a compact trust-guardrail string; assert it
  survives sanitization and reaches the system prompt
- howToCompress: 0.0.68 header is 'HOW TO COMPRESS' (no '(condensed)' suffix);
  assert the body marker KEEP VERBATIM
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Review started. Dependency chain confirmed still open and mergeable: acp-kernel #278 (feat) → #279 (release 0.0.69) → pi #428 (v0.1.69) → this PR; npm currently shows only 0.0.69-pr.279.142 (prerelease), no stable 0.0.69 — matching your CI note. Currently validating the branch locally against the kernel PR build (typecheck + tests), then I'll report findings.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Review complete — LGTM once the documented merge order lands. Cannot merge yet (dependencies unmerged, CI red by design).

Verified

Dependency chain (all open, all mergeable=true, no conflicts):
acp-kernel #278 → #279 → pi #428 (v0.1.69, pin 0.0.68) → this PR. npm has 0.0.69-pr.279.142 (prerelease) but no stable 0.0.69 — matches your CI note. #279's head (6f108b4) contains #278's feat commit (92f37e0), so its build is a valid stand-in for published 0.0.69.

Kernel contract (inspected src/report.ts @ #278): StatusReportOptions.meta?: { pack?, packVersion?, host? }; renders ACTIVE SURFACE: pack=X vY | host=Z in both overview and compressed drilldown — exactly as this PR declares. Host-declares/kernel-renders split is consistent with the #730 rationale.

Local validation against the #279 branch build (installed via prerelease, then overlaid the local dist per AGENTS.md §5; temp pin reverted after, tree clean):

  • npm run typecheck — clean
  • npm test — 801 pass / 0 fail / 6 skipped (env-dependent skips)
  • npm run build — bundle OK, kernel inlined, ACTIVE SURFACE present in dist, CURRENT_VERSION define correctly substituted (no bare identifier left)
  • Smoke test: resolveSurfaceMeta({}, cwd) → {pack:"default", host:"billion-context-pi dev"} (dev fallback works outside tsup define); with meta, overview line 1 = ACTIVE SURFACE: pack=lean v1.0.0 | host=billion-context-pi 0.1.68, same line in compressed drilldown.

Cherry-pick integrity: b92e0c6 here is byte-identical to b45b22f in #428 (patch diff empty). After #428 merges, rebase will drop it as already-applied — expected.

Diff cleanliness: 8 files, every line on-purpose; no version bump in the feature commit (correct per spec); lockfile intentionally stale and documented in the PR body. No unrelated/generated churn.

Non-blocking observations

  1. SessionStateStore.getActivePack() has no production consumer yet (tests only). Fine as the symmetric read API for forensics — no change made.
  2. First-turn stamp edge: setActivePack() only updates an existing cache slot, and the slot is created by store.load() during the first context event, which fires after the first before_agent_start. So the turn-1 stamp is dropped and the sidecar gets activePack from the second agent start onward (i.e., any single-shot headless session never gets stamped). Acceptable for /acp and acp_status should show the active prompt pack; sidecar should persist it #431's forensic goal — marathon interactive sessions always hit turn ≥ 2, and it's explicitly best-effort ("persisted on next save") — but noting it so the limitation is on record.

Merge gating (human-only)

  1. Merge acp-kernel feat(guardrail): generic same-arguments tool-call loop breaker #278 → [Feature Request] 使 acp_delegate 超时和嵌套深度可配置 #279, confirm npm view acp-kernel version → 0.0.69.
  2. Merge pi release v0.1.69 #428 (v0.1.69, pin 0.0.68).
  3. Rebase this branch on the new master (drops the duplicate cherry-pick) or npm install here to refresh the lockfile to 0.0.69, verify CI green, then merge.

中文摘要:审核通过——依赖链状态、kernel 侧 meta 契约、本地 typecheck/测试(801 过 0 败)/打包均验证无误,cherry-pick 与 #428 逐字节一致,diff 干净无跑题改动;两个非阻塞观察(getActivePack 暂无生产消费者、首个 agent-start 的 stamp 在一次性 headless 会话中不会落盘)已记录在案;按既定顺序合并 acp-kernel #278/#279 与 pi #428 并刷新 lockfile 后即可合并。

@ranxianglei ranxianglei reopened this Sep 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Extension Artifact

Branch: feat/status-surface-meta (9ad0604)

Option A — Install from npm PR tag (recommended)

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

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

This comment is automatically updated on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

Closing in favor of a correctly named branch (2026-09-13_status-surface-meta) — content identical, required by pr-validation branch naming rule.

@ranxianglei
ranxianglei deleted the feat/status-surface-meta branch September 13, 2026 12:40
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.

/acp and acp_status should show the active prompt pack; sidecar should persist it

1 participant