Repository navigation
Open
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "新規 runtime smoke live pytest が runner の排他的 output-dir 契約に反して固定パスを削除・再利用する再発を、既存ドキュメントへの短い authoring guidance で防ぐ"
change_kind: docs
dedupe_key: "runtime-smoke-live-pytest-nondestructive-output-authoring-v1"Background / Source
- #2971 で導入された live test 3 ファイルに、固定
OUTPUT_DIR+shutil.rmtree(ROOT / OUTPUT_DIR, ignore_errors=True)の同型パターンが存在した。 - #2986 が body-only lane の 1 ファイルを、#2997 が残り 2 ファイルを所有する。今回の Issue はそれらの実装修正を重複して所有しない。
- #2997 OWNER 敵対的レビュー F1/F3/F4/F5 により、生成関数の一意性だけでなく実 argv・summary/evidence の同一 run への binding、出力先の未作成、以前の evidence の保全が必要と指摘された。
- #2918 は Issue Verification Commands の記述を、#2915 は VC 内の prompt-file と output-dir の衝突を扱う。ここでは Python live test を新規作成・修正する開発者/agent 向け指針のみを扱う。新たな validator は作らない。
Outcome
既存 docs/dev/runtime-verification-policy.md に、exclusive-create な run_worktree_agent_runtime_smoke.py を pytest live test から 呼ぶ際の短い実装指針が追加される。新規テストの著者が、同一問題をコピー&ペーストで再導入しないようにする。
In Scope
- 既存ドキュメントに「Runtime smoke live-test fixture authoring」という小節を追加し、以下を明記する。
--output-dirは run ごとに未存在の一意な worktree-local 相対 path を生成する。UTC timestamp + UUID 等で構成し、mkdtemp/mkdirで runner 起動前にその出力先を作らない。- 古い output directory を
rmtreeで削除して使い回さない。失敗 run も含め、過去の evidence を保持する。 - 同一 invocation で生成した path を
--output-dir、summary.md読み出し、必要なevidence.jsonの保存・検証に一貫して使用する。path の一意性だけでなく配線を hermetic regression で固定する。 tempfile.mkdtempで生成した 一時入力 の cleanup は維持可能であり、runner 証跡の削除とは区別する。証跡は worktree-local で、worktree cleanup 後に永久保存されるとは主張しない。
- 実装: impl-review-loop の body-only lane runtime smoke を #2981 の counterfactual control に接続し candidate PASS + BASE FAIL を AC8 の PASS 条件にする #2986/実装: impl-review-loop の runtime smoke live test 2 本が固定 OUTPUT_DIR を削除せず run ごとに固有の output directory を使う #2997 と 実装: exclusive-create な runtime smoke runner の VC authoring 契約を stable prefix と一意 leaf の operator lane に固定する #2918/実装: runtime-smoke VC の排他的 output-dir 配下に入力ファイルを置く契約を静的検査で拒否する #2915 を短く相互参照し、責任範囲を区別する。
Out of Scope
- 実装: impl-review-loop の body-only lane runtime smoke を #2981 の counterfactual control に接続し candidate PASS + BASE FAIL を AC8 の PASS 条件にする #2986 / 実装: impl-review-loop の runtime smoke live test 2 本が固定 OUTPUT_DIR を削除せず run ごとに固有の output directory を使う #2997 の 3 live test file、runner、既存 Skill の動作変更。
- 新規 generic artifact manager、global registry、lock、CI gate、schema、validator、追加 permission/approval layer。
- Artifact retention / 永続ストレージの設計。
- 実装: exclusive-create な runtime smoke runner の VC authoring 契約を stable prefix と一意 leaf の operator lane に固定する #2918 の VC authoring 契約、実装: runtime-smoke VC の排他的 output-dir 配下に入力ファイルを置く契約を静的検査で拒否する #2915 の LP032 validator 実装。
Acceptance Criteria
- AC1:
docs/dev/runtime-verification-policy.mdにRuntime smoke live-test fixture authoring小節があり、runner の exclusive-create と未存在 run 固有 output path を明記する。 - AC2: 同節が古い run の output directory を削除・再利用せず、未作成の path を runner に渡すことを明記する。
- AC3: 同節が 1 invocation の argv・summary・structured evidence path の同一 binding と、その hermetic regression を推奨する。
- AC4: 一時入力の cleanup と証跡の保持を区別し、実装: impl-review-loop の body-only lane runtime smoke を #2981 の counterfactual control に接続し candidate PASS + BASE FAIL を AC8 の PASS 条件にする #2986/実装: impl-review-loop の runtime smoke live test 2 本が固定 OUTPUT_DIR を削除せず run ごとに固有の output directory を使う #2997/実装: exclusive-create な runtime smoke runner の VC authoring 契約を stable prefix と一意 leaf の operator lane に固定する #2918/実装: runtime-smoke VC の排他的 output-dir 配下に入力ファイルを置く契約を静的検査で拒否する #2915 との ownership 境界を記述する。
- AC5: PR diff が当該 docs 1 ファイルに限られ、既存 runtime behavior や gate が変更されない。
Verification Commands
# AC1
# baseline-expect: fail
$ rg -n --fixed-strings "Runtime smoke live-test fixture authoring" docs/dev/runtime-verification-policy.md
# AC2
# baseline-expect: fail
$ rg -n --fixed-strings "未存在の run 固有 output path" docs/dev/runtime-verification-policy.md
# AC3
# baseline-expect: fail
$ rg -n --fixed-strings "同一 invocation の output path" docs/dev/runtime-verification-policy.md
# AC4
# baseline-expect: fail
$ rg -n --fixed-strings "一時入力と runtime evidence の区別" docs/dev/runtime-verification-policy.md
# AC5
# preflight-scope: pr_review_only
$ git diff --name-only origin/mainAC1–AC4 の文字列は新規小節の短い見出し/箇条書き内に含める。AC5 の full changed-path 判定は既存 canonical Allowed Paths review gate が PR review 時に行い、この command 単体を PASS 証明としない。
Allowed Paths
docs/dev/runtime-verification-policy.md
Stop Conditions
- 追加コード・CI gate・validator が不可避になった場合は当 Issue に押し込まず再評価する。
- 実装: impl-review-loop の body-only lane runtime smoke を #2981 の counterfactual control に接続し candidate PASS + BASE FAIL を AC8 の PASS 条件にする #2986/実装: impl-review-loop の runtime smoke live test 2 本が固定 OUTPUT_DIR を削除せず run ごとに固有の output directory を使う #2997/実装: exclusive-create な runtime smoke runner の VC authoring 契約を stable prefix と一意 leaf の operator lane に固定する #2918/実装: runtime-smoke VC の排他的 output-dir 配下に入力ファイルを置く契約を静的検査で拒否する #2915 の ownership を変更する必要が生じた場合。
- 既存 repository policy と矛盾する実装指針が必要になった場合。
Runtime Verification Applicability
decision: not_applicable
reason: "既存文書に live-test fixture authoring の注意を追記する docs-only 変更で、runner・pytest・runtime の動作を変更しない"Delivery Rule
1 Issue = 1 PR、専用 worktree、Draft PR 既定。merge / auto-merge は人間判断。
Metadata
Metadata
Assignees
Labels
No labels
Activity
squne121 commentedon Oct 9, 2026
#3002 OWNER review F1 — hermetic fake の worktree root 整合性(#2999 AC3 の補足 evidence)
参照: #3002 (comment)
#2997 / PR #3002 の live test 2 本で、
runner_argv()の--worktreeはグローバルROOT、hermetic helper のrootと fake の出力先基準はtmp_pathになっている。実 runner は相対--output-dirを--worktree基準で解決するため、fake がcwd基準で作る出力先と実出力先が食い違う。この状態では実 worktree のartifacts/runtime-smokeを削除する mutation を、tmp_pathの sentinel 検証で検知できない(回帰テストの false-green)。現在の PR diff はこの具体的欠陥をまだ修復していない。所有範囲の整理: #3002 側は当該 2 テストファイル内で修正する。#2999 側の authoring guidance(既存 In Scope 3 / AC3)を実装する際は、配線の共通 path だけでなく 実 runner と fake の相対パス基準が同じ
--worktreeであること と、sentinel /cwd/ summary /evidence.jsonの同一 root binding を明記することを検討してほしい。test-only sandbox でmonkeypatch.setattr(module, "ROOT", sandbox_root)などを使い、旧証跡ディレクトリ削除を再導入した negative control が確実に FAIL することも推奨する。これを新しい CI gate、artifact manager、承認レイヤーの追加理由にしない。既存 #2999 の非破壊 output-dir authoring guidance の一部として扱えるため、新規の重複 Issue は起票しない。Issue body の契約自体はここでは書き換えていない。
docs(runtime): clarify worktree-relative evidence paths (squne121#2999)