fix: keep crash repair away from live sessions

This commit is contained in:
_Kerman
2026-07-23 18:31:37 +08:00
parent 022b42a450
commit 7f5ba286fe
12 changed files with 161 additions and 30 deletions
+3 -1
View File
@@ -917,7 +917,9 @@ abstract append(id: SessionId, events: readonly SessionEvent[]): Promise<void>
* Load a header and balanced contiguous log. A complete interrupted final
* turn is preserved and durably closed with missing tool errors plus any open
* step and turn boundaries; only a torn final record is discarded. Unknown
* versions and corruption in the committed prefix reject.
* versions and corruption in the committed prefix reject. Implementations
* MUST NOT crash-repair an identity still bound to a live Session: a balanced
* live log may return as a durable snapshot, while an open live turn rejects.
* @param id - the persisted session to reload.
* @returns the header and a log ending on a balanced `turn/end`.
*/