pi-orchestrator-config 4.1.5
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 +808 -0
- package/agents/api-documenter.md +32 -0
- package/agents/bash-expert.md +53 -0
- package/agents/code-reviewer-docs.md +145 -0
- package/agents/code-reviewer-guidelines.md +97 -0
- package/agents/code-reviewer-quality.md +142 -0
- package/agents/code-reviewer-security.md +107 -0
- package/agents/code-reviewer-spec.md +164 -0
- package/agents/debugger.md +63 -0
- package/agents/docker-expert.md +40 -0
- package/agents/docs-fetcher.md +48 -0
- package/agents/git-expert.md +63 -0
- package/agents/github-expert.md +83 -0
- package/agents/go-expert.md +62 -0
- package/agents/issue-reviewer-feasibility.md +60 -0
- package/agents/issue-reviewer-scope.md +63 -0
- package/agents/issue-reviewer-spec.md +77 -0
- package/agents/java-expert.md +31 -0
- package/agents/jenkins-expert.md +38 -0
- package/agents/kubernetes-expert.md +40 -0
- package/agents/planner.md +42 -0
- package/agents/python-expert.md +61 -0
- package/agents/reviewer.md +26 -0
- package/agents/scout.md +40 -0
- package/agents/security-auditor.md +254 -0
- package/agents/technical-documentation-writer.md +37 -0
- package/agents/test-automator.md +55 -0
- package/agents/test-runner.md +47 -0
- package/agents/ts-expert.md +23 -0
- package/agents/worker.md +30 -0
- package/extensions/acpx-provider/index.ts +104 -0
- package/extensions/acpx-provider/load-runtime.ts +99 -0
- package/extensions/acpx-provider/runtime-models.ts +40 -0
- package/extensions/cli-provider/agents/claude.ts +128 -0
- package/extensions/cli-provider/agents/cursor.ts +84 -0
- package/extensions/cli-provider/agents/gemini.ts +100 -0
- package/extensions/cli-provider/discover.ts +77 -0
- package/extensions/cli-provider/index.ts +57 -0
- package/extensions/cli-provider/parsers.ts +304 -0
- package/extensions/cli-provider/providers.ts +58 -0
- package/extensions/cli-provider/runner.ts +225 -0
- package/extensions/cli-provider/runtime-models.ts +32 -0
- package/extensions/cli-provider/session-reaper.ts +122 -0
- package/extensions/cli-provider/sessions.ts +533 -0
- package/extensions/cli-provider/shared/discover-cache.ts +235 -0
- package/extensions/cli-provider/types.ts +48 -0
- package/extensions/coms/coms-net-server.ts +1642 -0
- package/extensions/coms/coms-net-wrapper.ts +521 -0
- package/extensions/coms/coms-net.ts +1589 -0
- package/extensions/coms/coms-p2p.ts +1879 -0
- package/extensions/coms/coms-shared.ts +510 -0
- package/extensions/coms/coms-wrapper.ts +138 -0
- package/extensions/coms/index.ts +20 -0
- package/extensions/coms/themeMap.ts +147 -0
- package/extensions/image-gen/image-gen.ts +332 -0
- package/extensions/image-gen/index.ts +14 -0
- package/extensions/orchestrator/agents.ts +134 -0
- package/extensions/orchestrator/ask-user.ts +293 -0
- package/extensions/orchestrator/async-agents.ts +1037 -0
- package/extensions/orchestrator/async-capability.ts +129 -0
- package/extensions/orchestrator/async-runner.ts +324 -0
- package/extensions/orchestrator/async-status-parse.ts +31 -0
- package/extensions/orchestrator/async-status-ui.ts +201 -0
- package/extensions/orchestrator/async-wait.ts +36 -0
- package/extensions/orchestrator/btw.ts +210 -0
- package/extensions/orchestrator/cron-status-format.ts +126 -0
- package/extensions/orchestrator/cron-status-ui.ts +132 -0
- package/extensions/orchestrator/cron.ts +730 -0
- package/extensions/orchestrator/dreaming.ts +355 -0
- package/extensions/orchestrator/enforcement-helpers.ts +530 -0
- package/extensions/orchestrator/enforcement-rules.ts +329 -0
- package/extensions/orchestrator/enforcement.ts +828 -0
- package/extensions/orchestrator/extended-autocomplete.ts +593 -0
- package/extensions/orchestrator/git-helpers.ts +420 -0
- package/extensions/orchestrator/github-autocomplete.ts +250 -0
- package/extensions/orchestrator/icons.ts +17 -0
- package/extensions/orchestrator/index.ts +100 -0
- package/extensions/orchestrator/memory-embeddings.ts +281 -0
- package/extensions/orchestrator/memory-promotion.ts +449 -0
- package/extensions/orchestrator/memory-provenance.ts +80 -0
- package/extensions/orchestrator/memory-query-class.ts +90 -0
- package/extensions/orchestrator/memory-scoring.ts +434 -0
- package/extensions/orchestrator/memory-tools.ts +883 -0
- package/extensions/orchestrator/memory-tree.ts +212 -0
- package/extensions/orchestrator/nvim.ts +169 -0
- package/extensions/orchestrator/overlay-dashboard-utils.ts +25 -0
- package/extensions/orchestrator/overlay-dashboard.ts +512 -0
- package/extensions/orchestrator/pi-config-review-state.ts +303 -0
- package/extensions/orchestrator/preference-extractor.ts +106 -0
- package/extensions/orchestrator/project-settings.ts +468 -0
- package/extensions/orchestrator/promotion-queue.ts +311 -0
- package/extensions/orchestrator/resolve-agent-model.ts +32 -0
- package/extensions/orchestrator/review-ui.ts +204 -0
- package/extensions/orchestrator/rule-placeholders.ts +12 -0
- package/extensions/orchestrator/rules.ts +481 -0
- package/extensions/orchestrator/session-search.ts +243 -0
- package/extensions/orchestrator/session-validation.ts +374 -0
- package/extensions/orchestrator/situation-report.ts +370 -0
- package/extensions/orchestrator/status-bar.ts +31 -0
- package/extensions/orchestrator/status-line.ts +192 -0
- package/extensions/orchestrator/status.ts +110 -0
- package/extensions/orchestrator/subagent-tool.ts +1748 -0
- package/extensions/orchestrator/task-lifecycle.ts +88 -0
- package/extensions/orchestrator/utils.ts +227 -0
- package/extensions/pidash/index.ts +15 -0
- package/extensions/pidash/pidash.ts +941 -0
- package/extensions/pidiff/index.ts +13 -0
- package/extensions/pidiff/pidiff.ts +369 -0
- package/extensions/providers/acpx-driver.ts +479 -0
- package/extensions/providers/built-in-drivers.ts +52 -0
- package/extensions/providers/claude-driver.ts +319 -0
- package/extensions/providers/cursor-acpx-driver.ts +398 -0
- package/extensions/providers/cursor-cli-driver.ts +484 -0
- package/extensions/providers/gemini-driver.ts +302 -0
- package/extensions/providers/index.ts +513 -0
- package/extensions/shared/build-system-prompt.ts +57 -0
- package/extensions/shared/create-runtime-provider.ts +190 -0
- package/extensions/shared/daemon-manager.ts +248 -0
- package/extensions/shared/file-logger.ts +115 -0
- package/extensions/shared/managed-refresh.ts +211 -0
- package/extensions/shared/provider-driver.ts +295 -0
- package/extensions/shared/provider-errors.ts +305 -0
- package/extensions/shared/provider-registry.ts +388 -0
- package/extensions/shared/stream-builder.ts +275 -0
- package/extensions/shared/types.ts +20 -0
- package/extensions/shared/ui/README.md +10 -0
- package/extensions/shared/ui/badge.tsx +52 -0
- package/extensions/shared/ui/button.tsx +58 -0
- package/extensions/shared/ui/collapsible.tsx +21 -0
- package/extensions/shared/ui/dropdown-menu.tsx +266 -0
- package/extensions/shared/ui/input.tsx +20 -0
- package/extensions/shared/ui/popover.tsx +114 -0
- package/extensions/shared/ui/resizable.tsx +48 -0
- package/extensions/shared/ui/scroll-area.tsx +53 -0
- package/extensions/shared/ui/select.tsx +201 -0
- package/extensions/shared/ui/separator.tsx +25 -0
- package/extensions/shared/ui/tooltip.tsx +64 -0
- package/extensions/shared/ws-client.ts +74 -0
- package/package.json +59 -0
- package/prompts/coderabbit-rate-limit.md +95 -0
- package/prompts/create-coms-feature-manager.md +186 -0
- package/prompts/create-skill.md +128 -0
- package/prompts/domain-model.md +109 -0
- package/prompts/external-ai.md +665 -0
- package/prompts/implement-and-review.md +25 -0
- package/prompts/implement.md +26 -0
- package/prompts/issue-review.md +256 -0
- package/prompts/pr-review.md +753 -0
- package/prompts/query-db.md +154 -0
- package/prompts/refine-review.md +208 -0
- package/prompts/release.md +235 -0
- package/prompts/remember.md +33 -0
- package/prompts/review-handler-status.md +27 -0
- package/prompts/review-handler.md +677 -0
- package/prompts/review-local.md +159 -0
- package/prompts/scout-and-plan.md +21 -0
- package/rules/00-orchestrator-core.md +42 -0
- package/rules/05-issue-first-workflow.md +119 -0
- package/rules/10-agent-routing.md +58 -0
- package/rules/15-mcp-launchpad.md +46 -0
- package/rules/20-code-review-loop.md +234 -0
- package/rules/25-documentation-updates.md +15 -0
- package/rules/30-prompt-templates.md +19 -0
- package/rules/35-memory.md +240 -0
- package/rules/40-critical-rules.md +124 -0
- package/rules/45-file-preview.md +29 -0
- package/rules/50-agent-bug-reporting.md +90 -0
- package/rules/55-coms-protocol.md +63 -0
- package/rules/60-task-tracking.md +66 -0
- package/skills/conflict-resolver/SKILL.md +213 -0
- package/skills/skill-creator/SKILL.md +85 -0
- package/skills/systematic-debugging/SKILL.md +353 -0
- package/skills/test-driven-development/SKILL.md +335 -0
- package/skills/update-agents-md/SKILL.md +282 -0
- package/templates/coms-feature-manager-prompt.md +313 -0
|
@@ -0,0 +1,677 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Process ALL review sources (human, Qodo, CodeRabbit) from current PR
|
|
3
|
+
argument-hint: "[--autorabbit] [--autoqodo]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Raw Arguments
|
|
7
|
+
|
|
8
|
+
```text
|
|
9
|
+
$ARGUMENTS
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
# GitHub Review Handler
|
|
13
|
+
|
|
14
|
+
> **Bug Reporting Policy:** If you encounter ANY error, unexpected behavior, or reproducible bug
|
|
15
|
+
> while executing this command — DO NOT work around it silently. Ask the user:
|
|
16
|
+
> "Should I create a GitHub issue for this?" Route to:
|
|
17
|
+
> `myk-org/pi-config` for plugin/command spec or `myk-pi-tools` CLI issues.
|
|
18
|
+
> Do not silently skip steps or apply manual fixes that hide the root cause.
|
|
19
|
+
> Documented retry loops (e.g., auto polling) are not bugs — only report reproducible failures.
|
|
20
|
+
|
|
21
|
+
Unified handler that processes ALL review sources from the current branch's GitHub PR.
|
|
22
|
+
|
|
23
|
+
## Multi-PR Handling (MANDATORY)
|
|
24
|
+
|
|
25
|
+
When asked to handle reviews for **multiple PRs**, NEVER switch branches in the main worktree.
|
|
26
|
+
Use `git worktree` to create isolated directories for each PR:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Create a worktree per PR (inside the repo)
|
|
30
|
+
git worktree add .worktrees/pr-42 origin/fix/issue-42
|
|
31
|
+
git worktree add .worktrees/pr-43 origin/feat/issue-43
|
|
32
|
+
|
|
33
|
+
# Run review-handler in each worktree directory
|
|
34
|
+
# When done, clean up all worktrees at once
|
|
35
|
+
git worktree remove .worktrees/pr-42
|
|
36
|
+
git worktree remove .worktrees/pr-43
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
All worktrees live under `.worktrees/` in the repo.
|
|
40
|
+
`.worktrees/` is in the global gitignore (added by entrypoint.sh).
|
|
41
|
+
Branch switching corrupts parallel agent work — other agents running in the
|
|
42
|
+
main worktree will see the wrong branch.
|
|
43
|
+
|
|
44
|
+
## Prerequisites Check (MANDATORY)
|
|
45
|
+
|
|
46
|
+
### Step 0: Check uv
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
uv --version
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
If not found, install from <https://docs.astral.sh/uv/getting-started/installation/>
|
|
53
|
+
|
|
54
|
+
### Step 1: Check myk-pi-tools
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
myk-pi-tools --version
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
If not found, prompt to install: `uv tool install myk-pi-tools`
|
|
61
|
+
|
|
62
|
+
## Usage
|
|
63
|
+
|
|
64
|
+
- `/review-handler` - Process reviews from current PR
|
|
65
|
+
- `/review-handler https://github.com/owner/repo/pull/123#pullrequestreview-456` - With specific review URL
|
|
66
|
+
- `/review-handler --autorabbit` - Auto-fix CodeRabbit comments in a loop
|
|
67
|
+
- `/review-handler --autoqodo` - Auto-fix Qodo comments in a loop
|
|
68
|
+
- `/review-handler --autorabbit --autoqodo` - Auto-fix both CodeRabbit and Qodo comments
|
|
69
|
+
|
|
70
|
+
## Workflow
|
|
71
|
+
|
|
72
|
+
**`PROJECT_TMP_DIR`** is the project-scoped temp directory from `getProjectTmpDir(cwd)` — all temp files go here.
|
|
73
|
+
|
|
74
|
+
> **CRITICAL — BEFORE ANY CLI COMMAND:**
|
|
75
|
+
> `--autorabbit` and `--autoqodo` are **command-level flags**, NOT CLI arguments.
|
|
76
|
+
> **NEVER** pass `--autorabbit` or `--autoqodo` to `myk-pi-tools`. The CLI will reject it.
|
|
77
|
+
> You MUST strip them from the raw arguments first. See Phase 0 below.
|
|
78
|
+
|
|
79
|
+
### Phase 0: Parse Arguments (MANDATORY — DO NOT SKIP)
|
|
80
|
+
|
|
81
|
+
Read the **Raw Arguments** section above. Parse as follows:
|
|
82
|
+
|
|
83
|
+
1. Check if `--autorabbit` appears in the raw arguments
|
|
84
|
+
- If YES: set autorabbit mode = ON, remove `--autorabbit` from the text
|
|
85
|
+
- If NO: autorabbit mode = OFF
|
|
86
|
+
2. Check if `--autoqodo` appears in the (remaining) raw arguments
|
|
87
|
+
- If YES: set autoqodo mode = ON, remove `--autoqodo` from the text
|
|
88
|
+
- If NO: autoqodo mode = OFF
|
|
89
|
+
3. The remaining text is the cleaned arguments — pass these through to the CLI
|
|
90
|
+
4. `--autorabbit` and `--autoqodo` are **command-level flags** — NEVER pass them to the CLI
|
|
91
|
+
5. Both flags can be active simultaneously
|
|
92
|
+
|
|
93
|
+
**Example:** Raw arguments = `--autorabbit --autoqodo`
|
|
94
|
+
|
|
95
|
+
- autorabbit mode = ON, autoqodo mode = ON
|
|
96
|
+
- cleaned arguments = (empty)
|
|
97
|
+
- CLI call = `myk-pi-tools reviews fetch` (NO flags)
|
|
98
|
+
|
|
99
|
+
### Auto Mode Fast Path (MANDATORY)
|
|
100
|
+
|
|
101
|
+
**If autorabbit mode OR autoqodo mode is ON (set in Phase 0), skip Phases 1-8 entirely
|
|
102
|
+
and jump directly to Phase 9 (Auto Polling Loop).** The polling
|
|
103
|
+
loop handles fetching, processing, and posting internally. There is no
|
|
104
|
+
initial fetch/review cycle — the first fetch happens inside the poll.
|
|
105
|
+
|
|
106
|
+
### Phase 1: Fetch Reviews
|
|
107
|
+
|
|
108
|
+
**Skip this phase if autorabbit mode OR autoqodo mode is ON — see Auto Mode Fast Path above.**
|
|
109
|
+
|
|
110
|
+
The `reviews fetch` command auto-detects the PR from the current branch.
|
|
111
|
+
|
|
112
|
+
**Use the cleaned arguments from Phase 0 — NEVER pass `--autorabbit` or `--autoqodo` to the CLI.**
|
|
113
|
+
|
|
114
|
+
If a specific review URL is in the cleaned arguments:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
myk-pi-tools reviews fetch --output-dir ${PROJECT_TMP_DIR} <cleaned_arguments>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Otherwise (auto-detect from current branch):
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
myk-pi-tools reviews fetch --output-dir ${PROJECT_TMP_DIR}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Returns JSON with:
|
|
127
|
+
|
|
128
|
+
- `metadata`: owner, repo, pr_number, json_path
|
|
129
|
+
- `human`: Human review threads
|
|
130
|
+
- `qodo`: Qodo AI review threads
|
|
131
|
+
- `coderabbit`: CodeRabbit AI review threads
|
|
132
|
+
|
|
133
|
+
### Phase 2: User Decision Collection
|
|
134
|
+
|
|
135
|
+
> **CRITICAL — AUTO MODE CHECK (do this FIRST, before anything else):**
|
|
136
|
+
>
|
|
137
|
+
> If autorabbit mode is ON:
|
|
138
|
+
>
|
|
139
|
+
> 1. **CodeRabbit comments → ALL auto-approved.** Set every CodeRabbit item to "yes" automatically.
|
|
140
|
+
>
|
|
141
|
+
> If autoqodo mode is ON:
|
|
142
|
+
>
|
|
143
|
+
> **Qodo sticky findings with `is_auto_skipped=true` are auto-skipped.** When a finding
|
|
144
|
+
> has `already_replied=true` and Qodo did not push back (no `qodo_response`), it is
|
|
145
|
+
> auto-skipped — Qodo's silence is treated as implicit acceptance. These findings are
|
|
146
|
+
> presented in the table as auto-skipped but are NOT actionable.
|
|
147
|
+
> Findings where Qodo DID push back (`qodo_response` exists) remain actionable and
|
|
148
|
+
> MUST be re-fixed with a different approach.
|
|
149
|
+
>
|
|
150
|
+
> 🚨 **MANDATORY: Read the FULL Qodo sticky JSON data before acting.**
|
|
151
|
+
> Qodo sticky findings contain critical fields beyond the title:
|
|
152
|
+
>
|
|
153
|
+
> 🚨 **ALL fields below are MANDATORY — read EVERY field before acting on a finding.**
|
|
154
|
+
> Skipping any field is a violation. Each field provides critical context.
|
|
155
|
+
>
|
|
156
|
+
> - `code_diff` — the exact code the finding references. THIS is what you must fix.
|
|
157
|
+
> - `evidence` — Qodo's explanation of why this is a problem. Read to understand the root cause.
|
|
158
|
+
> - `evidence_refs` — links to the specific file/line ranges involved. Check EVERY entry.
|
|
159
|
+
> - `agent_prompt` — Qodo's suggested fix approach. Follow it unless you have a better solution.
|
|
160
|
+
> - `qodo_response` — Qodo's reply to our previous fix. **Read this FIRST when present.**
|
|
161
|
+
> Tells you whether Qodo accepted the fix or pushed back.
|
|
162
|
+
> **If Qodo pushed back, your previous fix was insufficient — make a DIFFERENT fix.**
|
|
163
|
+
> Do NOT repeat the same reply or approach.
|
|
164
|
+
> - `previous_reply` — What we previously replied to this finding. Shows the full conversation:
|
|
165
|
+
> we said `previous_reply` → Qodo responded `qodo_response`. Use both to understand context
|
|
166
|
+
> and avoid repeating the same fix that Qodo already rejected.
|
|
167
|
+
>
|
|
168
|
+
> **NEVER match findings by title alone.** Two findings with the same title
|
|
169
|
+
> (e.g., "Deploy ownership conflict") can reference completely different code.
|
|
170
|
+
> Always read `code_diff` and `evidence_refs` to understand what SPECIFIC code
|
|
171
|
+
> the finding is about before deciding it was "already addressed."
|
|
172
|
+
>
|
|
173
|
+
> 1. **Qodo comments → auto-approved based on finding type:**
|
|
174
|
+
> - `qodo_bug` → **MUST address.** Fix the code. No skip allowed.
|
|
175
|
+
> - `qodo_rule_violation` → **MUST address.** Fix the code. No skip allowed.
|
|
176
|
+
> - `qodo_requirement_gap` → **MUST address.** Either fix the code OR update the issue requirements to document the design decision. No skip allowed.
|
|
177
|
+
> - `qodo_ux_issue` → **MUST address.** Either fix the UX concern OR update the issue requirements to document the design decision. No skip allowed.
|
|
178
|
+
> - `qodo_cross_repo` → **MUST address.** Fix the code to avoid cross-repo breakage. No skip allowed.
|
|
179
|
+
> - `qodo_finding` (other) → **MUST address.** Either fix the code OR update the issue requirements. No skip allowed.
|
|
180
|
+
>
|
|
181
|
+
> **No finding type is optional. Every finding gets a code fix or an issue update.**
|
|
182
|
+
> **"Not a realistic issue", "by design", or "not applicable" are NOT valid skip reasons.**
|
|
183
|
+
>
|
|
184
|
+
> 🚨 **STRICT ENFORCEMENT — EVERY QODO FINDING MUST RESULT IN ONE OF:**
|
|
185
|
+
> 1. **Code fix** — change the code to address the finding. Commit and push.
|
|
186
|
+
> 2. **Issue spec update** — if the finding is about a spec mismatch (code does X, spec says Y),
|
|
187
|
+
> update the GitHub issue to match the actual design. Use `gh issue edit` to fix the spec.
|
|
188
|
+
> Then reply to Qodo referencing the updated spec.
|
|
189
|
+
>
|
|
190
|
+
> **Bare assertions without proof are FORBIDDEN:**
|
|
191
|
+
> - ❌ "Already addressed" (without citing commit SHA or diff link)
|
|
192
|
+
> - ❌ "By design" (without citing updated issue spec)
|
|
193
|
+
> - ❌ "Not applicable" (without explaining why AND updating spec if needed)
|
|
194
|
+
>
|
|
195
|
+
> **WITH proof, these are allowed:**
|
|
196
|
+
> - ✅ "Already addressed in commit abc123 — see diff" (links to specific change)
|
|
197
|
+
> - ✅ "By design per updated issue #N spec" (issue was actually updated)
|
|
198
|
+
>
|
|
199
|
+
> **Posting the same reply multiple times without a NEW code fix or spec update is a HARD VIOLATION.**
|
|
200
|
+
>
|
|
201
|
+
> **If a Qodo sticky comment keeps re-appearing after your reply:**
|
|
202
|
+
> - The spec does not match the code — FIX THE SPEC (gh issue edit)
|
|
203
|
+
> - OR the code does not match the spec — FIX THE CODE
|
|
204
|
+
> - NEVER post the same reply again. That means you haven't actually addressed it.
|
|
205
|
+
>
|
|
206
|
+
> 🚨 **STICKY FINDINGS WITH `qodo_response` ARE ALWAYS ACTIONABLE.**
|
|
207
|
+
> If a sticky finding has `qodo_response` (Qodo pushed back), it MUST be re-fixed
|
|
208
|
+
> with a different approach. `previous_reply` shows what you said before, `qodo_response`
|
|
209
|
+
> shows Qodo's pushback — use both to make a BETTER fix.
|
|
210
|
+
> Repeating the same reply or approach is a HARD VIOLATION.
|
|
211
|
+
>
|
|
212
|
+
> **STICKY FINDINGS WITHOUT `qodo_response` are auto-skipped by the code.**
|
|
213
|
+
> If `already_replied=true` and no `qodo_response`, the finding is `is_auto_skipped=true`.
|
|
214
|
+
> Qodo's silence = implicit acceptance. Do NOT re-process these.
|
|
215
|
+
>
|
|
216
|
+
> **Qodo reply detection (consolidated comment responses):**
|
|
217
|
+
> When we post consolidated PR comments mentioning `@qodo-code-review`, Qodo may
|
|
218
|
+
> reply in a new issue comment quoting our response. These replies are now detected
|
|
219
|
+
> automatically:
|
|
220
|
+
> - Sticky findings are enriched with a `qodo_response` field containing Qodo's reply text
|
|
221
|
+
> - If Qodo's reply indicates **pushback** (e.g., "still present", "not addressed",
|
|
222
|
+
> "disagree"), the finding is treated as **actionable** — `already_replied` is NOT
|
|
223
|
+
> a reason to skip. The finding MUST be re-fixed.
|
|
224
|
+
> - This means the autoqodo polling loop will re-surface findings where Qodo disagrees
|
|
225
|
+
> with our fix, requiring re-evaluation and a new code fix or spec update
|
|
226
|
+
> - Pushback keywords: "still present", "not fixed", "disagree", "issue remains", etc.
|
|
227
|
+
>
|
|
228
|
+
> 🚨 **When processing a finding with `qodo_response`:**
|
|
229
|
+
> 1. Read `qodo_response` FIRST — understand what Qodo said about your previous fix
|
|
230
|
+
> 2. If Qodo accepted ("looks good", "addressed", "thanks") — the finding may still
|
|
231
|
+
> be unresolved in the sticky (Qodo doesn't always auto-resolve). Reply referencing
|
|
232
|
+
> the acceptance.
|
|
233
|
+
> 3. If Qodo pushed back — your previous fix was wrong or incomplete. Make a NEW,
|
|
234
|
+
> DIFFERENT fix that addresses Qodo's specific concern. Do NOT repeat the same approach.
|
|
235
|
+
>
|
|
236
|
+
> Combined behavior:
|
|
237
|
+
>
|
|
238
|
+
> 1. **Human comments** → ALWAYS follow the normal decision flow (never auto-approved).
|
|
239
|
+
> 1. **If ALL comments are from auto-approved sources** (e.g., only CodeRabbit when autorabbit is on,
|
|
240
|
+
> or only Qodo when autoqodo is on, or both when both flags are on) →
|
|
241
|
+
> skip this entire phase and go directly to Phase 3.
|
|
242
|
+
>
|
|
243
|
+
> **Auto-approved sources are NEVER presented to the user for decision.**
|
|
244
|
+
|
|
245
|
+
**Normal mode (no `--autorabbit` / `--autoqodo`):** Follow the full decision flow below.
|
|
246
|
+
|
|
247
|
+
**MANDATORY: Present ALL fetched items to the user for decision.
|
|
248
|
+
Never silently hide or omit items — including auto-skipped ones.**
|
|
249
|
+
|
|
250
|
+
Even if an item appears to be a repeat from a previous round, was already addressed,
|
|
251
|
+
or seems trivial — present it to the user. The user decides what to address or skip,
|
|
252
|
+
not the AI.
|
|
253
|
+
|
|
254
|
+
**Presentation format (MANDATORY — always use this exact structure):**
|
|
255
|
+
|
|
256
|
+
**HARD RULE: The table MUST include ALL items — pending AND auto-skipped.
|
|
257
|
+
No exceptions. Never present a partial table. If you omit auto-skipped items,
|
|
258
|
+
the output is INVALID and must be redone.**
|
|
259
|
+
|
|
260
|
+
Present one table per source (human, qodo, coderabbit). Skip sources with zero items.
|
|
261
|
+
Within each table, sort by priority (HIGH → MEDIUM → LOW).
|
|
262
|
+
Use a **global counter** for the `#` column across all tables (not per-table).
|
|
263
|
+
|
|
264
|
+
```text
|
|
265
|
+
## Review Items: {source} ({total} total, {auto_skipped} auto-skipped)
|
|
266
|
+
|
|
267
|
+
| # | Priority | File | Line | Summary | Status |
|
|
268
|
+
|---|----------|------|------|---------|--------|
|
|
269
|
+
| 1 | HIGH | src/storage.py | 231 | Backfill destroys historical chronology | Pending |
|
|
270
|
+
| 2 | MEDIUM | src/html_report.py | 1141 | Add/delete leaves badges stale | Pending |
|
|
271
|
+
| 3 | LOW | src/utils.py | 42 | Unused import | Auto-skipped (skipped): "style only" |
|
|
272
|
+
| 4 | LOW | src/config.py | 15 | Missing validation | Auto-skipped (addressed): "added in prev PR" |
|
|
273
|
+
|
|
274
|
+
(Numbering continues across tables — e.g., if this table ends at 4, the next table starts at 5.)
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
**Table rules:**
|
|
278
|
+
|
|
279
|
+
- **Always a table** — never use bullets, prose, or any other format
|
|
280
|
+
- **Summary column:** 1-2 lines summarizing the comment.
|
|
281
|
+
Include "Also applies to" references if present
|
|
282
|
+
- **Status column values:**
|
|
283
|
+
- `Pending` — awaiting user decision
|
|
284
|
+
- `Auto-skipped ({original_status}): "{reason}"` — showing the original status (addressed/skipped/not_addressed) and the stored reason
|
|
285
|
+
- **Every item gets a row** — including auto-skipped items so the user can override
|
|
286
|
+
|
|
287
|
+
**After presenting all tables, show the response options:**
|
|
288
|
+
|
|
289
|
+
```text
|
|
290
|
+
Respond with:
|
|
291
|
+
- 'yes' / 'no' (per item number — if 'no', ask for a reason)
|
|
292
|
+
- 'all' — address all remaining pending items
|
|
293
|
+
- 'skip human/qodo/coderabbit' — skip remaining from that source (ask for a reason)
|
|
294
|
+
- 'skip ai' — skip all AI sources (qodo + coderabbit) (ask for a reason)
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
**User input method (MANDATORY):**
|
|
298
|
+
|
|
299
|
+
Always use the `AskUserQuestion` tool to collect user decisions — never rely on
|
|
300
|
+
free-text conversation. Present the tables first as regular output, then call
|
|
301
|
+
`AskUserQuestion` with a concise prompt summarizing the available options.
|
|
302
|
+
|
|
303
|
+
Example `AskUserQuestion` prompt:
|
|
304
|
+
|
|
305
|
+
```text
|
|
306
|
+
Enter your decisions (e.g., '1 yes, 2 no: already addressed, 3 yes, skip coderabbit: duplicates human review'):
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
The handler collects ALL decisions in a single `AskUserQuestion` call.
|
|
310
|
+
If the user says 'no' or 'skip' without a reason, follow up with another
|
|
311
|
+
`AskUserQuestion` asking for the reason before proceeding.
|
|
312
|
+
|
|
313
|
+
### Phase 3: Execute Approved Tasks
|
|
314
|
+
|
|
315
|
+
For each approved comment, delegate to appropriate specialist agent.
|
|
316
|
+
When delegating, pass the FULL original review thread to the agent — including the complete comment body,
|
|
317
|
+
all replies, every code suggestion/diff, and all referenced locations. Do NOT summarize or compress the thread.
|
|
318
|
+
|
|
319
|
+
**When fixing review comments (MANDATORY):**
|
|
320
|
+
|
|
321
|
+
- **For Qodo findings:** Before fixing or deciding a finding is "already addressed",
|
|
322
|
+
read the `code_diff`, `evidence`, `evidence_refs`, `agent_prompt`, `qodo_response`, and
|
|
323
|
+
`previous_reply` fields from the JSON.
|
|
324
|
+
🚨 **If `qodo_response` exists, read it FIRST** — it contains Qodo's feedback on your previous fix.
|
|
325
|
+
If Qodo pushed back, your previous approach failed — make a DIFFERENT fix.
|
|
326
|
+
`previous_reply` shows what you said before so you don't repeat it.
|
|
327
|
+
These fields — not the title — define what the finding is about. Never dismiss by title alone.
|
|
328
|
+
If `code_diff` is empty, use `evidence_refs` (check **every** entry, not just the first),
|
|
329
|
+
`path`/`line`/`end_line` (if present — these can be empty/null), and the finding body to locate the code.
|
|
330
|
+
If `path`/`line` are missing, derive locations from `evidence_refs` alone or search for the code snippet from `evidence`.
|
|
331
|
+
- If the reviewer provides a specific code suggestion or diff, implement IT exactly — not your own interpretation
|
|
332
|
+
- Do NOT simplify, minimize, or "half-fix" the suggestion
|
|
333
|
+
- After fixing, verify your code matches what the reviewer asked for, not just "addresses the concern"
|
|
334
|
+
- **NO SKIP WITHOUT USER APPROVAL:** If you disagree with the suggestion, ASK THE USER before skipping, partially fixing, or applying a minimum-viable fix
|
|
335
|
+
- **Read the ENTIRE review thread before acting.** Review threads contain a top-level comment plus replies.
|
|
336
|
+
Comments often contain multiple parts: a main issue description, code suggestions, AND additional references
|
|
337
|
+
like "Also applies to: 663-668" or mentions of other files/lines. Replies may contain clarifications,
|
|
338
|
+
additional locations, or refined suggestions. You MUST address ALL parts from the comment AND replies,
|
|
339
|
+
not just the first paragraph.
|
|
340
|
+
- **Multi-location fixes are MANDATORY.** When a comment says "Also applies to: X-Y" or references other lines/files,
|
|
341
|
+
apply the same logical fix, adapted as needed to each location. These are not optional — they are part of the
|
|
342
|
+
comment's requirements.
|
|
343
|
+
- **Post-fix verification checklist.** After fixing a comment, re-read the ORIGINAL review thread in full and verify:
|
|
344
|
+
1. Every code suggestion or diff was implemented
|
|
345
|
+
2. Every referenced file and line range was addressed
|
|
346
|
+
3. Every "Also applies to" location was fixed
|
|
347
|
+
4. No secondary instructions or reply clarifications were skipped
|
|
348
|
+
If any part was missed, fix it before moving to the next comment.
|
|
349
|
+
|
|
350
|
+
### Phase 3b: Finding Verification (MANDATORY — DO NOT SKIP)
|
|
351
|
+
|
|
352
|
+
**After ALL fixes are applied, verify EVERY finding from ALL sources (human, Qodo, CodeRabbit):**
|
|
353
|
+
|
|
354
|
+
1. **Read each finding's FULL description** — not just the title. Two findings with similar titles can reference completely different code.
|
|
355
|
+
2. **Read the code block** in the finding — for Qodo sticky findings, check the `code_diff` field first.
|
|
356
|
+
If `code_diff` is empty (not all findings have fenced diff blocks), fall back to
|
|
357
|
+
`evidence_refs` (check each entry — entries that contain file/line references like
|
|
358
|
+
`file[28-52]` or `file[R28-52]` are code locations to verify; skip non-location entries),
|
|
359
|
+
`path`/`line`/`end_line` (if present — can be empty/null), and the finding body.
|
|
360
|
+
If `path`/`line` are missing, derive locations from `evidence_refs` file/line entries.
|
|
361
|
+
Never skip verification because `code_diff` is empty — use the other fields instead.
|
|
362
|
+
The title alone is NEVER enough.
|
|
363
|
+
3. **Check the ACTUAL file** at that location — does the problematic code still exist?
|
|
364
|
+
- If YES → the finding is NOT addressed. Fix it.
|
|
365
|
+
- If NO → the finding is addressed.
|
|
366
|
+
4. **Never group findings by title.** Each finding is independent.
|
|
367
|
+
"Inconsistent task counts" about `readTaskSummary` is a DIFFERENT finding than
|
|
368
|
+
"Inconsistent task counts" about `renderTasksPart`.
|
|
369
|
+
5. **Never mark a finding as "pre-existing" or "by design" without reading the actual
|
|
370
|
+
code reference.** The code block tells you exactly what the reviewer found —
|
|
371
|
+
check if it's still there.
|
|
372
|
+
|
|
373
|
+
🚨 **HARD RULE: Every finding that includes a code block MUST be verified against
|
|
374
|
+
the actual file before being marked as addressed. No exceptions. No shortcuts.
|
|
375
|
+
No "this looks similar to the one I already fixed."**
|
|
376
|
+
|
|
377
|
+
### Phase 4: Review Unimplemented
|
|
378
|
+
|
|
379
|
+
If any approved tasks weren't implemented, review with user.
|
|
380
|
+
|
|
381
|
+
### Phase 5: Persist Decisions
|
|
382
|
+
|
|
383
|
+
Update each JSON entry with `status` and `reply` fields before posting.
|
|
384
|
+
|
|
385
|
+
**Valid status values:**
|
|
386
|
+
|
|
387
|
+
| Status | Behavior |
|
|
388
|
+
|--------|----------|
|
|
389
|
+
| `addressed` | Post reply, resolve thread |
|
|
390
|
+
| `not_addressed` | Post reply (human: leave unresolved; AI: resolve) |
|
|
391
|
+
| `skipped` | Post reply with skip reason (human: leave unresolved; AI: resolve) |
|
|
392
|
+
| `pending` | Skip (not processed yet) |
|
|
393
|
+
| `failed` | Retry posting |
|
|
394
|
+
|
|
395
|
+
**Mapping from user decisions (Phase 2):**
|
|
396
|
+
|
|
397
|
+
- User said **yes** and code was changed → `addressed`
|
|
398
|
+
- User said **yes** but fix attempt failed (code change didn't work) → `not_addressed`
|
|
399
|
+
- User said **no** → `skipped` (include the user's skip reason in `reply`)
|
|
400
|
+
- User said **all** → same as **yes** for each remaining comment
|
|
401
|
+
- User said **skip \<source\>** → `skipped` for all remaining from that source
|
|
402
|
+
(include the user's skip reason in `reply`)
|
|
403
|
+
- User said **skip ai** → `skipped` for all remaining AI sources
|
|
404
|
+
(include the user's skip reason in `reply`)
|
|
405
|
+
|
|
406
|
+
**Autoqodo status rules (MANDATORY):**
|
|
407
|
+
|
|
408
|
+
- Code was changed to fix the finding → `addressed`
|
|
409
|
+
- No code changed, finding is by design / won't fix / not applicable → `skipped` (with reason)
|
|
410
|
+
- No code changed, deferred to follow-up → `skipped` (with reason)
|
|
411
|
+
- Issue spec was updated (no code change) → `skipped` (with reason referencing the spec update)
|
|
412
|
+
|
|
413
|
+
🚨 **`addressed` means code was changed. If no code was changed, the status MUST be `skipped`.**
|
|
414
|
+
`not_addressed` means "we wanted to fix it but couldn't" — do NOT use it for "by design" findings.
|
|
415
|
+
|
|
416
|
+
🚨 **NEVER defer or skip a finding because the fix "requires too much work" (schema migration,
|
|
417
|
+
refactoring, new module, etc.).** The AI does NOT decide what is too much work — the user does.
|
|
418
|
+
If a finding requires a code change, make the code change. If you genuinely believe a finding
|
|
419
|
+
is wrong or not applicable, set status to `skipped` with a technical reason — but "too much work",
|
|
420
|
+
"requires migration", "will add later", or "deferred to follow-up" are NEVER valid reasons to skip.
|
|
421
|
+
Fix it now. In auto mode (--autoqodo / --autorabbit), there is NO user interaction — fix the code.
|
|
422
|
+
|
|
423
|
+
### Phase 6: Testing
|
|
424
|
+
|
|
425
|
+
Run tests with coverage.
|
|
426
|
+
|
|
427
|
+
**ALL tests must pass before proceeding. No exceptions.**
|
|
428
|
+
|
|
429
|
+
- Do NOT skip or ignore failures, even if they appear "pre-existing" or "unrelated to our changes"
|
|
430
|
+
- Do NOT rationalize failures as acceptable
|
|
431
|
+
- If a test fails, fix it — regardless of whether this PR introduced the failure
|
|
432
|
+
- Only proceed to Phase 7 when the test suite is fully green (zero failures)
|
|
433
|
+
|
|
434
|
+
### Phase 7: Commit & Push
|
|
435
|
+
|
|
436
|
+
**NEVER amend commits — always create NEW commits.** Amending + force-push prevents
|
|
437
|
+
automated reviewers (Qodo, CodeRabbit) from detecting changes and re-evaluating findings.
|
|
438
|
+
Each fix cycle MUST be a separate commit so reviewers can see what changed.
|
|
439
|
+
|
|
440
|
+
**If ALL comments are from auto-approved sources (see Phase 2 auto mode rules):**
|
|
441
|
+
Skip asking the user — commit and push automatically.
|
|
442
|
+
|
|
443
|
+
**Otherwise:** Ask user if they want to commit and push changes.
|
|
444
|
+
|
|
445
|
+
Code must be pushed before posting replies so that reviewers can see the fixes
|
|
446
|
+
when threads are resolved.
|
|
447
|
+
|
|
448
|
+
### Phase 8: Post Replies
|
|
449
|
+
|
|
450
|
+
Post all replies to GitHub and store results in the database.
|
|
451
|
+
|
|
452
|
+
**Body comments (outside-diff, major, minor, nitpick, duplicate, qodo sticky):**
|
|
453
|
+
|
|
454
|
+
Comments that don't have GitHub review threads (e.g., CodeRabbit outside-diff,
|
|
455
|
+
major, minor, nitpick, and duplicate comments) are replied to via a single
|
|
456
|
+
consolidated PR comment per reviewer. The comment mentions the reviewer (e.g., `@coderabbitai`)
|
|
457
|
+
and includes sections for each comment with the decision made. This ensures
|
|
458
|
+
automated reviewers know their comments were reviewed and won't re-raise them.
|
|
459
|
+
|
|
460
|
+
Post replies to GitHub:
|
|
461
|
+
|
|
462
|
+
```bash
|
|
463
|
+
myk-pi-tools reviews post {json_path}
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
If the command exits with a non-zero code, some threads failed to post.
|
|
467
|
+
The command prints an ACTION REQUIRED message with the exact retry command.
|
|
468
|
+
Re-run it to retry — only unposted entries are retried. Repeat until all succeed.
|
|
469
|
+
|
|
470
|
+
**Output verification (MANDATORY):**
|
|
471
|
+
|
|
472
|
+
After `reviews post` completes successfully, check the output:
|
|
473
|
+
|
|
474
|
+
- `Processed N threads` — N should equal the number of entries with status `addressed`, `not_addressed`, `skipped`, or `failed` (everything except `pending`)
|
|
475
|
+
- `Resolved: N` — should be non-zero if any entries have status `addressed` or if AI-source entries have status `skipped`/`not_addressed`
|
|
476
|
+
- If `Processed 0 threads`, the status values in the JSON are wrong — fix them to use valid values from the table above and re-run before proceeding
|
|
477
|
+
- If output shows `Warning: Unknown status`, fix those entries — e.g., `"done"` or `"completed"` are not valid, use `"addressed"` instead
|
|
478
|
+
|
|
479
|
+
Do NOT proceed to `reviews store` until `reviews post` shows the expected thread count.
|
|
480
|
+
|
|
481
|
+
Store to database:
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
myk-pi-tools reviews store {json_path}
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
### Phase 9: Auto Polling Loop (--autorabbit / --autoqodo mode)
|
|
488
|
+
|
|
489
|
+
**Skip this phase if NEITHER `--autorabbit` NOR `--autoqodo` was passed.**
|
|
490
|
+
|
|
491
|
+
🚨 **ABSOLUTE RULE: NO USER INTERACTION DURING THE POLLING LOOP.**
|
|
492
|
+
|
|
493
|
+
**NEVER call AskUserQuestion during Phase 9. NEVER present options,
|
|
494
|
+
dialogs, choices, or questions to the user. The polling loop is FULLY
|
|
495
|
+
AUTOMATIC. If something is stuck, stale, or unclear — keep polling
|
|
496
|
+
silently. Do NOT invent questions like "PRs are stuck, what do you
|
|
497
|
+
want to do?" or "Should I keep polling?" or any variation. The loop
|
|
498
|
+
runs silently until an exit condition is met. Period.**
|
|
499
|
+
|
|
500
|
+
> **Exception: `qodo_requirement_gap` spec changes require user approval.**
|
|
501
|
+
> When a `qodo_requirement_gap` finding needs an issue spec update (not a code fix),
|
|
502
|
+
> the AI MUST ask the user before changing the spec. This is the ONLY exception to
|
|
503
|
+
> the 'no user interaction in Phase 9' rule.
|
|
504
|
+
>
|
|
505
|
+
> - Code fix for a requirement gap → do it automatically, no user interaction needed
|
|
506
|
+
> - Issue spec update for a requirement gap → ask user first via ask_user
|
|
507
|
+
|
|
508
|
+
After the review flow completes (Phases 1-8), enter a polling loop
|
|
509
|
+
to watch for new comments from auto-approved sources (CodeRabbit if autorabbit,
|
|
510
|
+
Qodo if autoqodo, both if both flags active).
|
|
511
|
+
|
|
512
|
+
#### 9a+9b: Wait and Fetch (combined async)
|
|
513
|
+
|
|
514
|
+
**Always pass `--source` explicitly. No defaults.**
|
|
515
|
+
|
|
516
|
+
**If autorabbit is ON (only):** Spawn ONE async worker:
|
|
517
|
+
|
|
518
|
+
- Agent: `worker`
|
|
519
|
+
- Task: `Run: myk-pi-tools reviews poll --output-dir ${PROJECT_TMP_DIR} --source coderabbit [same arguments as Phase 1].`
|
|
520
|
+
`Return the EXACT raw stdout output — do NOT summarize, interpret, or rephrase it.`
|
|
521
|
+
`IMPORTANT: Do NOT set a timeout on the bash call — this command sleeps 300s between cycles and can run for 30+ minutes.`
|
|
522
|
+
- async: true
|
|
523
|
+
- **No timeout** — the poll can take 30+ minutes (rate limit waits). NEVER set a timeout.
|
|
524
|
+
|
|
525
|
+
**If autoqodo is ON (only):** Spawn ONE async worker:
|
|
526
|
+
|
|
527
|
+
- Agent: `worker`
|
|
528
|
+
- Task: `Run: myk-pi-tools reviews poll --output-dir ${PROJECT_TMP_DIR} --source qodo [same arguments as Phase 1].`
|
|
529
|
+
`Return the EXACT raw stdout output — do NOT summarize, interpret, or rephrase it.`
|
|
530
|
+
`IMPORTANT: Do NOT set a timeout on the bash call — this command sleeps 300s between cycles and can run for 30+ minutes.`
|
|
531
|
+
- async: true
|
|
532
|
+
- **No timeout** — the poll loops internally until new Qodo comments appear. NEVER set a timeout.
|
|
533
|
+
|
|
534
|
+
**If BOTH are ON:** Spawn TWO async workers in parallel:
|
|
535
|
+
|
|
536
|
+
1. `Run: myk-pi-tools reviews poll --output-dir ${PROJECT_TMP_DIR} --source coderabbit [same arguments as Phase 1].`
|
|
537
|
+
`Return the EXACT raw stdout output — do NOT summarize, interpret, or rephrase it.`
|
|
538
|
+
`IMPORTANT: Do NOT set a timeout on the bash call — this command sleeps 300s between cycles and can run for 30+ minutes.`
|
|
539
|
+
1. `Run: myk-pi-tools reviews poll --output-dir ${PROJECT_TMP_DIR} --source qodo [same arguments as Phase 1].`
|
|
540
|
+
`Return the EXACT raw stdout output — do NOT summarize, interpret, or rephrase it.`
|
|
541
|
+
`IMPORTANT: Do NOT set a timeout on the bash call — this command sleeps 300s between cycles and can run for 30+ minutes.`
|
|
542
|
+
|
|
543
|
+
When EITHER returns with new comments, process them (Phases 2-8). Then re-spawn that agent.
|
|
544
|
+
The other agent keeps running independently.
|
|
545
|
+
|
|
546
|
+
**While waiting for the async result**, the session remains interactive — the user
|
|
547
|
+
can continue working. When the result surfaces, process it:
|
|
548
|
+
|
|
549
|
+
Check the poll JSON output — it always contains an `approved` key:
|
|
550
|
+
|
|
551
|
+
- If `"approved": true` in the JSON: **EXIT the loop**.
|
|
552
|
+
The JSON contains both the approval status AND the reviews data
|
|
553
|
+
(metadata, human, qodo, coderabbit) — no separate fetch needed.
|
|
554
|
+
|
|
555
|
+
**On exit, display the Remaining Findings Summary (MANDATORY):**
|
|
556
|
+
|
|
557
|
+
The approval JSON includes the reviews data directly — use it for the summary.
|
|
558
|
+
The `metadata.json_path` field contains the path to the saved JSON file.
|
|
559
|
+
|
|
560
|
+
Display TWO tables:
|
|
561
|
+
|
|
562
|
+
**Table 1: Tradeoffs** — every finding that was replied WITHOUT a code fix (skipped, by design,
|
|
563
|
+
false positive, deferred, acknowledged). The user must see what compromises were made.
|
|
564
|
+
|
|
565
|
+
**Table 2: Remaining** — any truly unresolved findings (should be 0 on approval).
|
|
566
|
+
|
|
567
|
+
```text
|
|
568
|
+
🎉 {source} approved PR #{pr_number}. Auto loop complete.
|
|
569
|
+
|
|
570
|
+
## Tradeoffs ({count})
|
|
571
|
+
|
|
572
|
+
| # | Type | File | Finding | Resolution |
|
|
573
|
+
|---|------|------|---------|------------|
|
|
574
|
+
| 1 | Bug | enforcement.ts:604 | Commit bypass via untracked edits | By design — only tracks edit/write tools |
|
|
575
|
+
| 2 | Rule violation | implement-and-review.md:6 | Missing policy blockquote | False positive — blockquote exists |
|
|
576
|
+
| 3 | Bug | pi-config-review-state.ts:66 | Update race risk | Acknowledged — deferred, narrow window |
|
|
577
|
+
|
|
578
|
+
## Remaining Findings ({count})
|
|
579
|
+
|
|
580
|
+
| # | Type | File | Finding | Why remaining |
|
|
581
|
+
|---|------|------|---------|---------------|
|
|
582
|
+
| 1 | Bug | path/to/file.py:17 | Finding title | Skipped — reason from the reply |
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
**Tradeoffs table rules:**
|
|
586
|
+
- Include EVERY finding across ALL cycles that was replied without a code change
|
|
587
|
+
- Read the review database (`myk-pi-tools reviews store` data) or the accumulated
|
|
588
|
+
replies from the session to build this list
|
|
589
|
+
- **Resolution** = the reply text (summarized to one line)
|
|
590
|
+
- If zero tradeoffs: show `## Tradeoffs (0)` with "All findings fixed with code changes."
|
|
591
|
+
|
|
592
|
+
**Remaining findings table rules:**
|
|
593
|
+
- Show findings that are truly unresolved — `not_addressed` or `failed` status only
|
|
594
|
+
- Do NOT include `skipped` findings here — those are tradeoffs (shown in the table above)
|
|
595
|
+
- **Type** = the finding type (Bug, Requirement gap, Rule violation, etc.)
|
|
596
|
+
- **Finding** = the finding title (bold text from the body)
|
|
597
|
+
- **Why remaining** = the status + reason (from the reply field)
|
|
598
|
+
- If zero remaining findings: show `## Remaining Findings (0)` with "All findings resolved."
|
|
599
|
+
|
|
600
|
+
- This is the ONLY user-facing output on exit — no per-cycle summaries, no fix history
|
|
601
|
+
|
|
602
|
+
- If `"approved": false`: **Process ALL actionable items in the JSON.**
|
|
603
|
+
|
|
604
|
+
🚨 **MANDATORY: Process EVERY actionable item — review thread comments, sticky findings,
|
|
605
|
+
AND cleanup response. Do NOT cherry-pick one type and skip others. Do NOT treat the
|
|
606
|
+
checks below as mutually exclusive — they ALL apply in the same cycle.**
|
|
607
|
+
|
|
608
|
+
1. **Review thread comments** (items with `thread_id`): Run Phases 2-8 for each.
|
|
609
|
+
2. **Sticky findings** (items without `thread_id`, type starts with `qodo_`): Run Phases 2-8 for each.
|
|
610
|
+
3. **`qodo_cleanup_response`** (if not empty): Address every item Qodo listed:
|
|
611
|
+
- Qodo says "fixed" / "looks fixed" / "addressed" → no code change needed
|
|
612
|
+
- Qodo says "still open" / "still relevant" / "still actionable" → MUST fix the code, commit, push
|
|
613
|
+
- If you don't understand what Qodo wants for a specific finding → use
|
|
614
|
+
`myk-pi-tools reviews ask-qodo "<question>"` to ask Qodo directly.
|
|
615
|
+
The command posts the question to @qodo-code-review and waits up to 10 minutes
|
|
616
|
+
for Qodo's reply. Read the reply and act on it.
|
|
617
|
+
- Every item in `qodo_cleanup_response` MUST be addressed. No skipping.
|
|
618
|
+
|
|
619
|
+
After fixing ALL items, commit and push, then re-spawn the poll.
|
|
620
|
+
|
|
621
|
+
#### 9c: Exit Conditions (MANDATORY)
|
|
622
|
+
|
|
623
|
+
**The loop MUST run until one of these conditions is met:**
|
|
624
|
+
|
|
625
|
+
1. **All auto-approved reviewers approved** — `reviews poll` returns JSON with `"approved": true`. Exit and notify the user.
|
|
626
|
+
2. **User explicitly stops** — user presses `Ctrl+C` or sends "stop", "exit", "done", or "quit".
|
|
627
|
+
|
|
628
|
+
**No other reason is valid to exit the loop.**
|
|
629
|
+
|
|
630
|
+
```text
|
|
631
|
+
VIOLATION — The following rationalizations are FORBIDDEN reasons to exit the loop:
|
|
632
|
+
|
|
633
|
+
- "All comments have been addressed"
|
|
634
|
+
- "No new comments found for N cycles"
|
|
635
|
+
- "The loop seems complete"
|
|
636
|
+
- "Nothing left to process"
|
|
637
|
+
- "The review is done"
|
|
638
|
+
- "CodeRabbit has not posted anything new"
|
|
639
|
+
- "It appears the review cycle is finished"
|
|
640
|
+
- "The fetch command failed"
|
|
641
|
+
- "An error occurred during polling"
|
|
642
|
+
- "The API returned an error"
|
|
643
|
+
- "An error prevents continuing"
|
|
644
|
+
- Any variation of the AI deciding there is no more work to do
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
```text
|
|
648
|
+
VIOLATION — The following user interactions are FORBIDDEN during Phase 9:
|
|
649
|
+
|
|
650
|
+
- Calling AskUserQuestion for ANY reason
|
|
651
|
+
- Presenting options like "keep polling / stop / skip"
|
|
652
|
+
- Asking "should I continue?"
|
|
653
|
+
- Asking "PRs are stuck, what do you want to do?"
|
|
654
|
+
- Asking for user input about stale comments
|
|
655
|
+
- Asking for user decisions about polling strategy
|
|
656
|
+
- ANY dialog, question, or prompt to the user
|
|
657
|
+
- Any variation of the AI asking the user what to do
|
|
658
|
+
|
|
659
|
+
The ONLY way the user interacts with the loop is by explicitly
|
|
660
|
+
sending "stop", "exit", "done", or "quit" — unprompted by the AI.
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
If any command in the loop fails, log the error, wait 5 minutes, and retry from 9a.
|
|
664
|
+
Errors are recoverable — NEVER treat a command failure as a reason to exit.
|
|
665
|
+
|
|
666
|
+
**Breaking the loop without a valid exit condition is a HARD VIOLATION of this spec.**
|
|
667
|
+
|
|
668
|
+
Each cycle displays a status update so the user knows the loop is active:
|
|
669
|
+
|
|
670
|
+
```text
|
|
671
|
+
[auto] Cycle {N} complete — {addressed} addressed, {skipped} skipped. Re-spawning poll...
|
|
672
|
+
[auto] Checking for new comments from auto-approved sources...
|
|
673
|
+
[auto] Found {N} new comments — processing...
|
|
674
|
+
[auto] No new comments. Next check in 5 minutes...
|
|
675
|
+
[auto] CodeRabbit rate-limited. Handling automatically via reviews poll --source coderabbit...
|
|
676
|
+
[auto] 🎉 {source} approved PR #{pr_number}. Displaying remaining findings summary.
|
|
677
|
+
```
|