FN-6783: recover orphaned task dirs into the task index
Reconcile on-disk task.json records that are missing from SQLite without resurrecting tombstoned IDs.
- Add TaskStore orphaned task directory scanning with metadata validation, FTS-safe insertion, cache updates, lifecycle events, and run-audit entries.
- Run the reconcile during store init and self-healing maintenance for tasks created after startup.
- Cover recovery, skip, and maintenance behavior with core and engine regression tests.
- Document task index reconciliation and add the published package changeset.
Files changed:
.changeset/fn-6783-orphaned-task-dir-reconcile.md | 5 +
AGENTS.md | 1 +
docs/architecture.md | 2 +
docs/storage.md | 8 +
.../store-orphaned-task-dir-reconcile.test.ts | 179 +++++++++++++++++++++
packages/core/src/store.ts | 170 ++++++++++++++++++-
.../self-healing-orphaned-task-dirs.test.ts | 40 +++++
packages/engine/src/self-healing.ts | 14 ++
8 files changed, 412 insertions(+), 7 deletions(-)
Fusion-Task-Id: FN-6783
Fusion-Task-Lineage: 5c8d4690-5278-4c29-8f02-32d9f01d581d