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

4.2 KiB

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

  • Spec 338 was directly provided/promoted by the user as the preparation target.
  • Completed-spec guardrail checked that no existing specs/338-* package existed before creation.
  • Branch guardrail checked that no existing 338-* branch existed locally before creation.
  • 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.
  • 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

  • Provider Connection Scope Hardening (already a promoted candidate) is deferred; this spec focuses on link/query and evidence scope seams.
  • Canonical Link / Query Cleanup remains related and partially overlaps; Spec 338 scope is kept tight around confirmed helper outputs and evidence special casing.
  • Environment Resource Context Follow-through remains separate (resource internals); this spec focuses on contract seams and helper outputs.

Content Quality

  • Problem statement is operator-visible and framed as “scope drift + non-canonical deep links”, not internal refactor desire.
  • Scope is bounded to confirmed seams: OperationRunLinks query output contract and evidence special casing; baseline navigation is regression-only.
  • Explicit non-goals prevent reopening Spec 311/320 scope work or starting a navigation redesign.
  • Mandatory Spec Candidate Check is complete (score + decision included).
  • No unresolved placeholder markers remain.

Requirement Completeness

  • Scope taxonomy and link/query contract are documented inside spec.md.
  • 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)
  • Acceptance criteria are concrete and testable.

Plan Quality

  • Plan records stack context (Laravel/Filament/Livewire/Pest/PostgreSQL) and the no-migration/no-route-rewrite constraint.
  • Plan includes a “failing tests first” phase for contract changes.
  • OperationRun UX Impact is limited to link semantics; no lifecycle changes are planned.

Task Quality

  • Tasks are ordered from repo-truth → failing tests → implementation → validation.
  • Task IDs follow the required checkbox format and are verifiable.
  • Tasks include explicit non-goals to prevent scope creep.

Constitution / Repo Alignment

  • No new persisted entity, table, or artifact is introduced by this spec.
  • No new taxonomy framework is proposed; the spec reuses existing navigation/scope seams (AdminSurfaceScope, hub registry, navigation context).
  • Provider boundary is respected: platform-core scope keys (environment_id) remain separate from provider “tenant” identity semantics.
  • Filament v5 / Livewire v4 compliance is assumed by project baseline; this spec does not introduce version drift.

Preparation Analysis Outcome

  • Preparation artifacts (spec.md, plan.md, tasks.md) are internally consistent after manual /speckit.analyze-style review.
  • Every acceptance criterion maps to one or more tasks.
  • No preparation issue requires application implementation to resolve.
  • Candidate Selection Gate result: PASS.
  • 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.