Skip to content

feat: enforce manifest validation required check (#432) - #540

Merged
squne121 merged 7 commits into
mainfrom
worktree-issue-432-manifest-validation-gate-required-check
May 31, 2026
Merged

squne121 merged 7 commits into
mainfrom
worktree-issue-432-manifest-validation-gate-required-check

Conversation

@squne121

@squne121 squne121 commented May 31, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • agent-session-manifest workflow の check context を agent-session-manifest / validate-generated-artifact に固定
  • 生成 artifact を upload 前に pnpm manifest:check artifacts/agent-session-manifest-ci.json で検証する step を追加
  • public-safe 補助 grep check(belt-and-suspenders)、merge_group trigger、required check 運用手順を docs/dev/session-recording-policy.md に反映
  • artifact 名を agent-session-manifest-${{ github.run_id }} に変更(private- prefix 削除)
  • branch protection required_status_checks に agent-session-manifest / validate-generated-artifact を登録済み

受け入れ条件の達成状況

  • AC1: 生成済み artifact を pnpm manifest:check artifacts/agent-session-manifest-ci.json で検証する step を追加
  • AC2: validation step を upload 前に配置し、schema / semantic violation で fail-close する構成に更新
  • AC3: exact check context agent-session-manifest / validate-generated-artifact を SSOT に明記
  • AC4: workflow name / job_id / job name / required check context の違いを SSOT に明記
  • AC5: known sensitive absolute-path prefix / token-like string / transcript-local marker の belt-and-suspenders hard-fail check を追加(primary 検証は pnpm manifest:check が担う)
  • AC6: required check enforcement の SSOT を branch protection と明記(ruleset PATCH API が 404 のため)
  • AC7: 確認コマンドと admin stop condition を SSOT に追加
  • AC8: merge_group trigger を workflow に追加し、docs でも merge queue 運用を明記

検証コマンド結果

  • rg -n 'pnpm manifest:check artifacts/.+\.json' .github/workflows/session-manifest.yml : PASS
  • rg -n 'pnpm manifest:check' .github/workflows/session-manifest.yml : PASS
  • rg -n 'agent-session-manifest / validate-generated-artifact' docs/ : PASS
  • rg -n 'validate-generated-artifact' .github/workflows/session-manifest.yml : PASS
  • rg -n 'FAIL.*token-like\|token-like.*detected' .github/workflows/session-manifest.yml : PASS
  • rg -n 'branch protection\|ruleset' docs/ : PASS
  • rg -n 'required_status_checks\|admin.*stop condition\|stop condition.*admin' docs/ : PASS
  • rg -n 'merge_group\|merge queue' .github/workflows/session-manifest.yml docs/ : PASS
  • pnpm typecheck : PASS
  • pnpm lint : PASS
  • pnpm test : PASS (15 files / 266 tests)
  • pnpm build : PASS

required 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-artifact

agent-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 typecheck
  • pnpm lint
  • pnpm test
  • pnpm build

Schema Change Applicability

  • decision: not_schema_change
  • reason: workflow / docs の enforcement 変更のみで、agent_session_manifest/v1 schema や producer-consumer 契約は変更していない

Schema Consumer Inventory

N/A: schema 自体は変更していないため consumer inventory の更新は不要。

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
Generated manifest artifact is schema-validated before upload; merge-blocking check context is fixed across pull_request and merge_group; agent-session-manifest / validate-generated-artifact is registered in branch protection required_status_checks. yes 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 build N/A

Non-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 で対応する。
  • workflow grep の絶対パス検出は known prefix(/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

@squne121

Copy link
Copy Markdown
Owner Author

判定: 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

  1. 実装: manifest validation gate を required-check に昇格する #432 を close する根拠が足りない。実際の required check enforcement が未証跡

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 として強制された」とは言えません。


  1. public-safe hard-fail check をPRスコープの成果として主張しすぎ

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仕様にしない。


  1. artifact 名が private-agent-session-manifest-* のままで、docsのリスク説明と矛盾している

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 名の近くにも明記する。

現状の名前はレビューアに「これは非公開だから安全」と誤認させます。


  1. merge_group 対応は正しいが、required check 登録と一体で確認されていない

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
gh api repos/squne121/loop-protocol/branches/main/protection/required_status_checks
--jq '.checks[]?.context // .contexts[]?'

そして結果として agent-session-manifest / validate-generated-artifact が確認できたか、確認不能なら stop condition として明記してください。


Non-blocking comments

  1. phase_instance_id の3桁seq導出は衝突可能

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を許可する方向に拡張する。


  1. public-safe grep の絶対パス検出は仕様として弱い

現在の検出は /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 merge_group, which is necessary for merge queue required checks. However, it should not close #432 yet.

Blocking:

  1. 実装: manifest validation gate を required-check に昇格する #432's goal is an actually enforced required check that prevents schema-invalid manifests from merging. This PR only documents the required check context; it does not provide evidence that the GitHub ruleset or branch protection actually requires agent-session-manifest / validate-generated-artifact. Please either:

    • add evidence from gh api repos/squne121/loop-protocol/rulesets or .../required_status_checks, or
    • remove Closes #432 and record the admin stop condition / human handoff.
  2. The workflow-level grep is being claimed as a public-safe hard-fail gate, but public-safe semantic validation belongs in pnpm manifest:check / validator fixtures. Keep the grep only as defense-in-depth, or add matching validator tests so the contract does not fork between CI YAML and the validator.

  3. The artifact is still named private-agent-session-manifest-* even though the file is now public-safe agent-session-manifest-ci.json and docs acknowledge public repo artifacts are not a secrecy boundary. Rename the artifact prefix or explicitly document that "private" does not imply confidentiality.

Non-blocking:

  • The modulo-1000 phase_instance_id is schema-compatible but not unique. Document this limitation and consider a follow-up schema issue for CI-native IDs.
  • The absolute-path grep does not catch all absolute paths, so do not claim comprehensive absolute path protection unless the validator owns that rule.

結論

実装の核は悪くありません。ただし、今の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 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
squne121 marked this pull request as ready for review May 31, 2026 06:31

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: ci workflow run 26705374846 (headSha=acf2158da946a2ff8c3f36ebc62f9cfe7df5242a, conclusion=success) — typecheck/lint/test/build/python-test/e2e すべて pass。session-manifest workflow 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

  1. 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

@squne121

Copy link
Copy Markdown
Owner Author

判定: REQUEST_CHANGES。
PR #540 は方向性は妥当ですが、現状の主張は「required check enforcement まで完了」と読める一方、実際には workflow と docs の更新だけで、ruleset / branch protection に required check が実設定された証跡がありません。Issue #432 の目的は「schema 違反 PR が main にマージされない状態」にすることです。単に check job を追加しただけでは未達です。

良い点

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 は認証なしで利用可能とされています。

ブロッカー

  1. required check enforcement の実設定証跡がない

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
--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 どおり「実設定未完了」と明記し、Closes #432 を外すべきです。

  1. hidden / bidirectional Unicode warning が workflow と docs に出ている

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'
from pathlib import Path
import unicodedata

targets = [
".github/workflows/session-manifest.yml",
"docs/dev/session-recording-policy.md",
]
bad = []
for p in targets:
text = Path(p).read_text(encoding="utf-8")
for i, ch in enumerate(text):
cat = unicodedata.category(ch)
if cat in {"Cf", "Cc"} and ch not in "\n\r\t":
bad.append((p, i, f"U+{ord(ch):04X}", unicodedata.name(ch, "UNKNOWN")))
if bad:
for row in bad:
print(row)
raise SystemExit(1)
PY

  1. PR が「required check 化」ではなく「required check 化の準備」に留まっている

#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 実設定の証跡を追加する。
B. 権限不足で docs/workflow までなら、PR title / Summary / Safety Claim Matrix を「required check registration procedure added」に下げ、Closes #432 ではなく「Follow-up required: admin required-check registration」とする。

非ブロッカーだが修正推奨

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 と merge_group trigger の追加としては概ね正しいですが、#432 を close するには required check enforcement の実設定証跡が不足しています。

#432 の Goal は「schema 違反の PR が main にマージされないようにする」ことです。現状の証跡は docs/workflow の grep と PR check 成功だけで、ruleset または branch protection に agent-session-manifest / validate-generated-artifact が required として登録された証跡がありません。

以下のいずれかを 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 解消が必要**です。

@squne121
squne121 merged commit 637ec15 into main May 31, 2026
7 checks passed
@squne121
squne121 deleted the worktree-issue-432-manifest-validation-gate-required-check branch May 31, 2026 08:56
squne121 added a commit that referenced this pull request Jun 1, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: manifest validation gate を required-check に昇格する

1 participant