Automated PR to merge `267-artifact-lifecycle-retention` into `platform-dev`. Created by Copilot. Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #323
5.5 KiB
5.5 KiB
Quickstart: Governance Artifact Lifecycle & Retention v1
Goal
Implement one bounded shared lifecycle and retention contract over the existing governance-artifact families without widening into a registry UI, purge engine, closure flow, billing overlay, or new browsing console.
Recommended Implementation Order
- Extend the current governance-artifact truth support layer.
- Apply the shared contract to evidence, tenant-review, review-pack, customer-workspace, and signed-download surfaces.
- Add stored-report and accepted-risk decision-history adoption through existing headless model, aggregate, and service seams.
- Add family-local hold or deletion-request persistence only if it can stay on current tables or aggregates without widening scope; otherwise stop at read-only lifecycle truth plus existing download audit.
- Run the focused unit and feature proof and stop.
Implementation Checklist
- Add bounded lifecycle and retention mapping to the current artifact-truth path.
- Keep
EvidenceSnapshotResource,TenantReviewResource,ViewTenantReview,ReviewPackResource, andCustomerReviewWorkspaceon their current action-surface contracts. - Preserve the existing review-pack split: blocked future starts may show a business-state block, but ready retained downloads stay on the current controller path.
- Keep
StoredReportadoption headless through current service, fingerprint, and prune seams. - Keep decision-history adoption inside
FindingException,FindingExceptionDecision, andFindingExceptionServicewithout introducing a second decision console or rewriting current Spec 265 surfaces. - Only add new destructive-like actions on current detail surfaces with
->action(...),->requiresConfirmation(), and server-side authorization after the bounded current-owner persistence gate passes. - Stop if implementation starts demanding a generic artifact table, new console, or browser-heavy proof by default.
Focused Proof Commands
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Unit/Support/GovernanceArtifactTruth/GovernanceArtifactLifecycleContractTest.php
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Evidence/EvidenceSnapshotResourceTest.php tests/Feature/Evidence/EvidenceSnapshotAuditLogTest.php
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/ReviewPack/ReviewPackResourceTest.php tests/Feature/ReviewPack/ReviewPackDownloadTest.php tests/Feature/ReviewPack/ReviewPackEntitlementEnforcementTest.php
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/TenantReview/TenantReviewLifecycleTest.php tests/Feature/TenantReview/TenantReviewUiContractTest.php tests/Feature/Reviews/CustomerReviewWorkspacePackAccessTest.php tests/Feature/Reviews/CustomerReviewWorkspaceLaunchLinksTest.php
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Findings/FindingExceptionRenewalTest.php tests/Feature/Findings/FindingExceptionRevocationTest.php
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/PermissionPosture/StoredReportModelTest.php tests/Feature/PermissionPosture/PruneStoredReportsCommandTest.php tests/Feature/EntraAdminRoles/StoredReportFingerprintTest.php
export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent
Manual Checks Only If Native Proof Is Insufficient
- Open a review-pack detail that is ready, retained, and downloadable, then confirm the surface states reference, lifecycle truth, retention truth, and allowed next action without opening diagnostics.
- Put the workspace into suspended read-only posture and confirm that review-pack generation still blocks before creating a run while signed ready-pack downloads remain available.
- Open the customer review workspace and confirm it stays scan-first with
Open reviewas the dominant row affordance rather than a new download or mutation console. - Open an evidence snapshot detail and confirm it shows linked artifact reference, lifecycle truth, retention truth, and blocked-reason wording without turning the page into a mutation console.
Stop Conditions
- A generic artifact registry table, artifact console, or workflow engine becomes necessary.
- Hold or deletion-request persistence cannot stay on current family tables or aggregate roots.
- Accepted-risk decision adoption requires a current-slice
DecisionRegisterorViewFindingExceptionrewrite instead of staying headless. - The slice starts to require purge, closure, export-before-delete, or support-access workflow semantics.
- Browser tests become the default proving lane instead of a bounded exception.
- The implementation proposes new global-search resources, panel-provider changes, or asset-registration changes for this slice.
Review Close-out
- Re-check
specs/267-artifact-lifecycle-retention/checklists/requirements.mdbefore implementation and close-out. - Keep the review outcome class at
acceptable-special-case, the workflow outcome atkeep, and the test-governance outcome atkeepunless the mutation split gate or a decision-surface rewrite forces escalation. - If the bounded current-owner persistence gate fails, flip the workflow outcome to
splitbefore continuing.