Repository navigation
feat: lane-less <bili-durable> self-declaration marker for durable-state carriers (#2555) - #2557
ranxianglei wants to merge 4 commits into
Conversation
…e carriers (#2555) The dsh lane permitlist (#2419/#2447/#2481/#2446) is closed-world: it grows only when a human ships a bili release and structurally cannot fire in proxy mode (no lane identity on the wire) even for the four carriers it knows. This adds the injector-side declaration protocol from the #2446 owner decision: any host core or third-party plugin stamps its durable-state message's FIRST LINE with the namespaced bili-durable marker (free-text kind attribute, self-closing accepted, payload from line two) and bili honors it in EVERY session — plugin lane and proxy mode alike, no registry entry, no evidence bar (the injector opting in IS the evidence). The marker lives in the content, so it survives the whole replay surface where out-of-band protection state dies: fork raw-replay (#2383), machine export, any host re-sending history. Tag-name boundary is exact (a suffixed lookalike tag has not opted in); a marker mid-prose or inside a wrapper does not pin. Lane table unchanged and frozen as legacy fallback. Zero kernel change — same Config.isMessageProtected hook.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2757-pr.2557.8a6286bThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2557.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 PR #2557( 结构化八问
验证记录:本地定向套件 21/21 绿(新增 5 + 回归家族 16),typecheck clean;CI 各 lane/e2e/guard job 全绿,含 real dsh headless profile lane 与 dsh plugin lane(fork adoption)— 覆盖 PR 所述「本机 dsh-native 环境性挂起」的保留项。测试质量:真 server + 经 两条非阻塞观察:① CRLF 边界——首行以 判定:代码、测试、方向均成立;最后一个 CI job 转绿后即可合并(人工合并)。 |
[bot] 🏷 补一条:最后一个 CI job( |
…nchor (#2555) The first-line anchor splits on \n only, so a CRLF-emitting injector's marker line ended in \r and failed the end-of-line > check — the marker silently did not pin, which is exactly the silent-protection-failure class this protocol exists to close. Strip the trailing \r (terminator, not content) before anchoring. Behavior change: messages whose first line is the marker followed by CRLF are now pinned where they previously folded; no other input changes outcome.
…arker co-pin in one session (#2555) The issue's test plan requires the dsh-lane combination to hit all four legacy shapes; the existing composition test injected only the marked message. Extend runFoldScenario with optional carriers (injected inside the fold range, BLOCKED count computed unconditionally) and add the five-protected-message scenario: available_skills catalog, Instructions from:, Current runtime context, mcp_catalog and the bili-durable marker all survive one real fold, each stamped BLOCKED at assignment.
[bot] 🏷 Audited this PR line-by-line against the #2555 protocol spec. Implementation is complete and correct; two small gaps found and fixed as labeled additive commits on this branch:
Local verification: typecheck clean; new suite 6/6 + regression family (#2419/#2447/#2481/#2446) 16/16 green. CI on the original head was fully green (26/26); CI on the new head is running — first 12 completed checks green, remainder in flight. |
…-file creation (windows-22 flake, #1968 class)
What
Implements the
<bili-durable>self-declaration marker protocol (#2555) — the owner-approved layering from the #2446 discussion: marker as primary channel, protect-tool as auxiliary (#2556), the dsh lane permitlist frozen as legacy fallback.Any injector (host core, third-party plugin) that emits durable state as an ordinary conversation message stamps the message's first line with the namespaced marker; bili honors it in every session — plugin lane and proxy mode alike.
src/durable-message-guards.ts:biliDurableMarkerGuard— text-only, first-line anchored (\x3cbili-durableexact tag-name boundary: next char must be>,/or whitespace — a suffixed lookalike tag has not opted in), closing>on the same line covers attributed and self-closing forms;kindis free-text diagnostics, never parsed. Deliberately NOT in the lane-keyed registry (open-world opt-in vs closed-world permitlist).src/server/handle.ts:1741: wire path now composeslaneGuard || markerGuard; with no lane the marker guard applies alone — the proxy-mode shape from compress 增加按内容标记的硬排除(protectedContentMarkers),保护会话的基础设施注入免于折叠 #2446 where NO lane guard could fire.src/session.tseffectiveConfig(): read path (plugin tool / nudge panel) mirrors the same composition; clone-safe discipline unchanged (guard attached at read time, never persisted).Config.isMessageProtectedhook as feat: message-level protection hook + dsh durable-state guards (skill catalog #2419, workspace instructions #2447) #2428/fix: pin dsh mcp_catalog durable-state carrier (#2446) #2547.Why content-embedded, not an API
The marker travels with the message through every surface where out-of-band protection state dies: fork raw-replay (#2383 — new session id, full raw history resend), machine export / conversation transfer, any host re-sending history, and proxy mode (no plugin channel to call). Protection bound to content is replay-self-healing; a
protectcall is session state that forks forget. The auxiliary tool still exists as #2556 for content-zero-pollution / pre-registration use cases, with the marker documented as durable truth.Tests
tests/issue2555-bili-durable-marker.test.ts(5 tests): unit matrix (documented shape / unattributed / self-closing / marker-only pin; marker mid-prose, inside a wrapper, lowercase prose, lookalike suffixed tag, non-text, undefined, empty stay foldable; registry still dsh-only) · lane-less proxy-shape session (no plugin headers — #2446 reporter's exact config): real fold via/__bili/plugin/tool, marker + payload survive positionally-covered fold, BLOCKED ref stamped at assignment time · identical content WITHOUT the declaration folds away (pins the marker as the trigger) · dsh-lane composition (marker and legacy carriers co-protected) ·effectiveConfigread path stamps BLOCKED on a no-lane session.Regression: #2419/#2447/#2481/#2446 families 16/16 green; effectiveConfig/durable-adjacent suites (auto-restart, logger-epipe, store, web-logs-view) 38/38 green;
npm run typecheckclean. dsh-native not runnable on this machine (known environmental hang, CI covers it).Fixes #2555