Skip to content

調査: AGY認証 persistence と isolated auth contract をcurrent versionで再検証する #2609

Closed
1 of 1 issue completed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: research
parent_issue: "none"
goal_ref: "Antigravity CLI current version の WSL2/headless/isolated workspace における認証 persistence と公式 auth route を secret-safe に再分類し、最小の後続判断を可能にする"
change_kind: research-only

Parent Issue

none

Outcome

current AGY binary の account-session / Gemini API key / ADC の認証経路、persistence backend、headless 出力契約、および native/isolated 差分を secret-safe に観測して二層分類する。指定 local assets と current official docs の drift を評価し、必要な場合だけ最小 follow-up Issue、不要なら no-code decision を残す。silent migration は行わない。

Research Boundaries

Current Evidence and Evidence Hierarchy

Evidence cut は 2026-09-10。AGY 1.2.0、WSL2/non-TTY、file-token presence false、native fresh process 2 回が stdout 0 bytes のまま bounded outer timeout だったという既存記録は terminal observation であり、credential persistence または isolated wrapper の因果結論ではない。既存 Issue の materialization/profile 記述は historical/current-source recheck required とする。

優先順位は次のとおり。

  1. current observed behavior
  2. current official Google docs
  3. current repository implementation recheck
  4. historical controlled experiments
  5. upstream reporter observations
  6. upstream reporter hypotheses

Maintainer confirmation がある場合だけ、その artifact と対象主張を個別に明記する。

Official Contract to Recheck

Auth and Observation Model

認証経路と保存先を同じ軸に混ぜない。

auth_mode:
  - account_session
  - gemini_api_key
  - adc
persistence_backend:
  - os_keyring
  - file_token
  - not_applicable
  - unknown
surface_signals_presence_only:
  dbus_reachable: boolean
  file_token_present: boolean
  model_provider_gemini: boolean
  gemini_api_key_present: boolean
  agy_adc_auth_enabled: boolean
  adc_present: boolean

各セルは signal の値ではなく presence/boolean、選択した auth_mode、persistence_backend、設定面だけを記録する。account_session の backend は os_keyring / file_token / unknown、API-key と ADC は not_applicable として扱い、backend を類推しない。

Canonical Observation Procedure

  1. local --help で -p/--print、--output-format json、--print-timeout の availability を確認する。
  2. fixed non-secret sentinel を使い、available な場合のみ --output-format json と bounded inner --print-timeout を指定した headless print probe を実行する。outer supervisor は inner timeout より長い bounded 値にする。
  3. stdout を単一 JSON として parse し、process exit code、AGY JSON status/non-secret error class、stdout/stderr byte count、inner print timeout、outer timeout、sentinel confirmation を記録する。
  4. terminal observation と causal conclusion を混同しない。JSON が空・複数・malformed の場合は output contract の observation として残す。

研究 procedure の runtime command は VC に置かない。

Classification

まず terminal observation を次の taxonomy へ一意に分類する。

terminal_class:
  - success
  - auth_required
  - credential_backend_unavailable
  - credential_invalid
  - provider_configuration_invalid
  - model_unavailable
  - quota_or_rate_limit
  - permission_wait
  - print_timeout
  - outer_timeout
  - output_contract_violation
  - unknown

その後、根拠を添えて root-cause candidate を別層で 0 個以上選ぶ: native_or_local_auth_state、isolated_materialization、minimal_extended_contract_drift、headless_print_mode、provider_activation_contract_drift、unresolved_upstream_or_environment。terminal class 単独から causal candidate を確定しない。

isolated_materialization は次の全条件を満たす場合だけ candidate にできる: native success、使用 auth mode と persistence backend の特定、当該 backend が profile contract 上 materialize されるべきこと、host source presence、isolated reachability/materialization expectation、同一 binary/sentinel/print settings で isolated のみ失敗。native success だけ、または DBus/file-token の存在だけでは不足である。

Bounded Matrix

6 セル以下で実施する。実 credential を作成・使用せず、E/F の successful E2E は要求しない。

Cell Route Purpose / applicability
A native account fresh #1 account-session baseline
B native account fresh #2 fresh-process reproducibility
C isolated account minimal comparable かつ allowed の場合のみ
D isolated account extended comparable かつ allowed の場合のみ
E API-key recognition modelProvider: gemini + disposable invalid credential による recognition/failure surface のみ
F ADC recognition AGY_ADC_AUTH=true + absent/disposable invalid control による recognition/failure surface のみ

A/B が成功しない場合、isolated differential attribution だけを停止する。--help、JSON/stdout/stderr contract、inner timeout、API-key recognition、ADC recognition の headless contract verification は継続し、研究全体を早期終了しない。

In Scope

  • current binary の help-first canonical observation、二軸認証分類、bounded A-F matrix、terminal/root-cause 二層分類。
  • current official docs と次の assets の drift を recheck する: .claude/skills/gemini-cli-headless-delegation/references/usage-contract.md、.claude/skills/gemini-cli-headless-delegation/references/runtime-portability.md、.claude/skills/gemini-cli-headless-delegation/scripts/preflight_agy.py、.claude/skills/gemini-cli-headless-delegation/scripts/setup_check.py、.claude/skills/gemini-cli-headless-delegation/scripts/agy_permission_policy.py。
  • current source が示す materialization/profile と historical local experiments を、current fact ではなく comparison target として評価する。
  • 結果に応じた最小 follow-up/no-code decision。follow-up は drift または observed contract difference が implementation を必要とするときだけ起票可能にする。

Out of Scope

  • repo 変更、research runtime experiment のこの Issue refinement 中の実行、実 credential/readback、interactive login、real HOME 全体の露出、permission bypass。
  • account-session、API key、ADC 間の無承認切替または silent provider migration。
  • official docs が未定義の auth priority、refresh、revocation の補完的推測。

Acceptance Criteria

  • AC1: research-only と secret-safe 境界、historical/current fact の区別、upstream reporter evidence の限定を明記している。
  • AC2: account_session、gemini_api_key、adc と persistence backend、および presence-only surface signals を別軸で定義している。
  • AC3: help-first JSON canonical probe が exit/status/error、stdout/stderr byte count、inner/outer timeout、sentinel を記録し、terminal observation と causal conclusion を分離している。
  • AC4: terminal_class taxonomy と root-cause candidate 層、および isolated_materialization の全必要条件を定義している。
  • AC5: A-F の 6 セル以下 matrix、E/F の non-secret recognition control、native A/B failure 時の differential-only stop/contract-verification continue を定義している。
  • AC6: official docs、指定 5 assets の current-source drift recheck、historical evidence hierarchy、minimal follow-up/no-code decision と silent-migration prohibition を定義している。
  • AC7: research 本体の bounded runtime observation は immediate だが、この Issue refinement は実験を実行しないことを明記している。

