Repository navigation
Closed
Labels
area/ai-opsAI operations and agent tooling areaarea/securitySecurity areakind/implementationImplementation issue
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#378"
goal_ref: "manifest:check の production gate topology を確定し、producer artifact path の fail-closed validation を追加する"
change_kind: workflowParent Issue
Parent Goal Ref
- Goal:
pnpm manifest:checkの CI coverage を pre-gate(docs/schemas/examples + tests/fixtures)から production gate(producer artifact)まで拡張する - Desired Destination: 実装: agent_session_manifest producer output の schema validation gate (pnpm manifest:check) を追加する #378 の scope — pre-gate と production gate を合わせた manifest:check coverage が CI に確立されること
Current Validated Scope
- 現行 producer output を棚卸しし、以下を区別する
- GitHub Actions producer output:
artifacts/agent-session-manifest-ci.json - Claude hook wrapper output: 実装上の private artifact path/pattern(本 Issue は GitHub Actions 側のみ対象)
- docs/schemas/examples static examples(既存 pre-gate 対象)
- tests/fixtures validation fixtures(既存 pre-gate 対象)
- GitHub Actions producer output:
- production gate の正本を A案(
session-manifest.ymlの生成直後 explicit validation を正本として維持)に決定する scripts/check-agent-session-manifests.mjsの defaultPatterns にartifacts/agent-session-manifest-ci.jsonを追加する- 存在しない glob が default-empty exit 0 で silent no-op にならないよう、production artifact path には explicit target validation または file existence assertion を置く
- 採択した topology(A案)と upload constraints を
scripts/check-agent-session-manifests.mjsのコメントに明示する - artifact upload は
permissions: contents: read,pull_request_target不使用,secrets.*不使用,retention-days: 7,if-no-files-found: errorを維持する
Remaining Parent Gaps
なし(#378 の production gate 追加は本 Issue で完結する)
Outcome
production artifact artifacts/agent-session-manifest-ci.json が scripts/check-agent-session-manifests.mjs の defaultPatterns に追加され、production gate topology(A案: session-manifest.yml を正本とする)がコメントに明示され、存在しない glob による silent no-op が排除されている状態
In Scope
scripts/check-agent-session-manifests.mjsの defaultPatterns にartifacts/agent-session-manifest-ci.jsonを追加する- production gate topology(A案:
session-manifest.yml生成直後の explicit validation を正本とし、ci.ymlは production gate を主張しない)をscripts/check-agent-session-manifests.mjsのコメントに明示する - upload constraints(
if-no-files-found: error,retention-days: 7,pull_request_target不使用,secrets.*不使用)をscripts/check-agent-session-manifests.mjsのコメントに明示する - 存在しない glob が silent no-op にならないよう、production artifact path に explicit target validation または file existence assertion を置く
- artifact upload が
permissions: contents: read,pull_request_target不使用,secrets.*不使用,retention-days: 7,if-no-files-found: errorを維持することを確認する
Out of Scope
- producer 本体実装 / hook wiring / artifact 生成(実装: agent_session_manifest/v1 producer を .claude/settings.json hooks と .github/workflows で自動 invoke する #402 / PR feat(#402): wire agent_session_manifest/v1 producer to hooks and CI #426)
scripts/check-agent-session-manifests.mjsの validator / extractor ロジック変更- Claude hook wrapper output の独立 production gate(本 Issue では GitHub Actions producer のみ対象)
ci.ymlへの producer artifact generation step 追加(A案採用のため不要)
Acceptance Criteria
- AC1:
scripts/check-agent-session-manifests.mjsの defaultPatterns にartifacts/agent-session-manifest-ci.jsonが追加されている - AC2:
scripts/check-agent-session-manifests.mjs内でartifacts/agent-session-manifest-ci.jsonへの参照と現行 workflow の生成 path が一致している - AC3: production gate topology(A案:
session-manifest.ymlを正本とする)がscripts/check-agent-session-manifests.mjsのコメントに明示されている - AC4: artifact path 変更時に
session-manifest.ymlの generate / validate / upload path を同時更新することがscripts/check-agent-session-manifests.mjsのコメントに明示されている - AC5:
ci.ymlが production gate を主張しない旨(A案採用)がscripts/check-agent-session-manifests.mjsのコメントに明示されている - AC6: defaultPatterns に追加した path で invalid manifest を検出できる(存在しない glob で silent no-op にならない)ことが
scripts/check-agent-session-manifests.mjsの実装で保証されている - AC7: artifact upload constraints(
if-no-files-found: error,retention-days)がscripts/check-agent-session-manifests.mjsのコメントに明示されている - AC8:
pull_request_target/ write permission /secrets.*を使用しないことがscripts/check-agent-session-manifests.mjsのコメントに明示されている - AC9: Node 22 / pnpm 11 前提が
scripts/check-agent-session-manifests.mjsのコメントまたは CI workflow のどちらかで明示されている
Verification Commands
# AC1
$ rg -n "artifacts/agent-session-manifest-ci\.json" scripts/check-agent-session-manifests.mjs
# AC2
$ rg -c "artifacts/agent-session-manifest-ci\.json" scripts/check-agent-session-manifests.mjs
# AC3
$ rg -n "production.gate\|production gate" scripts/check-agent-session-manifests.mjs
# AC4
$ rg -n "session-manifest\.yml" scripts/check-agent-session-manifests.mjs
# AC5
$ rg -n "ci\.yml" scripts/check-agent-session-manifests.mjs
# AC6
$ rg -n "artifacts/agent-session-manifest-ci\.json" scripts/check-agent-session-manifests.mjs
# AC7
$ rg -n "if-no-files-found\|retention-days" scripts/check-agent-session-manifests.mjs
# AC8
$ rg -n "pull_request_target" scripts/check-agent-session-manifests.mjs
# AC9
$ rg -n "Node 22\|pnpm 11\|node-version" scripts/check-agent-session-manifests.mjs
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm buildAllowed Paths
scripts/check-agent-session-manifests.mjs.github/workflows/session-manifest.yml(A案で path 変更が生じる場合のみ).github/workflows/ci.yml(A案では変更不要)tests/fixtures/agent-session-manifest/(負例テスト fixture 追加の場合のみ)package.json(manifest:checkscript のみ)
Stop Conditions
実装中にこれらの状況が発生したら直ちに作業を停止し、Issue comment に状況を記録して人間の判断を待つ。
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
scripts/check-agent-session-manifests.mjsの validator / extractor ロジック変更が必要と判明した場合(Out of Scope のため)- Claude hook wrapper output の独立 gate が必要と判明した場合(follow-up Issue 化)
Required Skills
なし(Node.js ESM / GitHub Actions YAML 編集のみ)
Runtime Verification Applicability
decision: not_applicable — CI workflow / script の path 修正とドキュメントコメント追加のみで、ブラウザや対話的な runtime への影響を持たない
Metadata
Metadata
Assignees
Labels
area/ai-opsAI operations and agent tooling areaarea/securitySecurity areakind/implementationImplementation issue
Activity
squne121 commentedon Jun 2, 2026
判定: REQUEST_CHANGES
Issue #434 は、このまま実装に入ると 「production gate 化したつもりで fail-open する」 可能性が高いです。特に問題なのは、Issue 本文が
artifacts/agent-session-manifest/**/*.jsonを例示している一方、現行 workflow はartifacts/agent-session-manifest-ci.jsonを生成し、その直後に 明示 target としてpnpm manifest:check artifacts/agent-session-manifest-ci.jsonを実行しています。つまり、#434 の「default target に producer output path を足す」という作業だけでは、現行の producer artifact validation を強化しません。むしろ path mismatch と default-empty exit 0 により、production gate として誤認される危険があります。([GitHub]1)関連経緯の整理
#378 / PR #431 は、
pnpm manifest:checkを導入し、docs/schemas/examplesとtests/fixturesを CI で検証する pre-gate として着地しています。PR #431 のレビューでも、production artifact path は #402/#426 後の follow-up #434 に逃がす、と整理されました。したがって #434 の責務は「default glob を雑に追加する」ではなく、producer が実際に吐く artifact の場所と CI gate topology を確定することです。([GitHub]2)#402 / PR #426 は GitHub Actions artifact-only 生成と Claude hook 側の wrapper を扱っています。PR #426 の過程では、hook exec-form、exit code、secret boundary、PostToolUse の過剰取得、artifact filename などが実際にレビューで問題化し、最終的に best-effort telemetry と artifact-only 方針で approve されています。これは #434 が「artifact path の追加」だけで済むほど単純ではないことを示しています。([GitHub]3)
#412 / PR #495 は secret boundary を upstream で扱う作業として既に merge されています。ただし、artifact は secret store ではありません。GitHub 公式も、secret の自動 redaction は保証されないため、最小権限・mask・漏洩時の削除/rotate が必要だと説明しています。#434 は「validator に通るから安全」ではなく、artifact に出してよい情報だけが producer に到達しているかを前提条件として明記すべきです。([GitHub]4)
Blocker 1: 例示 path が現行 artifact path と一致していない
Issue #434 の scope では
artifacts/agent-session-manifest/**/*.jsonが例示されていますが、現行.github/workflows/session-manifest.ymlはartifacts/agent-session-manifest-ci.jsonを生成し、その単一ファイルを upload しています。**/*.json配下にファイルを置く設計へ変更するなら workflow 変更が必要です。変更しないなら #434 の path はartifacts/agent-session-manifest-ci.jsonを含むべきです。([GitHub]1)この mismatch は重大です。なぜなら #434 は「empty collection should keep exit 0」としており、存在しない glob を default target に足しても CI は green のままになります。これは production gate ではなく、silent no-op です。([GitHub]1)
Blocker 2:
ci.ymlのpnpm manifest:checkは producer artifact を生成していない現行
ci.ymlの test job はpnpm manifest:checkを実行しますが、その前に session manifest artifact を生成していません。一方、artifact を生成しているのは別 workflow のsession-manifest.ymlです。したがって、scripts/check-agent-session-manifests.mjsの default pattern に artifact path を追加しても、ci.yml側では対象ファイルが存在しない可能性が高いです。([GitHub]5)production gate と言うなら、次のどちらかに寄せる必要があります。
session-manifest.ymlの明示 validation を正本の production gate とし、その workflow/check を required にする。ci.ymlの test job 内で producer artifact を生成してからpnpm manifest:checkdefault target を走らせる。現状の #434 はこの topology を決めていません。
Blocker 3: 既に明示 validation が存在するため、default target 追加の価値が不明確
session-manifest.ymlは生成直後にpnpm manifest:check artifacts/agent-session-manifest-ci.jsonを実行しています。これは default glob より強いです。explicit target はファイル不在・unsupported target・0件を fail にできるため、production artifact の検証としては default target より適しています。([GitHub]6)したがって #434 の目的は次のどちらかに再定義すべきです。
session-manifest.ymlの explicit validation に集約する。ci.ymlに producer generation step を追加し、default target で実 artifact を検証する。私なら A案を推奨します。production artifact は「生成直後の explicit target validation」で閉じる方が fail-closed にしやすいです。
Blocker 4: artifact の公開範囲・保持期間・取得可能性を過小評価している
GitHub artifact は workflow 後にデータを保存・共有する仕組みであり、upload-artifact は digest も返します。保持期間は指定可能ですが、default では GitHub 側の retention policy に従います。また REST API で artifact の list/download/delete が可能で、private repo でも read 権限を持つ主体からは見え得ます。([GitHub Docs]7)
#434 は「validator が通る JSON」を見ているだけで、artifact の可視性・retention・secret redaction 非保証を acceptance criteria に入れていません。
retention-days: 7、permissions: contents: read、pull_request_target不使用、secrets.*不使用、upload 対象 path の限定は #434 の gate 条件として明記すべきです。([GitHub Docs]8)Blocker 5: Claude hook 側 producer と GitHub Actions producer の path を分けて扱っていない
#402/#426 は GitHub Actions artifact-only 生成だけでなく、Claude Code hook wrapper も扱っています。Claude Code hooks は exec-form の
command/argsの扱い、exit code 2 による block、PostToolUse の input/response など、運用上の癖が強いです。#426 のレビューでもここが実際に問題化しています。([Claude Code]9)#434 は producer output path を単数の glob で扱っていますが、実際には少なくとも次を分けるべきです。
artifacts/agent-session-manifest-ci.jsonこの分類なしに default target を拡張すると、どの producer を gate しているのか曖昧になります。
Blocker 6: Node / pnpm 前提は CI 側に閉じず、配布物として明記すべき
現行 CI は Node 22 と pnpm 11 を使っています。pnpm 11 は Node.js 22.12+ が必要で pure ESM 化されています。
scripts/check-agent-session-manifests.mjsも ESM 前提です。#434 の実装対象が CI default gate なら、Node/pnpm version 前提は workflow だけでなく、README または package metadata / developer docs 側にも明記すべきです。([GitHub]5)修正方針
#434 は次のように contract を書き換えるべきです。
推奨 title
manifest:check production artifact validation topology を確定し、producer output path を fail-closed に検証する修正後 Scope
修正後 Acceptance Criteria
PR 実装時の具体案
最小修正なら、
session-manifest.ymlの explicit validation を production gate として維持し、#434 ではmanifest:checkdefault target 追加を補助扱いに落とすべきです。ただし、これだけでは
ci.ymlの test job では artifact が存在しないため、PR 説明では「production gate はsession-manifest.ymlの explicit validation」と明記する必要があります。ci.yml側で production gate を主張するなら、先に artifact generation step を追加してください。最終コメント案
[-]実装: manifest:check の CI default target に producer output 実配置 path を追加する (#378 follow-up)[/-][+]manifest:check production artifact validation topology を確定し、producer output path を fail-closed に検証する[/+]squne121 commentedon Jun 2, 2026
issue-refinement-loop 完了
anchor comment 対応状況: squne121 の REQUEST_CHANGES(#issuecomment-4598280592)に記載された 6 つの Blocker をすべて反映済み。
artifacts/agent-session-manifest-ci.jsonに確定session-manifest.ymlの explicit validation を正本として明示squne121 commentedon Jun 2, 2026
Contract Snapshot (2026-06-02T03:15:00Z)
scripts/check-agent-session-manifests.mjsの defaultPatterns にartifacts/agent-session-manifest-ci.jsonが追加され、production gate topology(A案)がコメントで明示され、silent no-op が排除されるscripts/check-agent-session-manifests.mjs,.github/workflows/session-manifest.yml(変更時のみ),.github/workflows/ci.yml(変更時のみ),tests/fixtures/agent-session-manifest/(追加時のみ),package.json(manifest:check のみ).claude/worktrees/issue-434-manifest-check-production-artifact-validworktree-issue-434-manifest-check-production-artifact-validsqune121 commentedon Jun 2, 2026
implement-issue: 実装完了 (2026-06-02T03:22:23Z)
.claude/worktrees/issue-434-manifest-check-production-artifact-validworktree-issue-434-manifest-check-production-artifact-validfix(#434): translate production gate topology comments to English
squne121 commentedon Jun 2, 2026
implement-issue: fix_delta iteration 1 applied (2026-06-02T03:35:15Z)
scripts/check-agent-session-manifests.mjsto English; added PR feat(#402): wire agent_session_manifest/v1 producer to hooks and CI #426 artifact naming notefeat(#434): add production artifact to defaultPatterns and document g…
squne121 commentedon Jun 2, 2026
post-merge-cleanup: 完了 (2026-06-02T03:49:13Z)