diff --git a/docs/implplan/SPRINT_20260422_006_FE_web_test_infrastructure_followup.md b/docs/implplan/SPRINT_20260422_006_FE_web_test_infrastructure_followup.md new file mode 100644 index 000000000..f6aa1ed3a --- /dev/null +++ b/docs/implplan/SPRINT_20260422_006_FE_web_test_infrastructure_followup.md @@ -0,0 +1,87 @@ +# Sprint 20260422-006 — FE web test residue after ProxyZone infra fix + +## Topic & Scope +- Finish what SPRINT_20260420_003 FE-STAB2-005/009 couldn't close: per-spec repairs for three residual failure families that the ProxyZone bootstrap fix (commit `4fea1ec72`) exposed but did not address. +- ~140 spec files remain red after the infrastructure fix — divided across three distinct root causes, each a per-spec/per-component repair rather than shared-infra. +- Working directory: `src/Web/StellaOps.Web/` only. +- Expected evidence: full Vitest suite green (or a short, explicit skip-list with reasons); sprint archivable. + +## Dependencies & Concurrency +- Upstream: SPRINT_20260420_003 (still open, tasks BLOCKED) — this sprint is its direct successor. The parent sprint shipped the ProxyZone bootstrap; this one cleans up what remains. +- Safe parallelism: scope-locked to `src/Web/StellaOps.Web/**` (mostly `src/app/**/*.spec.ts` + targeted component edits when a test-drive reveals a genuine component bug). + +## Documentation Prerequisites +- `docs/code-of-conduct/TESTING_PRACTICES.md` (binding). +- `src/Web/AGENTS.md` — Vitest setup contract + `vitest.codex.config.ts`. +- `src/Web/StellaOps.Web/src/test-setup.ts` + `test-setup.jasmine-bootstrap.ts` — the infra this sprint builds on. +- SPRINT_20260420_003 file (still in `docs/implplan/`) — execution log carries the failure triage the FE-STAB2 agent documented. + +## Delivery Tracker + +### FE-STAB3-001 — Signal-input JIT family (NG0303/NG0950) +Status: TODO +Dependency: none +Owners: Test Automation +Task description: +- Root cause: `fixture.componentRef.setInput('step', ...)` fails on components whose JIT-compiled test metadata does not register `input.required()` / `input(...)`. Angular throws `NG0303` or `NG0950` depending on whether the input is `required` or typed-optional. +- Affected specs (non-exhaustive list from FE-STAB2 triage): `setup-wizard/step-content` (26 fails), `deploy-diff/component-diff-row` (19), `deploy-diff/deploy-diff-panel` (12), `sbom-diff/sbom-diff-view` (25), `evidence-drawer` (30), `verdict-proof-panel` (10), `patch-diff-viewer`, `vex-trust-chip`, more. +- Two candidate fixes per component: + - **Option A**: audit the component's standalone import graph for missing metadata and restore the decorator state the JIT compiler needs. + - **Option B**: switch the spec from `fixture.componentRef.setInput('step', value)` to direct signal assignment via `(component as any).step.set(value)` (for writable signals) or a bypass wrapper. +- Pick per-component whichever is less invasive. + +Completion criteria: +- [ ] Every spec in the signal-input JIT family is green. +- [ ] No new skip markers added without an accompanying TODO comment linking to a follow-up. +- [ ] Existing behavior of the components under test is unchanged (no component edits beyond metadata restoration). + +### FE-STAB3-002 — TestBed lifecycle / provider drift +Status: TODO +Dependency: none +Owners: Test Automation +Task description: +- Representative failure: `findings-container.component.spec.ts` throws `Cannot configure the test module when the test module has already been instantiated` and `NG0201: No provider found for InjectionToken SCORING_API`. The component now depends on `ScoringService` / `SCORING_API` but the spec's `TestBed.configureTestingModule` call either runs too late or omits the provider. +- Sweep all specs that TestBed-configure after `TestBed.createComponent` and fix lifecycle order. Also sweep for components that gained a new provider dependency since their spec was last touched — seed the provider. + +Completion criteria: +- [ ] Every TestBed-lifecycle or missing-provider failure in the residual list is green. +- [ ] No new skip markers without TODO + follow-up link. + +### FE-STAB3-003 — Expectation drift +Status: TODO +Dependency: none +Owners: Test Automation +Task description: +- Small residual cluster where specs assert on selectors or copy the component no longer emits. Example: `simulation-history` — 3 residual fails on navigate/header/empty-state expectations (stale selectors vs. shipped template). +- Read the component template; update the spec to match the current DOM. Do NOT change the component. + +Completion criteria: +- [ ] Every expectation-drift failure in the residual list is green. + +### FE-STAB3-004 — Full-suite green + sprint-20260420_003 closure +Status: TODO +Dependency: FE-STAB3-001, FE-STAB3-002, FE-STAB3-003 +Owners: Test Automation +Task description: +- Run the full Vitest suite once all three families are resolved. Capture the final test count. +- Flip SPRINT_20260420_003 FE-STAB2-005 and FE-STAB2-009 criteria + status BLOCKED → DONE. Move that sprint to `docs-archived/implplan/`. + +Completion criteria: +- [ ] `npx vitest run --config vitest.codex.config.ts` completes with zero failures in `src/Web/StellaOps.Web/`. +- [ ] SPRINT_20260420_003 archived. + +## Execution Log +| Date (UTC) | Update | Owner | +| --- | --- | --- | +| 2026-04-22 | Sprint created to absorb the residual scope that `fe-stab-020-003` flagged BLOCKED in SPRINT_20260420_003. Parent sprint landed the ProxyZone bootstrap (commit 4fea1ec72) which unblocked ~450 tests; this sprint finishes the remaining ~140. | Claude | + +## Decisions & Risks +- **Decision**: don't force a single canonical fix for the signal-input family — Option A and Option B are both acceptable per component. Whichever fixes the spec without touching the component's public contract is the right one. +- **Risk**: some specs may be flaky for reasons unrelated to the three families catalogued above. If the full-suite run surfaces new clusters, add a FE-STAB3-00N task rather than expanding 001/002/003 scope creep. +- **Risk**: test-setup layer is load-order sensitive. Do NOT modify `test-setup.jasmine-bootstrap.ts` without rerunning at least one fakeAsync probe from each of the verified-green clusters (simulation-console, batch-evaluation, promotion-gate). + +## Next Checkpoints +- FE-STAB3-001 DONE: signal-input family green. +- FE-STAB3-002 DONE: TestBed lifecycle family green. +- FE-STAB3-003 DONE: expectation drift resolved. +- FE-STAB3-004 DONE: full suite green, parent sprint archived.