Commit Graph
3 Commits
Author SHA1 Message Date
ranxianglei ed0e84fcc0 fork: msgid identity track for the plugin fork protocol (#6262)
Principle 1 of the four-principles proposal (discussion #6262): identity,
not bytes, decides which prefix a fork inherits. The plugin-protocol
channel (dsh/omp/pi declared forks) gains an optional msgid track:

- a host-pinned parent exposes the host's stable message ids AS its
  snapshot rawIds, so the child may present the host id of each matched
  prefix message (prefixMsgIds) plus the hash-run length (driftFrom);
- the server accepts a byte-drifted prefix only when every presented id
  equals the parent's rawId at its slot; the receipt is marked
  status "drifted" (or "expanded+drifted") with the verified
  driftFrom echoed;
- a gate failure never fails the fork: the byte-verified strict fork
  proceeds exactly as before (no 409); malformed shapes are 400; parents
  without host-pinned ids make the track a no-op (byte path unchanged).

Client: lanes inject their existing parity-pinned collectors (dsh
hostMsgIdsOf; pi/omp laneMsgIdsForWire on the anthropic wire with the
same content-pinnable gate the incremental pin uses); fork-adopt
performs only the core-alignment length lock — no new validator copies,
msgid-rule-parity matrix untouched. opencode-v2 is not wired in this PR
(byte track, follow-up).

Tests: tests/issue6262-fork-msgid-track.test.ts (8) — client prefix
extension across a drift cell, the byte-fallback arms, a full-chain
proxy round trip, and the server gate (drifted receipt / strict
fallback / 400 arms). Docs: msgid-infrastructure.md consumer 6,
plugin-protocol.md section 8, architecture.md.
2026-11-14 15:38:39 +08:00
ranxianglei 1b49f01f76 fix(prompts): teach the canonical string form in compress call examples
Two model-facing texts still demoed the retired raw-array shape for
compress content (schema accepts ONE string only; strict hosts reject
the array):

- tierActionHint (kernel/src/compress.ts): tier distillation/
  condensation offer — appended to the 'range already compressed'
  receipt, exactly where a weak model is most likely to copy it
- armed-breaker format reminder (src/stream.ts): taught 'content'
  must be a non-empty array of {startId,endId,summary} objects

Both now mirror the compress tool schema and the nudge example
(content: "b1-b5 optional topic\nsummary markdown..."); PLUGIN.md's
/__bili/plugin/tool example shows the string form with a note that a
JSON-encoded array inside that same string is still accepted.

Tests: regression-bili-470 pins the new wording; issue4812 gains a
negative assert against the old array phrasing. Kernel 1565/1565,
host typecheck green.
2026-11-12 21:51:20 +08:00
ranxianglei 05bb1dc948 docs: centralize 14 root docs under docs/ with hub index + redirect stubs (owner request 2026-11-08) 2026-11-08 13:33:45 +08:00