Skip to content

fix: test_issue_1952回帰テストのrepo_root誤指定による.claude/.claude迷子ディレクトリ生成を修正する - #2072

Merged
squne121 merged 2 commits into
mainfrom
worktree-issue-2071-repo-root-fix
Aug 12, 2026
Merged

squne121 merged 2 commits into
mainfrom
worktree-issue-2071-repo-root-fix

Conversation

@squne121

@squne121 squne121 commented Aug 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #2071(Issue #2071 の単一テスト修正を完了する PR)。

test_scalar_authority_route_still_writes_runtime_provenance_sidecar が build_provenance() と write_provenance_artifact() に .claude/ を repo_root として渡していたため、.claude/.claude/artifacts/issue-refinement-loop/9951952/ に迷子ディレクトリが生成され、cleanup と不一致になっていた不具合を修正する。

変更内容

  • repo_root を SKILL_ROOT.parent.parent.parent(真のリポジトリルート)へ修正
  • cleanup 用 artifact_dir を実際の artifact パスに一致させた

受け入れ条件の達成状況

  • AC1: current HEAD 690cba79c7d66323cc05fc5c9c777498b814f8b5 で rg -n "SKILL_ROOT.parent.parent.parent" .claude/skills/issue-refinement-loop/tests/test_issue_1952_trusted_directive_regression.py を実行し、3 箇所検出した。
  • AC2: current HEAD で uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_issue_1952_trusted_directive_regression.py::test_scalar_authority_route_still_writes_runtime_provenance_sidecar -q を実行し、1 passed。実行後に .claude/.claude が不存在であることを確認した。
  • AC3: current HEAD で uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_repair_issue_contract.py::test_new_allowed_path_baseline_fail .claude/skills/issue-refinement-loop/scripts/tests/test_repair_issue_contract.py::test_rg_exit2_new_file -q を実行し、2 passed。さらに uv run --locked pytest .claude/skills/issue-refinement-loop/tests/ .claude/skills/issue-refinement-loop/scripts/tests/ -q を3回連続実行し、各回 exit 0 と実行後の .claude/.claude 不存在を確認した。

Checks

  • rg -n "SKILL_ROOT.parent.parent.parent" .claude/skills/issue-refinement-loop/tests/test_issue_1952_trusted_directive_regression.py(3 箇所検出)
  • uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_issue_1952_trusted_directive_regression.py::test_scalar_authority_route_still_writes_runtime_provenance_sidecar -q(1 passed)
  • uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_repair_issue_contract.py::test_new_allowed_path_baseline_fail .claude/skills/issue-refinement-loop/scripts/tests/test_repair_issue_contract.py::test_rg_exit2_new_file -q(2 passed)
  • uv run --locked pytest .claude/skills/issue-refinement-loop/tests/ .claude/skills/issue-refinement-loop/scripts/tests/ -q(3 回連続、各回 exit 0)
  • git diff --check origin/main...HEAD

Schema Change Applicability

  • decision: not_schema_change
  • この変更はテスト内のパス引数と cleanup パスのみを対象とし、machine-readable schema を変更しない。

Schema Consumer Inventory

N/A。schema 変更はないため consumer 更新は不要。

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
当該テストの artifact 書き込み先は真のリポジトリルート配下になり、.claude/.claude を生成しない。 yes N/A producer test 1 passed、full suite 3 回連続 exit 0、各回 .claude/.claude 不存在 N/A

検証コマンド結果

  • current HEAD 690cba79c7d66323cc05fc5c9c777498b814f8b5 の required CI: validate-generated-artifact、typecheck、lint、test、build はすべて成功。

Allowed Paths 遵守

Notes

…#2071)

test_scalar_authority_route_still_writes_runtime_provenance_sidecar が
build_provenance()/write_provenance_artifact() に SKILL_ROOT.parent.parent
(.claude/ ディレクトリ自体)を repo_root として渡していたため、
.claude/.claude/artifacts/issue-refinement-loop/9951952/ という迷子
ディレクトリを毎回生成し、finally ブロックの cleanup パスとも不一致で
削除されなかった。SKILL_ROOT.parent.parent.parent(真のリポジトリルート)
を渡すよう修正し、cleanup 用 artifact_dir も実際の書き込みパスと一致
させた。既存の .claude/.claude/ stray directory は削除済み。

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@github-actions

github-actions Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #2072 closed).

@squne121

squne121 commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

PR Review Verdict (impl-review-loop, fresh review)

Verdict: APPROVE
Reviewed head: 488bc8554a6f2d6e5187d0ea374034d19954a14f

Confirmed against live state

Warnings(blocker ではない)

  • non-required PR Body Japanese Check が fail(コードブロック内英語コマンド行の誤検知の可能性、required checks リストに含まれず blocker としない)
  • AC2 の恒久的な regression-guard assertion はテスト自体には追加されていないが、Issue の VC 契約自体は満たしている
verdict: APPROVE
reviewed_head_sha: "488bc8554a6f2d6e5187d0ea374034d19954a14f"
blockers: []

P0/P1 blocker 0件・全 required CI green のため merge_ready=true(マージは人間判断に委ねます。本エージェントは merge を実行しません)。

@squne121
squne121 merged commit 7aac382 into main Aug 12, 2026
40 of 42 checks passed
@squne121
squne121 deleted the worktree-issue-2071-repo-root-fix branch August 12, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: test_issue_1952回帰テストのrepo_root誤指定による.claude/.claude迷子ディレクトリ生成を修正する

1 participant