6.9 KiB
6.9 KiB
Data Model: Finding Governance Health & Resolution Semantics Surface Hardening
1. Finding
- Purpose: Tenant-owned issue record that carries workflow lifecycle, severity, due state, ownership, and evidence-backed diagnostic context.
- Ownership: Tenant-owned (
workspace_id+tenant_idalready exist). - Relevant existing fields:
idworkspace_idtenant_idfinding_typestatus:new,acknowledged,triaged,in_progress,reopened,resolved,closed,risk_acceptedseverityowner_user_idassignee_user_iddue_atsla_daysresolved_at,resolved_reasonclosed_at,closed_reason,closed_by_user_idreopened_at,triaged_at,in_progress_atcurrent_operation_run_id,baseline_operation_run_idevidence_jsonb
- Relationships:
- belongs to
Tenant - has one current
FindingException - belongs to owner, assignee, acknowledged-by, and closed-by users
- belongs to
- Existing invariants preserved:
- Workflow status remains the source of lifecycle truth.
risk_acceptedremains a finding workflow state, not proof of healthy governance by itself.- Open-status and terminal-status helper behavior does not change in this slice.
2. FindingException
- Purpose: Tenant-owned governance record that determines whether accepted risk is currently backed by valid, expiring, expired, revoked, rejected, or missing-support governance.
- Ownership: Tenant-owned (
workspace_id+tenant_idalready exist). - Relevant existing fields:
idworkspace_idtenant_idfinding_idstatus:pending,active,expiring,expired,rejected,revoked,supersededcurrent_validity_state:valid,expiring,expired,revoked,rejected,missing_supportrequested_by_user_idowner_user_idapproved_by_user_idrequest_reason,approval_reason,rejection_reason,revocation_reasonrequested_at,approved_at,rejected_at,revoked_ateffective_from,review_due_at,expires_atcurrent_decision_idevidence_summary
- Relationships:
- belongs to
Finding - belongs to requester, owner, approver, and current decision
- has many decisions and evidence references
- belongs to
- Existing invariants preserved:
- Governance validity remains derived from exception state and timing.
- The exception remains the authoritative source for healthy versus lapsed governance.
3. Derived Surface Projection: Finding Governance Surface State
- Purpose: Non-persisted operator-facing projection used by findings list, finding detail, exception surfaces, and summary widgets.
- Derived from:
Finding.statusFinding.severityFinding.owner_user_id,Finding.assignee_user_id,Finding.due_at- linked
FindingException FindingRiskGovernanceResolver::resolveFindingState()FindingRiskGovernanceResolver::resolveWarningMessage()
- Proposed derived fields:
workflow_status: current finding status valueworkflow_family:active,accepted_risk, orhistoricalgovernance_validity:valid,expiring,expired,revoked,rejected,missing_support, ornullgovernance_attention:healthy,attention_needed, ornot_applicablegovernance_warning: nullable operator-readable warning messagedue_attention:overdue,due_soon,noneownership_attention:assigned,owner_missing,assignee_missing, orboth_missingwhere relevantresolution_context: nullable secondary text such asno longer observedwhen derivableprimary_next_action: derived operator guidance such as inspect exception, renew governance, review overdue finding, or review historical closure
- Invariant:
- This projection is derived only. It must not become a new stored truth or a replacement status enum.
4. Derived Surface Projection: Finding Detail Status Zone
- Purpose: Non-persisted grouping for the leading zone on finding detail.
- Derived from:
- the Finding Governance Surface State
- existing finding severity and related owner or assignee relationships
- existing exception owner or approver details when relevant
- Required visible fields:
- lifecycle status
- severity or priority
- governance validity and warning when applicable
- owner and assignee context
- due or SLA urgency
- next-step guidance
- Invariant:
- This zone reorganizes existing truth only; it does not add a new domain layer.
5. Derived Surface Projection: Tenant Governance Attention Summary
- Purpose: Non-persisted aggregate for dashboard and baseline-compare summary surfaces.
- Derived from:
- findings with open or terminal statuses
- overdue findings in open workflow states
- accepted-risk findings whose governance projection resolves to expiring, expired, revoked, rejected, or missing-support states
- existing compare summary state from
BaselineCompareStats
- Proposed aggregate values:
overdue_open_findings_countexpiring_governance_countlapsed_governance_countactive_non_new_findings_counthigh_severity_active_findings_counthealthy_checksfallback only when none of the above require attention
- Invariant:
- Summary surfaces remain glance-first and DB-only. They surface operator-critical truth without becoming a new reporting system.
Surface State Families
Finding workflow families
active:new,acknowledged,triaged,in_progress,reopenedaccepted_risk:risk_acceptedhistorical:resolved,closed
Governance-health families
healthy: accepted risk withvalidgovernanceattention_needed: accepted risk withexpiring,expired,revoked,rejected, ormissing_supportgovernancenot_applicable: active or historical findings without current governance relevance
Urgency families
overdue: open finding with due date in the pastdue_soon: open finding approaching due threshold if current UI supports itnone: no immediate due urgency signal
Relationship Rules
- A finding can exist without an exception.
- A finding in
risk_acceptedstatus without a valid linked exception must project as governance attention, not as healthy accepted risk. - A finding outside
risk_acceptedmay still have historical exception context, but workflow lifecycle remains the primary status dimension. - Exception surfaces and finding surfaces must render the same governance truth for the same finding or exception combination.
Behavioral Invariants For This Spec
- No new persisted entity, table, enum, or status family is introduced.
resolvedandclosedremain workflow states and do not gain implicit technical-remediation meaning.- Governance validity remains derived from exception truth, not from finding status alone.
- Summary attention must not count only
newfindings when overdue or lapsed-governance conditions already exist.