Runtime Verification Applicability

  • decision: immediate
  • reason: research 本体は bounded headless runtime observation を必要とする。一方、この Issue refinement は contract body のみを更新し、runtime experiment を実行しない。
    applicable_acs: AC3, AC5
    execution_environment: future authorized non-interactive AGY research environment; this refinement transaction executes no runtime probe.
    skip_conditions: help flags unavailable、comparable/allowed profile 不在、または secret/interactive login/real credential が必要になる場合は該当セルを not_applicable/skip と記録する。
    fallback_policy: native A/B failure は isolated differential attribution のみ停止し、non-secret headless contract verification を継続する。
    artifact_requirements: auth_mode、persistence_backend、presence-only signals、canonical observation record、terminal_class、root-cause candidate、official-doc/current-source refs を secret-free artifact に保存する。

Verification Commands

# AC1
# baseline-expect: pass
$ rg -n "credential" .claude/skills/gemini-cli-headless-delegation/references/usage-contract.md

# AC2
# baseline-expect: pass
$ rg -n "agy_oauth_token" .claude/skills/gemini-cli-headless-delegation/scripts/agy_permission_policy.py

# AC3
# baseline-expect: pass
$ rg -n "headless" .claude/skills/gemini-cli-headless-delegation/references/usage-contract.md

# AC4
# baseline-expect: pass
$ rg -n "agy_preflight" .claude/skills/gemini-cli-headless-delegation/scripts/setup_check.py

# AC5
# baseline-expect: pass
$ rg -n "auth_minimal" .claude/skills/gemini-cli-headless-delegation/scripts/agy_permission_policy.py

# AC6
# baseline-expect: pass
$ rg -n "AGY" .claude/skills/gemini-cli-headless-delegation/scripts/preflight_agy.py

# AC7
# baseline-expect: pass
$ rg -n "Runtime Verification Applicability" docs/dev/runtime-verification-policy.md

Allowed Paths

  • .claude/skills/gemini-cli-headless-delegation/references/usage-contract.md (read-only)
  • .claude/skills/gemini-cli-headless-delegation/references/runtime-portability.md (read-only)
  • .claude/skills/gemini-cli-headless-delegation/scripts/preflight_agy.py (read-only)
  • .claude/skills/gemini-cli-headless-delegation/scripts/setup_check.py (read-only)
  • .claude/skills/gemini-cli-headless-delegation/scripts/agy_permission_policy.py (read-only)
  • docs/dev/runtime-verification-policy.md (read-only)
  • No repository mutation. A future authorized research execution may write only to an explicit secret-free evidence artifact path; this refinement writes no repository artifact.

Stop Conditions

  • Outcome / Scope / AC が検索可能な形で記載されていない場合は即停止

  • Allowed Paths 外への書き込みを試みた場合は即停止

  • 権限不足(permission denied)により操作が完了できない場合は即停止

  • 成果物の書き込みに失敗した場合(I/O エラー等)は即停止

  • credential、token、OAuth URL、keyring secret、API keyの本文が必要になった場合は即停止

  • interactive login、real HOME exposure、silent provider migrationが必要になった場合は即停止

  • Stop the relevant observation before credential/token/API key/OAuth URL/keyring secret/environment value exposure, interactive login, real credential use, real HOME exposure, permission bypass, or unapproved provider migration.

  • Stop isolated differential attribution when A/B lack comparable native success, backend identification, required profile contract, host source presence, or isolated reachability/materialization expectation; continue non-secret headless contract verification.

  • Stop and record a bounded failure if the outer timeout expires or stdout violates the single-JSON contract; do not infer a root cause from that terminal class alone.

  • Do not create an implementation follow-up unless current observed behavior plus current-source/docs drift establishes the minimal required change. No code decision is valid otherwise.

