Repository navigation
Closed as not planned
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "初回 branch publish で remote branch 不在を検証可能な状態として扱い、head と Allowed Paths の整合が取れた場合だけ bounded branch publication を許可する"
change_kind: workflowParent Issue
なし
Parent Goal Ref
- Goal: impl-review-loop が初回 branch publish で安全ゲートを保ったまま Draft PR 作成まで進められるようにする。
- Desired Destination: 初回 publish を既存 remote head の欠落だけで停止せず、不在を明示検証する専用の fail-closed 判定を提供する。
Current Validated Scope
scripts/agent-guards/git_mutation_command_policy.pyはremote_readback_source: ls_remoteで remote branch が存在しないとpublish_guard_context_invalidを返す。- そのため、新規 branch の初回 publish は
PUBLISH_LANE_DECISION_V1 status: allow_retryを生成できない。 - Issue 実装: root preflight の bytecode cache 誤検知を防止する #1439 の実装済み branch がこの経路で停止した。既存 remote branch の更新規則と direct/force/tag/all/delete の deny は維持する必要がある。
Remaining Parent Gaps
なし。
Outcome
初回 branch 用の structured publish decision と回帰テストが追加され、remote branch 不在を証明でき、local/verified/declared head と Allowed Paths gate が一致する場合だけ bounded branch publication を許可できる状態。
In Scope
- 初回 branch 不在を表す closed な remote-readback 状態を policy に追加する。
- 初回 publish では expected/current remote head がともに branch-absent sentinel であり、local/verified/declared head と Allowed Paths gate が一致する場合だけ allow する。
- 既存 branch、head 不一致、remote readback 失敗、unknown sentinel、direct/force/tag/all/delete/mirror の deny は維持する。
- policy と failure hint、および関連 SSOT に初回 publish と通常 retry の差分を記録する。
- dedicated pytest regression を追加する。
Out of Scope
- Codex/Claude の permission model の変更。
- GitHub credential、OAuth、token scope の変更。
- force/tag/all/delete/mirror publish の許可。
- Issue 実装: root preflight の bytecode cache 誤検知を防止する #1439 の実装 branch の publish または PR 起票そのもの。
- command-structure classification(Issue 実装: PreToolUse の git push 判定を実行コマンド構造ベースに修正する #1428)と既存 remote branch の publish authorization(Issue 実装: PreToolUse remote_write_requires_approval を publish lane 証跡で通過可能にする #1408)の設計変更。
Runtime Verification Applicability
- decision: not_applicable
- reason: deterministic policy unit test と documentation check だけで完結し、実 GitHub remote への branch publication は検証として実行しない。
Acceptance Criteria
- AC1: remote branch 不在を表す closed sentinel と
ls_remotereadback を持つ初回 publish context で、expected/current が同じ sentinel、local/verified/declared head が一致し、Allowed Paths gate がokの場合だけ policy がallow_retryを返す。 - AC2: expected/current sentinel の片方だけが不在、unknown sentinel、remote readback failure、または head/Allowed Paths の不一致では
safety_stopと機械可読 reason を返す。 - AC3: 既存 remote branch の publish retry と direct/force/tag/all/delete/mirror の deny regression を維持する。
- AC4: initial publish と normal retry の input contract、postcondition、許可されない remote write を SSOT に記録する。
Verification Commands
# AC1
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-guards/tests/test_initial_branch_publish_policy.py -v
# AC2
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-guards/tests/test_initial_branch_publish_policy.py -v
# AC3
# baseline-expect: pass
$ uv run --locked pytest scripts/agent-guards/tests/test_git_mutation_command_policy.py -v
# AC4
$ rg -n "initial branch publish" docs/dev/workflow.md docs/dev/hook-boundaries.mdAllowed Paths
scripts/agent-guards/git_mutation_command_policy.pyscripts/agent-guards/hook_repair_hints.pyscripts/agent-guards/tests/test_initial_branch_publish_policy.pydocs/dev/workflow.mddocs/dev/hook-boundaries.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- remote branch 不在以外の remote state を初回 publish として許可する必要が生じた場合
- 実 GitHub remote への branch publication を automated verification として実行する必要が生じた場合
Required Skills
- Python / pytest
- Git refspec と remote ref safety policy
Required Design References
docs/dev/workflow.md#branch publish retry の safety stopdocs/dev/hook-boundaries.mddocs/dev/agent-skill-boundaries.md#Loop Sequencing & Preconditions- Issue 実装: PreToolUse remote_write_requires_approval を publish lane 証跡で通過可能にする #1408
- Issue 実装: root preflight の bytecode cache 誤検知を防止する #1439 の
PUBLISH_LANE_DECISION_V1safety stop evidence
Delivery Rule
1 Issue = 1 PR- dedicated worktree を使用する
- Draft PR を既定とする
- 実 GitHub remote への branch publication は verification command に含めない
Scope Delta
N/A
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity
squne121 commentedon Jul 11, 2026
OWNER裁定(#1449 issuecomment-4942998354)に基づき、本 Issue を #1449 にsupersedeします。
理由: remote branch状態のclassification(present/absent/probe_error)だけでは、新規branch初回作成を安全に完結できません。競合試験(race test)、compare-and-create primitive(empty-expect force-with-lease)、post-push readbackを一体で扱う必要があり、これらはすべて #1449 に統合されました。設計分割(本Issueと#1449への分離)は採用せず、#1449 が単一の実装契約として本Issueのscopeを包含します。
close reason: not planned(#1449 へ統合済み)
参照: