Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#733"
goal_ref: "M3: Loop MVP Gate — preparation / debrief の HUD 操作面を phase-aware contract として整理し、#738 の headless phase state machine を人間操作で進められるようにする"
change_kind: codeParent Issue
Parent Goal Ref
- Goal: M3: Loop MVP Gate (v0.3.x) として sortie 結果から報酬を獲得し progression snapshot を永続化して reload 後に復元する
- Desired Destination:
src/ui/HudController.tsとsrc/main.tsに、実装: sortie 後の debrief / preparation フェーズを導入する #738 のLoopPhaseを consumer として使う phase-aware HUD operation contract を導入し、Start sortie / Claim reward / Next sortie / Quick Load の操作面を安全に接続する
Current Validated Scope
src/ui/HudController.tsの現 action surface はQuick save/Reset sortieの 2 操作のみで、Start sortie/Claim reward/Next sortie/Quick Loadは未実装src/main.tsは Quick Save をloopPhase === preparationのときだけ許可しており、HUD action callback wiring owner であるsrc/state/GameState.tsとsrc/systems/SortieSystem.tsにはLoopPhase,claimPendingReward(),startSortie(),rewardClaimsの exactly-once ledger が既にあり、実装: sortie 後の debrief / preparation フェーズを導入する #738 の headless domain state machine は repo 現状で consumer 待ちであるtests/hud-controller.test.tsは hull 表示のみを検証しており、phase-aware button state / callback wiring を証明していないdocs/product/features/quick-save.mdとdocs/product/features/persistence.mdは Quick Save を progression-only snapshot と定義しており、reward persistence wiring や storage failure taxonomy の再定義はこの issue の責務外である- open な 整合: HUD action surface を TitleMenu / LoadMenu / Result phase 契約へ正規化する #771 は近接した narrower follow-up であり、実装着手前に canonical issue を 1 本へ正規化する必要がある
Remaining Parent Gaps
- Quick Save / Quick Load policy 本体と storage timing 制御は feat(#483): Quick Save を準備フェーズ限定に制限し Quick Load を実装する #619 / feat(#483): Quick Save ボタンの有効/無効表示と最小限のフィードバックを実装する #620 で扱う
- reward claim 後の progression snapshot 保存と reload 後復元は 実装: 報酬確定時に progression snapshot を localStorage へ保存する #739 で扱う
- sortie→reward→reload 復元の browser runtime E2E / playtest 証跡は 実装: M3 loop の sortie→reward→reload 復元を E2E / playtest で検証する #740 で扱う
Outcome
src/ui/HudController.ts と src/main.ts に、preparation / running / debrief_pending_reward / debrief_reward_claimed ごとの phase-aware HUD operation contract が追加される。具体的には Start sortie / Claim reward / Next sortie / Quick Load / Reset sortie の表示・enabled/disabled・フィードバック責務・LoopPhase 表示が明文化され、DOM 側でも disabled 属性で表現される。Claim feedback は in-memory claim success に限定され、persistence success と混同しない。HUD / interaction テストで phase/action matrix を検証でき、pnpm typecheck, pnpm lint, pnpm test, pnpm build が PR review 時に通る状態にする。
In Scope
src/ui/HudController.tsに Start sortie / Claim reward / Next sortie / Quick Load の action surface を追加するsrc/ui/HudController.tsにLoopPhaseの user-facing 表示とrole="status"またはaria-live="polite"の feedback 領域を追加するsrc/ui/HudController.tsで action の enabled/disabled を DOM のbutton.disabledとして表現するsrc/main.tsに Start / Claim / Next / Quick Load / Reset の thin callback wiring を追加し、実装: sortie 後の debrief / preparation フェーズを導入する #738 の consumer surface を接続するReset sortieの destructive boundary を明示し、少なくともpreparation以外では無効にするか、非破壊でないことを明確にした naming / feedback に固定する- Claim feedback を persistence feedback から分離し、実装: 報酬確定時に progression snapshot を localStorage へ保存する #739 実装前は in-memory claim success だけを示す
tests/hud-controller.test.tsと必要に応じて既存 HUD / sortie 系テストを更新し、phase/action matrix と disabled button no-op を検証する
Out of Scope
- 実装: sortie 後の debrief / preparation フェーズを導入する #738 の LoopPhase / reward-claim handoff 契約そのものの変更
- Quick Save / Quick Load policy 本体の再設計や storage timing の再定義
- storage failure taxonomy の変更、
LocalGameStorageadapter 実装変更、QuotaExceededError/SecurityErrorの新規分類 - reward persistence wiring や reload 後復元
- browser runtime E2E / playtest 証跡
src/ui/HudController.ts以外の広範な HUD redesign
Runtime Verification Applicability
- decision: deferred
- reason: 本 issue は DOM-side HUD 操作面と callback wiring の contract 整理が中心で、主要な correctness は typecheck / unit test / static review で検証できる。一方、browser runtime 上の実操作証跡と built
distの HTTP origin smoke は 実装: M3 loop の sortie→reward→reload 復元を E2E / playtest で検証する #740 の統合検証で初めて成立する。 - deferred_destination:
- destination_type: issue
- destination_ref: "実装: M3 loop の sortie→reward→reload 復元を E2E / playtest で検証する #740"
- deferred_verification_condition: preparation / debrief 各 phase で想定ボタンが browser runtime 上で正しく enabled/disabled となり、Start / Claim / Next の操作結果と user-facing phase copy が確認されていること
Acceptance Criteria
- AC1:
src/ui/HudController.tsにStart sortie/Claim reward/Next sortie/Quick Loadの action surface が追加される - AC2: HUD は
Preparation/Sortie running/Debrief: reward pending/Debrief: reward claimedの user-facingLoopPhase表示を持つ - AC3: phase/action matrix が本文と実装で一致し、
preparationでは Start と Quick Save / Quick Load、debrief_pending_rewardでは Claim、debrief_reward_claimedでは Next のみが有効になる - AC4:
runningでは Start / Claim / Next / Quick Save / Quick Load / Reset が無効で、DOM でもbutton.disabledが反映される - AC5:
Reset sortieは destructive boundary が明示され、少なくともpreparation外では無効または同等に安全な contract が固定される - AC6: Claim success feedback は in-memory claim success のみを示し、persistence success を示唆しない
- AC7: Quick Save / Quick Load failure feedback は既存 Result 分類を consumer として使い、失敗時に current state を破壊しない
- AC8: disabled button を操作しても callback は state mutation を起こさない
- AC9:
tests/hud-controller.test.tsを含む HUD / interaction 系テストが phase/action matrix を検証する - AC10:
pnpm typecheckが PR review 時に通る - AC11:
pnpm lintが PR review 時に通る - AC12:
pnpm testが PR review 時に通る - AC13:
pnpm buildが PR review 時に通る
Phase / Action Matrix
| Loop phase | Start sortie | Claim reward | Next sortie | Quick Save | Quick Load | Reset sortie |
|---|---|---|---|---|---|---|
preparation |
enabled | disabled | disabled | enabled | enabled when loadable; otherwise failure feedback only | enabled |
running |
disabled | disabled | disabled | disabled | disabled | disabled |
debrief_pending_reward |
disabled | enabled | disabled | disabled | disabled | disabled |
debrief_reward_claimed |
disabled | disabled | enabled | disabled unless explicitly justified in implementation review | disabled | disabled |
Verification Commands
# AC1
$ rg -n "Start sortie|Claim reward|Next sortie|Quick Load" src/ui/HudController.ts
# AC2
$ rg -n "Preparation|Sortie running|Debrief: reward pending|Debrief: reward claimed" src/ui/HudController.ts
# AC3
$ rg -n 'preparation.*Start sortie.*Quick Save.*Quick Load|debrief_pending_reward.*Claim reward|debrief_reward_claimed.*Next sortie' tests/hud-controller.test.ts
# AC4
$ rg -n 'running.*button\.disabled|button\.disabled.*running|toBeDisabled' tests/hud-controller.test.ts
# AC5
$ rg -n 'Reset sortie.*destructive boundary|destructive boundary.*Reset sortie|preparation.*Reset sortie|Reset sortie.*preparation' tests/hud-controller.test.ts
# AC6
$ rg -n "Reward claimed for this session|Persistence will be handled|already claimed|No pending reward" src/ui/HudController.ts src/main.ts tests/hud-controller.test.ts
# AC7
$ rg -n 'Quick Save failed|Quick Load failed|state unchanged|current state unchanged' src/main.ts src/ui/HudController.ts tests/hud-controller.test.ts
# AC8
$ rg -n 'toHaveBeenCalledTimes\(0\)|not\.toHaveBeenCalled|click\(\)' tests/hud-controller.test.ts
# AC9
$ pnpm test -- tests/hud-controller.test.ts tests/sortie-system.test.ts
# AC10
# preflight-scope: pr_review_only
$ pnpm typecheck
# AC11
# preflight-scope: pr_review_only
$ pnpm lint
# AC12
# preflight-scope: pr_review_only
$ pnpm test
# AC13
# preflight-scope: pr_review_only
$ pnpm buildAllowed Paths
src/ui/HudController.tssrc/main.tstests/hud-controller.test.tstests/main-loop.test.tstests/sortie-system.test.ts
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- 実装: sortie 後の debrief / preparation フェーズを導入する #738 の headless consumer 契約を変更しないと HUD callback wiring を成立できない場合
- feat(#483): Quick Save を準備フェーズ限定に制限し Quick Load を実装する #619 / feat(#483): Quick Save ボタンの有効/無効表示と最小限のフィードバックを実装する #620 / 実装: 報酬確定時に progression snapshot を localStorage へ保存する #739 / 実装: M3 loop の sortie→reward→reload 復元を E2E / playtest で検証する #740 の責務を同一 PR に押し込まないと acceptance を満たせない場合
- 整合: HUD action surface を TitleMenu / LoadMenu / Result phase 契約へ正規化する #771 との scope 重複を解消せずに着手すると canonical issue が不明瞭なままになる場合
Required Skills
- TypeScript / TSC strict
- DOM UI event wiring
- Accessibility-minded HUD state rendering
- Vitest BDD
Scope Delta(任意)
- feat(#483): Quick Save ボタンの有効/無効表示と最小限のフィードバックを実装する #620 は Quick Save ボタンの有効/無効表示と最小 feedback に集中しているため、本 issue では Start / Claim / Next / Quick Load を含む phase-aware operation contract へ寄せる
- 整合: HUD action surface を TitleMenu / LoadMenu / Result phase 契約へ正規化する #771 と scope が近接しているため、実装着手前に canonical issue をどちらに寄せるかを正規化する
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity
squne121 commentedon Jun 9, 2026
判定
#770 は方向性は妥当。ただし、現状のIssue本文のまま実装に入るのは危険です。
表面上は「Start / Claim / Next / Quick Load ボタンをHUDに足す」だけですが、実際には #733 の M3 Gate、#738 の loop phase FSM、#621 の storage failure Result契約、#739 の claim後永続化、#740 のE2E証跡にまたがっています。#733 は最終的に「sortie → reward → resources → localStorage snapshot → reload restore」と「reward exactly once」「storage failure no crash / no false success」「HTTP origin上のdist smoke」を要求しており、#770の現在のACだけではその境界を守り切れません。(GitHub)
敵対的レビュー
1. 最大の欠陥は「phase/action matrix」がIssue本文にないこと
#770 は #738 の headless FSM をHUDに露出するタスクで、
preparationでは Start、debrief_pending_rewardでは Claim、debrief_reward_claimedでは Next を追加する、という方向性を持っています。#738 側ではLoopPhase = preparation | running | debrief_pending_reward | debrief_reward_claimed、pending reward token、claim成功後の claimed 遷移、post-claim halt、next sortie reset preserving progression が明確化されています。(GitHub)しかし #770 は「Quick Save / Quick Load phase-derived enabled/disabled」と書くだけで、各phaseにおける全ボタンの許可・禁止を表にしていません。これは実装者にとって危険です。最低限、Issue本文に次を明記すべきです。
Loop phase | Start sortie | Claim reward | Next sortie | Quick Save | Quick Load | Reset sortie -- | -- | -- | -- | -- | -- | -- preparation | enabled | disabled | disabled | enabled | enabled if loadable / otherwise feedback failure | 要定義 running | disabled | disabled | disabled | disabled | disabled | 要定義 debrief_pending_reward | disabled | enabled | disabled | disabled | disabled | 原則 disabled debrief_reward_claimed | disabled | disabled | enabled | enabled or disabledを明示 | disabled推奨 | 要定義MDN上も
localStorage.setItem()は容量不足やユーザー拒否などでQuotaExceededErrorを投げ得ます。またlocalStorageは無効な origin、file:/data:、ユーザーポリシーなどでSecurityErrorになり得ます。つまり「UIで成功っぽく見えるが保存されていない」は普通に起きる前提で設計する必要があります。(MDN ウェブドキュメント)4. DOM上の disabled を実装しないと、E2Eもアクセシビリティも弱い
現行
HudControllerの action surface はonQuickSave()とonReset()だけで、ボタンも Quick save / Reset sortie の2つです。現行main.tsは Quick Save callback内でstate.loopPhase !== 'preparation'をguardしていますが、これは「クリックできるが内部で無視する」実装です。(GitHub)#770 では、内部guardだけでは不足です。HTMLButtonElement の
disabled属性を phase policy の一次表現にするべきです。MDNは disabled form control について、操作不可・focus不可・通常はクリックイベントを受けないものとして説明しています。Playwrightもlocator.click()前の actionability check で enabled を確認し、buttonの disabled 属性を enabled/disabled 判定に使います。(MDN ウェブドキュメント)つまり、テスト可能でユーザーにも明確な実装は次です。
さらに feedback は
textContentで更新し、innerHTMLに storage reason や error name を差し込まないこと。表示領域はrole="status"またはaria-live="polite"にするのが適切です。MDNはstatusrole を、focusを奪わずに advisory information を伝える live region と説明しています。(MDN ウェブドキュメント)5. #770 のVerificationがgrep中心なのは弱すぎる
#770 のVerificationは
rgでStart sortie、Claim reward、Next sortie、feedback文字列を探す手順が中心です。これは死んだコードでも通ります。DOMイベントが結線されているか、disabledがphaseで変わるか、Claimが一回しか適用されないか、Quick Load失敗時にstateが変わらないかを証明できません。(GitHub)しかも #770 の Allowed Paths は
src/ui/HudController.ts、src/ui/index.ts、src/main.tsに限定されています。つまりDOM unit testやintegration testを足せません。これはIssue設計として矛盾しています。HUDの操作面を追加するなら、最低でもtests/hud-controller.test.tsまたは既存UIテストの編集をAllowed Pathsに入れるべきです。(GitHub)追加すべきVerificationはこの程度です。
テスト観点は次を必須にしてください。
preparationでは Start / Quick Save / Quick Load が期待通り、Claim / Next がdisabled。runningでは Start / Claim / Next / Quick Save / Quick Load がdisabled。debrief_pending_rewardでは Claimだけenabled。debrief_reward_claimedでは Nextがenabled。disabled button をclickしても state が変わらない。
Claim成功後に resources が一度だけ増える。
same token の再Claimは no-op / already-claimed feedback。
Quick Load失敗時に current state を破壊しない。
Quick Save失敗時に成功表示を出さない。
6.
LoopPhaseの可視化がACにない#738 は
SortieStatusとLoopPhaseを分離しています。現行HudControllerは sortie status、kills、duration、result などを表示していますが、loop phase 自体の明示表示は見当たりません。(GitHub)これはUX上もテスト上も弱いです。
sortie.status = idleだけでは、ユーザーは「preparationなのか、reward claimed後の待機なのか、reset直後なのか」を判別できません。#770 のACに次を足すべきです。この表示があれば、#740 のE2Eでも role/text locator で確認しやすくなります。Playwright公式も、ユーザーが認識するroleやaccessible nameを使う locator を推奨しています。(Playwright)
7. 配布物・Preview確認が #770 では軽視されている
#770 は runtime verification を #740 に defer しています。しかし #773 のGitHub Actions bot comment では Preview URL が「publish requested」で、asset-level live check は未検証、Pages source設定後に有効化とされています。つまり、現時点の配布経路は「buildが通った」だけでは十分に信用できません。(GitHub)
Vite公式は、static deployment では通常
distがbuild outputで、vite previewはbuild済み成果物のローカルpreview用であり、本番サーバではないと説明しています。また GitHub Pages でhttps://<USERNAME>.github.io/<REPO>/に配布する場合はbase: '/<REPO>/'を設定する必要があります。(vitejs)#733 もHTTP origin上のbuilt dist smokeを要求しています。#621側でも
file://は unsupported と扱われ、HTTP origin runtime evidence は #733 に延期されています。(GitHub)したがって #770 のPRでは、少なくとも次をPR本文に要求すべきです。
確認項目は、単に画面が出ることではなく、built
dist上で HUD buttons が表示され、JS asset が404にならず、Start → running まで操作できることです。GitHub Pages preview があるなら、asset-level live check の結果もPR本文に残すべきです。Issue本文への具体的な修正案
#770 は次のように修正すると、実装者・レビュア・後続 #739/#740 が扱いやすくなります。
追加すべき In Scope
Add explicit HUD buttons:
Start sortie,Claim reward,Next sortie,Quick Load.Add phase-derived button policy table for all HUD actions, including existing
Reset sortie.Render current
LoopPhaseas user-facing HUD text.Use actual
button.disabled, not only callback guards.Add
role="status"/aria-live="polite"feedback region.Keep claim feedback separate from persistence feedback until 実装: 報酬確定時に progression snapshot を localStorage へ保存する #739.
Add DOM unit tests or integration tests for phase/action policy.
Add local
distsmoke via Vite preview or explicitly document why deferred to 実装: M3 loop の sortie→reward→reload 復元を E2E / playtest で検証する #740.追加すべき Out of Scope
No localStorage autosave after claim; this remains 実装: 報酬確定時に progression snapshot を localStorage へ保存する #739.
No reload-restore E2E proof; this remains 実装: M3 loop の sortie→reward→reload 復元を E2E / playtest で検証する #740.
No storage failure taxonomy changes; this remains 実装(M3): LocalGameStorage の例外境界と Result 契約を実装する #621/fix: harden local storage failure handling #765.
No new RewardSystem formula or ledger semantics; this remains 実装: SortieResult から報酬を算出する RewardSystem を追加する #737/feat(reward): add RewardSystem exactly-once claims #769.
追加すべき Acceptance Criteria
AC10: HUD displays current loop phase.
AC11: Every HUD button has an explicit enabled/disabled expectation for every
LoopPhase.AC12: Disabled actions are disabled in DOM and also guarded in callbacks.
AC13: Claim success copy does not imply persistence until 実装: 報酬確定時に progression snapshot を localStorage へ保存する #739 is implemented.
AC14: Quick Save / Quick Load failure feedback uses classified storage Result and does not mutate state on failed load.
AC15: Reset sortie behavior is explicitly defined; if destructive, it is disabled outside preparation or renamed as destructive.
AC16: DOM tests cover phase/action matrix.
AC17: Built
distis smoke-tested over HTTP origin, or the PR states that 実装: M3 loop の sortie→reward→reload 復元を E2E / playtest で検証する #740 is the first browser-runtime proof and links the blocker.最終判断
#770 は “ボタン追加Issue” としては危険で、 “phase-aware HUD operation contract” として書き直すべきです。
## 判定最も強い修正ポイントは、phase/action matrix、Resetの扱い、Claim feedbackとpersistence feedbackの分離、DOM disabled属性、grepではないテスト、built distのHTTP smokeです。これを入れれば、#738のheadless FSMを人間操作可能にするだけでなく、#733のM3 Gateに必要な no false success / exactly-once / runtime distribution evidence へ破綻なく接続できます。
#770 は方向性は妥当。ただし、現状のIssue本文のまま実装に入るのは危険です。
表面上は「Start / Claim / Next / Quick Load ボタンをHUDに足す」だけですが、実際には #733 の M3 Gate、#738 の loop phase FSM、#621 の storage failure Result契約、#739 の claim後永続化、#740 のE2E証跡にまたがっています。#733 は最終的に「sortie → reward → resources → localStorage snapshot → reload restore」と「reward exactly once」「storage failure no crash / no false success」「HTTP origin上のdist smoke」を要求しており、#770の現在のACだけではその境界を守り切れません。([GitHub]1)
敵対的レビュー
1. 最大の欠陥は「phase/action matrix」がIssue本文にないこと
#770 は #738 の headless FSM をHUDに露出するタスクで、
preparationでは Start、debrief_pending_rewardでは Claim、debrief_reward_claimedでは Next を追加する、という方向性を持っています。#738 側ではLoopPhase = preparation | running | debrief_pending_reward | debrief_reward_claimed、pending reward token、claim成功後の claimed 遷移、post-claim halt、next sortie reset preserving progression が明確化されています。([GitHub]2)しかし #770 は「Quick Save / Quick Load phase-derived enabled/disabled」と書くだけで、各phaseにおける全ボタンの許可・禁止を表にしていません。これは実装者にとって危険です。最低限、Issue本文に次を明記すべきです。
preparationrunningdebrief_pending_rewarddebrief_reward_claimed特に Reset sortie が未定義 なのは危険です。現行
main.tsのonReset()はcreateInitialGameState()に戻すため、resources や pending reward を破壊し得ます。#738 は「next sortie reset preserving progression」をACにしているので、HUD上の Reset が同じ見た目で進捗破壊を起こすなら、M3 Gateの証跡を汚します。([GitHub]3)2. #619 / #620 との責務重複が整理されていない
#770 は #620 を「Quick Save enabled/disabled/min feedback に限定」と扱っていますが、#620 自体は Quick Save disabled outside preparation と save success/failure feedback を含みます。さらに #619 は Quick Save / Quick Load を sortie 中に禁止し、save-scumを防ぐ phase-aware policy を扱っています。([GitHub]4)
このままだと、#770、#619、#620 が同じHUDボタン制御・feedback・Quick Load policy を別々に編集し、PR衝突か仕様二重化を起こします。敵対的に見るなら、#770 は実装Issueではなく「未整理な統合Issue」です。修正案は二択です。
1つ目は、#770 を「HUD phase operation surface の統合Issue」に昇格し、#619/#620 の該当スコープを明示的に吸収・close/obsolete すること。
2つ目は、#770 から Quick Save / Quick Load の policy と feedback を外し、Start / Claim / Next だけに絞ること。
現状の「#620は別、でも#770もQuick Save/Quick Loadを触る」という書き方はレビュー不能です。
3. “Claim success” の表示が #621 / #739 と衝突する
#770 のAC5は save/load/claim の success/failure feedback を要求しています。一方、#739 は「reward claim後に progression snapshot をlocalStorageへ保存し、reload後にresourcesを復元する」タスクで、#770では out of scope です。([GitHub]2)
ここで最も危険なのは、#770 の Claim ボタンが「Reward claimed」や「Saved」相当の成功表示を出してしまうことです。#621 は LocalGameStorage の失敗を Result として扱い、storage unavailable / SecurityError / QuotaExceededError / corrupt JSON / unsupported schema などを false success にしない契約を導入しています。([GitHub]5)
したがって #770 の Claim feedback は、#739 が入るまでは in-memory claim success と persistence success を絶対に混ぜるべきではありません。推奨コピーは次です。
Reward claimed for this session.Reward claimed. Persistence will be handled by autosave wiring.No pending reward to claim.Reward already claimed.Save failed: <classified reason>. Progress was not persisted.Load failed: <classified reason>. Current state unchanged.MDN上も
localStorage.setItem()は容量不足やユーザー拒否などでQuotaExceededErrorを投げ得ます。またlocalStorageは無効な origin、file:/data:、ユーザーポリシーなどでSecurityErrorになり得ます。つまり「UIで成功っぽく見えるが保存されていない」は普通に起きる前提で設計する必要があります。([MDN ウェブドキュメント]6)4. DOM上の disabled を実装しないと、E2Eもアクセシビリティも弱い
現行
HudControllerの action surface はonQuickSave()とonReset()だけで、ボタンも Quick save / Reset sortie の2つです。現行main.tsは Quick Save callback内でstate.loopPhase !== 'preparation'をguardしていますが、これは「クリックできるが内部で無視する」実装です。([GitHub]7)#770 では、内部guardだけでは不足です。HTMLButtonElement の
disabled属性を phase policy の一次表現にするべきです。MDNは disabled form control について、操作不可・focus不可・通常はクリックイベントを受けないものとして説明しています。Playwrightもlocator.click()前の actionability check で enabled を確認し、buttonの disabled 属性を enabled/disabled 判定に使います。([MDN ウェブドキュメント]8)つまり、テスト可能でユーザーにも明確な実装は次です。
さらに feedback は
textContentで更新し、innerHTMLに storage reason や error name を差し込まないこと。表示領域はrole="status"またはaria-live="polite"にするのが適切です。MDNはstatusrole を、focusを奪わずに advisory information を伝える live region と説明しています。([MDN ウェブドキュメント]9)5. #770 のVerificationがgrep中心なのは弱すぎる
#770 のVerificationは
rgでStart sortie、Claim reward、Next sortie、feedback文字列を探す手順が中心です。これは死んだコードでも通ります。DOMイベントが結線されているか、disabledがphaseで変わるか、Claimが一回しか適用されないか、Quick Load失敗時にstateが変わらないかを証明できません。([GitHub]2)しかも #770 の Allowed Paths は
src/ui/HudController.ts、src/ui/index.ts、src/main.tsに限定されています。つまりDOM unit testやintegration testを足せません。これはIssue設計として矛盾しています。HUDの操作面を追加するなら、最低でもtests/hud-controller.test.tsまたは既存UIテストの編集をAllowed Pathsに入れるべきです。([GitHub]2)追加すべきVerificationはこの程度です。
テスト観点は次を必須にしてください。
preparationでは Start / Quick Save / Quick Load が期待通り、Claim / Next がdisabled。runningでは Start / Claim / Next / Quick Save / Quick Load がdisabled。debrief_pending_rewardでは Claimだけenabled。debrief_reward_claimedでは Nextがenabled。6.
LoopPhaseの可視化がACにない#738 は
SortieStatusとLoopPhaseを分離しています。現行HudControllerは sortie status、kills、duration、result などを表示していますが、loop phase 自体の明示表示は見当たりません。([GitHub]10)これはUX上もテスト上も弱いです。
sortie.status = idleだけでは、ユーザーは「preparationなのか、reward claimed後の待機なのか、reset直後なのか」を判別できません。#770 のACに次を足すべきです。この表示があれば、#740 のE2Eでも role/text locator で確認しやすくなります。Playwright公式も、ユーザーが認識するroleやaccessible nameを使う locator を推奨しています。([Playwright]11)
7. 配布物・Preview確認が #770 では軽視されている
#770 は runtime verification を #740 に defer しています。しかし #773 のGitHub Actions bot comment では Preview URL が「publish requested」で、asset-level live check は未検証、Pages source設定後に有効化とされています。つまり、現時点の配布経路は「buildが通った」だけでは十分に信用できません。([GitHub]12)
Vite公式は、static deployment では通常
distがbuild outputで、vite previewはbuild済み成果物のローカルpreview用であり、本番サーバではないと説明しています。また GitHub Pages でhttps://<USERNAME>.github.io/<REPO>/に配布する場合はbase: '/<REPO>/'を設定する必要があります。([vitejs]13)#733 もHTTP origin上のbuilt dist smokeを要求しています。#621側でも
file://は unsupported と扱われ、HTTP origin runtime evidence は #733 に延期されています。([GitHub]1)したがって #770 のPRでは、少なくとも次をPR本文に要求すべきです。
確認項目は、単に画面が出ることではなく、built
dist上で HUD buttons が表示され、JS asset が404にならず、Start → running まで操作できることです。GitHub Pages preview があるなら、asset-level live check の結果もPR本文に残すべきです。Issue本文への具体的な修正案
#770 は次のように修正すると、実装者・レビュア・後続 #739/#740 が扱いやすくなります。
追加すべき In Scope
Start sortie,Claim reward,Next sortie,Quick Load.Reset sortie.LoopPhaseas user-facing HUD text.button.disabled, not only callback guards.role="status"/aria-live="polite"feedback region.distsmoke via Vite preview or explicitly document why deferred to 実装: M3 loop の sortie→reward→reload 復元を E2E / playtest で検証する #740.追加すべき Out of Scope
追加すべき Acceptance Criteria
LoopPhase.distis smoke-tested over HTTP origin, or the PR states that 実装: M3 loop の sortie→reward→reload 復元を E2E / playtest で検証する #740 is the first browser-runtime proof and links the blocker.最終判断
#770 は “ボタン追加Issue” としては危険で、 “phase-aware HUD operation contract” として書き直すべきです。
最も強い修正ポイントは、phase/action matrix、Resetの扱い、Claim feedbackとpersistence feedbackの分離、DOM disabled属性、grepではないテスト、built distのHTTP smokeです。これを入れれば、#738のheadless FSMを人間操作可能にするだけでなく、#733のM3 Gateに必要な no false success / exactly-once / runtime distribution evidence へ破綻なく接続できます。
squne121 commentedon Jun 9, 2026
issue-refinement-loop: iteration 1 完了
LoopPhase表示、Reset sortieの boundary、Claim feedback と persistence feedback の分離、tests/を含む Allowed Paths を反映しました。uv run python3 .claude/skills/review-issue/scripts/check_issue_contract.py --file tmp/issue-770-body.md --json→verdict: approveuv run python3 .claude/skills/issue-contract-review/scripts/contract_readiness_check.py --body-file tmp/issue-770-body.md --mode static→status: gosqune121 commentedon Jun 9, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approvedsqune121 commentedon Jun 9, 2026
› 作業ごとにサブエージェントを使って。
#770 (comment)
を対象に issue-refinement-loop を人間承認不要で行って。
• 対象は Issue #770 の指定コメントを一次ソースにして、issue-refinement-loop を人間承認なしで
最後まで回す作業として進めます。まず関連 skill とメモリを最小限読み、次に GitHub 上の
issue/comment と repo 側の validator/RTK 導線を確認して、作業単位ごとにサブエージェントを
切って進めます。
• Ran rtk --help
└ A high-performance CLI proxy designed to filter and summarize system outputs before they
reach your LLM context.
… +83 lines (ctrl + t to view transcript)
-V, --version
Print version
• Explored
└ Search issue-refinement-loop|issue 770|770 in MEMORY.md
Read SKILL.md (issue-refinement-loop skill)
────────────────────────────────────────────────────────────────────────────────────────────
• skill と過去事例の当たりを取りました。次は Issue/コメントの現物取得、planner 実行、必要な
ら参照ドキュメントを補足しつつ、調査・レビュー・書き換えをそれぞれ別サブエージェントに割り
当てる導線を作ります。
• Explored
└ Read 2026-06-07T06-00-12-usST-issue_refinement_loop_736_anchor_comment_refinement.md
• Ran rtk gh issue view 770 --comments
└ author: squne121
association: owner
… +212 lines (ctrl + t to view transcript)
Static Site | Vite"
--
────────────────────────────────────────────────────────────────────────────────────────────
• サブエージェント機能を有効に確認できたので、ここからは main がオーケストレーション、子が
「調査」「レビュー」「書き換え案」の分担で進めます。まず live issue/comment と project
read-order を揃えたうえで planner を回します。
• Explored
└ Read CLAUDE.md
• Ran python3 .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py --help
└ {
"schema_version": "refinement_loop_plan/v1",
… +44 lines (ctrl + t to view transcript)
}
}
────────────────────────────────────────────────────────────────────────────────────────────
• アンカーコメント本文は取得でき、論点はかなり具体的でした。ここから main は live issue と
validator を扱い、並列で「repo 実態調査」「contract review」を子に投げて、私は planner 入
力と rewrite ルートを固めます。
• Spawned 019ead2e-5482-7ae0-b53c-6eb4520691a4 (gpt-5.4-mini medium)
└ 対象: /home/squne/projects/LOOP_PROTOCOL の Issue #770 refinement loop 支援。read-only
で、anchor comment の主張が repo 現状とどう対応するかだけ調べてください。重点: src/ui/
HudController.ts, ...
• Spawned 019ead2e-68f0-7e11-aca8-2b4fd2659cf9 (gpt-5.4-mini medium)
└ 対象: /home/squne/projects/LOOP_PROTOCOL の Issue #770 refinement loop 支援。read-only
で live issue body と anchor comment https://github.com/squne121/loop-protocol...
• Explored
└ Read project-constitution.md, plan_refinement_loop.py
• Ran rtk gh issue view 770
└ [open] Issue #770: 実装: preparation / debrief の HUD 操作面を追加する
Author: @squne121
… +124 lines (ctrl + t to view transcript)
- #620 は Quick Save ボタンの enabled/disabled と最小 feedback に限定されるため、
Start / Claim / Next sortie を含む phase 操作面は本 issue に分離する
• Explored
└ Read runtime-verification-policy.md, github-ops.md
Search REFINEMENT_LOOP_PLANNER_INPUT_V1|known_context|anchor_comment in issue-
refinement-
loop
────────────────────────────────────────────────────────────────────────────────────────────
• planner の input schema と runtime policy も確認できました。現行 issue は
deferred_destination の構造や VC 形式が policy に対して怪しいので、まず planner と
contract checker が何をブロックするかを機械的に出してから、子の調査結果を合流させます。
• Explored
└ Read refinement-loop-plan-output.md
• Ran uv run python3 .claude/skills/review-issue/scripts/check_issue_contract.py --issue 770
│ --repo squne121/loop-protocol --json
└ {
"verdict": "needs-fix",
… +26 lines (ctrl + t to view transcript)
"parsed_vc_commands": []
}
• Ran mkdir -p tmp && rtk run 'gh issue view 770 --repo squne121/loop-protocol --json
│ body,comments > tmp/issue-770.json && cat tmp/issue-770.json'
└ {"body":"## Machine-Readable Contract\n\n```yaml\ncontract_schema_version:
v1\nissue_kind: implementation\nparent_issue: "#733"\ngoal_ref: "M3: Loop MVP Gate —
… +448 lines (ctrl + t to view transcript)
se,"minimizedReason":"","reactionGroups":[],"url":"https://github.com/squne121/loop-prot
ocol/issues/770#issuecomment-4661745457","viewerDidAuthor":true}]}
────────────────────────────────────────────────────────────────────────────────────────────
• 機械判定では、現行本文はまず Verification Commands が実行形式になっておらず needs-fix で
す。アンカーコメントの scope correction を反映するだけでなく、validator が通る書式まで直す
必要があるので、いま rewrite 本文を組み立てています。
• Waiting for 2 agents
└ 019ead2e-5482-7ae0-b53c-6eb4520691a4
019ead2e-68f0-7e11-aca8-2b4fd2659cf9
• Finished waiting
└ No agents completed yet
• Explored
└ Read HudController.ts, main.ts
List tests
Read hud-controller.test.ts
Search loopPhase|claim|prepareNextSortie|startSortie|RewardSystem|pending reward|debrief
in
src
────────────────────────────────────────────────────────────────────────────────────────────
• repo 現状を見ると、アンカーコメントの「Reset 未定義」「DOM disabled 必須」「テスト許可が狭
すぎる」はそのまま本文に落とす価値があります。次は issue-author に全文ドラフトを作らせ、
main が validator で締めます。
• Spawned 019ead2f-e54d-7320-bc42-0a8adf886b0f (gpt-5.4-mini xhigh)
└ 対象: /home/squne/projects/LOOP_PROTOCOL の Issue #770。anchor comment
#770 (comment)
を一次ソースに、現行 is...
• Ran rtk run 'python3 - <<"PY"
│ import json
│ from pathlib import Path
│ … +23 lines
└ tmp/issue-770-planner-input.json
{
… +61 lines (ctrl + t to view transcript)
}
}
• Waiting for 3 agents
└ 019ead2e-5482-7ae0-b53c-6eb4520691a4
019ead2e-68f0-7e11-aca8-2b4fd2659cf9
019ead2f-e54d-7320-bc42-0a8adf886b0f
• Finished waiting
└ No agents completed yet
────────────────────────────────────────────────────────────────────────────────────────────
• planner は fail-closed ではなく、Step 1 の repo fact-check が必須という結果でした。子エー
ジェントの返答待ちの間に本文の骨格は固まってきたので、戻り次第 validator を通して live
issue へ反映します。
• Waiting for 3 agents
└ 019ead2e-5482-7ae0-b53c-6eb4520691a4
019ead2e-68f0-7e11-aca8-2b4fd2659cf9
019ead2f-e54d-7320-bc42-0a8adf886b0f
• Finished waiting
└ 019ead2e-68f0-7e11-aca8-2b4fd2659cf9: Completed - REVIEW_ISSUE_RESULT_V1 verdict:
needs-fixblockers: -VC_FORMAT_AND_STRENGTH:check_issue_contractでC4_vc_commands_present = failです。Verification Commands が canonical なbashfencedblock +
$ <command>形式になっておらず、さらに `contract...• Waiting for 2 agents
└ 019ead2e-5482-7ae0-b53c-6eb4520691a4
019ead2f-e54d-7320-bc42-0a8adf886b0f
• Finished waiting
└ 019ead2e-5482-7ae0-b53c-6eb4520691a4: Completed - CODEBASE_INVESTIGATION_RESULT_V1
status: ok 1. confirmed_claims -
src/ui/HudController.tsは現状Quick save/Reset sortieだけを持ち、Start sortie/Claim reward/Next sortie/Quick Loadのaction surface はまだありません。
Sortie Status...• Waiting for 019ead2f-e54d-7320-bc42-0a8adf886b0f
• Finished waiting
└ No agents completed yet
• Explored
└ Read sortie.md, quick-save.md
• Ran rtk gh issue view 771
└ [open] Issue #771: 実装: preparation / debrief phase の HUD action surface を最小導入す
る
… +138 lines (ctrl + t to view transcript)
- reward persistence wiring (#739) と browser runtime verification (#740) は
out-of-scope
• Ran python3 .claude/scripts/contract_readiness_check.py --help
└ python3: can't open file '/home/squne/projects/LOOP_PROTOCOL/.claude/scripts/
contract_readiness_check.py': [Errno 2] No such file or directory
• Explored
└ List .claude
────────────────────────────────────────────────────────────────────────────────────────────
• 本文の方向性は二点です。アンカーコメントの修正要求をそのまま contract に落としつつ、現
repo reality として tests/ 解禁と #771 との重複注意を入れ、validator が落ちる VC 形式も直
します。
• PreToolUse hook (blocked)
feedback: CODEX_ALLOWED_PATHS is not set. Declare allowed paths per Issue contract or set
CODEX_LEGACY_ALLOW_WRITES=1 to opt out.
• Ran CODEX_LEGACY_ALLOW_WRITES=1 rtk run 'cat <<"EOF" > tmp/issue-770-body.md
│ ## Machine-Readable Contract
│
│ … +224 lines
└ 10232 tmp/issue-770-body.md
• Ran uv run python3 .claude/skills/issue-contract-review/scripts/
│ contract_readiness_check.py --issue-file tmp/issue-770-body.md --mode static
└ usage: contract_readiness_check.py [-h] [--body-file BODY_FILE]
[--issue ISSUE] [--repo REPO]
[--mode {static,preflight-static,execute}]
contract_readiness_check.py: error: unrecognized arguments: --issue-file tmp/
issue-770-body.md
• Ran uv run python3 .claude/skills/review-issue/scripts/check_issue_contract.py --file tmp/
│ issue-770-body.md --json
└ {
"verdict": "approve",
… +166 lines (ctrl + t to view transcript)
]
}
────────────────────────────────────────────────────────────────────────────────────────────
• 本文ドラフト自体は check_issue_contract.py を通過しました。残るのは readiness 側の静的
チェックと、live issue への反映、それから change log / termination report の投稿です。
• Ran python3 - <<'PY'
│ from pathlib import Path
│ text = Path('tmp/issue-770-body.md').read_text()
│ … +4 lines
└ 20 ## Current Validated Scope
39 ## In Scope
• Ran uv run python3 .claude/skills/issue-contract-review/scripts/
│ contract_readiness_check.py --body-file tmp/issue-770-body.md --mode static
└ {
"schema": "ISSUE_CONTRACT_READINESS_RESULT_V1",
… +13 lines (ctrl + t to view transcript)
"fix_hint": null
}
• Explored
└ Read publish_termination_report.py
Search change log|CHANGE_LOG|LOOP_HANDOFF_RESULT_V1|termination_reason in issue-
refinement-
loop
Read termination-policy.md, render_termination_report.py
────────────────────────────────────────────────────────────────────────────────────────────
• validator は approve、readiness も status: go まで確認できました。これから live issue 本文
を更新し、その変更内容をコメントで残してから、termination report を publish して loop を閉
じます。
• Ran rtk run 'wc -c tmp/issue-770-body.md
│ if [ "$(wc -c < tmp/issue-770-body.md)" -le 1 ]; then echo bad body-file >&2; exit 1; fi
│ if grep -Pn '\(?:"|$)' tmp/issue-770-body.md; then echo escape contamination >&2;
│ … +2 lines
└ /bin/bash: -c: line 3: syntax error near unexpected token
(' /bin/bash: -c: line 3:if grep -Pn '\(?:"|$)' tmp/issue-770-body.md; then echoescape contamination >&2; exit 1; fi'
• Ran rtk run 'python3 - <<"PY"
│ from pathlib import Path
│ p = Path("tmp/issue-770-body.md")
│ … +9 lines
Updating 1 issues ⢿
Updating 1 issues ⣟
#770
• Ran CODEX_LEGACY_ALLOW_WRITES=1 rtk run 'cat <<"EOF" > tmp/issue-770-refinement-comment.md
│ ## issue-refinement-loop: iteration 1 完了
│
│ … +15 lines
└ #770 (comment)
• Ran rtk run 'cat <<"EOF" > tmp/issue-770-termination-input.json
│ {
│ "termination_reason": "approved",
│ … +8 lines
└ [publish_termination_report] comment posted for issue #770
• Ran rtk gh issue view 770
└ [open] Issue #770: 実装: preparation / debrief の HUD 操作面を追加する
Author: @squne121
… +174 lines (ctrl + t to view transcript)
- #771 と scope が近接しているため、実装着手前に canonical issue をどちらに寄せるか
を正規化する
• Ran rtk gh issue view 770 --comments
└ author: squne121
association: owner
… +238 lines (ctrl + t to view transcript)
• Closed 019ead2e-5482-7ae0-b53c-6eb4520691a4
• Closed 019ead2e-68f0-7e11-aca8-2b4fd2659cf9
• Closed 019ead2f-e54d-7320-bc42-0a8adf886b0f
────────────────────────────────────────────────────────────────────────────────────────────
• loop は approved で閉じられる状態まで到達しました。最後に live issue / コメント反映を確認
し、メモリ参照の出典行だけ取ってから完了報告します。
• Explored
└ Read MEMORY.md, 2026-06-07T06-00-12-usST-
issue_refinement_loop_736_anchor_comment_refinement.md
────────────────────────────────────────────────────────────────────────────────────────────
• Issue #770 に対して、指定コメントを一次ソースに issue-refinement-loop を人間承認なしで完了
しました。作業ごとにサブエージェントを使い、調査・contract review・rewrite 支援を分担させ
たうえで、main 側で planner、validator、GitHub 反映まで進めています。
更新内容は、phase/action matrix の追加、LoopPhase の user-facing 表示、Reset sortie の
boundary 明確化、Claim feedback と persistence feedback の分離、tests/ を含む Allowed
Paths、$ ... 形式の Verification Commands への修正です。さらに live issue 本文更新後、
change-log コメントも投稿し、termination report も publish 済みです。
検証結果は次のとおりです。
補足として、repo reality 上の #771 との近接重複も本文に明記し、canonical issue 正規化を
Stop Condition / Scope Delta に入れました。
─ Worked for 9m 33s ────────────────────────────────────────────────────────────────────────
╭─────────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.138.0) │
│ │
│ model: gpt-5.4 low /model to change │
│ directory: ~/projects/LOOP_PROTOCOL │
│ permissions: YOLO mode │
╰─────────────────────────────────────────────╯
Tip: Use /mcp to list configured MCP tools.
Token usage: total=230,246 input=215,742 (+ 3,737,216 cached) output=14,504 (reasoning
2,134)
To continue this session, run codex resume 019ead20-c9d7-7fb3-89e4-819ff0baaaf2
squne121 commentedon Jun 9, 2026
Contract Review: BLOCKED (2026-06-09T16:48:57Z)
不足項目
unexpected_passとなり、既存コード断片や既存テスト断片にヒットして差分証明になっていません。rgの search path が広すぎるためbroad_search_path_unboundedで blocked です。Allowed Paths 内のより狭い path へ絞る必要があります。推奨アクション
issue-refinement-loopの起動を推奨します。AC3 / AC4 / AC5 / AC7 / AC8 の Verification Commands を、既存実装や無関係テスト断片で通らない narrower command に修正してください。squne121 commentedon Jun 9, 2026
Contract Snapshot (2026-06-10T00:00:00Z)
RUN v4.1.6 /home/squne/projects/LOOP_PROTOCOL
Test Files 21 passed (21)
Tests 474 passed (474)
Start at 02:06:50
Duration 3.82s (transform 2.88s, setup 0ms, import 4.02s, tests 10.73s, environment 1.28s)
/home/squne/projects/LOOP_PROTOCOL/.claude/skills/.system/openai-docs/scripts/fetch-codex-manual.mjs
37:26 error 'AbortController' is not defined no-undef
38:19 error 'setTimeout' is not defined no-undef
42:5 error 'clearTimeout' is not defined no-undef
175:7 error 'fetch' is not defined no-undef
539:5 error 'console' is not defined no-undef
586:5 error 'console' is not defined no-undef
589:7 error 'console' is not defined no-undef
591:5 error 'console' is not defined no-undef
592:5 error 'console' is not defined no-undef
593:5 error 'console' is not defined no-undef
/home/squne/projects/LOOP_PROTOCOL/.claude/skills/.system/openai-docs/scripts/resolve-latest-model-info.js
3:12 error A
require()style import is forbidden @typescript-eslint/no-require-imports3:12 error 'require' is not defined no-undef
4:14 error A
require()style import is forbidden @typescript-eslint/no-require-imports4:14 error 'require' is not defined no-undef
12:13 error 'process' is not defined no-undef
13:14 error 'process' is not defined no-undef
32:28 error 'URL' is not defined no-undef
39:26 error 'fetch' is not defined no-undef
108:14 error 'URL' is not defined no-undef
131:41 error 'process' is not defined no-undef
139:3 error 'process' is not defined no-undef
145:3 error 'console' is not defined no-undef
146:3 error 'process' is not defined no-undef
✖ 23 problems (23 errors, 0 warnings)
[ELIFECYCLE] Command failed with exit code 1.,
RUN v4.1.6 /home/squne/projects/LOOP_PROTOCOL
Test Files 21 passed (21)
Tests 474 passed (474)
Start at 02:06:58
Duration 5.81s (transform 9.08s, setup 0ms, import 13.00s, tests 19.00s, environment 2.59s), vite v8.0.13 building client environment for production...
�[2K
transforming...✓ 32 modules transformed.
rendering chunks...
computing gzip size...
dist/index.html 0.46 kB │ gzip: 0.30 kB
dist/assets/index-CCYduZ47.css 2.72 kB │ gzip: 1.25 kB
dist/assets/index-CAd8IfGu.js 27.35 kB │ gzip: 9.51 kB
✓ built in 85ms)
Allowed Paths:
squne121 commentedon Jun 9, 2026
Contract Snapshot (2026-06-10T00:00:00Z)
squne121 commentedon Jun 9, 2026
以下の方針がよいです。
このケースは 「secret-revealing の検知がおかしい」だけではなく、
git pushという remote write / destructive 相当の操作と、secret-revealing 操作を同じPreToolUseメッセージで潰している UX・分類設計の問題として切るのが妥当です。ログ上も、止まったのはrtk git push -u origin worktree-issue-770-phase-aware-hud-operation-contractの publish 段階で、secret を読むコマンドではありません。Issue案
Title
PreToolUseguard が remote write と secret-revealing を同一ブロック理由で表示し、git pushの publish 手順を不明瞭に停止するProblem
impl-review-loopの publish 段階で、実装・検証・commit までは完了しているにもかかわらず、以下のような通常の branch publish コマンドがPreToolUse: destructive or secret-revealing command blockedで停止した。このコマンドは remote repository を変更するため destructive / remote write として扱われる可能性は理解できる。しかし、secret を読み取る・表示する・送信する処理ではないため、
secret-revealingと同列のエラー表示になるのは誤解を招く。結果として、利用者・エージェント双方が以下を判断できない。
Actual Behavior
git push実行時に、以下のような包括メッセージだけで停止する。このため、secret を扱っていない場面でも secret leakage を疑わせる表示になる。
Expected Behavior
PreToolUseguard は、少なくとも以下のように reason code を分離して返すべき。例:
secret 関連の検知が発火していない場合、
secret-revealingという文言は出さない。Scope
対象は
PreToolUseguard の分類・表示・許可フロー。最低限、以下を分離する。
secret_revealingdestructive_localremote_writecredential_exfiltration_riskunknown_high_riskpolicy_requires_approvalAcceptance Criteria
AC1: reason code の分離
git pushが止まる場合は、secret_revealingではなくremote_writeまたはremote_write_requires_approvalと表示される。AC2: secret detector の発火有無を明示
secret 検知が発火していない場合、エラーに
secret-revealingを含めない。例:
AC3: block 対象コマンドの安全な要約を表示
ブロックされたコマンドを、secret redaction 済みで表示する。
例:
AC4: workflow 側が機械判定できる構造化出力
human-readable message だけでなく、machine-readable な payload を返す。
例:
{ "blocked": true, "category": "remote_write", "reason_code": "remote_write_requires_approval", "secret_detection": "not_triggered", "command_kind": "git_push", "suggested_action": "request_publish_approval" }AC5: publish 用の narrow approval path
impl-review-loopのように、すでに以下を満たしている場合は、branch publish だけを narrow に許可できる。status: go許可例:
禁止例:
AC6: blocked 時の remediation を明示
単に block するのではなく、次の行動を出す。
例:
Reproduction
impl-review-loopで issue implementation を進める。PreToolUse: destructive or secret-revealing command blockedが返る。Proposed Fix
PreToolUseguard の判定結果を単一の包括文言に潰さず、内部分類をそのまま表に出す。推奨分類:
git push系はさらに細分化する。今回のケースは、おそらく以下になるべき。
{ "category": "remote_write", "reason_code": "remote_write_requires_approval", "git_push_risk": "publish_new_branch", "secret_detection": "not_triggered" }Out of Scope
この Issue では、guard の全面無効化は扱わない。
以下は out-of-scope。
git push --forceの許可Security Notes
git pushは secret-revealing ではないが、remote state を変更するため high-risk command ではある。したがって、改善すべき点は「無条件に通す」ことではなく、以下の2点。Suggested Labels
bugdeveloper-experiencesecurityworkflowpretooluseagent-runtime追加で切るなら、別Issue
上のIssueに全部入れてもよいですが、分けるならこうです。
Issue 1: 表示・分類バグ
Title:
PreToolUseblock message should distinguishremote_writefromsecret_revealing目的は、今回の「secret を扱っていないのに secret-revealing と表示される」問題を直すこと。
Issue 2: publish workflow 改善
Title: Add narrow approval path for non-force issue branch publish in
impl-review-loop目的は、
impl-review-loopが commit 済み・検証済みの branch を publish する段階で、git push -u origin <issue-branch>だけを安全に進められるようにすること。この2分割の方がレビューしやすいです。最初に直すべきは Issue 1 です。今回の混乱の根本は、block したこと自体より、block reason が不正確なことです。
test: strengthen AC4 verification evidence (#770)
fix: tighten claim reward hud guards (#770)
feat: add phase-aware HUD controls (#770) (#782)