TenantAtlas/specs/338-workspace-environment-resource-scope-contract/checklists/requirements.md
ahmido e0c2cdb1f4 feat: enforce workspace and environment scope contract (Spec 338) (#409)
## Summary
- enforce the canonical workspace/environment scope contract for workspace hubs and environment-owned surfaces
- replace first-party Operations deep links that leaked Filament `tableFilters[...]` internals with stable product-level query behavior
- add the sidebar scope indicator and split environment-page navigation into explicit `Workspace-wide` and `Workspace admin` groups
- remove redundant tenantless `All environments` scope badges from workspace-wide pages while preserving explicit environment filter affordances
- include the Spec 338 artifacts, guard tests, and browser smoke coverage for the new contract

## Validation
- `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Navigation/Spec338EnvironmentSidebarSeparationTest.php tests/Feature/Navigation/Spec338OperationRunLinksQueryContractTest.php tests/Feature/Navigation/Spec338SidebarScopeIndicatorTest.php tests/Feature/Filament/PanelNavigationSegregationTest.php`
- `cd apps/platform && ./vendor/bin/sail php vendor/bin/pest tests/Browser/Spec338ScopeContractSmokeTest.php --compact`

## Notes
- Livewire v4 compliance unchanged
- Filament provider registration remains in `bootstrap/providers.php`
- no destructive action behavior changed
- no migrations, env var changes, or new Filament asset registration

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #409
2026-05-31 01:36:08 +00:00

71 lines
4.2 KiB
Markdown

# Specification Quality Checklist: Spec 338 - Workspace / Environment Resource Scope Contract
**Purpose**: Validate specification completeness, preparation quality, and readiness before implementation.
**Created**: 2026-05-30
**Feature**: `specs/338-workspace-environment-resource-scope-contract/spec.md`
## Candidate Selection Gate
- [x] Spec 338 was directly provided/promoted by the user as the preparation target.
- [x] Completed-spec guardrail checked that no existing `specs/338-*` package existed before creation.
- [x] Branch guardrail checked that no existing `338-*` branch existed locally before creation.
- [x] `docs/product/spec-candidates.md` was inspected; it states the active auto-prep queue is empty, so this spec proceeds only because the user directly supplied/promoted it.
- [x] Related completed/historical specs were treated as context only and remain unchanged:
- `specs/311-workspace-environment-surface-scope-contract/` (implemented + validated)
- `specs/320-workspace-owned-analysis-surface-registration-shell-cutover/` (completed)
- `specs/322-browser-no-drift-regression-guard/` (guard posture)
## Close Alternatives Deferred
- [x] Provider Connection Scope Hardening (already a promoted candidate) is deferred; this spec focuses on link/query and evidence scope seams.
- [x] Canonical Link / Query Cleanup remains related and partially overlaps; Spec 338 scope is kept tight around confirmed helper outputs and evidence special casing.
- [x] Environment Resource Context Follow-through remains separate (resource internals); this spec focuses on contract seams and helper outputs.
## Content Quality
- [x] Problem statement is operator-visible and framed as “scope drift + non-canonical deep links”, not internal refactor desire.
- [x] Scope is bounded to confirmed seams: `OperationRunLinks` query output contract and evidence special casing; baseline navigation is regression-only.
- [x] Explicit non-goals prevent reopening Spec 311/320 scope work or starting a navigation redesign.
- [x] Mandatory Spec Candidate Check is complete (score + decision included).
- [x] No unresolved placeholder markers remain.
## Requirement Completeness
- [x] Scope taxonomy and link/query contract are documented inside `spec.md`.
- [x] Required runtime decisions are explicit for:
- Operation type deep links (no `tableFilters` in helper output)
- Evidence `/admin/evidence/*` special casing (remove if stale, otherwise document + test)
- baseline ownership/navigation (regression-only)
- [x] Acceptance criteria are concrete and testable.
## Plan Quality
- [x] Plan records stack context (Laravel/Filament/Livewire/Pest/PostgreSQL) and the no-migration/no-route-rewrite constraint.
- [x] Plan includes a “failing tests first” phase for contract changes.
- [x] OperationRun UX Impact is limited to link semantics; no lifecycle changes are planned.
## Task Quality
- [x] Tasks are ordered from repo-truth → failing tests → implementation → validation.
- [x] Task IDs follow the required checkbox format and are verifiable.
- [x] Tasks include explicit non-goals to prevent scope creep.
## Constitution / Repo Alignment
- [x] No new persisted entity, table, or artifact is introduced by this spec.
- [x] No new taxonomy framework is proposed; the spec reuses existing navigation/scope seams (`AdminSurfaceScope`, hub registry, navigation context).
- [x] Provider boundary is respected: platform-core scope keys (`environment_id`) remain separate from provider “tenant” identity semantics.
- [x] Filament v5 / Livewire v4 compliance is assumed by project baseline; this spec does not introduce version drift.
## Preparation Analysis Outcome
- [x] Preparation artifacts (`spec.md`, `plan.md`, `tasks.md`) are internally consistent after manual `/speckit.analyze`-style review.
- [x] Every acceptance criterion maps to one or more tasks.
- [x] No preparation issue requires application implementation to resolve.
- [x] Candidate Selection Gate result: PASS.
- [x] Spec Readiness Gate result: PASS for later implementation.
## Notes
- Repository has prompt/agent definitions for `speckit.tasks` and `speckit.analyze`, but no local executable Bash command for those phases. Tasks and analysis were therefore produced repo-conformantly from templates and checked manually in this checklist.