session-persistence writes a turn/end event its own validator rejects (turn: 0 vs turn < 1), and one bad session kills search for the whole store
#5059
Replies: 2 comments
|
Verified every claim against the current tree (cd5ef81 / 0.1.2-alpha.1). Confirmed, with two corrections and one addition. Confirmed 1 — the validator and the routing. Confirmed 2 — per-store fail-closed. session-query-sqlite Correction 1 — the writer is not 0-based; I cannot find any writer that emits Correction 2 — "the bound should be < 0" is the wrong fix. It would accept The actual defect — a discriminator gap. The three legacy migrations form a family, and turn/end is the only one without a legacy discriminator:
So your middle option — "the legacy guard should not claim a turn: 0 event at all" — is the correct fix, and the concrete shape follows the siblings: claim the event only when its reason shape is one the migration actually upgrades ( Addition — the live write path never validates turn boundaries. The turn-trace invariant plugin ( Net: the fix belongs in the legacy migration's discriminator, not the writer, not the bound; the per-session reconcile degrade is a sound orthogonal availability improvement. Happy to help dig into the writer mystery if you share the stored session. |
|
A safe recovery sequence is to stop global search from being the first casualty: preserve the failing Session path and validator output, move only the confirmed-corrupt artifact to a quarantined copy, and verify that healthy Sessions remain searchable before changing the launcher or profile. The write-side contract should reject Verified against the upstream alpha.1 discussion/source evidence on 2026-08-30. This is an independent community runbook, not an official DeepSeek AI statement. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
dsh-session-persistencewrites aturn/endevent that its own validator rejects on the next read. Becausedsh-session-query-sqlitereconciles every stored session and fails closed on any single bad one, one such session disables session search for the entire store, permanently, with no self-heal.All packages
0.1.1-rc.2, Node v26.6.0, macOS.The defect
A stored
turn/endevent, written by the harness itself:{"type":"turn/end","seq":5,"time":1788034442786,"data":{"turn":0,"reason":{"kind":"completed"}}}On the next boot this throws:
dsh-session-persistence/lib/index.js:588:Evaluating that predicate against the event above,
data["turn"] < 1is the sole failing clause — every other condition passes. The writer emits a 0-indexedturn;migrateLegacyTurnEndEventrequires>= 1.So a current-format event with
turn: 0is first misidentified as a legacy pre-react-loop shape, then fails legacy validation. It looks like one of:turn >= 1, orturn: 0event at all, or< 0.Reproduce
With a profile composing
dsh-base(which declaressession-query-sqlite) plusdsh-session-persistence-jsonl,session-query-sqliteconfiguredopenAt: first-search:A run that only creates a session without completing a turn is idempotent and keeps passing, which is what isolates the
turn/endwriter as the source.Why this is worse than a validation bug
dsh-session-query-sqlite's reconcile walks the whole store, so the failure is not scoped to the offending session — search dies for all sessions. There is no quarantine, no skip-and-continue, and no warning; the only recovery I found was manually moving the session directory out of~/.dsh/sessions/. This is the second time it has happened on this install.Two suggestions, independent of the off-by-one:
Happy to supply the full stored session or test more configurations if useful.
All reactions