Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#928"
goal_ref: "EntireCLI 使用時の public push / telemetry / unknown config を fail-closed で検出する"
change_kind: mixedParent Issue
Parent Goal Ref
- Goal: EntireCLI を使う場合でも public checkpoint / session push 経路や unsafe config を検出し、report posting と retro index update を fail closed にする。
- Desired Destination: checker が not_applicable / blocked / safe を判定し、env や git config の生値を public-safe に再露出しない。
Background
既存の .claude/scripts/check_session_recording_runtime_safety.py(PR #474 実装)は Python verifier として継続運用する。本 Issue の scripts/agent-logs/check-entirecli-safety.mjs は、agent-run-report フロー向けの JS adapter として、Python verifier の判定ロジックを移植せず独立した verdict を report field に接続するアダプターレイヤーとして実装する。二重正本を防ぐため、JS checker が Python verifier の not_applicable/safe/blocked 判定基準と同一の規則を使用することを「In Scope」に明記する。
Current Validated Scope
- EntireCLI safety checker と helper / tests を追加する。
- available surface 記録、public push 経路検査、token/env / git config 検査、report verdict 連携を追加する。
docs/dev/agent-run-report.mdに checker の扱いを追記する。safe条件の完全な列挙:strategy_options.push_sessionsが effective config としてfalseと確認できる、strategy_options.telemetryがfalseと確認できる(未設定はblocked)、checkpoint_remoteがprivate_verifiedまたは local-only と確認できる、ENTIRE_CHECKPOINT_TOKENが存在する場合はcheckpoint_remoteがprivate_verifiedであること。- git config 検査対象キー全列挙:
remote.*.url,remote.*.pushurl,remote.pushDefault,branch.*.pushRemote,url.*.insteadOf,url.*.pushInsteadOf,include.path,includeIf.*.path,remote.*.mirror,remote.*.push。local refs,.entire/, commit trailers,ENTIRE_CHECKPOINT_TOKENenv presence も対象。 - schema read-back 確認:
docs/schemas/agent-run-report.schema.jsonにpublic_safety.entirecli_safetyフィールドが存在することを実装前に確認する。
Remaining Parent Gaps
- 導入: ChatGPT改善検討用のAI作業ログレポートをGitHubに永続保存する #928 parent の close 判定と merged child read-back は別作業で実施する。
Outcome
EntireCLI safety checker、tests、docs 追記、package wiring が 1 PR で追加され、EntireCLI 未使用時は not_applicable、unsafe / unknown visibility / push 経路ありは fail closed / blocked と判定し、report へ verdict を取り込める状態。
In Scope
entire version,entire enable --help,entire configure --helpなど available surface の記録(テストは fixture / mocked command runner で検証し、live EntireCLI binary は不要)。push_sessions,--skip-push-sessions,--local,--telemetry=false, checkpoint remote private verified の判定。- remote branch / local refs /
.entire// commit trailers /pushurl/insteadOf/pushInsteadOf/ token env presence の検査。 - report field
agent_run_report.public_safety.entirecli_safetyへの verdict 連携。 - JS checker (
check-entirecli-safety.mjs) は Python verifier (check_session_recording_runtime_safety.py) のnot_applicable/safe/blocked判定基準と同一の規則を使用する(二重正本防止)。
Out of Scope
- run report schema / lifecycle scripts 本体。
- retro index builder / workflow 全体。
- follow-up issue handoff docs の全面更新。
Acceptance Criteria
- AC1: EntireCLI 未使用時は
not_applicableverdict を出す。 - AC2: EntireCLI 使用時は
entire version,entire enable --help,entire configure --helpなどの available surface を記録する(テストは fixture / mocked command runner で検証し、live EntireCLI binary は不要)。 - AC3:
safeverdict は以下をすべて満たす場合のみ成立する:strategy_options.push_sessionsが effective config としてfalseと確認できるstrategy_options.telemetryがfalseと確認できる(未設定はblocked)checkpoint_remoteがprivate_verifiedまたは local-only と確認できるENTIRE_CHECKPOINT_TOKENが存在する場合はcheckpoint_remoteがprivate_verifiedであること- public / unknown / non-GitHub / parse error / network error / auth error はすべて
blocked
それ以外(確認不能・設定未発見)は fail_closed としてblockedを出す。
- AC4:
entire/checkpoints/v1,entire/*,*checkpoint*,*session*remote branch を検査する。 - AC5: 以下の git config キーをすべて検査する:
remote.*.url,remote.*.pushurl,remote.pushDefault,branch.*.pushRemote,url.*.insteadOf,url.*.pushInsteadOf,include.path,includeIf.*.path,remote.*.mirror,remote.*.push。local refs,.entire/, commit trailers,ENTIRE_CHECKPOINT_TOKENenv presence も対象。出力は raw URL / raw config path / token を出さず、reason_codeと redacted fingerprint のみ。 - AC6: public repo への checkpoint / session push 経路が 1 つでも見つかれば
blockedになり、unknown visibility も fail closed になる。 - AC7: 実装前に
docs/schemas/agent-run-report.schema.jsonを参照しpublic_safety.entirecli_safetyフィールドが既存 schema に存在することを確認する。存在しない場合は Stop Condition に従って schema 追加を別 follow-up Issue として分離し、本 Issue のスコープを verdict 計算のみに限定する。 - AC8: checker の verdict が
agent_run_report.public_safety.entirecli_safetyに取り込める。 - AC9: fixture で safe / public branch / pushurl rewrite / unknown visibility / telemetry enabled / token present を検証し、env や git config の生値をそのまま出力しない。
Verification Commands
# AC1
$ test -f tests/agent-logs/entirecli-not-applicable.test.ts
# AC2
$ test -f tests/agent-logs/entirecli-surface.test.ts
# AC3
$ test -f tests/agent-logs/entirecli-fail-closed.test.ts
# AC4
$ test -f tests/agent-logs/entirecli-remote-branches.test.ts
# AC5
$ test -f tests/agent-logs/entirecli-config-scan.test.ts
# AC6
$ test -f tests/agent-logs/entirecli-blocked.test.ts
# AC7
$ grep -n "entirecli_safety" docs/schemas/agent-run-report.schema.json
# AC8
$ test -f tests/agent-logs/entirecli-report-field.test.ts
# AC9
$ test -f tests/agent-logs/entirecli-safety.test.tsAllowed Paths
scripts/agent-logs/check-entirecli-safety.mjsscripts/agent-logs/lib/entirecli-safety*.mjstests/agent-logs/entirecli-*.test.tsdocs/dev/agent-run-report.mdpackage.json
Runtime Verification Applicability
decision: not_applicable
reason: "AC2 の available surface 確認は live EntireCLI binary を要求せず、fixture / mocked command runner のみで検証する。`entire version` 等の実 CLI 実行は成果条件に含まない。"Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- env や git config の生値をそのまま出さずに安全判定できないことが判明した場合
Required Skills
- JavaScript / git config inspection
Scope Delta(任意)
tests/agent-logs/entirecli-safety*.test.ts → tests/agent-logs/entirecli-*.test.ts
実装(PR #1131)で各 AC を独立したテストファイルに分割したため、Allowed Paths パターンを拡張する。対象は EntireCLI safety checker のテストのみであり、スコープ外への拡大はない。
Delivery Rule
1 Issue = 1 PRで完了する。- Draft PR を既定とする。
- EntireCLI 採用判断そのものではなく fail-closed checker の実装に限定する。
Activity
squne121 commentedon Jun 22, 2026
判定
REQUEST_CHANGES 相当。 #941 の方向性は正しいですが、このまま実装すると 既存 verifier との二重実装、false green、public transcript leak の見落としを作りやすいです。#941 本体にコメントはなく、検索上も #941 を閉じる PR はまだ見つかりませんでした。関連 PR としては #934 の境界整理 PR #951、既存 EntireCLI safety verifier PR #474、policy PR #323 が該当します。
重要な前提
EntireCLI は、AI coding session の prompts / responses / touched files / token usage / tool calls 等を Git と紐付けて保存するツールで、session metadata は
entire/checkpoints/v1branch に保存されます。公式 docs では、commit 時に session log / metadata がentire/checkpoints/v1に入り、次回git pushで checkpoint branch も自動 push される、と説明されています。([GitHub]1) ([docs.entire.io]2)さらに公式 README は、public repository では
entire/checkpoints/v1上の session transcripts が誰でも見える、redaction は best-effort、temporary shadow branches には unredacted data が残り得る、と明記しています。したがって #941 は「便利機能」ではなく、public leak 防止の fail-closed security gateとして扱う必要があります。([GitHub]1)Blocker 1: #379 / PR #474 の既存 verifier と責務が重複している
#941 は
scripts/agent-logs/check-entirecli-safety.mjsを新設する前提ですが、既に PR #474 で.claude/scripts/check_session_recording_runtime_safety.pyが実装済みです。この verifier は public checkpoint branch、auto-push settings、unknown remote visibility、git hooks / agent hook files、token、redaction を fail-closed で検査し、fixture test もあります。#379 側の契約も、
checkpoint_remotevisibility、.entire/settings.json/.entire/settings.local.jsonの merge、strategy_options.push_sessions、git config --show-origin --show-scopeによる effective config 評価まで含んでいます。修正要求: #941 は新規 checker を独立実装するのではなく、次のどちらかに固定すべきです。
agent_run_report.public_safety.entirecli_safetyへ取り込む adapter / summarizer に限定する。現状のままでは「session-recording verifier」と「agent-run-report verifier」が別々の安全判定を返す二重正本になります。
Blocker 2:
safeの条件が弱い#941 は
not_applicable / blocked / safeverdict を目標にしていますが、safeの成立条件が厳密ではありません。EntireCLI 公式設定では--skip-push-sessions、--local、--checkpoint-remote、--telemetry=false、strategy_options.push_sessions、strategy_options.checkpoint_remote、telemetryが関係します。checkpoint_remote未設定時は既定で code remote にentire/checkpoints/v1が push され、ENTIRE_CHECKPOINT_TOKENがあると token-based HTTPS operation に寄ります。([GitHub]1) ([GitHub]1)修正要求:
safeは最低でも以下をすべて満たす場合だけにしてください。strategy_options.push_sessions === falseを effective config として確認できる。falseと確認できる。未設定はblockedまたはfail_closed。private_verifiedまたは local-only と確認できる。ENTIRE_CHECKPOINT_TOKENが存在する場合、checkpoint remote が private verified でない限り fail-closed。blocked。「設定が見えないので多分 safe」は禁止です。
Blocker 3: Git remote / URL rewrite の検査面が不足しやすい
Git は
remote.<name>.pushurlがある場合それを push に使い、複数pushurlがあればすべて push 先になります。またurl.<base>.pushInsteadOfは push URL を書き換え、明示pushurlがあればpushInsteadOfは無視されます。remote.<name>.urlも複数持て、pushurlが無い場合は push に使われます。([Git]3)さらに Git config には
include/includeIfがあり、別ファイルの config が読み込まれます。git config --nullは改行を含む値でも安全に parse でき、--show-origin/--show-scopeは値の出所と scope を出します。([Git]3)修正要求: AC5 は次まで拡張すべきです。
remote.*.urlremote.*.pushurlremote.pushDefaultbranch.*.pushRemoteurl.*.insteadOfurl.*.pushInsteadOfinclude.pathincludeIf.*.pathremote.*.mirrorremote.*.push出力は raw URL / raw config path / token を出さず、
reason_codeと redacted fingerprint だけにしてください。Blocker 4:
agent_run_report.public_safety.entirecli_safety連携が schema 境界を越える可能性#941 は AC7 で
agent_run_report.public_safety.entirecli_safetyに verdict を取り込むとしていますが、同時に run report schema / lifecycle scripts 本体は Out of Scope としています。#928 系では public-safe report / retro index の schema・validator・posting guard を段階的に分けており、#935 では unknown field や raw transcript / local path / full prompt 等を reject する fail-closed contract が要求されています。修正要求: #941 の前提に「既存 schema に
public_safety.entirecli_safetyが既に存在すること」を read-back で確認する AC を追加してください。存在しない場合は #941 で schema を変更せず、Stop Condition に従って follow-up issue 化すべきです。Blocker 5: Runtime Verification
not_applicableが雑#941 は Runtime Verification Applicability を
not_applicableとしていますが、AC2 はentire version,entire enable --help,entire configure --helpの available surface 記録を含みます。外部 CLI 実行を成果条件に含めるなら、repo の runtime verification policy 上はimmediateまたはdeferredの整理が必要です。policy はnot_applicableを「ブラウザ/実行環境不要な docs/tests 等」に限定し、runtime AC がある場合は証跡と ownership を要求します。修正要求: #941 は次のどちらかに寄せるべきです。
not_applicableは成立。entirebinary surface を読むならdecision: deferredにし、verification_owner: human、必要環境、failure handling を書く。高品質化した #941 の設計案
verdict schema
判定規則
not_applicable:entirebinary /.entire// Entire hooks /entire/checkpoints/v1refs / checkpoint trailers / token env / Entire config がすべて存在しない場合のみ。safe: Entire 使用が検出され、no-push、telemetry false、private/local checkpoint remote、token条件、remote visibility がすべて確認できた場合のみ。blocked: public、unknown、parse error、auth error、network error、non-GitHub remote、raw出力混入、schema field 不在のいずれか。追加すべき fixture
includeIf経由で publicpushInsteadOfが入る。remote.origin.pushurlが複数あり、1つだけ public。remote.pushDefault/branch.*.pushRemoteが public。ENTIRE_CHECKPOINT_TOKENpresent +checkpoint_remoteabsent。checkpoint_remoteが private だが GitHub API 403/404 で visibility unknown。.entire/settings.local.jsonがsettings.jsonを override して push enabled。.entire/が tracked されている。Entire-Checkpoint:trailer が local commit にある。ghp_,github_pat_,sk-,sk-proj-,AKIA, Windows absolute path, POSIX absolute path が出ない。結論
#941 は必要ですが、今の contract のままでは「安全 checker を追加したつもりで、既存 verifier と矛盾する第2の安全判定を作る」リスクが高いです。実装前に、#379 / PR #474 の verifier を正本にするか、JS へ完全移植するかを決めてください。そのうえで
safe条件、Git config graph、schema field 連携、runtime verification の扱いを明文化すれば、かなり堅い Issue になります。squne121 commentedon Jun 22, 2026
Refinement Loop: Human Escalation Required
The loop has terminated and requires human review. Cause: human judgment required
human_escalationhuman_judgment_requiredBlockers
squne121 commentedon Jun 22, 2026
Contract Review: #941 — go ✅
Contract Snapshot
Outcome: EntireCLI safety checker、tests、docs 追記、package wiring が 1 PR で追加され、EntireCLI 未使用時は
not_applicable、unsafe / unknown visibility / push 経路ありは fail closed / blocked と判定し、report へ verdict を取り込める状態。Acceptance Criteria: AC1–AC9(チェックボックス形式・番号整合済み)
VC Preflight 集約:
test -f tests/agent-logs/entirecli-not-applicable.test.tstest -f tests/agent-logs/entirecli-surface.test.tstest -f tests/agent-logs/entirecli-fail-closed.test.tstest -f tests/agent-logs/entirecli-remote-branches.test.tstest -f tests/agent-logs/entirecli-config-scan.test.tstest -f tests/agent-logs/entirecli-blocked.test.tsgrep -n "entirecli_safety" docs/schemas/agent-run-report.schema.jsontest -f tests/agent-logs/entirecli-report-field.test.tstest -f tests/agent-logs/entirecli-safety.test.tsAllowed Paths:
scripts/agent-logs/check-entirecli-safety.mjsscripts/agent-logs/lib/entirecli-safety*.mjstests/agent-logs/entirecli-safety*.test.tsdocs/dev/agent-run-report.mdpackage.jsonWorktree / Branch:
.claude/worktrees/issue-941-entirecli-safety-checkerworktree-issue-941-entirecli-safety-checkerRuntime Verification Applicability:
not_applicable(fixture / mocked command runner のみ、live EntireCLI binary 不要)→
implement-issueへ handoff 可能。feat(#941): add EntireCLI safety checker
squne121 commentedon Jun 22, 2026
Scope Delta 申請: Allowed Paths 拡張
impl-review-loop iteration 0 の PR review(pr-reviewer judge)で以下の Allowed Paths 違反が検出されました。
現在の Allowed Paths パターン
実際に追加されたファイル
実装では各 AC を独立したテストファイルに分割しました(PR #1131):
tests/agent-logs/entirecli-not-applicable.test.ts(AC1)tests/agent-logs/entirecli-surface.test.ts(AC2)tests/agent-logs/entirecli-fail-closed.test.ts(AC3)tests/agent-logs/entirecli-remote-branches.test.ts(AC4)tests/agent-logs/entirecli-config-scan.test.ts(AC5)tests/agent-logs/entirecli-blocked.test.ts(AC6)tests/agent-logs/entirecli-report-field.test.ts(AC8)tests/agent-logs/entirecli-safety.test.ts(AC9)← パターン一致上記のうち
entirecli-safety.test.tsのみが現行パターンに一致します。残り 7 ファイルは Scope Delta が必要です。申請内容
変更内容はすべて Issue #941 のスコープ(EntireCLI safety checker のテスト)内であり、Allowed Paths 外へのスコープ拡大ではありません。
対応手順
tests/agent-logs/entirecli-*.test.tsに更新issue-contract-reviewを再実行go判定後、impl-review-loop を再開squne121 commentedon Jun 22, 2026
Contract Review: #941 — go ✅(Scope Delta 適用済み)
Scope Delta 変更内容
tests/agent-logs/entirecli-safety*.test.ts→tests/agent-logs/entirecli-*.test.tsContract Snapshot
Outcome: EntireCLI safety checker、tests、docs 追記、package wiring が 1 PR で追加され、EntireCLI 未使用時は
not_applicable、unsafe / unknown visibility / push 経路ありは fail closed / blocked と判定し、report へ verdict を取り込める状態。Acceptance Criteria: AC1–AC9(チェックボックス形式・番号整合済み)
VC Preflight 集約:
test -f tests/agent-logs/entirecli-not-applicable.test.tstest -f tests/agent-logs/entirecli-surface.test.tstest -f tests/agent-logs/entirecli-fail-closed.test.tstest -f tests/agent-logs/entirecli-remote-branches.test.tstest -f tests/agent-logs/entirecli-config-scan.test.tstest -f tests/agent-logs/entirecli-blocked.test.tsgrep -n "entirecli_safety" docs/schemas/agent-run-report.schema.jsontest -f tests/agent-logs/entirecli-report-field.test.tstest -f tests/agent-logs/entirecli-safety.test.tsAllowed Paths:
scripts/agent-logs/check-entirecli-safety.mjsscripts/agent-logs/lib/entirecli-safety*.mjstests/agent-logs/entirecli-*.test.tsdocs/dev/agent-run-report.mdpackage.jsonWorktree / Branch:
.claude/worktrees/issue-941-entirecli-safety-checkerworktree-issue-941-entirecli-safety-checkerRuntime Verification Applicability:
not_applicable(fixture / mocked command runner のみ、live EntireCLI binary 不要)→ PR #1131 の re-review へ handoff 可能。
fix(#941): apply PR review fix_delta B1-B8 — checkpoint_remote visibi…
feat(#941): add EntireCLI safety checker (#1131)
squne121 commentedon Jun 22, 2026
post-merge-cleanup: 完了 (2026-06-22)
cleanup サマリー
issue-941-entirecli-safety-checkerworktree-issue-941-entirecli-safety-checkergit pull origin main(6199092b)