Skip to content

Add a producer version to VerdictReport #121

Closed

Description

@omsherikar

Problem

reportVersion answers "can I parse this?". It does not answer "what did SAFE mean when this was written?" — and that question now has two different answers within the 0.4.x line.

Two merged ADRs changed the semantics of verdict without changing the shape of VerdictReport:

Both correctly left reportVersion at 1: no field was added, renamed, retyped or removed. Both ADRs also independently reached for the same follow-up, which is the signal that the gap is structural rather than incidental.

Why a producer version is the right answer

A consumer storing reports as fleet history can partition the ADR-11 change by inspecting the body (SAFE with changedStatements.covered < total was earned under the old rule) and the ADR-12 change by the presence of testScope. Both work, both are archaeology, and neither generalises: the next semantic tightening will need a third bespoke trick, and one of them will eventually not be recoverable from the body at all.

One additive string field answers all of them at once, and stops each future ADR relitigating the reportVersion question. The value already exists — src/mcp/server.ts reads the package version.

Direction

Add engineVersion: string to VerdictReport, populated from package.json.

Decisions this needs, which is why it is not a five-minute change:

  1. Name. engineVersion versus producedBy versus refactronVersion. It is a published field, so renaming later is breaking.
  2. Optional or required. Optional matches every other additive field and lets a consumer distinguish reports produced before it existed. Required is cleaner going forward.
  3. Does reportVersion stay? Yes — they answer different questions — but the docs must say which is which, or consumers will use the wrong one.
  4. Determinism in tests. A version string embedded in every report will churn snapshot assertions on every release. Existing report-shape tests need to tolerate it.

Acceptance criteria

  1. VerdictReport carries the producer version, additive, reportVersion unchanged at 1.
  2. docs/mcp/tool-reference.mdx and docs/verification/verify-diff.mdx state the difference between the two version fields in one sentence each.
  3. Serialized on both surfaces (--json and MCP), asserted by a test on each.
  4. Snapshot and shape tests do not break on a version bump.
  5. An ADR recording the naming decision, since the field cannot be renamed after release.

Non-goals

  • Bumping reportVersion. Neither merged ADR warranted it and this issue does not change that.
  • A machine-readable capability descriptor. One version string, not a feature matrix.

Verdict integrity

No verdict changes. This is about whether a stored SAFE can be interpreted correctly a year after it was written.

Activity

  1. added
    enhancement
    on Aug 17, 2026
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions