Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
__pycache__/

.ralph
.serena
Expand Down
2 changes: 2 additions & 0 deletions architect-review/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ runs:
- Then a short summary of the architectural analysis
- Then "阻塞项" / "Blocking Issues" listing architecture issues that should block merge; if none, write "阻塞项:无" / "Blocking Issues: None"
- Then "建议项" / "Suggestions" listing non-blocking architecture improvements; if none, write "建议项:无" / "Suggestions: None"

IMPORTANT: Never use #N format (e.g. #1, #2) to number items. GitHub auto-converts #N to issue/PR references. Use 1. 2. 3. or - list format instead. 请勿使用 #N 格式编号,GitHub 会将其转为 issue/PR 引用。
PROMPT_EOF
)
fi
Expand Down
2 changes: 2 additions & 0 deletions feature-missing/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ inputs:
Minor gaps, nice-to-have features, or documentation discrepancies.
For each gap: describe what's missing, reference the relevant spec section, and suggest where the implementation should be added.
- If verdict is "无遗漏" / "NO GAPS", briefly confirm all spec items are covered — do NOT include any severity sections.

IMPORTANT: Never use #N format (e.g. #1, #2) to number items. GitHub auto-converts #N to issue/PR references. Use 1. 2. 3. or - list format instead. 请勿使用 #N 格式编号,GitHub 会将其转为 issue/PR 引用。
use-github-token:
description: Value exported as USE_GITHUB_TOKEN before running `opencode github run`.
required: false
Expand Down
7 changes: 7 additions & 0 deletions github-run-opencode/run-github-opencode.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,12 @@ def _main() -> int:
zh_instruction = (
"\n\n请使用中文回复。所有分析和说明均使用中文。"
"对于 prompt 中列出的判定关键词,使用其中文版本。"
"\n请勿使用 #N 格式(如 #1、#2)编号,GitHub 会自动将其转换为 issue/PR 引用。请使用 1. 2. 3. 或 - 的列表格式。"
)
en_hash_instruction = (
" Never use #N format (e.g. #1, #2) to number items — "
"GitHub auto-converts #N to issue/PR references. "
"Use 1. 2. 3. or - list format instead."
)
if existing_prompt:
if language == "en":
Expand All @@ -466,6 +472,7 @@ def _main() -> int:
+ "\n\nIMPORTANT: Respond entirely in English. "
"Use English for all analysis, explanations, and output. "
"For any verdict keywords listed in the prompt, use their English equivalents."
+ en_hash_instruction
))
elif language == "zh":
set_env("PROMPT", existing_prompt + zh_instruction)
Expand Down
2 changes: 2 additions & 0 deletions multi-review/reviewers/architecture.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ prompt: |
- Then a short summary of architecture analysis
- Then "阻塞项" / "Blocking Issues" listing architecture issues that must block merge; if none, write "阻塞项:无" / "Blocking Issues: None"
- Then "建议项" / "Suggestions" listing non-blocking architecture improvements; if none, write "建议项:无" / "Suggestions: None"

IMPORTANT: Never use #N format (e.g. #1, #2) to number items. GitHub auto-converts #N to issue/PR references. Use 1. 2. 3. or - list format instead. 请勿使用 #N 格式编号,GitHub 会将其转为 issue/PR 引用。
2 changes: 2 additions & 0 deletions multi-review/reviewers/performance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ prompt: |
- Then a short summary of performance analysis
- Then "阻塞项" / "Blocking Issues" listing performance issues that must block merge; if none, write "阻塞项:无" / "Blocking Issues: None"
- Then "建议项" / "Suggestions" listing non-blocking performance improvements; if none, write "建议项:无" / "Suggestions: None"

IMPORTANT: Never use #N format (e.g. #1, #2) to number items. GitHub auto-converts #N to issue/PR references. Use 1. 2. 3. or - list format instead. 请勿使用 #N 格式编号,GitHub 会将其转为 issue/PR 引用。
2 changes: 2 additions & 0 deletions multi-review/reviewers/quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ prompt: |
- Then a short summary
- Then "阻塞项" / "Blocking Issues" listing required fixes for merge; if none, write "阻塞项:无" / "Blocking Issues: None"
- Then "建议项" / "Suggestions" listing non-blocking improvements; if none, write "建议项:无" / "Suggestions: None"

IMPORTANT: Never use #N format (e.g. #1, #2) to number items. GitHub auto-converts #N to issue/PR references. Use 1. 2. 3. or - list format instead. 请勿使用 #N 格式编号,GitHub 会将其转为 issue/PR 引用。
2 changes: 2 additions & 0 deletions multi-review/reviewers/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ prompt: |
- Then a short summary of security analysis
- Then "阻塞项" / "Blocking Issues" listing security issues that must block merge; if none, write "阻塞项:无" / "Blocking Issues: None"
- Then "建议项" / "Suggestions" listing non-blocking security improvements; if none, write "建议项:无" / "Suggestions: None"

