From 484abe003999a88e7e58018ce589b8ec74e57769 Mon Sep 17 00:00:00 2001 From: master <> Date: Sun, 8 Mar 2026 02:16:20 +0200 Subject: [PATCH] feat(ui): ship unified audit surfaces --- ..._20260307_039_FE_unified_audit_surfaces.md | 123 +++++++++ .../checked/web/unified-audit-surfaces-ui.md | 42 +++ docs/modules/ui/TASKS.md | 5 + .../RESTORATION_PRIORITIES.md | 4 + docs/modules/ui/implementation_plan.md | 3 + .../ui/unified-audit-surfaces/README.md | 114 ++++++++ .../app/core/navigation/navigation.config.ts | 16 +- .../audit-log/audit-anomalies.component.ts | 4 +- .../audit-log/audit-authority.component.ts | 4 +- .../audit-log/audit-correlations.component.ts | 6 +- .../audit-log/audit-event-detail.component.ts | 8 +- .../audit-log/audit-export.component.ts | 2 +- .../audit-log/audit-integrations.component.ts | 2 +- .../audit-log/audit-log-table.component.ts | 4 +- .../audit-log/audit-policy.component.ts | 4 +- .../audit-timeline-search.component.ts | 4 +- .../features/audit-log/audit-vex.component.ts | 4 +- .../evidence-audit-overview.component.ts | 1 + .../tenant-quota-detail.component.ts | 2 +- .../src/app/routes/administration.routes.ts | 45 ++++ .../src/app/routes/legacy-redirects.routes.ts | 15 ++ .../administration-routes.spec.ts | 9 + .../unified-audit-log-viewer.behavior.spec.ts | 28 +- .../evidence-audit-overview.component.spec.ts | 29 +-- .../evidence-audit-routes.spec.ts | 1 + .../tests/navigation/legacy-redirects.spec.ts | 4 + .../tests/e2e/unified-audit-surfaces.spec.ts | 245 ++++++++++++++++++ 27 files changed, 673 insertions(+), 55 deletions(-) create mode 100644 docs-archived/implplan/SPRINT_20260307_039_FE_unified_audit_surfaces.md create mode 100644 docs/features/checked/web/unified-audit-surfaces-ui.md create mode 100644 docs/modules/ui/unified-audit-surfaces/README.md create mode 100644 src/Web/StellaOps.Web/tests/e2e/unified-audit-surfaces.spec.ts diff --git a/docs-archived/implplan/SPRINT_20260307_039_FE_unified_audit_surfaces.md b/docs-archived/implplan/SPRINT_20260307_039_FE_unified_audit_surfaces.md new file mode 100644 index 000000000..39ffa8760 --- /dev/null +++ b/docs-archived/implplan/SPRINT_20260307_039_FE_unified_audit_surfaces.md @@ -0,0 +1,123 @@ +# Sprint 20260307-039 - Unified Audit Surfaces + +## Topic & Scope +- Restore the dropped and weakly surfaced audit capability by making one canonical audit owner fully usable instead of leaving Evidence, Admin, and legacy aliases split. +- Ship a working `Evidence > Audit Log` surface with live route wiring, repaired internal navigation, bookmark-safe aliases, and real entry points from Admin, Mission Control, Ops, Releases, and quota drilldowns. +- Complete the audit flows end to end: dashboard, events, event detail, correlations, anomalies, module-specific views, and export. +- Working directory: `src/Web/StellaOps.Web/src/app/features/audit-log`. +- Allowed coordination edits: `src/Web/StellaOps.Web/src/app/routes/`, `src/Web/StellaOps.Web/src/app/core/navigation/`, `src/Web/StellaOps.Web/src/app/layout/`, `src/Web/StellaOps.Web/src/app/features/administration/`, `src/Web/StellaOps.Web/src/app/features/mission-control/`, `src/Web.StellaOps.Web/src/app/features/dashboard-v3/`, `src/Web.StellaOps.Web/src/app/features/platform/`, `src/Web.StellaOps.Web/src/app/features/quota-dashboard/`, `src/Web.StellaOps.Web/src/app/features/release-orchestrator/`, `docs/modules/ui/unified-audit-surfaces/`, `docs/features/checked/web/`, `docs/modules/ui/TASKS.md`, and `docs/modules/ui/implementation_plan.md`. +- Expected evidence: one mounted audit route family, working alias redirects, repaired internal links, secondary entry-point handoffs, targeted Angular tests, Playwright verification, and synced docs. + +## Dependencies & Concurrency +- Depends on: + - `docs/modules/ui/component-preservation-map/RESTORATION_PRIORITIES.md` + - `docs/modules/ui/contextual-actions-patterns/README.md` + - `docs/modules/ui/triage-explainability-workspace/README.md` + - `src/Web/StellaOps.Web/src/app/routes/evidence.routes.ts` + - `src/Web.StellaOps.Web/src/app/features/audit-log/audit-log.routes.ts` + - `src/Web.StellaOps.Web/src/app/features/evidence-audit/evidence-audit-overview.component.ts` +- Safe parallelism: + - canonical ownership and alias contract must freeze before deep-link cleanup starts + - audit-shell internal link repairs can proceed in parallel with secondary entry-point rewiring once the canonical path is fixed + - docs sync can proceed in parallel with test authoring after route contracts are stable + +## Documentation Prerequisites +- `docs/modules/ui/unified-audit-surfaces/README.md` +- `docs/modules/ui/component-preservation-map/RESTORATION_PRIORITIES.md` +- `docs/modules/ui/contextual-actions-patterns/README.md` +- `docs/modules/ui/implementation_plan.md` + +## Delivery Tracker + +### FE-AUD-001 - Freeze canonical audit owner and alias contract +Status: DONE +Dependency: none +Owners: Product Manager, FE Architect +Task description: +- Make `Evidence > Audit Log` the canonical owner for cross-module audit browsing and exports. +- Define and implement bookmark-safe redirects from stale `/admin/audit*` and related setup/admin entry points into the mounted evidence route family. + +Completion criteria: +- [x] One canonical audit route family exists in the active router. +- [x] Legacy aliases land on working audit pages without losing query params. +- [x] Admin and Evidence navigation reference the same audit owner. + +### FE-AUD-002 - Repair audit-shell internal navigation and subviews +Status: DONE +Dependency: FE-AUD-001 +Owners: Developer, FE Architect +Task description: +- Update dashboard, event table, event detail, module-specific audit views, anomalies, timeline, correlations, and export pages so their internal navigation stays inside the canonical route family. +- Ensure module subviews remain usable rather than depending on stale absolute admin paths. + +Completion criteria: +- [x] Every audit-log subview links to the canonical owner routes. +- [x] Event detail, correlations, and export flows work from the mounted shell. +- [x] No internal audit workflow requires the stale admin path family. + +### FE-AUD-003 - Wire secondary entry points and contextual handoffs +Status: DONE +Dependency: FE-AUD-001 +Owners: Developer, Product Manager +Task description: +- Repair audit entry points from Setup/Admin overview, Mission Control activity, dashboard activity cards, platform ops, quota detail, and release detail. +- Preserve filter context where practical so the receiving audit surface opens with the relevant release, tenant, or correlation context. + +Completion criteria: +- [x] The main cross-shell audit links land on a usable canonical audit page. +- [x] Release and quota handoffs preserve their query/filter context. +- [x] Evidence overview exposes audit entry points as first-class shortcuts. + +### FE-AUD-004 - Verify route cutover and operator journeys +Status: DONE +Dependency: FE-AUD-002 +Owners: QA, Test Automation +Task description: +- Add targeted UI verification for canonical evidence routes, admin aliases, secondary entry points, and at least one in-shell navigation journey. +- Prove the restored audit functionality is usable, not only mounted. + +Completion criteria: +- [x] Angular tests cover canonical routes, alias redirects, and representative entry points. +- [x] Playwright covers the core audit landing and alias journey. +- [x] Verification explicitly checks that stale admin links no longer strand the operator. + +### FE-AUD-005 - Sync docs, archive the sprint, and record the shipped feature +Status: DONE +Dependency: FE-AUD-004 +Owners: Documentation author, Project Manager +Task description: +- Update the audit UX dossier, checked-feature note, task board, and implementation plan to reflect the shipped canonical owner. +- Archive the sprint only after code and verification evidence are complete. + +Completion criteria: +- [x] Shipped audit UX is documented with canonical routes and alias behavior. +- [x] Checked-feature note records the exact verification commands and outcomes. +- [x] Sprint is archived only after all delivery tasks are marked done. + +## Execution Log +| Date (UTC) | Update | Owner | +| --- | --- | --- | +| 2026-03-07 | Sprint created to restore unified audit functionality by making Evidence the canonical owner and fixing stale admin-route fragmentation. | Project Manager | +| 2026-03-07 | Implemented canonical Evidence-owned audit routing, repaired stale `/admin/audit*` links inside the audit shell, and added bookmark-safe aliases from `admin` and `administration` entry points. | Developer | +| 2026-03-07 | Rewired admin navigation, quota handoff, and Evidence overview shortcuts so audit resolves into one mounted route family instead of split owners. | Developer | +| 2026-03-07 | Verified the cutover with targeted Angular tests (`npm test -- --watch=false --include src/tests/audit_log/unified-audit-log-viewer.behavior.spec.ts --include src/tests/evidence-audit/evidence-audit-routes.spec.ts --include src/tests/evidence-audit/evidence-audit-overview.component.spec.ts --include src/tests/administration/administration-routes.spec.ts --include src/tests/navigation/legacy-redirects.spec.ts`): 31 tests passed. | QA | +| 2026-03-07 | Added browser verification via `npx playwright test tests/e2e/unified-audit-surfaces.spec.ts --workers=1`: 2 tests passed. | QA | +| 2026-03-07 | Production build passed via `npm run build`; existing bundle budget warnings remain unchanged from the baseline. | QA | + +## Decisions & Risks +- Decision: `Evidence > Audit Log` is the canonical owner for cross-module audit browsing and export. Admin remains a secondary surfacing point, not a separate product owner. +- Decision: `Audit Bundles` stay under Triage and the `Auditor Workspace` stays a separate artifact-focused surface; this sprint only unifies the cross-module audit log and its entry points. +- Risk: existing audit components hard-code `/admin/audit*` links, so a partial route fix would still leave in-shell navigation broken. +- Mitigation: repair internal links and add alias coverage in the same sprint. +- Risk: aliasing both `/admin/audit*` and `/administration/audit*` could cause hidden divergence if query params are dropped. +- Mitigation: use redirect helpers or legacy templates that preserve params and cover route variants explicitly. +- Delivery rule: this sprint is only complete when the canonical audit tree is mounted, secondary entry points work, and the main operator journeys are verified end to end. +- Reference design note: `docs/modules/ui/unified-audit-surfaces/README.md`. +- Docs synced: + - `docs/modules/ui/unified-audit-surfaces/README.md` + - `docs/features/checked/web/unified-audit-surfaces-ui.md` + - `docs/modules/ui/TASKS.md` + - `docs/modules/ui/implementation_plan.md` + +## Next Checkpoints +- 2026-03-07: archived after implementation, verification, and docs sync completed. diff --git a/docs/features/checked/web/unified-audit-surfaces-ui.md b/docs/features/checked/web/unified-audit-surfaces-ui.md new file mode 100644 index 000000000..9db0bc858 --- /dev/null +++ b/docs/features/checked/web/unified-audit-surfaces-ui.md @@ -0,0 +1,42 @@ +# Unified Audit Surfaces UI + +## Status +VERIFIED + +## Scope +Unified the cross-module audit experience around the Evidence-owned route family and restored old admin bookmarks as working aliases. + +## Canonical Owner +- Canonical route family: `src/Web/StellaOps.Web/src/app/routes/evidence.routes.ts` mounted at `/evidence/audit-log` +- Canonical audit subviews: `src/Web/StellaOps.Web/src/app/features/audit-log/audit-log.routes.ts` +- Bookmark-safe aliases: + - `src/Web/StellaOps.Web/src/app/routes/legacy-redirects.routes.ts` for `/admin/audit*` + - `src/Web/StellaOps.Web/src/app/routes/administration.routes.ts` for `/administration/audit*` + +## Key Implementation Files +- `src/Web/StellaOps.Web/src/app/core/navigation/navigation.config.ts` +- `src/Web/StellaOps.Web/src/app/features/audit-log/audit-log-dashboard.component.ts` +- `src/Web/StellaOps.Web/src/app/features/audit-log/audit-log-table.component.ts` +- `src/Web.StellaOps.Web/src/app/features/audit-log/audit-event-detail.component.ts` +- `src/Web.StellaOps.Web/src/app/features/evidence-audit/evidence-audit-overview.component.ts` +- `src/Web.StellaOps.Web/src/app/features/quota-dashboard/tenant-quota-detail.component.ts` + +## Verification +- Date (UTC): 2026-03-07 +- Targeted Angular tests: + - `npm test -- --watch=false --include src/tests/audit_log/unified-audit-log-viewer.behavior.spec.ts --include src/tests/evidence-audit/evidence-audit-routes.spec.ts --include src/tests/evidence-audit/evidence-audit-overview.component.spec.ts --include src/tests/administration/administration-routes.spec.ts --include src/tests/navigation/legacy-redirects.spec.ts` + - Result: `5` files, `31` tests passed +- Playwright: + - `npx playwright test tests/e2e/unified-audit-surfaces.spec.ts --workers=1` + - Result: `2/2` passed +- Production build: + - `npm run build` + - Result: pass; existing bundle-budget warnings only + +## Verified Behavior +- `/evidence/audit-log` renders the canonical Unified Audit Log dashboard. +- `/admin/audit*` redirects into `/evidence/audit-log*` with query params preserved. +- Audit subviews no longer deep-link back into stale `/admin/audit*` paths. +- Admin navigation points to the canonical Evidence-owned audit shell. +- Evidence overview exposes `Audit Log` as a first-class shortcut. +- Quota tenant drilldown opens the canonical audit surface with tenant context. diff --git a/docs/modules/ui/TASKS.md b/docs/modules/ui/TASKS.md index b0df6adfd..bc0bff4d8 100644 --- a/docs/modules/ui/TASKS.md +++ b/docs/modules/ui/TASKS.md @@ -83,6 +83,11 @@ - [DONE] FE-RW-004 Cross-product deep links and release-context use for reachability proofs - [DONE] FE-RW-005 Supporting evidence and export surfaces for witness UX - [DONE] FE-RW-006 QA, rollout, and docs sync for reachability witnessing +- [DONE] FE-AUD-001 Freeze canonical audit owner and alias contract +- [DONE] FE-AUD-002 Repair audit-shell internal navigation and subviews +- [DONE] FE-AUD-003 Wire secondary entry points and contextual handoffs +- [DONE] FE-AUD-004 Verify route cutover and operator journeys +- [DONE] FE-AUD-005 Sync docs, archive the sprint, and record the shipped feature - [DONE] FE-PO-001 Freeze Operations overview taxonomy and submenu structure - [DONE] FE-PO-002 Overview page regrouping and blocking-card contract - [DONE] FE-PO-003 Legacy widget absorption matrix for Platform Ops diff --git a/docs/modules/ui/component-preservation-map/RESTORATION_PRIORITIES.md b/docs/modules/ui/component-preservation-map/RESTORATION_PRIORITIES.md index a1b2ffdb3..1f538e6eb 100644 --- a/docs/modules/ui/component-preservation-map/RESTORATION_PRIORITIES.md +++ b/docs/modules/ui/component-preservation-map/RESTORATION_PRIORITIES.md @@ -107,6 +107,10 @@ These are mostly not dropped products. They are current or near-current capabili - `Audit Log` - Target: - keep under admin/security, but improve entry points and deep links +- Notes: + - Detailed UX dossier: `docs/modules/ui/unified-audit-surfaces/README.md` + - Implementation sprint: `docs-archived/implplan/SPRINT_20260307_039_FE_unified_audit_surfaces.md` + - Shipped verification note: `docs/features/checked/web/unified-audit-surfaces-ui.md` ### 8. Offline Operations - Type: `wire-in / preserve` diff --git a/docs/modules/ui/implementation_plan.md b/docs/modules/ui/implementation_plan.md index b800346c7..b88755863 100644 --- a/docs/modules/ui/implementation_plan.md +++ b/docs/modules/ui/implementation_plan.md @@ -27,11 +27,14 @@ Provide a living plan for UI deliverables, dependencies, and evidence. - `docs/features/checked/web/triage-explainability-workspace-ui.md` - shipped verification note for the canonical triage artifact workspace, explainability rail, audit bundles, and security alias cutover. - `docs/features/checked/web/workflow-visualization-replay-ui.md` - shipped verification note for the canonical run-detail graph, timeline, replay, evidence tabs, and workflow-editor preview reuse boundary. - `docs/features/checked/web/contextual-actions-patterns-ui.md` - shipped verification note for the shared contextual route-state, headers, drawers, list-detail shells, grouped overview cards, and first adopted restoration surfaces. +- `docs/features/checked/web/unified-audit-surfaces-ui.md` - shipped verification note for the Evidence-owned audit shell, admin bookmark redirects, repaired audit subview links, and secondary handoff entry points. - `docs/modules/ui/reachability-witnessing/README.md` - detailed witness and proof UX dossier plus cross-shell deep-link contract. - `docs/modules/ui/platform-ops-consolidation/README.md` - detailed Operations overview taxonomy and legacy absorption plan. - `docs/modules/ui/triage-explainability-workspace/README.md` - detailed artifact workspace and audit-bundle UX dossier. - `docs/modules/ui/workflow-visualization-replay/README.md` - detailed run-detail graph, timeline, replay, and evidence UX dossier. - `docs/modules/ui/contextual-actions-patterns/README.md` - shared placement contract for stray actions, pages, drawers, and tabs. +- `docs/modules/ui/unified-audit-surfaces/README.md` - shipped canonical audit owner, alias contract, and secondary entry-point rules for cross-module audit browsing. +- `docs/modules/ui/unified-audit-surfaces/README.md` - canonical audit owner, alias contract, and secondary entry-point rules for cross-module audit browsing. ## Dependencies - `docs/modules/ui/architecture.md` diff --git a/docs/modules/ui/unified-audit-surfaces/README.md b/docs/modules/ui/unified-audit-surfaces/README.md new file mode 100644 index 000000000..2984df86c --- /dev/null +++ b/docs/modules/ui/unified-audit-surfaces/README.md @@ -0,0 +1,114 @@ +# Unified Audit Surfaces + +## Status +Shipped on 2026-03-07. + +## Product Shape +Keep one canonical cross-module audit owner under Evidence. + +- Canonical product home: `Evidence > Audit Log` +- Canonical route family: `/evidence/audit-log` +- Secondary surfacing: + - `Admin > Unified Audit Log` + - `Setup` overview drilldowns + - `Mission Control` activity + - `Ops` and quota drilldowns + - `Release` detail audit links + +The current problem was not missing audit UI. The current problem was that the audit UI existed, but the app still split between Evidence-owned routes and stale admin absolute links. + +## Product Boundary + +### This shell owns +- cross-module audit dashboard +- all-events browser +- event detail +- timeline search +- correlation clusters +- anomaly alerts +- export +- module-specific audit views: + - policy + - authority + - vex + - integrations + +### This shell does not own +- `Audit Bundles` + - stays under `/triage/audit-bundles` +- `Auditor Workspace` + - stays under `/workspace/audit/:artifactDigest` +- contextual reason capsules + - stay embedded in the owning workflow +- policy/VEX scoped audit tabs + - remain inside Policy Decisioning Studio but can deep-link into the canonical audit shell + +## Canonical Route Contract + +### Canonical routes +- `/evidence/audit-log` +- `/evidence/audit-log/events` +- `/evidence/audit-log/events/:eventId` +- `/evidence/audit-log/timeline` +- `/evidence/audit-log/correlations` +- `/evidence/audit-log/anomalies` +- `/evidence/audit-log/export` +- `/evidence/audit-log/policy` +- `/evidence/audit-log/authority` +- `/evidence/audit-log/vex` +- `/evidence/audit-log/integrations` + +### Shipped aliases +- `/admin/audit` +- `/admin/audit/:page` +- `/admin/audit/events/:eventId` +- `/administration/audit` +- `/administration/audit/:page` +- `/administration/audit/events/:eventId` + +Aliases must preserve query params for handoffs like `tenantId`, `releaseId`, `runId`, `correlationId`, and event filters. + +## Navigation Contract + +### Primary navigation +- Evidence keeps the real audit owner link. +- Admin keeps an audit entry, but it points to the same Evidence-owned route family. + +### Secondary entry points to keep +- Setup overview drilldown card +- Mission Control activity feed +- dashboard activity cards +- platform ops summary links +- quota tenant detail +- release detail + +### Secondary entry points to avoid +- do not create a second top-level audit product +- do not fork a separate admin-only audit route tree +- do not move audit bundles out of Triage just because they contain the word `audit` + +## UX Rules +- audit detail pages must always offer a stable path back to the canonical dashboard or events list +- query-param handoffs should keep the operator in context instead of dumping them at an unfiltered dashboard +- breadcrumbs, quick links, and cards must use the canonical evidence route family +- cross-module audit is evidence-centered, not admin-settings-centered + +## Why This Is Worth Keeping +- Stella Ops makes an auditability promise; cross-module audit is core product capability, not optional legacy UI. +- Most of the necessary pages already exist and appear implementation-ready. +- The feature value is currently obscured by route fragmentation, broken links, and split ownership language rather than lack of functionality. + +## Verification Evidence +- feature verification note: `docs/features/checked/web/unified-audit-surfaces-ui.md` +- targeted Angular tests: `31` passing assertions across evidence routes, audit behavior, evidence overview, admin aliases, and legacy redirects +- Playwright: `2/2` passing scenarios for canonical audit landing, in-shell navigation, and old admin bookmark redirect +- production build: pass, with existing unrelated bundle-budget warnings + +## Restoration Goal +Restored usability, not just visibility: + +- one canonical owner +- working aliases for old bookmarks +- repaired internal navigation +- real contextual entry points from the workflows that need audit +- explicit verification that the main audit journeys work diff --git a/src/Web/StellaOps.Web/src/app/core/navigation/navigation.config.ts b/src/Web/StellaOps.Web/src/app/core/navigation/navigation.config.ts index 135be6dea..9790d59ba 100644 --- a/src/Web/StellaOps.Web/src/app/core/navigation/navigation.config.ts +++ b/src/Web/StellaOps.Web/src/app/core/navigation/navigation.config.ts @@ -513,50 +513,50 @@ export const NAVIGATION_GROUPS: NavGroup[] = [ { id: 'audit', label: 'Unified Audit Log', - route: '/admin/audit', + route: '/evidence/audit-log', icon: 'log', tooltip: 'Cross-module audit trail and compliance reporting', children: [ { id: 'audit-dashboard', label: 'Dashboard', - route: '/admin/audit', + route: '/evidence/audit-log', tooltip: 'Audit log overview and stats', }, { id: 'audit-events', label: 'All Events', - route: '/admin/audit/events', + route: '/evidence/audit-log/events', tooltip: 'Browse all audit events with filters', }, { id: 'audit-policy', label: 'Policy Audit', - route: '/admin/audit/policy', + route: '/evidence/audit-log/policy', tooltip: 'Policy promotions and approvals', }, { id: 'audit-authority', label: 'Authority Audit', - route: '/admin/audit/authority', + route: '/evidence/audit-log/authority', tooltip: 'Token lifecycle and incidents', }, { id: 'audit-vex', label: 'VEX Audit', - route: '/admin/audit/vex', + route: '/evidence/audit-log/vex', tooltip: 'VEX decisions and consensus', }, { id: 'audit-integrations', label: 'Integration Audit', - route: '/admin/audit/integrations', + route: '/evidence/audit-log/integrations', tooltip: 'Integration configuration changes', }, { id: 'audit-export', label: 'Export', - route: '/admin/audit/export', + route: '/evidence/audit-log/export', tooltip: 'Export audit logs for compliance', }, ], diff --git a/src/Web/StellaOps.Web/src/app/features/audit-log/audit-anomalies.component.ts b/src/Web/StellaOps.Web/src/app/features/audit-log/audit-anomalies.component.ts index 86c0e8827..1a29ad463 100644 --- a/src/Web/StellaOps.Web/src/app/features/audit-log/audit-anomalies.component.ts +++ b/src/Web/StellaOps.Web/src/app/features/audit-log/audit-anomalies.component.ts @@ -13,7 +13,7 @@ import { AuditAnomalyAlert } from '../../core/api/audit-log.models';
Unusual audit patterns detected by anomaly detection
@@ -44,7 +44,7 @@ import { AuditAnomalyAlert } from '../../core/api/audit-log.models'; } @else {