Skip to content

feat(#547): extend phase_instance_id to accept CI-native ci:<slug>:<run_id>:<run_attempt> - #551

Merged
squne121 merged 3 commits into
mainfrom
worktree-issue-547-agent-session-manifest-schema-phase-inst
Jun 1, 2026
Merged

squne121 merged 3 commits into
mainfrom
worktree-issue-547-agent-session-manifest-schema-phase-inst

Conversation

@squne121

@squne121 squne121 commented Jun 1, 2026 •

Copy link
Copy Markdown
Owner

Closes #547

Summary

  • docs/schemas/agent-session-manifest.schema.json: phase_instance_id pattern extended from single issue-<N>:<phase>:<seq> to dual-format non-capturing group ^(?:issue-[0-9]+:[a-z_]+:[0-9]{3}|ci:[a-z0-9_.-]+:[1-9][0-9]*:[1-9][0-9]*)$
  • scripts/generate-session-manifest.mjs: validatePhaseInstanceId updated to same pattern; --help and invalid-format error messages now list both formats with producer_slug note
  • .github/workflows/session-manifest.yml: PHASE_SEQ derivation removed; replaced 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 (AC1 positive, AC2 backward-compat, AC3 negative cases, AC8 additional variants)

Schema Change Applicability

  • 変更種別: pattern 拡張(既存パターンに OR 追加)
  • 後方互換性: issue-<N>:<phase>:<seq> 形式は変更なし。既存 document は引き続き新 pattern を満たす
  • 新フォーマット: ci:<producer_slug>:<run_id>:<run_attempt>
  • Ajv / JSON Schema validator での既存ドキュメントへの影響: なし(既存 document は両ブランチの pattern を満たし続ける)

Schema Consumer Inventory

Consumer enumeration コマンド実行結果:

$ rg -n "agent_session_manifest/v1|agent_session_manifest:v1|agent-session-manifest" . --glob '!*.json' --glob '!node_modules/**' --glob '!.claude/worktrees/**'
./scripts/generate-session-manifest.mjs:6: * Deterministic producer for agent_session_manifest/v1 JSON.
./scripts/generate-session-manifest.mjs:25: * Generates: agent_session_manifest/v1 JSON to stdout
./scripts/generate-session-manifest.mjs:41:} from './lib/agent-session-manifest-validation.mjs'
./scripts/generate-session-manifest.mjs:298:    schema: 'agent_session_manifest/v1',
./docs/schemas/agent-session-manifest.md:8:# Agent Session Manifest (agent_session_manifest/v1)
./tests/agent-session-manifest-producer.test.ts:110:    expect(result.stdout).toContain('"schema": "agent_session_manifest/v1"')
./tests/agent-session-manifest-check.test.ts:28:      [resolve(SCRIPTS_DIR, 'check-agent-session-manifests.mjs'), ...args],
Consumer 用途 phase_instance_id 参照 本 PR の影響
scripts/generate-session-manifest.mjs producer(manifest 生成) --phase-instance-id 引数として受け取り 本 PR で新形式のバリデーション追加済み
scripts/validate-agent-session-manifest.mjs validator(schema check) schema pattern で検証 pattern 拡張のみ。既存 issue-<N>:...:000 形式は引き続き valid
scripts/check-agent-session-manifests.mjs pnpm manifest:check entrypoint schema validation 経由 同上
.github/workflows/session-manifest.yml CI producer --phase-instance-id に値を渡す 本 PR で ci:session-manifest:${{ github.run_id }}:${{ github.run_attempt }} に更新済み
tests/agent-session-manifest-producer.test.ts integration test fixture に schema: 'agent_session_manifest/v1' 本 PR で phase_instance_id positive/negative test 追加済み
docs/schemas/agent-session-manifest.md schema documentation description として記述 変更不要(pattern は schema.json が正本)

Safety Claim Matrix

対象: .github/workflows/session-manifest.yml(PHASE_SEQ 生成ロジック → ci:session-manifest:${{ github.run_id }}:${{ github.run_attempt }} に置換)

