diff --git a/.github/workflows/gh-aw-docs-review.lock.yml b/.github/workflows/gh-aw-docs-review.lock.yml index 7e5628ea..8498e506 100644 --- a/.github/workflows/gh-aw-docs-review.lock.yml +++ b/.github/workflows/gh-aw-docs-review.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"3624ad27f59a13e7b5519d0c33f6d7db801f62b30c179685dfd8a44571ccb271","compiler_version":"v0.71.1","agent_id":"copilot"} +# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"52634bcbcaedefa3556ddf376e873c0533a4237df6338890547f8e23311b3e6c","compiler_version":"v0.71.1","agent_id":"copilot"} # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GH_AW_PLUGINS_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/cache/save","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"373c709c69115d41ff229c7e5df9f8788daa9553","version":"v9"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"239aec45b78c8799417efdd5bc6d8cc036629ec1","version":"v0.71.1"},{"repo":"microsoft/apm-action","sha":"a190b0b1a91031057144dc136acf9757a59c9e4d","version":"v1.4.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.28","digest":"sha256:a8834e285807654bf680154faa710d43fe4365a0868142f5c20e48c85e137a7a","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.25.28@sha256:a8834e285807654bf680154faa710d43fe4365a0868142f5c20e48c85e137a7a"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.28","digest":"sha256:93290f2393752252911bd7c39a047f776c0b53063575e7bde4e304962a9a61cb","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.28@sha256:93290f2393752252911bd7c39a047f776c0b53063575e7bde4e304962a9a61cb"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.28","digest":"sha256:844c18280f82cd1b06345eb2f4e91966b34185bfc51c9f237c3e022e848fb474","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.25.28@sha256:844c18280f82cd1b06345eb2f4e91966b34185bfc51c9f237c3e022e848fb474"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.0"},{"image":"ghcr.io/github/github-mcp-server:v1.0.2"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]} # ___ _ _ # / _ \ | | (_) @@ -217,14 +217,14 @@ jobs: run: | bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh" { - cat << 'GH_AW_PROMPT_db015165fa495ee9_EOF' + cat << 'GH_AW_PROMPT_715d4cede5146f7e_EOF' - GH_AW_PROMPT_db015165fa495ee9_EOF + GH_AW_PROMPT_715d4cede5146f7e_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md" cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md" cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md" cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md" - cat << 'GH_AW_PROMPT_db015165fa495ee9_EOF' + cat << 'GH_AW_PROMPT_715d4cede5146f7e_EOF' Tools: create_pull_request_review_comment(max:20), submit_pull_request_review, missing_tool, missing_data, noop @@ -256,9 +256,9 @@ jobs: {{/if}} - GH_AW_PROMPT_db015165fa495ee9_EOF + GH_AW_PROMPT_715d4cede5146f7e_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md" - cat << 'GH_AW_PROMPT_db015165fa495ee9_EOF' + cat << 'GH_AW_PROMPT_715d4cede5146f7e_EOF' @@ -423,7 +423,7 @@ jobs: Use line-level review comments when you can point to an exact changed line or nearby changed hunk. Keep each inline comment narrowly scoped. - When helpful, include a concrete replacement sentence, frontmatter snippet, or markdown wording in the comment body. Prefer GitHub suggestion blocks whenever the proposed edit cleanly maps to the reviewed line or hunk and can be applied directly. Fall back to plain prose only when the change is too large, crosses multiple distant hunks, or the exact replacement range is ambiguous. + When helpful, include a concrete replacement sentence, frontmatter snippet, or markdown wording in the comment body. Prefer GitHub suggestion blocks only after passing the pre-output checklist below, and only when the proposed edit cleanly maps to the reviewed line or hunk and can be applied directly. Fall back to plain prose when the change is too large, crosses multiple distant hunks, includes protected substitution syntax, or the exact replacement range is ambiguous. The review comment safe output allows a maximum of 20 inline comments. Use that budget carefully: @@ -434,11 +434,25 @@ jobs: For inline comments with concrete replacements: - - prefer one apply-ready GitHub suggestion over a prose description, + - prefer one apply-ready GitHub suggestion over a prose description only after passing the pre-output checklist below, - keep the suggested replacement as small as possible while still fixing the issue, and - avoid suggestion blocks only when GitHub would not be able to apply them cleanly. - Do not use GitHub suggestion blocks when the proposed replacement contains Elastic substitution syntax such as `{{...}}`. Safe-output sanitization may escape the braces before GitHub applies the suggestion. In those cases, provide the exact replacement as prose, or suggest only the part of the line that does not include the substitution. + Before creating any inline review comment, inspect the exact comment body you are about to send. + + If the comment body would contain a GitHub suggestion block and either the original reviewed line or the proposed replacement contains Elastic substitution syntax such as `{{...}}`, do not create the suggestion block. This is a hard rule. Safe-output sanitization can escape curly braces and corrupt substitutions when GitHub applies the suggestion. + + For these cases, use one of these alternatives instead: + + - Leave a prose-only inline comment with the exact replacement text outside a suggestion block. + - If only part of the line needs changing, suggest only the substring that does not include `{{`, `}}`, or escaped variants such as `\{\{`. + - If every useful replacement would include substitution syntax, do not include an apply-ready suggestion. + + Pre-output checklist for every `create_pull_request_review_comment` call: + + 1. Does the comment body include a fenced `suggestion` block? + 2. Does the original reviewed line or suggested replacement include `{{`, `}}`, `\{\{`, or `\}\}`? + 3. If both are true, rewrite the comment before calling the tool so it has no `suggestion` block. Treat low-priority nits differently: @@ -500,7 +514,7 @@ jobs: __GH_AW_EXPR_49B959F1__ - GH_AW_PROMPT_db015165fa495ee9_EOF + GH_AW_PROMPT_715d4cede5146f7e_EOF } > "$GH_AW_PROMPT" - name: Interpolate variables and render templates uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 @@ -722,9 +736,9 @@ jobs: mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs" mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs - cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_fc67deba9358c368_EOF' + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_be93a1390416159f_EOF' {"create_pull_request_review_comment":{"max":20,"side":"RIGHT"},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{},"submit_pull_request_review":{"allowed_events":["COMMENT"],"max":1,"target":"triggering"}} - GH_AW_SAFE_OUTPUTS_CONFIG_fc67deba9358c368_EOF + GH_AW_SAFE_OUTPUTS_CONFIG_be93a1390416159f_EOF - name: Write Safe Outputs Tools env: GH_AW_TOOLS_META_JSON: | @@ -944,7 +958,7 @@ jobs: mkdir -p /home/runner/.copilot GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) - cat << GH_AW_MCP_CONFIG_82f96d9e922511b6_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" + cat << GH_AW_MCP_CONFIG_39a8bdce539a3111_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { "elastic-docs": { @@ -1002,7 +1016,7 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_82f96d9e922511b6_EOF + GH_AW_MCP_CONFIG_39a8bdce539a3111_EOF - name: Clean git credentials continue-on-error: true run: bash "${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh" diff --git a/.github/workflows/gh-aw-docs-review.md b/.github/workflows/gh-aw-docs-review.md index f3dfa2ce..2ba806b6 100644 --- a/.github/workflows/gh-aw-docs-review.md +++ b/.github/workflows/gh-aw-docs-review.md @@ -207,7 +207,7 @@ Report only findings that are: Use line-level review comments when you can point to an exact changed line or nearby changed hunk. Keep each inline comment narrowly scoped. -When helpful, include a concrete replacement sentence, frontmatter snippet, or markdown wording in the comment body. Prefer GitHub suggestion blocks whenever the proposed edit cleanly maps to the reviewed line or hunk and can be applied directly. Fall back to plain prose only when the change is too large, crosses multiple distant hunks, or the exact replacement range is ambiguous. +When helpful, include a concrete replacement sentence, frontmatter snippet, or markdown wording in the comment body. Prefer GitHub suggestion blocks only after passing the pre-output checklist below, and only when the proposed edit cleanly maps to the reviewed line or hunk and can be applied directly. Fall back to plain prose when the change is too large, crosses multiple distant hunks, includes protected substitution syntax, or the exact replacement range is ambiguous. The review comment safe output allows a maximum of 20 inline comments. Use that budget carefully: @@ -218,11 +218,25 @@ The review comment safe output allows a maximum of 20 inline comments. Use that For inline comments with concrete replacements: -- prefer one apply-ready GitHub suggestion over a prose description, +- prefer one apply-ready GitHub suggestion over a prose description only after passing the pre-output checklist below, - keep the suggested replacement as small as possible while still fixing the issue, and - avoid suggestion blocks only when GitHub would not be able to apply them cleanly. -Do not use GitHub suggestion blocks when the proposed replacement contains Elastic substitution syntax such as `{{...}}`. Safe-output sanitization may escape the braces before GitHub applies the suggestion. In those cases, provide the exact replacement as prose, or suggest only the part of the line that does not include the substitution. +Before creating any inline review comment, inspect the exact comment body you are about to send. + +If the comment body would contain a GitHub suggestion block and either the original reviewed line or the proposed replacement contains Elastic substitution syntax such as `{{...}}`, do not create the suggestion block. This is a hard rule. Safe-output sanitization can escape curly braces and corrupt substitutions when GitHub applies the suggestion. + +For these cases, use one of these alternatives instead: + +- Leave a prose-only inline comment with the exact replacement text outside a suggestion block. +- If only part of the line needs changing, suggest only the substring that does not include `{{`, `}}`, or escaped variants such as `\{\{`. +- If every useful replacement would include substitution syntax, do not include an apply-ready suggestion. + +Pre-output checklist for every `create_pull_request_review_comment` call: + +1. Does the comment body include a fenced `suggestion` block? +2. Does the original reviewed line or suggested replacement include `{{`, `}}`, `\{\{`, or `\}\}`? +3. If both are true, rewrite the comment before calling the tool so it has no `suggestion` block. Treat low-priority nits differently: