Skip to content

feat(analyst): open the EvidenceRef.kind union to caller-defined kinds #704

Description

@drewstone

What is missing

EvidenceRef.kind is a closed union of five strings, so a custom analyst cannot name a new evidence source. It has to misclassify the reference under one of the five, or add conversion code that loses the real kind:

kind: 'span' | 'event' | 'artifact' | 'finding' | 'metric'

Ask: keep the five known kinds and accept caller-defined string kinds beside them. Preserve every kind and URI unchanged through validation, canonical hashing, finding identity, codecs, the file ledger journal, the ledger projector, recursive-run analysis, and rendering — a custom kind must not change a finding's canonical identity or be dropped on a round trip.

Where it lives today

Nothing local implements a workaround; the constraint is absorbed by not using custom evidence kinds. This is recorded as contract gap 1 in the Discovery wiki, docs/16-upstream-plan.md:8-22, written on 2026-07-30 and never filed until now. The wiki's Discovery-side outcome is stated there as "no evidence type or adapter" — the point of filing it here is that the consumer must not grow its own.

Where it belongs

src/analyst/types.ts:90 — the kind field of export interface EvidenceRef at :83, whose doc comment at :84-89 names what each of the five means. The type is re-exported from src/index.ts:461 and validated in src/feedback-trajectory-review.ts:792 (validateEvidenceRefs).

Measured motive

This gap is a contract limit rather than a failure count: the union is closed at five members, so the number of caller-definable evidence sources is 0. It has been open since 2026-07-30 and is still closed at the published 0.171.0.

Acceptance

Closed when a test writes a finding carrying a caller-defined kind, restarts, projects, rolls up, and renders it, and asserts the kind and URI survive with an unchanged canonical digest.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions