π UX-CLAIMS-DISPUTES.md
This document specifies UX patterns for Claims & Disputes in Evalium.
Goal:
- keep contested-result workflows operationally simple
- preserve legal/audit defensibility
- prevent ambiguous or non-reproducible decisions
Capability Baseline (Validated 2026-02-25)β
Backend-live now:
- Claims API: list/get/create, event append, ratification.
- Disputes API: list/get/create, event append, ratification.
- Event-led lifecycle and status derivation are live.
- Verification/context policy enforcement and step-up integration are live.
- Idempotency-key enforcement is live on create/event/ratify writes.
Current workflow gap:
- End-to-end product UX for claims/disputes is not yet first-class in frontend.
Implication:
- This doc defines the first-class UX contract to activate existing backend primitives without inventing new truth models.
0. Doctrine (MUST)β
- Claim/Dispute is evidence-first: every assertion or challenge is linked to a defensible source.
- Event history is canonical: lifecycle is append-only; no destructive edits.
- Status is derived from events/rules: UI must not allow manual status mutation outside defined actions.
- High-assurance actions are explicit: ratification requires step-up and visible confirmation copy.
- Cross-surface continuity: claims/disputes must deep-link to submissions, findings, and ledger context.
0.1 Claims/Disputes Interface Guardrails (MUST)β
- All lifecycle actions append events; no UI path may imply destructive edit of prior events.
- Legal/defensibility states must be presented with deterministic labels and explicit timestamped context.
- Ratification and other high-assurance actions must include step-up UX and clear irreversible-impact messaging.
- Evidence/source references must be linkable and accessible via keyboard and screen reader.
- Mobile/iPad supports filing, viewing, and basic response actions; deep legal review workflows may be desktop-optimized with explicit handoff.
- Error handling must distinguish validation, policy, and permission failures with actionable next steps.
1. Core Domain Semantics (UX Contract)β
1.1 Claimsβ
A Claim is a professional assertion bound to:
- a subject (
subjectId) - a claim type + statement
- one or more sources:
submissionIdsubmissionItemIdledgerEventId
Claim event types:
assertedamendedwithdrawnvoidednoteratified(via ratify endpoint)
Claim validity semantics:
validFrom, optionalvalidUntil- computed
validityStatus:future/active/expired - list filter supports
validAt
1.2 Disputesβ
A Dispute is a formal challenge targeting exactly one of:
claimIdsubmissionIdsubmissionItemId
Dispute event types:
opened(system-generated on create)challengeresponseresolutionwithdrawnnoteratified(via ratify endpoint)
Dispute status semantics:
- initial
open resolutionevent ->resolvedwithdrawnevent ->withdrawn
Implementation note:
- default list behavior hides withdrawn disputes unless explicitly filtered.
2. Information Architectureβ
Primary pages:
- Claims Hub (
/claims) - Claim Detail (
/claims/:id) - Disputes Hub (
/disputes) - Dispute Detail (
/disputes/:id)
Context drawers (read-only peek on drawer-enabled surfaces):
- Subject
- Related submission/submission item
- Related finding/ledger event (where linked)
Primary assets and edit/deeper workflows (full page):
- Claim
- Dispute
- Submission
3. Claims UXβ
3.1 Claims Hub (List)β
Columns (minimum):
- Claim type
- Statement (truncated)
- Subject
- Status
- Validity status (
future/active/expired) - Valid from / until
- Created at
- Created by
Filters:
subjectIdactorUserIdclaimTypestatusvalidAt
Actions:
- Create claim
- Open detail
3.2 Create Claim (Wizard or Modal)β
Required fields:
- Subject
- Claim type
- Statement
- At least one source reference
Optional fields:
- Status override (advanced; default to asserted behavior)
- Valid from / valid until
- Authority/context metadata
Validation rules (MUST):
validUntilmust be aftervalidFrom- each source must reference at least one of submission/submission-item/ledger-event
- idempotency key attached on submit
3.3 Claim Detailβ
Sections:
- Claim Summary
- Sources
- Event Timeline
- Validity Window
- Ratification Panel
Timeline composer actions:
- Amend
- Add note
- Withdraw
- Void
Each timeline event shows:
- event type
- timestamp
- actor
- message
- context metadata indicator (if present)
4. Disputes UXβ
4.1 Disputes Hub (List)β
Columns (minimum):
- Dispute ID
- Target type (claim/submission/item)
- Target reference
- Reason (truncated)
- Status
- Updated at
- Created by
Filters:
subjectIdclaimIdsubmissionIdsubmissionItemIdstatus
Actions:
- Open dispute
- Create dispute
4.2 Create Disputeβ
Required fields:
- Exactly one target (claim OR submission OR submission item)
- Reason
Optional:
- Subject
- Context/metadata
Validation rules (MUST):
- enforce one-target-only selector in UI
- idempotency key attached on submit
4.3 Dispute Detailβ
Sections:
- Dispute Summary
- Target Context
- Event Timeline
- Ratification Panel
Timeline composer actions:
- Challenge
- Response
- Resolution
- Withdraw
- Note
Validation rules (MUST):
- dispute event
messageis required for challenge/response/resolution/withdrawn/note - idempotency key attached on event submit
5. Ratification UX (Claims + Disputes)β
Ratification is a high-assurance action and must use a dedicated flow.
5.1 Ratify Action Contractβ
Required:
- step-up method
- step-up token
Optional:
stateHash- comment
- verified-at timestamp
UX requirements:
- explicit high-stakes confirmation copy
- display reason/comment box
- clear error for missing step-up (
step_up_required) - idempotency key attached on ratify submit
5.2 Ratification Resultβ
On success:
- show immutable
ratifiedevent in timeline - show returned status payload (
ratified) - show who/when details
6. Cross-Linking & Explainabilityβ
6.1 Linking Rulesβ
Claims/disputes must link to:
- related submission detail
- related submission item context
- related ledger/finding anchor where present
Observation linkage:
- where findings are present, use finding/ledger references to anchor claim/dispute rationale.
6.2 Evidence Basis Ruleβ
Claims/disputes are not stand-alone opinions in UI:
- every claim/dispute view must surface source references prominently.
- unresolved items without clear sources should be visually flagged for follow-up.
7. Status & State Language (Canonical)β
Claims:
- status from backend claim status field
- validity shown separately:
future,active,expired
Disputes:
open,resolved,withdrawn
Do not merge validity and lifecycle into one badge.
8. Permissions & Safetyβ
Capability model:
- read:
claims.readdisputes.read
- write/manage:
claims.managedisputes.manage
Rules:
- hide mutating controls if manage capability is missing.
- keep read surfaces visible if read capability exists.
- preserve org/tenant RLS boundaries in all list/detail views.
9. Error, Retry, and Idempotency UXβ
Writes covered:
- create claim
- add claim event
- ratify claim
- create dispute
- add dispute event
- ratify dispute
UX behavior:
- attach
Idempotency-Keyon each write intent. - on replay, show deterministic success replay outcome.
- on hash mismatch/key reuse, show conflict with βrequest already used for different payload.β
- show structured validation errors inline (not raw backend strings).
10. Screen-Level Definition of Doneβ
Before enabling claims/disputes frontend:
- Claim and dispute list pages with canonical filters are implemented.
- Detail pages render timeline, sources/target context, and status chips.
- Event composer enforces allowed event types and required message rules.
- Ratification flow requires step-up and handles
step_up_requiredcleanly. - Idempotency-key behavior is implemented on all mutating actions.
- Links to submissions/finding anchors/ledger context are present.
- RLS/capability gates are enforced in UI controls.
- Accessibility and keyboard navigation verified for list/detail/drawer flows.
11. Navigation Contract Summaryβ
| Task | Pattern | Primary CTA | Link Contract |
|---|---|---|---|
| Review claims | Table + filters | Open claim | Subject/source peek drawers + claim full page |
| Create claim | Wizard/modal | Create claim | Source links to submission/item/ledger |
| Evolve claim lifecycle | Timeline composer | Add event | Event audit trail inline |
| Review disputes | Table + filters | Open dispute | Target context peek + dispute full page |
| Progress dispute | Timeline composer | Add response/resolution | Source and target links preserved |
| Ratify outcome | Guarded modal | Ratify | Step-up proof required |