@dreb/coding-agent 2.55.6 → 2.57.0
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 +1 -1
- package/agents/developers-advocate.md +39 -0
- package/agents/devils-advocate.md +39 -0
- package/agents/independent-assessor.md +32 -43
- package/dist/core/tools/subagent.d.ts +10 -1
- package/dist/core/tools/subagent.d.ts.map +1 -1
- package/dist/core/tools/subagent.js +152 -14
- package/dist/core/tools/subagent.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +7 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +10 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +36 -2
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +23 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/docs/dashboard.md +2 -2
- package/docs/mach6.md +27 -21
- package/docs/rpc.md +18 -0
- package/docs/skills.md +1 -1
- package/package.json +1 -1
- package/skills/mach6-implement/SKILL.md +1 -1
- package/skills/mach6-publish/SKILL.md +12 -8
- package/skills/mach6-review/SKILL.md +65 -161
package/docs/mach6.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# mach6 — Development Workflow
|
|
2
2
|
|
|
3
|
-
mach6 is a built-in workflow that orchestrates the full issue-to-merge lifecycle using GitHub as shared memory. Six skills cover each stage of development,
|
|
3
|
+
mach6 is a built-in workflow that orchestrates the full issue-to-merge lifecycle using GitHub as shared memory. Six skills cover each stage of development, with round-aware specialist review and three independent assessment agents providing deliberate counter-pressure.
|
|
4
4
|
|
|
5
5
|
Inspired by [mach10](https://github.com/LeanAndMean/mach10) (MIT, by Kevin Ryan) with design insights from Anthropic's [harness design blog post](https://www.anthropic.com/engineering/harness-design-long-running-apps).
|
|
6
6
|
|
|
@@ -69,20 +69,17 @@ Commit changes, push to remote, and post a progress comment.
|
|
|
69
69
|
|
|
70
70
|
### mach6-review
|
|
71
71
|
|
|
72
|
-
Run
|
|
72
|
+
Run a durable, explicit, round-aware review. It always posts two comments: an **unverified candidates pending assessment** comment recording the review round and exact reviewed commit SHA, followed by an assessment comment whose action plan contains merge blockers only.
|
|
73
73
|
|
|
74
74
|
```
|
|
75
|
-
/skill:mach6-review 53
|
|
76
|
-
/skill:mach6-review 53 code errors
|
|
77
|
-
/skill:mach6-review 53 tests
|
|
75
|
+
/skill:mach6-review 53
|
|
76
|
+
/skill:mach6-review 53 code errors
|
|
77
|
+
/skill:mach6-review 53 tests
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
Rounds 1–2 run the applicable code-reviewer, error-auditor, test-reviewer, completeness-checker, and simplifier together in phase one. The independent assessor then applies factual, scope, and practical gates. Practical assessment requires a credible actor, exact reachable trigger, concrete consequence, existing safeguards, and material value from fixing the problem; missing tests are not blockers without an important uncovered regression.
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
2. **Assessment** (`<!-- mach6-assessment -->`) — each finding independently classified as genuine issue, nitpick, false positive, or deferred, with a prioritized action plan containing genuine issues only
|
|
84
|
-
|
|
85
|
-
A finding is genuine only when it passes both a **factual gate** (the current code contains the problem) and a **scope gate** (the problem must be fixed to deliver the authorized work safely and correctly). Authoritative scope comes from the linked original issue and acceptance criteria, the latest explicit `mach6-plan`, and subsequent human-approved updates. Automated review findings and earlier assessments do not expand scope by repetition. Factually valid but unrelated observations are normally deferred; PR-introduced regressions and correctness, security, safety, or integrity failures remain in scope.
|
|
82
|
+
Round 3+ reviews only changes since the latest recorded reviewed SHA and verifies prior blockers. The four core specialists remain; simplifier runs only when explicitly requested. Phase two runs independent-assessor, developers-advocate, and devils-advocate in parallel. The developer's advocate attacks the practical value of proposed work; the devil's advocate attacks evidence that the original acceptance promises hold and supplements rather than replaces test-reviewer. A later-round item blocks merge only when the assessor and developer's advocate agree on material practical impact, with parent adjudication based on a concrete trigger-and-outcome sequence.
|
|
86
83
|
|
|
87
84
|
See [Review Agents](#review-agents) below.
|
|
88
85
|
|
|
@@ -112,7 +109,7 @@ Pre-merge checks, version bump, docs update, merge, tag, and release.
|
|
|
112
109
|
/skill:mach6-publish 53
|
|
113
110
|
```
|
|
114
111
|
|
|
115
|
-
-
|
|
112
|
+
- Checks conflicts and merge blockers, performs version/docs pushes directly, then makes one final blocking `watch_github_ci` call immediately before merge
|
|
116
113
|
- Runs pre-merge checklist (version bump, tests)
|
|
117
114
|
- Applies version bump on the feature branch
|
|
118
115
|
- Proactively reviews and updates ALL documentation affected by the PR's changes
|
|
@@ -127,24 +124,33 @@ Strong general-purpose coding agent optionally used by `mach6-implement` for pre
|
|
|
127
124
|
|
|
128
125
|
### Review Agents
|
|
129
126
|
|
|
130
|
-
|
|
127
|
+
Phase one uses specialists with orthogonal incentives and confidence-scored candidate findings:
|
|
131
128
|
|
|
132
|
-
| Agent | Question |
|
|
129
|
+
| Agent | Question | Round behavior |
|
|
133
130
|
|---|---|---|
|
|
134
|
-
| **code-reviewer** |
|
|
135
|
-
| **error-auditor** | What can
|
|
136
|
-
| **test-reviewer** | What
|
|
137
|
-
| **completeness-checker** | Does
|
|
138
|
-
| **simplifier** | Can
|
|
131
|
+
| **code-reviewer** | Is the implementation correct and idiomatic? | All applicable rounds |
|
|
132
|
+
| **error-auditor** | What can fail silently at runtime? | All applicable rounds |
|
|
133
|
+
| **test-reviewer** | What important behavior lacks coverage? | All applicable rounds; never replaced |
|
|
134
|
+
| **completeness-checker** | Does the PR fulfill authoritative scope? | All applicable rounds |
|
|
135
|
+
| **simplifier** | Can changed code be clearer without behavior changes? | Rounds 1–2 in parallel; round 3+ only when requested |
|
|
136
|
+
|
|
137
|
+
Phase two assessment agents:
|
|
138
|
+
|
|
139
|
+
| Agent | Incentive |
|
|
140
|
+
|---|---|
|
|
141
|
+
| **independent-assessor** | Apply factual, scope, and practical gates; classify merge blockers |
|
|
142
|
+
| **developers-advocate** | Make the strongest honest case that proposed work has no practical value |
|
|
143
|
+
| **devils-advocate** | Design adversarial tests intended to disprove the original acceptance promises |
|
|
139
144
|
|
|
140
|
-
|
|
145
|
+
The two advocates intentionally pull in different directions: one challenges the value of fixing candidates, while the other challenges whether acceptance evidence is strong enough. Both join the assessor only in round 3+.
|
|
141
146
|
|
|
142
|
-
**Targeted review:**
|
|
147
|
+
**Targeted review:** `code`, `errors`, `tests`, `completeness`, or `simplify` selects corresponding phase-one agents.
|
|
143
148
|
|
|
144
149
|
## Design Principles
|
|
145
150
|
|
|
146
151
|
- **GitHub as shared memory** — Plans, reviews, assessments, and progress are posted as PR/issue comments with HTML markers (`<!-- mach6-plan -->`, `<!-- mach6-review -->`, etc.) so any future session can pick up context.
|
|
147
|
-
- **
|
|
152
|
+
- **Three-gate independent assessment** — Findings must be factual, authorized, and materially practical before becoming merge blockers.
|
|
153
|
+
- **Deliberate counter-pressure** — Later rounds focus on the delta and pair practical-value skepticism with adversarial acceptance evidence to resist ceremonial review work.
|
|
148
154
|
- **Durable accountability checkpoint** — Implementation and fixes are committed, pushed, and recorded before formal review so work cannot be lost or repeatedly rewritten while still local.
|
|
149
155
|
- **User-controlled review cycles** — Only the user starts each formal review or re-review. Agents stop at the checkpoint and suggest the next command rather than autonomously chaining review and fix cycles.
|
|
150
156
|
- **Focused checks remain available** — One-off reviewer/checker subagents may answer narrow correctness questions without becoming a formal mach6 review cycle.
|
package/docs/rpc.md
CHANGED
|
@@ -1141,6 +1141,24 @@ Response:
|
|
|
1141
1141
|
}
|
|
1142
1142
|
```
|
|
1143
1143
|
|
|
1144
|
+
#### steer_background_agent
|
|
1145
|
+
|
|
1146
|
+
Queue the exact user-provided text as steering input for a specific live child. The command fails if the ID is unknown, completed, rehydrated, waiting for a concurrency slot, or between chain steps; it never falls back to the parent or another child. Built-in slash commands are rejected at the RPC boundary just like parent steering.
|
|
1147
|
+
|
|
1148
|
+
```json
|
|
1149
|
+
{"type":"steer_background_agent","agentId":"a1b2c3d4e5f6","message":"Please finish with your current findings."}
|
|
1150
|
+
```
|
|
1151
|
+
|
|
1152
|
+
#### get_background_agent_pending
|
|
1153
|
+
|
|
1154
|
+
Read the selected live child's authoritative pending queues and effective steering delivery mode.
|
|
1155
|
+
|
|
1156
|
+
```json
|
|
1157
|
+
{"type":"get_background_agent_pending","agentId":"a1b2c3d4e5f6"}
|
|
1158
|
+
```
|
|
1159
|
+
|
|
1160
|
+
The response data is `{ "steeringMode": "one-at-a-time" | "all", "pending": RpcPendingMessages }`. Multiple `steer_background_agent` commands therefore use the target child's existing queue semantics.
|
|
1161
|
+
|
|
1144
1162
|
#### list_agent_types
|
|
1145
1163
|
|
|
1146
1164
|
List discoverable subagent types for the current session working directory. This includes package-bundled agents, user-level agents, and project-level agents in `.dreb/agents/*.md`. Results are sorted by `name`.
|
package/docs/skills.md
CHANGED
|
@@ -282,7 +282,7 @@ dreb ships with **mach6**, a development workflow that orchestrates the full iss
|
|
|
282
282
|
| `mach6-issue` | Assess an existing issue or create a new one |
|
|
283
283
|
| `mach6-plan` | Explore codebase, plan, create branch and draft PR |
|
|
284
284
|
| `mach6-push` | Commit, push, post progress comment |
|
|
285
|
-
| `mach6-review` |
|
|
285
|
+
| `mach6-review` | Explicit round-aware review with delta re-reviews, three-gate assessment, and later-round adversarial counter-pressure |
|
|
286
286
|
| `mach6-implement` | Implement plans, fix review findings, or fix CI failures |
|
|
287
287
|
| `mach6-publish` | Pre-merge checks, docs update, merge, tag, release |
|
|
288
288
|
| `model-routing-guide` | Research scoped models and sanitized local subagent evidence into a validated routing guide |
|
package/package.json
CHANGED
|
@@ -154,7 +154,7 @@ Find the review (`<!-- mach6-review -->`) and assessment (`<!-- mach6-assessment
|
|
|
154
154
|
|
|
155
155
|
#### If no finding numbers and not `ci`:
|
|
156
156
|
|
|
157
|
-
Read ALL PR comments, find review/assessment comments, present
|
|
157
|
+
Read ALL PR comments, find review/assessment comments, present the merge blockers from the latest assessment comment, and ask which to fix.
|
|
158
158
|
|
|
159
159
|
### Step 5f: Batch sizing
|
|
160
160
|
|
|
@@ -15,6 +15,7 @@ argument-hint: "<pr-number>"
|
|
|
15
15
|
3. **Safe git** — Never use `git add -A` or `git add .`. Stage files by name. Never stage secrets.
|
|
16
16
|
4. **Task tracking** — Use the `tasks_update` tool to show progress.
|
|
17
17
|
5. **Non-interactive `gh`** — Set `GH_PAGER=cat` and `GH_EDITOR=cat` before all `gh` commands to prevent interactive prompts from hanging the agent. Use `--body-file` instead of inline `--body` for all `gh pr comment`, `gh pr create`, and `gh issue create` calls to avoid shell interpretation of backticks. Write each body to a **unique per-invocation temp file** via `mktemp` (e.g. `GH_BODY="$(mktemp /tmp/gh-comment.$$.XXXXXXXX)"`) — never a fixed path like `/tmp/gh-comment.md`, which concurrent mach6 sessions on the same machine would clobber, cross-posting one session's body to another's PR/issue.
|
|
18
|
+
6. **Authorized pushes** — The agent performs the version-bump push, documentation push, and tag push directly without asking for per-step confirmation. The remaining user checkpoints are bump level when unclear, whether to create a GitHub release, and release-notes approval.
|
|
18
19
|
|
|
19
20
|
## Step 1: Set up task tracking
|
|
20
21
|
|
|
@@ -36,14 +37,11 @@ git pull
|
|
|
36
37
|
gh pr view <pr-number> --json mergeable,mergeStateStatus,statusCheckRollup,reviewDecision,comments,body
|
|
37
38
|
```
|
|
38
39
|
|
|
39
|
-
Use `watch_github_ci` with `pr: "<pr-number>"` to block until CI passes or fails. Do not use `wait`, sleep, or repeated polling commands for CI.
|
|
40
|
-
|
|
41
40
|
Read ALL PR comments to understand the full history — plans, reviews, assessments, progress updates, and discussion.
|
|
42
41
|
|
|
43
42
|
Verify:
|
|
44
|
-
- [ ] CI is passing
|
|
45
43
|
- [ ] No merge conflicts
|
|
46
|
-
- [ ] All
|
|
44
|
+
- [ ] All merge blockers in the latest assessment are addressed
|
|
47
45
|
|
|
48
46
|
If there are blocking issues, report them and suggest fixes:
|
|
49
47
|
- **Failed CI**: `/skill:mach6-implement <pr-number> ci`
|
|
@@ -89,7 +87,7 @@ Update task: checks → completed, version → in_progress.
|
|
|
89
87
|
git push
|
|
90
88
|
```
|
|
91
89
|
|
|
92
|
-
|
|
90
|
+
The agent performs this version-bump push directly without asking for confirmation.
|
|
93
91
|
|
|
94
92
|
If the project doesn't use versioning, skip this step.
|
|
95
93
|
|
|
@@ -126,13 +124,19 @@ Proactively review and update ALL documentation affected by the PR's changes. Th
|
|
|
126
124
|
git push
|
|
127
125
|
```
|
|
128
126
|
|
|
129
|
-
|
|
127
|
+
The agent performs this documentation push directly without asking for confirmation.
|
|
130
128
|
|
|
131
129
|
If no documentation changes are needed (rare), skip this step.
|
|
132
130
|
|
|
133
131
|
Update task: docs → completed, merge → in_progress.
|
|
134
132
|
|
|
135
|
-
## Step 5:
|
|
133
|
+
## Step 5: Final CI gate and merge
|
|
134
|
+
|
|
135
|
+
After the final pre-merge push (version bump and/or documentation), make the workflow's single CI watch:
|
|
136
|
+
|
|
137
|
+
Use `watch_github_ci` with `pr: "<pr-number>"` and proceed only after it passes. Do not use `wait`, sleep, or repeated polling commands for CI. If CI fails, stop and suggest `/skill:mach6-implement <pr-number> ci`.
|
|
138
|
+
|
|
139
|
+
Immediately after that successful watch:
|
|
136
140
|
|
|
137
141
|
```bash
|
|
138
142
|
gh pr merge <pr-number> --squash --delete-branch
|
|
@@ -161,7 +165,7 @@ Ask the user if they want to create a GitHub release:
|
|
|
161
165
|
|
|
162
166
|
### Always create the git tag
|
|
163
167
|
|
|
164
|
-
The tag is created on the default branch after merge, using the version from Step 3:
|
|
168
|
+
The tag is created on the default branch after merge, using the version from Step 3. The agent performs the tag push directly without asking for confirmation:
|
|
165
169
|
|
|
166
170
|
```bash
|
|
167
171
|
git tag v<version>
|
|
@@ -1,243 +1,147 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mach6-review
|
|
3
|
-
description: "Run
|
|
3
|
+
description: "Run round-aware specialist review, post unverified candidates, then assess practical merge blockers with adversarial counter-pressure. Usage: mach6-review 42 [aspects]"
|
|
4
4
|
argument-hint: "<pr-number> [code|errors|tests|completeness|simplify]"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# mach6-review — Multi-Agent PR Review
|
|
7
|
+
# mach6-review — Round-Aware Multi-Agent PR Review
|
|
8
8
|
|
|
9
9
|
**User input:** $ARGUMENTS
|
|
10
10
|
|
|
11
11
|
## Global Rules
|
|
12
12
|
|
|
13
|
-
1.
|
|
14
|
-
2.
|
|
15
|
-
3.
|
|
16
|
-
4.
|
|
17
|
-
5.
|
|
18
|
-
6.
|
|
19
|
-
7.
|
|
13
|
+
1. GitHub is shared memory. Post two comments in every round: `<!-- mach6-review -->`, then `<!-- mach6-assessment -->` as each body's first line.
|
|
14
|
+
2. Never use `#N` in comment bodies; say "finding N".
|
|
15
|
+
3. Track work with `tasks_update`.
|
|
16
|
+
4. Set `GH_PAGER=cat` and `GH_EDITOR=cat` for every `gh` command. Use `--body-file` with a unique `mktemp /tmp/gh-comment.$$.XXXXXXXX` file.
|
|
17
|
+
5. Formal review runs only from an explicit user request; never invoke it autonomously or start a review-fix-review loop.
|
|
18
|
+
6. Review durable work only. Do not review uncommitted or unpushed work.
|
|
19
|
+
7. Do not fix findings in this session; fixes require a later user-invoked `/skill:mach6-implement`.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
## Step 1: Track tasks
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
tasks_update([
|
|
27
|
-
{ id: "prepare", title: "Prepare — checkout and gather context", status: "in_progress" },
|
|
28
|
-
{ id: "review", title: "Run review agents", status: "pending" },
|
|
29
|
-
{ id: "post-review", title: "Post review findings", status: "pending" },
|
|
30
|
-
{ id: "assess", title: "Independent assessment", status: "pending" },
|
|
31
|
-
{ id: "post-assess", title: "Post assessment", status: "pending" },
|
|
32
|
-
{ id: "summary", title: "Present CLI summary", status: "pending" }
|
|
33
|
-
])
|
|
34
|
-
```
|
|
23
|
+
Track prepare, phase-one review, findings comment, phase-two assessment, assessment comment, and summary; keep at most one task in progress.
|
|
35
24
|
|
|
36
25
|
## Step 2: Parse input
|
|
37
26
|
|
|
38
|
-
Extract:
|
|
39
|
-
- **PR number** (required)
|
|
40
|
-
- **Review aspects** (optional) — if specified, only run matching agents
|
|
27
|
+
Extract the required PR number and optional aspects: `code`, `errors`, `tests`, `completeness`, `simplify`.
|
|
41
28
|
|
|
42
|
-
## Step 3: Prepare and
|
|
29
|
+
## Step 3: Prepare, determine the round, and establish the delta
|
|
43
30
|
|
|
44
|
-
Before
|
|
45
|
-
|
|
46
|
-
Check out and update the PR branch:
|
|
31
|
+
Before checkout, run `git status --porcelain`. If non-empty, stop and use `suggest_next` to offer `/skill:mach6-push`.
|
|
47
32
|
|
|
48
33
|
```bash
|
|
49
34
|
gh pr checkout <pr-number>
|
|
50
35
|
git pull --ff-only
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
**Before marking the PR ready, reading local source for review, or launching any review agent**, verify again that the worktree is clean and local `HEAD` is exactly the pushed PR head:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
git status --porcelain
|
|
36
|
+
test -z "$(git status --porcelain)"
|
|
57
37
|
LOCAL_HEAD="$(git rev-parse HEAD)"
|
|
58
38
|
PR_HEAD="$(gh pr view <pr-number> --json headRefOid --jq '.headRefOid')"
|
|
59
39
|
test "$LOCAL_HEAD" = "$PR_HEAD"
|
|
60
40
|
```
|
|
61
41
|
|
|
62
|
-
If
|
|
63
|
-
|
|
64
|
-
Once the durable-work checks pass, gather all authoritative scope and PR context:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
gh pr view <pr-number> --json title,body,comments,files,headRefOid
|
|
68
|
-
gh pr diff <pr-number>
|
|
69
|
-
gh issue view <linked-issue-number> --comments
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Read the PR description, **all** comments, and the linked original issue. Establish authoritative scope from:
|
|
42
|
+
If either durable-work check fails, stop without marking ready, posting, or launching agents and offer `/skill:mach6-push`. `PR_HEAD` is the exact reviewed commit.
|
|
73
43
|
|
|
74
|
-
|
|
75
|
-
- The latest explicit plan comment (the latest `<!-- mach6-plan -->` marker)
|
|
76
|
-
- Subsequent scope updates explicitly approved by a human
|
|
44
|
+
Read the PR body, all comments, files, linked original issue and discussion, latest `<!-- mach6-plan -->`, and subsequent human-approved scope updates. Prior findings and assessments are evidence, not scope authority.
|
|
77
45
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
Now mark the PR as ready for review (it was opened as a draft by mach6-plan):
|
|
46
|
+
Count comments whose bodies start with `<!-- mach6-review -->`:
|
|
81
47
|
|
|
82
48
|
```bash
|
|
83
|
-
gh pr
|
|
49
|
+
PR_CONTEXT="$(gh pr view <pr-number> --json title,body,comments,files,headRefOid)"
|
|
50
|
+
PRIOR_ROUNDS="$(printf '%s' "$PR_CONTEXT" | jq '[.comments[] | select(.body | startswith("<!-- mach6-review -->"))] | length')"
|
|
51
|
+
REVIEW_ROUND="$((PRIOR_ROUNDS + 1))"
|
|
84
52
|
```
|
|
85
53
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
Update task: prepare → completed, review → in_progress.
|
|
54
|
+
For round 3+, extract the most recent parseable full SHA after `Reviewed commit:` in the latest review comment. If found, use `git log <sha>..HEAD` and `git diff <sha>..HEAD`; this delta and its interactions are the review target. Also extract previous merge blockers and verify that each is fixed. Reject unchanged-code findings unless a delta change makes the issue newly reachable. If no legacy SHA is parseable, review the full PR diff but retain all round-3+ rules.
|
|
89
55
|
|
|
90
|
-
|
|
56
|
+
For rounds 1–2, use `gh pr diff <pr-number>`. Mark the PR ready only after all checks pass: `gh pr ready <pr-number>`.
|
|
91
57
|
|
|
92
|
-
|
|
58
|
+
## Step 4: Phase one — specialist candidates
|
|
93
59
|
|
|
94
|
-
|
|
60
|
+
Agent mapping: `code` → `code-reviewer`; `errors` → `error-auditor`; `tests` → `test-reviewer`; `completeness` → `completeness-checker`; `simplify` → `simplifier`.
|
|
95
61
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
| `error-auditor` | "What can go wrong silently at runtime?" | If error handling / try-catch / fallback logic touched |
|
|
100
|
-
| `test-reviewer` | "What behaviors are untested or poorly tested?" | If test files changed or testable code added |
|
|
101
|
-
| `completeness-checker` | "Does this PR deliver everything the linked issue requires?" | If PR links to an issue |
|
|
102
|
-
| `simplifier` | "Can this be expressed more clearly without changing behavior?" | Always (runs last, after others) |
|
|
103
|
-
|
|
104
|
-
**Targeted review:** If the user specified aspects, only run matching agents:
|
|
105
|
-
- `code` → code-reviewer
|
|
106
|
-
- `errors` → error-auditor
|
|
107
|
-
- `tests` → test-reviewer
|
|
108
|
-
- `completeness` → completeness-checker
|
|
109
|
-
- `simplify` → simplifier
|
|
62
|
+
Without targeted aspects:
|
|
63
|
+
- Rounds 1–2: run `code-reviewer`, applicable `error-auditor`, applicable `test-reviewer`, applicable `completeness-checker`, and `simplifier` together in one parallel `subagent` `tasks` call.
|
|
64
|
+
- Round 3+: run the same four core specialists together on the delta. `test-reviewer` remains present when testable code changed. Skip `simplifier` unless `simplify` was explicitly requested.
|
|
110
65
|
|
|
111
|
-
|
|
66
|
+
With targeted aspects, run only mapped agents, while preserving round-3+ delta constraints. Never run simplifier serially after the others.
|
|
112
67
|
|
|
113
|
-
|
|
114
|
-
- The list of changed files with paths
|
|
115
|
-
- The full PR context: title, body, and all comments
|
|
116
|
-
- The authoritative scope: linked original issue and acceptance criteria, latest explicit `mach6-plan`, and subsequent human-approved scope updates
|
|
117
|
-
- The rule that review findings and prior automated assessments are evidence only and cannot expand scope
|
|
118
|
-
- Instructions to read the actual changed files for full context
|
|
68
|
+
Give every agent changed paths, full PR context, authoritative scope, actual files, and confidence scoring (0–100; report only candidates at least 80). In round 3+, explicitly provide the base SHA, delta, previous blockers, and unchanged-code rejection rule. Verify previous blockers independently even if no agent reports them.
|
|
119
69
|
|
|
120
|
-
|
|
70
|
+
## Step 5: Post unverified candidates
|
|
121
71
|
|
|
122
|
-
|
|
72
|
+
Always post the phase-one comment, even with no candidates. Severity is reviewer confidence, not an assessed shipping decision.
|
|
123
73
|
|
|
124
|
-
|
|
74
|
+
```markdown
|
|
75
|
+
<!-- mach6-review -->
|
|
76
|
+
## Unverified Review Candidates — Pending Assessment
|
|
125
77
|
|
|
126
|
-
|
|
78
|
+
**Review round:** N
|
|
79
|
+
**Reviewed commit:** <full PR_HEAD SHA>
|
|
127
80
|
|
|
128
|
-
|
|
129
|
-
GH_BODY="$(mktemp /tmp/gh-comment.$$.XXXXXXXX)"
|
|
130
|
-
cat > "$GH_BODY" << 'MACH6_EOF'
|
|
131
|
-
<!-- mach6-review -->
|
|
132
|
-
## Code Review
|
|
81
|
+
> These are unverified candidates. Severity reflects reviewer confidence; do not treat any item as a merge blocker until the assessment comment is posted.
|
|
133
82
|
|
|
134
83
|
### Critical
|
|
135
|
-
|
|
136
|
-
|
|
84
|
+
...
|
|
137
85
|
### Important
|
|
138
|
-
|
|
139
|
-
|
|
86
|
+
...
|
|
140
87
|
### Suggestions
|
|
141
|
-
|
|
142
|
-
|
|
88
|
+
...
|
|
143
89
|
### Strengths
|
|
144
|
-
|
|
90
|
+
...
|
|
145
91
|
|
|
146
|
-
**Agents run:**
|
|
92
|
+
**Agents run:** ...
|
|
147
93
|
|
|
148
94
|
---
|
|
149
95
|
*Reviewed by mach6*
|
|
150
|
-
MACH6_EOF
|
|
151
|
-
gh pr comment <pr-number> --body-file "$GH_BODY"
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Save the review comment URL:
|
|
155
|
-
```bash
|
|
156
|
-
gh pr view <pr-number> --json comments --jq '.comments[-1].url'
|
|
157
96
|
```
|
|
158
|
-
Extract the numeric comment ID from the URL (the number after `issuecomment-`).
|
|
159
|
-
|
|
160
|
-
Update task: post-review → completed, assess → in_progress.
|
|
161
|
-
|
|
162
|
-
## Step 6: Independent assessment
|
|
163
|
-
|
|
164
|
-
Launch a subagent with `agent: "independent-assessor"`. This is a **pre-existing agent definition** shipped with dreb — it has full codebase read access and uses the strongest available model via its own fallback list. The default is fine for most cases.
|
|
165
|
-
|
|
166
|
-
**Do NOT use the Sandbox agent for this step** — the Sandbox agent has no codebase access and cannot verify findings against actual code.
|
|
167
97
|
|
|
168
|
-
|
|
169
|
-
- The full review text
|
|
170
|
-
- The PR context (title, body, and all comments)
|
|
171
|
-
- The authoritative scope context: linked original issue, acceptance criteria, latest explicit `mach6-plan`, and subsequent human-approved scope updates
|
|
172
|
-
- Instructions to **read the actual code** for each finding and verify independently
|
|
98
|
+
Post with a unique temp file and `gh pr comment <pr-number> --body-file "$GH_BODY"`; save the returned/latest comment URL.
|
|
173
99
|
|
|
174
|
-
|
|
100
|
+
## Step 6: Phase two — assess with counter-pressure
|
|
175
101
|
|
|
176
|
-
|
|
177
|
-
2. **Scope gate:** Must that problem be fixed to deliver the authoritative scope safely and correctly?
|
|
102
|
+
All assessors receive identical candidate findings, actual code, full PR/issue context, verbatim original quoted requests, acceptance criteria, approved scope changes, review round, and delta context.
|
|
178
103
|
|
|
179
|
-
|
|
104
|
+
Apply three gates:
|
|
105
|
+
1. **Factual:** current code contains the problem.
|
|
106
|
+
2. **Scope:** fixing it is required by authoritative scope or a PR-introduced material regression.
|
|
107
|
+
3. **Practical:** shipping plausibly causes meaningful harm in supported use, through a credible attacker/system failure, or directly violates an explicit acceptance criterion.
|
|
180
108
|
|
|
181
|
-
|
|
182
|
-
- **Genuine issue** — Passes both gates. The reasoning must separately explain factual evidence and scope relevance.
|
|
183
|
-
- **Nitpick** — Stylistic preference or minor inconsistency that does not affect correctness or an authorized requirement.
|
|
184
|
-
- **False positive** — Fails the factual gate because the current code is correct, context was missed, or the issue was already addressed.
|
|
185
|
-
- **Deferred** — Passes the factual gate but fails the scope gate. Note separately for optional follow-up; never include in the action plan.
|
|
109
|
+
Rounds 1–2: launch `independent-assessor` alone.
|
|
186
110
|
|
|
187
|
-
|
|
111
|
+
Round 3+: launch `independent-assessor`, `developers-advocate`, and `devils-advocate` together in one parallel `subagent` `tasks` call. This preserves model-family diversity where available. The devil's advocate supplements, never replaces, `test-reviewer` and attacks acceptance evidence. The developer's advocate attacks the practical value of proposed work and cannot generate findings.
|
|
188
112
|
|
|
189
|
-
|
|
113
|
+
In round 3+, a candidate is a merge blocker only when both the independent assessor and developer's advocate find material practical impact. Do not vote or average confidence. When they disagree, the parent adjudicates by writing a concrete actor, exact reachable trigger sequence, resulting user harm or attacker capability, existing safeguards, and material outcome of fixing it. Without that concrete trigger-and-outcome sequence, it is not a merge blocker. Use devil's-advocate output to determine the minimal missing acceptance evidence, not to manufacture unrelated findings.
|
|
190
114
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
Update task: assess → completed, post-assess → in_progress.
|
|
115
|
+
Missing tests are not blockers by themselves: identify the important regression, practical consequence, and why current tests miss it.
|
|
194
116
|
|
|
195
117
|
## Step 7: Post assessment
|
|
196
118
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
119
|
+
Post the second comment with a unique temp body:
|
|
120
|
+
|
|
121
|
+
```markdown
|
|
200
122
|
<!-- mach6-assessment -->
|
|
201
123
|
## Review Assessment
|
|
202
124
|
|
|
203
|
-
<link to
|
|
125
|
+
<link to findings comment>
|
|
204
126
|
|
|
205
127
|
### Classifications
|
|
206
|
-
|
|
207
128
|
| Finding | Classification | Reasoning |
|
|
208
129
|
|---|---|---|
|
|
209
|
-
|
|
|
130
|
+
| ... | merge blocker / useful follow-up / discarded observation / nitpick / false positive / deferred | **Factual:** ... **Scope:** ... **Practical:** ... |
|
|
210
131
|
|
|
211
132
|
### Action Plan
|
|
212
|
-
|
|
213
|
-
<numbered list of genuine issues only, ordered by priority>
|
|
133
|
+
<merge blockers only, ordered by priority>
|
|
214
134
|
|
|
215
135
|
---
|
|
216
136
|
*Assessment by mach6*
|
|
217
|
-
MACH6_EOF
|
|
218
|
-
gh pr comment <pr-number> --body-file "$GH_BODY"
|
|
219
137
|
```
|
|
220
138
|
|
|
221
|
-
|
|
139
|
+
Classify every candidate. Useful follow-ups and deferred observations stay outside the action plan.
|
|
222
140
|
|
|
223
141
|
## Step 8: CLI summary
|
|
224
142
|
|
|
225
|
-
|
|
226
|
-
- Per-finding breakdown: summary, classification, reasoning
|
|
227
|
-
- Counts: genuine, nitpicks, false positives, deferred
|
|
228
|
-
- Action plan
|
|
229
|
-
|
|
230
|
-
If any findings were classified as **deferred**, ask the user if they want to create issues for them:
|
|
231
|
-
```bash
|
|
232
|
-
GH_BODY="$(mktemp /tmp/gh-body.$$.XXXXXXXX)"
|
|
233
|
-
cat > "$GH_BODY" << 'MACH6_EOF'
|
|
234
|
-
<body referencing PR and finding>
|
|
235
|
-
MACH6_EOF
|
|
236
|
-
gh issue create --title "<title>" --body-file "$GH_BODY"
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
Update task: summary → completed.
|
|
143
|
+
Report each classification, counts of merge blockers/nitpicks/false positives/deferred, and the merge-blocker-only action plan. Ask whether to create issues for deferred follow-ups, using unique temp body files.
|
|
240
144
|
|
|
241
|
-
Suggest next
|
|
242
|
-
-
|
|
243
|
-
-
|
|
145
|
+
Suggest exactly one next command:
|
|
146
|
+
- Merge blockers: `/skill:mach6-implement <pr-number> <finding-numbers>`
|
|
147
|
+
- No merge blockers: `/skill:mach6-publish <pr-number>`
|