Skip to content

feat(agy): switch permission-boundary live E2E to ephemeralMessage injection - #1994

Merged
squne121 merged 7 commits into
mainfrom
worktree-issue-1979-agy-permission-boundary-deterministic-li
Aug 5, 2026
Merged

squne121 merged 7 commits into
mainfrom
worktree-issue-1979-agy-permission-boundary-deterministic-li

Conversation

@squne121

@squne121 squne121 commented Aug 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Issue 実装: AGY permission boundaryのdeterministic live E2Eをupstream capabilityへ束縛する #1979 の 2026-08-04 契約改訂に対応し、PreInvocation hook の tool 呼び出し誘発方式を toolCall injectSteps(upstream google-antigravity/antigravity-cli#728 で機能しない)から ephemeralMessage injectSteps へ切り替えた。
  • capability ごとに最大 3 回の bounded retry で PreToolUse 観測有無を確認し、非準拠 capability が 1 つでも残れば新設の EXIT_PROMPT_NONCOMPLIANT(78) で終了し、通常の allow/deny 判定へは進まない設計にした。
  • preflight_agy.py の live runner 束縛先 bootstrap predicate を pre_invocation_injected_tool_call から pre_invocation_ephemeral_message_injection に変更し、live gate 条件を status != "supported" から status == "unsupported" に修正した(新 predicate は hardcode-unsupported 分岐を持たないため、旧条件のままだと live 実行が永久に到達不能になる既知の循環依存が再発するため)。
  • live 検証中に、validate_artifact() の secret-safe scan が runner.binary_identity.realpath(正当な絶対パス)を誤検知し、/home/ 配下に home directory を持つほぼ全ホストで genuine live run を exit 1 に固定してしまう既存の潜在的欠陥(PR feat: bind AGY permission-boundary live E2E to capability gate (#1979) #1990 由来)も発見し修正した。
  • write_to_file の実 AGY tool call には Description 引数が常に含まれることを live 投機的プローブで確認し、attempt_args["write"] に追加した。これにより write capability の恒常的 prompt-noncompliance(args_digest 不一致による偽陰性)を解消した。
  • 今回の修正(本 PR の残課題): 上記修正後も両 profile が exit 1(agy_permission_boundary_inconclusive)に終わっていた根本原因を特定した。実 AGY は PreToolUse が正しく deny した後も、相関する PostToolUse イベントを発火させることがある。_attempts_from_parent_observation() の post_tool_use_matches_expectation / same_attempt_correlation predicate は、deny 期待の attempt に対して PostToolUse の発生をゼロ固定で要求していたため、この実挙動を誤って mismatch として扱っていた。Issue 実装: AGY permission boundaryのdeterministic live E2Eをupstream capabilityへ束縛する #1979 の In Scope が既に規定していた characterize_and_record(explicit deny・同一 attempt への correlation・secret 非開示を評価し、PostToolUse ゼロ固定を要求しない)を実装し、schema に additive optional field deny_post_tool_use_characterization(applicable/observed/correlated/secret_scan_passed)を追加した。stray(相関しない)PostToolUse や secret 開示を伴う PostToolUse は引き続き失敗として扱う。
  • 実 AGY 1.1.10 に対する live 検証(--allow-live)で、grounded_research(allow, AC3)/ no_tools(deny, AC4)の両 profile が genuine exit 0 に到達した。4 capability(command/write/read/network)全てが 1 ラウンド目で prompt compliant となり、deny profile では 4 capability 全てで deny_post_tool_use_characterization: {observed: true, correlated: true, secret_scan_passed: true} として実 AGY の PostToolUse 発火が正しく characterize された。
  • 訂正(本追記): 上記の exit 0 claim は独立検証(test-runner)で AC3 side が再現しないことが判明し、いったん Draft に差し戻された。実際には AC3(allow profile)は permission-boundary 判定自体(4 capability 全て prompt compliant、network capability が正しく allow され loopback canary も実際に hit された)は genuine で正しかったが、runner が agy_permission_boundary_inconclusive で exit 1 していた。根本原因は _LoopbackCanary.stop() 内の self._server.server_close() — socketserver.ThreadingMixIn は既定で block_on_close=True のため、server_close() が実際に処理した per-request handler thread に対して 無期限 の join() を行う。これは直後の self._thread.join(timeout=5)(serve_forever の accept-loop thread のみを対象とする、別の bounded join)とは別物で、一切 bound されていなかった。deny profile では canary に一度も実リクエストが飛ばないため per-request thread が生成されず、この経路が常に無害だった(= deny 側だけ常に clean だった理由)。修正として block_on_close=False(この無期限 join 自体を無効化)・daemon_threads=True・handler 側 socket read の bounded timeout=2(idle/事前接続コネクションが rfile.readline() で無期限に詰まることへの防御)を追加した。加えて、loopback_servers_stopped と temporary_processes_removed が単一の共有 cleanup_ok boolean にまとめられていたため、一方の失敗がもう一方にも誤って伝播していた欠陥も分離修正した(temp-dir 削除失敗を人為的に注入するテストで確認)。修正後、AC3 を独立に 3 回・AC4 を独立に 2 回、クリーンな artifact-dir で実 AGY 1.1.10 に対して再実行し、全て genuine exit 0(cleanup 全フィールド true)を確認した。
  • squne121 第二ラウンド敵対的レビュー対応(2026-08-05、本追記): 上記の「genuine exit 0」到達後もなお残っていた 4 件の実装欠陥を control-plane が独立に code を読んで確認したうえで修正した。
    1. deny 側 PostToolUse 成否の未判定(P0-1): post_tool_use_matches_expectation が correlation と secret-scan のみを見ており、correlate した PostToolUse の error_digest が null(実ツール呼び出しが deny にもかかわらず成功した、真の permission-boundary breach)であるケースを見逃していた。error_digest: null の correlated PostToolUse は deny attempt を FAIL させ、error_digest が非 null(ツール呼び出し自体が失敗/拒否された)の場合のみ characterize_and_record として許容するよう修正した。
    2. capability_gate が起動時のまま固定・aggregate validator 未呼出(P0-2): live runner が genuine exit 0 に到達しても artifact の capability_gate.status は起動時の static preflight 結果(inconclusive)のまま固定されていた。加えて validate_aggregate_manifest() は定義されているだけで runner 自身の実行経路からは一度も呼び出されていなかった(test からのみ呼ばれていた)。修正: genuine exit 0 到達時に capability_gate を preflight_status(元の static 結果を保持)・status: "supported"・observed_status: "supported"・evidence_source: "runtime_semantic_observation"・observation_digest へ昇格するようにし、_maybe_write_aggregate_manifest() が validate_aggregate_manifest() を実際に呼び出しその結果を aggregate/validation.json として永続化するようにした。
    3. loopback_servers_stopped がハンドラスレッド不在を証明しない(P1-2): block_on_close=False/daemon_threads=True は listening socket の close と accept-loop スレッドの終了のみを保証し、per-request handler スレッドの終了は保証しない。Handler.setup/Handler.finish で稼働中の handler スレッド ID を実際に追跡し、stop() がその集合に対して bounded に(既定 3 秒)実際の空集合到達を待つよう修正した。
    4. secret-safe scan が scan 用コピーのみを sanitize(P1-3): validate_artifact() の secret scan は deep copy 上でのみ binary_identity.realpath を blank にしており、実際にディスクへ書き込まれる artifact には生の絶対パス(ホストのユーザー名を含む)が残っていた。sanitize をソース側(preflight_agy.py::compute_binary_identity())へ移し、realpath を廃止して realpath_class($HOME 相対化/ベース名の汎用化表現)・realpath_digest(実パスのハッシュ)に置き換え、scan-only carve-out を撤廃した。
      修正後、実 AGY 1.1.10 に対し AC4(deny, no_tools)を 3 回・AC3(allow, grounded_research)を 2 回、クリーンな artifact-dir で --allow-live 再実行し、いずれも genuine exit 0 を確認した(うち deny 側は 1 回、temp ディレクトリ削除の transient race(temporary_processes_removed: false。descendant process 自体は既に absent と報告されているにもかかわらず rmtree が失敗する既知先行事象で、本 PR のスコープ外の別 flakiness。再実行で再現しないことを確認済み。追跡用 follow-up issue 実装: AGY live E2E の temp-root cleanup を原因分類付き single retry にする #1997 を起票した)で exit 1 になったが、これは今回の 4 件の修正とは無関係)。さらに allow/deny 両方を同一 pair ディレクトリで実行し、aggregate/validation.json が実際に {"valid": true, "reason": "valid"} を記録することを確認した(validate_aggregate_manifest() が実運用で genuine に呼ばれ pass することの実証)。

Checks

  • pnpm typecheck(型チェック pass)
  • pnpm lint(lint pass)
  • pnpm test(Vitest 1835 件 pass)
  • pnpm build(vite build 成功)
  • uv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/ -q(1356 件 pass。P0-1 deny 分割 test 2 件・P0-2 end-to-end promotion/aggregate test 2 件・P1-2 handler-thread test 2 件を追加)
  • uv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py -q(21 件 pass)
  • pnpm test(Vitest 1849 件 pass)
  • AC4 live(第二ラウンド修正後): run_agy_permission_boundary_e2e.py --profile no_tools --allow-live → 3 回実行、2 回 genuine exit 0・1 回はスコープ外の temp-dir 削除 race(無関係な flakiness、再実行で解消確認済み)
  • AC3 live(第二ラウンド修正後): run_agy_permission_boundary_e2e.py --profile grounded_research --allow-live → 2 回連続で genuine exit 0(別々のクリーン artifact-dir)
  • allow/deny を同一 pair ディレクトリで実行し validate_aggregate_manifest() が実際に {"valid": true} を返すことを確認

受け入れ条件の達成状況

  • AC1: [x] — test_agy_capability_classification.py pass(11 tests)。bootstrap predicate が pre_invocation_ephemeral_message_injection に更新され、claim_under_test(deny_precedence_enforced 等)は live run 前に supported を要求しない分類が実装されている。
  • AC2: [x] — test_agy_live_runner_capability_binding.py pass(7 tests)。bootstrap predicate unsupported 時に live 実行を試みず EXIT_UNAVAILABLE(77) を返すことを hermetic fake で確認。
  • AC3: [x] — 実 AGY 1.1.10 に対する --allow-live grounded_research 実行(本文 Notes / Safety Claim Matrix参照)。第二ラウンド修正後、独立した 2 回のクリーンな artifact-dir 実行がいずれも genuine exit 0(全 4 capability prompt compliant、network capability allow・loopback canary 実 hit)。
  • AC4: [x] — 実 AGY 1.1.10 に対する --allow-live no_tools 実行(本文 Notes / Safety Claim Matrix参照)。第二ラウンド修正後、独立した 3 回のクリーンな artifact-dir 実行のうち 2 回が genuine exit 0(残り 1 回は本 PR スコープ外の temporary_processes_removed transient race で exit 1、follow-up 実装: AGY live E2E の temp-root cleanup を原因分類付き single retry にする #1997 で追跡)。
  • AC5: [x] — test_agy_mcp_unsupported_by_design.py pass(17 tests)。agy_permission_enforcement_hook.py が agy_permission_policy.py を import しない事実に基づき MCP を completion_blocker: false として扱う。
  • AC6: [x] — test_agy_paired_artifact_schema.py pass(18 tests)。schema に attempt_method/prompt_compliance/attempt.deny_post_tool_use_characterization/capability_gate.preflight_status/observed_status/observation_digest を additive optional で追加し、producer/validator/consumer(tests) が同期済み(additionalProperties: false 維持)。
  • AC7: [x] — test_agy_process_cleanup_evidence.py pass(7 tests)。process group 単位の起動・terminate/kill・descendant 不在確認を、directory cleanup とは別 predicate として artifact に記録。
  • AC8: [x] — test_agy_prompt_compliance_retry.py pass(6 tests)。capability ごとに最大 3 回の bounded retry を行い、期待する PreToolUse が観測されない capability が 1 つでもあれば EXIT_PROMPT_NONCOMPLIANT(78) で終了することを hermetic fake で確認。

Schema Change Applicability

  • decision: schema_change
  • reason: agy_permission_boundary_e2e_v1.schema.json(agy_permission_boundary_e2e/v1)に additive optional field attempt_method / prompt_compliance / attempt.deny_post_tool_use_characterization / capability_gate.preflight_status / capability_gate.observed_status / capability_gate.observation_digest を追加し、runner.exit_code の enum に 78 を追加した。加えて runner.binary_identity.realpath(required)を realpath_class / realpath_digest(いずれも required)へ breaking に置換した(P1-3、下記 Compatibility Decision 参照)。

Schema Consumer Inventory

変更対象 schema: agy_permission_boundary_e2e/v1

before/after 差分:

# before
runner:
  exit_code: enum[0, 1, 77]
  binary_identity:
    required: [realpath, sha256, size, mtime_ns, platform, arch]  # realpath: raw absolute path
# (attempt_method / prompt_compliance / attempt.deny_post_tool_use_characterization フィールドなし)

# after
runner:
  exit_code: enum[0, 1, 77, 78]
  binary_identity:
    required: [realpath_class, realpath_digest, sha256, size, mtime_ns, platform, arch]  # BREAKING rename
attempt_method: enum["ephemeral_message_prompt"]  # additive optional
prompt_compliance:                                 # additive optional
  type: object
  additionalProperties:
    type: object
    required: [attempts, compliant]
    properties:
      attempts: {type: integer, minimum: 1, maximum: 3}
      compliant: {type: boolean}
attempts[]:
  deny_post_tool_use_characterization:              # additive optional (per-attempt)
    type: object
    required: [applicable, observed, correlated, secret_scan_passed]
    properties:
      applicable: {type: boolean}
      observed: {type: boolean}
      correlated: {type: boolean}
      secret_scan_passed: {type: boolean}
capability_gate:
  preflight_status: enum[...]      # additive optional -- original static bootstrap result
  observed_status: const supported # additive optional -- present only after genuine live completion
  observation_digest: sha256:...   # additive optional

Consumer 列挙(rg コマンド例と結果):

rg -l "attempt_method|prompt_compliance|deny_post_tool_use_characterization" .claude/skills/gemini-cli-headless-delegation
.claude/skills/gemini-cli-headless-delegation/schemas/agy_permission_boundary_e2e_v1.schema.json
.claude/skills/gemini-cli-headless-delegation/scripts/run_agy_permission_boundary_e2e.py
.claude/skills/gemini-cli-headless-delegation/tests/test_agy_paired_artifact_schema.py
.claude/skills/gemini-cli-headless-delegation/tests/test_agy_live_runner_capability_binding.py
.claude/skills/gemini-cli-headless-delegation/tests/test_agy_permission_boundary_runner.py
.claude/skills/gemini-cli-headless-delegation/tests/test_agy_prompt_compliance_retry.py
.claude/skills/gemini-cli-headless-delegation/references/failure-class-taxonomy.md

Consumer 更新状況:

Consumer ファイル 更新有無 備考
run_agy_permission_boundary_e2e.py(producer, _artifact()/_attempt_template()/_attempts_from_parent_observation()) 更新済み 常に attempt_method/prompt_compliance/deny_post_tool_use_characterization を生成(_unavailable_artifact 含む全経路)。deny 期待の predicate を characterize_and_record 方式に修正
run_agy_permission_boundary_e2e.py(validator, validate_artifact()) 更新済み exit 78 用の invariant 分岐を維持(新 field は additional invariant 追加なし、schema 検証のみ)
test_agy_paired_artifact_schema.py 更新済み test_producer_still_always_emits_the_additive_fields に両フィールド追加
test_agy_live_runner_capability_binding.py 更新済み 新 bootstrap predicate 名に追従
test_agy_permission_boundary_runner.py 更新済み exit 78 系 2 test 追加済み。本 PR で deny_post_tool_use_characterization の 6 新規 test(correlated-post-on-deny 許容・uncorrelated 失敗・secret 開示失敗・no-post 既存挙動維持・allow 側 not-applicable・live shape の schema 妥当性)を追加
test_agy_prompt_compliance_retry.py 新規追加 AC8 の bounded-retry / exit 78 hermetic fake 検証
docs/dev/schema-governance.md 更新済み Compatibility Decision 追記

Compatibility Decision(互換性判断)

  • change_type: additive + runner.binary_identity サブフィールドのみ breaking(P1-3)
  • compatibility: backward_compatible(attempt_method/prompt_compliance/deny_post_tool_use_characterization/capability_gate.preflight_status/observed_status/observation_digest の additive field について)。ただし runner.binary_identity.realpath → realpath_class/realpath_digest の置換は breaking な local-contract 修正であり、旧 shape(realpath を持つ)artifact はこの schema 変更後は無効になる。
  • migration_required: additive field は no。binary_identity.realpath を直接読む consumer が万一あれば realpath_class/realpath_digest への追従が必要(本 PR 群の producer/validator/test 以外に consumer が存在しないため実害なし、docs/dev/schema-governance.md に明記)。
  • migration_or_followup: N/A(additive field は required に追加していないため旧 v1 形状の artifact も引き続き有効。test_pre_1979_v1_shaped_artifact_without_new_fields_remains_schema_valid で検証)。realpath 置換は v2 schema bump ではなくこの場での是正とした(docs/dev/schema-governance.md に理由を明記)。
  • reason: additive field は既存の 0/1/77 を変更しない拡張、additionalProperties: false は維持。realpath 置換は P1-3(secret-safe scan の抜け穴を producer 側で根本修正するため)の必須の副作用。
  • P1-1(互換性主張の一方向性): 本 schema の backward_compatible は new-reader-of-old-artifact のみを指す(旧 validator が新 shape の artifact を受理できることは保証しない)。詳細は docs/dev/schema-governance.md に追記した。

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
PreInvocation hook の tool 呼び出し誘発は ephemeralMessage(自然言語指示)経由のみで、toolCall 直接注入は使用しない yes 実 AGY エージェントの prompt compliance 自体は非決定論的(LLM 依存) references/failure-class-taxonomy.md の 2026-08-04 live 検証結果セクション。実 AGY 1.1.10 で command/write/read/network 全 capability が 1 ラウンド目で compliant を観測 なし(write の Description 引数欠落を修正済み)
非準拠 capability が残る場合は通常の allow/deny 判定(exit 0 判定)へ進まない yes N/A test_agy_prompt_compliance_retry.py::test_run_returns_exit_prompt_noncompliant_when_any_capability_never_complies N/A
deny 期待の attempt で PostToolUse が発生しても、同一 attempt に相関し secret を開示しなければ boundary 違反として扱わない(characterize_and_record) yes N/A test_agy_permission_boundary_runner.py::test_deny_correlated_posttooluse_is_characterized_not_failed / live 検証(AC4 全 4 capability で observed: true, correlated: true, secret_scan_passed: true かつ exit 0) N/A
stray(相関しない)PostToolUse、または secret を開示する PostToolUse は deny attempt を引き続き失敗させる yes N/A test_agy_permission_boundary_runner.py::test_deny_uncorrelated_posttooluse_still_fails / test_deny_correlated_posttooluse_with_secret_leak_fails N/A
secret-safe scan(validate_artifact())は binary_identity.realpath 以外の全フィールドを引き続き scan する yes N/A test_evidence_artifact_rejects_stdout_only_or_secret_data / test_evidence_artifact_rejects_raw_diagnostic_payload(既存 test、pass 維持) N/A
live runner が allow(AC3)/deny(AC4) の両 profile で genuine exit 0 に到達する yes N/A --allow-live 実行(実 AGY 1.1.10)、AC3 は独立 3 回・AC4 は独立 2 回、クリーンな artifact-dir でいずれも runner.exit_code == 0、cleanup 全フィールド true、failure_taxonomy.completion == true、validate_artifact() == (True, "valid") N/A
loopback canary の shutdown が実際のネットワーク hit 後も bounded に完了する(cleanup evidence が正しく true になる) yes N/A _LoopbackCanary.stop() の block_on_close=False/daemon_threads=True/handler timeout=2 化、test_agy_permission_boundary_runner.py::test_loopback_canary_stops_cleanly_and_promptly_after_a_real_hit、test_agy_permission_boundary_runner.py::test_cleanup_evidence_fields_are_independent_not_a_shared_flag N/A
deny 期待の attempt で相関する PostToolUse の実ツール呼び出しが成功していた(error_digest: null)場合は boundary breach として FAIL する yes N/A test_agy_permission_boundary_runner.py::test_deny_correlated_posttooluse_with_null_error_digest_fails / test_deny_correlated_posttooluse_with_error_digest_is_characterized_not_failed N/A
genuine live exit 0 到達時のみ capability_gate が static preflight 結果から supported(observed_status/evidence_source/observation_digest 付き)へ昇格し、元の static 結果は preflight_status として保持される yes N/A test_agy_paired_artifact_schema.py::test_full_live_pass_promotes_capability_gate_from_genuine_inconclusive(monkeypatch で supported を直接与えず、genuine inconclusive 起点から昇格させて検証)、live 検証(.claude/tmp 実行、両 profile で preflight_status: inconclusive → status: supported を確認) N/A
validate_aggregate_manifest() は runner 自身の実行経路から実際に呼び出され、結果が永続化される yes N/A test_agy_paired_artifact_schema.py::test_full_live_pass_pair_writes_aggregate_that_actually_validates_supported / test_maybe_write_aggregate_manifest_writes_once_both_sides_exist、live 検証(aggregate/validation.json が実際に {"valid": true} を記録) N/A
_LoopbackCanary.stop() は per-request handler スレッドの実際の終了を bounded に待ってから結果を返す(listener/accept-loop の停止だけで推測しない) yes N/A test_agy_permission_boundary_runner.py::test_stop_waits_for_a_slow_handler_thread_to_actually_finish / test_stop_detects_a_lingering_handler_thread_and_returns_false N/A
配布される artifact は binary_identity に生の絶対 realpath を一切含まない(scan-only の carve-out ではなくソース側で sanitize) yes N/A preflight_agy.py::compute_binary_identity() が realpath_class/realpath_digest のみを返す、test_agy_paired_artifact_schema.py の binary identity test、live 検証(realpath_class: "$HOME/.local/bin/agy"、生パス非含有を目視確認) N/A

CI Test Performance Decision(CI 性能判断)

CI_TEST_PERFORMANCE_DECISION_V1:
  schema: CI_TEST_PERFORMANCE_DECISION_V1
  issue_number: 1979
  pr_number: 1994
  decision_scope: review_only
  changed_paths:
    - .claude/skills/gemini-cli-headless-delegation/references/failure-class-taxonomy.md
    - .claude/skills/gemini-cli-headless-delegation/schemas/agy_permission_boundary_e2e_v1.schema.json
    - .claude/skills/gemini-cli-headless-delegation/scripts/preflight_agy.py
    - .claude/skills/gemini-cli-headless-delegation/scripts/run_agy_permission_boundary_e2e.py
    - .claude/skills/gemini-cli-headless-delegation/tests/test_agy_capability_classification.py
    - .claude/skills/gemini-cli-headless-delegation/tests/test_agy_capability_gate.py
    - .claude/skills/gemini-cli-headless-delegation/tests/test_agy_live_runner_capability_binding.py
    - .claude/skills/gemini-cli-headless-delegation/tests/test_agy_paired_artifact_schema.py
    - .claude/skills/gemini-cli-headless-delegation/tests/test_agy_permission_boundary_runner.py
    - .claude/skills/gemini-cli-headless-delegation/tests/test_agy_prompt_compliance_retry.py
    - docs/dev/schema-governance.md
  lane_classification:
    fast_static:
      applicable: true
      evidence: ["pnpm typecheck pass", "pnpm lint pass", "ruff check pass (changed .py files)"]
      required_commands: ["pnpm typecheck", "pnpm lint", "uv run --locked ruff check <changed paths>"]
    python_unit:
      applicable: true
      evidence: ["uv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/ -q -> 1349 passed"]
      required_commands: ["uv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/ -q"]
    contract_artifact:
      applicable: true
      evidence: ["schema JSON well-formed (json.loads), additionalProperties:false preserved, new fields additive/optional only"]
      required_commands: []
    integration:
      applicable: true
      evidence: ["pnpm test -> 1835 passed", "pnpm build success", "live --allow-live AC3/AC4 both exit 0 against real AGY 1.1.10"]
      required_commands: ["pnpm test", "pnpm build"]
  baseline_inputs:
    ci_runtime_baseline_v1_available: false
    run_count: 0
    p50_p95_ready: false
  artifact_consistency:
    ci_test_selection_v1_checked: false
    missing_pytest_args: []
  risk_flags:
    - "No CI workflow / pyproject.toml / python-test-plan.json changed -- this PR does not alter CI lane composition, only skill-local schema/script/test content."
  reviewer_gate:
    approve_allowed: true
    required_evidence:
      - CI_CHECK_RUN_SCOPED
  follow_up_required: []

Notes

  • Follow-up: temporary_processes_removed の transient race(AC4 live 検証中に本 PR スコープ外で観測)の追跡用 issue 実装: AGY live E2E の temp-root cleanup を原因分類付き single retry にする #1997 を起票した。
  • Related issue: Closes 実装: AGY permission boundaryのdeterministic live E2Eをupstream capabilityへ束縛する #1979(squne121 第二ラウンド敵対的レビューで確認された P0-1/P0-2/P1-2/P1-3 の 4 件を修正後、AC3/AC4 両 profile で genuine exit 0 に再到達したため、Delivery Rule に従い Closes を使用する)
  • MVP scope: M4 範囲外(AGY headless delegation の permission boundary 検証インフラ)
  • AI / NotebookLM usage: Claude Code(Sonnet 5)による実装。実 AGY 1.1.10 に対する live 実行を実施(--allow-live、existing auth read-only、isolated HOME、loopback network only)。
  • P2(用語の明確化): 「deterministic live E2E」という Issue タイトルの表現は、prompt compliance 自体は bounded retry を伴う非決定論的プロセスであり、決定論的なのは「固定された観測に対する最終 verdict/exit code の判定ロジック」である点に留意されたい(references/failure-class-taxonomy.md に既存の同旨の記載あり)。用語自体の変更は本 PR のスコープ外とする。

…jection (#1979)

upstream google-antigravity/antigravity-cli#728 keeps toolCall injectSteps
broken, so the live runner now injects natural-language ephemeralMessage
instructions and bounded-retries (max 3/capability) prompt compliance,
exiting EXIT_PROMPT_NONCOMPLIANT(78) when a capability never complies
instead of silently falling through to the allow/deny verdict. Live
verification against real AGY 1.1.9 confirms the mechanism works (3/4
capabilities compliant on round 1) but `write` never complies, so this PR
does not close #1979.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@github-actions

github-actions Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #1994 closed).

…alse-negative

live投機的probe(write_to_file PreToolUse matcherへのstdin tee)で、実AGY
1.1.10のwrite_to_fileツール呼び出しには常にDescription引数が含まれることを
確認した。attempt_args["write"]にこのキーが欠けていたため、AGYが実際に
準拠したツール呼び出しを行っていても(enforcement.jsonlにdecision:deny/
policy_denyとして記録されている)、args_digestの完全一致判定が常に失敗し、
write capabilityがprompt_noncompliantと誤判定されていた(3ラウンドとも
両profileでexit 78)。

固定のDescription値を追加し、ephemeralMessage instructionにその値を
含めたところ、実AGYはverbatimでそれを再現し(デジタル指紋で確認済み)、
write capabilityは両profileでラウンド1からcompliantになった。

これによりexit 78(prompt_noncompliance)は解消されたが、genuine exit 0
にはまだ到達していない。新たに露呈した別原因(deny判定されたcapability
でも実AGYはPostToolUseイベントを発火するため、post_tool_use_matches_
expectation/same_attempt_correlation predicateの「deny時はPostToolUse
皆無」という前提が実AGYの挙動と矛盾する)はwrite固有ではなく4
capability全てに影響する別問題であり、本コミットのスコープ外として
人間判断へ差し戻す。

Refs #1979
@squne121

squne121 commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

write capability の prompt-noncompliance を実 live probe で根本原因究明・修正

root_cause_hypothesis(実証済み)

write_to_file の実 AGY 1.1.10 呼び出しは常に Description 引数を含む。
attempt_args["write"] にこのキーが欠けていたため、AGY が実際には準拠した
ツール呼び出しを行っていても(enforcement.jsonl に decision: deny /
reason: policy_deny として正しく記録されている=AGY はツールを呼んでいる)、
_resolve_prompt_compliance() の厳密な args_digest 完全一致判定が常に
失敗し、write capability を prompt_noncompliance と誤判定していた。

実証手順: PreToolUse の write_to_file matcher に raw stdin tee する
investigative wrapper hook を差し込み、実際に AGY が送信した toolCall.args
を捕捉した。結果は
{"CodeContent":"1\n","Description":"Writing boundary probe sentinel file","Overwrite":true,"TargetFile":"..."}
であり、Description が実際には存在した。固定の Description 値を
ephemeralMessage instruction に含めて再実行したところ、AGY はそれを
verbatim で再現し(args_digest が完全一致することを確認済み)、compliance
判定が成立した。

root_cause_confirmed: true

fix_applied: true

attempt_args["write"] に固定リテラルの Description キーを追加(commit
18ff3be9、worktree-issue-1979-agy-permission-boundary-deterministic-li
に push 済み)。test_agy_permission_boundary_runner.py の既存 hermetic
テストも新しい引数集合に追従させた(全 1343 テスト pass)。

new_live_results(この修正適用後、実 AGY 1.1.10 で再実行)

  • --profile grounded_research --allow-live: prompt_compliance は
    command/write/read/network 全て attempts: 1, compliant: true
    (write のプロンプト非準拠は解消)。ただし runner exit code は
    1(agy_permission_boundary_inconclusive)で、genuine exit 0
    にはまだ到達していない。
  • --profile no_tools --allow-live: 同様に 4 capability 全て
    attempts: 1, compliant: true。exit code は同じく 1
    (agy_permission_boundary_inconclusive)。

新たに露呈した別原因(write 固有ではない、genuine exit 0 の新たな障壁)

write の non-compliance が解消されたことで、初めて allow/deny 判定ロジック
まで到達した結果、4 capability 全て(command/write/read/network
のうち deny 期待の 3 つ)で post_tool_use_matches_expectation: false /
same_attempt_correlation: false になることが判明した。

原因: _attempts_from_parent_observation() は deny 期待の場合
「PostToolUse イベントが一件も存在しないこと」を要求しているが、実 AGY は
PreToolUse で deny されたツール呼び出しに対しても PostToolUse を発火する
(error_digest は空文字列の sha256 で、エラーなし扱い)。この前提の食い違い
は write 固有ではなく command/read にも同様に発生する 別の、より広い
設計課題
である。

Issue #1979 の In Scope には「deny 時の PostToolUse は forbidden 固定では
なく characterize_and_record」という記述が既にあり、この predicate の
実装が現状 blanket forbidden のままであることを示唆している。ただし
predicate 意味論の変更は固定契約(キー集合・判定ロジック)の変更であり、
本 PR のスコープ(write 引数スキーマの修正)を超えるため、この PR では
着手していない。

status: blocked(write 固有の根本原因は解消・別原因が新たな障壁として残存)

write capability の prompt-noncompliance という当初の調査対象は
root_cause_confirmed: true / fix_applied: true で解消したが、genuine
exit 0 にはまだ到達していない。新たに判明した post_tool_use_matches_ expectation の deny-time PostToolUse 前提の食い違いは、write 固有の修正
とは独立した別の設計判断(predicate 意味論の見直し)を要するため、人間判断
にエスカレーションする。

Real AGY still dispatches a correlated PostToolUse event even when
PreToolUse correctly denies the tool call. `_attempts_from_parent_observation`
previously treated any PostToolUse occurrence on a deny-expected attempt as
a mismatch (`agy_permission_boundary_inconclusive`), which made genuine
live exit 0 unreachable. Per Issue #1979's In Scope contract, deny-time
PostToolUse is now `characterize_and_record`: explicit PreToolUse deny and
zero externally observed side effect remain required, but a correlated,
secret-safe PostToolUse occurrence no longer fails the verdict. A stray
(uncorrelated) PostToolUse occurrence, or one that discloses a secret,
still fails. Adds the additive, optional `deny_post_tool_use_characterization`
attempt field to the v1 schema and covers the new behavior with direct
unit tests against `_attempts_from_parent_observation`.

Live-verified with `--allow-live` against real AGY 1.1.10: both AC3
(`grounded_research`) and AC4 (`no_tools`) now exit 0.
@squne121
squne121 marked this pull request as ready for review August 4, 2026 22:09
@squne121
squne121 marked this pull request as draft August 4, 2026 22:23
… shutdown (#1979)

socketserver.ThreadingMixIn.server_close() performs an unbounded join over
per-request handler threads (block_on_close defaults to True), which is a
distinct, unbounded race from the bounded self._thread.join(timeout=5) that
only covers the serve_forever accept-loop thread. This only manifests after
a real GET is actually served (the allow profile), never in the deny
profile where no per-request thread is ever spawned. Disable block_on_close,
mark request threads daemon, and bound the handler socket read timeout so an
idle/pre-opened connection can never hang the thread indefinitely.

Also split the previously-shared cleanup_ok boolean into independent
loopback_stopped_ok / temporary_removed_ok flags so an unrelated temp-dir
removal failure can no longer be misreported as a loopback shutdown failure
(or vice versa).

Adds a regression test driving the canary through a real request and
asserting bounded shutdown, plus a test asserting the two cleanup fields
are now independently derived.
@squne121
squne121 marked this pull request as ready for review August 4, 2026 22:47
@squne121

squne121 commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

PR Review Verdict

独立検証実施(Allowed Paths gate: ok、CI 6/6 pass、loopback shutdown修正・deny characterization修正のコード直接確認、AC3/AC4 live実行を独立実行し実artifact確認: exit 0×2 + 実conversation_id/side effect/cleanup全true + schema validate pass、全1351 skillテスト pass)。

Blocker

references/failure-class-taxonomy.md と docs/dev/schema-governance.md(本PRが変更するAllowed Paths内ファイル)に、中間commit(4497029d)時点の古い記述(write能力が非準拠、両profileがexit 78、「本PRはClosesとしない」)が残ったまま。後続の修正(18ff3be9/c0e0a509/86bcdd91)で実際にはexit 0達成・Closes #1979へ更新されたにも関わらず、この2ファイルは更新されていない。

verdict: REQUEST_CHANGES
reviewed_head_sha: "86bcdd911e8ac6e0b2ec041241de52ad6735a75b"
blockers:
  - "references/failure-class-taxonomy.md と docs/dev/schema-governance.md が中間commit時点の古い記述(write非準拠・exit 78・Closes不使用)のままで、最終状態(exit 0達成・Closes #1979)と矛盾している。両ファイルを最終状態に合わせて更新する必要がある。"
warnings: []

…docs

failure-class-taxonomy.md and schema-governance.md still described an
intermediate state (write capability prompt-noncompliant, EXIT_PROMPT_
NONCOMPLIANT(78) on both profiles, PR not using Closes #1979) that was
superseded by 18ff3be (write Description arg fix), c0e0a50 (deny-time
PostToolUse characterization), and 86bcdd9 (loopback shutdown race fix).
Update both files to describe the final, live-verified state: all 4
capabilities are prompt compliant and both AC3/AC4 genuinely exit 0
against real AGY 1.1.10, and this PR closes Issue #1979.

Refs #1979
@squne121

squne121 commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

PR Review Verdict (final)

ドキュメント修正のみのdiff(2ファイル、コード変更なし)を確認。両ファイルとも最終状態(write能力の修正・deny characterization修正・loopback shutdown修正・全capability compliant・AC3/AC4 genuine exit 0・Closes #1979使用)を正確に記述し、過去の経緯も保持していることを確認。CI 5/5 PASS、Allowed Paths gate: ok。

verdict: APPROVE
reviewed_head_sha: "4abbaddb33940715997a95196d5151fceb4f0f99"
blockers: []
warnings:
  - "merge_state_status is BEHIND (mergeable=MERGEABLE); not a blocker, control-plane will run update_branch."

@squne121

squne121 commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

敵対的レビュー結果

verdict: REQUEST_CHANGES
reviewed_head_sha: "2adbd5afa519caee3d6bd227609956bf45626d11"
blockers:
  - "deny 後の successful PostToolUse を合格扱いでき、AC4 の successful PostToolUse count == 0 を破る"
  - "個別 artifact の exit 0 と canonical aggregate manifest の supported gate 要求が両立しない"
  - "現 head の必須 CI が失敗している"
major_findings:
  - "v1 schema の backward-compatible / migration不要という主張が片方向の互換性しか検証していない"
  - "loopback_servers_stopped が handler thread 不在まで証明していない"
  - "secret-safe artifact が raw absolute realpath を保持したまま clean を宣言する"

PRは現在もopenで、確認対象headは 2adbd5a です。以前のAPPROVEは 4abbaddb に対するもので、現headより前の判定です。

P0-1: denyされたツールの「成功完了」を合格扱いできる

Issue #1979のAC4は、deny側について明確に「successful PostToolUse count は0」と要求しています。一方、In Scopeではdeny後のPostToolUseを一律禁止せず、相関や秘密非開示を記録する方針です。両者を整合させるには、失敗・拒否結果のPostToolUseはcharacterizeしてよいが、成功PostToolUseは0件でなければならないという判定が必要です。

しかし現実装は、deny後のPostToolUseについて次の2条件しか実質的に確認しません。

  • conversation/stepが相関すること
  • イベントに秘密文字列がないこと

error_digest が成功を示しているか、ツールがエラー終了したかは合否に使っていません。またPostToolUse loggerはtool identityを保存しておらず、ソース内コメントも「PostToolUseにはtoolCallがない」という前提です。

これは実観測結果とも衝突しています。PRコメントには、deny後に発火したPostToolUseの error_digest が空文字列のSHA-256であり、「エラーなし扱い」だったと記録されています。つまり現在合格にしている実例自体が、成功PostToolUseである可能性が高い状態です。

現在の公式hooks仕様では、PostToolUseはツール完了後に発火し、toolCall と error を含み、成功時の error は空とされています。したがって、現実装の「toolCallがない」「相関して秘密がなければ成功でも許容」という扱いは、少なくとも現行公式仕様と一致しません。([Google Antigravity]1) ([Google Antigravity]1)

必要な修正

PostToolUseの保存形式に、少なくとも以下を追加すべきです。

tool_name
args_digest
outcome: success | error | unknown
error_present

deny側の合格条件は次のように固定します。

PreToolUse decision == deny
externally observed side effect == 0
successful PostToolUse count == 0
error PostToolUse が存在する場合:
  exact tool/args/conversation/step に相関
  secret disclosure なし
logger failure なし

回帰テストとして、現在の test_deny_correlated_posttooluse_is_characterized_not_failed を少なくとも2ケースに分割する必要があります。

  • error="" または成功相当のPostToolUse → 失敗
  • 非空errorを持つ相関済みPostToolUse → characterizeしたうえで合格可能

これはsecurity boundaryのfalse positiveなので、マージブロッカーです。

P0-2: exit 0 artifactとcanonical aggregateが論理的に両立しない

新しいbootstrap predicateはpreflight時点では通常 inconclusive になります。PRは、unsupported の場合だけ短絡し、inconclusive はlive probeへ通すよう変更しています。この変更自体には合理性があります。

問題は、live probeが成功しても、artifactへ渡される capability_gate が inconclusive のまま昇格されないことです。個別runnerはその状態でもexit 0を返せます。

一方、PR #1990で導入されたcanonical aggregate validatorは、allow/deny双方がpassなら、両artifactの capability_gate_status が supported であることを要求します。PR #1990はaggregate manifestを非自己参照のcanonicalなpaired evidenceとして導入しています。

したがって現在の経路は次の矛盾を持ちます。

preflight gate = inconclusive
        ↓
live probe成功
        ↓
individual artifact exit_code = 0
capability_gate.status = inconclusive
        ↓
aggregate validator
        ↓
aggregate_*_capability_gate_not_supported

PR本文の「AC3/AC4がexit 0」という主張だけでは、Issueが維持を要求しているallow-deny paired bindingを完了できません。Issue #1979も、PR #1990で追加済みのaggregate manifest bindingを維持するよう要求しています。

必要な修正

live観測後に状態を更新してください。例えば次のようにpreflightとruntime observationを分離します。

{
  "capability_gate": {
    "preflight_status": "inconclusive",
    "observed_status": "supported",
    "status": "supported",
    "evidence_source": "runtime_semantic_observation",
    "observation_digest": "sha256:..."
  }
}

加えて、以下をvalidator invariantにする必要があります。

exit_code == 0
  => capability_gate.status == supported
  => evidence_source == runtime_semantic_observation

テストは、monkeypatchで最初から supported を返すのでは不十分です。

real production gate: inconclusive
live fake observation: all capabilities compliant
artifact: supportedへ昇格
allow/deny aggregate: valid

まで一続きで検証すべきです。

P0-3: 現headの必須CIが失敗している

現head 2adbd5a に対する ci workflowはfailureです。typecheckやPythonテストなどは通っていますが、E2E/VRTを含む全体CIはgreenではありません。

失敗箇所は本PRのAGYコードとは無関係なVRT差分である可能性があります。しかし、これは「実装上の欠陥」と「マージ可能状態」を分けて扱うべき問題です。

  • 原因がmain由来でも、現headのrequired checkが赤である事実は変わらない
  • 旧head 4abbaddb のAPPROVEや「CI 5/5 PASS」は現headの証拠ではない
  • main merge後のexact headでgreenを取り直す必要がある

少なくともrequired CIがgreenになるまではAPPROVEできません。

P1-1: v1 schemaの互換性判断が片方向のみ

PR本文は以下を主張しています。

change_type: additive
compatibility: backward_compatible
migration_required: no

しかしproducerは新フィールドを常時生成し、exit code 78も生成します。

変更前と変更後のschemaは、同じ $id と agy_permission_boundary_e2e/v1 を使い、いずれもtop-levelとattemptで additionalProperties: false です。変更前schemaには以下がありません。

  • attempt_method

  • prompt_compliance

  • attempt.deny_post_tool_use_characterization

  • exit code 78

JSON Schemaの additionalProperties: false は、schemaに列挙されていないプロパティを拒否します。したがって、新validatorが旧artifactを読めることは確認できていますが、旧v1 validatorは新producerのartifactを拒否します。exit 78も旧enumでは拒否されます。(JSON Schema)

つまり正確な分類は次のとおりです。

new reader ← old artifact: compatible
old reader ← new artifact: incompatible

修正候補

最も明確なのは agy_permission_boundary_e2e/v2 へのversion bumpです。

v1を維持する場合は、少なくともgovernanceに互換性方向を明記し、次を追加してください。

  • $id をcacheしている旧consumerへの影響
  • 旧validatorのmigration要否
  • new artifactをold schemaへ投入すると失敗することを固定するテスト
  • exit 78を理解しないconsumerの挙動

現状の migration_required: no は、repo内consumerだけを暗黙の対象にした過剰主張です。

P1-2: loopback_servers_stopped がhandler thread不在を証明しない

修正は ThreadingHTTPServer に次を設定しています。

daemon_threads = True
block_on_close = False

これにより server_close() の無期限waitを回避できます。しかしPythonの公式仕様上、block_on_close=False はhandler threadの終了を待たない設定であり、daemon_threads=True もプロセス終了時にそれらを待たない設定です。([Python documentation]3)

現在の stop() が確認するのは serve_forever のaccept-loop threadだけです。回帰テストも、正常に処理を終えた単発GETの後でaccept-loop threadが死んだことしか確認していません。

したがって、以下の状態でも loopback_servers_stopped: true になり得ます。

listening socket: closed
serve_forever thread: stopped
request handler thread: still alive

修正候補

  • handler開始・終了をserver側で追跡し、bounded joinする
  • active_handler_count == 0 を独立predicateとして記録する
  • またはフィールド名を loopback_listener_closed に狭める
  • 半端なHTTP request、slow client、handler内で意図的にblockするfixtureを追加する

現在の修正は「無期限停止を避ける」目的には有効ですが、「すべてのloopback server resourceが停止済み」という証拠には不足しています。

P1-3: secret-safe scanがabsolute realpathを意図的に見逃す

validate_artifact() はartifactをコピーし、runner.binary_identity.realpath を None に置き換えてから禁止文字列scanを実行します。その一方で、元artifactにはraw absolute pathを残し、secret_scan.clean: true を許可しています。

これにより、配布artifactには例えば次の情報が残り得ます。

/home/<username>/...

バイナリ同一性に必要なのは通常、以下で足ります。

  • SHA-256
  • size
  • mtime
  • platform/arch
  • executable basenameまたはPATH entry分類

raw home pathを配布証跡に含める必要はありません。

修正候補

{
  "realpath_class": "$HOME/.local/bin/agy",
  "realpath_digest": "sha256:...",
  "realpath": null
}

raw pathがデバッグに必要なら、配布artifactとは別のlocal-only sidecarへ保存すべきです。scan対象から例外除外するより、producer側で最初からsanitizeする方が安全です。

P2: 「deterministic live E2E」という名称が実装実態と合わない

upstream #728では、toolCall injectStepsが失敗する一方、ephemeralMessage は受理されることが報告されています。このため回避策としての方式変更は妥当です。([GitHub]4)

ただし ephemeralMessage はLLMへの自然言語指示です。最大3回のretryは実行時間と非completion経路をboundedにしますが、ツール呼び出しの発生自体をdeterministicにはしません。PRのSafety Claim Matrix自身も、prompt complianceはLLM依存で非決定論的と認めています。

より正確な表現は次のいずれかです。

bounded stochastic live E2E
bounded prompt-elicited live E2E
deterministic verdict over nondeterministic elicitation

証跡にもround単位の次項目を追加した方がよいです。

invocation_num
conversation_id
retry_round
injected_capabilities
observed_capabilities
model/runtime version

現在のログ累積方式では、過去roundのイベントと現在roundの因果関係を弱くしか区別できません。

妥当な変更

以下は方向性として妥当です。

  • upstream #728を待たず、受理される ephemeralMessage へ切り替える判断。([GitHub]4)
  • prompt非準拠を通常のdeny判定へ流さず、exit 78として分離すること。
  • write_to_file に Description を追加したこと。現行公式ツール仕様にも同フィールドがあります。([Google Antigravity]1)
  • temporary directory cleanupとloopback cleanupの真偽を分離したこと。
  • live側とhermetic側を混同しない方針。

ただし、上記のP0二件はsecurity evidenceの意味論そのものを壊しています。特にdeny後の成功PostToolUseを合格させる現状は、実行境界の証明として受け入れられません。

最終判断はREQUEST_CHANGESです。 GitHubへのレビュー投稿やPR変更は行っていません。

@squne121
squne121 marked this pull request as draft August 5, 2026 10:48
@squne121

squne121 commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

Control-plane triage(squne121 敵対的レビュー、iteration次)

P0-1・P0-2・P1-2・P1-3 を実コード確認の上、全て確認済みの実バグと判断しました:

  • P0-1: error_digest を記録しているにも関わらず、deny側合否判定(post_matches_expectation = deny_correlated and deny_secret_scan_passed)が一切outcome(成功/エラー)を検査していない。AC4「successful PostToolUse count == 0」要件を破りうる。
  • P0-2: capability_gateは_bootstrap_capability_gate()で一度設定されたまま(inconclusive)artifactへ伝播し、live probe成功後もsupportedへ昇格されない。かつvalidate_aggregate_manifest()はrunner本体から一度も呼ばれておらず(testsのみ)、個別exit 0とaggregate要件の非整合を検出できていなかった。
  • P1-2: block_on_close=False/daemon_threads=Trueはhandler threadの終了を待たない設定であり、loopback_servers_stoppedはhandler thread不在を証明していない。
  • P1-3: validate_artifact()のsecret scanはscan用コピー内でのみrealpathをNoneに置換しており、実artifactにはraw absolute pathが残ったままsecret_scan.clean: trueを宣言している。

P0-3は不正確と判断: branch protection必須contextsはtypecheck/lint/test/build/python-test/validate-generated-artifactの6つのみで、現head 2adbd5a は全てPASSしています。e2e/ci-verdict-summaryは必須外(既知の無関係な既存VRT差分)です。

修正を実装へ委譲します。

#1979)

Fixes 4 control-plane-confirmed bugs found by squne121's second-round
adversarial review (issue comment 5190769472):

- P0-1: deny-side PostToolUse pass condition ignored whether the
  correlated tool call actually succeeded (null error_digest). A
  successful side effect after an explicit deny is now a hard FAIL;
  only a correlated PostToolUse whose tool call itself errored/was
  rejected (non-null error_digest) is still characterized as
  acceptable.
- P0-2: capability_gate never promoted past its static bootstrap
  result even after genuine live completion, and
  validate_aggregate_manifest() was defined but never invoked by the
  runner's own execution flow. capability_gate now promotes to
  status=supported/observed_status=supported with
  evidence_source=runtime_semantic_observation and an
  observation_digest after a genuine exit-0 live run (preserving the
  original static result as preflight_status), and
  _maybe_write_aggregate_manifest() now actually calls
  validate_aggregate_manifest() and persists the real result to
  aggregate/validation.json.
- P1-2: loopback_servers_stopped did not prove per-request handler
  thread absence (block_on_close=False / daemon_threads=True only
  guarantee the listener closed). _LoopbackCanary now tracks active
  handler threads via Handler.setup/finish and stop() bound-waits on
  that set.
- P1-3: the secret-safe scan only sanitized a deep-copy for scanning,
  leaving the raw absolute realpath in the real artifact.
  compute_binary_identity() now emits realpath_class (generalized/
  masked) and realpath_digest (hash) instead of a raw realpath, so the
  distributed artifact never contains it and the scan-only carve-out
  is removed entirely.

Also documents the one-directional nature of this schema's
"backward_compatible" claim (P1-1) in docs/dev/schema-governance.md.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@squne121
squne121 marked this pull request as ready for review August 5, 2026 11:27
@squne121
squne121 marked this pull request as draft August 5, 2026 11:50
@squne121

squne121 commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

PR Review Verdict(P0/P1修正後)

P0-1・P0-2・P1-2・P1-3全て実コード確認+6回のfresh live実行で修正を確認。CI 6/6 PASS、Allowed Paths gate: ok、pytest 1356 pass。

Blocker

PR本文に必須の ## 受け入れ条件の達成状況 セクションが完全に欠落(AC1/AC2/AC5/AC6/AC7が個別に[x]/[ ]+根拠で記載されていない)。

verdict: REQUEST_CHANGES
reviewed_head_sha: "77e89cf5af9937a8790baec6e52adbee7de7093b"
blockers:
  - "PR本文に必須の `## 受け入れ条件の達成状況` セクションが存在せず、AC1-AC8全件が個別に[x]/[ ]+根拠で記載されていない。"
warnings:
  - "temporary_processes_removed flakinessの追跡用follow-up issue番号がSafety Claim Matrixに未記載。follow-up issue起票を推奨。"

@squne121

squne121 commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

PR Review Verdict (final)

PR本文のみの修正(head SHA変更なし、必須CI既にPASS済み)。## 受け入れ条件の達成状況セクションでAC1-AC8全件が具体的根拠付きで記載され、follow-up Issue #1997(temporary_processes_removed flakiness)が正しく起票・参照されていることを確認。

verdict: APPROVE
reviewed_head_sha: "77e89cf5af9937a8790baec6e52adbee7de7093b"
blockers: []
warnings: []

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.

実装: AGY permission boundaryのdeterministic live E2Eをupstream capabilityへ束縛する

1 participant