Skip to content

fix: stateless decompress — pure retrieval, no deactivate, cache retained (#400) - #426

Merged
ranxianglei merged 1 commit into
masterfrom
2026-09-01_stateless-decompress
Sep 1, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-09-01_stateless-decompress

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Fixes #400.

[Design decision by maintainer — supersedes this issue's original acceptance criteria] decompress is stateless copy-paste: it changes no state. The old "state transition" semantics (deactivate the block → originals re-enter the view → re-compress cycle) is rejected as a design error.

What changed

src/decompress-shared.ts resolveDecompress:

Why this kills the whole #400 bug family

All three root causes were state writes: syncBlocks re-activation clobbering the deactivation, cache deletion breaking repeat decompress, folded-view fallback divergence. With zero state writes there is nothing to clobber — no expanded flag needed, no kernel change needed (kernel core.decompress is a pure lookup; collectBlockContent is already documented as the stateless primitive). Matches the semantics acp-kernel documents for the pi host ("The compressed block stays folded").

Related

Tests

  • resolveDecompress: stateless — cache kept, block stays active, repeat is idempotent (flipped from the old "deletes the cache" assertion)
  • resolveDecompress: cache miss falls back to originals via compressMessages (new — covers the loop-path folded-view bug)
  • typecheck ✓ / 892 tests 892 pass ✓ / build ✓

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-09-01_stateless-decompress (1fb6b69)

Option A — Install from npm PR tag (recommended)

npm install -g billion-context@pr-426

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

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr426.tgz
npm install -g package

This comment is automatically updated on each push.

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

Labels

None yet

Projects

None yet

1 participant