Claim Implemented? Not controlled Evidence Follow-up
phase_instance_id の値が schema の新 pattern `^(?:issue-... ci:[a-z0-9_.-]+:[1-9][0-9]:[1-9][0-9])$` に適合する Yes — workflow が ci:session-manifest:${{ github.run_id }}:${{ github.run_attempt }} を生成 github.run_id / github.run_attempt の値は GitHub Actions が保証(ワークフロー外からの注入は不可) AC7 (runtime_only/deferred): validate-generated-artifact CI step が artifact を schema check する。pnpm manifest:check の exit code で確認
既存の issue-<N>:<phase>:<seq> 形式が引き続き valid である(後方互換) Yes — schema pattern が non-capturing group で両形式を OR 結合 既存 artifact は変更なし AC2 VC: rg -n "issue-[0-9].*ci:" docs/schemas/agent-session-manifest.schema.json exit 0 なし
PHASE_SEQ ベースの 1000 通り衝突リスクが解消される Yes — run_id(リポジトリ内一意)+ run_attempt の組み合わせで事実上無制限 GitHub Actions の run_id 一意性は GitHub が保証 workflow diff(PHASE_SEQ 行が削除され ci:session-manifest:... に置換) なし

Verification

Command Result
pnpm typecheck pass
pnpm lint pass
pnpm test 288 passed (16 files, +11 new tests)
pnpm build pass
uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py 21 passed

AC VC Results

AC VC Result
AC1 rg -n "ci:[a-z0-9_\.-]" docs/schemas/agent-session-manifest.schema.json exit 0
AC2 rg -n "issue-[0-9].*ci:" docs/schemas/agent-session-manifest.schema.json exit 0
AC3 rg -n "[1-9][0-9]" docs/schemas/agent-session-manifest.schema.json exit 0
AC4 rg -n "ci:session-manifest" scripts/generate-session-manifest.mjs exit 0
AC5 rg -n "producer_slug" scripts/generate-session-manifest.mjs exit 0
AC6 rg -n "ci:session-manifest" .github/workflows/session-manifest.yml exit 0
AC7 runtime_only — deferred to CI run skipped
AC8 rg -rn "ci:session-manifest" tests/ exit 0

Allowed Paths Compliance

All changes are within Allowed Paths:

  • docs/schemas/agent-session-manifest.schema.json
  • .github/workflows/session-manifest.yml
  • scripts/generate-session-manifest.mjs
  • tests/

Contract Snapshot

#547 (comment)

AC7 (deferred)

AC7 (pnpm manifest:check artifacts/agent-session-manifest-ci.json) is deferred to CI run per contract. The session-manifest workflow's validate-generated-artifact step will generate an artifact with phase_instance_id: ci:session-manifest:<run_id>:<run_attempt> and run pnpm manifest:check against it.

…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]>
@squne121

squne121 commented Jun 1, 2026

Copy link
Copy Markdown
Owner Author

Verification Results for Issue #547

All Acceptance Criteria verified successfully in worktree branch worktree-issue-547-agent-session-manifest-schema-phase-inst.

Verification Summary

AC Verification Command Result Exit Code Status
AC1 Schema pattern validates ci:session-manifest:12345678:1 Pattern: ci:[a-z0-9_.-]+:[1-9][0-9]*:[1-9][0-9]* 0 PASS
AC2 Backward compat: issue-432:impl:001 format Pattern includes: issue-[0-9]+:[a-z_]+:[0-9]{3} 0 PASS
AC3 Malformed CI ID rejection (0 values, spaces, missing parts) All negative test cases in test suite 0 PASS
AC4 Script accepts ci:session-manifest:12345678:1 format Validation pattern in generate-session-manifest.mjs line 228 0 PASS
AC5 --help lists both formats + error messages Both formats with examples in help text 0 PASS
AC6 Workflow uses ci:session-manifest:${{ github.run_id }}:${{ github.run_attempt }} Line 53 of .github/workflows/session-manifest.yml 0 PASS
AC7 CI artifact validation (runtime_only) Deferred to CI execution 77 SKIP
AC8 TypeScript tests cover positive/negative cases agent-session-manifest-phase-instance-id.test.ts: 16 test cases 0 PASS

Quality Gate Results

Gate Command Result Exit Code Status
TypeCheck pnpm typecheck No errors 0 PASS
Lint pnpm lint No errors 0 PASS
Unit Tests pnpm test 288 passed / 16 files 0 PASS
Build pnpm build Successful 0 PASS
TEST_VERDICT:
  result: PASS
  mergeable: MERGEABLE
  merge_state_status: BLOCKED
  baseline_only: false
  verification_commands_pass: 7
  verification_commands_fail: 0
  verification_commands_skip: 1
  runtime_ac_results: []

