8.0 KiB
8.0 KiB
Data Model: Baseline Compare Summary Trust Propagation & Compliance Claim Hardening
Overview
This feature introduces no new persistence model. The data model is a derived view-model contract that lifts existing compare truth, explanation, and evidence signals into compact summary surfaces.
Derived Entities
1. BaselineCompareStats
- Type: existing immutable support DTO
- Source:
app/Support/Baselines/BaselineCompareStats - Responsibility: canonical aggregate of baseline assignment state, latest compare run state, findings totals, severity counts, coverage status, reason code, evidence-gap totals, diagnostics, and related run identity
- Relevant fields for this feature:
statemessagereasonCodereasonMessageoperationRunIdfindingsCountseverityCountscoverageStatusuncoveredTypesCountuncoveredTypesfidelityevidenceGapsCountevidenceGapDetailslastComparedHumanlastComparedIso
2. OperatorExplanationPattern
- Type: existing derived explanation object
- Source:
BaselineCompareExplanationRegistry::forStats()viaBaselineCompareStats::operatorExplanation() - Responsibility: translates stats into explanation family, evaluation result, trustworthiness, reliability statement, coverage statement, dominant cause, and next action
- Relevant fields for this feature:
familyheadlineexecutionOutcomeevaluationResulttrustworthinessLevelreliabilityStatementcoverageStatementdominantCauseCodedominantCauseLabelnextActionCategorynextActionTextcountDescriptors
3. BaselineSummaryAssessment
- Type: new derived support-layer contract
- Persistence: none
- Responsibility: one compact summary-safe interpretation of the current baseline compare posture that can be rendered consistently across dashboard, banner, and landing summary surfaces
- Documentation note:
not-readyin the spec or task wording is not an extra enum value; it must resolve to eitherin_progressorunavailablein the formal contract.
Proposed Fields
stateFamily: one ofpositive,caution,stale,action_required,unavailable,in_progressheadline: strongest safe primary statement for the current compare posturesupportingMessage: short secondary explanation, optionaltone: centralized tone or badge domain for rendering emphasispositiveClaimAllowed: boolean guard used to block compliant or no-drift wordingtrustworthinessLevel: copied or normalized from operator explanationevaluationResult: copied or normalized from operator explanation, includingfailed_resultwhen compare execution failed or produced no decision-grade artifactevidenceImpact: enum-like derived label such asnone,coverage_warning,evidence_gap,stale_result,suppressed_output,unavailablefindingsVisibleCount: numeric descriptor, not itself the verdicthighSeverityCount: numeric descriptor for compact severity emphasisnextAction: structured object with:label: concise action cuetarget: one oflanding,findings,run,none
lastComparedLabel: relative-time summary where applicablereasonCode: current dominant reason code when one exists
Validation Rules
positiveClaimAllowedmay betrueonly when:- a usable compare result exists
- trustworthiness is decision-grade
- evaluation result is not incomplete, suppressed, failed, or unavailable
- there is no material evidence or coverage limitation undermining the claim
stateFamily = positiverequirespositiveClaimAllowed = truestateFamily = cautionrequires a usable but limited resultstateFamily = stalerequires a usable but no-longer-fresh result whose age materially limits the safety of an all-clear claimstateFamily = action_requiredrequires confirmed drift, failed compare execution, or another follow-up-critical statestateFamily = unavailablerequires no usable result, no snapshot, compare never run, or equivalent pre-execution unavailabilityheadlinemust never be semantically stronger than the current explanation family and trustworthiness combination
4. Surface Consumption Profile
- Type: new derived rendering hint, optionally implicit rather than a dedicated class
- Persistence: none
- Responsibility: allows the same summary assessment to render at different compactness levels without changing its semantic meaning
Candidate Variants
dashboard_widgetneeds_attentioncoverage_bannerlanding_summarycanonical_detail_reference
Expected Behavior
- All variants share the same
stateFamily,headline, andpositiveClaimAllowed - Variants may differ in verbosity, badge count, and which next-action link is most prominent
- No variant may upgrade a cautionary or unavailable assessment into a positive assessment
Relationships
BaselineCompareStats->OperatorExplanationPatternBaselineCompareStats+OperatorExplanationPattern->BaselineSummaryAssessmentBaselineSummaryAssessment+Surface Consumption Profile-> rendered widget, banner, or landing summary output- Canonical run detail remains the deeper truth surface that validates the same underlying explanation and reason semantics
State Families
Positive
- Meaning: no confirmed drift and the result is safe to treat as trustworthy
- Allowed only when positive-claim guard passes
- Example outcomes:
- trustworthy no-result with no material evidence limitation
Caution
- Meaning: no all-clear claim is allowed because the result is limited, incomplete, or partially reliable
- Typical drivers:
- evidence gaps
- coverage warnings
- suppressed output
- limited-confidence explanation family
Stale
- Meaning: a previously usable compare result exists, but its freshness is no longer strong enough to support a current-state all-clear claim
- Typical drivers:
- aged compare history beyond the current freshness threshold
- no newer compare since a material tenant or baseline change
Action Required
- Meaning: confirmed drift, failed compare requiring review, or another immediately actionable posture
- Typical drivers:
- visible open drift findings
- failed compare with explicit investigation path
Unavailable
- Meaning: no usable compare result currently exists
- Typical drivers:
- no assignment
- no snapshot
- compare never run
- blocked prerequisite
In Progress
- Meaning: compare is queued or running and current numbers are diagnostic only
- Typical drivers:
- active compare operation run
State Transitions
The summary-state family is derived, not persisted. Expected transition patterns:
unavailable->in_progresswhen a compare startsin_progress->positivewhen the compare completes with trustworthy no-result semanticsin_progress->cautionwhen the compare completes with limited-confidence or suppressed-result semanticspositiveorcaution->stalewhen freshness decays below the decision-grade threshold without a newer comparestale->in_progresswhen a refresh compare startsin_progress->action_requiredwhen the compare records open drift findings or a failure state demanding reviewpositive->cautionif later evidence or coverage limits undercut trustworthinesspositiveorcaution->unavailablewhen no consumable snapshot or no usable result remains available
Test-Critical Invariants
0 findingsmust not forcestateFamily = positivepositiveClaimAllowed = falsemust blockCompliant,No drift,No open drift, and equivalent copy on all compact surfaces- Evidence gaps must be able to move a surface from
positivetocautioneven whencoverageStatus = ok - Stale compare history must not collapse into
unavailableorpositive; it needs its own compact summary semantics - Dashboard and landing surfaces consuming the same assessment must not disagree on the primary state family
- Compact surfaces may omit details, but not semantic qualifiers