diff --git a/internal/scaffold/fullsend-repo/agents/fix.md b/internal/scaffold/fullsend-repo/agents/fix.md index d82e6c72d..dacc5775e 100644 --- a/internal/scaffold/fullsend-repo/agents/fix.md +++ b/internal/scaffold/fullsend-repo/agents/fix.md @@ -72,6 +72,11 @@ triggered this fix run (e.g., `"orgname-review[bot]"` for bot-triggered, triggers. When triggered by a human (username doesn't end in `[bot]`), the `HUMAN_INSTRUCTION` environment variable contains the instruction text. +**Important:** `TRIGGER_SOURCE` is a GitHub username — not the value you +write to `fix-result.json`. The `trigger_source` field in structured output +must be normalized to `"bot"` or `"human"` (the schema enum). Map it: +if the username ends in `[bot]`, use `"bot"`; otherwise use `"human"`. + ## Zero-trust principle You do not trust the review agent's analysis unconditionally. The review diff --git a/internal/scaffold/fullsend-repo/skills/fix-review/SKILL.md b/internal/scaffold/fullsend-repo/skills/fix-review/SKILL.md index cee7b42d4..7183c6700 100644 --- a/internal/scaffold/fullsend-repo/skills/fix-review/SKILL.md +++ b/internal/scaffold/fullsend-repo/skills/fix-review/SKILL.md @@ -95,8 +95,14 @@ echo "FIX_ITERATION=${FIX_ITERATION:-1}" ``` - `PR_NUMBER` — which PR to fix (required) -- `TRIGGER_SOURCE` — GitHub username that triggered the fix (e.g., `"orgname-review[bot]"` or `"alice"`) -- `HUMAN_INSTRUCTION` — the human's instruction text (only when `TRIGGER_SOURCE` doesn't end in `[bot]`) +- `TRIGGER_SOURCE` — GitHub username that triggered the fix (e.g., + `"orgname-review[bot]"` or `"alice"`). **This is a username, not the + value you write to `fix-result.json`.** Derive the normalized trigger + type now — you will need it in step 9: + - If `TRIGGER_SOURCE` ends in `[bot]` → trigger type is `"bot"` + - Otherwise → trigger type is `"human"` +- `HUMAN_INSTRUCTION` — the human's instruction text (only when + `TRIGGER_SOURCE` doesn't end in `[bot]`) - `FIX_ITERATION` — which iteration of the review→fix loop this is If `PR_NUMBER` is not set, stop. @@ -401,16 +407,29 @@ Write a JSON file to `$FULLSEND_OUTPUT_DIR/fix-result.json`: } ``` +**Schema compliance — read carefully.** The schema uses +`additionalProperties: false` at both the top level and inside each action +object. Any extra fields you invent will cause validation to fail. Only use +the fields shown in this section. + +**`trigger_source` field:** This must be the **normalized trigger type** you +derived in step 1 — either `"bot"` or `"human"`. Do NOT use the raw +`TRIGGER_SOURCE` environment variable value (the GitHub username). The schema +enforces an enum of `["bot", "human"]`; any other value fails validation. + **Action types:** -- `fix` — You fixed the code per the reviewer's feedback. The post-script +- `fix` — You fixed the code per the reviewer's feedback. **Required fields + for fix actions:** `type`, `finding`, `description`. The post-script includes this in the summary comment. -- `disagree` — You determined the feedback is incorrect or out of scope. The - post-script includes your reason in the summary. The reviewer can insist - in the next review cycle. - -**Required fields:** `pr_number`, `trigger_source`, `actions`, `summary`, -`tests_passed`, `files_changed`. +- `disagree` — You determined the feedback is incorrect or out of scope. + **Required fields for disagree actions:** `type`, `finding`, `reason`. + The post-script includes your reason in the summary. The reviewer can + insist in the next review cycle. + +**Required top-level fields:** `pr_number`, `trigger_source`, `actions`, +`summary`, `tests_passed`, `files_changed`. The `actions` array must +contain at least one item. Write the file using `Bash`: