@jphutchins/code-review 0.1.0-alpha.39 → 0.1.0-alpha.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -99,8 +99,51 @@ links to:
99
99
  downstream tool) SHOULD base64-decode and parse that marker rather than parse the comment's prose.
100
100
  Embedding in the comment (rather than only linking the artifact) keeps the pointer from expiring
101
101
  with artifact retention; when the encoded findings are too large to embed, the sticky falls back to
102
- a `<!-- code-review:findings-json <url> -->` link marker instead the shared serializer is
102
+ a `<!-- code-review:findings-json <url> -->` link marker instead (the linked `findings.json` is the
103
+ agent's draft and lacks the surfaced fields below) — the shared serializer is
103
104
  [`src/surface.ts`](src/surface.ts).
105
+
106
+ The embedded document is the **surfaced** findings document: the agent's findings
107
+ (`schema_version` 0.5.0 contract, which is what the review agent is held to and what
108
+ [`schema/findings.schema.json`](schema/findings.schema.json) validates) stamped with the
109
+ `0.7.0` surface version plus the pipeline-computed convergence state of the **last completed
110
+ full-review round**:
111
+
112
+ ```json
113
+ {
114
+ "schema_version": "0.7.0",
115
+ "verdict": "comment",
116
+ "summary": "...",
117
+ "convergence": { "score": 1, "threshold": 1, "converged": true },
118
+ "round": 2,
119
+ "findings": []
120
+ }
121
+ ```
122
+
123
+ `convergence` (`score` = critical·4 + major·2 + minor·1 + nit·0, `threshold` default 1, `converged`
124
+ = score ≤ threshold, as a literal boolean) and `round` (the count of completed full-review rounds)
125
+ are the deterministic **stop signal** for an iterating author-agent: `converged: true` means the
126
+ last completed round is at or below the convergence tolerance, so another iteration round is not
127
+ warranted. The agent never writes these fields — the commenter computes them from the review's own
128
+ severities at render time — and they are omitted until at least one full-review round has
129
+ completed. They survive the "review in progress" banner: the banner replaces only the sticky's
130
+ prose and carries the embedded marker forward verbatim. The 0.7.0 surfaced contract applies to the
131
+ **whole-document** marker only; each inline comment embeds a per-finding fragment
132
+ (`schema_version` + one finding) at the draft's own version, since the fragment carries no stop
133
+ signal.
134
+
135
+ Semantics on non-round posts: a mechanic (CI-fix) pass or an envelope-loss post embeds the
136
+ **last completed round's stored signal** (round + its own threshold — never re-derived, so an
137
+ operator changing `convergence_threshold` mid-PR cannot flip a stored `converged`) beside its own
138
+ findings, so the signal always describes the last completed full-review round, not the findings
139
+ that happen to sit beside it. A notice — a post whose verdict is `error` or whose run did not
140
+ complete (empty diff, corrupt output, did-not-complete) — embeds **no** signal in its own blob:
141
+ its document already says no review was produced this run, and a carried `converged` beside that
142
+ would read as a stop signal for a run that produced none; the last completed round's signal still
143
+ survives on the sticky in the compact `<!-- code-review:signal;base64 <base64> -->` marker, so
144
+ the next post reads it back. The same compact marker is emitted when the embedded payload is too
145
+ large and the whole-document marker falls back to the artifact link — an oversized review's stop
146
+ signal stays readable and can be carried forward.
104
147
  - **`code-review-transcript`** — the full Claude Code session transcripts for the triage and review
105
148
  phases. This is advisory/auditability only: it is never read by the comment job and never affects
106
149
  what gets posted.