@jphutchins/code-review 0.1.0-alpha.44 → 0.1.0-alpha.46

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
@@ -106,43 +106,55 @@ links to:
106
106
  The embedded document is the agent's **complete** findings document — the same `schema_version`
107
107
  0.9.0 contract the review agent is held to and
108
108
  [`schema/findings.schema.json`](schema/findings.schema.json) validates, and the same object the
109
- comment is rendered from. It is embedded verbatim: no field is added or dropped, so the machine
110
- channel can never carry less than, or drift from, the rendered prose.
109
+ comment is rendered from. The agent's fields are embedded verbatim; the pipeline stamps one field the
110
+ agent never writes `convergence` (below) so the whole review, findings and convergence signal
111
+ alike, travels as one JSON document with no side marker to drift from.
111
112
 
112
113
  ```json
113
114
  {
114
115
  "schema_version": "0.9.0",
115
116
  "verdict": "comment",
116
117
  "summary": "...",
117
- "findings": []
118
+ "findings": [],
119
+ "convergence": {
120
+ "score": 0.42,
121
+ "threshold": 1,
122
+ "converged": true,
123
+ "rounds": [
124
+ { "round": 1, "score": 2.4 },
125
+ { "round": 2, "score": 1.1 },
126
+ { "round": 3, "score": 0.42 }
127
+ ]
128
+ }
118
129
  }
119
130
  ```
120
131
 
121
- The deterministic **stop signal** for an iterating author-agent rides its own compact marker beside
122
- the findings blob, `<!-- code-review:signal;base64 <base64> -->`, whose decoded payload is
123
- `{ "schema_version": "0.8.0", "round": <n>, "convergence": { "score": <s>, "threshold": <t>, "converged": <bool> } }`.
124
- `round` is the count of completed full-review rounds; `convergence.score` sums each finding and
125
- systemic problem's `floor(severity) + max(0, ceiling floor) × confidence` (ceilings critical 4 ·
126
- major 2 · minor 1 · nit 0; floors critical `threshold + 0.01` · major 0.5 · else 0), rounded to 2
127
- decimals; `threshold` defaults to 1, and `converged` = score threshold as a literal
128
- boolean — `converged: true` means the last completed round is at or below the tolerance, so another
129
- iteration round is not warranted. The commenter computes the signal from the review's own severities
130
- (the agent never writes it); it appears once at least one full-review round has completed and is
131
- carried verbatim afterward a mechanic (CI-fix) pass or an envelope-loss notice re-emits the last
132
- completed round's signal rather than re-deriving it, so an operator changing `convergence_threshold`
133
- mid-PR cannot flip a stored `converged`, and a notice never fabricates a stop signal for a run that
134
- produced no review. Both markers survive the "review in progress" banner, which replaces only the
135
- sticky's prose and carries them forward verbatim.
136
-
137
- Cross-round recurrence (the sticky's "Scope metastasis" warning) is carried structurally in the
138
- `<!-- code-review:rounds;base64 <base64> -->` marker per-round severity counts and mechanism
139
- frequencies — from which the re-review seed re-derives the advisory `scope_metastasis` entry it
140
- hands the next-round agent. It is deliberately NOT embedded in the findings blob: the blob is the
141
- agent's own document, and a recurrence claim is round state the commenter owns. Each inline review
142
- comment embeds only its own finding (a `schema_version` + one-finding fragment), and the
143
- review-object body only links the sticky so the **sticky is the sole documented decode surface**
144
- for the whole-document marker; a decoding agent reads it there. The review body is written only after
145
- the sticky exists (a failed sticky write aborts the run first), so it never carries the blob itself.
132
+ The **`convergence`** field is the deterministic stop signal AND the per-round trajectory for an
133
+ iterating author-agent, carried in the JSON document itself so a decoder reads one object.
134
+ `convergence.score` sums each finding and systemic problem's
135
+ `floor(severity) + max(0, ceiling floor) × confidence × likelihood` (ceilings critical 4 · major 2
136
+ · minor 1 · nit 0; floors critical `threshold + 0.01` · major 0.5 · minor 0.1 · nit 0), rounded to 2
137
+ decimals. A **systemic problem is scored with `likelihood` = 1** a structural observation has no
138
+ single triggering input, so it is never discounted by likelihood. `threshold` defaults to 1, and
139
+ `converged` = score ≤ threshold as a literal boolean — `converged: true` means the last completed
140
+ round is at or below the tolerance, so another iteration is not warranted. `score` and `threshold`
141
+ are both carried so the number is interpretable on its own. `convergence.rounds` is the trajectory,
142
+ oldest first: each entry's `score` is a historical snapshot carried **verbatim**, so changing
143
+ `convergence_threshold` mid-PR never rewrites a past round's number. The commenter computes
144
+ `convergence` from the review's own severities (the agent never writes it) and stamps it, overwriting
145
+ any value the agent echoed; it appears once at least one full-review round has completed and is carried
146
+ forward afterward a mechanic (CI-fix) pass or an envelope-loss notice carries the last completed
147
+ round's convergence unchanged rather than re-deriving it, and a notice never fabricates a signal for a
148
+ run that produced no review. The convergence survives the "review in progress" banner, which replaces
149
+ only the sticky's prose and carries the blob forward verbatim.
150
+
151
+ Cross-round recurrence (the sticky's "Scope metastasis" warning) is derived from the per-round
152
+ mechanism frequencies carried in `convergence.rounds` (each entry's `codes` map), from which the
153
+ re-review seed re-derives the advisory `scope_metastasis` entry it hands the next-round agent. Each
154
+ inline review comment embeds only its own finding (a `schema_version` + one-finding fragment), and the
155
+ review-object body only links the sticky so the **sticky is the sole documented decode surface** for
156
+ the whole-document marker; a decoding agent reads it there. The review body is written only after the
157
+ sticky exists (a failed sticky write aborts the run first), so it never carries the blob itself.
146
158
  - **`code-review-transcript`** — the full Claude Code session transcripts for the triage and review
147
159
  phases. This is advisory/auditability only: it is never read by the comment job and never affects
148
160
  what gets posted.