Implementation Details

  • Schema: Line 218 of docs/schemas/agent-session-manifest.schema.json implements the combined regex pattern supporting both legacy and CI formats
  • Script: scripts/generate-session-manifest.mjs (line 228) validates phase_instance_id with matching pattern and provides detailed error messages for both format families
  • Tests: Comprehensive test suite in tests/agent-session-manifest-phase-instance-id.test.ts validates:
    • CI format: ci:session-manifest:12345678:1 (accepted)
    • Legacy format: issue-432:impl:001 (backward compat)
    • Rejection of: spaces in slug, run_id=0, run_attempt=0, missing run_attempt, empty slug, uppercase in slug
  • Workflow: .github/workflows/session-manifest.yml correctly uses GitHub context variables for run_id and run_attempt
  • Mergeable Status: Currently BLOCKED (expected state — not a verification failure)

@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=CLEAN

Note: TEST_VERDICT_MACHINE recorded merge_state_status: BLOCKED, but gh pr view returns CLEAN. Using current API value (CLEAN).

Evidence Check

  • AC coverage: 8/8 covered. AC7 is deferred (runtime_only) with CI validate-generated-artifact job passing on head SHA 14bd681.
  • Allowed Paths: All 4 changed files within allowed paths.
  • CI Verification: All checks pass (build, e2e, lint, python-test, test, typecheck, validate-generated-artifact) on head SHA 14bd681.
  • 検証コマンド結果: TEST_VERDICT_MACHINE (v1) present, 7 pass / 1 skip (AC7 runtime_only deferred). Quality gates (typecheck/lint/test/build) all PASS.

