fix: #412/#413/#414 runtime stability and PR governance preflight
All checks were successful
Gitea CI / test (push) Successful in 38s
Gitea CI / test (pull_request) Successful in 38s

## #413 — runtime_verify_monitor.sh pipefail fix
- find_live_pids() now captures pgrep output via local variable with || true
  so pipefail never triggers on no-match (pgrep exit 1)
- Regression test added: monitor survives MAX_LOOPS=1 without crash

## #412 — startup crash logging improvement
- Add asyncio.CancelledError catch in sync_positions_from_broker call
  so BaseException-level cancellations are logged before propagating
- Provides evidence in run log if CancelledError causes future startup aborts

## #414 — PR governance preflight
- validate_pr_body.py: add REQ-ID/TASK-ID/TEST-ID pattern checks (--no-governance flag to skip)
- docs/workflow.md: new "PR Governance Preflight (Mandatory)" section
- docs/commands.md: "PR Body Governance Preflight" section before tea pulls create
- Tests: 4 new governance traceability tests in test_validate_pr_body.py

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
agentson
2026-03-04 23:27:12 +09:00
parent 7de2a818e8
commit 4200575c8e
8 changed files with 141 additions and 5 deletions

View File

@@ -59,6 +59,20 @@ scripts/tea_comment.sh 374 /tmp/comment.md
- `scripts/tea_comment.sh` accepts stdin with `-` as body source.
- The helper fails fast when body looks like escaped-newline text only.
#### PR Body Governance Preflight (Mandatory before `tea pulls create`)
PR 본문 파일 준비 후, **생성 전에** 아래 명령으로 형식 + 거버넌스 traceability를 검증한다.
```bash
python3 scripts/validate_pr_body.py --body-file /tmp/pr_body.md
```
검증 항목: `\n` 이스케이프, 마크다운 헤더, 리스트, **REQ-ID, TASK-ID, TEST-ID** 포함.
검증 실패 시:
- PR 본문에 실제 REQ-ID/TASK-ID/TEST-ID를 채운 뒤 재검증 통과 후에만 `tea pulls create` 실행
- placeholder(`REQ-...`, `TASK-...`, `TEST-...`) 형태는 CI에서 실패 처리됨
#### PR Body Post-Check (Mandatory)
PR 생성 직후 본문이 `\n` 문자열로 깨지지 않았는지 반드시 확인한다.