Skip to content

再発防止: runtime smoke live pytest の非破壊 output-dir authoring 指針を追加する #2999

Open

Description

@squne121

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

Out of Scope

Acceptance Criteria

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/main

AC1–AC4 の文字列は新規小節の短い見出し/箇条書き内に含める。AC5 の full changed-path 判定は既存 canonical Allowed Paths review gate が PR review 時に行い、この command 単体を PASS 証明としない。

Allowed Paths

  • docs/dev/runtime-verification-policy.md

Stop Conditions

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 は人間判断。

Activity

  1. squne121 commented on Oct 9, 2026

    @squne121
    OwnerAuthor

    #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 の契約自体はここでは書き換えていない。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions