Skip to content

spec(notifications): sort L5 Notifications Layer into a skeleton - #2190

Merged
liplus-lin-lay merged 8 commits into
mainfrom
spec-2188-l5-notifications-skeleton
Oct 16, 2026
Merged

liplus-lin-lay merged 8 commits into
mainfrom
spec-2188-l5-notifications-skeleton

Conversation

@liplus-lin-lay

@liplus-lin-lay liplus-lin-lay commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Closes #2188

変更

  • rules/notifications/notifications.md(layer: L5-notifications、常時ロード)を新設。受け取り方 = チャネル/ポーリングの二本立て、対象 = webhook と GitHub Notifications。
  • main-agent-procedures.md の Foreground webhook notification intake 節・Notifications API 節、operations.md の mark_processed 行を移設。
  • GitHub Notifications は GH_CLASSIC_TOKEN のみで動く、ポーリング側の受け皿とした。受け取り先に順番は付けず、その環境で使えるものを使う(issue 本文のマスター判断)。
  • 中継スキル(名前は維持)、毎ターンフック 3 本、hooks-settings.md、テスト 2 本、docs(4・5・6・L)の指す先を更新。

範囲外として残したもの

  • rules/model/layer-definition.md の L5 行(「rule/skill files を持たない」)は L1 のため本 PR では触れていない。

版種別の提案: patch(ガバナンス構造の移設、利用者観測可能な変化なし)。

🤖 Generated with Claude Code

https://claude.ai/code/session_011b47CVqVoCCdK1RQyBMNdb

— Claude Lin

L5 Notifications Layer の骨格として rules/notifications/notifications.md を新設した。
受け取り方はチャネル(イベント駆動)とポーリングの二本立て、受け取る対象は
webhook と GitHub Notifications(GH_CLASSIC_TOKEN、MCP 不要のポーリング側の受け皿)。
main-agent-procedures.md の Foreground webhook notification intake 節と
Notifications API 節、operations.md の mark_processed 行をここへ移し、
中継スキル・毎ターンフック・テスト・docs の指す先を直した。

Refs #2188

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011b47CVqVoCCdK1RQyBMNdb
@liplus-lin-lay

Copy link
Copy Markdown
Member Author

Adjudicate each finding below by checking its literal against the source at the revision its path:line is given at, and adopt or drop it on that. No count enters that judgment, and no axis is exempt from it: the fixed impression-literal axis is adjudicated the same way, on the flagged phrase against the removal test its own spec fixes (skills/evolution-impression-literal-detection/SKILL.md), and it fixes no threshold.

対象: PR #2190 @ 2dbf26e / issue #2188

Axis A — issue requirement

A-1. issue の対象ファイル列挙に無い adapter/claude/hooks-settings.md を変更している

  • issue spec(notifications): sort L5 Notifications Layer into a skeleton #2188 本文: 「## 対象ファイル(節名「Foreground webhook notification intake」を参照している所、grep で確認)」。列挙は rules/operations/main-agent-procedures.md、rules/notifications/、skills/operations-foreground-webhook-intake/SKILL.md、フック3本、テスト2本、docs 4・6・L・5、rules/operations/operations.md。adapter/claude/hooks-settings.md は含まれない。
  • diff 側: adapter/claude/hooks-settings.md:195((rules/operations/main-agent-procedures.md Foreground webhook notification intake) → (rules/notifications/notifications.md ...))。
  • 問題: 列挙集合の外への変更であり、rules/operations/main-agent-procedures.md Sub-issue rules の scope-exceed confirm の対象になりうる。PR 本文は「hooks-settings.md ... の指す先を更新」と記すが、issue 本文側の更新・確認の記録は読んだ範囲で見当たらない(issue コメント 0 件)。

A-2. 「Li+update.md」側の rules サブディレクトリ列挙が未更新(docs/6 とは非対称)

  • issue 本文: 「docs と実装は同じ PR で更新する」。
  • diff 側: docs/6.-Adapter.md は operations/ の後ろに notifications/ を追記したが、同じ列挙を持つ Li+update.md:218(including files under model/, evolution/, task/, operations/ subdirectories)は未変更。
  • 問題: 列挙は "including" で再帰ミラーなので動作は変わらないが、docs/6 だけ直して実装手順書側を直さないのは同一 PR 内の列挙の不一致。

A-3. issue が要求した「L5 受け皿を判断」のうち layer-definition の食い違いが残る(PR 本文で範囲外と明示済み)

  • rules/model/layer-definition.md:21: 「L5 Notifications Layer (declared; currently has no rule/skill files of its own. Webhook intake is implemented under L4 Operations namespace pending future split.)」。本 PR で rules/notifications/notifications.md(layer: L5-notifications)が入るため、この行は事実でなくなる。
  • 問題: L1 のため範囲外とした判断は PR 本文に記録されているが、現状 SHA では L1 の記述と L5 の実体が矛盾する。後続 issue の起票有無が PR からは確認できない。

以上のほか、issue 本文の必須事項(L5 に channel/polling の二本立て、対象は webhook と GitHub Notifications、GH_CLASSIC_TOKEN のみで動くポーリング側の受け皿、中継スキルの名前維持、フック3本・テスト2本・docs 4/5/6/L の更新、operations.md の mark_processed 行の移設)は diff が満たしていることを確認した(読んだもの: issue 本文全体、PR diff 全体、rules/notifications/notifications.md 全文)。

Axis B — rule violation

B-1. 新規 rule ファイルの H2 見出し直後の記述順 — 違反なし(確認事項のみ)

  • rules/model/liplus-coding-rule.md Source File Format: 「wrap each H1 and H2 with a kebab-case semantic tag ... tag before heading, blank line between」。rules/notifications/notifications.md:7-9,14-16,30-32,120-122 は準拠。

B-2. rules/notifications/notifications.md:124-125 「Read at the foreground check when source priority above reaches it, and whenever the Inbox is acted on directly.」と :134 の適用範囲が曖昧

  • rules/operations/main-agent-procedures.md Foreground webhook intake (旧 :own-operation arrival confirmation) の mark_processed 義務は webhook イベント向け。:134 は「read / done stand where mark_processed stands」と Inbox スレッドへ拡張するが、:26 は「Every consumed webhook event is marked with mark_processed」のみ。Inbox スレッドを consume した場合の義務(read/done を必須とするか)が :134 の「stand where」で読み手に推論を委ねている。rules/model/subtractive-structural-beauty.md Surfaces of freedom の Decision 面(「close options not load-bearing」)に照らすと、必須か任意かが閉じていない。

B-3. rules/notifications/notifications.md:127 — 「skip silently, as the local store does」

  • 参照先 :73 「if helper missing or state dir unresolved = skip silently」と整合。違反なし。ただし :45 の「3 = GitHub Notifications (below), when GH_CLASSIC_TOKEN is present」と :127 の「Absent -> this target is unavailable」は重複して同じ条件を2回述べている。重複は片方に寄せられる(subtractive-structural-beauty.md Core principles (A))。軽微。

上記以外、移設した節の本文は removed 側と added 側が行単位で同一であることを確認した(rules/operations/main-agent-procedures.md の removed 107 行と rules/notifications/notifications.md:30-118 の内容一致)。

Fixed axis — impression-literal detection

rules/notifications/notifications.md(新規、約 138 行)の追加文のうち、移設した節を除く新規文を除去テストにかけた。

  • :11 「Canonical for how events reach the main agent. Japanese specification: docs/5.-Notifications.md.」の "Japanese specification: ..." — 除いても挙動は変わらない(docs へのポインタで、行動を固定しない)。impression-literal 候補。
  • :20 「Use it where the host carries it.」 — 除去しても channel の選択条件は :18 「chosen by what the environment can run」で既に決まる。impression-literal 候補。
  • :24 「is the polling base for an environment that has nothing else」 — :45 の source priority 位置が挙動を決める。意味は重複。候補。
  • :127 「Pass it to gh api by reference to the variable, never as its value in the command string.」 — 行動を固定する(CLAUDE.md の token 非出力に対応)。load-bearing、clean。
  • 他の追加行(hook echo 文、docs の #2188 で L5 へ移設 注記、テスト docstring のパス差し替え)は挙動を固定する参照先の差し替えまたは履歴注記で、flag しない。

— Claude Lin (brake 1 evaluator)

…ings

受け取り先の優先順位を廃し「その環境で使えるものを使う」形へ改めた(#2188 本文の
マスター判断、2026-10-15 22:50)。brake 1 第1ラウンドの採択分として、Inbox スレッド
consume 時の read/done 義務の明示、Li+update.md の rules サブディレクトリ列挙への
notifications/ 追記、挙動を固定しない文言の除去を行った。

Refs #2188

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011b47CVqVoCCdK1RQyBMNdb
@liplus-lin-lay

Copy link
Copy Markdown
Member Author

brake 1 第1ラウンド 裁定(@ f45dfa4)

  • A-1 不採択: adapter/claude/hooks-settings.md:195 は移設した節を名指すポインタで、直さなければ存在しないパスを指す。移設に同期する参照の差し替えであり範囲の拡張ではない(issue の対象ファイル見出し自体が「節名を参照している所」を集合の定義にしており、grep 漏れの 1 件)。
  • A-2 採択: Li+update.md:217 の列挙に notifications/ を追記。
  • A-3 不採択(本 PR 内): rules/model/layer-definition.md は L1 で、変更は evolution-l1-update-gating 経由。issue の対象ファイルにも無い。矛盾は事実なので、後続 issue の起票を親へ報告する。
  • B-2 採択: read / done を「stand where」で委ねず、「Every consumed Inbox thread is marked read or done.」と必須で閉じた。
  • B-3 採択: 重複していた when GH_CLASSIC_TOKEN is present 側は、下記の順位廃止とあわせて消えた。条件は GitHub Notifications 節の 1 箇所だけ。
  • 固定軸 :11 / :20 / :24 採択: 3 句とも除去テストで挙動不変のため削除。

あわせて、issue 本文に追加されたマスター判断(受け取り先に順番を付けない、使えるものを使う)に従い、source priority の番号付けを順序なしの sources 列挙に改め、docs/5 と中継スキルの文言も揃えた。

— Claude Lin

@liplus-lin-lay

Copy link
Copy Markdown
Member Author

Adjudicate each finding below by checking its literal against the source at the revision its path:line is given at, and adopt or drop it on that. No count enters that judgment, and no axis is exempt from it: the fixed impression-literal axis is adjudicated the same way, on the flagged phrase against the removal test its own spec fixes (skills/evolution-impression-literal-detection/SKILL.md), and it fixes no threshold.

対象: PR #2190 @ f45dfa4 / issue #2188(第2ラウンド。第1ラウンドの A-1〜A-3・B-2・B-3・固定軸3句の既出分は再掲しない)

Axis A — issue requirement

指摘なし。読んだもの: issue #2188 本文全体(目的・範囲・前提・制約・対象ファイル)、PR 本文、PR diff 全体、rules/notifications/notifications.md 全文 @ f45dfa4。issue の「受け取り先に順番(優先順位)は付けない」は rules/notifications/notifications.md:42(sources (no order among them; use each one this environment can run):)で満たされ、二本立て(:18-20)、対象2つ(:22-24)、GH_CLASSIC_TOKEN のみで動くポーリング側の受け皿(:24, :127)、中継スキルの名前維持、フック3本・テスト2本・docs 4/5/6/L・Li+update.md の更新、mark_processed 行の移設(:26)が diff と一致した。

Axis B — rule violation

B-4. rules/notifications/notifications.md:134 が Inbox スレッドに適用できない手順を適用対象にしている

  • 引用: 「Foreground handling, the ownership test and the hold exit apply to Inbox threads as they apply to webhook events.」
  • 同ファイル :97 「1. head_branch = this session's working branch -> own.」、:101 「workflow_run on any head_branch -> read gh run view <id> --json displayTitle」、:104-105 「issue_comment / pull_request_review / issues / pull_request, sender = ...」。ownership test は webhook イベントの payload 項目(head_branch、event 種別、sender)を前提に書かれている。GET /notifications(:132)が返す thread には head_branch も event 種別も sender も無く(subject の type / url / reason のみ)、step 1・2・3 は Inbox スレッドに対して実行できない。結果 step 4(「nothing above settles it -> hold, and leave the event unprocessed」)に全件が落ち、:134 後段の「Every consumed Inbox thread is marked read or done.」と衝突する(hold すれば unprocessed、consume すれば mark、のどちらを取るか読み手が決められない)。
  • 規則: rules/model/subtractive-structural-beauty.md Core principles (A)(load-bearing でない記述は残さない)と rules/model/rule-policy.md 「Separate fact from assumption」。実行不能な手順を「apply」と宣言する行は、読み手に推論を委ねる自由度を増やす。Inbox 用の own / external 判定を別に書くか、:134 の「the ownership test and the hold exit」を外して foreground handling のみに絞る必要がある。

Fixed axis — impression-literal detection

  • rules/notifications/notifications.md:11 「Canonical for how events reach the main agent.」 — 除去しても、直後の :12 「Actor = the main agent on every section below.」と各節の Canonical.(:34, :124)で規則の挙動(誰が・いつ何をするか)は変わらない。範囲宣言のみで行動を固定しない。impression-literal 候補。第1ラウンドで削除された :11 の後半("Japanese specification: ...")の残り半分。

他の追加・変更行(移設した節の本文は removed 側と同一、hook の echo 文、中継スキルの description、Li+update.md:218 の notifications/ 追記、rules/operations/main-agent-procedures.md のポインタ差し替え)は参照先の差し替えまたは挙動を固定する文で、flag しない。

削除行の確認

  • rules/operations/operations.md の「mark_processed is mandatory for every consumed webhook event.」 — 現存 notifications.md:26 に置換あり。必要かつ移設済み。
  • rules/operations/main-agent-procedures.md の「source priority: 1 = ... 2 = ... 3 = none」 — issue 本文に追記されたマスター判断(順番なし)で :42-46 に置換。問題なし。
  • rules/operations/main-agent-procedures.md の Notifications API 節 — notifications.md:129-132 に同一内容で移設済み。「scope = notifications (classic PAT)」は :127 に存続。
  • docs/5.-Notifications.md の「rules/ 搭載判断は保留している」「CI polling」 — 前者は spec(notifications): sort L5 Notifications Layer into a skeleton #2188 で保留が解かれたため事実でなくなり削除は正当、後者は同段落の「polling」に置換済み。

— Claude Lin (brake 1 evaluator)

Inbox スレッドには webhook payload 前提の ownership test と hold exit が実行できないため、
適用範囲を foreground handling に絞った。挙動を固定しない冒頭の範囲宣言文を削除した。

Refs #2188

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011b47CVqVoCCdK1RQyBMNdb
@liplus-lin-lay

Copy link
Copy Markdown
Member Author

brake 1 第2ラウンド 裁定

  • B-4 採択: ownership test(head_branch・event 種別・sender 前提)は GET /notifications の thread に実行できず、全件が step 4 の hold に落ちて consume 時の read / done 義務と衝突する。Inbox への適用を「Foreground handling applies to Inbox threads as it applies to webhook events.」に絞り、ownership test と hold exit を外した。Inbox 用の own / external 判定は骨格の後の肉付け側に残す。
  • 固定軸 :11 採択: 「Canonical for how events reach the main agent.」は除去テストで挙動不変のため削除。

— Claude Lin

@liplus-lin-lay

Copy link
Copy Markdown
Member Author

Adjudicate each finding below by checking its literal against the source at the revision its path:line is given at, and adopt or drop it on that. No count enters that judgment, and no axis is exempt from it: the fixed impression-literal axis is adjudicated the same way, on the flagged phrase against the removal test its own spec fixes (skills/evolution-impression-literal-detection/SKILL.md), and it fixes no threshold.

対象: PR #2190 @ fd32649 / issue #2188(第3ラウンド。第1・2ラウンドの既出分と、作者が不採択とした A-1・A-3 は再掲しない)

Axis A — issue requirement

指摘なし。issue #2188 本文(目的・範囲・前提・制約・対象ファイル)、PR 本文、PR diff 全体、rules/notifications/notifications.md 全文を @fd32649 で読み、二本立て(:17-19)、対象2つ(:21-23)、順序なしの受け取り先(:41)、GH_CLASSIC_TOKEN のみで動く受け皿(:23, :126)、中継スキル名の維持、フック3本・テスト2本・docs 4/5/6/L の更新、mark_processed 行の移設(:25)が issue 本文と一致した。grep で旧パス参照(main-agent-procedures.md の Foreground webhook notification intake / Notifications API)の残りを確認し、現行文面に残るのは docs/4.-Operations.md:218,237,239 等の履歴記述のみだった。

Axis B — rule violation

B-5. rules/notifications/notifications.md:18 と :44/:80 が衝突している

  • 引用(:18): 「channel (event-driven) = LI_PLUS_WEBHOOK_DELIVERY=channel. Events are pushed; nothing is polled.」
  • 引用(:44): 「- GitHub Notifications (below)」(:41 の sources 列挙の一項)、:80: 「each user turn start = inspect once before main reply」、:133: 「Foreground handling applies to Inbox threads as it applies to webhook events.」
  • 問題: GET /notifications(:131)は poll であり、GH_CLASSIC_TOKEN があれば channel モードでも sources の一つとして毎ターン inspect 対象になる。:18 の「nothing is polled」と両立せず、channel モードで Inbox を引くべきか否かを読み手が決められない。:19 は GitHub Notifications を polling 側に分類しているので、:41 の列挙を「channel でないときの polling 受け皿」に絞るか、:18 の「nothing is polled」を webhook 対象に限定する必要がある。規則: rules/model/subtractive-structural-beauty.md Surfaces of freedom の Decision 面(「close options not load-bearing」)、rules/model/rule-policy.md「Separate fact from assumption」。

Fixed axis — impression-literal detection

  • rules/notifications/notifications.md:25 「Every consumed webhook event is marked with mark_processed, whatever the delivery shape.」の「, whatever the delivery shape」 — 除いても、文は「consumed な全 event に mark_processed」と言い切っており、挙動は変わらない。範囲を強調するだけの句で impression-literal 候補。

他の追加・変更行(:23 の「no MCP」は GH_CLASSIC_TOKEN のみで足りる根拠を固定する、:126 のトークン変数参照、hook の echo 文、中継スキル、Li+update.md、docs/テストのパス差し替え)は挙動を固定する、または参照先の差し替えのため flag しない。

削除行の確認

rules/operations/operations.md の mark_processed 行、main-agent-procedures.md の Notifications API 節と Foreground intake 節、docs/5.-Notifications.md の「意図的に不在」「保留」記述、docs/6.-Adapter.md の「L5 は ... 予約席」記述を確認した。いずれも notifications.md または #2188 の記述に置換済みで、現行 SHA でも不要。指摘なし。

— Claude Lin (brake 1 evaluator)

channel の「nothing is polled」を webhook 対象に限定し、GitHub Notifications の
ポーリングとの衝突を解いた。挙動を固定しない強調句を削除した。

Refs #2188

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011b47CVqVoCCdK1RQyBMNdb
@liplus-lin-lay

Copy link
Copy Markdown
Member Author

brake 1 第3ラウンド 裁定

  • B-5 採択: :18 を「Webhook events are pushed; the webhook target is not polled.」に限定した。GitHub Notifications には push の形が無く、:19 どおり常にポーリング側の対象で、issue の「使えるものを使う」により channel 環境でも GH_CLASSIC_TOKEN があれば使う。:41 の列挙は絞らない(絞ると順番なしの判断に反する)。
  • 固定軸 :25 採択: 「, whatever the delivery shape」を削除。

— Claude Lin

@liplus-lin-lay

Copy link
Copy Markdown
Member Author

Adjudicate each finding below by checking its literal against the source at the revision its path:line is given at, and adopt or drop it on that. No count enters that judgment, and no axis is exempt from it: the fixed impression-literal axis is adjudicated the same way, on the flagged phrase against the removal test its own spec fixes (skills/evolution-impression-literal-detection/SKILL.md), and it fixes no threshold.

対象: PR #2190 @ eaca311 / issue #2188(第4ラウンド。第1〜3ラウンドの既出分と、作者が不採択とした A-1・A-3 は再掲しない)

Axis A — issue requirement

A-4. docs/6.-Adapter.md:314-317 に順序付きの「通知源の優先順位」が残り、issue の「順番は付けない」と食い違う

  • issue spec(notifications): sort L5 Notifications Layer into a skeleton #2188 本文: 「受け取り先に順番(優先順位)は付けない。その環境で使えるものを使う」「docs と実装は同じ PR で更新する」。対象ファイルに docs/6.-Adapter.md を含む。
  • diff 側: 第2ラウンドの裁定は「source priority の番号付けを順序なしの sources 列挙に改め、docs/5 と中継スキルの文言も揃えた」と述べるが、docs/6.-Adapter.md は 2 箇所(rules 列挙・前景取り込み手続きの正本ポインタ)しか変わっておらず、docs/6.-Adapter.md:314 「通知源の優先順位:」 / :315 「1. mcp__github-webhook-mcp」 / :316 「2. ローカル webhook ストア(…)」 / :317 「3. 利用不可 → 黙ってスキップ」が、削除された source priority: 1 = … 2 = … 3 = none の旧形のまま現 SHA に残る。GitHub Notifications も列挙されていない。
  • 問題: 正本(rules/notifications/notifications.md:41-45 「sources (no order among them; …)」)と同一内容を述べる docs が、順序ありかつ GitHub Notifications 欠落の旧版のまま。docs/5 は更新済みなので、同一 PR 内での不整合。

Axis B — rule violation

B-6. rules/notifications/notifications.md:126 のトークンの渡し方が実行できる形に閉じていない

  • 引用: 「Token = the GH_CLASSIC_TOKEN environment variable (classic PAT, scope = notifications). Pass it to gh api by reference to the variable, never as its value in the command string.」
  • 問題: gh が自動で読む環境変数は GH_TOKEN / GITHUB_TOKEN であり、GH_CLASSIC_TOKEN という名前は gh からは読まれない。「variable への参照で gh api に渡す」手段(GH_TOKEN="$GH_CLASSIC_TOKEN" gh api … か -H "Authorization: token $GH_CLASSIC_TOKEN" か)が本文に無く、一方 adapter/claude/CLAUDE.md Rules は「Do not export GH_TOKEN in Bash commands」と定める。読み手はどの形を取ればよいか決められない(rules/model/subtractive-structural-beauty.md Surfaces of freedom の Decision 面、rules/model/rule-policy.md「Separate fact from assumption」)。「GH_CLASSIC_TOKEN のみで動く」(:23、issue 本文)という事実を裏づける呼び出し形が rule 側に無い。
  • 併せて、:126 「Absent -> this target is unavailable; skip silently」の「Absent」が、変数が未設定の場合か空の場合か、無効トークン(401)の場合かを閉じていない。

B-7. docs/L.-Hop-Count-Instrument.md:86 が現存しない義務の所在を現在形で述べる

  • 引用: 「非計数 — rules/operations/operations.md(mark_processed の義務): 鎖のどこにも明示ポインタがない。」
  • 問題: 本 PR は rules/operations/operations.md の「mark_processed is mandatory for every consumed webhook event.」を削除して notifications.md:25 へ移した。L の同行は baseline 時点の記述として読めるが、同ファイルの他の移設箇所(docs/L.-Hop-Count-Instrument.md 追記)が「spec(notifications): sort L5 Notifications Layer into a skeleton #2188 で…移った」と注記しているのに対し、この行だけ注記が無く、現 SHA で operations.md を引いても義務は存在しない(rules/operations/operations.md の該当行は diff で削除済み)。rules/operations/operations.md Operations Rules「Docs update must be in same PR as implementation」。軽微。

Fixed axis — impression-literal detection

  • rules/notifications/notifications.md:34 「Webhook target of Delivery shapes above.」 — 除いても :22(「webhook events = Foreground webhook notification intake below.」)が同じ対応を既に固定しており、節の挙動(何を・いつ・誰が)は変わらない。impression-literal 候補。
  • rules/notifications/notifications.md:126 「, as the local store does」 — 除いても「skip silently」が行動を固定し、挙動は変わらない。参照先 :72 の再提示のみ。impression-literal 候補。

他の追加・変更行(:18 の「the webhook target is not polled」、:23 の「no MCP」、:25、:133、hook の echo 文、中継スキル、テストの docstring)は挙動を固定する、または参照先の差し替えのため flag しない。

削除行の確認

第3ラウンド以降に増えた削除(rules/notifications/notifications.md の「, whatever the delivery shape」と :18 の旧表現)以外は既に確認済みの範囲。docs/6.-Adapter.md の旧 1. … 2. … 3. 利用不可 は削除されておらず(上記 A-4)、他に「現在も真で、かつ必要」な行の置換なし削除は見つからなかった。

— Claude Lin (brake 1 evaluator)

docs/6 の通知源を順番なしの列挙に改め GitHub Notifications を加えた。
GH_CLASSIC_TOKEN の渡し方を Authorization ヘッダの変数参照に閉じ、使えない条件
(未設定・空・401)を明示した。docs/L の mark_processed 所在に移設注記を加え、
挙動を固定しない句を削除した。

Refs #2188

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011b47CVqVoCCdK1RQyBMNdb
@liplus-lin-lay

Copy link
Copy Markdown
Member Author

brake 1 第4ラウンド 裁定

  • A-4 採択: docs/6.-Adapter.md の「通知源の優先順位」を順番なしの列挙に改め、GitHub Notifications(GH_CLASSIC_TOKEN がある場合)を加えた。第2ラウンドで docs/6 を揃え漏らしていた。
  • B-6 採択: gh は GH_CLASSIC_TOKEN を自動では読まない。adapter/claude/CLAUDE.md の「Do not export GH_TOKEN」に触れない形として、gh api -H "Authorization: token $GH_CLASSIC_TOKEN" <endpoint>(変数参照のヘッダ)に閉じた。使えない条件も「未設定・空・401」と閉じた。
  • B-7 採択: docs/L.-Hop-Count-Instrument.md:86 に baseline 時点の所在である旨と spec(notifications): sort L5 Notifications Layer into a skeleton #2188 での移設先を注記した。
  • 固定軸 :34・:126 採択: 「Webhook target of Delivery shapes above.」と「, as the local store does」を削除。

— Claude Lin

@liplus-lin-lay

Copy link
Copy Markdown
Member Author

Adjudicate each finding below by checking its literal against the source at the revision its path:line is given at, and adopt or drop it on that. No count enters that judgment, and no axis is exempt from it: the fixed impression-literal axis is adjudicated the same way, on the flagged phrase against the removal test its own spec fixes (skills/evolution-impression-literal-detection/SKILL.md), and it fixes no threshold.

対象: PR #2190 @ 4ce3166 / issue #2188(第5ラウンド。第1〜4ラウンドの既出分と、作者が不採択とした A-1・A-3 は再掲しない)

Axis A — issue requirement

A-5. PR 本文が、issue の「順番は付けない」判断と現 diff に反する旧記述を残している

  • issue spec(notifications): sort L5 Notifications Layer into a skeleton #2188 本文: 「受け取り先に順番(優先順位)は付けない。その環境で使えるものを使う」。
  • PR 本文(gh pr view 2190 --json body、「## 変更」3 行目): 「GitHub Notifications は GH_CLASSIC_TOKEN のみで動く、ポーリング側の受け皿とし、source priority の 3 番目(none の手前)に置いた。」
  • diff 側: 第1ラウンドの裁定で source priority は廃止され、rules/notifications/notifications.md:40(sources (no order among them; use each one this environment can run):)になっている。PR 本文だけが番号付きの旧形を述べており、現 SHA の diff と issue 本文の双方に一致しない。squash merge で PR 本文が履歴に残るため、実体と食い違う記述が持ち越される。本文の該当行を順番なしの記述へ直す必要がある。

それ以外は、issue 本文の必須事項と diff が一致していることを確認した(読んだもの: issue 本文全体、PR 本文、PR diff 全体、rules/notifications/notifications.md 全文 @4ce3166、旧パス参照の grep)。

Axis B — rule violation

B-8. rules/notifications/notifications.md:125 のトークンの渡し方が POSIX シェル構文のみで、同じ always-on ルールを読む PowerShell 側の adapter で成立しない

  • 引用: 「gh api -H "Authorization: token $GH_CLASSIC_TOKEN" <endpoint>, never as its value in the command string.」
  • 問題: 本ルールは alwaysApply: true(:3)で Claude と Codex の両 adapter に載り、Codex 側には PowerShell の hook(adapter/codex/hooks/on-user-prompt.ps1)がある。PowerShell では環境変数は $env:GH_CLASSIC_TOKEN であり、$GH_CLASSIC_TOKEN は未定義の通常変数として空に展開される。結果ヘッダは Authorization: token となり 401 になるが、同行は「a call answered 401 -> this target is unavailable; skip silently」と閉じているため、構文の取り違えが「トークン無効」として黙って握りつぶされ、検出できない。規則: rules/model/rule-policy.md「Separate fact from assumption」(構文が通る環境を確認せずに一つの形を断定している)。シェル別の形を並記するか、シェルに依らない参照方法(例: 変数名のみを述べ、展開はシェルに委ねると明示)に閉じる必要がある。

Fixed axis — impression-literal detection

指摘なし。掃いた対象: rules/notifications/notifications.md(新規)の移設分を除く追加文と、rules/operations/main-agent-procedures.md:19 / skills/operations-foreground-webhook-intake/SKILL.md の変更行、hook echo 文 3 行、Li+update.md:218 の追記、計およそ 25 行。除去すると挙動が変わる句のみで、第1〜4ラウンドで採択済みの句の再出現もなかった。

削除行の確認

rules/operations/main-agent-procedures.md の Foreground intake 節・Notifications API 節、rules/operations/operations.md の mark_processed 行は rules/notifications/notifications.md に置換または同一内容で移設済み。docs/5.-Notifications.md の「意図的に不在」「保留」記述は #2188 で事実でなくなり削除は正当。docs/6.-Adapter.md の旧優先順位 3 行は順番なしの列挙に置換済み。現 SHA でも必要かつ真のまま置換なしに消えた行は見つからなかった。

— Claude Lin (brake 1 evaluator)

GH_CLASSIC_TOKEN のヘッダ参照を POSIX sh / Git Bash と PowerShell で並記し、
Git Bash が先頭スラッシュの endpoint をパスへ書き換える件(親の実機プローブで確認)
に合わせ、endpoint を先頭スラッシュなしで書くと定めた。

Refs #2188

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011b47CVqVoCCdK1RQyBMNdb
@liplus-lin-lay

Copy link
Copy Markdown
Member Author

brake 1 第5ラウンド 裁定

  • A-5 採択: PR 本文の「source priority の 3 番目(none の手前)に置いた」を、順番なし・使えるものを使う記述へ直した。
  • B-8 採択: ヘッダの変数参照を POSIX sh / Git Bash($GH_CLASSIC_TOKEN)と PowerShell($env:GH_CLASSIC_TOKEN)で並記した。あわせて、親が本ホストの Git Bash で実行したプローブで、先頭スラッシュ付きの endpoint(/notifications)がファイルパスへ書き換えられて失敗し、スラッシュなし(notifications)なら両形とも成功することが確認されたため、endpoint を先頭スラッシュなしで書くと定めた。PowerShell 形は未プローブ。

— Claude Lin

@liplus-lin-lay

Copy link
Copy Markdown
Member Author

Adjudicate each finding below by checking its literal against the source at the revision its path:line is given at, and adopt or drop it on that. No count enters that judgment, and no axis is exempt from it: the fixed impression-literal axis is adjudicated the same way, on the flagged phrase against the removal test its own spec fixes (skills/evolution-impression-literal-detection/SKILL.md), and it fixes no threshold.

対象: PR #2190 @ d91a888 / issue #2188(第6ラウンド。第1〜5ラウンドの既出分と、作者が不採択とした A-1・A-3 は再掲しない)

Axis A — issue requirement

指摘なし。読んだもの: issue #2188 本文全体、PR 本文、PR diff 全体、rules/notifications/notifications.md 全文 @d91a888。順番なし(:40)、二本立て(:17-19)、対象2つ(:21-23)、GH_CLASSIC_TOKEN のみ(:23, :125)、mark_processed の移設(:25)、中継スキル名の維持、フック3本・テスト2本・docs 4/5/6/L の更新が issue 本文と一致した。

Axis B — rule violation

B-9. rules/notifications/notifications.md:130-133 のエンドポイント表が、同ファイル :128 の規則に反する先頭スラッシュ付きで書かれている

  • 引用(:128): 「Write <endpoint> without the leading slash (notifications, not /notifications)」
  • 引用(:130-133): 「PATCH /notifications/threads/{id}」「PUT /notifications {"read":true}」「DELETE /notifications/threads/{id}」「GET /notifications?all=false」
  • 問題: 読み手がこの表のエンドポイントを :126-127 のコマンド形の <endpoint> にそのまま入れると、:128 が禁じる形になる。同一ファイル内で、書き方の規則と、その規則の適用対象である一覧が食い違い、どちらに従うか読み手が決められない。docs/5.-Notifications.md(diff 追加行)の「gh api /notifications を呼べ」も同じ先頭スラッシュ形。規則: rules/model/rule-policy.md「Separate fact from assumption」/ rules/model/subtractive-structural-beauty.md Surfaces of freedom の Decision 面(「close options not load-bearing」)。表を <endpoint> 形(スラッシュなし)に揃えるか、表は HTTP パス表記であり <endpoint> に入れる際にスラッシュを外すと明記する必要がある。

Fixed axis — impression-literal detection

  • rules/notifications/notifications.md:128 「: Git Bash rewrites a leading-slash argument into a filesystem path」 — 除去しても「Write <endpoint> without the leading slash」という動作指示は残り、読み手の挙動は変わらない。理由の説明であり、reasoning(rules/model/liplus-coding-rule.md Body States Behavior)。加えて、これは外部ツールの挙動という時間で変わりうる事実の断定で、リポジトリ内に裏づけ(出典・probe 記録)がない(裏づけは PR スレッド上の親の口頭報告のみ)。
  • rules/notifications/notifications.md:125 「gh does not read this variable itself: 」 — 除去しても「pass it as a header that references the variable」という指示が残り、挙動は変わらない。同じく reasoning。

削除行の確認

削除行(main-agent-procedures.md の Foreground intake 節・Notifications API 節、operations.md の mark_processed 行、hook 3 本の旧ポインタ、docs の旧記述)は、rules/notifications/notifications.md に同内容が移設または更新されており、置換なしの削除で現 SHA でも真かつ必要なものは見当たらなかった。

— Claude Lin (brake 1 evaluator)

エンドポイント表と docs/5 の呼び出し例を先頭スラッシュなしの形に揃え、
挙動を固定しない理由説明の句を本文から除いた。

Refs #2188

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011b47CVqVoCCdK1RQyBMNdb
@liplus-lin-lay

Copy link
Copy Markdown
Member Author

brake 1 第6ラウンド 裁定(@ 594220a)

  • B-9 採択: エンドポイント表を先頭スラッシュなし(notifications/threads/{id} 等)に揃え、:128 を「Write <endpoint> without the leading slash, as in the table below.」とした。docs/5.-Notifications.md の gh api /notifications も gh api notifications に直した。
  • 固定軸 :128 採択: Git Bash の書き換えという理由の句を本文から除いた(理由は第5ラウンド裁定と本スレッドの親プローブ記録が持つ)。
  • 固定軸 :125 採択: 「gh does not read this variable itself:」を除いた。

なお親が本ホストで PowerShell 形($env:GH_CLASSIC_TOKEN、スラッシュなし endpoint)もプローブし成功を確認しているため、第5ラウンドの「PowerShell 形は未プローブ」は解消。

— Claude Lin

@liplus-lin-lay

Copy link
Copy Markdown
Member Author

Adjudicate each finding below by checking its literal against the source at the revision its path:line is given at, and adopt or drop it on that. No count enters that judgment, and no axis is exempt from it: the fixed impression-literal axis is adjudicated the same way, on the flagged phrase against the removal test its own spec fixes (skills/evolution-impression-literal-detection/SKILL.md), and it fixes no threshold.

対象: PR #2190 @ 594220a / issue #2188(第7ラウンド。第1〜6ラウンドの既出分と、作者が不採択とした A-1・A-3 は再掲しない)

Axis A — issue requirement

指摘なし。読んだもの: issue #2188 本文全体、PR 本文、PR diff 全体、rules/notifications/notifications.md 全文 @594220a。二本立て(:17-19)、対象2つ(:21-23)、順番なし(:40)、GH_CLASSIC_TOKEN のみ(:23, :125)、mark_processed の移設(:25)、中継スキル名の維持、フック3本・テスト2本・docs 4/5/6/L の更新が issue 本文と一致した。

Axis B — rule violation

B-10. docs/4.-Operations.md の「通知 API」節の表が、第6ラウンドで確定した「先頭スラッシュなし」と食い違ったまま、正本を指す文の直下に残っている

  • 引用(diff の同節の変更行): 「(→ 正本は rules/notifications/notifications.md の ## GitHub Notifications(spec(notifications): sort L5 Notifications Layer into a skeleton #2188 で ... から移設)。」
  • 直下の未変更行(diff 文脈行): 「GET /notifications?all=false -> 200 inbox 確認」(同表の他のエンドポイントも先頭スラッシュ付きのはず。表本体は diff の文脈行で、全行は docs/4.-Operations.md で確認のこと)
  • 引用(規則、rules/notifications/notifications.md:128): 「Write <endpoint> without the leading slash, as in the table below.」
  • 問題: 変更行が「正本はこちら」と指した直下で、docs 側の表は正本が禁じた形のまま。第6ラウンドで docs/5 の gh api /notifications は直されたが、同じ移設で正本を指し直した docs/4 の表は直っていない。同一 PR 内で docs と実装が食い違う(rules/operations/operations.md「Docs update must be in same PR as implementation」)。表が HTTP パス表記であると断るか、スラッシュを外す必要がある。

Fixed axis — impression-literal detection

指摘なし。追加・修正された Li+ source 行 約152行(PR 全体の + 行。うち規則本文は rules/notifications/notifications.md 139行)を掃引した。第6ラウンドで除かれた :125・:128 の理由句は現 SHA に残っていない。

削除行の確認

削除行は rules/notifications/notifications.md に同内容が移設・更新されており、置換なしで消えた行のうち現 SHA でも真かつ必要なものは見当たらなかった。

— Claude Lin (brake 1 evaluator)

…slash

docs/4 の通知 API 表を正本 rules/notifications/notifications.md と同じ
先頭スラッシュなしの形に揃えた(brake 1 第7ラウンド B-10)。

Refs #2188

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011b47CVqVoCCdK1RQyBMNdb
@liplus-lin-lay

Copy link
Copy Markdown
Member Author

brake 1 第7ラウンド 裁定(@ 1d4e7eb)

  • B-10 採択: docs/4.-Operations.md:1086-1089 の通知 API 表 4 行を、第6ラウンドで確定した正本(rules/notifications/notifications.md)の表と同じ先頭スラッシュなしの形に揃えた。正本を指す文の直下で docs が正本の禁じる形のまま残るのは同一 PR 内の docs と実装の食い違いであり、直す以外の選択肢がない。

— Claude Lin

@liplus-lin-lay liplus-lin-lay left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

自己レビュー(#2188)

受け入れ条件: 満たしています。

  • L5 の骨組み(チャネル/ポーリング、順番なしの sources、webhook 受け取り、GitHub Notifications 管理)を rules/notifications/notifications.md に新設し、main-agent-procedures.md の webhook 受け取り節・Notifications API 節と operations.md の mark_processed 行を移しました。
  • 中継スキル名は維持し、指す先だけ直しました。アダプタの byte-frozen 部分は触っていません。
  • 毎ターンのフック 3 本、テスト 2 本、docs 4/5/6/L、Li+update.md の参照を更新しました。旧節名で main-agent-procedures.md を指す残りは 0 件、ルールと docs の表に先頭スラッシュ付きのエンドポイントは残っていません(grep で確認)。

brake 1: 7 回まわしました。最終回の指摘は B-10(docs/4 の表のスラッシュ)1 件のみです。B-9 の再発扱いとしてマスターに上げ、「直して終える」の判断で修正済み(head 1d4e7eb、CI 緑)。採否は各回のコメントのとおりです。

範囲外の変更: adapter/claude/hooks-settings.md の参照 1 行。マスターの了承を得て残し、issue の対象ファイルに追記しました。

版の種類: patch。ルールと docs の置き場所の整理で、利用者や動作から見える変化はありません。semi_auto の patch として直接マージします。

見送り: L1 layer-definition.md の L5 行は #2191 で扱います(起票済み)。ワークスペース側の見送りはありません。

実装の委任は effort low で足りました。

— Claude Lin

@liplus-lin-lay
liplus-lin-lay merged commit 7e75166 into main Oct 16, 2026
2 checks passed
@liplus-lin-lay
liplus-lin-lay deleted the spec-2188-l5-notifications-skeleton branch October 16, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spec(notifications): sort L5 Notifications Layer into a skeleton

1 participant