Skip to content

fix(packs): lean recall rules aligned with pre-lean semantics - #400

Merged
ranxianglei merged 1 commit into
masterfrom
fix/lean-recall-alignment
Sep 12, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
fix/lean-recall-alignment

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Fixes #399

Session 01a095bf: 8s after a textbook-correct compress (45.9K reclaimed, active work protected, dense summary), the model ran search_context to recall its own task. Cause: lean rules 4/7 promoted search_context to the primary recall action and mandated pre-reliance verification — the model obeyed.

Changes (3 rules reworded, lean stays 8 single-line rules)

  • Rule 3 + "a good summary is the primary carrier and makes recall unnecessary"
  • Rule 4: "Prefer search_context before decompressing" → "Recall on demand only: when YOU genuinely need detail lost in compression, decompress (block id or message ref); search_context locates the right block first; acp_status shows ranges and usage. Never run recall as a routine post-compress step."
  • Rule 7: "Search or decompress before relying on critical details" → "treat them as settled history and continue the task from them"

Restores the 0.1.67 default semantics (decompress-centric, search as locator) while keeping lean's compactness.

Session 01a095bf showed a post-compress search bounce: lean rules 4/7
promoted search_context to the primary recall action and mandated
pre-reliance verification, so the model ran recall as a routine
post-compress step. Rule 3 now states the summary is the primary
carrier; recall is decompress-centric and strictly on-demand;
search_context only locates the block; summaries are settled history.
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Extension Artifact

Branch: fix/lean-recall-alignment (5c570ad)

Option A — Install from npm PR tag (recommended)

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

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

This comment is automatically updated on each push.

@ranxianglei
ranxianglei merged commit fbbeb4c into master Sep 12, 2026
8 of 9 checks passed
HangxiangMa pushed a commit to HangxiangMa/billion-context-pi that referenced this pull request Sep 21, 2026
…lignment

fix(packs): lean recall rules aligned with pre-lean semantics
HangxiangMa pushed a commit to HangxiangMa/billion-context-pi that referenced this pull request Sep 21, 2026
…acks

Fixes ranxianglei#401

- src/packs/* deleted (229 lines): types/sanitize/lean/builtin/dir all
  live in the kernel now (acp-kernel ranxianglei#259/ranxianglei#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 ranxianglei#399/ranxianglei#400)
- acp-kernel pinned 0.0.65 -> 0.0.66 (exact)
- 792 tests: 789 pass / 0 fail / 3 skipped (pre-existing); typecheck+build green
ranxianglei added a commit that referenced this pull request Sep 25, 2026
… acp-kernel 0.0.90 (#540, #535 go-live)

- #540: compress receipts and the tier3-only rewrite selected 'new' blocks
  with slice(-blocksCreated); an in-place refold keeps its original array
  position, so refolding b1 of [b1,b2,b3] presented b3's stale summary as
  the new one. Selection now diffs before/after runIds (every applyCompression
  assigns a fresh runId to created AND refolded blocks) — exact for both
  shapes. Regression test: two blocks, inline-restore the non-tail b1,
  re-compress its span, assert span clause + fingerprint line reference b1's
  NEW summary, b2 untouched, still exactly two persisted blocks.
- pin acp-kernel 0.0.86 -> 0.0.90 (real install, overlay retired): ships
  refold-in-place (kernel #403) + full-log resolving (#400), making #535 P2
  live end-to-end.
- viable-ranges test now feeds well-formed CoreMessages: 0.0.90's syncBlocks
  (subid coverage, kernel #233) dereferences message.id via baseIdOf and
  throws on id-less host-shaped entries where 0.0.86 silently tolerated them
  (kernel-side guard filed separately).

Gates: typecheck ✓ · 944 tests / 941 pass / 0 fail / 3 skipped · build ✓

Fixes #540
HangxiangMa pushed a commit to HangxiangMa/billion-context-pi that referenced this pull request Sep 29, 2026
…ecompress re-fold hint (ranxianglei#535 P2)

P1: compress success panel appends one fingerprint line per created/updated
block computed from the stored (round-tripped) summary: exact charLen,
head 30 chars, tail 100 chars, newlines flattened to spaces.

P2: decompress with inline:true ends its tool result with the frozen re-fold
hint carrying the kernel's K1 refs (restoredStartRef–restoredEndRef, blockId);
degrades to a generic hint when fields are missing (pre-feature kernel).
File/toFile modes are byte-identical to before. The inline restore also calls
kernel markBlockRestoredInline so the sidecar flag makes later refolds update
the block in place.

Refs frozen contract P1/P2 (refold/spec.md), issue ranxianglei#535. Full e2e refold
acceptance is pending the acp-kernel full-log-host gate fix (ranxianglei#400, follow-up
to ranxianglei#398/PR#399) — see PR body.
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.

Post-compress search bounce: lean pack promotes search_context to routine recall

1 participant