Handoff Contract

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    phase/research
    state/queued
    agent/research
    on Sep 10, 2026
  2. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    判定: REQUEST_CHANGES

    Issue #2609 の起票意図は正しいです。特に、現在の AGY 1.2.0 で native fresh process 自体が成功していない以上、過去の「OAuth token only が必要十分」という結論をそのまま current fact とせず、isolated wrapper の regression と断定しない方針は妥当です。#2609 は実際に agy 1.2.0、WSL2/non-TTY、file token absent、native fresh process 2回とも stdout 0 bytes + timeout まで事実と推論を分離しています。

    ただし、現状の Acceptance Criteria のままだと、再調査しても誤った root cause に着地できる穴が2つあります。さらに、Google の current documentation が過去の repository contract より先に進んでおり、API key / ADC / headless output contract を調査設計へ取り込む必要があります。

    主要 finding

    Severity | Finding | 推奨 -- | -- | -- BLOCKER | native success + isolated-minimal failure ⇒ isolated_materialization は因果条件として不十分 | credential backend parity を条件に追加 BLOCKER | account-keyring / file-token / API-key / ADC を同じ「credential source」軸で比較している | auth mode と persistence backend を分離 HIGH | current AGY は API key と ADC を正式サポートするが、#2609 の experiment contract が activation surface を表現できない | modelProvider: gemini / AGY_ADC_AUTH=true を明示 HIGH | 45秒 outer timeout + stdout byte count は current headless contract を捨てている | AGY native --output-format json + --print-timeout を一次観測にする HIGH | repo の usage-contract.md / preflight_agy.py が current Google docs と既に矛盾 | research対象・follow-up判断対象へ追加 MEDIUM | upstream #14/#223/#479 は current 1.2.0 の証拠ではなく、maintainer-confirmedでもない | historical reporter evidence として限定 MEDIUM | native 2回失敗時の Stop Condition が早すぎ、current headless contract regression の観測まで打ち切る | isolated attributionだけ停止し、native contract検証は続行 LOW | research-only Issueとしてハーネス側の secret/sandbox 条件がやや前面に出すぎ | secret本文非取得は維持しつつ、診断自体は軽量化

    E/F は実 credential の成功確認を必須にする必要はありません。

    例えば偽API keyで、

    OAuth/login required

    から

    Gemini API credential invalid

    相当へ failure surface が切り替われば、「1.2.0 が modelProvider: gemini を認識している」という有用な negative control になります。

    ADCも同様です。

    実credentialでの successful E2E は、後続 implementation の必要性が判明した場合にだけ opt-in すれば十分です。これなら secret-safety のために research を止める必要がありません。


    10. root-cause taxonomy も1段分ける

    現在の、

    native_or_local_auth_state
    isolated_materialization
    minimal_extended_contract_drift
    headless_print_mode
    unresolved_upstream_or_environment

    だけでは terminal observation と causal conclusion が混ざっています。

    まず観測を、

    terminal_class:
      - success
      - auth_required
      - credential_backend_unavailable
      - credential_invalid
      - provider_configuration_invalid
      - model_unavailable
      - quota_or_rate_limit
      - permission_wait
      - print_timeout
      - outer_timeout
      - output_contract_violation
      - unknown

    と分類し、その上に現在の root-cause classification を載せる二層構造を推奨します。

    特に API-key や ADC は auth が成功していても model/provider limitation で sentinel が失敗し得ます。ADCには公式にもモデル制約があります。 (Google Antigravity)


    最終的に #2609 へ要求したい変更

    Issue自体を作り直す必要はありません。 目的、research-only 境界、historical evidence の扱い、secret本文を読まない方針は維持してよいです。

    修正必須なのは次の5点です。

    1. native success → isolated fail の attribution に auth mode / persistence backend parity を追加する。

    2. account-session + persistence backend と API-key/ADC auth mode を別軸にする。

    3. current AGY の --output-format json / --print-timeout / stderr / exit contract を canonical probe とする。

    4. usage-contract.md / preflight_agy.py の current Google docsとのdriftを research outcome に含める。

    5. native failure時は isolated differential だけ停止し、headless 1.2.0 contract検証までは止めない。

    この5点を反映すれば、#2609 はかなり良い research Issue になります。逆に現状のまま進めると、一番危険なのは keyringでnativeだけ成功したケースを isolated_materialization と誤診して、OAuth token exposure側を不要に変更してしまうことです。

    なお、今回の用途では bwrap/read-only enforcement をこれ以上強化する必要はありません。token本文非取得・非ログ化は維持しつつ、認証 routing の差分観測を優先した方が、個人開発としての実用性は高いです。

    ## 判定: **REQUEST_CHANGES**

    Issue #2609 の起票意図は正しいです。特に、現在の AGY 1.2.0 で native fresh process 自体が成功していない以上、過去の「OAuth token only が必要十分」という結論をそのまま current fact とせず、isolated wrapper の regression と断定しない方針は妥当です。#2609 は実際に agy 1.2.0、WSL2/non-TTY、file token absent、native fresh process 2回とも stdout 0 bytes + timeout まで事実と推論を分離しています。

    ただし、現状の Acceptance Criteria のままだと、再調査しても誤った root cause に着地できる穴が2つあります。さらに、Google の current documentation が過去の repository contract より先に進んでおり、API key / ADC / headless output contract を調査設計へ取り込む必要があります。

    主要 finding

    Severity Finding 推奨
    BLOCKER native success + isolated-minimal failure ⇒ isolated_materialization は因果条件として不十分 credential backend parity を条件に追加
    BLOCKER account-keyring / file-token / API-key / ADC を同じ「credential source」軸で比較している auth mode と persistence backend を分離
    HIGH current AGY は API key と ADC を正式サポートするが、#2609 の experiment contract が activation surface を表現できない modelProvider: gemini / AGY_ADC_AUTH=true を明示
    HIGH 45秒 outer timeout + stdout byte count は current headless contract を捨てている AGY native --output-format json + --print-timeout を一次観測にする
    HIGH repo の usage-contract.md / preflight_agy.py が current Google docs と既に矛盾 research対象・follow-up判断対象へ追加
    MEDIUM upstream #14/#223/#479 は current 1.2.0 の証拠ではなく、maintainer-confirmedでもない historical reporter evidence として限定
    MEDIUM native 2回失敗時の Stop Condition が早すぎ、current headless contract regression の観測まで打ち切る isolated attributionだけ停止し、native contract検証は続行
    LOW research-only Issueとしてハーネス側の secret/sandbox 条件がやや前面に出すぎ secret本文非取得は維持しつつ、診断自体は軽量化

    1. BLOCKER — native / isolated の比較に「credential backend parity」がない

    現在の AC は、

    同一 binary/sentinel で native fresh process が成功し isolated-minimal が失敗した場合だけ isolated_materialization

    という条件です。

    これはまだ強すぎる推論です。

    例えば、

    native
      → Linux Secret Service / D-Bus / keyring
      → success
    
    isolated-minimal
      → OAuth file token のみ exposure
      → host file token は absent
      → failure
    

    でも、この条件を満たします。

    しかしこれは materialization implementation defect ではありません。単に native が keyring backend を使い、minimal profile がその backend を意図的に提供していないだけです。Google の current troubleshooting documentation でも、Linux account-session の credential は Secret Service/dbus 経由になり得ると明記されています。 ([Google Antigravity]1)

    一方、現在の repository implementation は auth_minimal と auth_extended を分け、DBus等は extended 側だけにしています。

    したがって isolated_materialization の必要条件を次まで強めるべきです。

    native success
    AND
    native が成功に使用した auth mode / persistence backend が特定できる
    AND
    その backend は isolated-minimal の contract 上 materialize されるべきものである
    AND
    その source が host 側に存在する
    AND
    isolated 側への materialization/reachability が期待どおり作られている
    AND
    それでも同一 probe が isolated のみ失敗する
    

    特に current evidence の file-token absent 状態では、native が将来成功しても、直ちに token materialization regression とは判定しない方がよいです。


    2. BLOCKER — 「credential source」の分類軸が間違っている

    #2609 は、

    account-keyring、file-token、API-key、ADCを credential source として区別

    としています。

    ここはモデルを変更することを推奨します。

    keyring と file-token は、基本的には account-session authentication の persistence backend です。一方、Gemini API key と ADC は current AGY ではそれ自体が別の authentication/provider mode です。

    Google は現在、API keyについて、

    • settings.json の modelProvider を gemini
    • GEMINI_API_KEY
    • account session は作らない
    • headless / CI 向け

    と明記しています。環境変数だけでは有効になりません。 ([Google Antigravity]2)

    ADCも、

    • ADC credential
    • AGY_ADC_AUTH=true
    • Antigravity CLI 固有の正式 auth mode
    • 古いモデルには制約あり

    という別経路です。 ([Google Antigravity]3)

    したがって最低でも、調査結果を次の2軸にしてください。

    auth_mode:
      - account_session
      - gemini_api_key
      - adc
    
    persistence_backend:
      - os_keyring
      - file_token
      - not_applicable
      - unknown

    さらに観測 surface は別に、

    exposed_surfaces:
      dbus_reachable: bool
      file_token_present: bool
      model_provider_gemini: bool
      gemini_api_key_present: bool
      agy_adc_auth_enabled: bool
      adc_file_present: bool

    とするのがよいです。

    これで初めて「DBus exposure不足」「file token read-back bug」「API-key provider設定不足」「ADC activation不足」が混ざらなくなります。


    3. HIGH — current API-key / ADC contract が isolated implementation に存在しない

    これは #2609 の調査価値をかなり上げる差分です。

    現在の build_official_agy_settings() 系の repository contract は isolated settings を生成していますが、テスト上も主に toolPermission + permissions の settings として扱われています。

    一方、current Google contract の API-key route には modelProvider: gemini が必須です。GEMINI_API_KEY を単に env allowlist へ追加しても動きません。 ([Google Antigravity]2)

    同様に、repository の extended profile は DBus/XDG/GOOGLE_APPLICATION_CREDENTIALS/gcloud ADC reachability を扱う過去設計ですが、current ADC contract は AGY_ADC_AUTH=true を activation switch として要求します。 ([Google Antigravity]3)

    したがって #2609 の alternative 5 は単なる「API keyも比較してみる」では不足です。

    current binary が公式 activation contract を実際に実装しているかを確認する research item にしてください。

    これは即実装すべきという意味ではありません。account-session と billing/provider semantics が違うため、既定経路へ silent fallback しないという現在の判断は正しいです。


    4. HIGH — 45秒 kill + stdout 0 bytes は current AGY の観測方法として弱い

    Google の current headless documentation はかなり進んでいます。

    agy -p は現在、

    • model response → stdout
    • auth/error/progress → stderr
    • --output-format json
    • JSON の status, error, duration_seconds 等
    • --print-timeout
    • default print timeout = 5分
    • non-interactive環境で unauthenticated なら、hang ではなく authentication required で終了する

    という contract です。 ([Google Antigravity]4)

    ここは #2609 の current evidence と直接衝突しています。

    現在の観測は、

    agy 1.2.0
    non-TTY
    fresh process
    45秒
    stdout = 0 bytes
    outer timeout
    

    です。

    したがって、「認証 persistence が失敗している」以前に「current documented headless error contract が成立していない」可能性があります。

    調査の canonical probe を、ローカル 1.2.0 の --help で flag availability を確認したうえで、例えば次の形へ変更することを推奨します。

    agy -p 'Reply exactly: LOOP_AGY_AUTH_PROBE_OK' \
      --output-format json \
      --print-timeout 20s

    outer supervisor は例えば30秒程度とし、

    process_exit_code:
    agy_status:
    agy_error_class:
    stdout_bytes:
    stderr_bytes:
    print_timeout_reached:
    outer_timeout_reached:
    sentinel_confirmed:

    を secret-safe に記録します。

    inner --print-timeout と outer kill timeout を区別することが重要です。

    これなら、

    authentication required
    API credential invalid
    ADC unavailable
    model unsupported
    quota exhausted
    permission waiting
    AGY internal timeout
    outer harness timeout
    empty/malformed JSON
    

    を一緒に timeout に潰さずに済みます。

    趣味開発の用途では、この方が security harness を増やすより遥かに実用的です。


    5. HIGH — repository documentation は既に current仕様とdriftしている

    これは #2609 の In Scope に明示的に追加した方がよいです。

    現在の references/usage-contract.md には、

    API key(GEMINI_API_KEY 等)は provider=agy の認証前提には使わない
    API key 経路は provider=gemini 専用

    という contract が残っています。

    さらに preflight_agy.py の recovery は、noninteractive auth failure に対して interactive TTY login を要求する内容です。

    これは現在の公式 API-key / ADC headless support と一致しません。 ([Google Antigravity]2)

    #2609 は research-only のままで構いませんが、調査対象として最低限次を追加すべきです。

    .claude/skills/gemini-cli-headless-delegation/references/usage-contract.md
    .claude/skills/gemini-cli-headless-delegation/scripts/preflight_agy.py
    .claude/skills/gemini-cli-headless-delegation/scripts/setup_check.py
    .claude/skills/gemini-cli-headless-delegation/references/runtime-portability.md
    .claude/skills/gemini-cli-headless-delegation/scripts/agy_permission_policy.py
    

    そして調査完了時に、

    current docs/preflight contract update が必要か

    も Handoff 判断してください。

    そうしないと、AGY本体について正しい結論を得ても、repository が「API key は AGY では使えない」と利用者へ案内し続けます。


    6. 過去の #1740 → #1743 → #1778 → #1779 は証拠としては良い。ただし current fact ではない

    この履歴はかなり整理されています。

    #1740 は、それ以前の gcloud ADC / DBus 仮説を訂正し、AGY独自 OAuth token file の exposure を導入しました。

    #1743 / PR #1746 では、token を XDG_CONFIG_HOME ではなく isolated $HOME/.gemini/antigravity-cli/ に置けば、当時の live diagnostic で agy -p が成功したという因果証拠まで得ています。PR #1746 はマージ済みです。

    #1778 は controlled ablation によって、当時の環境では、

    oauth-token only              success
    oauth + dbus                  success
    oauth + gcloud                success
    all                           success
    token absent                  auth_required
    dbus only                     auth_required
    gcloud only                   auth_required
    

    という結果を machine-readable baseline として固定しました。

    #1779 / PR #1783 はその結果から minimal=OAuth-only / extended=DBus+ADC を実装し、bwrap read-only boundary も追加しました。PR review では実 bwrap process と 1021 tests を独立再検証して APPROVE されています。

    なので、過去実装の品質が低かったわけではありません。

    問題は AGY側の contract がその後変化している可能性です。#2609 が過去の結論を historical evidence に降格している判断は正しいです。


    7. upstream #14 / #223 / #479 は「maintainer-confirmed fact」ではない

    ここも AC の表現を少し強化した方がよいです。

    #479 は v1.0.8/1.0.10で「file token を fresh process が読んでも auth provider が使わない」という詳細な reproduction があります。ですが root cause 部分は reporter 自身も “Likely root cause” としています。唯一のコメントも別ユーザーによる v1.0.13 confirmation で、maintainer confirmation ではありません。

    #14 も WSL2/Secret Service failure の有力な実例ですが、コメント0件です。

    #223 も headless auth feature request と複数ユーザー報告であり、API-key / ADC が ignored とされたのは当時のバージョンです。

    現在は Google 自身が API-key と ADC を公式 documentation に掲載しています。 ([Google Antigravity]2)

    したがって #2609 の証拠階層は、

    1. current AGY 1.2.0 observed behavior
    2. current Google official docs
    3. current repository implementation
    4. historical local controlled experiments
    5. upstream issue reporter observations
    6. upstream issue reporter root-cause hypotheses
    

    くらいに固定するとよいです。

    「assigned」「bug label が付いた」は root cause confirmation に数えない方がいいです。


    8. Stop Condition は isolated attribution だけ止めるべき

    現在は、

    native fresh process 2回が成功せず、secretを読まず利用可能なofficial credential sourceも確認できないなら differential attribution を停止

    となっています。

    前半は正しいです。

    ただしそこで research 全体を unresolved_upstream_or_environment に落として終えるのは惜しいです。

    current docsでは「unauthenticated non-TTY は hangせず authentication required で終了」が contract です。 ([Google Antigravity]4)

    したがって native process が再び hard timeout するなら、それだけで、

    documented headless contract
    vs
    AGY 1.2.0 observed behavior
    

    という独立した有用な finding になります。

    Stop Condition は、

    isolated-vs-native differential attribution を停止する

    に限定し、

    • current --help capability
    • structured JSON behavior
    • stderr error behavior
    • inner print timeout behavior
    • API-key/ADC recognition without exposing real credentials

    の調査は継続させる方がいいです。


    9. 推奨する最小 experiment matrix

    無闇に20セル程度へ増やす必要はありません。次の6セル程度で十分です。

    Cell Mode 目的
    A native/account fresh #1 current account auth baseline
    B native/account fresh #2 persistence/fresh-process再現性
    C isolated/account minimal token-only contract。ただし対応source不存在なら not_applicable
    D isolated/account extended keyring/DBus依存差分
    E isolated/API-key recognition modelProvider=gemini + disposable invalid sentinel keyで公式routing認識確認
    F isolated/ADC recognition AGY_ADC_AUTH=true + absent/disposable invalid ADCでrouting認識確認

    E/F は実 credential の成功確認を必須にする必要はありません。

    例えば偽API keyで、

    OAuth/login required
    

    から

    Gemini API credential invalid
    

    相当へ failure surface が切り替われば、「1.2.0 が modelProvider: gemini を認識している」という有用な negative control になります。

    ADCも同様です。

    実credentialでの successful E2E は、後続 implementation の必要性が判明した場合にだけ opt-in すれば十分です。これなら secret-safety のために research を止める必要がありません。


    10. root-cause taxonomy も1段分ける

    現在の、

    native_or_local_auth_state
    isolated_materialization
    minimal_extended_contract_drift
    headless_print_mode
    unresolved_upstream_or_environment
    

    だけでは terminal observation と causal conclusion が混ざっています。

    まず観測を、

    terminal_class:
      - success
      - auth_required
      - credential_backend_unavailable
      - credential_invalid
      - provider_configuration_invalid
      - model_unavailable
      - quota_or_rate_limit
      - permission_wait
      - print_timeout
      - outer_timeout
      - output_contract_violation
      - unknown

    と分類し、その上に現在の root-cause classification を載せる二層構造を推奨します。

    特に API-key や ADC は auth が成功していても model/provider limitation で sentinel が失敗し得ます。ADCには公式にもモデル制約があります。 ([Google Antigravity]3)


    最終的に #2609 へ要求したい変更

    Issue自体を作り直す必要はありません。 目的、research-only 境界、historical evidence の扱い、secret本文を読まない方針は維持してよいです。

    修正必須なのは次の5点です。

    1. native success → isolated fail の attribution に auth mode / persistence backend parity を追加する。
    2. account-session + persistence backend と API-key/ADC auth mode を別軸にする。
    3. current AGY の --output-format json / --print-timeout / stderr / exit contract を canonical probe とする。
    4. usage-contract.md / preflight_agy.py の current Google docsとのdriftを research outcome に含める。
    5. native failure時は isolated differential だけ停止し、headless 1.2.0 contract検証までは止めない。

    この5点を反映すれば、#2609 はかなり良い research Issue になります。逆に現状のまま進めると、一番危険なのは keyringでnativeだけ成功したケースを isolated_materialization と誤診して、OAuth token exposure側を不要に変更してしまうことです。

    なお、今回の用途では bwrap/read-only enforcement をこれ以上強化する必要はありません。token本文非取得・非ログ化は維持しつつ、認証 routing の差分観測を優先した方が、個人開発としての実用性は高いです。

  3. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    推奨は、指定コメントを direct human context の trusted anchor として扱い、通常の preflight.run.with_anchor ではなく preflight.run.with_human_context → 必要なら contract_update.run.with_human_context の正規経路に流すことです。現行 issue-refinement-loop は loop iteration の承認を既定で要求せず、trusted human-context から deterministic repair / contract update / controlled issue-editor へ自動的に進められる設計です。issue_editor_required になった場合も、人間へ戻すのではなく controlled full rewrite route へ handoff し、その後 fresh preflight・review・readiness をやり直す契約があります。

    今回の anchor は外部仕様への依存が強いため、codebase-investigator に加えて web-researcher を使わせるべきです。Google の現行資料でも、headless の --output-format json / --print-timeout、未認証 non-TTY の authentication required 終了、API key の modelProvider: gemini + GEMINI_API_KEY、ADC の AGY_ADC_AUTH=true が確認できます。([Google Antigravity]1)

    Claude-GPT 側については、既に auto mode で起動済みなら /permission を触らせないのが重要です。現在の launcher は caller の --permission-mode 等を拒否し、launcher 自身が --permission-mode auto を注入する設計なので、prompt から permission mode や settings を変更させるとかえって停止要因になります。

    そのまま投入するなら以下を推奨します。

    対象:
    #2609

    trusted anchor / direct human context:
    #2609 (comment)

    .claude/skills/issue-refinement-loop を使い、Issue #2609 を上記 anchor comment の指摘に基づいて refinement してください。

    このセッションは既に Claude-GPT の auto mode で起動済みです。人間の承認待ちは挟まず、skill が許可する deterministic / controlled route を最後まで自律的に進めてください。

    重要: Claude-GPT の permission mode は変更しないでください。/permission を実行しないでください。--permission-mode、--dangerously-skip-permissions、--allow-dangerously-skip-permissions、caller-supplied --settings 等を追加・変更しないでください。現在の launcher-owned auto mode をそのまま使用してください。

    実行方針

    まず current HEAD の .claude/skills/issue-refinement-loop/SKILL.md と、そこから必要とされる references/、command registry、termination/routing contract を読んでください。過去の記憶や独自の prose 判断で skill の routing を再実装しないでください。

    指定 anchor は、この対話で operator が明示的に指定した direct human context です。GitHub author metadata から origin を推定するのではなく、canonical preflight.run.with_human_context lane を使用してください。

    canonical main root / default branch から、現在の skill contract に従って preflight.run.with_human_context を実行してください。lower-level wrapper の直接呼び出しなど、canonical executor を迂回しないでください。

    preflight / planner の結果に従い、人間へ確認せず以下を自動処理してください。

    • deterministic repair が提示された場合は、登録済み controlled consumer を使って自動適用し、fresh preflight を行う。
    • trusted contract patch plan が生成された場合は contract_update.run.with_human_context の canonical route を使用して適用する。
    • issue_editor_required になった場合は human escalation に丸めず、skill が定義する controlled issue-editor / full rewrite route へ handoff し、Issue body/title readback → fresh preflight → fresh root review → fresh readiness まで完了させる。
    • needs-fix は max_iterations の範囲内で自動継続する。loop iteration ごとの人間承認を要求しない。
    • planner / root review / readiness が canonical machine-readable next action を返している場合、それを prose で再判定しない。

    SubAgent

    調査は main thread だけで済ませないでください。

    codebase-investigator SubAgent を使い、Issue #2609、anchor comment、関連 Issue/PR、現在の repository implementation と少なくとも以下の資産を照合してください。

    • .claude/skills/gemini-cli-headless-delegation/references/usage-contract.md
    • .claude/skills/gemini-cli-headless-delegation/references/runtime-portability.md
    • .claude/skills/gemini-cli-headless-delegation/scripts/preflight_agy.py
    • .claude/skills/gemini-cli-headless-delegation/scripts/setup_check.py
    • .claude/skills/gemini-cli-headless-delegation/scripts/agy_permission_policy.py

    anchor comment には current external specification に依存する dispositive claim があるため、planner contract が許す正規の web-researcher SubAgent も使用してください。Google Antigravity の current official documentation を一次資料として再取得し、API-key、ADC、headless/print-mode、authentication persistence の主張を fact-check してください。upstream issue #14/#223/#479 は current official fact と混同せず、reporter observation / reporter hypothesis / maintainer-confirmed fact を分離してください。

    独立可能な SubAgent は並列実行して構いません。

    起動したすべての SubAgent の作業完了を必ず待ってください。
    SubAgent がまだ実行中の状態で review、rewrite、最終判定へ進まないでください。
    全 SubAgent を join し、その結果を canonical planner/review input に取り込んでから次へ進んでください。

    Anchor comment の要求

    anchor comment 全体を authoritative review input として扱い、支持できる指摘を Issue contract に反映してください。最低限、以下を満たしてください。

    1. native success -> isolated failure だけで isolated_materialization と断定せず、auth mode / persistence backend parity を attribution の必要条件にする。
    2. account_session の persistence backend と、gemini_api_key / adc という auth mode を別軸でモデル化する。
    3. current AGY の --output-format json、--print-timeout、stdout/stderr、exit/status contract を canonical observation surface として Issue に組み込む。
    4. usage-contract.md、preflight_agy.py 等と current Google documentation の drift を research scope / follow-up decision に含める。
    5. native fresh process が失敗しても research 全体を早期終了せず、isolated differential attribution だけを停止し、current headless contract の検証は継続する。
    6. terminal observation と causal/root-cause conclusion を分離する。anchor にある terminal_class の二層 taxonomy を検討し、より適切な current repository contract がなければ採用する。
    7. anchor の A-F 程度の bounded experiment matrix を基準に、無意味なセル増殖を避ける。API-key / ADC recognition は実 credential の successful E2E を必須にせず、secret-free / disposable negative control で routing recognition を確認可能な contract にする。
    8. evidence hierarchy を明示し、current AGY observed behavior、current Google official docs、current repository implementation、historical local experiments、upstream reporter observations/hypotheses を混同しない。

    ただし anchor の文章を機械的にコピーするのではなく、repository の current implementation と current official documentation を調査した結果に基づいて Issue contract として一貫する形へ統合してください。

    維持する境界

    Issue #2609 の目的、research-only、historical evidence を current fact としない方針、credential/token/API-key/keyring secret の本文を取得・記録しない方針は維持してください。

    今回実行するのは Issue refinement です。research task 本体の runtime experiment や implementation を先走って実行しないでください。repository implementation の変更や PR 作成もしないでください。

    実 credential を読む、表示する、コピーする、ログへ残すことは禁止です。interactive OAuth login、real HOME 全体の exposure、silent provider migration も行わないでください。

    Issue の research design に disposable invalid credential を negative control として記述することと、この refinement session で実 credential を使用することを混同しないでください。

    Human judgment / failure handling

    単なる loop continuation、deterministic repair、trusted anchor の反映、controlled issue-editor handoff、既存 contract に従う機械的判断について人間へ確認を求めないでください。

    human_judgment_required が出た場合、即座に「人間に聞く」で終了する前に、今回の direct-human anchor がその判断点をすでに明示的に解決していないか確認してください。解決済みなら canonical human-context / trusted-contract-update route で処理し、独自に approval を捏造せず正規経路で再評価してください。

    それでもなお canonical contract が genuine semantic ambiguity / owner ambiguity として human_judgment_required を返す場合だけ、guard を迂回したり架空の承認を生成したりせず、正確な reason code・不足判断・試行済み canonical route を最終報告してください。単なる permission prompt を human semantic judgment と誤分類しないでください。

    permission denied 等が発生した場合も /permission や permission-mode変更で回避しないでください。まず current skill の canonical executor / allowed tool route で実行可能か確認し、それでも不可能なら environment failure として根拠を残してください。

    完了条件

    Issue #2609 の本文が anchor comment の dispositive findings を矛盾なく取り込み、current repository / official evidence と整合していること。

    rewrite 後に Issue body/title を再取得して実際の GitHub state を確認すること。

    fresh preflight と fresh root-owned review を実行し、以前の review result を再利用しないこと。

    needs-fix が残る場合は iteration 上限まで自動修正すること。

    最終的に approve/proceed/readiness 相当まで到達した場合、そこで issue-refinement-loop を正常終了してください。research実行やimplementation開始には進まないでください。

    最後に簡潔に以下だけ報告してください。

    途中で私に承認・確認を求めず、可能な範囲をすべて自律実行してください。

    この形なら、特に Claude-GPT で起きやすい「auto mode なのに prompt 側から permission 設定を触って止める」経路を避けつつ、anchor comment 自体を既存の human-context authority として最大限利用できます。

  4. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: approved

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: issue-refinement-loop
      follow_up_issues: []
      note_only_observations: []
  5. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    確認結果として、#2609 はすでに refinement 完了済みで、fresh preflight は pass / proceed。本体は research-only Issue で、まず current AGY の認証・headless contract を再観測し、その結果から初めて「no-code」か「最小 implementation follow-up」へ分岐する設計です。

    一方、現在の main には依然として #1779 の historical ablation を根拠に「agy_oauth_token_path だけが必要十分」とする記述がコード・ドキュメント双方に残っています。#2609 の目的はまさに、この主張を current fact として再検証することです。 また、最新 main の通常の build/typecheck/lint/test/e2e/AGY drift gate は通っていますが、Actions 全体には既存の fail-closed 系 failure もあるため、PR 作成時は base/main の既存 failure と自分の差分起因 failure を区別する必要があります。

    推奨は、#2609 を直接「実装 Issue」に変質させず、research → decision → 必要時だけ follow-up implementation Issue → PR → review loop → merge/closure を一つの自律実行として完走させることです。以下をそのまま、auto mode で起動済みの対話的 Claude Code に渡せます。

    対象リポジトリ: squne121/loop-protocol

    対象 Issue:
    #2609

    Issue #2609 を起点として、調査・判定・必要な実装・テスト・Issue/PR作成・レビュー対応・CI確認・merge・Issue closure 条件の達成までを、人間の途中承認を要求せず自律的に完走してください。

    この指示は、現在の対話的 Claude Code セッションがすでに auto mode で起動している前提です。
    /permissions、permission mode、launcher 設定、--dangerously-skip-permissions その他の permission bypass を変更・追加しないでください。既存の auto mode のまま進めてください。

    0. 実行原則

    最初に必ず最新状態を取得してください。私がこの指示を作成した時点では以下でしたが、これらを固定事実として使わず、実行開始時に GitHub と local repository から再取得してください。

    Issue #2609 の current body、全 comment、関連 Issue/PR、現在の repository assets、現在の CI 状態を source of truth としてください。

    1. 最初に取得する GitHub / repository context

    最低限、以下を取得・確認してください。

    Issue #2609

    • current body
    • 全コメント
    • refinement approved report
    • Machine-Readable Contract
    • Outcome
    • Research Boundaries
    • Evidence Hierarchy
    • Official Contract to Recheck
    • Auth and Observation Model
    • Canonical Observation Procedure
    • terminal_class taxonomy
    • root-cause candidate taxonomy
    • Bounded Matrix A-F
    • Acceptance Criteria
    • Runtime Verification Applicability
    • Handoff Contract

    Issue body と最新 comment が食い違う場合は、repository の canonical workflow が定義する authority/provenance rule に従って解決してください。推測で選ばないでください。

    関連 Issue / PR

    少なくとも以下を調べ、必要ならその predecessor/successor も辿ってください。

    特に #1740/#1743/#1778/#1779 の実験結果を current AGY へそのまま適用しないでください。

    repository assets

    current HEAD から少なくとも以下を実読してください。

    • .claude/skills/gemini-cli-headless-delegation/references/usage-contract.md
    • .claude/skills/gemini-cli-headless-delegation/references/runtime-portability.md
    • .claude/skills/gemini-cli-headless-delegation/scripts/preflight_agy.py
    • .claude/skills/gemini-cli-headless-delegation/scripts/setup_check.py
    • .claude/skills/gemini-cli-headless-delegation/scripts/agy_permission_policy.py
    • docs/dev/runtime-verification-policy.md
    • .claude/skills/issue-refinement-loop/SKILL.md
    • .claude/skills/impl-review-loop/SKILL.md
    • .claude/skills/pr-review-judge/SKILL.md
    • PR 作成に使用する current canonical skill / helper / command registry

    検索だけで済ませず、判断に使うコードは実体を読んでください。

    2. サブエージェント

    調査は main thread だけで抱え込まないでください。

    少なくとも次の2系統を並列 SubAgentとして起動してください。

    1. codebase-investigator

      • current AGY wrapper / preflight / materialization / auth diagnostics を実読
      • historical claim と current implementation の区別
      • current source drift
      • implementation が必要になった場合の最小変更面
        を調査する
    2. web-researcher

      • current Antigravity CLI の公式 Google documentation を一次情報優先で調査する
      • install/auth
      • account-session persistence
      • Linux Secret Service / keyring
      • Gemini API key activation
      • ADC activation
      • headless --print
      • --output-format
      • --print-timeout
      • stdout/stderr/exit contract
        を current version 基準で確認する

    必要なら repository の current agent catalog に存在する review/test 専門 SubAgent を追加してください。

    起動した全 SubAgent の task/run ID を把握し、全員が terminal state になるまで必ず待ってください。

    一部 SubAgent の結果だけで root decision、Issue mutation、PR 作成、merge、Issue close へ進まないでください。

    SubAgent が失敗した場合は bounded retry または current workflow が認める native fallback を使って構いません。ただし、開始した SubAgent を orphan のまま残して処理を終了しないでください。

    3. #2609 の research を先に完遂する

    いきなり repository code を修正しないでください。

    #2609 は research-only なので、まず current contract に従って authorized research execution を完遂してください。

    3.1 help-first

    current local AGY binary について最初に:

    • version
    • --help
    • -p / --print
    • --output-format json
    • --print-timeout

    の availability を確認してください。

    古い docs、古い Issue、古い wrapper implementation から CLI contract を推測しないでください。

    3.2 auth_mode と persistence_backend を分離

    次の二軸を混同しないでください。

    auth_mode:

    • account_session
    • gemini_api_key
    • adc

    persistence_backend:

    • os_keyring
    • file_token
    • not_applicable
    • unknown

    特に、

    • DBus がある
    • token file がある
    • native が成功する
    • isolated が失敗する

    という単独の事実から root cause を決めないでください。

    3.3 secret-safe observation

    値を取得せず、presence boolean と非秘密情報だけを扱ってください。

    例:

    • dbus_reachable
    • file_token_present
    • model_provider_gemini
    • gemini_api_key_present
    • agy_adc_auth_enabled
    • adc_present

    環境変数の値、credential 本文、token、API key、OAuth URL、keyring secret は取得・表示・ログ保存しないでください。

    3.4 Bounded Matrix

    Issue #2609 の current contract が変更されていなければ、A-F 最大6セルの bounded matrix を実施してください。

    C/D は comparable/allowed な場合だけ実施してください。

    E/F は 認証成功を目的としない recognition test にしてください。
    実 credential は使わず、Issue contract が認める disposable invalid/absent control だけを利用してください。

    API key recognition では current official contract を再確認した上で modelProvider: gemini activation surface を含めてください。

    ADC recognition では current official contract を再確認した上で AGY_ADC_AUTH=true activation surface を含めてください。

    A/B が失敗しても research 全体を打ち切らないでください。
    停止するのは isolated differential attribution だけです。

    その場合も以下は続行してください。

    • help contract
    • JSON output contract
    • stdout/stderr separation
    • inner print timeout
    • outer timeout
    • API-key recognition
    • ADC recognition
    • current docs/source drift comparison

    4. observation artifact

    secret-free な evidence を一つの構造化 artifact として残してください。

    最低限:

    • AGY version
    • binary identity
    • help feature availability
    • cell A-F applicability
    • auth_mode
    • persistence_backend
    • presence-only signals
    • process exit code
    • parsed JSON status
    • non-secret error/failure class
    • stdout byte count
    • stderr byte count
    • inner timeout occurrence
    • outer timeout occurrence
    • sentinel confirmation
    • terminal_class
    • root-cause candidates
    • current official docs references
    • current repository source references
    • historical evidence references
    • drift findings
    • skipped/not_applicable reason

    を含めてください。

    terminal_class と root-cause candidate は別フィールドにしてください。

    terminal observation 単独から因果結論を生成しないでください。

    5. research decision

    全 SubAgent と runtime observation を join した後で、次のどちらかを明示的に選択してください。

    A. no-code

    current implementation と current official/runtime contract の間に、実装を必要とする materially relevant drift が無い場合:

    未確認項目を「おそらく正しい」で埋めて close しないでください。

    B. implementation required

    current observed behavior + current official docs/current-source recheck によりコード/docs変更が必要と証明された場合だけ implementation へ進んでください。

    #2609 自身を無断で research-only から implementation Issue へ変質させないでください。

    repository contract が許す current canonical routeを使い、最小 implementation follow-up Issue を作成してください。

    follow-up Issue には最低限:

    を materialize してください。

    必要なら .claude/skills/issue-refinement-loop を使って follow-up Issue を implementation-ready まで自律 refine してください。

    ここでも途中の human approval は要求しないでください。

    6. implementation

    follow-up Issue が implementation-ready になったら、fresh origin/main から専用 worktree/branch を作成し、current .claude/skills/impl-review-loop に従って実装してください。

    変更は observed drift を解消する最小差分 にしてください。

    「ついでの cleanup」「将来対応」「historical architecture の全面刷新」を混ぜないでください。

    ただし、実装の正しさを成立させるために schema consumer、test plan、docs、CI registry 等の更新が実際に必要なら、current workflow に従って scope を適切に materialize した上で変更してください。

    7. tests / verification

    Issue の Verification Commands だけを盲信せず、変更箇所の consumer/test topology を current repository から調べてください。

    最低限:

    1. targeted tests
    2. regression tests
    3. repository が要求する static validation
    4. pnpm typecheck
    5. pnpm lint
    6. pnpm test
    7. pnpm build

    を、current contract で applicable な範囲で実行してください。

    AGY auth/headless contract に runtime verification が必要なら、#2609 と follow-up Issue の secret-safe boundary を維持した bounded test のみ実施してください。

    実 credential を成功させるためだけの live login/test は追加しないでください。

    8. PR

    実装と local verification が green になったら canonical PR creation route で PR を作成してください。

    PR body には必ず:

    Closes #<implementation follow-up Issue番号>

    を入れてください。

    #2609 を直接 close する implementation PR でないなら、Closes #2609 を付けないでください。
    代わりに #2609 を research/source Issue として明示的に reference してください。

    PR body には必要に応じて:

    を current repository contract に合わせて記載してください。

    repo の current merge policy を確認してください。
    確認時点では squash merge のみが有効だったため、古い merge policy を仮定しないでください。

    9. review loop

    PR 作成で終了しないでください。

    current .claude/skills/impl-review-loop / .claude/skills/pr-review-judge の canonical route を使い、マージ可能になるまでレビュー・修正ループを続行してください。

    auth surface / grounded research / credential boundary 変更について current HEAD の review contract が independent/clean-room reviewer を要求する場合は、その reviewer SubAgent も起動してください。

    その場合も全 reviewer SubAgent の完了を待ってください。

    各 review iteration で:

    1. current PR head SHA を固定
    2. review comments / reviews / threads / CI を取得
    3. actionable fix_delta を分類
    4. コードまたはテストを修正
    5. targeted verification
    6. required full verification
    7. push
    8. fresh CI を待つ
    9. current head に対して fresh review
    10. stale review evidence を current head の approval として流用しない

    を繰り返してください。

    review comment を単に「対応済み」と返信して resolve しないでください。
    実装/evidence が comment を実際に解消した後だけ resolve してください。

    10. CI baseline と attributable failure

    作業開始時に main の現在の CI 状態を snapshot してください。

    既存 main に failure/skipped/gh_error がある場合:

    • base/main にも存在する failure
    • PR で新規発生した failure
    • stale workflow_run
    • infrastructure/transient failure
    • candidate head に実際に bind された required failure

    を分離してください。

    「CI workflow が赤だから今回のコードが壊した」と短絡しないでください。

    逆に、base に似た failure があるという理由だけで candidate-head の新規 regression を無視させないでください。

    必要なら base/head comparison と job logs を使って attributable failure を確定してください。

    transient と証明できる failure は bounded rerun して構いません。
    実装起因なら自律修正してください。

    11. merge / close

    全 required gates が current PR head に対して green/approved/merge-ready になったら、repository policy が許す canonical merge route で merge してください。

    merge 自体について私への追加承認は要求しないでください。

    merge 後:

    まで進めてください。

    「PR を作った」「レビュー待ち」「merge 待ち」で通常終了しないでください。

    12. 人間承認を要求しない

    以下は human approval の理由にしないでください。

    • ordinary code edit
    • test追加/修正
    • docs更新
    • branch/worktree作成
    • commit/push
    • Issue body/comment の canonical mutation
    • implementation follow-up Issue 作成
    • Draft PR作成
    • Draft解除
    • reviewer 起動
    • review fix
    • CI rerun
    • merge
    • closure conditionを満たした Issue close
    • known C1/path-overlap を current deterministic workflow が自律解決可能な場合
    • tool/subagent failure に対する bounded retry/fallback

    contract-defined skip/not_applicable は「人間に聞く」のではなく、根拠を記録して残りの実行を続けてください。

    権限や外部環境の制約で一部操作が不可能でも、可能な作業をすべて完了してから terminal blocker として記録してください。単なる permission/configuration inconvenience を途中承認要求へ変換しないでください。

    13. 唯一の operator stop 条件

    途中で operator input を要求して停止してよいのは、原則として次の2種類だけです。

    STOP 1 — destructive operation

    不可逆または共有状態を破壊する操作が必要な場合。

    例:

    • force push
    • shared branch の history rewrite / hard reset
    • unrelated branch/Issue/PR/file の削除
    • 大量削除
    • branch protection / security control の無効化
    • repository history rewrite
    • データ破壊
    • credential revoke/rotate
    • unrelated remote state の不可逆変更

    通常の commit、push、PR merge、条件を満たした Issue close は、このタスクで明示的に許可しているため destructive stop とみなしません。

    STOP 2 — secret material

    タスク遂行に秘密情報そのものへのアクセス・取得・複製・表示・ログ保存・入力が必要になる場合。

    例:

    • OAuth token 本文
    • API key 本文
    • keyring secret
    • credential file 本文
    • OAuth login URL / authorization code
    • secret environment variable の値
    • real HOME 全体の credential exploration
    • interactive login
    • 実 credential を使った認証成功の強制

    presence boolean、ファイルの存在有無、非秘密の path class、exit/status/error class、byte count は secret ではありません。

    秘密情報へ踏み込む直前で停止してください。
    秘密を読んでから redact するのは禁止です。

    14. 完了報告

    最終報告は簡潔でもよいですが、必ず以下を含めてください。

    開始した SubAgent、reviewer、CI/review loop を未完了のまま残して「後で確認してください」で終了しないでください。

    この構成なら、#2609 の research-only 契約を壊さず、それでも調査結果が実装を要求した場合は follow-up を切って、そのまま実装・レビュー・マージ・closure まで連続して進められます。

  6. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    Research result (2026-09-10)

    Decision

    implementation-required。#2609 は research-only のまま維持し、実装は別の child Issue に分離する。

    Current evidence

    • Current binary: agy 1.2.0; help exposes -p, --print, --output-format, and --print-timeout.
    • A/B native account-session probes used -p, JSON output, a 10-second inner print timeout, and a 20-second outer timeout. Both reached only outer_timeout; stdout was empty. Diagnostics were classified only as secret_like_output_suppressed; no raw stdout/stderr, credential, token, API key, or OAuth URL was retained.
    • C/D isolated account profiles were not_applicable: no file-token was present, and no other credential backend was exposed.
    • E/F negative controls confirmed current API-key and ADC activation surfaces reach JSON error behavior without a successful sentinel. They do not establish a working credential and do not identify the account-session persistence backend.
    • Current official Antigravity documentation distinguishes account session, API-key (modelProvider: gemini plus GEMINI_API_KEY), and ADC (AGY_ADC_AUTH=true) routes, and documents JSON/headless timeout behavior.

    Proven current-source drift

    1. references/usage-contract.md says API-key auth is unavailable for provider=agy, contradicting the current official Antigravity CLI API-key route.
    2. preflight_agy.py still lists --output-format as an unexpected capability while the same module contains structured-output support; its canonical basic smoke does not exercise documented JSON/inner-timeout surfaces.
    3. preflight_agy.py and agy_permission_policy.py retain wording that promotes the historical OAuth file-token result from 実装: AGY isolated workspaceがagy固有OAuthトークンファイルへ値露出なしで到達できるようにする #1740/実装: AGY OAuthトークンのisolated workspace内symlink配置先をXDG_CONFIG_HOMEからHOME配下に修正する #1743/実装: AGY auth surfaceと因果主張のmachine-readable baselineを追加する #1778/実装: AGY認証surfaceを最小化しOAuth credentialの真正read-only境界を実装する #1779/PR 実装: AGY認証surfaceを最小化しOAuth credentialの真正read-only境界を実装する (#1779) #1783 into a current necessary-and-sufficient authentication claim.

    Constraints for follow-up

    The child Issue must preserve credential safety, keep account-session/API-key/ADC and persistence backend classification separate, treat the historical OAuth file-token conclusion as historical only, and avoid interactive login, real-HOME scanning, secret reads, or permission/launcher changes.

    Sources

    issue_2609_agy_observation_v1 was generated as a local, secret-free artifact. Its stored fields are version/binary digest, flag availability, boolean presence signals, byte counts, exit/timeout/status classifications, and candidate classifications only.

  7. squne121 commented on Sep 19, 2026

    @squne121
    OwnerAuthor

    Closure verification

    本 Issue は close-ready と判断します。

    したがって、#2609 の research decision / follow-up materialization / implementation handoff は完了済みとして completed で close します。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/researchphase/researchstate/queued

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions