TenantAtlas/specs/167-derived-state-memoization/contracts/request-scoped-derived-state-key.schema.json
ahmido d98dc30520 feat: add request-scoped derived state memoization (#198)
## Summary
- add a request-scoped derived-state store with deterministic keying and freshness controls
- adopt the shared contract in ArtifactTruthPresenter, OperationUxPresenter, and RelatedNavigationResolver plus the covered Filament consumers
- add spec, plan, contracts, guardrails, and focused memoization and freshness test coverage for spec 167

## Verification
- vendor/bin/sail artisan test --compact tests/Feature/078/RelatedLinksOnDetailTest.php
- vendor/bin/sail artisan test --compact tests/Feature/078/ tests/Feature/Operations/TenantlessOperationRunViewerTest.php tests/Feature/Monitoring/OperationsCanonicalUrlsTest.php tests/Feature/Monitoring/OperationsTenantScopeTest.php tests/Feature/Verification/VerificationAuthorizationTest.php tests/Feature/Verification/VerificationReportViewerDbOnlyTest.php tests/Feature/Verification/VerificationReportRedactionTest.php tests/Feature/Verification/VerificationReportMissingOrMalformedTest.php tests/Feature/OpsUx/FailureSanitizationTest.php tests/Feature/OpsUx/CanonicalViewRunLinksTest.php
- vendor/bin/sail bin pint --dirty --format agent

## Notes
- Livewire v4.0+ compliance preserved
- provider registration remains in bootstrap/providers.php
- no Filament assets or panel registration changes
- no global-search behavior changes
- no destructive action behavior changes in this PR

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #198
2026-03-28 14:58:30 +00:00

72 lines
1.8 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://tenantpilot.local/contracts/request-scoped-derived-state-key.schema.json",
"title": "RequestScopedDerivedStateKey",
"description": "Deterministic key used to identify one reusable derived-state result inside a single request. This schema describes the internal runtime key shape using snake_case field names; the logical OpenAPI contract documents an equivalent camelCase transport form that must normalize back to this structure.",
"type": "object",
"additionalProperties": false,
"required": [
"family",
"record_class",
"record_key",
"variant"
],
"properties": {
"family": {
"type": "string",
"enum": [
"artifact_truth",
"operation_ux_guidance",
"operation_ux_explanation",
"related_navigation_primary",
"related_navigation_detail",
"related_navigation_header"
]
},
"record_class": {
"type": "string",
"minLength": 1,
"examples": [
"App\\Models\\TenantReview"
]
},
"record_key": {
"type": "string",
"minLength": 1,
"examples": [
"42"
]
},
"variant": {
"type": "string",
"minLength": 1,
"examples": [
"list_row",
"detail_page",
"header_action"
]
},
"workspace_id": {
"type": [
"integer",
"null"
],
"minimum": 1
},
"tenant_id": {
"type": [
"integer",
"null"
],
"minimum": 1
},
"context_hash": {
"type": [
"string",
"null"
],
"minLength": 1,
"description": "Stable hash of additional scope-sensitive or capability-sensitive inputs required to distinguish the result."
}
}
}