@jphutchins/code-review 0.1.0-alpha.45 → 0.1.0-alpha.47
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 +40 -30
- package/dist/index.js +216 -142
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/schema/VERSIONING.md +15 -11
- package/schema/findings.schema.json +49 -0
- package/templates/comment.eta +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jphutchins/code-review",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.47",
|
|
4
4
|
"description": "Deterministic commenter for agentic PR review — gather, render, inline, post, adapt, extract, cost, validate, print-schema",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/schema/VERSIONING.md
CHANGED
|
@@ -76,21 +76,25 @@ ignored); a version outside the supported set degrades to a §5.5 sticky notice.
|
|
|
76
76
|
|
|
77
77
|
The commenter embeds the agent's **complete** findings document verbatim in review comments
|
|
78
78
|
(`<!-- code-review:findings-json -->`) — no surfaced copy, no added fields (issue #156). The
|
|
79
|
-
deterministic stop signal an iterating author-agent needs
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
marker
|
|
79
|
+
deterministic stop signal an iterating author-agent needs is the pipeline-stamped `convergence` field
|
|
80
|
+
INSIDE that document (issue #174): `{score, threshold, converged}` (a literal boolean, so a decoding
|
|
81
|
+
agent cannot re-derive the weights) plus the per-round `rounds` trajectory. It is the single source of
|
|
82
|
+
truth — the agent never writes it (it cannot know the score; the weights and threshold are
|
|
83
|
+
commenter-side), and the findings schema above describes the whole embedded document, `convergence`
|
|
84
|
+
included. When an oversized review falls to the link form (the blob is a URL, not base64), the same
|
|
85
|
+
stamped object rides a compact `<!-- code-review:convergence -->` marker beside the link (issue #185)
|
|
86
|
+
so the trajectory and stop signal survive; the embedded blob always wins on read.
|
|
87
|
+
|
|
88
|
+
Two older surface formats survive only as READ-ONLY migration inputs — a re-review may still parse a
|
|
89
|
+
sticky posted by an earlier release. Nothing writes either anymore:
|
|
86
90
|
|
|
87
91
|
| Version | Status | Notes |
|
|
88
92
|
|---|---|---|
|
|
89
|
-
| `v0.7.0` |
|
|
90
|
-
| `v0.8.0` |
|
|
93
|
+
| `v0.7.0` | legacy (read-only) | The pre-#156 surface axis: the commenter embedded a **surfaced** copy of the findings document carrying `convergence` + `round` inside it (issue #141). A sticky written by a `0.7.0` release still seeds — `stripSurfaceFields` peels the surfaced copy back to the agent's draft. |
|
|
94
|
+
| `v0.8.0` | legacy (read-only) | The version a compact `<!-- code-review:signal -->` marker declared (and a legacy `0.8.0` surfaced blob). Its writer is retired (issue #186); `parseSignalMarker` / `parseSurfaceSignal` still decode it so a pre-#185 sticky seeds. `0.8.0` also added the agent-facing `scope_metastasis` entry (issue #150): per-code consecutive-round recurrence counts plus a decision prompt. Post-#156 that entry is embedded in no document — the re-review seed re-derives it from the carried trajectory. The flat draft schema (now `v0.9.0`) accepts an optional `scope_metastasis` property so a seed-echoing draft validates — an in-place additive change, deliberately NOT a draft version bump: a draft sharing a `0.7.0`/`0.8.0` number would collide with the surface axis's version gate, so the draft axis skips past them to `0.9.0` (issue #163); the axes must stay distinct so `stripSurfaceFields`/`parseSurfaceSignal` can tell a legacy surfaced blob from a draft). |
|
|
91
95
|
|
|
92
|
-
The surface axis is independent of the draft-version registry:
|
|
93
|
-
|
|
96
|
+
The surface axis is independent of the draft-version registry: it numbers the legacy read-only signal
|
|
97
|
+
formats, while the agent-written document above is `v0.9.0`. `stripSurfaceFields` and
|
|
94
98
|
`parseSurfaceSignal` are version-gated on the surface axis, so a future draft bump can never be
|
|
95
99
|
mistaken for a legacy surfaced blob — and no fresh document is ever surfaced.
|
|
96
100
|
|
|
@@ -123,6 +123,55 @@
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
|
+
"convergence": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"additionalProperties": false,
|
|
129
|
+
"description": "Advisory (issue #174): the current round's convergence score, the threshold it is judged against, whether it converged, and the per-round trajectory. The review agent does NOT write this field — the pipeline computes the score deterministically from the findings (floor(severity) + headroom × confidence × likelihood, summed) and stamps it, so this JSON document is the sole source of the convergence data a decoding agent reads. `score` and `threshold` are both carried so the number is interpretable on its own (converged when score <= threshold); prior rounds are carried verbatim, so changing the threshold never rewrites a past round's score.",
|
|
130
|
+
"required": ["score", "threshold", "converged"],
|
|
131
|
+
"properties": {
|
|
132
|
+
"score": {
|
|
133
|
+
"type": "number",
|
|
134
|
+
"description": "This round's convergence score — the sum of every finding's and systemic problem's contribution, rounded to 2 decimals. Lower is closer to convergence."
|
|
135
|
+
},
|
|
136
|
+
"threshold": {
|
|
137
|
+
"type": "number",
|
|
138
|
+
"description": "The convergence tolerance in force for this round: the round is converged when score <= threshold."
|
|
139
|
+
},
|
|
140
|
+
"converged": {
|
|
141
|
+
"type": "boolean",
|
|
142
|
+
"description": "Whether this round converged (score <= threshold). Advisory only — never alters the verdict."
|
|
143
|
+
},
|
|
144
|
+
"rounds": {
|
|
145
|
+
"type": "array",
|
|
146
|
+
"description": "The convergence trajectory: one entry per completed full-review round, oldest first, this round's entry last. Each score is a historical snapshot carried verbatim.",
|
|
147
|
+
"items": {
|
|
148
|
+
"type": "object",
|
|
149
|
+
"additionalProperties": false,
|
|
150
|
+
"required": ["round"],
|
|
151
|
+
"properties": {
|
|
152
|
+
"round": {
|
|
153
|
+
"type": "integer",
|
|
154
|
+
"minimum": 1,
|
|
155
|
+
"description": "The 1-indexed completed-round number this entry represents."
|
|
156
|
+
},
|
|
157
|
+
"score": {
|
|
158
|
+
"type": "number",
|
|
159
|
+
"description": "That round's convergence score, carried verbatim from when the round completed. Absent only for a round migrated from a pre-#174 sticky, which stored no score."
|
|
160
|
+
},
|
|
161
|
+
"codes": {
|
|
162
|
+
"type": "object",
|
|
163
|
+
"additionalProperties": { "type": "integer", "minimum": 0 },
|
|
164
|
+
"description": "That round's mechanism-frequency map: finding code -> number of findings carrying it. Feeds the same-mechanism and scope-metastasis recurrence signals."
|
|
165
|
+
},
|
|
166
|
+
"sha": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"description": "The reviewed head SHA (short form) for that round, so a same-head CI retry is recognised as the same iteration rather than new recurrence evidence."
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
126
175
|
"findings": {
|
|
127
176
|
"type": "array",
|
|
128
177
|
"description": "Zero or more specific findings.",
|