Repository navigation
fix: side requests under public-fork children ride the #388 passthrough (#2157 follow-up) - #2164
Merged
Merged
Conversation
…gh (#2157 follow-up) #2157 keyed side requests verbatim (sideRequestLike) but kept the lane's !publicForkPrefix veto, so a full-history-replaying side call (dsh title-gen under a forked conversation: the host resends the ENTIRE current history plus the title instruction, so the inherited-prefix receipt always matches) ran the FULL pipeline on the fork child's MAIN session — junk turns into the snapshot, usage-baseline pollution (#1916 class), stats inflation. Pre-#2157 the same request forked onto an isolated |sub:<fp> junk session (ugly but clean). The receipt's first-request 409 discipline has already accepted the request, and side requests read none of the kernel state fork adoption maintains, so the veto had nothing to defend — drop it for intent-certain side identification. demotedSide keeps its own veto (leak-shape heuristic can false-positive a fork child's early mainline turns).
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2213-pr.2164.bfe0ef8This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2164.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Merged
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.40-master.6f0cdfc # this exact build
npm install -g billion-context@master # always the newest merged build
|
This was referenced Oct 5, 2026
Closed
yingzhongshuoqi
pushed a commit
to yingzhongshuoqi/billion-context
that referenced
this pull request
Oct 5, 2026
… runtime canaries, CI lane guard (ranxianglei#2170) Measures 1/2/4/5 from ranxianglei#2170 (measure 3's recorded golden fixture stays a follow-up; the e2e lane itself ships here): - demoteGate()/resolveSideLane() extracted into src/server/side-request.ts as pure functions; server.ts wires them with the detect/strip effects still lazily short-circuited. resolveSideLane takes no fork input (the ranxianglei#2164 structural guarantee); demoteGate keeps the !publicForkPrefix veto. - tests/side-lane-truth-table.test.ts: exhaustive tables pinning both gates and the reason strings. - tests/side-lane-invariants.test.ts: observation-transparency, seeded ordering-fuzz vs main-only baseline, splitSessionWarnings unit. - Runtime canaries: post-lane SIDE-EFFECT LEAK counter on the session + /__bili/status splitSessions warnings (the ranxianglei#2165 shape). - ci.yml lane-guard job; new ci-e2e-dsh.yml dedicated dsh plugin lane.
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.
What
Follow-up to #2157 (fix for #2156/#2160). #2157 keyed side requests verbatim (
sideRequestLike) but left the #388 lane's!publicForkPrefixveto in place — those two gates moved apart, opening a regression window:A full-history-replaying side request under an ALREADY-ANCHORED public-fork child now runs the FULL pipeline on the child's main session.
Why that fires in the real world
dsh title-gen is exactly that shape: the host resends the entire current history plus the title instruction, on the anthropic wire (top-level system, messages replay the raw conversation) — so
publicForkInputMatchesalways matches and the receipt branch accepts the request. Then:!publicForkPrefixfails) →processTurn/ usage capture / snapshot growth run;sideRequestLike=true→ verbatim child key (no|sub:<fp>isolation anymore).Per side call under a forked dsh conversation: junk turns recorded into the snapshot, usage baseline polluted (#1916 class — the title's full-history token count becomes the session baseline),
stats.requestsinflated. Pre-#2157 the same request forked onto an isolated|sub:<fp(side)>junk session — ugly but clean.Fix
Drop the
!publicForkPrefixveto for intent-certain side identification in the #388 lane (src/server.ts): the receipt's first-request 409 discipline has already accepted the request (matched prefix, or live child traffic), and a side request reads none of the kernel state fork adoption maintains — the veto had nothing to defend.demotedSidekeeps its own!publicForkPrefixveto deliberately: the all-bili-tools leak shape is heuristic, and a fork child's early mainline turns (raw inherited prefix, no artifacts yet, no agent header) can false-positive it. Only a declared side agent (title) or a tool-less tiny budget diverts under a receipt.Test
tests/fork-side-request-lane.test.ts(new): fork parent→child, one child main turn (anchors), then an agent=titlefull-replay request. Asserts:stats.requests, snapshot revision,/__bili/plugin/statususage/context estimate all unchanged;pluginSnapshot;Evidence (local repro, master 8b62bd7)
requests=1, rev9f0c…,inputTokens=10000, compressiblem00001–m00004requests=2, reve486…,inputTokens=20000, compressiblem00001–m00005— the title turn recorded as conversation contentPre-flight
npm run typecheck✅Release coordination
Merge this before #2161 (v0.1.185 release PR) so the release carries the fix — the release branch merge will pick up master. The v0.1.185 release-notes entry (critical tier, #2156 headline) is unaffected.