Repository navigation
[PR] feat: plugin-lane server-owned history — msgid pinning + transcript render endpoint | 插件车道服务端正史:msgid 钉身份 + 正史渲染端点 - #4505
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.5434-pr.4505.fb07b63This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4505.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…orts gate #1440 P6) loadMarks, VanishReason, VanishedEntry, AlignStats, AlignOptions and MsgIdValidation are referenced only inside their declaring files — drop the leading `export` per the gate's INTERNAL_ONLY prescription. Pure visibility change, zero behavioral diff.
(ai: vllm-qwen/qwen3.8-27b) 接单。这是 agent 已完成的 [PR](Closes #4491),不重做——进入核对流程:拉分支读代码、跑定向验证、看 CI、按八问出独立审核结论。 查重: 不重复 —— open PR 里引用 #4491 的只有本 PR;无同机制并行条目(宿主 id 可达性审计是本 issue 的前置研究,PR 正文已含审计结论表)。 标签: CI 初查(head |
|
在 daemon 的基底(2e26e6a)上补了车道流 e2e 覆盖(58fa0f5):msgid-pin / msgid-algebra / plugin-render-endpoint 三套钉的是校验、纯函数和端点,缺的是带 id 的完整 turn 流。新增
rollout 关时的行为也钉了:lane 仍接受 msgIds 钉内存 canonical,但管线会话/行走内容派生 h_ id——两态都是设计内。门全绿(18+58 桩/测试,tsc 0,unused-exports clean——六符号 0627cfa 已先行收口)。 |
…aneServerHistory (docs-sync gate) The PR hand-wrote the pluginLaneServerHistory row into the generated param-ref blocks of CONFIGURATION.md / CONFIGURATION.zh-CN.md without adding the matching entry to website/config-reference/rollout.yaml, so gen-config-docs regeneration deleted the rows and git diff went red. Add the seed entry (the sanctioned source of truth), regenerate, and commit the generated state. Regeneration normalizes the ZH default cell from 0(关) to 0 (off) — the generator has one default field per entry, and every sibling ZH row already carries its English default — and drops backticks from the descriptions, which the seed validator forbids. Also adds the BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY row to both env-map tables.
(ai: vllm-qwen/qwen3.8-27b) docs-sync 红已修:4d9ff5a,叠在你刚推的 58fa0f5 之上(分支现序:2e26e6a0 → 0627cfa unused-exports 收口 → 58fa0f5 lane-flow e2e → 4d9ff5a docs-sync)。 是什么问题:docs-sync 门禁 = 修法:补上缺失的种子条目(key/type/default/env/group/desc_en/desc_zh 齐全,env 名按 八问:
文档措辞差异披露(行为变更类,按规上报):
lane-flow e2e(58fa0f5)已确认在本分支基底内,我的修复不触碰任何测试/源码文件,只动种子 + 两个生成产物。等 CI 全绿即可合。 |
…nder endpoint, rollout gate (#4491) Server-side core of the plugin-lane server history design (owner-finalized 2026-10-24): clients become event sources, the unified transcript becomes the identity authority. - rollout: new gate pluginLaneServerHistory (default 0%; env force-on BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY); documented en+zh - msgid-pin: biliMsgIds body channel (always stripped pre-upstream; strict validation: reserved acp_summary_ prefix, duplicates, control chars, oversize, length mismatch) - prepare-anthropic: plugin-mode turns pin client ids onto the converted core messages; id-set algebra observation (vanish reasons compressed vs deleted, generation-switch detection) logged + bounded metadata counters - msgid-algebra: pure append/tombstone-reason/epoch judgment layer over ordered id lists (store keeps doing the mechanical row work) - incremental lane: optional msgIds parallel to messages (poison shapes hard-fail 400, count mismatch degrades); assembled bodies re-stamp the canonical ids; probe advertises serverHistory - plugin-render: POST /__bili/plugin/render {conversationId, untilSeq} — loopback-only, serves the prefix rendered from the unified transcript (fold regions collapse to anchors past each block's last covered row), degrades honestly (gate off 404, storage/cold/desync 503) - tests: algebra stakes (S1-S3), pin validation matrix both directions, endpoint stakes incl. degradation matrix + pin chain through stored rows Host audit (issue prerequisite): pi verdict NO with source evidence (no stable message ids at the fetch interception point); opencode/dsh/omp unverified. No host lane is wired yet — first consumer follows the audit.
…orts gate #1440 P6) loadMarks, VanishReason, VanishedEntry, AlignStats, AlignOptions and MsgIdValidation are referenced only inside their declaring files — drop the leading `export` per the gate's INTERNAL_ONLY prescription. Pure visibility change, zero behavioral diff.
… base (#4491) The msgid-pin / msgid-algebra / plugin-render-endpoint suites pin validation, the pure algebra and the render endpoint in isolation. This adds the missing lane-flow coverage — full turns with client ids riding the body: - pin carries client ids into the unified rows (rollout on: the assembled body re-stamps biliMsgIds so the pipeline session re-pins; rollout off: only the in-memory canonical is pinned), edits land as FRESH rows under the same client id — never a swap onto an old seq (the 409-loop contract), biliMsgIds never leaks upstream; - undo→redo with identical content revives at the ORIGINAL seq via the #4390 identity join (zero new rows); - a delta re-claiming a live canonical id hard-fails 400; - divergent resync with ids then a delta — no 409 loop, tip monotonic; - id-less turns stay byte-identical (control case). Also un-exports six internal symbols the new modules exported without src readers (unused-export gate) — loadMarks, the msgid-algebra option types, MsgIdValidation.
|
review |
19382fc to
a7fd378
Compare
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.797-master.aeea173 # this exact build
npm install -g billion-context@master # always the newest merged build
|
…aneServerHistory (docs-sync gate) The PR hand-wrote the pluginLaneServerHistory row into the generated param-ref blocks of CONFIGURATION.md / CONFIGURATION.zh-CN.md without adding the matching entry to website/config-reference/rollout.yaml, so gen-config-docs regeneration deleted the rows and git diff went red. Add the seed entry (the sanctioned source of truth), regenerate, and commit the generated state. Regeneration normalizes the ZH default cell from 0(关) to 0 (off) — the generator has one default field per entry, and every sibling ZH row already carries its English default — and drops backticks from the descriptions, which the seed validator forbids. Also adds the BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY row to both env-map tables.
…nc regenerates clean #4505 added the flag (src/rollout.ts) and hand-wrote its doc rows but never registered it in website/config-reference/rollout.yaml, so every docs-sync run regenerates without the row and fails git diff --exit-code. Adding the seed entry restores idempotency; the generator normalizes the row (no backticks in generated descs, single default cell) and adds the env-map row it had been missing.
(ai: vllm-qwen/qwen3.8-27b) 记录备查:本 PR 审核期间备好的 docs-sync 修复( |
Closes #4491
Server-side core of the plugin-lane server-history design (owner-finalized 2026-10-24): clients become event sources, the unified transcript becomes the identity authority. Default rollout 0% — zero behavior change until rolled out.
What landed
pluginLaneServerHistory(default 0%; env force-onBILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY); documented en+zh.src/msgid-pin.ts): thebiliMsgIdsbody channel — an array parallel tomessages, ALWAYS stripped before upstream forwarding (prompt_cache_key discipline), strictly validated (reservedacp_summary_prefix, duplicates, control/space chars, oversize, non-string, length mismatch).src/msgid-algebra.ts, pure): the judgment layer over ordered id lists — append / vanish(reason) / edit / epoch flip. The store already does the mechanical row work (append, tombstone via retired_at, reactivate-at-original-seq, branch views); this module only judges.msgIdsparallel tomessages(identity-poisoning shapes hard-fail 400; a mere count mismatch degrades to content-derived ids since wire↔core mapping is not always 1:1); every assembled body re-stamps the canonical ids so the pipeline pins exactly what the lane owns; probe advertisesserverHistory.src/plugin-render.ts,POST /__bili/plugin/render {conversationId, untilSeq}, loopback-only like every /__bili/ surface): serves the outbound prefix rendered from the unified transcript — view-pointer ordered, fold regions collapse toacp_summary_<blockId>anchors past each block's last covered row, ledgerSeq stamped ([PR] storage: seq ledger foundations — block interval bounds + ledgerSeq ref stamping (#4316 layer 3, phase 1) #4346). Degrade matrix: gate off → 404 feature-off; storage unreadable / cold session / unparsable row / dangling pointer → 503 with reason. Never guesses.Config surface (mandatory section)
rollout.features.pluginLaneServerHistory(boolean | number, default 0) + env tierBILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY.rollout.featurestable is the designated mechanism for feature gates (same shape assnapshotRenderandpluginIncrementalTurns). No existing key covers "plugin lanes may pin identity / use the render endpoint".pluginIncrementalTurnsgate — rejected: the render endpoint and pinning must roll out independently of the incremental lane (a host can consume one without the other). A dedicated config section — rejected per the owner-gated configuration-surface discipline (no invented shapes without sign-off; the issue itself is the application, as its 配置面 section states).Host id reachability audit (the issue's prerequisite research)
packages/ai/src/types.ts:UserMessage/SystemMessage/ToolResultMessagecarry no id;AssistantMessage.responseId?is an OPTIONAL provider-specific identifier, not host-stable identity. The agent loop converts to wire messages only at the LLM-call boundary, sobefore_provider_requestpayloads expose no stable message ids. The issue's table cell "插件 API 层(CoreMessage.id)" does not exist in pi's source. Pinning needs an upstream host change (host-stamped ids) — not something we can fabricate client-side (that would be a mask).Consequence: no host lane is wired in this PR — the server-side core is delivered generic and hermetically tested; the first consumer follows whichever host the audit lands on.
Stake status (先 RED 后 GREEN)
tests/msgid-algebra.test.tstests/plugin-render-endpoint.test.ts(happy path = pure codec over stored canonical rows; full degrade matrix both directions)Behavior changes (disclosure)
At the 0% default: none. When the gate is ON for an install:
biliMsgIdstop-level body fields are accepted and stripped (previously such a field — sent by no one today — would have been forwarded to the real upstream);/__bili/plugin/turnprobe gains an additiveserverHistorykey;biliMsgIdsinternally and have it stripped pre-upstream;Tests
Targeted local run green: 149/149 across the touched areas (incremental-lane family incl. ack-pull/recovery/direct-send/divert-authz, snapshot-render family, rollout, anthropic cache-control + pck identity/verbatim, plus the three new test files). Full-suite verdict = remote CI on the pushed head.
Deliberate follow-ups (tracked, not bundled)
dead_refs(needs a schema migration — v1 keeps reasons in logs/metadata counters).