Repository navigation
実装: repo-approved local temporary workspace を tmp/ へ一本化する - #2001
Conversation
eslint.config.mjs の ignores に '.claude/tmp/**' / '**/.claude/tmp/**' / 'tmp/**' を追加し、 未追跡 session artifact が pnpm lint の regression gate を偽陽性で fail させる再発を防止する。 docs/dev/repository-folder-policy.md / AGENTS.md / docs/dev/agent-skill-boundaries.md / docs/dev/hook-boundaries.md / .claude/skills/post-merge-cleanup-executor/SKILL.md を 「tmp/ が canonical、.claude/tmp/ は deprecated legacy root(構造・never_delete は温存)」 という一貫した記述に更新し、tests/eslint-ignore-policy.test.ts に runtime 検証テストを追加する。 production writer・schema enum・marker・classifier の変更は本 Issue のスコープ外。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Preview URL✅ verified live assets: https://squne121.github.io/loop-protocol/pr-2001/ The preview will be removed when this PR is closed. |
Canonical-heading exemption リストに未登録の見出しが per-block 日本語比率 0.056(閾値 0.1)で PR Body Japanese Check CI を fail させていたため、見出しに日本語 gloss を追加する。
敵対的レビュー結果判定: ESLint の ignore 追加自体は成立しています。一方で、正本文書の自己矛盾、未追跡の production writer、破壊的かつ並列非安全なテストという P1 ブロッカーが3件あります。PR は Draft・mergeable で CI も成功していますが、これらは単発の green CI では検出できない契約・副作用上の欠陥です。 P1 — folder-policy SSOT が同一文書内で相反している
さらに既存の「運用ルール」も、両方を「使える」と明記しています。その直後に追加された節だけが「 Issue の AC6・AC7 は単に 必要な修正
- path: "tmp/"
folder_class: repo_approved_temporary_workspace
guidance: canonical_write_destination
- path: ".claude/tmp/"
folder_class: repo_approved_temporary_workspace
guidance: deprecated_legacy_read_scan_report_only_use_tmp_for_new_writes既存の「 P1 — 「一本化」を主張しているが、production runtime は現在も書き込み・推奨している実装上の production writer は、既定で 加えて runtime advisory producer は、 Issue refinement の最終コメントでは、writer migration・schema v2・advisory 改修がすべて 次のどちらかが必要です。
現状の「一本化済みだが、実行系の移行は未起票」は不整合です。 P1 — 回帰テストが既存ファイルを上書き・削除できる
その後 これはリポジトリ自身が Issue #1616/source PR #1544 で要求している「exact owned session directory」「削除直前の marker・Git state・identity 再検査」「root/glob deletion 禁止」という安全モデルより弱い削除です。production executor とテストでは脅威モデルが異なりますが、開発者の実 worktree を直接変更する以上、固定パスを無条件に再帰削除してよい理由にはなりません。 さらに Vitest は既定でテストファイルを並列実行します。このリポジトリには、同じ test suite 内で repo root を なお、この危険な形は実装者独自の逸脱ではなく、Issue #1995 の AC3〜AC5 が「repo 内に fixture を生成して子プロセスで P2 —
|
- tests/eslint-ignore-policy.test.ts を ESLint Node.js API (isPathIgnored/lintText) による in-process 検証へ全面書き換え。 実ファイル fixture の固定パス書き込み・pnpm lint 子プロセス多重起動を廃止。 - docs/dev/repository-folder-policy.md の REPOSITORY_FOLDER_POLICY_V1 構造化定義の guidance フィールドを tmp/=canonical, .claude/tmp/=deprecated legacy に変更し、運用ルールのプローズを新規書き込み tmp/ 単一の 記述へ置換。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
…lization' into worktree-issue-1995-tmp-canonicalization
…sion-recording/ へ同時移行する (#2008) * feat: move session-recording source-bound eligibility/readiness private location to tmp/ (#2004) readiness producer (bootstrap-source-bound-readiness.mjs)、eligibility producer/loader (check_session_recording_runtime_safety.py)、readiness consumer (capture_scope_rollup_final_response.py) の固定 private location を .claude/tmp/session-recording/ から tmp/session-recording/(#1995/#2001 の repo-approved local temporary workspace)へ同時移行する。旧パスは dual-read fallback せず消費しない。env override (SCOPE_ROLLUP_ELIGIBILITY_ARTIFACT_PATH / SCOPE_ROLLUP_READINESS_ARTIFACT_PATH) は絶対パスをそのまま使い、相対パスは producer/consumer で共通の repo-root 基準に正規化する。親ディレクトリ mode 0700 を umask に依存せず明示的に強制する。docs/dev/session-recording-policy.md に新パスと digest 再生成順序(policy/secret-policy digest 変更→eligibility 再生成、producer digest 変更→readiness 再生成)を明記する。 tests/session-recording/test_fixed_location_cutover.py に AC1/AC3-AC7 の runtime 検証テストを追加し、既存の regression テスト (.claude/hooks/tests/test_scope_rollup_capture.py、 tests/agent_ops/test_temp_residue_classifier.py、 scripts/agent-guards/tests/test_root_temporary_residue_policy.py、 tests/codex/test_root_temporary_residue_advisory.py) が継続 pass することを 確認した。 Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix_delta: register new session-recording test in python-test-plan.json + add scope-rollup round-trip negative controls PR #2008 REQUEST_CHANGES fix_delta for Issue #2004: 1. tests/session-recording/test_fixed_location_cutover.py (hyphenated dir, uses node subprocess for the readiness bootstrap script) was not registered in any CI target, so it was never actually collected/executed by node-backed-hook-tests or python-test-core (uncovered_changed_test_files gate violation). Registered it as a python-test-plan.json target (python-test-core job; ubuntu-latest runners ship Node preinstalled, and the test only needs node + uv, both already available there). Scope Delta: .github/ci/python-test-plan.json is outside Issue #2004's Allowed Paths. This is a mechanical registration of an already-Allowed-Paths test file into the existing python-test-plan SSOT target list (no target set redesign, no workflow topology change) required to satisfy the Runtime Verification Applicability: immediate constraint (AC1/AC3-AC8 cannot SKIP). Verified via python_test_plan.py --emit run-argv and verify_python_test_lane.py that the lane invariant/topology is unaffected. 2. Added the In-Scope-required tests to .claude/hooks/tests/test_scope_rollup_capture.py: a producer-consumer round trip against the real (non-overridden) new default tmp/session-recording/ location, plus three negative controls (old .claude/tmp/session-recording/ path only, readiness-only, eligibility-only) each asserting the fixed fail-closed missing reason code (eligibility_missing / readiness_missing), matching the Issue's In Scope bullet exactly (this file's existing tests only exercised the test-harness override paths, never the real default-path computation). Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix_delta: harden parent-dir/TOCTOU (P1-1), fix CI lane separation (P1-2), fix cross-language override parity (P1-3), sync PR body (P1-4), hermetic E2E (P2), non-fixed test clock (P3) OWNER 敵対的レビュー (PR #2008 head 800116e) の REQUEST_CHANGES に対応する fix_delta。 P1-1: 親ディレクトリの symlink/owner 検証を追加(prepare_private_parent_dir / validate_private_parent_dir_readonly、Python・Node 両方)。新規作成した親のみ chmod する。artifact 読み取りは O_NOFOLLOW fd で open+fstat+read を単一 fd に 統一し stat-then-read の TOCTOU を解消。 P1-2: tests/session-recording/test_fixed_location_cutover.py のうち Node subprocess を起動する 8 nodeid を python-test-plan.json の deselect へ移し、 node-backed-hook-tests job の専用ステップで実行するよう ci.yml を更新。 P1-3: override path 解決を Python/Node 双方で lexical-only 正規化に統一し (symlink 非解決、".." 拒否)、cross-language parity test を追加。Node 側に --print-resolved-override 診断用 CLI を追加。 P2: bootstrap-source-bound-readiness.mjs に --repo-root test seam を追加し、 live repo の canonical artifact を操作しない hermetic な producer-consumer E2E テストへ置き換え。 P3: テスト内 eligibility expiry を real wall-clock 相対値に変更。 Scope Delta 追加: scripts/ci/tests/test_python_test_plan.py の serial-lane argv snapshot を python-test-plan.json の deselect 追加に合わせて機械的に 更新(Issue #2004 Allowed Paths へ追加済み)。 --------- Co-authored-by: Claude Sonnet 5 <[email protected]> Co-authored-by: Test User <[email protected]>
Summary
eslint.config.mjsのignoresに'.claude/tmp/**'/'**/.claude/tmp/**'/'tmp/**'を追加し、未追跡 session artifact がpnpm lintの regression gate を偽陽性で fail させる再発(Issue 実装: write-set-audit-helper に origin/storageKey 境界の記録を追加する #1993 実害)を防止するdocs/dev/repository-folder-policy.md/AGENTS.md/docs/dev/agent-skill-boundaries.md/docs/dev/hook-boundaries.md/.claude/skills/post-merge-cleanup-executor/SKILL.mdを「tmp/が canonical write destination、.claude/tmp/は deprecated legacy root(構造・read/scan/report・never_deletesafety rule は温存)」という一貫した記述に更新するtests/eslint-ignore-policy.test.tsを ESLint Node.js API(ESLint#isPathIgnored()/ESLint#lintText())による in-process 検証へ全面書き換えし、.claude/tmp//tmp/(root 直下・nested 両方)が ignored 判定されること、通常 source path(negative control)は ignored でなく実際に lint エラーが検出されることを runtime に確認する(実ファイル fixture 書き込み・pnpm lint子プロセス多重起動なし。OWNER 敵対的レビュー issuecomment-5203294136 を受けた改訂)bootstrap-source-bound-readiness.mjs)・schema enum(repo_temp_folder_advice_v1.schema.json)・marker(temp_residue_marker.py)・classifier(temp_residue_classifier.py)の変更は本 PR のスコープ外(Issue 実装: repo-approved local temporary workspace を tmp/ へ一本化し .claude/tmp/ を非推奨化する #1995 の OWNER 敵対的レビューで narrow 化済み)Checks
pnpm typecheck(型検証・成功)pnpm lint(静的解析・成功)pnpm test(全テスト・成功)pnpm build(ビルド・成功)Schema Change Applicability
not_schema_changeschemas/*.json等)は変更しない。Schema Consumer Inventory
N/A(
not_schema_changeのため)Compatibility Decision(互換性判定)
N/AN/AN/AN/ASafety Claim Matrix
.claude/tmp/**/tmp/**を ESLint scan 対象外にしても、通常 source path(src/**等)の lint 検出力は維持されるtests/eslint-ignore-policy.test.tsの negative control ケース(ESLint#isPathIgnored()がfalseを返し、ESLint#lintText()が実際に lint エラーを報告することを in-process で確認).claude/tmp/のnever_delete/report_onlysafety boundary(TEMP_CLEANUP_SAFETY_RULES_V1)は本 PR で変更・削除されない.claude/skills/post-merge-cleanup-executor/SKILL.mdのTEMP_CLEANUP_SAFETY_RULES_V1.never_deleteに.claude/tmp/が引き続き含まれることを diff で確認可能(AC13)root_temporary_residue_policy.py)を新たな enforcement/検出境界にはしないscripts/agent-guards/root_temporary_residue_policy.pyを一切変更しない(Allowed Paths 外).claude/tmp/session-recording/の production writer/consumer 契約(scripts/session-recording/bootstrap-source-bound-readiness.mjs/.claude/hooks/capture_scope_rollup_final_response.py)は本 PR の変更後も active に稼働し続けるdocs/dev/session-recording-policy.mdを一切変更しない(Allowed Paths 外・Out of Scope)。.claude/tmp/session-recording/は canonical/deprecated 区別の対象外の明示的な legacy exception として残るtmp/への段階的移行を扱うNotes
M4: Upgrade Loop (v0.4.x)の境界外(開発運用ツールの改善)