singularity-forge/web/lib
Jeremy c6093b4bbd fix(state-machine): 9 resilience fixes + 86 regression tests (#3161)
Fixes identified by comprehensive state machine validation:

- M12: reopen-task/slice now deletes SUMMARY.md from disk, preventing
  the DB-filesystem reconciler from auto-correcting tasks back to
  "complete" — reopen was previously a no-op when artifacts existed
- H4: add 30s hard timeout to unitPromise via Promise.race — prevents
  permanent hang if supervision fails to resolve agent_end
- H5: add handleReopenMilestone — milestone completion was irrevocable
- H6: pass ID as title when auto-creating phantom parent entities
- H7: guard loadRegistry() against missing/corrupt registry.json
- M4: report_blocker replay now sets blocker_discovered flag via
  new setTaskBlockerDiscovered() DB function
- M5: insertVerificationEvidence uses INSERT OR IGNORE with unique
  index on (task_id, slice_id, milestone_id, command, verdict)
- M11: complete-slice rollback preserves original status instead of
  hardcoding "pending"
- M14: deriveWorkflowAction shows contextual labels for blocked,
  paused, validating-milestone, completing-milestone, needs-discussion,
  and replanning-slice phases instead of generic "Continue"

Includes 86 regression tests (49 unit + 37 integration) validating
every phase transition, completion guard, and edge case.

Closes #3161
2026-04-07 07:27:08 -05:00
..
__tests__
auth.ts
browser-slash-command-dispatch.ts
command-surface-contract.ts
dev-overrides.tsx
diagnostics-types.ts
git-summary-contract.ts
gsd-workspace-store.tsx
image-utils.ts
initial-gsd-header-filter.ts
knowledge-captures-types.ts
project-store-manager.tsx
project-url.ts
pty-chat-parser.ts
pty-manager.ts
remaining-command-types.ts
session-browser-contract.ts
settings-types.ts
shutdown-gate.ts
use-editor-font-size.ts
use-terminal-font-size.ts
use-user-mode.ts
utils.ts
visualizer-types.ts
workflow-action-execution.ts
workflow-actions.ts
workspace-status.ts
workspace-types.ts
xterm-theme.ts