From bd26e209de38873f0369db09b14cf43f9adbe16c Mon Sep 17 00:00:00 2001 From: ahmido Date: Fri, 24 Apr 2026 21:05:37 +0000 Subject: [PATCH] feat: harden provider boundaries (#273) ## Summary - add the provider boundary catalog, boundary support types, and guardrails for platform-core versus provider-owned seams - harden provider gateway, identity resolution, operation registry, and start-gate behavior to require explicit provider bindings - add unit and feature coverage for boundary classification, runtime preservation, unsupported paths, and platform-core leakage guards - add the full Spec Kit artifact set for spec 237 and update roadmap/spec-candidate tracking ## Validation - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Unit/Providers/ProviderBoundaryClassificationTest.php tests/Unit/Providers/ProviderBoundaryGuardrailTest.php tests/Feature/Providers/ProviderBoundaryHardeningTest.php tests/Feature/Providers/UnsupportedProviderBoundaryPathTest.php tests/Feature/Guards/ProviderBoundaryPlatformCoreGuardTest.php` - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Unit/Providers/ProviderGatewayTest.php tests/Unit/Providers/ProviderIdentityResolverTest.php tests/Unit/Providers/ProviderOperationStartGateTest.php` - `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent` - browser smoke: `http://localhost/admin/provider-connections?tenant_id=18000000-0000-4000-8000-000000000180` loaded with the local smoke user, the empty-state CTA reached the canonical create route, and cancel returned to the scoped list Co-authored-by: Ahmed Darrazi Reviewed-on: https://git.cloudarix.de/ahmido/TenantAtlas/pulls/273 --- .github/agents/copilot-instructions.md | 4 +- .specify/memory/constitution.md | 88 ++++-- .specify/templates/checklist-template.md | 7 + .specify/templates/plan-template.md | 15 +- .specify/templates/spec-template.md | 21 +- .specify/templates/tasks-template.md | 11 +- .../Services/Providers/ProviderGateway.php | 15 +- .../Providers/ProviderIdentityResolution.php | 20 -- .../Providers/ProviderOperationRegistry.php | 168 +++++++++++- .../Providers/ProviderOperationStartGate.php | 62 ++++- .../Boundary/ProviderBoundaryCatalog.php | 194 ++++++++++++++ .../Boundary/ProviderBoundaryOwner.php | 17 ++ .../Boundary/ProviderBoundarySeam.php | 149 +++++++++++ .../Support/Providers/ProviderReasonCodes.php | 4 + .../Providers/ProviderReasonTranslator.php | 10 +- apps/platform/config/provider_boundaries.php | 115 ++++++++ .../ProviderBoundaryPlatformCoreGuardTest.php | 47 ++++ .../ProviderBoundaryHardeningTest.php | 109 ++++++++ .../UnsupportedProviderBoundaryPathTest.php | 45 ++++ .../ProviderBoundaryClassificationTest.php | 57 ++++ .../ProviderBoundaryGuardrailTest.php | 75 ++++++ .../Unit/Providers/ProviderGatewayTest.php | 28 ++ .../ProviderIdentityResolverTest.php | 21 ++ .../ProviderOperationStartGateTest.php | 38 +++ docs/product/roadmap.md | 2 +- docs/product/spec-candidates.md | 164 +++++++++--- docs/product/standards/README.md | 4 +- .../checklists/requirements.md | 35 +++ ...er-boundary-hardening.logical.openapi.yaml | 207 ++++++++++++++ .../data-model.md | 115 ++++++++ specs/237-provider-boundary-hardening/plan.md | 253 ++++++++++++++++++ .../quickstart.md | 84 ++++++ .../research.md | 42 +++ specs/237-provider-boundary-hardening/spec.md | 235 ++++++++++++++++ .../237-provider-boundary-hardening/tasks.md | 226 ++++++++++++++++ 35 files changed, 2587 insertions(+), 100 deletions(-) create mode 100644 apps/platform/app/Support/Providers/Boundary/ProviderBoundaryCatalog.php create mode 100644 apps/platform/app/Support/Providers/Boundary/ProviderBoundaryOwner.php create mode 100644 apps/platform/app/Support/Providers/Boundary/ProviderBoundarySeam.php create mode 100644 apps/platform/config/provider_boundaries.php create mode 100644 apps/platform/tests/Feature/Guards/ProviderBoundaryPlatformCoreGuardTest.php create mode 100644 apps/platform/tests/Feature/Providers/ProviderBoundaryHardeningTest.php create mode 100644 apps/platform/tests/Feature/Providers/UnsupportedProviderBoundaryPathTest.php create mode 100644 apps/platform/tests/Unit/Providers/ProviderBoundaryClassificationTest.php create mode 100644 apps/platform/tests/Unit/Providers/ProviderBoundaryGuardrailTest.php create mode 100644 specs/237-provider-boundary-hardening/checklists/requirements.md create mode 100644 specs/237-provider-boundary-hardening/contracts/provider-boundary-hardening.logical.openapi.yaml create mode 100644 specs/237-provider-boundary-hardening/data-model.md create mode 100644 specs/237-provider-boundary-hardening/plan.md create mode 100644 specs/237-provider-boundary-hardening/quickstart.md create mode 100644 specs/237-provider-boundary-hardening/research.md create mode 100644 specs/237-provider-boundary-hardening/spec.md create mode 100644 specs/237-provider-boundary-hardening/tasks.md diff --git a/.github/agents/copilot-instructions.md b/.github/agents/copilot-instructions.md index e96aa26a..ce0cb817 100644 --- a/.github/agents/copilot-instructions.md +++ b/.github/agents/copilot-instructions.md @@ -250,6 +250,8 @@ ## Active Technologies - Existing PostgreSQL tables only; no new table or schema migration is planned in the mainline slice (235-baseline-capture-truth) - PHP 8.4.15 + Laravel 12, Filament v5, Livewire v4, Pest v4, existing governance domain models and builders, existing Evidence Snapshot and Tenant Review infrastructure (236-canonical-control-catalog-foundation) - PostgreSQL for existing downstream governance artifacts plus a product-seeded in-repo canonical control registry; no new DB-backed control authoring table in the first slice (236-canonical-control-catalog-foundation) +- PHP 8.4.15, Laravel 12, Filament v5, Livewire v4 + existing provider seams under `App\Services\Providers` and `App\Services\Graph`, especially `ProviderGateway`, `ProviderIdentityResolver`, `ProviderIdentityResolution`, `PlatformProviderIdentityResolver`, `ProviderConnectionResolver`, `ProviderConnectionResolution`, `MicrosoftGraphOptionsResolver`, `ProviderOperationRegistry`, `ProviderOperationStartGate`, `GraphClientInterface`, Pest v4 (237-provider-boundary-hardening) +- Existing PostgreSQL tables such as `provider_connections` and `operation_runs`; one new in-repo config catalog for provider-boundary ownership; no new database tables (237-provider-boundary-hardening) - PHP 8.4.15 (feat/005-bulk-operations) @@ -284,9 +286,9 @@ ## Code Style PHP 8.4.15: Follow standard conventions ## Recent Changes +- 237-provider-boundary-hardening: Added PHP 8.4.15, Laravel 12, Filament v5, Livewire v4 + existing provider seams under `App\Services\Providers` and `App\Services\Graph`, especially `ProviderGateway`, `ProviderIdentityResolver`, `ProviderIdentityResolution`, `PlatformProviderIdentityResolver`, `ProviderConnectionResolver`, `ProviderConnectionResolution`, `MicrosoftGraphOptionsResolver`, `ProviderOperationRegistry`, `ProviderOperationStartGate`, `GraphClientInterface`, Pest v4 - 236-canonical-control-catalog-foundation: Added PHP 8.4.15 + Laravel 12, Filament v5, Livewire v4, Pest v4, existing governance domain models and builders, existing Evidence Snapshot and Tenant Review infrastructure - 235-baseline-capture-truth: Added PHP 8.4.15, Laravel 12, Filament v5, Livewire v4 + `BaselineCaptureService`, `CaptureBaselineSnapshotJob`, `BaselineReasonCodes`, `BaselineCompareStats`, `ReasonTranslator`, `GovernanceRunDiagnosticSummaryBuilder`, `OperationRunService`, `BaselineProfile`, `BaselineSnapshot`, `OperationRunOutcome`, existing Filament capture/compare surfaces -- 234-dead-transitional-residue: Added PHP 8.4.15, Laravel 12, Filament v5, Livewire v4 + `App\Models\BaselineProfile`, `App\Support\Baselines\BaselineProfileStatus`, `App\Support\Badges\BadgeCatalog`, `App\Support\Badges\BadgeDomain`, `Database\Factories\TenantFactory`, `App\Console\Commands\SeedBackupHealthBrowserFixture`, existing tenant-truth and baseline-profile Pest tests ### Pre-production compatibility check diff --git a/.specify/memory/constitution.md b/.specify/memory/constitution.md index c4431b04..d584fe80 100644 --- a/.specify/memory/constitution.md +++ b/.specify/memory/constitution.md @@ -1,28 +1,30 @@