Repository navigation
feat: harden remote protocol Git builders - #2381
Conversation
Closes #2378 Co-Authored-By: Claude <[email protected]>
Preview URLPreview removed (PR #2381 closed). |
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Use Linux subreaper parentage to detect delayed setsid descendants after a successful Git leader exit and reject unavailable containment before spawning.\n\nCo-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
|
レビュー依頼可能な状態に更新しました。
|
敵対的レビュー結果判定: 対象は、2026年8月29日時点の current head 方向性そのもの、つまり「raw argvを廃止し、用途固定builder、固定fetch flags、OID読戻し、CAS削除、detached locked worktreeへ狭める」は妥当です。しかし、後続の#2197がこのAPIだけを使用する前提なので、以下は今の段階で直す必要があります。Issue #2378自身も、本PRを#2197のhard predecessorと定義しています。 P1-1: 一般的なGitHub SSH originをすべて拒否する
そのため、次の両方が拒否されます。 Git公式仕様では、SSH URLは これはセキュリティ上の特殊ケースではなく、SSHでcloneした利用者が通常経路で即座に停止する可用性バグです。後続#2197がobserved originをこのbuilderへ渡すなら、SSH clone環境ではprotocol全体が起動できません。 必須修正
P1-2: worktree作成後の検証失敗がlocked worktreeを残し、再試行不能になる
しかし、3の成功後に4または5が失敗した場合の補償処理がありません。 したがって、次のケースでlocked worktreeが残ります。
次回の再試行では、同じbuilderが 後続#2197はpublic closed builderだけを利用する契約であり、raw Gitによる任意cleanupを追加できません。このため「#2197側で後から対処する」は契約上成立しません。 必須修正 worktree builder内部でtransactional rollbackを所有してください。publicな汎用remove builderを追加する必要はありません。 added = False
try:
add_locked_worktree(...)
added = True
verify_head(...)
except BaseException:
if added:
remove_exact_worktree_force_twice(...)
verify_path_and_catalog_absent(...)
raise併せて、add後のreadback例外、deadline exhaustion、OID mismatchの3fixtureで、filesystemと P1-3:
|
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Summary
Issue #2378 の closed Git builder を、review
REQUEST_CHANGESの指摘に従い修正しました。任意 argv、可変 worktree action、caller 選択の fetch flag/refspec/private-ref 名は公開 surface にありません。ls-remote --get-urlの effective URL が literal と一致しない場合だけ fail-closed にします。無関係なinsteadOfと read/fetch に無関係なpushInsteadOfは拒否しません。--no-lazy-fetchcapability を一度だけ probe し、対応時は固定 global option を付与します。未対応の promisor/partial clone は fetch 前に fail-closed にします。refs/heads/内で Git ref component grammar に沿う+/Unicode を受理し、.lock、hidden component、//、..等を拒否します。worktree remove --force --forceを内部補償し、filesystem とworktree list --porcelainの両方で不在を確認します。/procobservation がNoneの場合を cleanup 成功と扱わず fail-closed にします。process supervisor は Linux/WSL の short-lived single-threaded child に限定します。finallyで削除し、repository を dirty にしません。Checks
Acceptance Criteria
以下のチェックは、current PR head
6a6612c40e5a21ab99041692e1ec778b49505875に束縛された CI のpython-test-core成功結果と、その JUnit artifact の scoped testcase 結果に基づきます。git ls-remote --exit-code --symref <literal-url> HEADと不正 URL 拒否を focused testcase で確認。Runtime Verification Evidence(動作検証証跡)
6a6612c40e5a21ab99041692e1ec778b49505875です。cirun 33233818174 はこの head に対して成功しました。python-test-corejob も成功し、parallel pytest lane は13460 passed, 60 skipped, 2 xfailedを記録しました。python-test-junitartifact(artifact id9709455383)には focused なtest_skill_runtime_control_plane_{exec,policy}.pyの testcase が 83 件あり、JUnit failure と error はともに 0 件です。typecheck、lint、test、buildも成功しました。ここには実行済みの CI 証跡だけを記録し、旧 head030afb3486251d1e7a43d93d953388c047eacd3aの local run を current-head 証跡として読み替えていません。030afb3486251d1e7a43d93d953388c047eacd3aを対象にしたvisual-impact-policy-trustedの stale-workflow-run rejection は、current-head CI 完了後に自動で解消されました。current-head のvisual-impact-policy-trustedCheckRun はSUCCESSであり、手動 CI rerun は実施していません。Schema Change Applicability
Schema Consumer Inventory
該当しません。schema change ではないため、consumer schema の before/after 差分はありません。
Safety Claim Matrix
| Claim | Implemented? | Not controlled | Evidence | Follow-up | 安全性確認用日本語注記 |
|---|---|---|---|---|
| Remote transport は validated literal のみを受理し、effective URL mismatch を fail-closed にします。 | yes | none | current head の focused 83 passed | none |
| Fetch は caller-selected private ref を受けず、unsupported promisor repository では lazy fetch を行いません。 | yes | none | current head の focused 83 passed | none |
| Post-add readback failure 後に locked worktree path と catalog entry を残しません。 | yes | none | current head の focused 83 passed | none |
| Unconfirmed final process observation を cleanup success と扱いません。 | yes | none | current head の focused 83 passed | none |
Notes
Issue #2378 を close します(Closes #2378)。