Skip to content

feat: add entirecli schema admission contract (#1134) - #1178

Merged
squne121 merged 5 commits into
mainfrom
worktree-issue-1134-schema-admission-entirecli-safety
Jun 26, 2026
Merged

squne121 merged 5 commits into
mainfrom
worktree-issue-1134-schema-admission-entirecli-safety

Conversation

@squne121

@squne121 squne121 commented Jun 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • agent_run_report schema に public_safety.entirecli_safety の EntireCLISafetyResult/v1 admission 契約を追加しました。
  • この PR は EntireCLISafetyResult/v1 を present のときに admit するだけで、public report で public_safety.entirecli_safety を required にはしていません。
  • entirecli_safety が無い current generated reports も、producer / posting / retro enforcement follow-up までは引き続き valid であり、今回の変更だけでは失敗させません。
  • public surface では blocked と raw_values_emitted: true を schema で reject し、safe / not_applicable だけを許可する cross-field 制約を追加しました。
  • bad schema_version negative fixture/test を追加し、entirecli_safety_result/v2 のような値が schema/current validator で fail することを確認しました。
  • checked_surfaces.entire_version は non-authoritative diagnostic fingerprint として扱い、raw version/provenance を証明する authoritative な field ではないことを docs に明記しました。
  • telemetry safe 条件は top-level telemetry を正本として優先し、legacy strategy_options.telemetry は互換入力、未設定は blocked と明記しました。

受け入れ条件の達成状況

  • AC1: public_safety.entirecli_safety と required fields を schema に追加済みです。
  • AC2: EntireCLISafetyResult/v1 の exact shape と public surface admission 制約を schema に追加済みです。
  • AC3: valid / invalid fixture と Ajv compile / current validator のテストを追加済みです。
    • 追加の negative fixture: invalid-public-entirecli-bad-schema-version.json
  • AC4: docs/dev/agent-run-report.md に schema-admission のみを扱い、runtime enforcement は後続 scope と明記済みです。

Checks

  • pnpm typecheck : 型検査
  • pnpm lint : lint 検査
  • pnpm test : テスト実行
  • pnpm build : build 検証

検証コマンド結果

  • Verification Commands(issue contract の確認コマンド):
    • rg -n '"entirecli_safety"' docs/schemas/agent-run-report.schema.json
    • rg -n '"const": "entirecli_safety_result/v1"' docs/schemas/agent-run-report.schema.json
    • test -f tests/fixtures/agent-run-report/invalid-public-entirecli-blocked.json
    • rg -n 'schema-admission のみを扱い、producer 接続・posting / retro index の fail-closed enforcement は後続 scope' docs/dev/agent-run-report.md
  • Focused schema/validator tests(追加した schema admission の重点確認):
    • rtk vitest run tests/agent-run-report-schema.test.ts tests/agent-logs/entirecli-report-field.test.ts tests/agent-logs/generated-report-validation.test.ts
CI_TEST_PERFORMANCE_DECISION_V1:
  schema: CI_TEST_PERFORMANCE_DECISION_V1
  issue_number: 1134
  pr_number: 1178
  decision_scope: docs_only
  changed_paths:
    - docs/dev/agent-run-report.md
    - docs/schemas/agent-run-report.schema.json
    - tests/agent-logs/entirecli-report-field.test.ts
    - tests/agent-logs/generated-report-validation.test.ts
    - tests/agent-run-report-schema.test.ts
    - tests/fixtures/agent-run-report/invalid-public-entirecli-bad-schema-version.json
    - tests/fixtures/agent-run-report/invalid-public-entirecli-blocked.json
    - tests/fixtures/agent-run-report/invalid-public-entirecli-missing-field.json
    - tests/fixtures/agent-run-report/invalid-public-entirecli-raw-values.json
    - tests/fixtures/agent-run-report/invalid-public-entirecli-unknown-key.json
    - tests/fixtures/agent-run-report/invalid-public-entirecli-unknown-verdict.json
    - tests/fixtures/agent-run-report/valid-public-entirecli-not-applicable.json
    - tests/fixtures/agent-run-report/valid-public-entirecli-safe.json
  lane_classification:
    fast_static:
      applicable: false
      evidence:
        - docs/schema/tests 変更で .github/workflows や src 変更はない
      required_commands: []
    python_unit:
      applicable: true
      evidence:
        - docs/schemas/agent-run-report.schema.json と tests/** を変更しており schema validator / vitest 影響がある
      required_commands:
        - pnpm test
    contract_artifact:
      applicable: true
      evidence:
        - schema admission 契約と fixture 群を更新している
        - docs/dev/agent-run-report.md は artifact contract の説明を更新している
      required_commands:
        - pnpm test
        - pnpm typecheck
        - pnpm lint
        - pnpm build
    integration:
      applicable: false
      evidence:
        - runtime wiring や src 変更はなく integration lane 対象外
      required_commands: []
  baseline_inputs:
    ci_runtime_baseline_v1_available: false
    run_count: 0
    p50_p95_ready: false
  artifact_consistency:
    ci_test_selection_v1_checked: true
    missing_pytest_args: []
  risk_flags:
    - docs_only_no_runtime_delta
    - baseline_insufficient
  reviewer_gate:
    approve_allowed: true
    required_evidence:
      - TEST_VERDICT_MACHINE
      - CI_CHECK_RUN_SCOPED
    approve_denied_reason: null
  follow_up_required: []

Schema Change Applicability

この変更は report schema の admission 契約を更新する schema change として扱います。

  • decision: schema_change
  • rationale: docs/schemas/agent-run-report.schema.json に public_safety.entirecli_safety を追加し、public report admission の cross-field 制約を更新したため schema change として扱います。

Schema Consumer Inventory

schema consumer への影響範囲を、変更前後の比較として以下に整理します。

before

  • agent_run_report/v1 schema には public_safety.entirecli_safety が存在せず、EntireCLI checker の結果は report schema に admission されていませんでした。
  • tests/agent-logs/entirecli-report-field.test.ts は checker result の構造保持のみを見ており、Ajv compile や public report invalid fixture を検証していませんでした。

after

  • agent_run_report/v1 schema に public_safety.entirecli_safety を追加し、schema_version / verdict / reason_codes / raw_values_emitted / checked_surfaces を required として固定しました。
  • ただし public report で entirecli_safety 自体を required にはしておらず、present のときだけ EntireCLISafetyResult/v1 admission を検証します。
  • invalid-public-entirecli-bad-schema-version.json を追加し、wrong schema_version が schema/current validator の両方で fail することを検証しました。
  • checked_surfaces.entire_version は diagnostic fingerprint の note を docs に追加し、release provenance の証明には使わない non-authoritative 情報だと明記しました。
  • telemetry safe 条件の docs を top-level telemetry 優先 / legacy strategy_options.telemetry 互換入力 / 未設定 blocked に修正しました。
Consumer ファイル 更新有無 備考
docs/schemas/agent-run-report.schema.json yes EntireCLISafetyResult/v1 と public surface cross-field 制約を追加
docs/dev/agent-run-report.md yes optional admission / telemetry precedence / diagnostic fingerprint note を追記
tests/agent-run-report-schema.test.ts yes bad schema_version negative fixture を追加
tests/agent-logs/entirecli-report-field.test.ts yes checker result を report schema に埋めた admission 判定
tests/agent-logs/generated-report-validation.test.ts yes current validator で bad schema_version fixture を検証
tests/fixtures/agent-run-report/*entirecli*.json yes valid / invalid fixture 群を追加
scripts/lib/agent-run-report-validation.mjs no schema consumer。新 schema を読むだけ
scripts/agent-logs/lib/report-builder.mjs no producer 接続は out-of-scope
scripts/agent-logs/finalize-agent-run.mjs no entirecli_safety の生成必須化は今回行わない
scripts/agent-logs/lib/validate-final-report.mjs no schema consumer として既存 validator 経由で新 schema を読むのみ
scripts/agent-logs/lib/retro-index-builder.mjs no retro index runtime enforcement は out-of-scope

Safety Claim Matrix

この PR は runtime enforcement を広げず、schema admission の説明と検証に限定した変更です。

N/A reason: 変更対象は schema / docs / tests / fixtures のみで、permission・sandbox・auth・workflow など validator 上の safety-sensitive path には該当しません。runtime enforcement は #1134 の out-of-scope であり、本 PR は schema-admission 契約だけを固定します。

Allowed Paths 遵守

Notes

補足として、optional admission と後続 follow-up 境界を再掲します。

@github-actions

github-actions Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #1178 closed).

squne121 commented Jun 25, 2026 •

Copy link
Copy Markdown
Owner Author

検証結果レポート

Issue #1134: 実装: agent_run_report schema に entirecli_safety admission 契約を追加する。

TEST_VERDICT:
  result: PASS
  mergeable: MERGEABLE
  merge_state_status: BEHIND
  branch_behind_main: true
  baseline_only: false
  verification_commands_pass: 4
  verification_commands_fail: 0
  verification_skipped_count: 0
  runtime_ac_results:
    - ac: AC1
      command: "rg -n 'entirecli_safety' docs/schemas/agent-run-report.schema.json"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "schema head で entirecli_safety の定義行を確認"
    - ac: AC2
      command: "rg -n '\"const\": \"entirecli_safety_result/v1\"' docs/schemas/agent-run-report.schema.json"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "schema_version const を確認"
    - ac: AC3
      command: "test -f tests/fixtures/agent-run-report/invalid-public-entirecli-blocked.json"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "fixture file exists"
    - ac: AC4
      command: "rg -n 'schema-admission のみを扱い、producer 接続・posting / retro index の fail-closed enforcement は後続 scope' docs/dev/agent-run-report.md"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "scope boundary 文言を確認"

CI_TEST_PERFORMANCE_DECISION_V1

CI_TEST_PERFORMANCE_DECISION_V1:
  schema: CI_TEST_PERFORMANCE_DECISION_V1
  issue_number: 1134
  pr_number: 1178
  decision_scope: docs_only
  changed_paths:
    - docs/dev/agent-run-report.md
    - docs/schemas/agent-run-report.schema.json
    - tests/agent-run-report-schema.test.ts
    - tests/agent-logs/entirecli-report-field.test.ts
    - tests/agent-logs/generated-report-validation.test.ts
    - tests/fixtures/agent-run-report/invalid-public-entirecli-blocked.json
    - tests/fixtures/agent-run-report/invalid-public-entirecli-missing-field.json
    - tests/fixtures/agent-run-report/invalid-public-entirecli-raw-values.json
    - tests/fixtures/agent-run-report/invalid-public-entirecli-unknown-key.json
    - tests/fixtures/agent-run-report/invalid-public-entirecli-unknown-verdict.json
    - tests/fixtures/agent-run-report/valid-public-entirecli-not-applicable.json
    - tests/fixtures/agent-run-report/valid-public-entirecli-safe.json
  lane_classification:
    fast_static:
      applicable: false
      evidence:
        - "schemas/** 変更は fast_static 対象外"
        - "docs/schema/test-only 変更で src や workflow の修正はない"
      required_commands: []
    python_unit:
      applicable: true
      evidence:
        - "schema / Vitest fixture を更新しており pnpm test が必要"
      required_commands:
        - "pnpm test"
    contract_artifact:
      applicable: true
      evidence:
        - "schema-admission 契約と docs/fixtures を更新している"
      required_commands:
        - "pnpm test"
        - "pnpm typecheck"
        - "pnpm lint"
        - "pnpm build"
    integration:
      applicable: false
      evidence:
        - "runtime wiring や src の変更はない"
      required_commands: []
  baseline_inputs:
    ci_runtime_baseline_v1_available: false
    run_count: 0
    p50_p95_ready: false
  artifact_consistency:
    ci_test_selection_v1_checked: true
    missing_pytest_args: []
  risk_flags:
    - docs_only_no_runtime_delta
    - baseline_insufficient
  reviewer_gate:
    approve_allowed: true
    required_evidence:
      - TEST_VERDICT_MACHINE
      - CI_CHECK_RUN_SCOPED
    approve_denied_reason: null
  follow_up_required: []

@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, merge_state_status=BEHIND

Evidence Check

  • AC coverage: linked issue #1134 / PR本文 / TEST_VERDICT_MACHINE を照合し、reviewed_head_sha 2e10a068b45f910b18e47ce67088a4360a2ac280 上で AC1-AC4 の根拠は確認できました。
  • Allowed Paths: allowed_paths_review_gate.py は status: ok、changed files 12件すべてが contract snapshot の Allowed Paths 内でした。
  • CI Verification: ci_verdict_summary.py は expected head 一致で status: all_pass、required checks は success でした。
  • 検証コマンド結果: TEST_VERDICT_MACHINE は verification_commands_pass: 4、verification_skipped_count: 0 でした。

Blockers

  • なし

Non-blockers

  • PR 本文に ## 受け入れ条件の達成状況 / ## 検証コマンド結果 / ## Allowed Paths 遵守 の required section 名が無いため、update_pr_body_hygiene が必要です。
  • mergeability は MERGEABLE ですが merge_state_status=BEHIND のため、update_branch が必要です。

LOOP_VERDICT_V2

verdict: APPROVE
reviewed_head_sha: "2e10a068b45f910b18e47ce67088a4360a2ac280"
merge_ready: false
mergeability:
  mergeable: "MERGEABLE"
  merge_state_status: "BEHIND"
blockers: []
required_auto_actions:
  - kind: update_pr_body_hygiene
    executor: implementation-worker
    skill: open-pr.update_pr
    blocking_merge_ready: true
    mechanical: true
  - kind: update_branch
    executor: implementation-worker
    skill: implement-issue.update_branch
    blocking_merge_ready: true
    mechanical: true
    expected_head_sha: "2e10a068b45f910b18e47ce67088a4360a2ac280"
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
  status: ok
allowed_paths_gate_source: review_subagent

@squne121

Copy link
Copy Markdown
Owner Author

検証結果レポート

Issue #1134: 実装: agent_run_report schema に entirecli_safety admission 契約を追加する。

TEST_VERDICT:
  result: PASS
  mergeable: MERGEABLE
  merge_state_status: CLEAN
  branch_behind_main: false
  baseline_only: false
  verification_commands_pass: 4
  verification_commands_fail: 0
  verification_skipped_count: 0
  runtime_ac_results:
    - ac: AC1
      command: "rg -n 'entirecli_safety' docs/schemas/agent-run-report.schema.json"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "current head で entirecli_safety の定義行を確認"
    - ac: AC2
      command: "rg -n '\"const\": \"entirecli_safety_result/v1\"' docs/schemas/agent-run-report.schema.json"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "current head で schema_version const を確認"
    - ac: AC3
      command: "test -f tests/fixtures/agent-run-report/invalid-public-entirecli-blocked.json"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "current head で invalid fixture file exists"
    - ac: AC4
      command: "rg -n 'schema-admission のみを扱い、producer 接続・posting / retro index の fail-closed enforcement は後続 scope' docs/dev/agent-run-report.md"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "current head で scope boundary 文言を確認"

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

Evidence Check

  • AC coverage: linked issue #1134、PR 本文の ## 受け入れ条件の達成状況、current head 向け TEST_VERDICT_MACHINE を照合し、af770a847a51dee203d9dbee9cca9831a19d04a3 上で AC1-AC4 の根拠を確認しました。
  • Allowed Paths: allowed_paths_review_gate.py を current head / linked issue contract で再計算し、status: ok、changed files 12 件すべてが Allowed Paths 内でした。
  • CI Verification: ci_verdict_summary.py は GitHub 詳細取得で待機継続したため raw GitHub fallback に切り替え、gh pr view --json statusCheckRollup で current head の check rollup を確認しました。required checks はすべて SUCCESS で、ci-verdict-summary check 自体も SUCCESS でした。
  • 検証コマンド結果: current head 向け TEST_VERDICT_MACHINE は verification_commands_pass: 4、verification_commands_fail: 0、verification_skipped_count: 0 でした。
  • PR body hygiene: Closes #1134、## 受け入れ条件の達成状況、## 検証コマンド結果、## Allowed Paths 遵守 を current body で確認しました。
  • CI_TEST_PERFORMANCE_DECISION_V1: PR 本文に存在し、reviewer_gate.approve_allowed: true、required evidence は TEST_VERDICT_MACHINE と CI_CHECK_RUN_SCOPED と記載されていました。changed paths は schema/docs/tests/fixtures に限定され、review-only で追加 follow-up はありませんでした。

Blockers

  • なし

Non-blockers

  • なし

LOOP_VERDICT_V2

verdict: APPROVE
reviewed_head_sha: "af770a847a51dee203d9dbee9cca9831a19d04a3"
merge_ready: true
mergeability:
  mergeable: "MERGEABLE"
  merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
  status: ok
allowed_paths_gate_source: review_subagent

@squne121

Copy link
Copy Markdown
Owner Author

結論

判定: REQUEST_CHANGES 寄りの Conditional Approve。
PR #1178 は、#1134 を「schema-admission 契約の固定」に絞った点では概ね正しいです。過去コメントで指摘されていた「schema 追加」と「runtime fail-closed」を混同する問題は、PR 本文と docs でかなり解消されています。PR 本文も runtime enforcement は後続 scope と明記しています。

ただし、#1134 を close して後続 #1153 の前提依存にするなら、まだ誤読されやすい穴があります。 特に「public report で entirecli_safety が必須になった」と読まれる危険がある一方、実際には現行の generated report は entirecli_safety なしで validator を通ります。このズレは安全境界の議論で後続作業を誤誘導し得るため、最低限の追記と negative fixture を要求した方がよいです。


参照した関連文脈

#941 / PR #1131 では EntireCLI safety checker 自体が実装されましたが、agent_run_report schema に entirecli_safety field が存在しなかったため、AC7 は baseline fail、AC8 は deferred_by_stop_condition とされ、schema 統合は別 Issue に切り出されています。

#1134 はその follow-up であり、public_safety.entirecli_safety の exact schema、public surface cross-field admission、valid/invalid fixture、Ajv compile test を追加する scope です。PR #1178 はその scope に沿って schema / docs / tests / fixtures の 12 ファイルを変更しています。

過去の #1134 コメントでは、blocked な EntireCLI result や raw_values_emitted: true を public report に載せられると安全境界を弱める、schema-only では runtime fail-closed に到達しない、grep/file-exists 検証だけでは insufficient、というブロッカーが指摘されていました。今回の PR は blocked と raw value emission を public surface で reject する方向へ修正しています。


良い点

PR は EntireCLISafetyResult/v1 を schema_version const、verdict enum、reason_codes enum、raw_values_emitted boolean、checked_surfaces object として定義し、全 5 フィールドを required にしています。additionalProperties: false も入っているため、shape 固定という #1134 の中核には到達しています。

public surface では entirecli_safety.verdict を safe | not_applicable に制限し、raw_values_emitted: false を要求する root-level allOf が追加されています。public_safety 内部でも、safe は reason_codes: []、not_applicable は ["entire_absent"]、blocked は reason 必須、raw true は blocked + raw_value_redaction_violation 必須という相関制約を入れています。

テストも以前の「report-like object に値を入れるだけ」から進み、checker result を実際に report に埋めて schema validation する形になっています。safe / not_applicable は pass、blocked は public report で fail、safe なのに reason がある場合、raw true、not_applicable なのに entire_absent がない場合も fail するようになっています。

Ajv は strict mode で compile されており、JSON Schema / Ajv の一般的な落とし穴である「未知 keyword や曖昧な schema が静かに無視される」リスクを抑える設定になっています。 Ajv 側も strict mode は schema のミスを静かに無視しないための仕組みとして説明しています。([ajv.js.org]1)


修正要求 1: entirecli_safety は public report でまだ optional。これは明示しないと危険

現行 schema の public_safety.required は redaction_status / checked_by / validator_version / checked_at / verdict / blocked_reasons までで、entirecli_safety は required ではありません。 root-level の public surface 制約も、public_safety に entirecli_safety が存在する場合だけ safe | not_applicable と raw_values_emitted: false を要求します。

これは JSON Schema 的にも当然で、properties に追加しただけでは property は required になりません。required keyword が必要です。([json-schema.org]2)

さらにテストはこの optional 状態を明示的に維持しています。createValidReport() は public_surface_kind: "github_issue_comment" なのに public_safety.entirecli_safety を持たず、generated finalize output もそのまま current validator を pass します。

これは #1134 の「schema-admission のみ」という scope なら許容できます。docs も producer 接続・posting / retro index fail-closed enforcement は後続 scope と明記しています。 ただし、#1153 は #1134 completion を EntireCLI safety verdict の report 統合前提として扱っているため、「#1134 close = public report 必須化完了」と誤読されると危険です。

要求: PR 本文と docs に次を明記してください。

This PR admits EntireCLISafetyResult/v1 when present.
It does not require public_safety.entirecli_safety on public reports.
Current generated reports without entirecli_safety remain valid until producer/posting/retro enforcement follow-up.

可能なら後続 Issue 番号、少なくとも #1153 Child C 相当の依存先を明示してください。


修正要求 2: schema_version const の negative fixture が足りない

AC2 は schema_version const を契約の中心にしています。schema には const: "entirecli_safety_result/v1" が入っていますが、negative fixture/test は missing field、unknown key、unknown verdict、blocked、raw values までで、wrong schema_version を直接落とす fixture がありません。

既存の invalid-public-entirecli-missing-field.json は raw_values_emitted を欠落させているだけで、schema_version 自体の不正値は検証していません。

要求: 次を追加してください。

tests/fixtures/agent-run-report/invalid-public-entirecli-bad-schema-version.json

内容は schema_version: "entirecli_safety_result/v2" または typo にして、tests/agent-run-report-schema.test.ts と generated-report-validation.test.ts のどちらか、できれば両方で fail を確認してください。


修正要求 3: checked_surfaces.entire_version が “redacted fingerprint” として固定されていない

docs は raw URL / raw config path / token を出さず、reason_code と redacted fingerprint のみ許可するとしています。 checker 実装も entire_version を redactFingerprint() に通して checked_surfaces.entire_version へ入れています。

しかし schema 上の entire_version は minLength: 1, maxLength: 80 の任意 string または null です。つまり schema-admission だけ見ると、生の version/banner 文字列や build 情報を入れても通り得ます。 valid fixture は v1.2***[len=12] のような fingerprint 形式を使っていますが、その形式は schema で強制されていません。

要求: v1 で redacted fingerprint のみを schema 契約にするなら、entire_version に pattern を入れてください。例えば checker の現在の出力に合わせるなら次の方向です。

{
  "type": "string",
  "pattern": "^[A-Za-z0-9*]{1,4}\\*{3}\\[len=[1-9][0-9]{0,5}\\]$",
  "maxLength": 32
}

併せて、raw-ish な version 文字列を持つ invalid fixture を追加してください。v1 でそこまで縛らないなら、docs に「entire_version は non-authoritative diagnostic fingerprint であり、release provenance ではない」と明記すべきです。


修正要求 4: docs の telemetry 記述が Entire 公式 config とズレている

repo docs は safe 条件として strategy_options.telemetry が false と書いています。 一方、Entire 公式 docs の settings reference では telemetry は top-level key で、strategy_options は push_sessions / checkpoint_remote / summarize などを持つ object として記載されています。([docs.entire.io]3)

実装側は top-level telemetry を先に読み、strategy_options.telemetry は legacy/alternate として扱っているため、コードは docs より正確です。

要求: docs の safe 条件を次のように修正してください。

effective telemetry setting が false
- official top-level telemetry を優先
- legacy/alternate strategy_options.telemetry は互換入力として扱う
- 未設定は blocked

この修正は実装変更不要の docs hardening です。


Web 調査に基づく高品質化ポイント

Entire 公式 docs では、checkpoint は entire/checkpoints/v1 branch に保存され、通常の git push 時に同じ remote へ push されます。checkpoint remote を分離するには strategy_options.checkpoint_remote に { "provider": "github", "repo": "myorg/checkpoints-private" } のような object を設定します。([docs.entire.io]4)

また checkpoint remote への push 失敗は warning 扱いで、main git push 自体は成功する fail-open 動作です。つまり hook の exit code や push 成功だけでは public-safe の根拠になりません。([docs.entire.io]4) #1153 の「hook は diagnostic/prevention layer であり、最終判定は post-run verifier と public-safe validator が行う」という方針は、この公式挙動と整合しています。

Entire の配布経路は stable / nightly、Homebrew、Scoop、install script、direct binary、source build など複数あります。([docs.entire.io]5) したがって checked_surfaces.entire_version の短い fingerprint だけでは、後から「どの Entire 実装を検査したか」を再現できません。これは #1134 の v1 scope 外でよいですが、entirecli_safety_result/v1 を authoritative evidence として扱わない制約は明記した方が安全です。

推奨 follow-up for v2:

entirecli_safety_result/v2:
  checker_policy_version: string
  checker_commit: sha
  entire_release_channel: stable | nightly | source | unknown
  entire_semver: string | null
  entire_binary_digest: sha256 | null
  checked_at: date-time
  checker_result_digest: sha256

Governance 観点

repo の schema governance は、producer/consumer 境界を越える machine-readable contract を schema と定義し、schema change では consumer inventory を必須にしています。 また consumer 一覧・before/after・各 consumer の更新要否が欠ける schema PR は approve 禁止とされています。

PR 本文には Schema Consumer Inventory があり、#955 の precedent と同じ方向です。ただし敵対的に見るなら、scripts/lib/agent-run-report-validation.mjs の semantic validator 自体は entirecli_safety を個別には見ておらず、schema validation に依存しています。 これは schema-admission scope では妥当ですが、runtime enforcement follow-up では validateReportSemantics() 側にも explicit check を追加した方が reviewer に伝わりやすいです。


そのまま PR に貼れるレビュー文案

## Verdict: REQUEST_CHANGES

#1178 は #1134 を schema-admission scope に狭めた点は妥当です。`EntireCLISafetyResult/v1` の required fields / enum / additionalProperties:false と、public surface 上の blocked / raw_values_emitted rejection は過去 blocker をかなり解消しています。

ただし #1134 を close して後続 #1153 の prerequisite にするなら、次を修正してください。

1. `public_safety.entirecli_safety` は現時点で public report required ではなく、generated public report without entirecli_safety still validates することを PR body/docs に明記してください。これは producer/posting/retro enforcement follow-up の scope であり、この PR は “admit when present” だけです。

2. `schema_version` const の negative fixture がありません。`invalid-public-entirecli-bad-schema-version.json` を追加し、`entirecli_safety_result/v2` 等が schema/current validator で fail することを検証してください。

3. `checked_surfaces.entire_version` は docs 上 redacted fingerprint とされていますが、schema は任意 string maxLength 80 を許しています。`redactFingerprint()` の出力形式を pattern で固定するか、v1 は non-authoritative diagnostic field であり raw version/provenance を証明しないと docs に明記してください。

4. docs の safe 条件は `strategy_options.telemetry=false` と書いていますが、Entire 公式 config では `telemetry` は top-level key です。実装は top-level を優先しており正しいので、docs を “effective telemetry setting” に修正してください。

以上が直れば、schema-admission contract PR としては approve 可能です。runtime fail-closed / required field enforcement / producer wiring は別 PR で扱うべきです。

確認限界

GitHub connector と公開 Web docs に基づくレビューです。ローカル clone / pnpm test の再実行はできていないため、PR 本文の品質ゲート pass は独立再現ではなく PR 側の記録として扱っています。

@squne121

Copy link
Copy Markdown
Owner Author

検証結果レポート

Issue #1134 / PR #1178 current head 3136a7a3b215a385af40c848b7345ed6dcea68de

TEST_VERDICT:
  result: PASS
  pr_number: 1178
  issue_number: 1134
  head_sha: "3136a7a3b215a385af40c848b7345ed6dcea68de"
  verification_commands_pass: 4
  verification_commands_fail: 0
  verification_skipped_count: 0
  runtime_ac_results:
    - ac: AC1
      command: "rg -n '\"entirecli_safety\"' docs/schemas/agent-run-report.schema.json"
      exit_code: 0
      status: pass
      notes: "public_safety.entirecli_safety の schema 定義を確認"
    - ac: AC2
      command: "rg -n '\"const\": \"entirecli_safety_result/v1\"' docs/schemas/agent-run-report.schema.json"
      exit_code: 0
      status: pass
      notes: "schema_version const を確認"
    - ac: AC3
      command: "bash -lc \"test -f tests/fixtures/agent-run-report/invalid-public-entirecli-blocked.json\""
      exit_code: 0
      status: pass
      notes: "issue contract VC を確認"
    - ac: AC4
      command: "rg -n 'schema-admission のみを扱い、producer 接続・posting / retro index の fail-closed enforcement は後続 scope' docs/dev/agent-run-report.md"
      exit_code: 0
      status: pass
      notes: "scope boundary を確認"
  extra_checks:
    - command: "pnpm test -- tests/agent-run-report-schema.test.ts tests/agent-logs/entirecli-report-field.test.ts tests/agent-logs/generated-report-validation.test.ts"
      exit_code: 0
      status: pass
      notes: "81 files / 1123 tests passed"
    - command: "rg -n 'invalid-public-entirecli-bad-schema-version' tests/agent-run-report-schema.test.ts"
      exit_code: 0
      status: pass
      notes: "bad schema_version fixture test added"
    - command: "rg -n 'telemetry' docs/dev/agent-run-report.md"
      exit_code: 0
      status: pass
      notes: "effective telemetry setting の precedence を確認"
    - command: "rg -n 'checked_surfaces.entire_version' docs/dev/agent-run-report.md"
      exit_code: 0
      status: pass
      notes: "diagnostic fingerprint caveat を確認"

CI_TEST_PERFORMANCE_DECISION_V1

CI_TEST_PERFORMANCE_DECISION_V1:
  schema: CI_TEST_PERFORMANCE_DECISION_V1
  issue_number: 1134
  pr_number: 1178
  decision_scope: docs_only
  changed_paths:
    - docs/dev/agent-run-report.md
    - docs/schemas/agent-run-report.schema.json
    - tests/agent-run-report-schema.test.ts
    - tests/agent-logs/entirecli-report-field.test.ts
    - tests/agent-logs/generated-report-validation.test.ts
    - tests/fixtures/agent-run-report/invalid-public-entirecli-bad-schema-version.json
    - tests/fixtures/agent-run-report/invalid-public-entirecli-blocked.json
    - tests/fixtures/agent-run-report/invalid-public-entirecli-missing-field.json
    - tests/fixtures/agent-run-report/invalid-public-entirecli-raw-values.json
    - tests/fixtures/agent-run-report/invalid-public-entirecli-unknown-key.json
    - tests/fixtures/agent-run-report/invalid-public-entirecli-unknown-verdict.json
    - tests/fixtures/agent-run-report/valid-public-entirecli-not-applicable.json
    - tests/fixtures/agent-run-report/valid-public-entirecli-safe.json
  lane_classification:
    fast_static:
      applicable: false
      evidence:
        - "schema / docs / tests 変更であり fast_static のみでは不十分"
      required_commands: []
    python_unit:
      applicable: true
      evidence:
        - "Vitest / fixture 変更のため targeted test run を実施"
      required_commands:
        - "pnpm test"
    contract_artifact:
      applicable: true
      evidence:
        - "schema admission contract と fixtures を更新"
      required_commands:
        - "pnpm test"
        - "pnpm typecheck"
        - "pnpm lint"
        - "pnpm build"
    integration:
      applicable: false
      evidence:
        - "runtime wiring 変更なし"
      required_commands: []
  baseline_inputs:
    ci_runtime_baseline_v1_available: false
    run_count: 0
    p50_p95_ready: false
  artifact_consistency:
    ci_test_selection_v1_checked: true
    missing_pytest_args: []
  risk_flags:
    - docs_only_no_runtime_delta
    - baseline_insufficient
  reviewer_gate:
    approve_allowed: true
    required_evidence:
      - TEST_VERDICT_MACHINE
      - CI_CHECK_RUN_SCOPED
  follow_up_required: []

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

Evidence Check

  • AC coverage: linked issue #1134、PR 本文の ## 受け入れ条件の達成状況、current head 向け TEST_VERDICT_MACHINE を照合し、3136a7a3b215a385af40c848b7345ed6dcea68de 上で AC1-AC4 の根拠を確認しました。
  • Allowed Paths: allowed_paths_review_gate.py を current head / linked issue contract snapshot で再計算し、status: ok、changed files 13 件すべてが Allowed Paths 内でした。
  • CI Verification: ci_verdict_summary.py は GitHub 詳細取得で待機継続したため skill 許容の raw GitHub fallback に切り替え、gh pr view --json statusCheckRollup で current head の required checks が SUCCESS であることを確認しました。
  • 検証コマンド結果: current head 向け TEST_VERDICT_MACHINE は head_sha: 3136a7a3b215a385af40c848b7345ed6dcea68de、verification_commands_pass: 4、verification_commands_fail: 0、verification_skipped_count: 0 でした。
  • Review follow-up closure: review comment #4809908277 の fix_delta(optional admission / bad schema_version fixture / diagnostic fingerprint caveat / telemetry precedence)は current PR body と current-head TEST_VERDICT extra checks で反映を確認しました。
  • PR body hygiene: Closes #1134、## 受け入れ条件の達成状況、## 検証コマンド結果、## Allowed Paths 遵守 を current body で確認しました。
  • CI_TEST_PERFORMANCE_DECISION_V1: PR 本文に存在し、reviewer_gate.approve_allowed: true、required evidence は TEST_VERDICT_MACHINE と CI_CHECK_RUN_SCOPED でした。

Blockers

  • なし

Non-blockers

  • なし

LOOP_VERDICT_V2

verdict: APPROVE
reviewed_head_sha: "3136a7a3b215a385af40c848b7345ed6dcea68de"
merge_ready: true
mergeability:
  mergeable: "MERGEABLE"
  merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
  status: ok
allowed_paths_gate_source: review_subagent

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_run_report schema に entirecli_safety admission 契約を追加する。

1 participant