TenantAtlas/specs/374-diagnostic-entry-point-support-diagnostics-consolidation/artifacts/implementation-notes.md
Ahmed Darrazi c125fd48fd
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 3m58s
feat(ui): implement diagnostic entry point consolidation
Applied diagnostic surface contract rules to Audit Log inspect modal and Support Diagnostics action context, consolidating raw diagnostic data into safe modals according to Spec 374.
2026-06-13 03:06:33 +02:00

51 lines
5.0 KiB
Markdown

# Implementation Notes
Status: complete.
## Product Decisions
- Support Diagnostics remains the official quick diagnostics entrypoint from Environment Dashboard.
- Environment `/diagnostics` remains a secondary route and now renders as `Repair diagnostics`.
- Repair Diagnostics provides one secondary read-only `Open support diagnostics` action for broader support context without promoting the repair page as a diagnostic hub.
- No dashboard repair diagnostics link was added because the no-action state has no repo-backed repair value to promote.
- `ManagedEnvironmentLinks::diagnosticsUrl()` remains a retained canonical deeplink utility for future targeted repair contexts and route-contract tests.
## Runtime Changes
- `EnvironmentDiagnostics` now sets the page title to `Repair diagnostics` and adds a repair-only subheading.
- The no-action state now says no repair diagnostics are active and points broader provider, operation, evidence, and audit context to `Open support diagnostics`.
- `EnvironmentDiagnostics` now exposes `Open support diagnostics` as a secondary read-only modal action with support-diagnostics capability gating, audit logging, and `repair_diagnostics` telemetry.
- Blocker headings now use repair-diagnostics language instead of generic diagnostic blocker language.
- `ActionSurfaceExemptions` now uses `Repair diagnostics` as the canonical noun for the singleton diagnostic exception.
- The support diagnostics modal now states that it is quick support context before the recommended first check and lower sections, renders the redaction state as `Redacted support view`, demotes the redaction boundary to a compact `Support scope` line, structures lower sections by status, why relevant, observed, and action, and renders reference drilldowns as safe links that leave the modal context.
- Support diagnostics bundle copy now normalizes raw OperationRun technical exception fragments, including SQLSTATE and database constraint text, out of header and summary copy while preserving the operation reference.
- The dashboard support diagnostics action stayed in the existing More action group; no new navigation or hub card was added.
## Safety Preservation
- Existing `bootstrapOwner` and `mergeDuplicateMemberships` actions remain `Action::make(...)->action(...)`, `->requiresConfirmation()`, `UiEnforcement`-controlled, `Capabilities::TENANT_MANAGE`-gated, service-owned, and audit-covered.
- Page and modal rendering remain DB-local. Feature tests bind the fail-hard Graph client on the dashboard and repair diagnostics paths.
- Support bundle redaction now explicitly covers database exception fragments in addition to provider payloads, credentials, unrestricted log excerpts, and raw report payloads.
- No provider, permission, system, evidence, OperationRun lifecycle, support request, PSA, AI, export, migration, package, route, or panel-provider behavior was added.
## UI / Native Primitive Notes
- Existing Filament Page, Action, ActionGroup, modal, section, badge, and link primitives were reused.
- The Blade changes stay inside the existing support diagnostics modal and use the same Tailwind text, grid, section, badge, link, and dark-mode conventions already present in the file.
- Support modal reference links use Filament link output with explicit safe-drilldown attributes (`target="_blank"` and `rel="noopener noreferrer"`).
- No ad-hoc status colors, button system, card framework, or diagnostic resolver was introduced.
## Test Evidence
- `php artisan test --compact tests/Feature/Filament/Spec374DiagnosticEntrypointTest.php`: 3 passed, 32 assertions.
- `php artisan test --compact --filter=DiagnosticEntry`: 4 passed, 51 assertions.
- `php artisan test --compact tests/Feature/Filament/TenantDiagnosticsRepairsTest.php`: 6 passed, 51 assertions.
- `php artisan test --compact --filter=SupportDiagnostics`: 39 passed, 228 assertions.
- `php artisan test --compact tests/Feature/Guards/ActionSurfaceContractTest.php --filter='tenant diagnostics'`: 1 passed, 3 assertions.
- `php artisan test --compact tests/Feature/Guards/Spec193MonitoringSurfaceHierarchyGuardTest.php`: 4 passed, 35 assertions.
- `php artisan test --compact tests/Feature/Guards/ManagedEnvironmentCanonicalRouteContractTest.php tests/Feature/Navigation/Spec322EnvironmentCtaUrlContractTest.php`: 3 passed, 181 assertions.
- `php artisan test --compact tests/Feature/Filament/Spec374DiagnosticEntrypointTest.php tests/Feature/Filament/TenantDiagnosticsRepairsTest.php tests/Feature/SupportDiagnostics/TenantSupportDiagnosticActionTest.php tests/Feature/SupportDiagnostics/OperationRunSupportDiagnosticActionTest.php tests/Feature/SupportDiagnostics/ProductTelemetrySupportDiagnosticsCaptureTest.php tests/Unit/Support/SupportDiagnostics/SupportDiagnosticBundleBuilderTest.php tests/Unit/Support/SupportDiagnostics/SupportDiagnosticBundleRedactionTest.php`: 27 passed, 269 assertions.
- `php artisan test --compact tests/Browser/Spec374DiagnosticEntrypointSmokeTest.php`: 1 passed, 36 assertions.
- `php vendor/bin/pint --dirty`: passed.
- `git diff --check`: passed.