Repository navigation
[PR] chore(batch): land 7 open BBleae fixes in one history-preserving batch - #6455
Merged
Merged
Conversation
…ions and keep it when rewriting
pnpm appends a peer-resolution suffix to an importer's resolved version
when the package or one of its dependencies has a satisfied peer:
`version: 0.1.213(@types/node@16.9.1)`. The ledger code took the whole
scalar for the version. A healthy profile was reported as copy-vs-lock,
and convergence (`bili doctor --fix`, the pass after an in-place update)
rewrote the line to the bare version: a write where nothing had drifted,
leaving the importer without the suffix its snapshots key carries.
- splitPeerSuffix(): split the scalar at the first "(".
- readPnpmLockResolution returns the version without the suffix, so the
state and the findings carry a plain version.
- patchNestedEntries compares the version part only; when the version
really moves it swaps that part and keeps the suffix and the quoting
the line already had.
- tests/issue3496-dsh-ledger-convergence.test.ts: v9 fixture with a peer
suffix; healthy triple gives no finding and zero writes; real drift
changes only the two importer lines and keeps the suffix; multi-peer,
quoted and v6-v8 nested shapes.
packages:/snapshots: stay untouched as before (#3509, #3570).
(cherry picked from commit 9ae09b3)
…ccept a numeric blockId acp_rewrite only checked "non-empty" and "not identical", so it stored summaries compress refuses for the same block: over compress.maxSummaryLength, under compress.minSummaryLength, or larger than the content the block folded. The stored summary rides in the resident view on every request, so a block could end up costing more than the messages it replaced. executeAcpRewrite now judges each rewrite before the kernel call: - compress.minSummaryLength / maxSummaryLength of the resolved config (0 or absent = unbounded, as in compress), with compress's wording; - net shrink: a summary not smaller than the folded content (compressedTokens, defaultCountTokens) is refused, unless it shrinks the summary it replaces; - unknown/inactive ids and blank or identical text keep the kernel's existing reasons; in a batch the other items still land. blockId also accepts a non-negative integer (single form and items), the way acp_retire / acp_restore already do; before, a number was read as a missing argument. Host-side only; kernel/** is untouched. Docs line for compress.blockOps updated in both languages. (cherry picked from commit 8cffeaf)
…vement' exception (#6319) The net-shrink refusal in executeAcpRewrite has an exception: a rewrite that shrinks the summary it replaces is always allowed, even when the stored summary was already larger than the folded content. The PR's two new tests cover the refusals (too long / no net shrink / too short) and the numeric blockId, but not this exception branch. Add a case that pins it so a future tightening of the check cannot silently start refusing bloat cleanup. (cherry picked from commit 59d1e98)
…mote reason/summary acp_status prints an advisory's id + reason on its CRITICAL ADVISORY line and one line per release-note summary under CRITICAL UPDATE, straight into model context. Both parsers kept that text as-is apart from a trim: no length cap, line breaks preserved. Bound it where the documents are parsed (boundedLine in text-safe.ts): whitespace / control runs become one space, over-long text is cut on a code-point boundary and ends in an ellipsis. Entries are kept, never skipped. Caps: summary / summaryZh 400 (the producer-side contract), reason 500, id 80. Text inside the bounds is unchanged. (cherry picked from commit d5248f1)
…g the client caps (#6306) The release-notes workflow already rejects summary/summaryZh over 400 chars at publish time; the advisories workflow had no length check at all, so an over-long reason/id would ship and only get truncated client-side (and the truncated id would then collide in the per-process warn dedupe). Same mechanism as the client caps in this PR — one producer-side mirror, same numbers (id 80, reason 500). (cherry picked from commit 7b7b337)
…matching entry archiveSession appended the session's export line to archive.jsonl and only then ran the sweep transaction. When the sweep failed (write lock held by another process past busy_timeout, a constraint error), the line stayed in the log while the session stayed active and kept growing. The next successful archive appended a second line; restoreArchived took the first matching line, i.e. the stale one, and then removed every line of that session, so the newer export was lost. Each failed attempt (gc retries included) also added another full copy of the session to the log. - archiveSession (sqlite + mysql): serialize the line before the sweep, append it as the last step inside the sweep transaction. A sweep that cannot start or fails midway writes nothing; the line is still on disk before COMMIT, so a committed sweep always has its export. - restoreArchived (sqlite + mysql): scan the log from the end so the newest line of a session wins, and warn when more than one line of that session is dropped. Logs written by earlier versions can already hold such pairs. - tests/storage-archive-failed-sweep.test.ts: 4 cases (failed sweep leaves no line and the later archive restores in full; newest line wins; both for sqlite and for the mysql backend on a stub driver). (cherry picked from commit 047da26)
…elf in place (#2082) The #2082 boot smoke (PR #2091) was wired into refreshDshDesktopCopy only, the lane where another bili process refreshes the dsh desktop profile copy. When the running proxy IS that copy, hostManagedInstall exempts the layout (#1575) and the copy updates itself through the plain self-update lanes: checkForUpdate (periodic check, `bili update`) and forceInstallVersion (advisory force-install, web-panel install). Both called installViaTarball without bootSmoke, so a tarball whose entry parses but throws at load was swapped into the copy dsh respawns its plugin from. Arm the smoke on both lanes when the install dir is the dsh desktop copy. Other install layouts keep their current behaviour. (cherry picked from commit 4e7ac09)
…eally gets INCREMENTAL
SQLite only honours PRAGMA auto_vacuum while the database file is still
empty. storagePragmas() switched to WAL first, which already writes
page 1, and issued auto_vacuum = INCREMENTAL last, so every newly created
index.db kept auto_vacuum = 0. PRAGMA incremental_vacuum
(gc({vacuum:"incremental"}), `bili storage gc --vacuum incremental`,
?vacuum=incremental) then reclaimed nothing: the freelist only grew and
the file never shrank without the offline full VACUUM.
- storagePragmas(): auto_vacuum is now the first pragma, with a comment
on why it has to stay there.
- gc() doc comment: describes what incremental does and when it is a
no-op (comment only).
- tests/storage-auto-vacuum.test.ts: pragma order; a new index.db reads
auto_vacuum = 2; fill, delete, gc(incremental) empties the freelist and
shrinks the file; a file created the old way stays at 0 until one full
VACUUM converts it.
Existing databases are not migrated: on a non-empty file the pragma only
takes effect at the next full VACUUM.
(cherry picked from commit d5a52e0)
applyRanges set session.pendingLedgerAlign right after committing the kernel's returned state, before the blocksCreated === 0 returns. A refused compress (range too small, cannot anchor, already compressed) and the no-op class armed the one-time #4316 alignment too, so the next save ran it after a call that folded nothing. Set the marker past those returns. A compress that created a block arms it exactly as before (#5608-D). (cherry picked from commit b3286db)
Contributor
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9346-pr.6455.8c49e2aThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6455.tgz
npm install -g packageInstall instructions are refreshed on each push. |
ranxianglei
force-pushed
the
bbleae-dry
branch
from
November 12, 2026 15:15
3ef9020 to
ad3cb8d
Compare
This was referenced Nov 12, 2026
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1181-master.259cd87 # this exact build
npm install -g billion-context@master # always the newest merged build
|
This was referenced Nov 12, 2026
Closed
This was referenced Nov 12, 2026
[PR] Degrade a second long-lived index.db writer to legacy-only instead of co-residing (#5064)
#5250
Open
ranxianglei
added a commit
to Louie0806/billion-context
that referenced
this pull request
Nov 14, 2026
(cherry picked from commit a7fe295) The code half of that commit was already on master via ranxianglei#6324/ranxianglei#6455, so only the regression test is added here.
ranxianglei
pushed a commit
that referenced
this pull request
Nov 14, 2026
…merge commit These files (issue-number lists recording the superseded closings of the previous four batches #6439/#6455/#6464/#6482) are present in neither parent of the #6574 merge commit yet appear in its result, and survive to the branch tip. They are not part of any source PR, are referenced nowhere, are not mentioned in the PR description, and the previous four batch merges never committed such files to master. Process scratch data does not belong at the repo root; the closing record already lives in GitHub history.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
chore(batch): land 7 open BBleae fixes in one history-preserving batch
Lands 7 of the 8 currently-open PRs from contributor @BBleae as a single,
reviewable batch. Every commit is cherry-picked with its original author, date and message
intact (
git cherry-pick -xappends aCherry-picked-from: <upstream sha>trailer, so eachcommit is individually attributable and can be dropped by the maintainer with an interactive
rebase if any one is ever disputed). The source PRs stay open and untouched until this merges —
after merge they will be closed as superseded.
Each change was line-by-line reviewed against the surrounding code (not just CI): storage
refcount/sweep semantics, the kernel's block-ops bounds, the pnpm lockfile format, and the
SQLite pragma ordering were all checked by hand.
What's in it (7 PRs, 9 commits)
1.2.3(@types/node@…)) when comparing lock versions, keep it verbatim when rewriting — lock comparison no longer oscillatesblockIdacceptedreasonand release-notesummary/summaryZhfrom remote documents are flattened to one line and capped (80/500/400 chars) at parse time; the publish side mirrors the capsnode --check)PRAGMA auto_vacuum = INCREMENTALnow set BEFOREjournal_mode = WAL— a brand-newindex.dbreally gets INCREMENTAL (SQLite only honors auto_vacuum while the file is still empty)<acp>tag'stime=attribute on the next saveVerification:
npm run typecheck— pass.tests/compress-refused-ledger-align.test.ts,tests/issue2082-self-update-boot-smoke.test.ts,tests/issue3496-dsh-ledger-convergence.test.ts,tests/issue5765-acp-block-ops.test.ts,tests/remote-text-bounds.test.ts,tests/storage-archive-failed-sweep.test.ts,tests/storage-auto-vacuum.test.ts(62/62).tests/event-loop-watchdog.test.ts("forensic lines stay OFF the worker's stderr") — a timing-dependent watchdog threshold test,
unrelated to that PR's storage changes; master's CI has been green since.
Notes:
acp_rewritecan now refuse a summary that compress wouldhave refused ([PR] fix(block-ops): acp_rewrite respects compress's summary min/max bounds and accepts numeric blockId | fix(block-ops): acp_rewrite 遵守 compress 的摘要上下限,并接受数字形式的 blockId #6315) — stricter by design, the receipt names the bound.
after this merges; [PR] fix(dsh): prevent the latest system prompt in history from being collapsed | fix(dsh): 让最新的历史内系统提示不被折叠 #6353 stays open and is being reviewed on its own.
To remove an individual fix from this batch: interactive-rebase out the commit(s) whose
Cherry-picked-from:trailer matches the upstream SHA; every fix is self-contained.Closes #6306
Closes #6317
Closes #6319
Closes #6320
Closes #6321
Closes #6323
Closes #6330