Skip to content

Answer-card projection: compact per-claim view-model for in-stream rendering #205

Description

@briananderson1222

Answer-card projection: compact per-claim view-model for in-stream rendering

Driver: kontourai/station#1391 (per-answer provenance cards — "what did the AI base its answer on"). Every chat answer gets a collapsible card; the card drills into a full trust report.

Today a consumer must hand-roll the fold: explainClaim + buildDerivationDrilldown return the full recursive tree with complete evidence context per node — right for a panel, verbose for a chat stream. Every consumer building a card would duplicate the same reduction.

Scope

A pure, DOM-free exported function beside src/claim-explanation.ts, e.g. buildAnswerCardProjection(report, claimId), returning a compact flat view-model:

  • claim status + freshness (asOf, expiresAt, stale) + materiality
  • subject/value summary
  • evidence items partitioned cited vs entails (partitionEvidenceBySupport is already exported — the card's core visual distinction)
  • direct derivation inputs (one level, with method/supportStrength/rationale per edge; drilldown handles deeper)
  • transparency gaps touching this claim
  • transparency-gaps-shown-never-hidden is the card's trust contract — projection must make gaps un-omittable (present in the type, not optional)

Non-goals

  • No DOM/rendering (headless path stays the embedding story)
  • No new schema fields — this is a projection over existing records

Notes

examples/system-card/ (LLM model card) is the closest existing template and a good test bed: the projection should render that example's bundles sensibly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions