Skip to content

Commit f47f048

Browse files
committed
Document terminal reliability and no-set-e guidance
1 parent 6da35be commit f47f048

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

.github/copilot-instructions.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ When a new issue is created, follow these steps:
150150
- Do not modify `CHANGELOG.md` unless executing a release workflow (see `release-notes` prompt).
151151
- Do not close issues without a fix or without providing a clear reason.
152152

153+
## Terminal Execution Safety
154+
- Treat any non-zero shell exit code as a failed step that requires correction before proceeding.
155+
- If a bash process exits, do not wait for more output from that process; rerun the command in a fresh terminal session.
156+
- Validate that expected command output was produced before using it as evidence for conclusions.
157+
- When terminal execution fails, surface the failure immediately and retry with a corrected command.
158+
- Avoid `set -e` in this automation workflow; use focused commands and verify each result explicitly so shell exits are observable and attributable.
159+
- Prefer short, single-purpose terminal commands over long chained scripts when debugging or gathering state.
160+
153161
## 📝 Notes
154162
- Update policies and guidelines in the `policy/` directory as needed based on trending practices and team feedback.
155163
- Regularly review and update the `doc/` directory to ensure it reflects the current state of the project.

AGENTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ This repository provides reusable prompts in `.github/prompts/` for common maint
5454
6. **Performance Optimization**: Use pooling, async, efficient allocations
5555
7. **Observability**: EventSource tracing, meaningful errors
5656

57+
## Terminal Reliability Rules
58+
59+
When using shell/terminal tools, follow these rules strictly:
60+
61+
1. Treat non-zero terminal exit codes as immediate failures to investigate; do not continue as if the command succeeded.
62+
2. If a bash session exits, assume it is dead and start a new command/session; do not wait for additional output from that session.
63+
3. After any command expected to gather data, verify output was actually returned before proceeding.
64+
4. If command execution failed, report the failure clearly and retry with a corrected command instead of waiting.
65+
5. Avoid `set -e` in this automation context; prefer single-purpose commands with explicit follow-up checks so failures are visible without killing the shell unexpectedly.
66+
6. Prefer shorter command batches over long chained scripts when collecting evidence; this makes bash exits easier to detect and recover from.
67+
5768
## Branch Naming
5869

5970
All branches created by AI agents **must** live under the `dev/automation/` prefix. Use a descriptive suffix, for example:

0 commit comments

Comments
 (0)