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

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
@@ -38,10 +38,11 @@ npx @jphutchins/code-review <subcommand>
38
38
  | Subcommand | What it does |
39
39
  | --- | --- |
40
40
  | `post` | Post a complete review (inline comments + sticky summary) from findings + envelope + diff — the one-call path |
41
- | `gather` | Resolve the PR from the CI head SHA and gather the review inputs (diff with git-diff fallback, PR context, prior bot review, failing-job logs) into the workspace for the agent |
41
+ | `gather` | Resolve the PR from the CI head SHA and gather the review inputs (diff with git-diff fallback, PR context, prior bot review, the prior review's answered-findings registry, failing-job logs) into the workspace for the agent |
42
42
  | `parse-command` | Resolve a PR's head from its number and parse a ChatOps trigger comment (`/code-review [24m] [$1.00] <instructions>`) into review overrides — the on-demand comment trigger |
43
43
  | `react` | Add/remove a GitHub comment reaction — the ChatOps acknowledgement (👀 on receipt, 🚀 on completion) |
44
44
  | `await-ci` | Wait for a PR head's CI run to conclude and emit its real conclusion + run id — so an on-demand comment review routes on the CI result (success → full, failure → mechanic) instead of reviewing blind |
45
+ | `check-scope` | Validate + normalize the workflow's `scope` input (the languages/inputs the project accepts) and print the normalized list for the review prompt, or nothing when empty (the reviewer then infers scope from the README's first paragraph); a structurally malformed value is rejected rather than spliced in as-is |
45
46
  | `render` | Render the sticky-comment markdown from findings + usage + prices |
46
47
  | `inline` | Build the GitHub reviews `comments[]` payload from findings + diff (in-diff validation; strays demote to the summary) |
47
48
  | `adapt` | Map a native agent-CLI result envelope onto the abstract result envelope (`src/schema.ts`) |
@@ -104,18 +105,24 @@ links to:
104
105
  [`src/surface.ts`](src/surface.ts).
105
106
 
106
107
  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_version` 0.6.0 contract, which is what the review agent is held to and what
108
109
  [`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**:
110
+ `0.8.0` surface version, the pipeline-computed convergence state of the **last completed
111
+ full-review round**, and the advisory `scope_metastasis` entry (issue #150):
111
112
 
112
113
  ```json
113
114
  {
114
- "schema_version": "0.7.0",
115
+ "schema_version": "0.8.0",
115
116
  "verdict": "comment",
116
117
  "summary": "...",
117
118
  "convergence": { "score": 1, "threshold": 1, "converged": true },
118
- "round": 2,
119
+ "round": 4,
120
+ "scope_metastasis": {
121
+ "decision_prompt": "Findings keep recurring in the same mechanism across consecutive rounds — each fix keeps enabling the next finding in that machinery. This is a decision, not a directive: state in your summary whether you are committing to the expanding scope (plan the remaining facets of the recurring mechanism(s) above as one unit) or narrowing the scope so the recurrence stops.",
122
+ "recurring": [
123
+ { "code": "mixin-field-guard-gap", "consecutive_rounds": 4, "start_round": 1 }
124
+ ]
125
+ },
119
126
  "findings": []
120
127
  }
121
128
  ```
@@ -127,10 +134,14 @@ links to:
127
134
  warranted. The agent never writes these fields — the commenter computes them from the review's own
128
135
  severities at render time — and they are omitted until at least one full-review round has
129
136
  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.
137
+ prose and carries the embedded marker forward verbatim. `scope_metastasis` is the structured
138
+ counterpart of the sticky's "Scope metastasis" warning per-code consecutive-round counts plus a
139
+ decision prompt computed from the same rounds history and omitted when no mechanism recurred. It
140
+ is deliberately NOT stripped when a surfaced blob feeds the re-review seed: a decoding agent — and
141
+ the next-round reviewer — must see the recurrence data to answer the scope decision. The 0.8.0
142
+ surfaced contract applies to the **whole-document** marker only; each inline comment embeds a
143
+ per-finding fragment (`schema_version` + one finding) at the draft's own version, since the
144
+ fragment carries no stop signal.
134
145
 
135
146
  Semantics on non-round posts: a mechanic (CI-fix) pass or an envelope-loss post embeds the
136
147
  **last completed round's stored signal** (round + its own threshold — never re-derived, so an