Skip to content

Add an annotations field to the target contract for adapter-reported checks #40

Description

@ChelseaKR

What

The target contract carries text, citations, context_ids, refused, and escalated. The real-target adapters under real_targets/ need to report two more things: how many claims the target withheld, and what the harness's own quote check found. Today both travel as bracketed suffixes on the observed text and as counters in the provenance block, which docs/real-targets.md calls legible but not a contract, and names as the obvious next change.

Add an optional annotations list to TargetResponse and to the HTTP response body: {"kind": str, "detail": str, "count": int | null, "ref": str | null} with a closed enum of kinds (withheld_claim, quote_verified, quote_not_found, quote_unverifiable, adapter_note). The evidence pack renders them per case and totals them per gate.

Why it matters

A reviewer reading a pack cannot currently see per-quote check outcomes without opening the recording beside it. Making annotations part of the versioned structure keeps the pack self-describing, keeps text as exactly what the target said, and gives issue #31's recordings a field to replay. Gates keep validating only the fields they check today; annotations inform, they never infer.

Scope

  • annotations on TargetResponse, to_dict, response_from_payload (strict: unknown kind or malformed entry is a TargetProtocolError, exit 2).
  • Results and pack schema version bump; a rendered "Adapter annotations" section in both forms.
  • Migrate the three adapters off text suffixes; recordings carry the field.
  • A target that omits the field behaves exactly as before.

Out of scope

  • Any gate changing its verdict on an annotation.
  • Judge rubric inputs.

Done when

  • An HTTP target returning annotations renders them in evidence.md and evidence.json.
  • A payload with an unknown kind is refused with exit 2 and no results file.
  • The committed real-target packs regenerate with no bracketed suffix left in any observed text.
  • A target omitting annotations yields a byte-identical pack to today.

Pointers

Proposed with AI assistance.

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

    enhancementNew feature or requestfeatureMajor new capability proposal

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions