feat(confidence-engine): v0.60j preserve investigation on restart

This commit is contained in:
2026-09-04 10:18:22 +01:00
parent 4bc998ee3f
commit cc3a5dabd4
7 changed files with 551 additions and 7 deletions
+13 -1
View File
@@ -2,7 +2,7 @@
// Owns the canonical identity contract: snapshot.id is the sole save identity.
// Delegates to the concrete localStorage provider internally.
import { loadInvestigation as _load, saveInvestigation as _save, clearInvestigation as _clear, listInvestigations as _list } from "./providers/local-storage.js";
import { loadInvestigation as _load, saveInvestigation as _save, clearInvestigation as _clear, listInvestigations as _list, restartInvestigation as _restart } from "./providers/local-storage.js";
/**
* Canonical save contract: snapshot.id is the sole identity authority.
@@ -40,3 +40,15 @@ export function clearInvestigation(id) {
export function listInvestigations() {
return _list();
}
/**
* Semantic restart: reset reasoning/report state within the Investigation container.
*
* The Investigation is NOT deleted or replaced. Its durable `id` and `scenario` (container)
* are preserved. All reasoning-state fields are cleared so a new clean pass can begin.
*
* Missing/invalid id → silently no-op (does NOT fall back to legacy singleton).
*/
export function restartInvestigation(id) {
return _restart(id);
}