Task — engineering-spec@1

Structured review findings alongside the prose packet

doneTASK-IMP-112
module improvement · class product · priority p2 · created 2026-07-17 · shipped null
depends on none · blocks none

TASK-IMP-112: Structured review findings alongside the prose packet

Summary

code-review.md is a prose packet: excellent for a human, opaque to a machine. Nothing downstream can count findings, route them, or act on them. Emit review-findings@1 (JSON) beside the markdown - one record per finding with file, line, severity, clause reference, and suggested fix - keeping the prose as the human artefact.

Problem

code-review-author/SKILL.md declares envelopes/input.json and envelopes/output.json schema_refs at lines 44 and 56: the contract already anticipates structured output. The artefact does not emit it. The consequence is that "how often is the reviewer corrected" - the metric the whole improvement loop depends on - is unmeasurable, because findings are sentences.

Proposed Solution

Emit review-findings.json beside code-review.md, one record per finding: file, line, severity (severe | important | nit), clause_ref, summary, suggested_fix. The markdown stays exactly as it is and remains the artefact a human reads. The JSON is what a future CI step, the reconcile ladder, or the outer loop reads.

Severity uses the three-value taxonomy rather than our High/Medium/Low prose: a nit and a severe finding are different kinds of thing, and a reviewer who cannot say "this is a nit" says nothing instead.

Alternatives Considered

Success Metrics

Scope

In scope: the review-findings@1 schema, its emission, the audit's check that the two agree, suite arms.

Out of scope / Non-Goals

Dependencies

None.

AI Authorship Disclosure

1. Description (normative)

2. Acceptance criteria

3. Edge cases

Audit

§1 - Verdict summary

Spec is 68 lines, 6 §1 clauses, 5 ACs, 5 edge cases. The contract already declares the schema_refs (code-review-author/SKILL.md:44,56); the artefact simply never emitted them. Passes after 6 findings.

§2 - Findings (all resolved)

ISS-001 - Emitting only JSON would degrade human review

The prose packet is what makes a review readable. Resolved: §1 #1.5 forbids changing the markdown; AC 5 asserts byte-identical for a fixture.

ISS-002 - clause_ref could be fabricated for out-of-spec findings

Forcing every finding to name a clause invents references. Resolved: §1 #1.3 allows null and names it a real category; AC 3 asserts it.

ISS-003 - An absent file and an empty review are different things

A missing artefact reads as a failed run. Resolved: §1 #1.6 requires []; AC 4 covers it.

ISS-004 - The two artefacts could disagree about one review

Prose saying three findings and JSON saying two is a review that says two things. Resolved: §1 #1.4 requires equal counts; AC 2 reds a mismatch at audit.

ISS-005 - Parsing prose into JSON was the cheaper-looking path

Parsing what a model wrote is a guess about a guess. Resolved: Alternatives rejects it in favour of emitting at the source, where the reviewer already knows the answer.

ISS-006 - Naive serialisation would break on real paths

A quote or backslash in a path silently corrupts the file. Resolved: §3 requires proper serialisation and a test with both characters.

§3 - Resolution

All 6 concerns addressed. The machine floor (task-lint) ran FIRST and was clean before any judgment family was applied, per TASK-IMP-084. Score = 10/10.


End of TASK-IMP-112 audit.