opencode-magi 0.0.0-dev-20260630052239 → 0.0.0-dev-20260630072109
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/dist/prompts/merge/edit/output-contract.md +5 -3
- package/dist/prompts/merge/edit/validate.json +6 -3
- package/dist/prompts/review/close-reconsideration/output-contract.md +2 -1
- package/dist/prompts/review/close-reconsideration/validate.json +11 -5
- package/dist/prompts/review/rereview/output-contract.md +4 -3
- package/dist/prompts/review/rereview/validate.json +13 -6
- package/dist/prompts/review/review/output-contract.md +3 -2
- package/dist/prompts/review/review/validate.json +15 -6
- package/dist/prompts/triage/create/output-contract.md +4 -3
- package/dist/prompts/triage/create/validate.json +8 -2
- package/dist/prompts/triage/signal/output-contract.md +1 -1
- package/dist/prompts/triage/signal/validate.json +0 -1
- package/dist/tools/merge/editor.js +8 -4
- package/dist/tools/review/report.js +1 -1
- package/package.json +1 -1
|
@@ -19,6 +19,8 @@ Rules:
|
|
|
19
19
|
- `"ASK"` means you need clarification and did not edit.
|
|
20
20
|
- Do not make changes just because a reviewer requested them; edit only when you understand and agree.
|
|
21
21
|
- Do not push. The orchestrator pushes after validating this envelope.
|
|
22
|
-
- `filesTouched` must include every final changed file.
|
|
23
|
-
- `responses` must include a reply for each thread you addressed.
|
|
24
|
-
- `"
|
|
22
|
+
- `filesTouched` is required for `"EDITED"` and must include every final changed file.
|
|
23
|
+
- `responses` is required and must include a reply for each thread you addressed.
|
|
24
|
+
- `"EDITED"` requires at least one response.
|
|
25
|
+
- `"REPLIED"` may omit `filesTouched`. If present, it must be empty.
|
|
26
|
+
- `"REPLIED"` requires at least one `"DISAGREE"` or `"ASK"` response.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "object",
|
|
3
|
-
"required": ["mode", "
|
|
3
|
+
"required": ["mode", "responses"],
|
|
4
4
|
"additionalProperties": false,
|
|
5
5
|
"properties": {
|
|
6
6
|
"mode": { "enum": ["EDITED", "REPLIED"] },
|
|
@@ -28,8 +28,11 @@
|
|
|
28
28
|
{
|
|
29
29
|
"if": { "properties": { "mode": { "const": "EDITED" } } },
|
|
30
30
|
"then": {
|
|
31
|
-
"required": ["commitSha", "commitMessage"],
|
|
32
|
-
"properties": {
|
|
31
|
+
"required": ["commitSha", "commitMessage", "filesTouched"],
|
|
32
|
+
"properties": {
|
|
33
|
+
"filesTouched": { "type": "array", "minItems": 1 },
|
|
34
|
+
"responses": { "type": "array", "minItems": 1 }
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
},
|
|
35
38
|
{
|
|
@@ -11,7 +11,8 @@ Return exactly one JSON object and nothing else. Do not wrap it in markdown.
|
|
|
11
11
|
Rules:
|
|
12
12
|
|
|
13
13
|
- `"verdict"` must be `"APPROVED"` or `"CHANGES_REQUESTED"`.
|
|
14
|
-
- `"APPROVED"`
|
|
14
|
+
- `"APPROVED"` may omit `"findings"`. If present, it must be empty.
|
|
15
|
+
- `"APPROVED"` may omit `"comment"`. If present, it must be an empty string.
|
|
15
16
|
- `"CHANGES_REQUESTED"` requires `"comment"` and at least one `"finding"`.
|
|
16
17
|
- `"comment"` for `"CHANGES_REQUESTED"` must be a concise prose review summary, not a bullet list of findings.
|
|
17
18
|
- `"CLOSED"` is not allowed in this reconsideration step.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "object",
|
|
3
|
-
"required": ["verdict"
|
|
3
|
+
"required": ["verdict"],
|
|
4
4
|
"additionalProperties": false,
|
|
5
5
|
"properties": {
|
|
6
6
|
"verdict": { "enum": ["APPROVED", "CHANGES_REQUESTED"] },
|
|
@@ -18,20 +18,26 @@
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
"comment": { "type": "string"
|
|
21
|
+
"comment": { "type": "string" }
|
|
22
22
|
},
|
|
23
23
|
"allOf": [
|
|
24
24
|
{
|
|
25
25
|
"if": { "properties": { "verdict": { "const": "APPROVED" } } },
|
|
26
26
|
"then": {
|
|
27
|
-
"properties": {
|
|
27
|
+
"properties": {
|
|
28
|
+
"findings": { "type": "array", "maxItems": 0 },
|
|
29
|
+
"comment": { "const": "" }
|
|
30
|
+
}
|
|
28
31
|
}
|
|
29
32
|
},
|
|
30
33
|
{
|
|
31
34
|
"if": { "properties": { "verdict": { "const": "CHANGES_REQUESTED" } } },
|
|
32
35
|
"then": {
|
|
33
|
-
"required": ["comment"],
|
|
34
|
-
"properties": {
|
|
36
|
+
"required": ["comment", "findings"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"findings": { "type": "array", "minItems": 1 },
|
|
39
|
+
"comment": { "type": "string", "minLength": 1 }
|
|
40
|
+
}
|
|
35
41
|
}
|
|
36
42
|
}
|
|
37
43
|
]
|
|
@@ -15,11 +15,12 @@ Rules:
|
|
|
15
15
|
- `"verdict"` must be `"APPROVED"`, `"CHANGES_REQUESTED"`, or `"CLOSED"`.
|
|
16
16
|
- `"resolves"` contains threads that should be resolved because the issue is fixed or the user's explanation is acceptable.
|
|
17
17
|
- Each `"resolves"` item must use the exact `"commentId"` and `"threadId"` from `<unresolved_threads>`.
|
|
18
|
-
-
|
|
19
|
-
- `"APPROVED"`
|
|
18
|
+
- Omit `"resolves"` when no thread should be resolved.
|
|
19
|
+
- `"APPROVED"` may omit `"followUps"` and `"newFindings"`. If present, they must be empty.
|
|
20
|
+
- `"APPROVED"` may omit `"comment"`. If present, it must be an empty string.
|
|
20
21
|
- `"CHANGES_REQUESTED"` requires `"comment"` and at least one `"followUp"` or `"newFinding"`.
|
|
21
22
|
- `"comment"` for `"CHANGES_REQUESTED"` must be a concise prose review summary, not a bullet list of findings.
|
|
22
|
-
- `"CLOSED"` requires `"comment"` and
|
|
23
|
+
- `"CLOSED"` requires `"comment"` and may omit `"followUps"` and `"newFindings"`. If present, they must be empty.
|
|
23
24
|
- `"line"` is required and must target a valid right-side line inside the latest PR diff hunk.
|
|
24
25
|
- `"startLine"` is optional and must also target a valid right-side line inside the same latest PR diff hunk range.
|
|
25
26
|
- Omit `"startLine"` for single-line findings.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "object",
|
|
3
|
-
"required": ["verdict"
|
|
3
|
+
"required": ["verdict"],
|
|
4
4
|
"additionalProperties": false,
|
|
5
5
|
"properties": {
|
|
6
6
|
"verdict": { "enum": ["APPROVED", "CHANGES_REQUESTED", "CLOSED"] },
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
"comment": { "type": "string"
|
|
45
|
+
"comment": { "type": "string" }
|
|
46
46
|
},
|
|
47
47
|
"allOf": [
|
|
48
48
|
{
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
"then": {
|
|
51
51
|
"properties": {
|
|
52
52
|
"followUps": { "type": "array", "maxItems": 0 },
|
|
53
|
-
"newFindings": { "type": "array", "maxItems": 0 }
|
|
53
|
+
"newFindings": { "type": "array", "maxItems": 0 },
|
|
54
|
+
"comment": { "const": "" }
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
},
|
|
@@ -59,11 +60,16 @@
|
|
|
59
60
|
"then": {
|
|
60
61
|
"required": ["comment"],
|
|
61
62
|
"anyOf": [
|
|
62
|
-
{ "properties": { "followUps": { "type": "array", "minItems": 1 } } },
|
|
63
63
|
{
|
|
64
|
+
"required": ["followUps"],
|
|
65
|
+
"properties": { "followUps": { "type": "array", "minItems": 1 } }
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"required": ["newFindings"],
|
|
64
69
|
"properties": { "newFindings": { "type": "array", "minItems": 1 } }
|
|
65
70
|
}
|
|
66
|
-
]
|
|
71
|
+
],
|
|
72
|
+
"properties": { "comment": { "type": "string", "minLength": 1 } }
|
|
67
73
|
}
|
|
68
74
|
},
|
|
69
75
|
{
|
|
@@ -72,7 +78,8 @@
|
|
|
72
78
|
"required": ["comment"],
|
|
73
79
|
"properties": {
|
|
74
80
|
"followUps": { "type": "array", "maxItems": 0 },
|
|
75
|
-
"newFindings": { "type": "array", "maxItems": 0 }
|
|
81
|
+
"newFindings": { "type": "array", "maxItems": 0 },
|
|
82
|
+
"comment": { "type": "string", "minLength": 1 }
|
|
76
83
|
}
|
|
77
84
|
}
|
|
78
85
|
}
|
|
@@ -11,10 +11,11 @@ Return exactly one JSON object and nothing else. Do not wrap it in markdown.
|
|
|
11
11
|
Rules:
|
|
12
12
|
|
|
13
13
|
- `"verdict"` must be `"APPROVED"`, `"CHANGES_REQUESTED"`, or `"CLOSED"`.
|
|
14
|
-
- `"APPROVED"`
|
|
14
|
+
- `"APPROVED"` may omit `"findings"`. If present, it must be empty.
|
|
15
|
+
- `"APPROVED"` may omit `"comment"`. If present, it must be an empty string.
|
|
15
16
|
- `"CHANGES_REQUESTED"` requires `"comment"` and at least one `"finding"`.
|
|
16
17
|
- `"comment"` for `"CHANGES_REQUESTED"` must be a concise prose review summary, not a bullet list of findings.
|
|
17
|
-
- `"CLOSED"` requires `"comment"` and
|
|
18
|
+
- `"CLOSED"` requires `"comment"` and may omit `"findings"`. If present, `"findings"` must be empty.
|
|
18
19
|
- `"path"` must be repository-relative.
|
|
19
20
|
- `"line"` is required and must target a valid right-side line inside the PR diff hunk.
|
|
20
21
|
- `"startLine"` is optional and must also target a valid right-side line inside the same PR diff hunk range.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "object",
|
|
3
|
-
"required": ["verdict"
|
|
3
|
+
"required": ["verdict"],
|
|
4
4
|
"additionalProperties": false,
|
|
5
5
|
"properties": {
|
|
6
6
|
"verdict": { "enum": ["APPROVED", "CHANGES_REQUESTED", "CLOSED"] },
|
|
@@ -18,27 +18,36 @@
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
"comment": { "type": "string"
|
|
21
|
+
"comment": { "type": "string" }
|
|
22
22
|
},
|
|
23
23
|
"allOf": [
|
|
24
24
|
{
|
|
25
25
|
"if": { "properties": { "verdict": { "const": "APPROVED" } } },
|
|
26
26
|
"then": {
|
|
27
|
-
"properties": {
|
|
27
|
+
"properties": {
|
|
28
|
+
"findings": { "type": "array", "maxItems": 0 },
|
|
29
|
+
"comment": { "const": "" }
|
|
30
|
+
}
|
|
28
31
|
}
|
|
29
32
|
},
|
|
30
33
|
{
|
|
31
34
|
"if": { "properties": { "verdict": { "const": "CHANGES_REQUESTED" } } },
|
|
32
35
|
"then": {
|
|
33
|
-
"required": ["comment"],
|
|
34
|
-
"properties": {
|
|
36
|
+
"required": ["comment", "findings"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"findings": { "type": "array", "minItems": 1 },
|
|
39
|
+
"comment": { "type": "string", "minLength": 1 }
|
|
40
|
+
}
|
|
35
41
|
}
|
|
36
42
|
},
|
|
37
43
|
{
|
|
38
44
|
"if": { "properties": { "verdict": { "const": "CLOSED" } } },
|
|
39
45
|
"then": {
|
|
40
46
|
"required": ["comment"],
|
|
41
|
-
"properties": {
|
|
47
|
+
"properties": {
|
|
48
|
+
"findings": { "type": "array", "maxItems": 0 },
|
|
49
|
+
"comment": { "type": "string", "minLength": 1 }
|
|
50
|
+
}
|
|
42
51
|
}
|
|
43
52
|
}
|
|
44
53
|
]
|
|
@@ -22,6 +22,7 @@ Rules:
|
|
|
22
22
|
- Use REPLIED when you only replied without code changes.
|
|
23
23
|
- For EDITED, pullRequest.title and pullRequest.body must be non-empty and follow the repository's PR conventions.
|
|
24
24
|
- Do not push or create the PR. The orchestrator pushes and creates the PR using pullRequest exactly as provided.
|
|
25
|
-
- filesTouched must include every final changed file.
|
|
26
|
-
- responses may be
|
|
27
|
-
- REPLIED
|
|
25
|
+
- filesTouched is required for EDITED and must include every final changed file.
|
|
26
|
+
- responses may be omitted when no review threads were addressed.
|
|
27
|
+
- REPLIED may omit filesTouched. If present, it must be empty.
|
|
28
|
+
- REPLIED requires at least one DISAGREE or ASK response.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "object",
|
|
3
|
-
"required": ["mode"
|
|
3
|
+
"required": ["mode"],
|
|
4
4
|
"additionalProperties": false,
|
|
5
5
|
"properties": {
|
|
6
6
|
"mode": { "enum": ["EDITED", "REPLIED"] },
|
|
@@ -37,13 +37,19 @@
|
|
|
37
37
|
{
|
|
38
38
|
"if": { "properties": { "mode": { "const": "EDITED" } } },
|
|
39
39
|
"then": {
|
|
40
|
-
"required": [
|
|
40
|
+
"required": [
|
|
41
|
+
"commitSha",
|
|
42
|
+
"commitMessage",
|
|
43
|
+
"filesTouched",
|
|
44
|
+
"pullRequest"
|
|
45
|
+
],
|
|
41
46
|
"properties": { "filesTouched": { "type": "array", "minItems": 1 } }
|
|
42
47
|
}
|
|
43
48
|
},
|
|
44
49
|
{
|
|
45
50
|
"if": { "properties": { "mode": { "const": "REPLIED" } } },
|
|
46
51
|
"then": {
|
|
52
|
+
"required": ["responses"],
|
|
47
53
|
"not": {
|
|
48
54
|
"anyOf": [
|
|
49
55
|
{ "required": ["commitSha"] },
|
|
@@ -30,15 +30,19 @@ export async function edit() {
|
|
|
30
30
|
const parsed = prompt.parse(raw);
|
|
31
31
|
if (!prompt.validate(parsed))
|
|
32
32
|
throw new Error("Invalid output for editor.");
|
|
33
|
-
|
|
33
|
+
const output = {
|
|
34
|
+
...parsed,
|
|
35
|
+
filesTouched: parsed.filesTouched ?? [],
|
|
36
|
+
};
|
|
37
|
+
if (output.mode === "EDITED") {
|
|
34
38
|
const head = await this.exec(command("git", "rev-parse", "HEAD"), {
|
|
35
39
|
cwd: this.state.worktree.path,
|
|
36
40
|
signal: this.context.abort,
|
|
37
41
|
});
|
|
38
|
-
if (head !==
|
|
39
|
-
throw new Error(`Editor reported commit ${
|
|
42
|
+
if (head !== output.commitSha)
|
|
43
|
+
throw new Error(`Editor reported commit ${output.commitSha}, but worktree HEAD is ${head}.`);
|
|
40
44
|
}
|
|
41
|
-
return
|
|
45
|
+
return output;
|
|
42
46
|
}, {
|
|
43
47
|
error: (_, count) => this.notify(`Attempt ${count} failed to edit ${this.getLink()}. Retrying...`),
|
|
44
48
|
retries: this.config.output.repairAttempts,
|
|
@@ -43,7 +43,7 @@ export function createMetaContent(input) {
|
|
|
43
43
|
`- **Mode**: ${toTitleCase(this.config.mode)}`,
|
|
44
44
|
`- **Dry run**: ${this.state.dryRun ? "Yes" : "No"}`,
|
|
45
45
|
`- **Status**: ${toTitleCase(input.status)}`,
|
|
46
|
-
`- **Automation**: ${toTitleCase(this.state.pr
|
|
46
|
+
`- **Automation**: ${this.state.pr?.automation ? toTitleCase(this.state.pr.automation.toLocaleLowerCase()) : "none"}`,
|
|
47
47
|
];
|
|
48
48
|
if (this.state.pr?.verdict)
|
|
49
49
|
rows.push(`- **Verdict**: ${toTitleCase(this.state.pr.verdict.toLocaleLowerCase())}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-magi",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20260630072109",
|
|
4
4
|
"description": "Multi-agent PR review and merge orchestration plugin for OpenCode.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Hirotomo Yamada <hirotomo.yamada@avap.co.jp>",
|