opencode-magi 0.0.0-dev-20260715023915 → 0.0.0-dev-20260717081152
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.
|
@@ -15,6 +15,7 @@ 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
|
+
- Each `"followUps"` item must use a `"commentId"` from `<unresolved_threads>`.
|
|
18
19
|
- Omit `"resolves"` when no thread should be resolved.
|
|
19
20
|
- `"APPROVED"` may omit `"followUps"` and `"newFindings"`. If present, they must be empty.
|
|
20
21
|
- `"APPROVED"` may omit `"comment"`. If present, it must be an empty string.
|
|
@@ -3,11 +3,12 @@ The PR worktree is {worktreePath}.
|
|
|
3
3
|
Validate whether your unresolved comments are fixed in the diff from {previousHeadSha} to {headSha} and in the review thread conversation.
|
|
4
4
|
Use: git -C "{worktreePath}" diff {previousHeadSha}...{headSha}
|
|
5
5
|
Your unresolved threads are provided in `<unresolved_threads>`.
|
|
6
|
+
All review threads are provided in `<review>` for context, but only your unresolved threads may be resolved or receive followUps.
|
|
6
7
|
|
|
7
8
|
If there is no new commit, still reconsider the thread when a user replied after your latest comment.
|
|
8
9
|
If you agree with the user's explanation or the code is fixed, add the thread to `resolves`.
|
|
9
10
|
If you do not agree, reply in the same thread with a followUp explaining why the issue still needs changes and keep `"CHANGES_REQUESTED"`.
|
|
10
|
-
Do not duplicate an
|
|
11
|
+
Do not duplicate an issue already raised in any review thread as a newFinding. Use newFindings only for separate new issues.
|
|
11
12
|
Every newFinding must target a valid right-side line in the PR diff.
|
|
12
13
|
If the problem itself does not have an exact changed line, choose the nearest changed line that represents the cause, responsibility, missing implementation, or affected behavior. This includes but is not limited to missing validation, missing wiring, missing requirements, missing tests, missing documentation, affected configuration, or relevant call sites.
|
|
13
14
|
Do not omit line. Do not create file-level or body-only newFindings.
|
|
@@ -101,6 +101,7 @@ export async function review() {
|
|
|
101
101
|
const parsed = prompt.parse(raw);
|
|
102
102
|
if (!prompt.validate(parsed))
|
|
103
103
|
throw new Error(`Invalid output for reviewer ${id}.`);
|
|
104
|
+
validateThreadTargets(parsed, unresolvedThreads);
|
|
104
105
|
validateInlineCommentTargets(status, parsed, inlineCommentTargets);
|
|
105
106
|
const findings = parsed.findings ?? parsed.newFindings ?? [];
|
|
106
107
|
await this.updateEvent(filterEmpty([
|
|
@@ -383,3 +384,14 @@ function validateInlineCommentTargets(status, output, inlineCommentTargets) {
|
|
|
383
384
|
}
|
|
384
385
|
}
|
|
385
386
|
}
|
|
387
|
+
function validateThreadTargets({ followUps, resolves }, threads) {
|
|
388
|
+
const targets = new Map(threads.flatMap(({ comments, id }) => comments.flatMap(({ databaseId }) => databaseId == null ? [] : [[databaseId, id]])));
|
|
389
|
+
if (followUps)
|
|
390
|
+
for (const [index, { commentId }] of followUps.entries())
|
|
391
|
+
if (!targets.has(commentId))
|
|
392
|
+
throw new Error(`followUps[${index}].commentId must target an unresolved thread owned by the reviewer.`);
|
|
393
|
+
if (resolves)
|
|
394
|
+
for (const [index, { commentId, threadId }] of resolves.entries())
|
|
395
|
+
if (targets.get(commentId) !== threadId)
|
|
396
|
+
throw new Error(`resolves[${index}] must target an unresolved thread owned by the reviewer.`);
|
|
397
|
+
}
|
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-20260717081152",
|
|
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>",
|