Repository navigation
chore(#559): add afterAll cleanup for temp fixtures in manifest-check tests - #562
Conversation
… tests Adds cleanupTempFixtures() helper called in both beforeAll and afterAll, ensuring temp-unsupported.txt and temp-invalid-no-markers.md are removed after test runs to keep the working tree clean. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
TEST_VERDICT:
result: PASS
mergeable: MERGEABLE
merge_state_status: BLOCKED
branch_behind_main: false
baseline_only: false
verification_commands_pass: 5
verification_commands_fail: 0
verification_skipped_count: 0
runtime_ac_results: []検証結果レポートIssue #559: agent-session-manifest テスト後処理 cleanup
総合判定
Notes
|
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=CLEAN
Evidence Check
- AC coverage: 5/5 confirmed via TEST_VERDICT_MACHINE (AC1-AC5 all PASS, verification_skipped_count: 0)
- Allowed Paths: compliant (only
tests/agent-session-manifest-check.test.tsmodified) - CI Verification: all 7 checks pass (build, e2e, lint, python-test, test, typecheck, validate-generated-artifact) on head SHA 6064d33
- 検証コマンド結果: TEST_VERDICT_MACHINE v1 コメントで全 AC PASS 確認済み。verification_commands_pass: 5, verification_commands_fail: 0, verification_skipped_count: 0
Blockers
- なし
Non-blockers
- なし
LOOP_VERDICT
verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 6064d33e8a68038df34fd8009dfceb2590a7d70b
recommendations: []
follow_up_issue_requests: []
結論: APPROVE寄り / BlockerなしPR #562 は、Issue #559 の契約に対して 実装としては十分に合格です。変更は 契約充足の確認Issue #559 は、 PR #562 の差分は、対象 temp path 配列を追加し、 Vitest 公式ドキュメント上、 Node.js 公式ドキュメント上、 敵対的レビュー結果Blocker 1: なしコード上の主要リスクは見つかりません。 Non-blocker 1: TEST_VERDICT の machine-readable runtime 証跡が弱いPR コメントの これは実装の欠陥ではありませんが、将来 gate が 推奨修正は PR 本体ではなく、verdict 生成側の follow-up です。 follow_up_issue:
title: "TEST_VERDICT の runtime AC 結果を machine-readable に正規化する"
rationale: "PR #562 では runtime 的な AC2/AC3 の証跡が本文表にはあるが runtime_ac_results が空で、gate が構造化結果を読む場合に検出不能になる"
scope:
- "runtime_only / file-existence AC の command, exit_code, status を runtime_ac_results に出す"
- "本文表と machine-readable verdict の drift を禁止する"Non-blocker 2: beforeAll の stale artifact 除去を直接検証するコマンドが不足Issue #559 は、書き込み先を変えるだけでは stale repo-local artifact が残るため、legacy path の cleanup を必須にしています。([GitHub]2) PR 実装自体は 高品質化するなら、追加で次のような verification を comment に残すとよいです。 printf 'stale\n' > tests/fixtures/agent-session-manifest/temp-unsupported.txt
printf 'stale\n' > tests/fixtures/agent-session-manifest/temp-invalid-no-markers.md
pnpm test -- tests/agent-session-manifest-check.test.ts -t 'valid JSON manifest fixture'
test ! -f tests/fixtures/agent-session-manifest/temp-unsupported.txt
test ! -f tests/fixtures/agent-session-manifest/temp-invalid-no-markers.mdこのコマンドは、temp fixture を生成しない filtered test でも Non-blocker 3: 異常終了時の artifact 残存は未解決だが、Issue scope 外
本質的にさらに強くするなら、repo-local fixture への書き込みをやめて per-test temp dir を使う設計が上位改善です。ただし Issue #559 は当該1ファイル限定で、他テストファイルや広範な test-hygiene 改修を Out of Scope としているため、この PR で要求すべきではありません。([GitHub]2) 関連Issue / PRとの整合Issue #559 は PR #555 の post-merge cleanup 観察由来の follow-up と明記されており、PR #555 側の主題である GitHub Actions Node24 対応とは分離された test-hygiene 改善です。今回の PR #562 はその派生原因である repo-local temp artifact のみを処理しており、スコープ分離は妥当です。([GitHub]2) また、元の 推奨コメント案## Verdict: APPROVE
Blocker はありません。
PR #562 は Issue #559 の契約に沿って、`tests/agent-session-manifest-check.test.ts` の既知 temp fixture path
`temp-unsupported.txt` / `temp-invalid-no-markers.md` を `cleanupTempFixtures()` に集約し、
`beforeAll` / `afterAll` の両方から `rmSync(path, { force: true })` で削除しています。
Vitest の lifecycle 上、`beforeAll` は suite 実行前、`afterAll` は suite 完了後に1回実行されるため、
通常の `pnpm test` 実行後に repo-local untracked artifact を残さない目的に合っています。
Node `fs.rmSync(..., { force: true })` も、path 不在時に例外を出さない idempotent cleanup として適切です。
Non-blocker:
- TEST_VERDICT の `runtime_ac_results: []` は弱いです。AC2/AC3 の file-existence check を本文表だけでなく machine-readable に出す follow-up を推奨します。
- stale artifact が事前に存在する場合の `beforeAll` cleanup を直接証明する追加 verification があると、証跡品質が上がります。
追加確認例:
```bash
printf 'stale\n' > tests/fixtures/agent-session-manifest/temp-unsupported.txt
printf 'stale\n' > tests/fixtures/agent-session-manifest/temp-invalid-no-markers.md
pnpm test -- tests/agent-session-manifest-check.test.ts -t 'valid JSON manifest fixture'
test ! -f tests/fixtures/agent-session-manifest/temp-unsupported.txt
test ! -f tests/fixtures/agent-session-manifest/temp-invalid-no-markers.md上記は品質改善であり、現 PR の merge blocker ではありません。 |
Summary
cleanupTempFixtures()helper を追加し、beforeAll/afterAllの両方から呼ぶrmSync(path, { force: true })で idempotent cleanup を実装temp-unsupported.txt/temp-invalid-no-markers.mdをテスト終了後に削除Closes #559
Contract Snapshot: #559 (comment)
Verification
allowed_paths_compliance: true
🤖 Generated with Claude Code