Repository navigation
fix(#2601): absorb header-corroborated model-drift into the persona anchor - #2727
Conversation
988183a to
80eec4f
Compare
[bot] 🏷 Review of #2727 complete. What I verified: pulled head Structured conclusion (八问):
Test-quality gate: the 11 cases are deterministic hermetic unit tests pinning every boundary of the rule (absorb; missing header on either side forks; unchanged header forks; non-model line forks; line-count change forks; folded display-name variants corroborate; A→B→A stays on the raw key; continuity runs before absorption; auto-review system still forks; alias re-declaration refresh invariant; log surfacing). Each assertion has teeth — each catches a distinct regression. Diff cleanliness: single commit, 3 files, every line purposeful, no whitespace churn, no lockfile/generated noise. CI status: all 8 workflow runs on the branch are green (e2e-codex-persona, e2e-dsh-plugin-lane, e2e-native-dsh, e2e-fake-codex, e2e-native-opencode, e2e-pi-codex-ws, e2e-native-pi, e2e-local-registry; check-runs 10/10 success). One note: the main 判定:可合 — direction matches the approved B' proposal, implementation is faithful to it, tests pin the boundaries, branch CI green. Per §7.4 identity/session-binding logic requires human sign-off; auto-merge does not apply. Please merge yourself when ready: #2727 |
…nchor A model switch landing in the same window as an unannounced history rewrite (dsh local compaction) still satisfies the fork conjunction even with #2719's churn-tolerant continuity: fp changed AND chain discontinuous. dsh declares its model target on every request via x-bili-plugin-model — consume both host declarations: the header model changed AND the system line-diff is confined to lines naming the old/new model (folded) => absorb the fp half (migrate-model, raw key). No host-specific phrasing hardcoded; anything less keeps the fork.
… split (#2601 review nit, pre-existing on master)
b75e433 to
e2da718
Compare
ed86e5c
into
2026-10-11_2601-model-switch-lineage
Stacked on #2719 (base branch = its head). Proposal discussion: #2601 (comment)
What
#2719's churn-tolerant continuity makes a plain model switch MIGRATE. The residual fork shape is the conjunction: the model switch (fp changes) lands in the same window as an unannounced history rewrite (chain discontinuity — dsh local compaction / checkpoint) and the main lane still forks — exactly the XR1988 corpus shape (prompt-switch-heavy sessions +
substrate destroyedevents on the fork keys).This PR absorbs the fp half when two independent host declarations corroborate the drift:
x-bili-plugin-modelheader actually changed (anchor-recorded model ≠ this request's model —src/agent/dsh-native.tsstamps it per request), and→
migrate-model, raw key, compression state stays. No host-specific phrasing is hardcoded — only the header-declared names are matched. Anything less keeps the fork exactly as before: no header on either side, unchanged header model, an extra changed line (AGENTS.md edit), a line-count change, or a genuinely different (auto-review) system.The recorded anchor model is only refreshed on a same-fp re-declaration when the new name actually renders in the system text — the invariant "anchored.model is a name the model line contains" is what makes the old-side containment test sound.
Tests
tests/issue2601-model-drift-absorption.test.ts(11 cases): absorbed switch migrates; missing header on either side forks; unchanged header forks; non-model line forks; line-count change forks; folded display-name variants corroborate; A→B→A stays on the raw key; continuing history still takes plainmigrate(continuity runs first); auto-review system still forks; alias re-declaration refresh invariant;personaNamespacelogs the absorbed migration. Adjacent: dsh-persona-continuity / issue2601-persona-fork-lineage / session-id / dsh-persona-fingerprint / fold-reconcile ×2 = 109/109; typecheck clean; build OK.Config surface
None (no new config/env/CLI).
Kernel boundary
Host-side only (
src/persona-anchor.ts,src/server/handle.tsplumbs the already-parsed header). No changes underkernel/.Notes