You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- If `gh` fails or returns empty, use a generic prompt: "Review the code changes on this branch for quality and merge readiness."
48
+
- Otherwise, read the PR body: `gh pr view --json body -q .body`
49
+
- If nothing useful is found, use a generic prompt: "Review the code changes on this branch for quality and merge readiness."
66
50
67
51
## Phase 2: Trigger the Review
68
52
69
-
Call the trigger API using `curl`, saving the response to a file. Use `python3` to parse the saved JSON (never pipe curl to python3 — connection hiccups cause empty stdin and `JSONDecodeError`).
53
+
Call the trigger API using `curl`. Use `python3 -c "import sys,json; ..."` for JSON parsing (jq may not be available).
70
54
71
55
```bash
72
56
curl -s -X POST "${APP_URL}/api/orchestration/trigger" \
1. **Extract findings** from the status response. Prefer structured findings when available:
167
-
- `state.structuredFindings` — array of structured findings with `findingId`, `title`, `severity`, `evidence`, `file`, `line`, `acceptanceCriteria`, and `status`
168
-
- `state.findingDelta` — shows `newCount`, `resolvedCount`, `regressedCount`, `remainingCount` since last iteration
169
-
- `state.findingsStale` — if `true`, analysis is in progress; wait and re-poll before acting
170
-
- **Fallback** (if structuredFindings is null): `state.lastMergeResult.blockingIssues`, `state.lastMergeResult.summary`, `state.lastQualityResult.findings`
171
-
172
-
### Triage Findings Before Fixing
173
-
174
-
Not all blocking findings are your responsibility. Triage each finding before acting:
175
-
176
-
- **Check `firstSeenIteration`**: If a finding's `firstSeenIteration` is > 1, it pre-dates your changes and is likely a pre-existing issue.
177
-
- **Check if the file was modified by you**: Run `git diff --name-only HEAD~1` to get your modified files. If a finding's `file` is NOT in that list, it's likely pre-existing.
178
-
- **Priority order**: Fix findings in YOUR modified files first. Findings in untouched files are likely pre-existing — skip them with a justification commit (see false-positive escape below).
179
-
- **High `newCount` but all in unmodified files?** That's pre-existing noise, not your fault. Skip with justification.
180
-
181
-
### Interpret `findingDelta` to Guide Your Actions
182
-
183
-
Use the delta to understand what happened since your last push:
184
-
185
-
- `resolvedCount > 0` → Your last push fixed things. Good progress — keep going.
186
-
- `newCount > 0` in YOUR files → Your fix introduced new issues. Address these.
187
-
- `newCount > 0` in unmodified files → Pre-existing issues surfaced by deeper analysis. Consider skipping.
188
-
- `regressedCount > 0` → Previously resolved findings came back. Check if you accidentally reverted something.
189
-
- `remainingCount == 0 && newCount == 0` → All issues addressed. This iteration will likely pass.
103
+
1.**Extract findings** from the status response:
104
+
-`state.lastMergeResult.blockingIssues` — array of blocking issue descriptions
105
+
-`state.lastMergeResult.summary` — detailed markdown summary with findings
106
+
-`state.lastQualityResult.findings` — quality check findings text
190
107
191
108
2.**Read and understand each blocking issue.** Common issue types:
**False-positive escape**: If you determine a blocking finding is a false positive (the code is correct and the reviewer is wrong), you can skip it by pushing a commit with this message format:
The reviewer will evaluate your justification. If it's valid, the finding will be resolved automatically. If not, it will be re-flagged at high confidence. Only use this for genuine false positives — do not abuse it to skip real issues.
215
-
216
-
**Batching skips**: If multiple findings are false positives, batch all skips into a single commit with each on its own line:
217
-
```
218
-
review: skip findings
219
-
220
-
skip finding <findingId1> — <justification1>
221
-
skip finding <findingId2> — <justification2>
222
-
skip finding <findingId3> — <justification3>
223
-
```
224
-
225
-
5.**Verify push and wait for bot reviews.** The quality check and merge readiness analysis read PR review comments — bot reviewers (linters, security scanners) need time to post theirs after a new push.
226
-
```bash
227
-
PUSHED_SHA=$(git rev-parse --short HEAD)
228
-
```
229
-
Tell the user: "Pushed $PUSHED_SHA, waiting 3 minutes for bot reviews before nudging re-review..."
127
+
5.**Wait 3 minutes for CI and bot reviews** to process the new commit. Bot reviewers on the PR need time to analyze the push before Command Center re-reviews:
230
128
```bash
231
129
sleep 180
232
130
```
233
131
234
-
6.**Nudge the orchestrator** to re-review. Save the response to a file:
132
+
6.**Nudge the orchestrator** to re-review:
235
133
```bash
236
134
curl -s -X POST "${APP_URL}/api/orchestration/trigger" \
Tell the user: "Pushed $PUSHED_SHA, nudging re-review."
244
-
245
140
7.**Go back to Phase 3** (poll again). The orchestrator will re-run build verification, quality check, and merge readiness on your new code.
246
141
247
142
**Repeat Phase 3→5 until the review passes or fails permanently.**
248
143
249
144
## Important Notes
250
145
251
-
-**Do NOT use `jq`** — it may not be available. Use `python3` to parse JSON from saved files: `python3 -c "import json; data=json.load(open('/tmp/cc-review-status.json')); print(data['key'])"`. Never pipe curl output directly to python3 — save to a file first to avoid `JSONDecodeError` on connection hiccups.
146
+
-**Do NOT use `jq`** — it may not be available. Use `python3-c "import sys,json; data=json.load(sys.stdin); print(data['key'])"` for JSON parsing.
252
147
-**Do NOT run long-lived bash loops** — poll by making individual curl calls with `sleep 30` between them.
253
148
-**Always push before nudging** — the orchestrator checks the latest commit on the branch.
254
149
-**Be thorough with fixes** — superficial fixes will just fail the next review cycle.
0 commit comments