bootstrap walkthrough skip and gh install relocation - Liplus-Project/liplus-language GitHub Wiki

Bootstrap walkthrough sentinel-skip + gh install hook 移譲

判断

2026-05-18 セッション内で、(1) Li+update.md Phase 2.1 の gh install spec を hook 側に移譲、(2) adapter/claude/hooks/on-session-start.sh に 3 軸 sentinel-skip 機構を追加して update walkthrough を skip 可能化、(3) Li+configを実行 magic phrase で強制再走経路を確保、の 3 点を一括実装する判断を確定。 PR #1310 merge 完了。

背景

セッション開始時に Li+config + Li+update を実行する経路で AI context を約 4% 消費していた (Li+config 実行 10% vs 未実行 6% の Master 実測)。 99% のセッションでは tag / schema / config 値とも前回から変化が無く、 spec walkthrough は verification only に終わっている。 update procedure は本質的に idempotent installer であり、 毎セッション spec を読み下す構造的必然性が無いと判断した。

制約

  • Li+ は配布用プロジェクト = hardcoded user-specific path 禁止 (~ 展開は universal なので OK)
  • Windows host 側に余計なツールを入れない方針 = gh 本体は sandbox 側 (~/.local/bin/gh) install を維持
  • sandbox persistence は Li+ 責任範囲外として受容 (persist しない場合は毎セッション install が走る点を含めて)
  • L1 Model Layer source は touch しないため evolution-l1-update-gating は対象外 (touch 対象は L6 adapter / bootstrap / hook のみ)

結論

採用案:

  • Li+update.md Phase 2.1 は「prerequisite install は hook が管理」の 1 行参照に圧縮
  • hook が command -v ~/.local/bin/gh で sandbox gh の有無を check、 無ければ curl + tarball で ~/.local/bin/gh に install (失敗時は cold-start material で Master 介入要請を emit)
  • 3 軸 (sentinel tag 一致 / schema canonical / LI_PLUS_BASE_LANGUAGE + LI_PLUS_PROJECT_LANGUAGE 解決済み) AND gate で LI_PLUS_UPDATE_STATUS=unnecessary signal を emit
  • AI 側は signal を読んで update walkthrough skip、 magic phrase Li+configを実行 で bypass (adapter CLAUDE.md Execute block に contract 記述)
  • ~/.local/bin/gh literal 指定は据え置き (~ は universal expansion で distribution 上の hardcode 問題は実質発生しない)

却下案:

  • MCP 型独立 install (Windows host 側 prerequisite として gh) → Master 明示で却下。 host untouched 方針との衝突。
  • settings.json env block で PATH=$HOME/.local/bin:$PATH を per-tool-invocation 注入 → Claude Code は env block で $HOME / $PATH 展開しない仕様 (literal 文字列扱い) を確認。 CLAUDE_ENV_FILE 経路に降りる必要があり、 新規ファイル + host 挙動依存で複雑度コストが portability gain を上回ると評価。
  • bootstrap on-demand 化 (必要時のみ install) → sandbox persistence が不確実なため最悪ケースで「gh を使う最初の skill 起動時に毎セッション install stutter」が発生、 棄却。

「綺麗じゃないが pragmatic」 を Master と AI で合意した上で採用。 host capability の凹凸に乗る部分は構造的に綺麗にしきれない領域であるため、 最小複雑度の形に倒した。

残課題 (本 issue scope 外、 別 issue 候補)

  • gh version pin の置き場所: hook 内に GH_VERSION=2.62.0 を hardcode。 Li+ release cycle と gh release cycle が独立しているため、 運用上 version 注入機構を別 issue で設計するか、 当面は hook 内編集で済ますか未決。
  • tag channel local fallback の整合性: git ls-remote 失敗時の local git tag fallback で stale local clone が誤判定するリスクが残る。 3 軸 AND gate でカバーされるが、 実機での fetch skip 連鎖検証は別 issue 候補。

2026-05-25 boundary refinement: spot read vs walkthrough

Question

sentinel-skip = unnecessary の session 中、 AI は Li+config.md の値 lookup を目的とした on-demand spot read を発火してよいか?

Current resolution

許可。 Li+update.md の re-execution は引き続き禁止だが、 Li+config.md の Read (値抽出のみ、 execute 不可) は permitted。 「opening the file does not re-enter step 2」が運用境界。

Background

当初 literal 「Do NOT read Li+config.md or Li+update.md this session」 は本来の walkthrough skip 意図 (token 節約 / #1309) を超えて全面禁止に振れていた。 実運用で AI が sentinel-skip session 中に repo URL / execution mode / 言語等の config 値を引きたい場面が発生し、 「Master に口頭で聞く」 or 「override magic phrase で full walkthrough を強制起動」 の二択となっていた。 後者は #1309 の本来意図 (token 節約) を毎回相殺する構造。

Adopted refinement

adapter literal を 「Li+update.md re-execution 禁止 / Li+config spot read (Read for value lookup, do not execute contents) 許可」 に refine。 動詞分離 (Read for value lookup vs execute its contents) + 例示の e.g. 化 + 「opening the file does not re-enter step 2」 明文化で運用境界を立てる。 hook banner (line 198) も同方針で同期。 brake 1 (parallel-subagent-eval N=3) は R1 axis C 3 subagent converging partial → revise → R2 9/9 consistent unanimous で adopt。

Related (refinement axis)

  • #1395 (refinement 起票 issue)
  • #1396 (実装 PR、 squash merge commit f992194)
  • 本 entry 上段の 2026-05-18 判断 (#1309/#1310 sentinel-skip 機構導入) を depends on / refine 関係で継承

関連

  • #1309 (本判断の起票 issue)
  • #1310 (実装 PR)
  • #1065 spec(bootstrap): separate sentinel-based auto action from legacy user decision — 本判断は #1065 の sentinel mechanic を adapter section 単位から bootstrap walkthrough 全体に拡張する形
  • #1234 refactor: github-history-driven judgment criteria for boot-token reduction — boot-token reduction の rules audit 軸 (-340 lines / 21% 達成)。 本判断は walkthrough 経路 skip 軸で相補
  • li-plus-lightening-l1-gate-override — 軽量化判断 (2026-05-11)。 本判断は同系譜の継続だが L1 gate override は不要