IMPORTANT: Never use #N format (e.g. #1, #2) to number items. GitHub auto-converts #N to issue/PR references. Use 1. 2. 3. or - list format instead. 请勿使用 #N 格式编号,GitHub 会将其转为 issue/PR 引用。
4 changes: 3 additions & 1 deletion multi-review/src/orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Your task is to synthesize them into a single deduplicated report.
- 第一行:最终决策(可合并 / CAN MERGE、有条件合并 / CONDITIONAL MERGE、不可合并 / CANNOT MERGE)
- 然后简要总结
- "阻塞项" / "Blocking Issues"列出合并前必须修复的问题;如无,写"阻塞项:无" / "Blocking Issues: None"
- "建议项" / "Suggestions"列出非阻塞改进建议;如无,写"建议项:无" / "Suggestions: None"`;
- "建议项" / "Suggestions"列出非阻塞改进建议;如无,写"建议项:无" / "Suggestions: None"

IMPORTANT: Never use #N format (e.g. #1, #2) to number items in your output. GitHub auto-converts #N to issue/PR references. Use 1. 2. 3. or - list format instead. 请勿使用 #N 格式编号,GitHub 会将其转为 issue/PR 引用。`;

function extractText(messages: Array<{ info: { role: string }; parts: Array<{ type: string; text?: string }> }>): string {
return messages
Expand Down
15 changes: 12 additions & 3 deletions multi-review/src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,31 @@ function fetchAllGiteaComments(baseUrl: string, token: string): Array<{ id: numb
return allComments;
}

// ── Escape #N references ─────────────────────────────────────────────

const HASH_NUM_RE = /(^|\s)#(\d{1,6})(?=[\s:.]|$)/gm;

function escapeHashReferences(text: string): string {
return text.replace(HASH_NUM_RE, "$1#&#8203;$2");
}

// ── Post PR comment (with PR-context guard) ───────────────────────────

export function postPRComment(body: string): void {
const escaped = escapeHashReferences(body);
const prNumber = resolvePRNumber();
if (!prNumber) {
console.log("Not in PR context, printing review to stdout:");
console.log("---");
console.log(body);
console.log(escaped);
return;
}

const platform = detectPlatform();
if (platform === "github") {
postCommentGithub(prNumber, body);
postCommentGithub(prNumber, escaped);
} else {
postCommentGitea(prNumber, body);
postCommentGitea(prNumber, escaped);
}
}

Expand Down
6 changes: 4 additions & 2 deletions multi-review/src/reviewers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ export function loadReviewers(opts: {
const team = parseTeam(teamStr);

const language = (env("MULTI_REVIEW_LANGUAGE") || "zh").trim().toLowerCase();
const hashAvoidZh = "\n请勿使用 #N 格式(如 #1、#2)编号,GitHub 会自动将其转换为 issue/PR 引用。请使用 1. 2. 3. 或 - 的列表格式。";
const hashAvoidEn = "\nNever use #N format (e.g. #1, #2) to number items — GitHub auto-converts #N to issue/PR references. Use 1. 2. 3. or - list format instead.";
const langInstruction = language === "en"
? "\n\nIMPORTANT: Respond entirely in English. Use English for all analysis, explanations, and output. For any verdict keywords listed in the prompt, use their English equivalents."
: "\n\n请使用中文回复。所有分析和说明均使用中文。对于 prompt 中列出的判定关键词,使用其中文版本。";
? "\n\nIMPORTANT: Respond entirely in English. Use English for all analysis, explanations, and output. For any verdict keywords listed in the prompt, use their English equivalents." + hashAvoidEn
: "\n\n请使用中文回复。所有分析和说明均使用中文。对于 prompt 中列出的判定关键词,使用其中文版本。" + hashAvoidZh;

const reviewers: Reviewer[] = [];
for (const [name, count] of team) {
Expand Down
2 changes: 2 additions & 0 deletions review/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ inputs:
- Then a short summary
- Then "阻塞项" / "Blocking Issues" listing required fixes for merge; if none, write "阻塞项:无" / "Blocking Issues: None"
- Then "建议项" / "Suggestions" listing non-blocking improvements; if none, write "建议项:无" / "Suggestions: None"

IMPORTANT: Never use #N format (e.g. #1, #2) to number items. GitHub auto-converts #N to issue/PR references. Use 1. 2. 3. or - list format instead. 请勿使用 #N 格式编号,GitHub 会将其转为 issue/PR 引用。
use-github-token:
description: Value exported as USE_GITHUB_TOKEN before running `opencode github run`.
required: false
Expand Down
2 changes: 2 additions & 0 deletions spec-coverage/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ inputs:
Minor gaps — documentation, non-essential features, or nice-to-haves.
For each gap: quote the spec task verbatim, describe what's missing in the implementation, and suggest which file(s) should be modified.
- If verdict is "全覆盖" / "FULL COVERAGE", briefly confirm all spec tasks are covered — do NOT include any severity sections.

IMPORTANT: Never use #N format (e.g. #1, #2) to number items. GitHub auto-converts #N to issue/PR references. Use 1. 2. 3. or - list format instead. 请勿使用 #N 格式编号,GitHub 会将其转为 issue/PR 引用。
use-github-token:
description: Value exported as USE_GITHUB_TOKEN before running `opencode github run`.
required: false
Expand Down