Skip to content

Commit 2283e1a

Browse files
committed
docs(192): update hard gate skills for async execution with 5-minute polling
- quality-gates/SKILL.md: replace synchronous execution with async background launch + 5-minute polling loop - subtask-loop/SKILL.md: update Task Completion Verification to reference async polling - git-workflow/SKILL.md: update Pre-merge checks to reference async polling procedure
1 parent f911810 commit 2283e1a

3 files changed

Lines changed: 31 additions & 10 deletions

File tree

.opencode/skills/git-workflow/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ docs(XXX-SN): description
4949

5050
### Pre-merge checks
5151

52-
The hard gate MUST pass before merging:
52+
The hard gate MUST pass before merging. Run asynchronously with periodic polling:
5353

5454
```bash
55-
python3 tools/hard_gate.py
55+
python3 tools/hard_gate.py > tmp/hard-gate-stderr.txt 2>&1 &
5656
```
5757

58-
See the `quality-gates` skill for the full hard gate procedure. While the gate runs, `tmp/hard-gate.txt` shows `STATUS: IN_PROGRESS` — wait for the process to exit. Check the exit code. If non-zero — for ANY reason — STOP. Do not merge. Only merge when exit code 0.
58+
See the `quality-gates` skill for the full async polling procedure. Poll `grep "STATUS:" tmp/hard-gate.txt` every 5 minutes. Only non-zero exit code — for ANY reason — is a blocker. Do not merge. Only merge when exit code 0.
5959

6060
### Merge strategy
6161

.opencode/skills/quality-gates/SKILL.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,36 @@ Then read and analyze `tmp/quality-check.txt`. If STATUS: BLOCKED — fix all pr
7474

7575
## Task Verification
7676

77-
Run once when all subtasks are done. Use the hard gate tool:
77+
Run once when all subtasks are done. The full hard gate may take more than 30 minutes, so it is run **asynchronously** with periodic status polling.
78+
79+
### Starting the Gate
7880

7981
```bash
80-
python3 tools/hard_gate.py
82+
python3 tools/hard_gate.py > tmp/hard-gate-stderr.txt 2>&1 &
83+
echo $! > tmp/hard-gate.pid
8184
```
8285

83-
The hard gate writes output incrementally to `tmp/hard-gate.txt`. While it runs, the file shows `STATUS: IN_PROGRESS` — the gate has not finished yet. **Never interpret `IN_PROGRESS` as a pass or failure.** Wait for the process to exit, then check the exit code (`echo $?`):
86+
The gate runs in background and writes progress incrementally to `tmp/hard-gate.txt` after each step.
87+
88+
### Polling Status
89+
90+
Every **5 minutes**, check the current status:
91+
92+
```bash
93+
grep "STATUS:" tmp/hard-gate.txt
94+
```
95+
96+
- **`STATUS: PASS`** — gate finished successfully (exit code 0). Proceed to merge.
97+
- **`STATUS: BLOCKED`** — gate finished with exit code non-zero. Read `tmp/hard-gate.txt` to identify all failures, fix them, and **re-run the gate from the start**.
98+
- **`STATUS: IN_PROGRESS`** — gate is still running. Check the step counter (lines like `Step N/M`) to verify progress. If the step number advanced since the last check, the gate is making progress — continue waiting and poll again in 5 minutes. If the step counter has not advanced after multiple polling cycles (>15 minutes with no progress), investigate the detailed log section in `tmp/hard-gate.txt` for the currently running command. **Keep polling** until `IN_PROGRESS` changes to `PASS` or `BLOCKED`.
99+
100+
**Never interpret `IN_PROGRESS` as a pass or failure.** Only `PASS` and `BLOCKED` are terminal states.
101+
102+
### After Completion
84103

85-
- **Exit code 0**`STATUS: PASS` — proceed to merge.
86-
- **Exit code non-zero**`STATUS: BLOCKED` — read `tmp/hard-gate.txt` to identify what to fix, then re-run. Repeat until exit code 0.
104+
When the gate finishes, check the exit status:
105+
- If any step shows `BLOCKED` in the summary, read the detailed log to identify the failure, fix all problems, and re-run from the start.
106+
- Exit code 0 and `STATUS: PASS` means proceed to merge.
87107

88108
The hard gate runs: format → build → tests with coverage → coverage verification → lint on changed projects. See `docs/developer/guides/tools.md` for detailed step descriptions, thresholds, and output format examples.
89109

.opencode/skills/subtask-loop/SKILL.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,11 @@ If you encounter an algorithmic problem that you cannot resolve to 100% correctn
187187
After ALL subtasks are committed, run the hard gate:
188188

189189
```bash
190-
python3 tools/hard_gate.py
190+
python3 tools/hard_gate.py > tmp/hard-gate-stderr.txt 2>&1 &
191+
echo $! > tmp/hard-gate.pid
191192
```
192193

193-
See the `quality-gates` skill for the full procedure. While the gate runs, `tmp/hard-gate.txt` shows `STATUS: IN_PROGRESS` — the gate has not finished yet. Wait for the process to exit, then check the **exit code** (`echo $?`). If non-zero — for ANY reason — STOP. Do not merge. Do not mark the task as done. Read the output file only to identify what to fix, not to decide whether the failure applies to you. Re-run until exit code 0, then proceed to merge.
194+
See the `quality-gates` skill for the full async polling procedure. The gate runs in background and writes progress to `tmp/hard-gate.txt`. Poll every 5 minutes: `grep "STATUS:" tmp/hard-gate.txt`. Only `PASS` and `BLOCKED` are terminal states — `IN_PROGRESS` means keep polling. If non-zero exit code — for ANY reason — STOP. Do not merge. Do not mark the task as done. Read the output file only to identify what to fix. Re-run until exit code 0, then proceed to merge.
194195

195196
## Marking Complete
196197

0 commit comments

Comments
 (0)