All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
[1.1.0] - 2026-07-09
Changed
- PHP 8.2 support dropped — minimum PHP is now 8.3. The AI features added in this release depend on
artisanpack-ui/ai, which requires PHP 8.3+, so the CI matrix (and the package's ownrequire) can no longer honor 8.2. Apps still on PHP 8.2 should stay on1.0.x.
Security
- Authorization gate on draft persistence —
AiTools::saveDraftnow checks amanageComplianceAiDraftsGate (default-deny, override in the app'sAuthServiceProvider) before writing tocompliance_ai_drafts. Previously any browser session that reached a page mounting the component could persist forged drafts. - Configurable auth guard — the
/api/v1/compliance/ai/*REST routes now read the guard fromconfig('artisanpack.compliance.ai.guard')(defaultsanctum, override viaCOMPLIANCE_AI_GUARD). Consumer apps without Sanctum can point atwebor any configured guard, replacing the previous hard-codedauth:sanctumthat 500'd when Sanctum wasn't installed.
Fixed
- Feature-toggle bypass on save —
AiTools::saveDraftnow rejects saves when the feature is toggled OFF in the FeatureRegistry (was only checkingAI_FEATURE_KEYSmembership). - DPIA risk↔mitigation linkage —
DpiaAssistanceAgent::validateOutputnow enforces that every enumerated risk has a matching mitigation entry (linked byrisk_title). Previously the "every risk must have a mitigation" invariant declared in the prompt was not verified in code, so a partial DPIA could ship as valid output. - Privacy-policy input validation —
PrivacyPolicyDraftAgentnow rejects non-array elements inprocessing_activities, closing a Livewire-only path (REST callers were already covered by the FormRequest) that could send mixed lists to the prompter. - Consent-text short label —
ConsentTextSuggestionAgentnow throwsFeatureErrorwhen the model returns an emptyshort_label. An unlabelled consent checkbox does not meet the "clear affirmative act" standard.
Added
- AI integration — three high-stakes agents powered by
artisanpack-ui/ai(soft dependency):compliance.privacy_policy_draft(PrivacyPolicyDraftAgent, default modelclaude-opus-4-7) — drafts a starter privacy policy from declared processing activities.compliance.dpia_assistance(DpiaAssistanceAgent, default modelclaude-opus-4-7) — enumerates risks, mitigations, and stakeholder impacts for a DPIA.compliance.consent_text(ConsentTextSuggestionAgent, default modelclaude-sonnet-4-6) — suggests plain-language consent text with reading-level score and jurisdiction notes.
- Guardrail contract — every agent forces
requires_legal_review: trueand a non-emptyreview_checkliston its output; the host UI is required to render an un-dismissable "requires legal review" banner and an acknowledgement checkbox before the draft body is shown. - Append-only draft storage — new
compliance_ai_draftstable +AiDraftmodel preserve every generation as a new row; the model throws on any attempt to update an existing draft. - Trigger surfaces — Livewire component
ap-compliance-ai-toolsfor Blade/Livewire hosts, plus/api/v1/compliance/ai/*REST endpoints (Sanctum-gated) for React and Vue hosts. Both are skipped whenartisanpack-ui/aiis not installed. (#18, #19, #20)
[1.0.1] - 2026-06-14
Added
- Laravel 13 support — widened
illuminate/supportconstraint to^10.0|^11.0|^12.0|^13.0so consumer apps (andartisanpack-ui/security-full, which pulls Compliance in transitively) can adopt Laravel 13. PHP^8.2is preserved; Composer's solver picks Laravel 10/11/12 on PHP 8.2 and only picks Laravel 13 on PHP 8.3+. (#15)
Changed
- CI matrix —
Testjob now runs across Laravel 12/13 × PHP 8.2/8.3/8.4 (excluding L13/PHP 8.2, which Laravel 13 itself forbids). Workflow also gainedrelease/**triggers and least-privilegepermissions: contents: read+persist-credentials: falsehardening. - Dev dependency constraints widened to unblock the Laravel 13 leg —
pestphp/pest→^3.8|^4.0pestphp/pest-plugin-laravel→^3.2|^4.0orchestra/testbench→^10.2|^11.0
[1.0.0] - 2026-05-18
Added
- Initial release of the standalone Compliance package, extracted from
artisanpack-ui/security1.x as part of the Security 2.0 package split. - Consent management — versioned
ConsentPolicyper purpose, per-userConsentRecordwith status lifecycle, immutableConsentAuditLog,ConsentManagerservice,ConsentPolicyServicefor version transitions,CookieConsentHandler,check.consentroute middleware. - Data subject rights —
ErasureServiceorchestrating pluggableErasureHandlerInterfaceimplementations with logged outcomes per handler and exemption tracking;PortabilityServicewith pluggableDataExporterInterfaceproviders and downloadable JSON / XML / CSV exports. - DPIA + processing activities — Article 30
ProcessingActivityrecords, Article 35DataProtectionAssessmentwith risk + mitigation tracking,RiskCalculatorfor inherent + residual scoring,DpiaServicefor full assessment lifecycle. - Data minimization —
AnonymizationEngine,PseudonymizationEngine,DataMinimizerService,data.minimizationroute middleware. - Retention policies —
RetentionPolicy+CollectionPolicymodels,PurgeExpiredDataconsole command, configurable deletion strategy (delete / anonymize / archive). - Compliance monitoring —
ComplianceMonitorruns pluggableComplianceCheckInterfaceimplementations, persistsComplianceCheckResultrows, raisesComplianceViolationrecords, computesComplianceScoresnapshots with letter-grade output. - Reporting —
ReportGeneratorwith pluggableReportTypeInterfaceproviders,ScheduledComplianceReportmodel for cron-driven delivery, multi-format output (PDF / HTML / CSV / JSON). - 17 Eloquent models —
ConsentPolicy,ConsentRecord,ConsentAuditLog,ProcessingActivity,DataProtectionAssessment,AssessmentRisk,RiskMitigation,ErasureRequest,ErasureLog,PortabilityRequest,ExportSchema,RetentionPolicy,CollectionPolicy,ComplianceViolation,ComplianceCheckResult,ComplianceScore,ScheduledComplianceReport, plus thePrivacyAwareModelbase class. - 18 migrations creating every backing table with foreign keys, indices, and a guarded unique-granted-consent constraint.
- 5 console commands —
RunComplianceChecks,ProcessErasureRequests,ProcessPortabilityRequests,PurgeExpiredData,GenerateComplianceReport. - 4 HTTP controllers —
ConsentController,ErasureController,PortabilityController,ComplianceDashboardController(gated behind a default-denyviewComplianceDashboardGate). - 8 events —
ConsentGranted,ConsentWithdrawn,ErasureRequested,ErasureCompleted,DataExportRequested,DataExportCompleted,ComplianceCheckCompleted,ComplianceViolationDetected— auto-listened by the service provider so apps get an audit trail in the log without wiring anything up. - 5 contract interfaces —
ComplianceCheckInterface,ConsentStorageInterface,DataExporterInterface,ErasureHandlerInterface,ReportTypeInterface— for extending the toolkit with organization-specific behaviour. - Helper function
compliance()plusComplianceFacade entry points. - PHP-CS-Fixer + PHPCS code style enforcement matching the ArtisanPack UI ecosystem conventions (WordPress-style spacing, Yoda conditions, aligned operators).
Notes
The pre-1.0 0.1.0 scaffold release shipped with import references to model classes that did not yet exist as PHP files (the migrations created the tables, but the Eloquent classes were missing). 1.0.0 ships the full set of 17 model classes and brings the package to a runnable state.

