FN-5764: expose mission assertion backfill through API and CLI

Expose mission assertion backfill controls and run paths across engine, API, and CLI surfaces.

- add mission assertion backfill gating classification and reliability coverage for assertion-linked validation recovery
- add dashboard mission routes plus legacy API coverage and e2e checks for running assertion backfill
- expose new extension tool support and update Fusion skill docs/capability references
- add a changeset for @runfusion/fusion and refresh mission documentation

Files changed:
 .changeset/fn-5764-mission-backfill-assertions.md  |   9 ++
 docs/missions-completion-contract.md               |   7 +-
 docs/missions.md                                   |   7 +-
 packages/cli/skill/fusion/SKILL.md                 |   2 +-
 .../cli/skill/fusion/references/extension-tools.md |   9 ++
 .../skill/fusion/references/fusion-capabilities.md |   1 +
 packages/cli/src/__tests__/extension.test.ts       |  41 +++++++
 packages/cli/src/extension.ts                      |  43 +++++++
 .../dashboard/app/__tests__/api-missions.test.ts   |  44 +++++++
 packages/dashboard/app/api/legacy.ts               |  34 ++++++
 .../dashboard/src/__tests__/mission-e2e.test.ts    | 127 +++++++++++++++++++++
 packages/dashboard/src/mission-routes.ts           |  29 +++++
 .../mission-validation-trigger-gap.test.ts         |  66 +++++++++++
 .../workflow-step-readonly-allowlist.test.ts       |   1 +
 packages/engine/src/gating-classifications.ts      |   1 +
 15 files changed, 418 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-5764

Fusion-Task-Lineage: b16123c2-7cfe-4b17-a899-4e30044a7a49
This commit is contained in:
gsxdsm
2026-05-31 00:54:07 -07:00
parent ec92434f4c
commit acad46cc10
15 changed files with 418 additions and 3 deletions

View File

@@ -72,7 +72,12 @@ A feature can show acceptance text while links are missing (legacy pre-repair da
- authored/informational text surfaces, from
- linked assertion enforcement surfaces.
Operators should use the FN-5696 repair workflow to restore the expected store-managed linkage.
Operators should use the mission assertion backfill operator path to restore expected store-managed linkage for FN-5696 legacy rows:
- Agent/tool: `fn_mission_backfill_assertions` with `{ missionId?, dryRun? }` (defaults to dry-run).
- API: `POST /api/missions/:missionId/backfill-assertions` with body `{ dryRun?: boolean }` (defaults to `true`).
- Run dry-run first, then apply (`dryRun=false`) once repaired rows look correct.
- This remediation is additive: it derives/links one store-managed assertion per unlinked feature so runtime enforcement uses validator-linked assertions rather than the zero-assertion auto-pass branch.
## Slice Status and Mission Autopilot Advance Derivation

View File

@@ -179,7 +179,12 @@ Fusion keeps a canonical per-feature assertion invariant in `MissionStore`:
Assertion text source priority is: `acceptanceCriteria``feature.description` → fallback text (`"Verify implementation of: {feature.title}"`).
**Operator repair note (FN-5696):** Some databases created before the feature-create-path fix could show feature `acceptanceCriteria`/`description` in the UI but still have zero `mission_feature_assertions` links, which caused validator auto-pass short-circuits. Run `node scripts/backfill-fn-5696-feature-assertions.mjs` to preview repairs, then `node scripts/backfill-fn-5696-feature-assertions.mjs --apply` to write links. Use `--mission=<missionId>` for scoped repair (for example the confirmed Goals mission `M-MP32KU9Y-0001-2ADN`).
**Operator repair note (FN-5696):** Some databases created before the feature-create-path fix could show feature `acceptanceCriteria`/`description` in the UI but still have zero `mission_feature_assertions` links, which caused validator auto-pass short-circuits. Use the built-in backfill operator surfaces instead of ad-hoc scripts:
- Agent/tool: `fn_mission_backfill_assertions` with `{ missionId?, dryRun? }` (dry-run default)
- API: `POST /api/missions/:missionId/backfill-assertions` with body `{ dryRun?: boolean }`
Run dry-run first, then apply (`dryRun=false`) when the report looks correct. Scope by mission id for targeted repair (for example Goals mission `M-MP32KU9Y-0001-2ADN`).
- **Verification fields**: Milestone and slice verification criteria from the interview are stored in dedicated `verification` fields rather than concatenated into descriptions
- **Milestone acceptanceCriteria derivation**: explicit `milestone.acceptanceCriteria` from interview output is authoritative. When omitted/blank, Fusion derives a deterministic bulleted summary from child features after creation: prefer `feature.acceptanceCriteria`, fall back to `feature.description`, skip empty contributors, and leave milestone acceptance empty when nothing contributes
- **Partial plans handled**: Auto-generation is robust to partial plans (missing slices/features or empty criteria) without throwing errors