feat(ui): adopt policy components on decisioning surfaces [SPRINT-019]

Wire PolicyEvaluatePanel, RemediationHint, and PolicyPackEditor into
policy-decisioning gates page and policy-studio editor within the
canonical /ops/policy shell.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
master
2026-03-08 19:25:20 +02:00
parent 7fbf04ab1e
commit 1660a9138e
6 changed files with 463 additions and 1 deletions

View File

@@ -0,0 +1,44 @@
# Orphan Policy Component Adoption
Sprint: SPRINT_20260308_019_FE_orphan_policy_component_adoption
## Summary
Revived three dormant shared policy widgets by adopting them on mounted canonical surfaces inside the `/ops/policy` shell:
1. **PolicyEvaluatePanelComponent** + **RemediationHintComponent**: Adopted on the `PolicyDecisioningGatesPageComponent` (`/ops/policy/gates/*`). The gates page now renders a structured decision banner, gate results table, and contextual remediation hints derived from its existing gate results data. The `RemediationHintComponent` is imported transitively through the evaluate panel.
2. **PolicyPackEditorComponent**: Adopted as a visual gate configuration sidebar within the `PolicyEditorComponent` (`/ops/policy/packs/:packId/edit`). Operators can view and modify gates visually alongside the Monaco DSL editor. No second editor route tree was created.
## Mounted hosts
| Widget | Host component | Route | Adoption type |
|---|---|---|---|
| PolicyEvaluatePanelComponent | PolicyDecisioningGatesPageComponent | `/ops/policy/gates/*` | Inline evaluation panel |
| RemediationHintComponent | PolicyDecisioningGatesPageComponent (via evaluate panel) | `/ops/policy/gates/*` | Transitive via evaluate panel |
| PolicyPackEditorComponent | PolicyEditorComponent | `/ops/policy/packs/:packId/edit` | Sidebar visual config |
## Exclusions
| Surface | Reason |
|---|---|
| `features/releases/release-flow.component` | Uses bespoke `RemediationHintsComponent` with domain-specific data contract (`PolicyGateResult`/`RemediationStep` from `release.models`) including automated step triggers, copy-to-clipboard, and exception request flow. The shared `RemediationHintComponent` does not support these features. |
| Policy Studio as a separate navigation branch | Explicitly excluded per sprint scope - canonical policy shell only. |
## Data contracts
- `PolicyEvaluateResponse` (from `policy-interop.models.ts`): gates page derives this from its existing `GateResult[]` via a computed signal.
- `PolicyPackDocument` (from `policy-interop.models.ts`): editor derives this from the loaded `PolicyPack` metadata.
- `RemediationHint` (from `policy-interop.models.ts`): consumed transitively through the evaluate panel.
## Test coverage
- `policy-decisioning-gates-page.component.spec.ts`: Verifies policyEvaluateResult derivation, gate mapping, remediation hints, decision computation, and template rendering of the shared panel.
- `policy-editor-pack-editor.component.spec.ts`: Verifies packDocument derivation, template rendering of the shared pack editor, and change handler.
## Files changed
- `src/Web/StellaOps.Web/src/app/features/policy-decisioning/policy-decisioning-gates-page.component.ts`
- `src/Web/StellaOps.Web/src/app/features/policy-studio/editor/policy-editor.component.ts`
- `src/Web/StellaOps.Web/src/app/features/policy-decisioning/policy-decisioning-gates-page.component.spec.ts` (new)
- `src/Web/StellaOps.Web/src/app/features/policy-studio/editor/policy-editor-pack-editor.component.spec.ts` (new)