Some checks failed
Main Confidence / confidence (push) Failing after 1m45s
## Summary - add the bounded workspace commercial lifecycle overlay from spec 251 on top of the existing entitlement substrate - expose audited commercial state inspection and mutation on the system workspace detail surface - gate onboarding activation and review-pack start actions through the shared lifecycle decision while preserving suspended read-only access to existing review, evidence, and generated-pack history - add focused Pest coverage plus the spec/plan/tasks/data-model/contract artifacts for the feature ## Validation - targeted Pest unit and feature lanes for lifecycle resolution, system-plane mutation, onboarding gating, review-pack enforcement, download preservation, customer review workspace access, and evidence snapshot access - `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent` - integrated browser smoke on the system workspace detail and the preserved read-only review/evidence/review-pack surfaces ## Notes - branch: `251-commercial-entitlements-billing-state` - base: `dev` - commit: `606e9760` Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #292
6.5 KiB
6.5 KiB
Quickstart: Commercial Entitlements and Billing-State Maturity
Date: 2026-04-28
Branch: 251-commercial-entitlements-billing-state
This quickstart is the intended reviewer flow after implementation. It stays bounded to the commercial lifecycle overlay described in the spec.
Prerequisites
- Start the local platform stack.
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && cd apps/platform && ./vendor/bin/sail up -d
- Ensure one platform user has directory visibility plus the dedicated commercial lifecycle management capability.
- Ensure one workspace member can complete onboarding, one reporting operator can manage review packs, and one customer-safe or operator read-only actor can open review/evidence/download surfaces under current RBAC.
- Seed or factory-create:
- one workspace with untouched lifecycle state
- one onboarding draft in that workspace
- one tenant with an existing review, evidence snapshot, and generated review pack
- one workspace already at or above the managed-tenant activation limit for substrate-block verification
Scenario 1: Change workspace commercial state from the system plane
- Open
/system/directory/workspaces/{workspace}as the authorized platform user. - Confirm the page shows:
- current lifecycle state
- source label
- rationale and last-changed attribution
- affected behavior summary for onboarding and review-pack starts
- the underlying entitlement substrate summary for context
- Use
Change commercial stateto move the workspace totrialwith rationale. - Confirm the page updates immediately and the change is attributable.
- Repeat with
grace,suspended_read_only, andactive_paid. - Confirm every explicit state change requires rationale, including a return to
active_paid, and that theSuspended / read-onlypath also requires explicit confirmation.
Scenario 2: Gate onboarding activation with business-state truth
- Open
/admin/onboarding/{onboardingDraft}for a workspace intrialoractive_paid. - Confirm the completion step allows
Complete onboardingwhen the underlying entitlement substrate also allows it. - Switch the same workspace to
gracefrom the system plane. - Refresh the onboarding draft and confirm:
- the action remains visible for an otherwise authorized actor
- the step explains that expansion is frozen during grace
- no tenant activation occurs
- Repeat with
suspended_read_onlyand confirm the block message changes to read-only suspension semantics instead of a permission failure.
Scenario 3: Gate review-pack starts before any run is created
- Use a workspace in
trialoractive_paidwhere the underlying review-pack entitlement allows generation. - Trigger the current start family from:
- tenant dashboard review-pack card
- review register export action
- tenant review detail export action
- review-pack detail regenerate action
- Confirm the existing queued-start UX remains unchanged when allowed.
- Move the workspace to
grace. - Confirm review-pack starts remain allowed with a grace warning.
- Start one allowed review-pack action and leave the resulting work queued or running.
- Move the workspace to
suspended_read_only. - Confirm the already-created run remains visible and continues with the existing run UX.
- Repeat the same start actions and confirm:
- each surface shows the same lifecycle-based reason
- no new
ReviewPackrow is created - no new
OperationRunrow is created - no queued or terminal review-pack notification is emitted for the blocked attempt
Scenario 4: Preserve read-only review, evidence, and generated-pack access while suspended
- Keep the workspace in
suspended_read_only. - Open the current read-only consumption surfaces as an already-authorized actor:
CustomerReviewWorkspace- tenant review detail
- review-pack detail
- evidence snapshot detail
- current review-pack download link
- Confirm:
- the pages still render
- already-generated review packs remain downloadable
- existing review/evidence history remains visible
- any read-only explanation stays calm and does not masquerade as 403 or 404
- Confirm the slice does not add broad new suspension behavior to unrelated mutable controls outside the spec boundary.
RBAC and Plane Semantics Checks
- Access lifecycle mutation from
/adminand confirm there is no self-service control surface. - Access
/system/directory/workspaces/{workspace}as a platform user lacking the dedicated lifecycle capability and confirm authorization is enforced without leaking admin-plane truth. - Access onboarding or review-pack surfaces as a non-member or wrong-plane actor and confirm 404.
- Access the same surfaces as an established-scope actor lacking the relevant capability and confirm 403.
- Access the action as an otherwise authorized actor whose workspace lifecycle blocks the action and confirm a truthful business-state block instead of 403 or 404.
Targeted Validation Commands
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Unit/Entitlements/WorkspaceCommercialLifecycleResolverTest.php
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/System/ViewWorkspaceEntitlementsTest.php tests/Feature/System/Spec113/AuthorizationSemanticsTest.php tests/Feature/Onboarding/ManagedTenantOnboardingEntitlementTest.php tests/Feature/Onboarding/OnboardingRbacSemanticsTest.php
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/ReviewPack/ReviewPackEntitlementEnforcementTest.php tests/Feature/ReviewPack/ReviewPackGenerationTest.php tests/Feature/ReviewPack/ReviewPackDownloadTest.php tests/Feature/Reviews/CustomerReviewWorkspacePageTest.php tests/Feature/Reviews/CustomerReviewWorkspacePackAccessTest.php tests/Feature/Evidence/EvidenceSnapshotResourceTest.php
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent
Out of Scope Confirmations
While validating this slice, confirm that the implementation does not add or imply:
- payment-provider credentials, invoices, checkout, taxes, or public pricing UI
- customer-account, subscription, or contract models
- automated expiry/reminder/renewal logic
- a second admin-plane commercial settings surface
- a broad suspension engine across unrelated mutable product surfaces