From af719e387dd8528f6c0aca9e04bcfd75ad6d6a2c Mon Sep 17 00:00:00 2001 From: Hare Date: Tue, 27 Oct 2026 06:15:48 +0900 Subject: [PATCH] fix: align reviewer guidance with Bash-enabled scope --- crates/worker/src/prompt/catalog.rs | 5 ++++- crates/worker/src/spawn/tool.rs | 14 +++++++++++++- resources/prompts/role/reviewer.md | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/crates/worker/src/prompt/catalog.rs b/crates/worker/src/prompt/catalog.rs index d7bd636ac..fda6a2901 100644 --- a/crates/worker/src/prompt/catalog.rs +++ b/crates/worker/src/prompt/catalog.rs @@ -834,7 +834,10 @@ mod tests { assert!(common.contains("target-only movement preserves approval")); assert!(reviewer.contains("complete linked MR/result snapshot")); assert!(reviewer.contains("Submit `ReviewMergeRequest` once")); - assert!(reviewer.contains("without modifying implementation files")); + assert!(reviewer.contains("Bash")); + assert!(reviewer.contains("Git")); + assert!(!reviewer.contains("without modifying")); + assert!(!reviewer.contains("read-only")); } #[test] diff --git a/crates/worker/src/spawn/tool.rs b/crates/worker/src/spawn/tool.rs index b88952ea1..f47f5610e 100644 --- a/crates/worker/src/spawn/tool.rs +++ b/crates/worker/src/spawn/tool.rs @@ -70,7 +70,8 @@ struct SubWorkerSpawnInput { /// Explicitly grant command execution through the parent-owned Workdir tool broker. #[serde(default)] command: bool, - /// Binds an actual read-only builtin Reviewer child to the current Merge Request candidate. + /// Binds an actual builtin Reviewer child to the current Merge Request candidate. + /// Bash may be enabled for Git and other commands. /// Review capability material is generated by the trusted spawn layer. #[serde(default)] review: Option, @@ -1174,6 +1175,17 @@ mod tests { } } + #[test] + fn reviewer_handoff_schema_allows_bash_for_git_commands() { + let schema = serde_json::to_value(schemars::schema_for!(SubWorkerSpawnInput)).unwrap(); + let description = schema["properties"]["review"]["description"] + .as_str() + .expect("review handoff description"); + assert!(description.contains("Bash")); + assert!(description.contains("Git")); + assert!(!description.contains("read-only")); + } + #[test] fn reviewer_handoff_requires_explicit_builtin_profile_and_writable_scope() { let valid: SubWorkerSpawnInput = serde_json::from_value(serde_json::json!({ diff --git a/resources/prompts/role/reviewer.md b/resources/prompts/role/reviewer.md index 9b32cb1a1..a293142a0 100644 --- a/resources/prompts/role/reviewer.md +++ b/resources/prompts/role/reviewer.md @@ -1,5 +1,5 @@ You are the independent MR Reviewer, a direct SubWorker of the review requester. -Evaluate the captured MR subject, Ticket `content_digest`, and complete linked MR/result snapshot against the Ticket requirements. Approval attests that snapshot, not just the selected diff. Inspect and test without modifying implementation files, repository refs, or Ticket state. +Evaluate the captured MR subject, Ticket `content_digest`, and complete linked MR/result snapshot against the Ticket requirements. Approval attests that snapshot, not just the selected diff. You may use Bash for Git and other commands. Submit `ReviewMergeRequest` once with `approve` or `request_changes`, evidence, and findings. The child client injects capability and subject identity; prose is not a verdict. Source movement cancels submission; target-only movement preserves unchanged-source approval. For a merged MR, review the immutable result against the current requirements.