Some checks failed
Main Confidence / confidence (push) Failing after 44s
## Summary - enforce shared operation run link generation across admin and system surfaces - add guard coverage to block new raw operation route bypasses outside explicit exceptions - harden Filament theme asset resolution so stale or wrong-stack hot files fall back to built assets ## Testing - export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent - export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/OpsUx/CanonicalViewRunLinksTest.php tests/Feature/Monitoring/OperationsDashboardDrillthroughTest.php tests/Feature/Filament/RecentOperationsSummaryWidgetTest.php tests/Feature/Filament/InventoryCoverageRunContinuityTest.php tests/Feature/ReviewPack/ReviewPackResourceTest.php tests/Feature/144/CanonicalOperationViewerDeepLinkTrustTest.php tests/Feature/078/RelatedLinksOnDetailTest.php tests/Feature/RunAuthorizationTenantIsolationTest.php tests/Feature/System/Spec195/SystemDirectoryResidualSurfaceTest.php tests/Feature/System/Spec113/AuthorizationSemanticsTest.php tests/Feature/Guards/OperationRunLinkContractGuardTest.php tests/Unit/Filament/PanelThemeAssetTest.php Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #268
5.9 KiB
5.9 KiB
Quickstart: Operation Run Link Contract Enforcement
Prerequisites
-
Start the local platform stack.
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" cd apps/platform && ./vendor/bin/sail up -d -
Work with:
- one workspace operator who can access canonical admin monitoring,
- one entitled tenant with recent
OperationRunrecords, - one second tenant that the operator must not be able to inspect, and
- one platform user who can access
/system/ops/runs.
-
Remember that this feature changes link generation only. No frontend asset build should be required unless unrelated platform assets changed.
Automated Validation
Run formatting and the narrowest proving suites for this feature:
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH"
cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH"
cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/OpsUx/CanonicalViewRunLinksTest.php tests/Feature/Monitoring/OperationsDashboardDrillthroughTest.php tests/Feature/Filament/RecentOperationsSummaryWidgetTest.php tests/Feature/Filament/InventoryCoverageRunContinuityTest.php tests/Feature/ReviewPack/ReviewPackResourceTest.php tests/Feature/144/CanonicalOperationViewerDeepLinkTrustTest.php tests/Feature/078/RelatedLinksOnDetailTest.php tests/Feature/RunAuthorizationTenantIsolationTest.php tests/Feature/System/Spec195/SystemDirectoryResidualSurfaceTest.php tests/Feature/System/Spec113/AuthorizationSemanticsTest.php tests/Feature/Guards/OperationRunLinkContractGuardTest.php
Final Guard Boundary
The implemented guard is bounded to the first-slice source surfaces and explicit infrastructure exceptions:
- Migrated admin producers:
RecentOperationsSummary,InventoryCoverage,InventoryItemResource,ReviewPackResource,TenantlessOperationRunViewer, andRelatedNavigationResolver. - Verified system producers:
ViewTenant,ViewWorkspace,Runs, andViewRun, all continuing throughSystemOperationRunLinks. - Accepted thin delegate:
App\Support\OpsUx\OperationRunUrl, which forwards toOperationRunLinks. - Allowlisted infrastructure exceptions:
AdminPanelProvider,TenantPanelProvider,EnsureFilamentTenantSelected, andClearTenantContextController. - Forbidden bypasses inside the boundary: raw
route('admin.operations.index'), rawroute('admin.operations.view'), direct/system/ops/runsstrings, and directRuns::getUrl(...)orViewRun::getUrl(...)outsideSystemOperationRunLinks.
Manual Validation Flow
1. Validate tenant-aware admin collection continuity
- Open a tenant-facing surface that exposes the recent-operations summary or an inventory coverage follow-up link.
- Follow the
Open operationsor equivalent history link. - Confirm the destination stays on
/admin/operationsand preserves only helper-supported tenant or filter continuity. - Confirm the page does not invent a tenant-prefixed duplicate operations route.
2. Validate canonical admin detail links from representative resource surfaces
- Open one inventory item with a
last_seen_operation_run_id. - Follow the
Last inventory synclink. - Open one review pack with an associated
operation_run_id. - Confirm both links open canonical admin run detail, not a surface-local route or raw fallback URL.
3. Validate shared related-navigation and back-link behavior
- Open a surface that renders an
operation_runrelated link throughRelatedNavigationResolver. - Confirm the helper-generated label and URL match canonical admin run detail behavior.
- Open
TenantlessOperationRunViewerthrough a source without an explicit back-link context. - Confirm
Back to OperationsandShow all operationsland on the canonical admin collection helper path.
4. Validate system-plane continuity
- Open a system-plane widget or directory page with run drill-through.
- Follow collection and detail links into monitoring.
- Confirm the destination stays on
/system/ops/runsor/system/ops/runs/{run}and does not fall back to/admin/operations.
5. Validate authorization semantics stayed unchanged
- As a workspace member who is not entitled to a foreign tenant, request a canonical admin detail URL for that tenant’s run.
- Confirm the response remains
404. - As a non-platform user, request a system-plane operations URL.
- Confirm the response remains
404. - As an entitled actor missing the relevant capability, confirm current destination behavior still yields
403where the route already distinguishes membership from capability denial.
6. Validate the explicit exception boundary
- Confirm that navigation boot, middleware, and clear-tenant redirect behavior still function after the cleanup.
- Review the named allowlist entries and verify each remaining raw producer is infrastructure-owned rather than convenience-owned.
- Confirm no new operator-facing page, widget, or related-navigation builder remains on raw
admin.operations.*assembly outside the allowlist.
7. Validate the guardrail
- Use a temporary local probe or test fixture to simulate one representative raw
route('admin.operations.view', ...)bypass inside the declared guard boundary without committing it. - Run the guard test.
- Confirm it fails with actionable file and snippet output.
- Replace the bypass with the canonical helper or move it into an explicitly justified exception and confirm the guard passes again.
Reviewer Notes
- The feature stays Livewire v4.0+ compatible and does not change provider registration in
bootstrap/providers.php. - No new global-search surface is introduced;
InventoryItemResourcealready has a view page andReviewPackResourceremains non-searchable. - No destructive action or new asset behavior is introduced.
- The contract boundary is intentionally narrow: platform-owned UI and shared navigation code only.