Blockers

  1. Schema Change Applicability section missing (Step 4.5): docs/schemas/agent-session-manifest.schema.json is agent_session_manifest/v1 — an Initial Known Schema in docs/dev/schema-governance.md. PR diff modifies this schema's phase_instance_id pattern. A ## Schema Change Applicability section with schema_change_applicability: schema_change (or not_schema_change with justification) is required per PR_REVIEW_JUDGE_APPROVE_PROHIBITION_SKIP_FALLBACK.

  2. Schema Consumer Inventory section missing (Step 4.5): The agent_session_manifest/v1 schema lists consumers: pr-review-judge, impl-review-loop, pilot smoke test issue, future aggregation script. A ## Schema Consumer Inventory section must be present listing each consumer, the before/after diff (pattern change), and update status per schema-governance.md. This is an additive/compatible change (new format added, old format preserved), but the consumer inventory must be documented.

  3. Safety Claim Matrix section missing (Step 4.6): .github/workflows/session-manifest.yml matches .github/workflows/**, triggering the safety-sensitive path rule. A ## Safety Claim Matrix section is required with columns: Claim / Implemented? / Not controlled / Evidence / Follow-up.

Non-blockers

  • AC7 verification_commands_skip: 1 in TEST_VERDICT_MACHINE: The CI validate-generated-artifact job passed on the same head SHA (run 26753571325, conclusion=success), providing CI_CHECK_RUN_SCOPED evidence for the runtime_only deferred AC. This is not treated as an additional blocker given the explicit deferred contract and passing CI evidence.

LOOP_VERDICT

verdict: REQUEST_CHANGES
blockers:
  - schema_change_applicability_section_missing
  - schema_consumer_inventory_section_missing
  - safety_claim_matrix_section_missing
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 14bd681a677dd4becdf160a5ed15ccd8673483f7
recommendations: []
follow_up_issue_requests: []

@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=CLEAN

Note: TEST_VERDICT_MACHINE recorded merge_state_status: BLOCKED, but gh pr view returns CLEAN. Using current API value (CLEAN).

Evidence Check

  • AC coverage: 8/8 covered. AC7 is deferred (runtime_only) with CI validate-generated-artifact job passing on head SHA 14bd681.
  • Allowed Paths: All 4 changed files within allowed paths.
  • CI Verification: All checks pass (build, e2e, lint, python-test, test, typecheck, validate-generated-artifact) on head SHA 14bd681.
  • 検証コマンド結果: TEST_VERDICT_MACHINE (v1) present, 7 pass / 1 skip (AC7 runtime_only deferred). Quality gates (typecheck/lint/test/build) all PASS.

Blockers

  1. Schema Change Applicability section missing (Step 4.5): docs/schemas/agent-session-manifest.schema.json is agent_session_manifest/v1 — an Initial Known Schema in docs/dev/schema-governance.md. PR diff modifies this schema's phase_instance_id pattern. A ## Schema Change Applicability section with schema_change_applicability: schema_change (or not_schema_change with justification) is required per PR_REVIEW_JUDGE_APPROVE_PROHIBITION_SKIP_FALLBACK.

  2. Schema Consumer Inventory section missing (Step 4.5): The agent_session_manifest/v1 schema lists consumers: pr-review-judge, impl-review-loop, pilot smoke test issue, future aggregation script. A ## Schema Consumer Inventory section must be present listing each consumer, the before/after diff (pattern change), and update status per schema-governance.md. This is an additive/compatible change (new format added, old format preserved), but the consumer inventory must be documented.

  3. Safety Claim Matrix section missing (Step 4.6): .github/workflows/session-manifest.yml matches .github/workflows/**, triggering the safety-sensitive path rule. A ## Safety Claim Matrix section is required with columns: Claim / Implemented? / Not controlled / Evidence / Follow-up.

Non-blockers

  • AC7 verification_commands_skip: 1 in TEST_VERDICT_MACHINE: The CI validate-generated-artifact job passed on the same head SHA (run 26753571325, conclusion=success), providing CI_CHECK_RUN_SCOPED evidence for the runtime_only deferred AC. This is not treated as an additional blocker given the explicit deferred contract and passing CI evidence.

LOOP_VERDICT

verdict: REQUEST_CHANGES
blockers:
  - schema_change_applicability_section_missing
  - schema_consumer_inventory_section_missing
  - safety_claim_matrix_section_missing
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 14bd681a677dd4becdf160a5ed15ccd8673483f7
recommendations: []
follow_up_issue_requests: []

@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=CLEAN

Evidence Check

  • AC coverage: 8/8 addressed (AC7 deferred/runtime_only with CI validate-generated-artifact PASS on head SHA 14bd681)
  • Allowed Paths: 遵守(4 files, all within Allowed Paths)
  • CI Verification: all 7 checks pass on head SHA 14bd681 (build/e2e/lint/python-test/test/typecheck/validate-generated-artifact)
  • TEST_VERDICT_MACHINE: present, verification_commands_pass=7, skip=1 (AC7 runtime_only/deferred — satisfying deferred_verification_condition confirmed via validate-generated-artifact CI pass)
  • 前回 blockers (Schema Change Applicability section, Safety Claim Matrix section): 両セクションが PR body に追加済み

Blockers

B1: Schema Consumer Inventory — rg command output missing (APPROVE_PROHIBITED)

Skill rule: "consumer 列挙コマンド(rg 等)の出力結果が PR 本文に含まれていない → APPROVE 禁止"

## Schema Consumer Inventory セクションは存在するが、rg 等による consumer 検索コマンドの実行結果が PR 本文に含まれていない。consumer table のみでは不十分。

schema-governance.md の agent_session_manifest/v1 detection pattern:
rg -n "agent_session_manifest/v1\|agent_session_manifest:v1\|agent-session-manifest" .

の出力結果を PR 本文に追加してください。

B2: Safety Claim Matrix — 必須列が不足 (APPROVE_PROHIBITED)

Skill rule: "Safety Claim Matrix の必須列: Claim / Implemented? / Not controlled / Evidence / Follow-up"

現在の matrix は 対象ファイル / 変更内容 / Safety 影響 / Claim 列を持つが、Implemented? / Not controlled / Evidence / Follow-up 列が存在しない。

.github/workflows/ パスへの変更により safety-sensitive PR と判定される。Not controlled 列と Evidence 列が存在しないため、APPROVE 禁止条件(Not controlled 評価・Evidence と VC の対応確認)を検証できない。

必須5列(Claim / Implemented? / Not controlled / Evidence / Follow-up)を含む形式に更新してください。本 PR の場合、Not controlled は空(workflow の ID 生成変更のみで security boundary 変更なし)、Evidence は pnpm test 288 passed / validate-generated-artifact CI pass を指すことが想定されます。

Non-blockers

なし(前回指摘の3セクション追加・CI pass・AC coverage はすべて解消)

LOOP_VERDICT

LOOP_VERDICT:
  verdict: REQUEST_CHANGES
  blockers:
    - id: B1
      rule: SCHEMA_CONSUMER_INVENTORY_RG_OUTPUT_MISSING
      summary: "Schema Consumer Inventory に rg コマンド出力結果が含まれていない"
    - id: B2
      rule: SAFETY_CLAIM_MATRIX_REQUIRED_COLUMNS_MISSING
      summary: "Safety Claim Matrix の必須列 (Implemented? / Not controlled / Evidence / Follow-up) が存在しない"
  mergeable: MERGEABLE
  mergeStateStatus: CLEAN
  reviewed_head_sha: 14bd681a677dd4becdf160a5ed15ccd8673483f7
  recommendations: []
  follow_up_issue_requests: []

@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=CLEAN

Evidence Check

  • AC coverage: 8/8 — AC1-AC6 and AC8 PASS; AC7 deferred per Issue #547 contract (decision: deferred, destination: validate-generated-artifact CI step, CI check passed on head SHA 14bd681)
  • Allowed Paths: compliant — all changed paths (docs/schemas/agent-session-manifest.schema.json, .github/workflows/session-manifest.yml, scripts/generate-session-manifest.mjs, tests/) are within Allowed Paths
  • CI Verification: all 7 checks pass on head SHA 14bd681 (runs 26753571393 / 26753571325, conclusion=success); validate-generated-artifact satisfies deferred AC7 condition
  • TEST_VERDICT_MACHINE: present, head SHA matches, verification_commands_pass=7, verification_commands_skip=1 (AC7 with explicit deferred waiver in contract)

Iteration 2 Blockers (resolved)

  1. Schema Consumer Inventory — rg コマンド出力が追加済み (7 lines of actual output)
  2. Safety Claim Matrix — 5 列形式 (Claim / Implemented? / Not controlled / Evidence / Follow-up) に修正済み

Blockers

なし

Non-blockers

なし

LOOP_VERDICT

verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 14bd681a677dd4becdf160a5ed15ccd8673483f7
recommendations: []
follow_up_issue_requests: []

@squne121

squne121 commented Jun 1, 2026

Copy link
Copy Markdown
Owner Author

判定: APPROVE寄り。ただし Draft 解除前に 1 件だけ補強推奨

現状の実装は、Issue #547 の目的である「phase_instance_id を衝突リスクのない CI-native ID にする」には到達しています。PR は Draft 状態ですが、差分としては 4 files / +157 / -10、head SHA 14bd681、CI の validate-generated-artifact も成功しています。([GitHub]1) ([GitHub]1)

良い点

PHASE_SEQ=(run_id + run_attempt) % 1000 を廃止し、workflow が ci:session-manifest:${{ github.run_id }}:${{ github.run_attempt }} を直接渡すようになった点は正しいです。GitHub 公式 docs でも github.run_id は repository 内の workflow run ごとの一意値で、re-run では変わらず、github.run_attempt は同一 run の試行ごとに 1 から増える値とされているため、この 2 つの組み合わせは #540 の 1000 通り衝突問題を実質的に解消します。([GitHub]2) ([GitHub Docs]3)

schema 側も旧 issue-[0-9]+:[a-z_]+:[0-9]{3} を残した OR pattern になっており、後方互換を壊していません。JSON Schema の pattern は暗黙 anchor されないため、^...$ を明示している点も妥当です。([GitHub]2) ([JSON Schema]4)

関連 Issue との整合も概ね取れています。#547 は ci:<producer_slug>:<run_id>:<run_attempt> 形式の受け入れ、generator の validation 更新、workflow の PHASE_SEQ 廃止、unit test 追加を明示しており、PR 差分はその範囲に収まっています。([GitHub]5) ([GitHub]5)

敵対的に見た懸念

Blocker ではないが、CLI integration test が薄いです。
新規 test は validateManifestAgainstSchema() に manifest object を渡す schema validation 寄りで、node scripts/generate-session-manifest.mjs ... --phase-instance-id ci:... --validate を実際に spawn していません。generator 側の regex と schema regex が将来 drift しても、現状の新規 test だけでは検知しにくいです。([GitHub]6) ([GitHub]6)

追加するなら、以下の 3 ケースで十分です。

it('generator accepts CI-native phase_instance_id with --validate', async () => {
  const result = await execa('node', [
    'scripts/generate-session-manifest.mjs',
    '--repository', 'squne121/loop-protocol',
    '--phase-main-loop', 'impl',
    '--phase-ledger-phase', 'post_commit_verification',
    '--phase-instance-id', 'ci:session-manifest:12345678:1',
    '--actor-type', 'github_action',
    '--actor-name', 'session-manifest-workflow',
    '--evidence-source-kind', 'ci_check',
    '--evidence-source-ref', 'https://github.com/squne121/loop-protocol/actions/runs/12345678',
    '--evidence-visibility', 'private_artifact',
    '--format', 'json',
    '--validate',
  ])

  const manifest = JSON.parse(result.stdout)
  expect(manifest.phase.phase_instance_id).toBe('ci:session-manifest:12345678:1')
})

加えて、invalid case と help/error 文言も実行テストにしてください。

// invalid
ci:session-manifest:0:1
ci:session-manifest:12345678:0
ci:session manifest:12345678:1

// help / stderr
issue-<N>:<phase>:<seq>
ci:<producer_slug>:<run_id>:<run_attempt>

producer_slug は schema 上は任意 slug なので、固定 slug という説明は規約止まりです。
#547 は producer_slug を GitHub workflow name ではなく schema-safe な固定 slug とする、と明記していますが、schema pattern は ci:[a-z0-9_.-]+:... であり、test でも ci:my-workflow.v2:12345678:1 を valid にしています。これは Issue の pattern 指定とは整合しますが、「session-manifest だけを許可したい」なら schema を ci:session-manifest:... に狭める必要があります。現状は「将来 producer を増やせる一般形式」と解釈すべきです。([GitHub]5) ([GitHub]2) ([GitHub]2)

CI に Node.js 20 action deprecation warning が出ています。
これは PR #551 の直接 blocker ではありませんが、GitHub Checks に actions/checkout@v4, actions/setup-node@v4, actions/upload-artifact@v4, pnpm/action-setup@v4 が Node.js 20 action として警告表示されています。別 Issue で runner/action runtime の Node 24 対応を追うのが妥当です。([GitHub]1)

GitHub に貼るレビュー案

## Verdict: APPROVE with non-blocking test hardening

#547 の主目的である `phase_instance_id` の CI-native 化は満たしています。旧 `issue-<N>:<phase>:<seq>` 形式を維持したまま、schema / generator / workflow が `ci:<producer_slug>:<run_id>:<run_attempt>` を受け付けるようになっており、#540 の `(run_id + run_attempt) % 1000` による衝突リスクは解消されています。

Blocker はありません。

Non-blocking:
1. `tests/agent-session-manifest-phase-instance-id.test.ts` は schema validation 中心なので、generator CLI を実際に spawn する integration test を追加すると品質が上がります。
   - positive: `node scripts/generate-session-manifest.mjs ... --phase-instance-id ci:session-manifest:12345678:1 --validate` が exit 0
   - negative: `ci:session-manifest:0:1`, `ci:session-manifest:12345678:0`, `ci:session manifest:12345678:1` が exit 1
   - help/error: `issue-<N>:<phase>:<seq>` と `ci:<producer_slug>:<run_id>:<run_attempt>` の両方を含む
2. `producer_slug` は schema 上は任意 `[a-z0-9_.-]+` なので、「session-manifest 固定」ではなく「固定 slug を使う producer registry 形式」として扱うのが正確です。session-manifest のみ許可したい場合は別 Issue で schema を狭めてください。
3. Checks に Node.js 20 action deprecation warning が出ているため、別 Issue で Node 24 対応を追うとよいです。

LOOP_VERDICT:
  verdict: APPROVE
  blockers: []
  recommendations:
    - add_generator_cli_integration_tests_for_ci_phase_instance_id
    - track_node20_action_deprecation_as_followup

このままなら「Draft を解除して merge 可」でよいです。CLI integration test は merge 前に入れられるなら入れた方が堅いですが、現行 PR の scope では blocker 扱いにしません。

squne121 and others added 2 commits June 1, 2026 21:20
… 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]>
@squne121
squne121 marked this pull request as ready for review June 1, 2026 12:21
@squne121
squne121 merged commit 697ca53 into main Jun 1, 2026
7 checks passed
@squne121
squne121 deleted the worktree-issue-547-agent-session-manifest-schema-phase-inst branch June 1, 2026 12:35
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.

実装: agent_session_manifest schema の phase_instance_id を CI-native 形式(ci:<workflow>:<run_id>:<run_attempt>)に対応させる

1 participant