Harden policy simulation direct-route defaults

This commit is contained in:
master
2026-03-10 09:09:29 +02:00
parent db7371de03
commit eae2dfc9d4
15 changed files with 739 additions and 18 deletions

View File

@@ -0,0 +1,50 @@
# Sprint 20260310-006 - FE Policy Simulation Direct Route Defaults and Hydration
## Topic & Scope
- Harden revived Policy Simulation surfaces so direct entry and partially wired host routes still render usable defaults instead of blank inputs.
- Normalize missing policy pack, version, and target environment inputs across the revived lint, diff, coverage, and promotion-gate components.
- Ensure the read-only coverage route hydrates on first render instead of waiting for a second interaction.
- Working directory: `src/Web/StellaOps.Web/src/app/features/policy-simulation`.
- Allowed coordination edits: `src/Web/StellaOps.Web/tsconfig.spec.features.json`, `docs/modules/ui/README.md`.
- Expected evidence: focused component spec pass, authenticated live Playwright evidence for `/ops/policy/simulation` policy actions, updated UI docs if behavior changes.
## Dependencies & Concurrency
- Follows `SPRINT_20260309_019_FE_policy_simulation_active_tenant_runtime.md`; this sprint hardens the revived component surfaces after the tenant seam repair.
- Safe parallelism: do not touch router readiness or unrelated search work while closing this slice.
## Documentation Prerequisites
- `AGENTS.md`
- `docs/code-of-conduct/CODE_OF_CONDUCT.md`
- `docs/qa/feature-checks/FLOW.md`
- `docs/modules/ui/README.md`
## Delivery Tracker
### FE-POLICY-SIM-006-001 - Normalize revived policy simulation inputs and direct hydration
Status: DONE
Dependency: none
Owners: Developer, QA
Task description:
- Centralize the fallback defaults used by revived Policy Simulation components so direct-entry routes and partially restored host callers do not pass through blank pack IDs, unusable versions, or empty target environments.
- Cover the normalization behavior in focused specs for the shared defaults helper and the affected components, then re-run live authenticated policy actions with Playwright to prove the repaired runtime still behaves correctly.
Completion criteria:
- [x] Coverage, diff, lint, and promotion-gate components normalize missing/blank inputs to stable defaults instead of rendering unusable state.
- [x] Coverage auto-loads on first render so the direct route is hydrated without a second click.
- [x] Focused Angular specs prove the normalization and hydration behaviors.
- [x] Authenticated Playwright completes the policy action sweep on `https://stella-ops.local` without new route or runtime failures.
## Execution Log
| Date (UTC) | Update | Owner |
| --- | --- | --- |
| 2026-03-10 | Sprint created after the remaining dirty `policy-simulation` slice was identified as a follow-on hardening pass for revived direct-route component defaults and coverage hydration. | Developer |
| 2026-03-10 | Added shared policy simulation defaults plus a Vitest-compatible direct-route regression harness, rebuilt the web bundle, synced `dist/stellaops-web/browser` into `compose_console-dist`, and verified `/ops/policy/simulation/coverage`, `/lint`, `/promotion`, and `/diff/policy-pack-001` live with zero runtime errors via Playwright. | Developer |
## Decisions & Risks
- Decision: keep default restoration local to the revived Policy Simulation feature cluster through a shared helper instead of reintroducing per-component literals.
- Decision: use a focused Vitest-compatible regression spec for the revived direct-route behaviors instead of widening the unsupported legacy ProxyZone/Karma component suite.
- Risk: defaulting a missing pack/version can hide a wiring regression; mitigate with focused specs and live Playwright verification on the real shell.
## Next Checkpoints
- 2026-03-10: finish the focused spec coverage and live policy Playwright recheck.
- 2026-03-10: commit the isolated policy-simulation hardening slice.