Skip to content

Make resolution (resolvedTo / confidence / warnings) ergonomic to consume #832

Description

@medelman17

Motivation

When called with { resolve: true }, short-form citations carry a resolution object (resolvedTo, antecedentIndex, confidence, warnings). But resolution is typed only on the ResolvedCitation<C> wrapper — it's undefined on the base Citation — so consumers tend to read just the resolvedTo index and drop confidence/warnings.

That's a loss: the resolver does real work to compute those signals (confidence downgrades on chained/ambiguous Id., soft bracket-balance caps, supra non-unique-key abstention, etc.). A consumer that can't easily reach them has no way to act on the library's own uncertainty and only discovers a bad resolution much further downstream.

Proposal

  • Make resolution (or a getResolution(citation) helper) reachable without the ResolvedCitation narrowing dance, and/or document the intended pattern for consuming confidence + warnings.
  • Optionally add a convenience accessor returning the resolved antecedent citation plus its confidence/warnings in one shot.

Benefit

Consumers can gate on resolution confidence (e.g. flag or down-rank low-confidence Id. binds) instead of treating every resolvedTo as equally trustworthy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority:lowP3 — edge cases, rare formats, cosmeticready-for-agentFully specified, ready for an AFK agentresolutionCitation resolution issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions