Repository navigation
並列の計画の同時実行を稼働中のレーンの数とテストのスロットの 2 層にする(#3989) - #4001
Merged
Merged
Conversation
- 計画の max_lanes・max_plans、レーンの plans、検査 I20・I2、ndf lanes limits、ndf lanes set --plans を消す。記録に残る値は読み捨て、設定のファイルは名前を名指して断る - 起動の許可は稼働中のレーンと動いているラッパー(役に依らない・登録簿に無いものを含む)を 1 本ずつ数える。マシンの計画の索引でラッパーの止まった計画も数える - 上限の値は ndf.contracts.named_cap が判定のたびにマシンの設定 → NDF_RELAY_MAX_NAMED → relay.max-named の順で読み、ndf relay cap で書く - リレーハブは要求に載った頼む側の値で判定し、置き換えの起動(spawn --replace --seat)は止める前に判定する。続きの起動(--seated)は席で本数を免除する - ndf lanes status に待ちの理由(machine-lanes・lock・observe)と metrics.machine を出す - 手順書と並行開発の説明を 2 つの層にそろえる Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KYHP7xtTft8kizHeodLjzC
…ne.RULE をそれに向ける (I-006) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
振る舞いは変えない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
admitted と machine_waits が別々に書いていた「admit で収まるか見て、収まらなければ 一覧を読めたかで RULE か OBSERVE の waiting を返す」判定を machine.over_cap にする。 振る舞いは変えない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…of から使う (I-004) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
index_plan と unindex_plan で重複していた計画 ID からのファイル名の組み立てを 1 つにした。振る舞いは変えない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
restart の上限の断りの項目・止まった対象を数え直すとき・回数の上限で断るときの項目、 置き換えで対象が動いていないときの本数を固定する。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_over_cap と restart が個別に書いていた「running から対象を 1 引く」計算を、 hub_decide の判定と同じ関数で行う。振る舞いは変えない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bool の分岐を int の条件へ畳む。bool は str でもないため末尾の raise に届き、振る舞いは変わらない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(I-013) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_preflight と _launch で同じ式を書いていたのを 1 つの関数にする。振る舞いは変えない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
起動の排他を取れないときの早期リターンへの書き換えの前に、今の振る舞いを固定する。 - 起動できるレーンはどれも lock の待ちになり、レーンごとには数えない - 一覧を読めなくても lock の待ち(observe にしない) - 上限を読めなければ排他より先に error を返し、待ちを載せない - 排他を取れればレーンごとに自分を除いて数える Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
I-008 の整理(パーサーを 1 回だけ作り、--seat・--seated・--replace の検査を理由の文を返す関数へまとめる)の前に、 断る組み合わせごとの理由の文・通す組み合わせ・main の終了コードを固定する。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
自分の計画で辞書を作り始め、ほかの計画を 1 件ずつ setdefault で足す。 先勝ちの順序と結果は変わらない(I-014)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…やめる (I-017) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…back へ切り出す(I-016) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KYHP7xtTft8kizHeodLjzC
cross-review の指摘(PR #4001)への対応。 - r1-1: 席を書く前のバージョンが書いた登録簿の行(seat のキーが無い)は、役と計画が要求と同じなら 続きの起動を通して席を書く。今のバージョンは席を持たない起動でも seat: null を書く - r1-2: 置き換えの起動を新しい要求の種別 replace にし、旧版のハブが「知らないリクエスト」で断ったら 頼む側が同じ要求を書き直して、対応版のハブが処理するまで待つ - r1-4: 起動の許可が数えた、ラッパーの止まった稼働中のレーンの名前を --held でハブへ渡し、ハブの 最終判定でも数える - r1-5: machine_plans が計画のステートマシンの ID を解いた段階で既読を判定し、同じ計画を 1 回だけ読む - r1-6: relay ls は錠を持つ名前だけを集め、ラッパーの状態のファイルを行ごとに 1 回だけ読む - r1-7: named_cap の置き場を実装(contracts/named_cap.py・tests/contracts/test_named_cap.py)に そろえ、設計書・詳細設計書・実装プランを直す Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
旧版のハブは結果を書いてから要求のファイルを消すので、同じパスへ書き直すと その削除が再送分を消し、置き換えの起動が期限切れになっていた。再送のたびに 要求 ID を変え、待つ結果と期限切れで消す要求のパスも切り替える。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
一覧で動いていたラッパーを除いていたので、許可の後にラッパーだけが止まった 稼働中のレーンをハブが数え落とし、手の起動と合わせて上限を超え得た。ハブは held と自分が見る動いているラッパーの和集合を数える。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
詳細設計は seat のキーの無い行を役と計画の一致で通して席を書くと定めていたが、 決定 7 は席の一致だけを求めていた。決定 7 の条件で作ると、更新の前から実行中の 行を更新の後に続けられない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
takemi-ohama
commented
Nov 21, 2026
takemi-ohama
commented
Nov 21, 2026
takemi-ohama
commented
Nov 21, 2026
takemi-ohama
commented
Nov 21, 2026
takemi-ohama
commented
Nov 21, 2026
takemi-ohama
commented
Nov 21, 2026
takemi-ohama
commented
Nov 21, 2026
takemi-ohama
commented
Nov 21, 2026
takemi-ohama
commented
Nov 21, 2026
takemi-ohama
commented
Nov 21, 2026
Contributor
Author
cross-review の記録(PR #4001)終わり方: 収束した。ラウンド 3・指摘 11(直した 9・見送った 1・未解決 0・軽い 1) ラウンドと修正
指摘
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KYHP7xtTft8kizHeodLjzC
14 of 31 tasks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KYHP7xtTft8kizHeodLjzC
Contributor
Author
cross-refactoring の完了報告(PR #4001)結果: 完了 予算: 60 分 項目
見送り(理由別)
工程別の所要
成立の判定
フレーキーなテストの直し
最終ゲート
|
takemi-ohama
marked this pull request as ready for review
November 21, 2026 14:12
- 確定仕様を 2 層の同時実行の制御(マシン全体の稼働中のレーンの数・テストのスロット)の現行の姿で書き直す(受け入れ条件 12 の確定仕様の分) - 起動の許可の数え方・計画の索引・リレーハブの置き換えの起動と続きの起動・上限の値の読む順・ndf relay cap・ndf lanes status の待ちを書く - 設計からのずれ(上限の読み手を ndf/contracts/named_cap.py に置いた・launch.replace を別の関数にした)を構成要素の表へ反映する - issues/ の要求・設計・詳細設計・計画の 4 本を消し、用語集の 3 語の出所を確定仕様へ移す - 用語集: 廃止した仕組みの語(マシンのプランの本数・プランの本数の上限)を外し、起動の待ち・起動の排他・レーン数の上限・マシンの設定の意味を今の仕組みに合わせる - ndf-next-closed-children-subcommands.md の relay.py cap の対応と from-issue:3569-relay-cap の行を ndf relay cap に合わせる Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KYHP7xtTft8kizHeodLjzC
takemi-ohama
added a commit
that referenced
this pull request
Nov 22, 2026
mcp-serena・playwright-kit の節は前のタグ以来の全 PR の題名を並べていたので、2 つを変えた #3961 の 1 行にする。 ndf の節は #4001(本文に節が無いため「変えたこと」から)と #3961 の利用者向けの変化、両者の移行の手順を載せる。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KYHP7xPKEHnLPsZtLawhvj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
#3989 の実装。並列の計画の同時実行の制御を、マシン全体の稼働中のレーンの数(セッションの数)とテストのスロット(重い処理)の 2 層にし、計画とレーンの上限の値(
max_lanes・max_plans・レーンのplans)と検査 I20・I2、ndf lanes limits、ndf lanes set --plansを消した。変えたこと
max_lanes・max_plans・plans、I20・I2、ndf lanes limits、ndf lanes set --plansplan.json・lane.jsonは名前を名指して断る。記録に残る値は読み捨てるmachine.admitted)plansの合計(重み)と conductor の役のラッパー<状態の保存先>/parallel/plans/)でラッパーが止まった計画も数えるNDF_RELAY_MAX_NAMED→limits.json。プロセスごとに読む時点が違うndf.contracts.named_cap.readが判定のたびにマシンの設定 →NDF_RELAY_MAX_NAMED→relay.max-namedの順で読む。1 以上の整数だけを受ける。ndf relay cap [--named N | --clear]で書くmax_named(要求を処理したプロセスの環境)itemsに{"refusal": "max-named", "running", "cap"}spawnndf relay spawn --replace --seat <席>。ハブが止める前に対象を除いた本数で判定し、断れば元のラッパーは動いたまま。耐久ワークフローは待ちに戻す/goalの入れ直し)spawn(上限で断られ得た)--replace --seat <席> --seated。登録簿の席が同じなら本数を判定しないndf relay lsregistered: falseで載せるndf lanes statusmachine_wait(一覧を読めたときだけ)machine-lanes・lock・observe)と数・上限、集計のmetrics.machinendf lanes limitsparallel-plan.md・parallel.md・parallel-checks.md・parallel-cross-repo.md・parallel-work.md・docs/ndf-parallel-model.md)テストのスロット(
plugins/ndf/src/ndf/testing/)は変えていない。確定仕様docs/specifications/ndf-parallel-machine-plan-limit.mdは確定仕様化の工程で直す(課題の「含まない」)。設計からずらしたこと
ndf/core/named_cap.pyでなくndf/contracts/named_cap.pyに置いた。coreの下に新しいモジュールを足すと子の表(children.json)に持ち主が要り、表は設計 PR を先に通して直す決まりのため。contractsは既存の子 D1 が持ち、依存の向き(ndf.contractsだけに依存)も設計のとおりであるlaunch.spawnの引数を増やさずlaunch.replace(..., seat)に分けた(引数の多い関数の検査 PLR0913)リファクタリングとレビュー
ndf refactor run(codex・kiro): 項目 17 件をすべて採り、最終ゲートを通った。計画のコメントは GitHub の二次的なレート制限で書けなかった(コメントで足す)ndf cross-review run(codex・kiro): 3 ラウンドで収束。指摘 11 件(直した 9・見送った 1・軽い指摘 1)。記録は 並列の計画の同時実行を稼働中のレーンの数とテストのスロットの 2 層にする(#3989) #4001 (comment)移行の手順(マージの後、手元で 1 回)
手元の計画の設定から 3 つの値を消してから
ndf lanes startを打ち直す。消す前に打つと、キーの名前を名指して断られる。テスト計画
plugins/ndf/tests/progress・plugins/ndf/tests/domains/relay・plugins/ndf/tests/coreを含む)が通るplan.jsonを上の手順で直し、ndf lanes statusにmetrics.machineと待ちが出ることをオーガナイザーが見る受け入れ条件との対応
test_plan.py::test_cli_has_no_limits_subcommand_and_no_plans_optiontest_plan.py::test_cli_refuses_a_plan_file_that_names_a_removed_limittest_plan.py::test_recorded_limits_of_older_versions_are_read_as_no_changetest_lane.py::test_lanes_waiting_on_after_are_not_counted_against_any_limittest_lane_machine.py::test_count_adds_each_live_lane_and_each_running_wrapper_once_but_not_the_lane_to_launch・test_admit_counts_the_lane_to_launch_as_one・test_a_launch_held_by_the_machine_cap_is_not_a_failure_and_is_tried_againtest_lane_machine.py::test_waiting_lanes_start_in_plan_order_once_a_seat_freestest_lane_machine.py::test_count_takes_wrappers_of_any_role_and_wrappers_outside_the_registry・test_relay_hub.pyの置き換えの起動・続きの起動・頼む側の値のテストtest_lane_machine.py::test_two_plans_admitting_at_once_do_not_pass_the_cap・test_a_plan_whose_wrappers_all_stopped_is_found_from_the_indextest_lane_machine.py::test_status_*test_named_cap.py・test_relay_cli.py::test_cap_*・test_lane_machine.py::test_a_new_cap_takes_effect_on_the_next_admission_in_the_same_process・test_relay_hub.py::test_the_machine_setting_is_read_at_each_decisionplugins/ndf/src/ndf/testing/とplugins/ndf/tests/testing/を変えていない(差分に無い)Refs #3989(課題はスプリントの最後の工程で閉じる)
🤖 Generated with Claude Code
https://claude.ai/code/session_01KYHP7xtTft8kizHeodLjzC
通した工程