Repository navigation
Description
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:
- ADR-12 (fix(verify): a narrowed test command cannot earn SAFE #112): a narrowed
testCmdfloors atUNPROVEN - ADR-11 (fix(verify): SAFE requires every coverable changed statement #113):
SAFErequires every coverable changed statement to have executed
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:
- Name.
engineVersionversusproducedByversusrefactronVersion. It is a published field, so renaming later is breaking. - Optional or required. Optional matches every other additive field and lets a consumer distinguish reports produced before it existed. Required is cleaner going forward.
- Does
reportVersionstay? Yes — they answer different questions — but the docs must say which is which, or consumers will use the wrong one. - 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
VerdictReportcarries the producer version, additive,reportVersionunchanged at1.docs/mcp/tool-reference.mdxanddocs/verification/verify-diff.mdxstate the difference between the two version fields in one sentence each.- Serialized on both surfaces (
--jsonand MCP), asserted by a test on each. - Snapshot and shape tests do not break on a version bump.
- 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