Repository navigation
feat: enforce manifest validation required check (#432) - #540
Conversation
|
判定: Request changes このPRは方向性は妥当ですが、現状のまま Closes #432 で閉じるのは危険です。特に「required check 化」の実効性と、public-safe 検査の責務境界が過剰主張になっています。 良い点 agent-session-manifest workflow に merge_group を追加した点は正しいです。GitHub Docs でも、merge queue 使用時に required check を走らせるには merge_group event を workflow trigger に含める必要がある、と明記されています。 また、生成 artifact を upload 前に pnpm manifest:check artifacts/agent-session-manifest-ci.json で検証する配置は、Issue #432 の AC1/AC2 の主旨には合っています。PR本文でも AC1/AC2 達成としてこの検証 step を主張しています。 Blocking comments
Issue #432 の Goal は「schema 違反の PR が main にマージされないようにする」で、Desired Destination も「required check で schema validate し、fail した PR が merge できない状態」です。 このPRは workflow と docs を更新していますが、ruleset / branch protection に agent-session-manifest / validate-generated-artifact が実際に登録された証跡がありません。PR本文の検証も rg 中心で、gh api repos/squne121/loop-protocol/rulesets や required status checks の実結果はありません。 修正要求: Closes #432 を外す、または PR本文に以下のどちらかを記録する。 ruleset / branch protection に required check を設定済みである証跡 admin 権限不足等により設定できず、Issue #432 の stop condition として人間へ引き継いだ証跡 現状は「required check にできる名前と手順をdocsに書いた」だけで、「required check として強制された」とは言えません。
PR本文は AC5 として「absolute path / token-like string / transcript-local marker の public-safe hard-fail check を追加」と主張しています。 しかし Issue #432 の本来スコープは manifest schema validation の required check 化であり、Secret 管理境界は明示的に #412 の担当外部スコープです。 さらに Issue #378 では pnpm manifest:check 側に、絶対パス、secret/token/api-key 様の値、raw transcript、local file などの semantic violation を fail-close する責務が既に定義されています。 ここで workflow の grep を追加しても、validator と二重化し、仕様差分が生まれます。 修正要求: workflow 側の grep は「補助的なbelt-and-suspenders検査」と明記する。 本質的な public-safe 判定は pnpm manifest:check の semantic validator に寄せる。 grepで担保するなら、同じパターンを validator fixture にも追加し、workflow-only仕様にしない。
workflow は出力ファイルを artifacts/agent-session-manifest-ci.json に変更していますが、upload artifact 名は private-agent-session-manifest-${{ github.run_id }} のままです。Files changed でも artifact name prefix は private-agent-session-manifest のまま残っています。 一方 docs は public repo では artifact がREST API経由で扱われる前提で public-safe contract を要求しており、GitHub Docs も Actions artifact をREST APIで取得・ダウンロードできるものとして説明しています。 修正要求: artifact 名を agent-session-manifest-${{ github.run_id }} などに変更する。 docs の artifact name prefix も合わせる。 「private」という語を使うなら、「private artifact channel」は機密性ではなく「PR comment / git history ではない一時保管面」を意味する、と artifact 名の近くにも明記する。 現状の名前はレビューアに「これは非公開だから安全」と誤認させます。
merge_group trigger の追加自体は良いです。GitHub Docs は merge queue で required checks を使う場合、pull_request / push とは別に merge_group が必要と説明しています。 ただし、required check の exact context を docs に書くだけでは不十分です。実際に ruleset がその check context を要求していなければ、merge queue 上でこのcheckがmerge blockerになりません。 修正要求: PR本文の検証コマンドに以下を追加してください。 gh api repos/squne121/loop-protocol/rulesets そして結果として agent-session-manifest / validate-generated-artifact が確認できたか、確認不能なら stop condition として明記してください。 Non-blocking comments
GITHUB_RUN_ID + GITHUB_RUN_ATTEMPT % 1000 で issue-432:impl: を作っています。schema互換性のための妥協は理解できますが、1000通りしかないため長期運用では衝突します。PR本文でも commit に「schema-compatible」修正が入っています。 改善案: まずはコメントに「uniquenessではなくschema-compatible CI marker」と明記する。 後続Issueで phase_instance_id schema を ci::<run_id>:<run_attempt> のようなCI固有IDを許可する方向に拡張する。
現在の検出は /home, /Users, /tmp, /var, /private, Windows path, file:// に寄っています。PR本文では「absolute path」と広く主張していますが、例えば /workspace/foo, /opt/hostedtoolcache/foo, /github/workspace/foo は検出対象外になりえます。 改善案: PR本文の主張を「known sensitive absolute path prefixes」に弱めるか、validator側のsemantic ruleとして網羅的に定義してください。workflow grepだけで「absolute path全般」を保証するのは不適切です。 推奨PRコメント案 Request changes. This PR correctly moves the manifest validation step before artifact upload and adds Blocking:
Non-blocking:
結論 実装の核は悪くありません。ただし、今のPRは「required check化の実装」ではなく「required check化に向けたworkflow名・job名・検証step・docs整備」です。#432 を閉じるなら、ruleset / branch protection の実設定証跡が必須です。 |
…ders doc, branch protection evidence - Rename artifact from private-agent-session-manifest-* to agent-session-manifest-* (blocking #3) - Add belt-and-suspenders note to public-safe grep step; pnpm manifest:check is primary validator (blocking #2) - Add branch protection registration evidence and confirmed contexts to docs (blocking #1/#4) - Update AC6 SSOT to branch protection (ruleset PATCH API returned 404) Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
Verdict: REQUEST_CHANGES
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=BLOCKED
- PR is in DRAFT state — mergeStateStatus=BLOCKED is caused by draft status. Per skill policy, BLOCKED = merge blocker (REQUEST_CHANGES). Mark as ready for review to unblock.
Evidence Check
- AC coverage: AC1-AC8 全て達成。各 AC の根拠は PR 本文に具体的に記載されており、diff との対応も確認。
- Allowed Paths: 遵守。変更ファイルは
.github/workflows/session-manifest.ymlとdocs/dev/session-recording-policy.mdのみ。Issue #432 の Allowed Paths と完全一致。 - CI Verification: head SHA
acf2158da946a2ff8c3f36ebc62f9cfe7df5242aで全 CI ジョブ成功(typecheck/lint/test/build/python-test/e2e/validate-generated-artifact いずれも conclusion=success)。CI_CHECK_RUN_SCOPED 条件(head_sha 一致・workflow/job/step が対象 VC に対応・conclusion=success・非 skipped)を満たす。 - 検証コマンド結果: PR 本文の各 VC(AC1-AC8 対応 rg コマンドおよび pnpm typecheck/lint/test/build)が全て PASS と記録されており、CI run で対応する check が success であることを確認。
- branch protection 確認:
gh api repos/squne121/loop-protocol/branches/main/protection/required_status_checksでagent-session-manifest / validate-generated-artifactの登録を直接確認済み。 - Schema Change Applicability:
not_schema_change— workflow/docs 変更のみ、consumer 境界に影響なし。妥当。 - Safety Claim Matrix: 存在し、必須列が揃っている。
Not controlled列が空で、Evidence が VCs に対応している。bounded claim として許可。 - TEST_VERDICT_MACHINE: コメントなし(#88 pending)。CI_CHECK_RUN_SCOPED で代替。
Blockers
- DRAFT 状態によるマージブロック:
mergeStateStatus=BLOCKED— PR が DRAFT のため merge できない状態。AC/CI/Allowed Paths は全て充足しており、DRAFT を解除して Ready for review にすることで解消可能。
Non-blockers
phase_instance_idの(run_id + run_attempt) % 1000によるシーケンス導出は一意性を保証しない(PR 本文 Non-blocking notes に記載済み)。将来の schema 拡張(ci:<workflow>:<run_id>:<run_attempt>形式)は follow-up Issue 対応を推奨。
LOOP_VERDICT
verdict: REQUEST_CHANGES
blockers:
- "mergeStateStatus=BLOCKED: PR is in DRAFT state. All AC/CI checks pass; unblock by marking ready for review."
mergeable: MERGEABLE
mergeStateStatus: BLOCKED
reviewed_head_sha: acf2158da946a2ff8c3f36ebc62f9cfe7df5242a
recommendations: []
follow_up_issue_requests:
- title: "feat: extend phase_instance_id schema to support ci:<workflow>:<run_id>:<run_attempt> format"
issue_kind: implementation
severity: optional_follow_up
source:
kind: pr_body
url: "https://github.com/squne121/loop-protocol/pull/540"
note_id: "1"
dedupe_key: "follow-up:squne121/loop-protocol:https://github.com/squne121/loop-protocol/pull/540:1"
desired_destination: "CI の phase_instance_id が run_id+run_attempt から一意に導出できる状態。3桁seq の衝突リスクがなくなる。"
validated_scope_delta: "agent_session_manifest/v1 schema の phase_instance_id フィールドに ci:<workflow>:<run_id>:<run_attempt> 形式を追加し、manifest:check validator がこの形式を受け付けるよう更新する"
origin_skill: pr-review-judge
labels:
- triage-required
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=BLOCKED(required check
agent-session-manifest / validate-generated-artifactが branch protection に登録済みのため、CI run が認識されるまで一時 BLOCKED — これは required check 登録自体の正常動作であり conflict/merge blocker ではない)
Evidence Check
- AC coverage: 8/8 すべて
[x]+ 根拠記載あり。placeholder 残存なし。 - Allowed Paths: 変更ファイルは
.github/workflows/session-manifest.ymlとdocs/dev/session-recording-policy.mdの 2 ファイルのみ。issue #432 の Allowed Paths と完全一致。 - CI Verification:
ciworkflow run 26705374846 (headSha=acf2158da946a2ff8c3f36ebc62f9cfe7df5242a, conclusion=success) — typecheck/lint/test/build/python-test/e2e すべて pass。session-manifestworkflow run 26705374848 (headSha=acf2158da946a2ff8c3f36ebc62f9cfe7df5242a, conclusion=success) — validate-generated-artifact pass。head SHA が PR head と一致(CI_CHECK_RUN_SCOPED 条件充足)。 - 検証コマンド結果: AC1-AC8 対応の全 rg コマンドと pnpm コマンドが
## 検証コマンド結果に記載、すべて PASS。
Schema / Safety Checks
- Schema Change Applicability:
not_schema_change(根拠が diff と一致、workflow/docs 変更のみ)。Schema Consumer Inventory: N/A として明示。 - Safety Claim Matrix: 存在。Not controlled 列が空、Evidence が VC と対応。過大な safety claim なし(bounded claim)。
TEST_VERDICT_MACHINE
- TEST_VERDICT_MACHINE コメントが存在しない。#88 pending 状態に該当(SKILL.md 注記)。CI_CHECK_RUN_SCOPED の全条件(head_sha 一致・workflow/job 対応・conclusion=success)を充足しており補助証跡として有効。
Blockers
- なし
Non-blockers
phase_instance_idの 3 桁 seq((run_id + run_attempt) % 1000)は唯一性なし。将来的なci:<workflow>:<run_id>:<run_attempt>形式への移行を follow-up Issue で対応することが PR 本文に明示済み。
LOOP_VERDICT
verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: BLOCKED
reviewed_head_sha: acf2158da946a2ff8c3f36ebc62f9cfe7df5242a
recommendations: []
follow_up_issue_requests:
- title: "phase_instance_id を ci:<workflow>:<run_id>:<run_attempt> 形式に移行する"
issue_kind: implementation
severity: optional_follow_up
source:
kind: pr_body
url: "https://github.com/squne121/loop-protocol/pull/540"
note_id: "1"
dedupe_key: "follow-up:squne121/loop-protocol:https://github.com/squne121/loop-protocol/pull/540:1"
desired_destination: "phase_instance_id が CI run ごとに唯一な値(ci:<workflow>:<run_id>:<run_attempt>)を持つ状態"
validated_scope_delta: "session-manifest workflow の --phase-instance-id 引数を ci:<workflow>:<run_id>:<run_attempt> 形式に変更し、schema との互換性を確認する"
origin_skill: pr-review-judge
labels:
- triage-required|
判定: REQUEST_CHANGES。 良い点 agent-session-manifest / validate-generated-artifact という exact context を固定し、job 名も validate-generated-artifact に寄せた点は required check 運用上正しいです。GitHub の required status check は過去 7 日以内に成功していないと候補として扱えないため、PR 側で一度成功させる導線も docs に書かれています。 merge_group trigger を追加した点も正しいです。GitHub 公式 docs は、merge queue を使う required check workflow には merge_group event を追加しないと merge group で required check が報告されず merge が失敗すると明記しています。 public repo の Actions artifact が public resource として REST API 経由で取得可能である前提を docs に明記し、manifest content を public-safe として扱っている点も妥当です。GitHub docs でも public resource の artifact list/get/list-run-artifacts は認証なしで利用可能とされています。 ブロッカー
Issue #432 の Goal / Desired Destination は「schema 違反 PR が main にマージされない」ことです。PR 本文は AC6 で ruleset を SSOT と明記したと言っていますが、実際の証跡は docs/ の grep だけです。gh api repos/squne121/loop-protocol/rulesets や branch protection API の結果が PR 本文・Issue コメントにありません。 この状態で Closes #432 は危険です。workflow check が成功しても、それが ruleset / branch protection に required として登録されていなければ merge blocker にはなりません。GitHub の rulesets は「branch/tag と相互作用する方法を制御する」機構であり、docs 更新だけでは制御は発生しません。 修正要求: PR 本文または #432 に以下のどちらかを記録してください。 gh api repos/squne121/loop-protocol/rulesets または fallback の場合: gh api repos/squne121/loop-protocol/branches/main/protection/required_status_checks その出力に agent-session-manifest / validate-generated-artifact が含まれることを証跡化する。admin 権限がなく実行不能なら、docs に書いた stop condition どおり「実設定未完了」と明記し、Closes #432 を外すべきです。
GitHub が .github/workflows/session-manifest.yml と docs/dev/session-recording-policy.md に対して「hidden or bidirectional Unicode text」警告を出しています。特に workflow は shell script を含むため、表示と実行内容がずれる余地を残すのは CI/security 変更として許容しにくいです。 修正要求: 対象ファイルを normalize し、不可視制御文字を除去してください。最低限、以下を検証コマンドに追加。 python3 - <<'PY' targets = [
#432 の In Scope は workflow validation step、fail 時 workflow fail、required check 昇格手順 docs です。ただし Goal は merge blocker 化です。PR #540 の本文は「required check enforcement の SSOT を ruleset と明記」と主張しますが、設定適用の evidence がないため、レビュー上は 実効 enforcement 未確認です。 修正要求: PR の表現をどちらかに揃えるべきです。 A. 本当に #432 を close するなら、ruleset / branch protection 実設定の証跡を追加する。 非ブロッカーだが修正推奨 public-safe check が schema validator と二重管理になっている PR は pnpm manifest:check artifacts/agent-session-manifest-ci.json を追加しており、#378 側の validator は public comment visibility、transcript/local_file、raw transcript、local paths、secret-like metadata などの semantic violation を fail-close する契約です。 一方で workflow 内に grep ベースの public-safe check も追加されています。これは保険としては良いですが、validator と grep の検出範囲がズレると「grep は PASS だが validator は FAIL」またはその逆の説明不能な状態になります。grep はコメントに「public-safe smoke check」と明記し、正本は pnpm manifest:check と docs に固定した方がよいです。 Node.js 20 action runtime deprecation warning Checks 画面には actions/checkout@v4, actions/setup-node@v4, actions/upload-artifact@v4, pnpm/action-setup@v4 が Node.js 20 action runtime deprecation warning を出しています。現時点の PR ブロッカーではありませんが、2026-06-16 以降の runner default 変更に巻き込まれる可能性があるため、別 Issue で action major の追従を切るべきです。 そのまま貼れるレビューコメント案 REQUEST_CHANGES この PR は workflow validation step と #432 の Goal は「schema 違反の PR が main にマージされないようにする」ことです。現状の証跡は docs/workflow の grep と PR check 成功だけで、ruleset または branch protection に 以下のいずれかを PR body または #432 comment に記録してください。 gh api repos/squne121/loop-protocol/rulesets \
--jq '.[] | {name, enforcement, rules}'
または fallback:
gh api repos/squne121/loop-protocol/branches/main/protection/required_status_checks \
--jq '.checks[]?.context // .contexts[]?'
その出力に agent-session-manifest / validate-generated-artifact が含まれることを確認できる必要があります。admin 権限がなく実行できない場合は、docs に書いた stop condition どおり「required check 実設定は未完了」と明記し、Closes #432 を外してください。
加えて、GitHub が .github/workflows/session-manifest.yml / docs/dev/session-recording-policy.md に hidden/bidirectional Unicode warning を出しています。CI/security workflow 変更で不可視制御文字を残すのは危険なので、対象ファイルを normalize し、不可視制御文字検査を検証コマンドに追加してください。
総合すると、**merge 前に required-check 実設定の証跡化と Unicode warning 解消が必要**です。 |
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…un_id>:<run_attempt> (#551) * feat(#547): extend phase_instance_id pattern to accept CI-native ci:<slug>:<run_id>:<run_attempt> format Extends `phase_instance_id` in agent_session_manifest/v1 schema from the single `issue-<N>:<phase>:<seq>` pattern to a two-format non-capturing group: `^(?:issue-[0-9]+:[a-z_]+:[0-9]{3}|ci:[a-z0-9_.-]+:[1-9][0-9]*:[1-9][0-9]*)$` This eliminates the 1000-collision limit introduced in #540 (where run_id % 1000 was used as a 3-digit seq) by letting CI workflows emit a fully unique `ci:session-manifest:<run_id>:<run_attempt>` identifier instead. Changes: - docs/schemas/agent-session-manifest.schema.json: new dual-format pattern + updated description noting producer_slug is a fixed slug, not workflow name - scripts/generate-session-manifest.mjs: validatePhaseInstanceId uses same pattern; --help and invalid-format errors now list both formats - .github/workflows/session-manifest.yml: replaces PHASE_SEQ derivation with --phase-instance-id ci:session-manifest:${{ github.run_id }}:${{ github.run_attempt }} - tests/agent-session-manifest-phase-instance-id.test.ts: 11 new tests covering AC1 (CI valid), AC2 (legacy valid), AC3 (malformed rejected) Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * test(#547): add generator CLI integration tests for phase_instance_id ci-native format - AC4: positive test — generator --validate accepts ci:session-manifest:12345678:1 and issue-432:impl:001 - AC4 negative: run_id=0, run_attempt=0, space-in-slug all exit non-zero - AC5: --help output and invalid-format error message both list issue-<N>:<phase>:<seq> and ci:<producer_slug>:<run_id>:<run_attempt> Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Summary
agent-session-manifestworkflow の check context をagent-session-manifest / validate-generated-artifactに固定pnpm manifest:check artifacts/agent-session-manifest-ci.jsonで検証する step を追加merge_grouptrigger、required check 運用手順をdocs/dev/session-recording-policy.mdに反映agent-session-manifest-${{ github.run_id }}に変更(private-prefix 削除)agent-session-manifest / validate-generated-artifactを登録済み受け入れ条件の達成状況
pnpm manifest:check artifacts/agent-session-manifest-ci.jsonで検証する step を追加agent-session-manifest / validate-generated-artifactを SSOT に明記pnpm manifest:checkが担う)merge_grouptrigger を workflow に追加し、docs でも merge queue 運用を明記検証コマンド結果
rg -n 'pnpm manifest:check artifacts/.+\.json' .github/workflows/session-manifest.yml: PASSrg -n 'pnpm manifest:check' .github/workflows/session-manifest.yml: PASSrg -n 'agent-session-manifest / validate-generated-artifact' docs/: PASSrg -n 'validate-generated-artifact' .github/workflows/session-manifest.yml: PASSrg -n 'FAIL.*token-like\|token-like.*detected' .github/workflows/session-manifest.yml: PASSrg -n 'branch protection\|ruleset' docs/: PASSrg -n 'required_status_checks\|admin.*stop condition\|stop condition.*admin' docs/: PASSrg -n 'merge_group\|merge queue' .github/workflows/session-manifest.yml docs/: PASSpnpm typecheck: PASSpnpm lint: PASSpnpm test: PASS (15 files / 266 tests)pnpm build: PASSrequired check 登録証跡(ブロッカー 1/4 対応)
$ gh api repos/squne121/loop-protocol/branches/main/protection/required_status_checks \ --jq '.checks[]?.context // .contexts[]?' typecheck lint test build python-test agent-session-manifest / validate-generated-artifactagent-session-manifest / validate-generated-artifactが branch protection required_status_checks に登録済み(2026-05-31)。schema 違反の PR は main にマージできない状態。
ruleset PATCH API(id: 16796903)は 404 を返したため、branch protection を SSOT として登録した。
ブロッカー 2 対応(public-safe grep の責務明確化)
workflow の "Verify artifact content is public-safe" step を "belt-and-suspenders" と明記した。
primary の public-safe semantic validation は
pnpm manifest:checkが担う(#378)。workflow grep は known sensitive path prefix / token pattern の defense-in-depth であり、「absolute path 全般」を保証するものではない旨をコメントに明記した。
ブロッカー 3 対応(artifact 名変更)
artifact 名を
private-agent-session-manifest-${{ github.run_id }}→agent-session-manifest-${{ github.run_id }}に変更。docs の artifact name prefix 表記も同様に更新。
Allowed Paths 遵守
.github/workflows/session-manifest.ymlとdocs/dev/session-recording-policy.mdのみtests/fixtures/agent-session-manifest/temp-unsupported.txtは既存 untracked のため本 PR では未変更Checks
pnpm typecheckpnpm lintpnpm testpnpm buildSchema Change Applicability
not_schema_changeagent_session_manifest/v1schema や producer-consumer 契約は変更していないSchema Consumer Inventory
N/A: schema 自体は変更していないため consumer inventory の更新は不要。
Safety Claim Matrix
gh api repos/squne121/loop-protocol/branches/main/protection/required_status_checks --jq '.checks[]?.context';rg -n 'pnpm manifest:check artifacts/.+\.json' .github/workflows/session-manifest.yml;rg -n 'merge_group|merge queue' .github/workflows/session-manifest.yml docs/;pnpm typecheck;pnpm lint;pnpm test;pnpm buildNon-blocking notes
phase_instance_idの 3 桁 seq((run_id + run_attempt) % 1000)は schema-compatible だが唯一性なし。current schema がissue-<N>:impl:<seq>形式を要求するための暫定実装。将来的な schema 拡張(ci:<workflow>:<run_id>:<run_attempt>形式)は follow-up Issue で対応する。/home,/Users,/tmp,/var,/private, Windows path,file://)に限定。全 absolute path の網羅保証は validator (実装: agent_session_manifest producer output の schema validation gate (pnpm manifest:check) を追加する #378) の責務。Notes
Closes #432