Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#2093"
goal_ref: "#2093 の Goal(1): TS import graph 経由の到達可能性が trusted side で独立検証される設計を実装または明示的に不採用と決定する"
change_kind: mixedParent Issue
Parent Goal Ref
- Goal:
resolve_trusted_minimum()が TS-compiler transitive import graph 経由の到達可能性も trusted side で独立検証できるようになっている、または候補 PR head ソースツリーを安全に静的解析する設計(実行を伴わない読み取り専用解析)が採用され実装されている - Desired Destination:
visual-impact-policy-trustedが candidate-controlled な自己申告に依存せず、TS import graph 経由の到達可能性についても残存 bypass 経路を独立検証できる状態(実装: visual-impact-policy-trusted の残存検証ギャップ(TS import graph 到達可能性・CheckRun identity・reusable workflow pinning)を縮小する #2093 Desired Destination 参照)
Predecessor
#2098(Blocker): .github/workflows/visual-impact-trusted-consumer.yml の同じ trusted-input derivation block(Git 認証 bootstrap failure の分類・修正)を扱う OPEN Issue であり、.github/workflows/visual-impact-trusted-consumer.yml / scripts/agent-ops/tests/test_visual_impact_trusted_consumer.py を Allowed Paths に持つ。本 Issue はその fetch 後にさらに candidate blobs を読む拡張のため、#2098 未完了の状態で並行実装すると認証・plumbing failure の failure taxonomy を二重に触ることになる。#2098 マージ後に本 Issue へ着手すること(OWNER レビュー、issuecomment-5254213373)。また open Draft PR #2070 も同 workflow に広範な変更を含むため、着手直前に current diff との衝突有無を確認すること。
Current Validated Scope
scripts/agent-ops/resolve_visual_impact.mjsのisRelativeSpecifier()は/始まりを相対として許容しpath.resolve(containingDir, base)で解決する実装が現存する(HEAD 3559ad2 時点 codebase-investigator fact-check で confirmed)。Node のpath.resolve()は後続の absolute segment に到達するとそれ以前を捨てる semantics であり、isRelativeSpecifier()が/始まりを relative 扱いすることと組み合わさると path confinement の抜け穴になり得る- producer path(
modules/styles/assets/config)を定義する正本 schema はdocs/dev/visual-surfaces.schema.jsonである(scripts/agent-ops/resolve_visual_impact.pyのDEFAULT_SCHEMA_PATHがこれを指す。control-plane が直接コード確認済み:resolve_visual_impact.py:45)。docs/dev/visual-impact.schema.json(DEFAULT_VISUAL_IMPACT_SCHEMA_PATH、同ファイル47行目)は declaration/decision/evidence 用の別 schema であり、producer path の定義を持たない scripts/agent-ops/resolve_visual_impact.pyのresolve_trusted_minimum()は meta-policy path / global invalidator / direct producer・contract path / registry-union mapping deletion / coverage-root boundary の5シグナルのみで、TS import graph walk を含まない(実装: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2091 実装済み範囲の前提通り。関数 docstring にも "Deliberately omits step 4 (mjs transitive reachability)" と明記されている).github/workflows/visual-impact-trusted-consumer.ymlには|| trueが2箇所存在する(control-plane が直接コード確認済み)。159行目git diff --name-status ... > artifacts/trusted/name_status.nul || trueは trusted input 取得の fail-open であり本 Issue の対象。214行目cat verdict.json || trueは診断出力のみで trusted input 取得ではなく対象外- 同ファイル166-174行目の
git show "${SHA}:${REGISTRY_PATH}" ... else rm -f ...は、registry ファイルが当該コミットに存在しない正常なケース(missing file)と、任意の git plumbing failure(ネットワークエラー・オブジェクト破損等)を同一のelse節(rm -f)で扱っており、fail-closed taxonomy が分離されていない(control-plane が直接コード確認済み) scripts/agent-ops/resolve_visual_impact.pyのrun_mjs()(304-317行目)のsubprocess.run()にはtimeout=引数がなく、wall-clock 上限が存在しない(control-plane が直接コード確認済み)scripts/agent-ops/tests/test_visual_impact_trusted_consumer.py(440-442行目)には、workflow 内でpnpm/npm/npxを実行する run fragment を禁止する既存 regression test が存在する。一方.github/workflows/visual-impact-trusted-consumer.ymlは base checkout 後に Python/uv setup のみを行い、Node/TypeScript dependency の provisioning を一切行っていない(control-plane が直接コード確認済み)。現行resolve_visual_impact.mjsはimport ts from 'typescript'に依存するため、この既存 regression と Node dependency 不在の間には未解決の bootstrap ギャップがある- 本 Issue の write-capable scope は上記の trusted-side 拡張と
|| truefail-open 穴(159行目相当のみ)の除去に限る
Remaining Parent Gaps
- 子2(CheckRun provenance binding)は別 Issue(Refs 実装: visual-impact-policy-trusted の残存検証ギャップ(TS import graph 到達可能性・CheckRun identity・reusable workflow pinning)を縮小する #2093)
- 子3(immutable evidence producer / attestation architecture)は別 Issue(Refs 実装: visual-impact-policy-trusted の残存検証ギャップ(TS import graph 到達可能性・CheckRun identity・reusable workflow pinning)を縮小する #2093)
Outcome
resolve_trusted_minimum()(scripts/agent-ops/resolve_visual_impact.py)が TS import graph 経由の到達可能性も trusted side で独立検証できるように実装され、対応する pytest が PASS している状態。実装は以下を満たす:
- 候補ソースを実行可能な checkout として materialize せず、
git ls-tree/git cat-file --batch等で Git object database を read-only に読む、またはそれと同等以上に狭い trust boundary を持つ設計(base-locked resolver・candidate data はデータとしてのみ扱う・resource bound を満たす) - 全 path ingress(entry module 自身、TS import/export、CSS
@import、CSSurl()、new URL(..., import.meta.url)、extension/index probing を含む)が単一の confined resolver を必ず通り、absolute path /..escape / symlink escape //始まり specifier の誤許容を一貫して拒否する - per-file bytes / total bytes / file count / import-hop depth(
max_graph_depth)/ wall-clock time / Node heap(可能な場合)の resource bound が、それぞれ個別の fail-closed reason code とテストを持つ - TypeScript dependency(
typescriptパッケージ)の trusted-side bootstrap 方針が固定・文書化されている(base 側 lockfile に固定した最小限の deterministic install を許容するか、Node dependency 自体を trusted consumer へ一切持ち込まない代替設計にするかのいずれかを選択し、scripts/agent-ops/tests/test_visual_impact_trusted_consumer.pyの pnpm/npm/npx 禁止 regression(440-442行目)との整合を取る、または該当 regression を明示的に更新する)
あわせて .github/workflows/visual-impact-trusted-consumer.yml の trusted input 取得における || true fail-open 記述(159行目、trusted input acquisition のみ。214行目の診断用 cat || true は対象外)が除去され、git show の missing-file と git plumbing failure を区別する fail-closed taxonomy が実装され、対応する negative control テストが追加されている状態。
In Scope
resolve_trusted_minimum()への TS import graph transitive reachability trusted-side 検証の追加、または candidate checkout/materialization を避けた Git-object-backed な候補ソース静的解析設計の実装(base-locked resolver、実行なし)- 候補ソースをデータとしてのみ扱う(実行しない。ディスクへの materialize を避けられる設計を優先する)
- 全 path ingress(entry module、TS import/export、CSS
@import/url()、new URL(...)、extension/index probing)を単一の confined resolver に通す実装(fs.realpath()等による canonical realpath を含む repo-root confinement。symlink/..escape 拒否) - absolute path /
../ symlink escape //始まり specifier の誤許容の拒否 - per-file / total bytes / file count / import-hop depth(
max_graph_depth)/ time の resource bound の実装(それぞれ個別の fail-closed reason code) - TypeScript dependency の trusted-side bootstrap 方針の決定・実装・文書化(既存の pnpm/npm/npx 禁止 regression との整合、または明示的な regression 更新を含む)
- transitive-only change(TS import 経由でのみ到達可能な変更)を正しく検出する negative control fixture の追加。producer が
affected_surfaces: []を forge してもok=Falseになることを検証する adversarial fixture を含む .github/workflows/visual-impact-trusted-consumer.ymlに現存する trusted input 取得の|| truefail-open 穴(159行目、git diff ... || true)の除去(214行目の診断用cat verdict.json || trueは対象外)git show/git diffの failure taxonomy 分離: missing file(正常系)と任意の git plumbing failure(異常系)を異なる分岐・異なる fail-closed reason code で扱う実装、および両方を想定した negative control の追加- 実装が「TS compiler import graph」ではなく「base-locked existing static-import resolver semantics」であることを Issue/コード双方の呼称・コメントで正確に反映する(
paths/baseUrl/Vite alias/packageimports・exportsを解決しない、という既存の限界を明示する) - AC1/AC2 の Verification Commands を、
verify_trusted_artifact()の最終 verdict まで通す end-to-end adversarial test に変更する(comment/dead code で通ってしまう presence-basedrg検査からの脱却)
Out of Scope
- 実装: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2091 実装済みの trusted-side re-derivation(base_sha/PR body digest/changed-path digest/registry blob sha/policy_version 突合等)の再変更
- 子2(CheckRun provenance binding)のスコープ
- 子3(immutable evidence producer / attestation architecture)のスコープ
resolve_trusted_minimum()の既存5シグナル(meta-policy path / global invalidator / direct producer・contract path / registry-union mapping deletion / coverage-root boundary)ロジック自体の変更.github/workflows/visual-impact-trusted-consumer.yml214行目の診断用cat verdict.json || trueの変更(trusted input acquisition ではないため本 Issue の対象外)- 実装: trusted visual-impact consumer の Git 認証 bootstrap failure を分類・修正する #2098 が扱う Git 認証 bootstrap failure の分類・修正ロジック自体の変更(本 Issue は 実装: trusted visual-impact consumer の Git 認証 bootstrap failure を分類・修正する #2098 マージ後にその上へ拡張するのみ)
Acceptance Criteria
- AC1:
resolve_trusted_minimum()が TS import graph transitive reachability を trusted side で独立検証する実装が追加されている、または candidate checkout/materialization を避けた Git-object-backed な静的解析設計(base-locked resolver・実行なし)が採用され実装されている。検証はverify_trusted_artifact()の最終 verdict まで通す end-to-end adversarial test で行う - AC2: 候補ソースの全 path ingress(entry module、TS import/export、CSS
@import/url()、new URL(...)、extension/index probing)が単一の confined resolver を通り、absolute path /..escape / symlink escape //始まり specifier の誤許容を一貫して拒否する実装になっている - AC3: absolute path /
../ symlink escape //始まり specifier の誤許容を拒否する negative control テストが追加され PASS している - AC4: per-file / total bytes / file count / import-hop depth(
max_graph_depth)/ time の resource bound が実装され、それぞれ個別の fail-closed reason code とともに上限超過時に fail-closed になることを検証するテストが追加されている - AC5: TS import 経由でのみ到達可能な transitive-only change を正しく検出する negative control fixture が追加され PASS している。producer が
affected_surfaces: []を forge してもok=Falseになることを検証する adversarial fixture を含む - AC6:
.github/workflows/visual-impact-trusted-consumer.yml159行目相当の trusted input 取得における|| truefail-open 記述が除去されている(214行目の診断用cat verdict.json || trueは対象外と明示する) - AC7:
git show/git diffの failure taxonomy が分離されている(missing file と git plumbing failure が異なる分岐・異なる fail-closed reason code で扱われる)。両方を想定した negative control テストが追加され PASS している - AC8: TypeScript dependency の trusted-side bootstrap 方針が固定・文書化され、
scripts/agent-ops/tests/test_visual_impact_trusted_consumer.pyの pnpm/npm/npx 禁止 regression(440-442行目)との整合が取れている、または該当 regression が本 Issue 内で明示的に更新されている
Runtime Verification Applicability
decision: immediate
applicable_acs:
- AC3
- AC4
- AC5
- AC7
execution_environment:
cli_tools:
- python3
- uv
- node
auth_required: false
network_required: false
skip_conditions:
- "node バイナリが実行環境に存在しない場合は SKIP ではなく environment blocked として扱う"
fallback_policy:
fallback_success_is_pass: false
notes: "fallback 経由の成功を PASS に変換しない"
artifact_requirements:
- "pytest 実行ログ(exit code・stdout/stderr)"reason: AC3/AC4/AC5/AC7 は resolve_visual_impact.mjs を実際に Node subprocess として起動し、resource bound(wall-clock timeout・resource 超過時の fail-closed 終了)や negative control(symlink escape・git plumbing error 等)を実プロセス起動・実ファイルシステム I/O で検証する。静的解析(typecheck/lint/unit test のみ)では resource bound の実効性やプロセス終了コードの検証が成立しない。
Verification Commands
# AC1
$ uv run pytest scripts/agent-ops/tests/test_resolve_visual_impact_trusted_transitive.py -k end_to_end_adversarial -v# AC2
$ uv run pytest scripts/agent-ops/tests/test_resolve_visual_impact_trusted_transitive.py -k confined_resolver -v# AC3
$ uv run pytest scripts/agent-ops/tests/test_resolve_visual_impact_trusted_transitive.py -k symlink -v# AC4
$ uv run pytest scripts/agent-ops/tests/test_resolve_visual_impact_trusted_transitive.py -k resource_bound -v# AC5
$ uv run pytest scripts/agent-ops/tests/test_resolve_visual_impact_trusted_transitive.py -k transitive_only -v# AC6
$ rg -c "artifacts/trusted/name_status\.nul$" .github/workflows/visual-impact-trusted-consumer.yml# AC7
$ uv run pytest scripts/agent-ops/tests/test_resolve_visual_impact_trusted_transitive.py -k git_plumbing_error -v# AC8
$ uv run pytest scripts/agent-ops/tests/test_resolve_visual_impact_trusted_transitive.py -k typescript_bootstrap -vAllowed Paths
- scripts/agent-ops/resolve_visual_impact.py
- scripts/agent-ops/resolve_visual_impact.mjs
- scripts/agent-ops/tests/test_resolve_visual_impact_trusted_transitive.py
- scripts/agent-ops/tests/test_visual_impact_trusted_consumer.py
- scripts/agent-ops/tests/test_visual_surfaces_schema.py
- .github/workflows/visual-impact-trusted-consumer.yml
- docs/dev/visual-surfaces.schema.json
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- 実装: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2091 実装済みの trusted-side re-derivation ロジック(既存5シグナル)自体の変更が必要と判明した場合
- 実装: trusted visual-impact consumer の Git 認証 bootstrap failure を分類・修正する #2098 が未マージのまま本 Issue に着手しようとした場合(Predecessor セクション参照)
Required Skills
なし
Required Design References
- docs/dev/visual-surfaces.schema.json
- docs/dev/visual-baseline-registry.md
Scope Delta(任意)
N/A
Notes for Reviewer
Priority P1。Refs #2093、Refs #2091。Predecessor: #2098(マージ後に着手)。TS import graph の静的解析設計は、第一候補として candidate checkout/materialization を避けた Git-object-backed virtual filesystem(git ls-tree -r -z -l によるエントリ列挙 + git cat-file --batch による blob 読み取り)+ base-locked resolver を検討すること。base graph だけで conservative detection を成立させられないか(固定 entry から head で新たに reachability が生じる経路上の最初の新規 edge を持つ importer 自身が変更されているかを見る)という代替案も設計上の候補として検討に値するが、採用する場合は反例探索と adversarial fixture での証明が必要(OWNER レビュー issuecomment-5254213373 より)。
Scope Collision (C1, overlap_requires_comment): related_issue=#2098(trusted visual-impact consumer の Git 認証 bootstrap failure 修正、.github/workflows/visual-impact-trusted-consumer.yml / scripts/agent-ops/tests/test_visual_impact_trusted_consumer.py が重複)。#2098 は non-conflict ではなく hard predecessor として扱う(同じ trusted-input derivation block を扱うため、#2098 未完了での並行実装は認証・plumbing failure の failure taxonomy を二重に触ることになる。OWNER レビュー issuecomment-5254213373 で明示)。related_issue=#2019(visual-surface dependency registry 導入、resolve_visual_impact.py/.mjs・docs/dev/visual-surfaces.schema.json・visual-impact-trusted-consumer.yml が重複)。non_conflict_reason: #2019 は visual-surface registry 導入自体の既存実装 Issue であり、本 Issue はその trusted-side 検証拡張のみを扱う。実 Git conflict は worktree/PR 作成時に別途検出される(#1860 Owner Decision)。また open Draft PR #2070 も .github/workflows/visual-impact-trusted-consumer.yml を含む広範な変更を保持しているため、着手直前に current diff との衝突有無を確認すること。
Activity
squne121 commentedon Aug 11, 2026
判定
REQUEST_CHANGES /
needs-fixです。#2099 の問題設定そのものは正しいです。むしろ現行 registry では
src/ui/HudController.tsが../stateと../systems/UpgradeSystemを import している一方、coverage_rootsはsrc/ui/**/src/render/**等に限定されています。したがって、coverage root 外の transitive-only change をresolve_trusted_minimum()が見逃す経路は現在の実コードでも成立します。これは #2094 が明示的に #2093 へ送った残存 gap と整合します。ただし、現 Issue contract のまま着手すると trust boundary を不必要に広げるか、AC を形式的に満たして実質的な穴を残す可能性があります。
[Blocker] Canonical schema を取り違えています。 実装: visual-impact-policy-trusted に TS import graph transitive reachability の trusted-side 独立検証を追加する #2099 は「
docs/dev/visual-impact.schema.jsonの producer path は string + minLength」としていますが、producermodules/styles/assets/configを定義している正本はdocs/dev/visual-surfaces.schema.jsonです。Python 側もDEFAULT_SCHEMA_PATHとしてこちらを使用しています。visual-impact.schema.jsonは declaration/decision/evidence の schema で、producer path の定義はありません。これは文言上のミスだけではありません。Allowed Paths に誤った
visual-impact.schema.jsonが入り、本来 path contract を強化すべきvisual-surfaces.schema.jsonとその schema test が変更不能です。docs/dev/visual-surfaces.schema.jsonとscripts/agent-ops/tests/test_visual_surfaces_schema.pyを Allowed Paths に入れるか、「schema は変更せず runtime confinement のみ」と明示的に決定すべきです。[Blocker] TypeScript dependency の trusted-side bootstrap が未定義です。 現行 MJS は
import ts from 'typescript'し、repository は TypeScript~6.0.2を devDependency としています。しかし trusted workflow は base checkout 後に Python/uv setup を行うだけで、project Node dependencies を決定論的に provision していません。さらに既存 security regression は workflow 内のpnpm/npm/npx実行を禁止しています。つまり AC1 の「base-locked resolver/dependencies」が実装契約になっていません。base 側の
pnpm-lock.yamlに固定した install を許すのか、その場合 scripts/cache をどう扱うのか、あるいは Node dependency 自体を trusted consumer へ持ち込まないのかを 着手前に固定する必要があります。[P1] candidate tree をディスクへ materialize する設計を第一候補にすべきではありません。
workflow_runは privileged context になり得るため、GitHub 自身も untrusted code/artifact の取り扱いや cache poisoning に注意を要求しています。([GitHub Docs]1)より狭い trust boundary は、candidate commit を checkout せず Git object database を read-only virtual filesystem として扱う方式です。
git ls-tree -r -z -lで entry と blob size を先に列挙し、git cat-file --batchで必要な blob だけを読む構成なら、host filesystem の symlink traversal 自体をかなり減らせます。([Git]2)MJS 側を
readFile/existsabstraction にし、POSIX repo-relative path → candidate blob の lookup に閉じる方が、${RUNNER_TEMP}へ untrusted tree を再現してrealpath()で後追い防御するより設計上単純です。[P1] path confinement は
realpath()が1回出てくるだけでは不十分です。 現行 MJS は entry module、TS import/export、CSS@import、CSSurl()、new URL(..., import.meta.url)、extension/index probing の複数箇所で host path を構成します。またisRelativeSpecifier()は/始まりを許可し、path.resolve(containingDir, base)を使います。Node のpath.resolve()は後続の absolute segment に到達するとそれ以前を捨てる semantics です。 ([Node.js]3)AC2 は「
realpathを使う」ではなく、全 path ingress が単一の confined resolver を必ず通ることを要求すべきです。absolute、..escape、symlink escape に加えて、entry path 自体も対象です。[P1] resource bound に memory がなく、
depthの意味も未定義です。 現在のrun_mjs()はsubprocess.run()に timeout がありません。 Python は subprocess timeout を直接提供し、Node は V8 old-space 上限も指定できます。([Python documentation]4)AC4 は少なくとも
max_file_bytes、max_total_bytes、max_files、max_graph_depth、wall-clock timeout、Node heap cap を別々の fail-closed reason code とテストにすべきです。「depth」が filesystem depth / AST nesting / import-hop depth のどれか不明な現状は実装者依存になります。[P1]
|| trueの AC6 と Verification Command が一致していません。 現行 workflow には問題のgit diff ... || trueだけでなく、診断用のcat verdict.json || trueも存在します。一方 実装: visual-impact-policy-trusted に TS import graph transitive reachability の trusted-side 独立検証を追加する #2099 の AC6 は「trusted input acquisition の fail-open を除去」と限定しているのに、VC は workflow 全体の|| trueを数えます。さらに深刻なのは
git show "$SHA:$REGISTRY_PATH"のelseが missing file と任意の git plumbing failure を同じrm -fに潰している点です。実装: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2091 が Python 側で直したmissing-ref-object != missing-fileと同じ fail-closed taxonomy を shell 側にも適用すべきです。AC7 はgit diffだけでなくgit show/ registry acquisition の異常も対象にしてください。[P1] AC1/AC2 の VC は security property を証明しません。
rg "resolve_trusted_minimum"とrg "realpath"は comment や dead code だけでも通ります。必須 evidence は
verify_trusted_artifact()の最終 verdict まで通す adversarial test にすべきです。特に「src/systems/...のような coverage-root 外かつ entry module から transitive にのみ reachable なファイルを変更し、producer がaffected_surfaces: []を forged してもok=False」を integration property として固定するべきです。[P1/P2] “TS compiler import graph” という名称が実装より強いです。 現行 MJS は TypeScript の
createSourceFile()で AST を解析していますが、module resolution 自体は独自の relative-path resolver です。コード自身もpaths/baseUrl/ Vite alias / packageimports・exportsを解決しないと明示しています。 TypeScript の実際の module resolution はより広い semantics を持ちます。([GitHub]5)実装を変えないなら AC は「base-locked existing static-import resolver semantics」と呼ぶ方が正確です。
ts.resolveModuleName等へ移行するなら、それは別途 compiler options / host contract を固定すべき変更です。[P1] 実装: trusted visual-impact consumer の Git 認証 bootstrap failure を分類・修正する #2098 を単なる “non-conflict” ではなく hard predecessor にした方がよいです。 実装: trusted visual-impact consumer の Git 認証 bootstrap failure を分類・修正する #2098 はまさに同じ trusted-input derivation block の Git authentication bootstrap failure と failure taxonomy を修正する open Issue で、同じ workflow/test を Allowed Paths にしています。 実装: visual-impact-policy-trusted に TS import graph transitive reachability の trusted-side 独立検証を追加する #2099 はその fetch 後にさらに candidate blobs を読むので、実装: trusted visual-impact consumer の Git 認証 bootstrap failure を分類・修正する #2098 未完了の状態で並行実装すると認証・plumbing failure の意味付けを二重に触ることになります。加えて open Draft PR fix(contract-review): RVA 欠落を fail-closed に統一 #2070 も同 workflow を含む広範な変更を保持しています。
推奨する設計方向
第一候補は、candidate checkout/materialization を避けた Git-object-backed virtual filesystem + base-locked resolver です。candidate tree は「実行可能な checkout」ではなく blob 集合として読み、path normalization と size/count bound を blob 読み込み前に適用し、Node parser は host filesystem に直接触れない設計が最も trust boundary を狭くできます。
さらに検討価値があるのは、base graph だけで conservative detection を成立させられないかという案です。固定 entry から head で新たに reachability が生じるには、通常はその経路上の最初の新規 edge を持つ importer 自身が変更されています。その importer が base graph で既に reachable なら、その変更だけで surface を affected と判断できます。base で unresolved だった import が head で初めて解決されるケースなどを fail-closed にできるなら、candidate source parsing 自体を避けられる可能性があります。これは現時点では設計上の推論なので、採用するなら反例探索と adversarial fixture で証明する必要があります。
結論として、#2099 は実装すべきですが、着手前に contract rewrite が必要です。最低条件は「正しい
visual-surfaces.schema.jsonへの修正」「TypeScript dependency bootstrap の固定」「#2098 の predecessor 化」「全 path ingress の単一 confinement」「memory を含む resource bounds」「git diff/git show の failure taxonomy」「presence-based VC から end-to-end adversarial VC への変更」です。ここまで直せば、#2099 はかなり強い P1 security-hardening Issue になります。squne121 commentedon Aug 11, 2026
Contract Review Result
squne121 commentedon Aug 11, 2026
issue-refinement-loop: approved
approve(compact output validation: valid)go(body SHA:sha256:819fec9f6950943695cdc8cf2f91bac017659d7ea4571104f49794035d7351dc)Anchor comment 反映内容
OWNER の9個の Blocker/P1 指摘(control-plane が全項目コード直接確認で fact-check 済み、全て正確と確認)を Issue 契約へ反映した:
docs/dev/visual-surfaces.schema.jsonに修正(誤り:visual-impact.schema.json)## Predecessorセクションを新設し 実装: trusted visual-impact consumer の Git 認証 bootstrap failure を分類・修正する #2098 を hard predecessor 化|| truefail-open の対象を159行目(trusted input acquisition)のみに限定、214行目(診断用)を対象外化git show/git diffの failure taxonomy 分離(missing file vs plumbing error)を AC7 に追加max_graph_depth・wall-clock・memory を個別 fail-closed reason code として追加rgから end-to-end adversarial test へ変更squne121 commentedon Aug 12, 2026
implement-issue: 実装完了 (2026-08-12T14:24:13Z)
.claude/worktrees/issue-2099-ts-import-transitive-reachabilityworktree-issue-2099-ts-import-transitive-reachabilitychore: PR本文へ VISUAL_IMPACT_DECLARATION_V1 を追加した再検証トリガー (#2099)
chore: VISUAL_IMPACT_DECLARATION_V1 に verified_unchanged エントリを追加した再検証…
squne121 commentedon Aug 12, 2026
impl-review-loop: 完了 (2026-08-12T15:10:00Z)
visual-impact-policy-trusted(follow-up 実装: visual-impact-policy-trusted の PR body 独立検証を producer 側改行取り扱いと一致させ pr_body_digest_mismatch 誤検知を解消する #2145 で追跡済み・実装: visual-impact-policy-trusted に TS import graph transitive reachability の trusted-side 独立検証を追加する #2099 Out of Scope 該当)のみであり、route_loop_verdict_v2()の policy 上 human escalation 理由にしない)fix: trusted transitive graph walker の CSS 削除バイパス・素の相対URL・無制限git・plum…
squne121 commentedon Aug 12, 2026
impl-review-loop: 完了 (2026-08-12T22:20:00Z)
route_loop_verdict_v2(): mergeable=MERGEABLE, merge_state_status=CLEAN, blockers=[])このイテレーションは repo owner による PR コメント(https://github.com/squne121/loop-protocol/pull/2144#issuecomment-5273206822)の REQUEST_CHANGES(P1 4件)を fix_delta として実装・再検証・再レビューしたもの。P1 4件全て pr-reviewer が実コードで独立再検証済み。
実装: visual-impact-policy-trusted に TS import graph transitive reachab…
squne121 commentedon Aug 13, 2026
post-merge-cleanup: 完了 (2026-08-13T13:25:00Z)
.claude/worktrees/issue-2099-ts-import-transitive-reachability/worktree-issue-2099-ts-import-transitive-reachability): cleanup_exec で削除済みall_children_closed: false(残 children: 実装: visual-impact-policy-trusted の CheckRun provenance に exact workflow_run.id binding の adversarial negative control を追加する #2100, 調査: visual-impact-policy の same-run producer authenticity 保証(固定 producer / full-SHA pinned reusable workflow / artifact attestation)採用可否を決定する #2101, 実装: visual-impact-policy-trusted の PR body 独立検証を producer 側改行取り扱いと一致させ pr_body_digest_mismatch 誤検知を解消する #2145)のため keep_open(close しない)