fix(bot): ensure management files are written to and read from workspace root

This commit is contained in:
Christian Gunderman
2026-05-14 11:50:19 -07:00
parent 48e6cc179e
commit 00aaba6759
3 changed files with 14 additions and 9 deletions
@@ -242,6 +242,10 @@ jobs:
run: | run: |
touch bot-changes.patch touch bot-changes.patch
touch pr-description.md touch pr-description.md
touch pr-labels.txt
touch branch-name.txt
touch issue-comment.md
touch pr-comment.md
if [ -f critique_result.txt ] && grep -q "\[APPROVED\]" critique_result.txt && ! grep -q "\[REJECTED\]" critique_result.txt; then if [ -f critique_result.txt ] && grep -q "\[APPROVED\]" critique_result.txt && ! grep -q "\[REJECTED\]" critique_result.txt; then
git diff --staged > bot-changes.patch git diff --staged > bot-changes.patch
else else
@@ -33,12 +33,12 @@ If you are proposing fixes and PR creation is enabled (per the System Directive)
unrelated refactor, or a metrics script update. Metrics and fixes MUST unrelated refactor, or a metrics script update. Metrics and fixes MUST
be in separate PRs. be in separate PRs.
2. **Generate PR Description**: Use the `write_file` tool to create 2. **Generate PR Description**: Use the `write_file` tool to create
`pr-description.md`. `pr-description.md` **at the workspace root**.
- **Title**: The very first line MUST be a concise, conventional title. - **Title**: The very first line MUST be a concise, conventional title.
- **Body**: Explain the change and expected impact. You MUST identify the domain expert for the affected files and mention them (cc @<user>). - **Body**: Explain the change and expected impact. You MUST identify the domain expert for the affected files and mention them (cc @<user>).
- **Labels**: Use the `write_file` tool to create `pr-labels.txt` containing one label per line. You MUST ALWAYS add the `bot-fix` label. - **Labels**: Use the `write_file` tool to create `pr-labels.txt` **at the workspace root** containing one label per line. You MUST ALWAYS add the `bot-fix` label.
3. **Branch Naming (Optional)**: If you wish to specify a custom branch name, 3. **Branch Naming (Optional)**: If you wish to specify a custom branch name,
use `write_file` to create `branch-name.txt`. **CRITICAL**: The branch name use `write_file` to create `branch-name.txt` **at the workspace root**. **CRITICAL**: The branch name
MUST start with the `bot/` prefix. If you do not specify a branch name, one MUST start with the `bot/` prefix. If you do not specify a branch name, one
will be generated for you. will be generated for you.
4. **Stage Fixes**: You MUST explicitly stage your fixes using the 4. **Stage Fixes**: You MUST explicitly stage your fixes using the
@@ -56,14 +56,14 @@ If you are continuing work on an existing Task or responding to a comment on an
existing bot PR: existing bot PR:
1. **Target Existing Branch**: Use `write_file` to generate `branch-name.txt` 1. **Target Existing Branch**: Use `write_file` to generate `branch-name.txt`
containing the current branch name. **CRITICAL**: The branch name MUST start **at the workspace root** containing the current branch name. **CRITICAL**: The branch name MUST start
with the `bot/` prefix (e.g., `bot/task-BT-01`). If it does not, your PR with the `bot/` prefix (e.g., `bot/task-BT-01`). If it does not, your PR
creation will be rejected by the safety gate. creation will be rejected by the safety gate.
2. **Track PR ID**: Use `write_file` to generate `pr-number.txt` containing the 2. **Track PR ID**: Use `write_file` to generate `pr-number.txt` **at the workspace root** containing the
numeric PR ID. numeric PR ID.
3. **Respond to Maintainers**: 3. **Respond to Maintainers**:
- For general responses, write your markdown comment to `issue-comment.md`. - For general responses, write your markdown comment to `issue-comment.md` **at the workspace root**.
- For specific PR feedback, write your markdown response to `pr-comment.md`. - For specific PR feedback, write your markdown response to `pr-comment.md` **at the workspace root**.
4. **Handle CI Failures**: Diagnose failing checks using `gh --no-pager run view` or `gh api`. Your 4. **Handle CI Failures**: Diagnose failing checks using `gh --no-pager run view` or `gh api`. Your
priority must be generating a new patch and staging it with `git add` to fix priority must be generating a new patch and staging it with `git add` to fix
the failure. the failure.
+3 -2
View File
@@ -74,7 +74,7 @@ If investigation confirms a change is required:
user's specific request. You are STRICTLY FORBIDDEN from including any user's specific request. You are STRICTLY FORBIDDEN from including any
unrelated updates when operating in interactive mode. unrelated updates when operating in interactive mode.
- **Acknowledgment**: Use the `write_file` tool to write a brief acknowledgement - **Acknowledgment**: Use the `write_file` tool to write a brief acknowledgement
to `issue-comment.md`. to `issue-comment.md` **at the workspace root**.
### 3. Question & Answer (Q&A) ### 3. Question & Answer (Q&A)
@@ -83,7 +83,8 @@ If the user's request is purely informational:
- **Evidence-Based Answers**: Delegate the information gathering to the - **Evidence-Based Answers**: Delegate the information gathering to the
**'worker' agent** to verify facts before answering. **'worker' agent** to verify facts before answering.
- **Output**: You MUST use the `write_file` tool to save your response to - **Output**: You MUST use the `write_file` tool to save your response to
`issue-comment.md`. DO NOT simply output your response to the console. `issue-comment.md` **at the workspace root**. DO NOT simply output your
response to the console.
## Execution Constraints ## Execution Constraints