The opt-in compress.imageCompression pass and its image_full restore
channel are structurally broken where they matter most:
- hosts that reject bili-injected tools (codex) can never deliver the
restore call — the downscale is permanent for them (#3270 disarmed
the lane, which proved the tool was dead weight there);
- where the tool IS injectable, the model has no reliable way to learn
the ref of the downscaled message (no ref annotations on the wire),
producing the 38-round guess-reject-resend loop from #3266 (cache
hit 75% -> 28%).
Remove the whole feature from host and kernel: arrival-time downscale
pass, image_full injection + sticky restore + fail-streak guardrail,
image stats, persistence keys, wire-contract tool variants, config
schema, docs, and the sharp optional dependency. Every image now passes
through byte-identical at original resolution.
Sessions persisted by older versions load unchanged; legacy
imageShrinks/imageFullRestored state keys and imageShrunk* stats are
ignored on load (storage corpus pins that as a fixture).
kernel 0.0.126.
Two concurrent full `npm test` runs on one machine corrupted each other:
cores-1 concurrency doubled the spawn/attach load so every 15s readiness
watchdog timed out (mass false-red), and daemons without a per-test
XDG_STATE_HOME shared ~/.local/state/billion-context (port-zone drift,
multi-instance alarms) — with ZERO detection of the sibling run.
Add scripts/test-suite-lock.mjs: an O_EXCL ("wx") lock at
$XDG_CACHE_HOME/billion-context/test-suite.lock holding {pid,ts,cmdline,cwd},
with liveness-only stale steal (kill(pid,0); never steal a live suite; no age
timeout — a local full run can exceed any fixed budget; a corrupt/truncated
file left by a SIGKILLed writer is reclaimable, not a permanent wedge).
`pretest` now prepends a non-owning `gate` so a second run refuses within
milliseconds BEFORE the build; `test` becomes an owning `run` wrapper that
holds the lock across the real suite and releases it on exit (plus a sync
backstop in the exit handler). BILI_TEST_FORCE=1 is the documented escape hatch.
Single-run behavior is unchanged: the wrapper reproduces the exact old
`node --import … --test tests/*.test.ts` invocation (same file set, no
concurrency cap added). Regression suite tests/test-suite-lock.test.ts pins
free / live-block / dead-steal / corrupt-reclaim, the <2s fail-fast acceptance,
force bypass, and release-on-exit.
Node's `exports` map is closed once declared, so require.resolve(
"billion-context/package.json") threw ERR_PACKAGE_PATH_NOT_EXPORTED. dsh's
client scanner uses that resolve to locate the package root before reading the
dsh.client declaration; its catch swallows the throw, the entry drops out of
the client module table, and the browser half (settings.section) never
registers — the settings page vanishes while the host half keeps working.
Add the "./package.json" self-mapping at BOTH writer locations of the same
mechanism (the published manifest and the `bili dsh` launcher shim) and pin
both with regression tests that reproduce the scanner's root-locate resolve.
Fixes#3043
A green suite over a retired module guarantees nothing about the wired
path: #2988 finding ① shipped while every persona-anchor pin stayed
green. New zero-dep gate scripts/check-test-import-graph.mjs BFS-walks
the tsup entry set and fails on any tests/** import of an unreachable
src module unless whitelisted (test-only registries marker/spec.ts,
exit-matrix.ts) or the importing file carries a 'retired-module pin'
label. Wired into ci.yml as the test-import-graph leg gating both
test and static-gates.
resolveStorageMode now lands on 'shadow' when neither storage.unified nor
BILI_STORAGE_UNIFIED is set: the JSON envelope stays the sole source of
truth (zero behavior change) while every session write is mirrored into
index.db with digest reconciliation — fleet-wide parity telemetry before
the full-mode default flip. Explicit legacy opts out; garbage still
degrades to legacy; engine-less lanes stay legacy-only (#2825 contract).
The test corpus runs on an explicit legacy baseline
(tests/preload-storage-baseline.mjs wired into npm test and
scripts/run-ci-tests.mjs) so the 600-suite wire/e2e corpus keeps its
legacy dir-shape assumptions; the storage family pins and overrides its
own modes, the resolveStorageMode matrices pin the new default, and the
web-sessions stamp test now asserts shadow for absent-everywhere.
Freezes the manual v0.1.196 review pass (PR #2962) into one command for
operator machines with live models — the regression lane GitHub CI can
never run. Executed before each release (reference/release.md step 5.5).
Lanes (hermetic scratch: own DSH_HOME/BILI_CONFIG_FILE/sessions/XDG/ports;
never touches ~/.dsh or running proxies; missing prerequisites skip with
a warning, GATE_* knobs in the script header):
- A compression: real dsh session reads a marker corpus at the real
window, then the route window shrinks mid-session (the field-report
"switched to a smaller-window model" lane) -> nudge INJECT -> preflight
fold -> SAME session answers from folded context, cache recovers.
A fresh oversized read tool-result is NOT expected to fold (protected
recent zone, #2847 fail-fast) — asserted as such.
- B model switch: same session resumed on a different model/upstream;
same lineage across switch + proxy restart (dsh resume-replay fork
WITH fork-adoption of the parent's folded blocks passes; an orphaned
pfa fails), cross-upstream usage-baseline demoted to untrusted when
cited (#2283/#2867), cache cold -> hot on the new upstream.
- U --with-update: dsh-managed install detection (no in-place self
update) + latest read from the configured update registry.
Green on 0.1.196: A 8/8, B 6/6, U 2/2 (~4 min, sglang + z.ai relay).
Windows-only update lanes (global installer, desktop-profile in-place
swap + spec converge, doctor) stay on the Win10 VM checklist appended
to reference/release.md.
pnpm >=10's strict build-script gate (strictDepBuilds) blocks any unlisted
install script as a hard error, so dsh plugin-market installs/updates on fresh
profiles failed with [ERR_PNPM_IGNORED_BUILDS] better-sqlite3. Unified storage
is OFF by default (legacy file persistence), so dropping the optional native
engine is low-impact: the driver already prefers built-in node:sqlite when the
native module is absent, and when no engine is available at all
UnifiedShadow.maybeOpen degrades to legacy-only (one warn, never bricks).
- package.json / package-lock.json: remove better-sqlite3 (sharp stays).
- src/storage/driver.ts: add setSqliteEnginesUnavailableForTests seam so tests
force the "no engine" path deterministically; keep the opportunistic
require("better-sqlite3") probe for hosts that still ship it.
- tests/storage-engine-proofs.test.ts: pin the contract -- maybeOpen -> null;
SessionStore runs legacy-only, writes survive, no index.db.
- CHANGELOG.md: [Unreleased] entry.
Gates green on this head: typecheck + targeted storage tests + build.
Closes#2823
v0.1.192 was a carve-out release (78df4eaa, #2664 only) and its version
bump never flowed back to master, so master still declares 0.1.191 while
npm latest is 0.1.192. That trips the Release one-click Drift guard:
::error::master package.json (0.1.191) != npm latest (0.1.192)
#2664's changes themselves are already in master (f0b3f5d6), so this is
metadata-only: bump package.json + package-lock.json (root and
packages."" entries) to 0.1.192 so the next one-click release (0.1.193,
carrying the #2755 fold-summary head-stability fix) can proceed.
A hard better-sqlite3 dependency made npm install fail on hosts without
a build toolchain (Windows runners: node-gyp cannot find VS; CI codex/
registry e2e legs went red). The driver already probes it lazily and
falls back to node:sqlite, so the package now sits in
optionalDependencies next to sharp. When absent, the unified store runs
on node:sqlite and the better-sqlite3 corpus leg skips loudly instead
of failing (createRequire-based availability probe in the test).
package.json "files" gains the English paper and its six figures
(~1.0 MB on top of the 26 MB tarball). The Chinese edition and
make-figures.py stay repo-only. Verified via npm pack --dry-run.
The semver alone cannot distinguish a locally-installed test build from the
npm release with the same version number (exactly the situation while trialing
an unmerged fix). Add BUILD_COMMIT and render it wherever a human reads a
version:
- bili --version → "0.1.187 (8f9faf9e)" (first token stays bare semver;
all in-repo consumers match by regex, none compare equality)
- /acp panel host line → billion-context 0.1.187 (8f9faf9e)
- web UI header + overview row → v0.1.187 (8f9faf9e) / "0.1.187 (8f9faf9e)"
- /__bili/health and /__bili/overview → additive "commit" field
Resolution: bundled code reads dist/build-info.json stamped by
scripts/write-build-info.mjs at build time ("-dirty" suffix when the worktree
has uncommitted changes); dev (tsx) asks git directly; "unknown" otherwise.
The updater, advisory watcher and MCP serverInfo keep comparing/announcing
bare package.json semver — display-only, zero update-path impact.
Ports the gate from PR #1443 to current master: npm script check:unused-exports
plus a zero-dep CI job. Adapted since the original: scans exclude kernel/ (its
own package with its own suite and human-gated boundary) and the entry list
gains src/agent/dsh-native-client.ts to match the second tsup.config.ts entry.
Wire the acp_delegate sub-agent surface (tools + /acp-fleet command +
fleet shortcut + status widget + read tracking + prompt append) into the
native pi extension via the package's embedder contract: markEmbedded()
claim, manual building-block wiring, tsup noExternal inlining, and an
esbuild alias stub for @earendil-works/pi-coding-agent so the package's
only value import (CONFIG_DIR_NAME) falls back to the documented ".pi".
- agent-gated (pi only; omp lane untouched), single-writer vs a
standalone billion-context-pi-subagents install
- devDeps pinned exact: billion-context-pi-subagents 0.1.1,
@earendil-works/{pi-coding-agent,pi-tui} 0.83.0 (typecheck-only)
- dist/index.js + dist/mcp.js import graph unchanged (zero-dep contract)
tests/dsh-settings-ui.test.ts dynamically imports esbuild (lines 241/387)
but it was never declared — resolution worked only because npm hoists
tsup's transitive esbuild@^0.27.0 to the top level. Under pnpm (strict
layout) or any non-hoisting install, tsc fails with TS2307 at both import
sites, red-lining local typecheck on a non-bug cause.
Declares "esbuild": "^0.27.0" (same range tsup 8.5.1 already declares);
npm dedupes to the same 0.27.7 instance, so the lockfile diff is one line
and no version moves. Pure declaration change — dist never references
esbuild at runtime (build-time tool consumed by tsup only).
Closes#2009
Closes#1970
- package.json: npm run typecheck now targets the root tsconfig.json
(include: src + tests) instead of tsconfig.build.json (src only);
all four CI workflows inherit the widened gate via the script.
- tsconfig.json: lib ES2022 -> ES2024 (type-only; tests use
Promise.withResolvers & co.; src stays clean under it; no effect on
tsup/esbuild output).
- 276 test files: type-level-only fixes (import sources, missing
fixture fields filled with src-default values, narrowing, explicit
annotations, single-expression casts). No assertion changes, no
runtime behavior changes.
- src/agent/dsh-acp.ts: export CommandOutcome / CommandsService types
(type-only; erased at build).
The rebase onto dfca5a9f resolved package.json from the PR side for three
lines that must come from master: version 0.1.180 (content commits never
touch version; merging 0.1.179 would downgrade master), acp-kernel 0.0.100
(exact pin follows master), and the test:e2e:image script (#1843/#1857).
Lockfile re-synced from master plus the ws dev-deps.
The steady request path (client echoes the round back) silently dropped
redacted_thinking blocks because anthropicToCore had no case for them, so
every later request rebuilt the latest assistant message without the block
and Anthropic answered 400 "cannot be modified" forever — the half of #1960
that kept the session stuck after the compress turn.
- acp-kernel pin 0.0.99 → 0.0.101 (exact), which carries kernel PR #500
(redacted_thinking sidecar round-trip). Also rides along from v0.0.100+:
#483 ref capacity widened to 9,999,999, #484 case-insensitive protected
tool matching, #478 nudge cadence re-anchor, #493 language-preservation
behind an opt-in flag (default off), and #499 prune/recommend shared
per-turn index (hundreds of ms saved on ordinary requests in large
sessions — release-note material).
- tests/issue1960-steady-redacted.test.ts: client-echoed
[thinking(sig), redacted(data), tool_use] must survive prepare→outbound
byte-identical in order. Verified failing on 0.0.99, passing on 0.0.101.
Preflight: typecheck clean; targeted loop/thinking/reasoning suites 186/186
green incl. both new #1960 files; build OK.
tests/e2e/e2e-image-billing.test.ts synthesizes a corpus of structurally
real images in pure Node (valid PNG/JPEG/WebP/GIF containers, real dims,
4.7MB 4032x3024 photo, EXIF orientation, truncated + garbage blobs) and
drives it through the real billing pipeline against a mock upstream billing
the Qwen2-VL formula. Pins the three #1857 failure classes: parser truth,
the >=700x bytes-prior poison ratio, and the learned-cost rescue (12.6MB
arbitrated forward -> usage teaches per-image cost -> stale-high usage
baseline no longer bricks the session -> baseline regresses to real
billing) plus the default auto->pixels route riding a malformed blob.
Runs ungated (~1s, zero network, zero tokens): npm run test:e2e:image.
CI: .github/workflows/ci-image.yml auto-runs on PRs touching image/window
-gate surfaces (src/image-*.ts, preflight, server, cache-ledger, kernel pin).
- acp-kernel 0.0.99 → 0.0.100. Brings four kernel changes:
* ak#484: matchToolPattern is case-insensitive — fixes#1725
(opencode "read" vs Claude-style "Read" protectedTools entries
silently never matched, so their history could be folded).
* ak#496: ref capacity widened to 9,999,999, hybrid widths (#483) —
long side-request sessions no longer burn out at m99999.
* ak#495: language preservation prompt rule, kernel-side opt-in only
(exposing a bc config knob is a follow-up decision).
* ak#479: nudge cadence re-anchors when the live count drops below the
shown reference (#478) — the kernel-side fix for the class bc#1595
patched around.
- tests/protected-tools.test.ts: new regression — "Read" pattern protects
opencode's lowercase "read" pair end-to-end (BLOCKED refs, fold carve-out,
survival). Verified it FAILS on 0.0.99 and PASSES on 0.0.100.
- tests/issue1595-nudge-reanchor.test.ts: with ak#479 the kernel retires
the phantom reference inside the nudge node before bc's usage-settle
hook runs, so the bc log line legitimately disappears; the invariant
under test is now the end state (phantom never survives a real usage
report), log asserted only when bc is the retiring side.
Local: typecheck ✓ build ✓ full suite 3591/3571/1/19 pre-adaptation (the 1
failure was this test's outdated log expectation), 16/16 after.