Skip to content

スプリント lfactory3-1 - #2485

Merged
takemi-ohama merged 33 commits into
developfrom
sprint/lfactory3-1
Nov 4, 2026
Merged

takemi-ohama merged 33 commits into
developfrom
sprint/lfactory3-1

Conversation

@takemi-ohama

Copy link
Copy Markdown
Contributor

スプリント lfactory3-1 の課題を develop へ取り込む。

利用者向けの変化

移行の手順

課題と設計

コミット

変更の統計

 .../plugins__ndf__scripts__supervise.py.json       |   2 +
 plugins/ndf/contracts/env/NDF_FACTORY_RUN.json     |   5 +
 plugins/ndf/contracts/env/NDF_ORGANIZER_DIR.json   |   5 +
 plugins/ndf/contracts/env/NDF_ORGANIZER_LANE.json  |   5 +
 plugins/ndf/contracts/forms/parallel-external.json | 261 +++++++++
 plugins/ndf/contracts/index.md                     |   3 +
 plugins/ndf/scripts/lib/parallel_answer.py         |  29 +
 plugins/ndf/scripts/lib/parallel_external.py       | 372 ++++++++++++
 plugins/ndf/scripts/lib/parallel_external_cli.py   | 114 ++++
 plugins/ndf/scripts/lib/parallel_lane.py           |  60 +-
 plugins/ndf/scripts/parallel.py                    | 101 ++--
 .../ndf/scripts/tests/test_parallel_external.py    | 181 ++++++
 plugins/ndf/scripts/tests/test_parallel_run.py     |  17 +-
 .../development-workflow/references/parallel.md    |  34 ++
 113 files changed, 7971 insertions(+), 439 deletions(-)

テスト(supervise.py の run のステップ)

ステップ exit 最後の行
collect 0

集めた実装の PR

閉じる課題

Closes #2172
Closes #2439

手動確認

モード: standard / 通した工程: 実装 → Pull Request

🤖 Generated with Claude Code

takemi-ohama and others added 30 commits November 4, 2026 08:28
)

parallel.py request の gate の報告に次の 1 手が無く、形の検査で 2 で終わっていたのも直す。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
コードの識別子・API の項目名・データの項目名・i18n のキーは変えない。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rnal_cli.py へ・parallel_external.py の関数名を他と重ねない)(#2439)

- `--external` の副命令の本体(提示・まとめた配布・結果・依頼・実行ジョブの断り)を lib/parallel_external_cli.py へ移す
- 問いの答えの後に起こす相手(owner_restart)を lib/parallel_answer.py へ、依頼の読み出しと再開の送信を parallel_lane.py へ移す
  (parallel_lane から parallel_run を読むと、レーンの側の入口が parallel_run の環境変数を読むことになるため分けた)
- parallel_external.py の同名の関数を改名し(put_json・present_batch・settle_batch など)、時刻の関数は utc_stamp の 1 つにする

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#2439 を実装する(スプリント lfactory3-1)
#2172 を実装する(スプリント lfactory3-1)
工程の中身の応答の型(files / files_omitted / commit_range / decisions / output / diff_url)が
api の views/derive.ts と web の api.ts に同じ形で 2 回書かれていたため、依存を持たない契約の入口
@ndf-factory/contracts/views に StepDetailBody として 1 つにまとめ、両方の StepDetail を
StepRow & StepDetailBody へ置き換えた。型だけの変更で、実行時の振る舞いは変わらない。

Item-Id: I-001
Impl-Runtime: claude
Impl-Model: claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…anizer/model.ts#laneOf

長いループ名・長い実行 ID・ループ名なしのレーン名を API とランナーの両方で固定する。

Item-Id: I-002
Impl-Runtime: claude
Impl-Model: claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s#laneOf

API の laneOf とランナーの laneName が別々に持っていたレーンの名前の式(loop-/run- の接頭辞・小文字化・27/16 字の切り詰め)を、
契約の organizerLaneName へ 1 つにまとめる。両者はシグネチャを保ったまま委譲する。

Item-Id: I-002
Impl-Runtime: claude
Impl-Model: claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e.ts#releasePresentedKey

配布の実行の事象(release.presented / progress / settled)の冪等の鍵の式を契約(factory/contracts/src/index.ts)へ移し、
API の受け口の照合(authorize.ts の releaseKeyOf)とランナーの送信(organizer.ts の releaseBodies)が同じ関数を使うようにした。
authorize.ts の公開名は再エクスポートで維持する。鍵の文字列と認可の条件は変えていない。

Item-Id: I-003
Impl-Runtime: claude
Impl-Model: claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l.py#settle_batch

step_k が present に 1・represent に 2 を既に返すため、直後の再代入は結果を変えない。
同じ対応を step_k の 1 か所にまとめる。

Item-Id: I-004
Impl-Runtime: claude
Impl-Model: claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…errors

Item-Id: I-005
Impl-Runtime: claude
Impl-Model: claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…py#file_errors

answers の検査を _answer_errors に、batch.json の step・seq とレーンの入れ子の検査を
_batch_errors に抽出した。file_errors には入口の {file, body} の検査とファイル種別の
振り分けだけを残す。エラー文・順序・受け付ける値は変えていない。

Item-Id: I-005
Impl-Runtime: claude
Impl-Model: claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…StepDetails

git log の差分の収集を changesOf へ、ステップの出力の読み込みと切り詰めを outputOf へ抽出した。
collectStepDetails は 2 つと decisionsOf の結果を組み立てるだけにし、集められなかった項目を
省く振る舞い・項目の順序・外部呼び出しの順序は変えていない。

Item-Id: I-006
Impl-Runtime: claude
Impl-Model: claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Item-Id: I-007
Impl-Runtime: claude
Impl-Model: claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#StepPanel

変更したファイルの欄を StepFiles に、判断の欄を StepDecisions に抽出した。
StepPanel は取得・キャンセル・出力の開閉の状態と概要を持ち、2 つの一覧は新しい部品の
呼び出しにした。DOM の構造・翻訳キー・リンク・null と空配列の扱いは変えていない。

Item-Id: I-007
Impl-Runtime: claude
Impl-Model: claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@takemi-ohama

Copy link
Copy Markdown
Contributor Author

改修計画 — devbasex/ai-plugins #2485

/ndf:cross-refactoring が提案し、改修計画し、適用した改善項目の記録である。
理由と手順は提案の時点でしか残らないため、公開の直前に書き出している。

  • 件数: 採用 7・未確認 0・取り消し 0・見送り 24(うち時間 24)(最終ゲート: passed)
  • 公開: 09ef3f9 を push した
  • 書き直した時刻: 2026-11-04T11:33:15
  • 対象範囲: docs/glossary.md, docs/glossary/glossary.json, docs/specifications/README.md, docs/specifications/ndf-factory-accounts-and-plans.md, docs/specifications/ndf-factory-contracts-and-progress.md, docs/specifications/ndf-factory-dev-loops-data-and-contracts.md, docs/specifications/ndf-factory-dev-loops.md, docs/specifications/ndf-factory-runs-and-runner.md, docs/specifications/ndf-factory-runs-state-and-data.md, docs/specifications/ndf-factory-screen-map.md, docs/specifications/ndf-factory-service-boundary.md, docs/specifications/ndf-parallel-organizer.md, factory/README.md, factory/api/src/accounts/limits.ts, factory/api/src/accounts/model.ts, factory/api/src/accounts/service.test.ts, factory/api/src/accounts/service.ts, factory/api/src/github/app.ts, factory/api/src/github/port.ts, factory/api/src/handlers/api.test.ts, factory/api/src/handlers/run-jobs.ts, factory/api/src/index.ts, factory/api/src/organizer/control.test.ts, factory/api/src/organizer/control.ts, factory/api/src/organizer/model.ts, factory/api/src/progress/append.test.ts, factory/api/src/progress/append.ts, factory/api/src/progress/authorize.ts, factory/api/src/progress/read.ts, factory/api/src/routes/factory.test.ts, factory/api/src/routes/factory.ts, factory/api/src/routes/sprint-views.test.ts, factory/api/src/routes/sprint-views.ts, factory/api/src/runs/control.test.ts, factory/api/src/runs/control.ts, factory/api/src/runs/deps.ts, factory/api/src/runs/dynamo-table.ts, factory/api/src/runs/loops.test.ts, factory/api/src/runs/loops.ts, factory/api/src/runs/memory-table.ts, factory/api/src/runs/model.ts, factory/api/src/runs/runner-api.test.ts, factory/api/src/runs/runner-api.ts, factory/api/src/runs/table.ts, factory/api/src/testing/runs.ts, factory/api/src/views/derive.test.ts, factory/api/src/views/derive.ts, factory/contracts/openapi/accounts.yaml, factory/contracts/openapi/organizer.yaml, factory/contracts/openapi/runs.yaml, factory/contracts/package.json, factory/contracts/schemas/local-runner-declaration.schema.json, factory/contracts/schemas/progress-event.schema.json, factory/contracts/schemas/run-job-instruction.schema.json, factory/contracts/scripts/generate.ts, factory/contracts/src/generated/local-runner-declaration.ts, factory/contracts/src/generated/progress-event.ts, factory/contracts/src/generated/run-job-instruction.ts, factory/contracts/src/index.ts, factory/contracts/src/phases.ts, factory/package-lock.json, factory/runner/src/capacity.ts, factory/runner/src/main.ts, factory/runner/src/model.ts, factory/runner/src/organizer.test.ts, factory/runner/src/organizer.ts, factory/runner/src/redact.ts, factory/runner/src/runtime.ts, factory/runner/src/state.ts, factory/runner/src/step-details.test.ts, factory/runner/src/step-details.ts, factory/runner/src/translate.ts, factory/web/e2e/paths.ts, factory/web/package.json, factory/web/src/App.test.tsx, factory/web/src/App.tsx, factory/web/src/api.ts, factory/web/src/auth.test.ts, factory/web/src/config.ts, factory/web/src/context.tsx, factory/web/src/dummy/api.ts, factory/web/src/dummy/data.ts, factory/web/src/i18n/ja.json, factory/web/src/main.tsx, factory/web/src/pages/BacklogPage.tsx, factory/web/src/pages/RepositoriesPage.tsx, factory/web/src/pages/SprintDetailPage.tsx, factory/web/src/pages/SprintsPage.tsx, factory/web/src/pages/loops.test.tsx, factory/web/src/pages/sample.test.tsx, factory/web/src/pages/sprintParts.tsx, factory/web/src/pages/sprints.test.tsx, factory/web/src/poll.ts, factory/web/src/screens.ts, factory/web/src/ui/ui.css, factory/web/vite.config.ts, plugins/ndf/contracts/entrypoints/plugins__ndf__scripts__parallel.py.json, plugins/ndf/contracts/entrypoints/plugins__ndf__scripts__sprint-state.py.json, plugins/ndf/contracts/entrypoints/plugins__ndf__scripts__supervise.py.json, plugins/ndf/contracts/env/NDF_FACTORY_RUN.json, plugins/ndf/contracts/env/NDF_ORGANIZER_DIR.json, plugins/ndf/contracts/env/NDF_ORGANIZER_LANE.json, plugins/ndf/contracts/forms/parallel-external.json, plugins/ndf/contracts/index.md, plugins/ndf/scripts/lib/parallel_answer.py, plugins/ndf/scripts/lib/parallel_external.py, plugins/ndf/scripts/lib/parallel_external_cli.py, plugins/ndf/scripts/lib/parallel_lane.py, plugins/ndf/scripts/parallel.py, plugins/ndf/skills/development-workflow/references/parallel.md, tests, factory/contracts/tests, plugins/ndf/scripts/tests, plugins/ndf/skills/development-workflow/tests
  • テストの戦略: local-scoped-ci-whole(根拠 derived:test_duration)
  • 範囲テストの雛形: uv run --frozen --project . --all-extras pytest {paths} -q -n 4 -o junit_family=xunit1 --junitxml=.ndf/tmp/junit.xml / npm --prefix factory ci --no-audit --no-fund --silent && factory/node_modules/.bin/vitest run --root factory {paths} / python3 scripts/check-script-structure.py {paths}(静的解析) / python3 scripts/check-ndf-contracts.py {paths}(静的解析) / bash scripts/check-lint.sh -- {paths}(静的解析)
  • 最終ゲートへ寄せた危険フラグ: D1, D3, D4(項目 I-001, I-002, I-003)
  • 着手前のテスト: npm --prefix factory ci --no-audit --no-fund --silent && factory/node_modules/.bin/vitest run --root factory factory/api/src/accounts/service.test.ts factory/api/src/handlers/api.test.ts factory/api/src/organizer/control.test.ts factory/api/src/progress/append.test.ts factory/api/src/routes/factory.test.ts factory/api/src/routes/sprint-views.test.ts factory/api/src/runs/control.test.ts factory/api/src/runs/loops.test.ts factory/api/src/runs/runner-api.test.ts factory/api/src/testing/runs.ts factory/api/src/views/derive.test.ts factory/contracts/tests factory/runner/src/organizer.test.ts factory/runner/src/step-details.test.ts factory/web/src/App.test.tsx factory/web/src/auth.test.ts factory/web/src/pages/loops.test.tsx factory/web/src/pages/sample.test.tsx factory/web/src/pages/sprints.test.tsx && uv run --frozen --project . --all-extras pytest plugins/ndf/scripts/tests plugins/ndf/skills/development-workflow/tests tests -q -n 4 -o junit_family=xunit1 --junitxml=.ndf/tmp/junit.xml && python3 scripts/check-script-structure.py && python3 scripts/check-ndf-contracts.py && bash scripts/check-lint.sh(scope)
  • 着手前のテストの結果: 通過(562.8 秒 / HEAD 2d370d4)
  • 既存失敗の件数: 0
  • 想定最大時間: 54 分 / 改修計画の時点で使えた時間: 18.44 分
  • 実装担当: claude

改善項目

I-001 — factory/web/src/api.ts#StepDetail

兆候 手法 重要度 等級 提案元 状態 コミット
duplication consolidate_duplication major high claude / kiro 採用 1

なぜ: 工程の中身の応答の型 StepDetail(files / files_omitted / commit_range / decisions / output / diff_url)が factory/api/src/views/derive.ts と factory/web/src/api.ts に同じ形で 2 回書かれている(jscpd で 16 行の重複)。web は既に @ndf-factory/contracts に依存しており、依存の無い入口(contracts/src/phases.ts)の前例がある

手順: 1. factory/contracts/src に依存を持たない入口(例: views.ts)を作り、StepDetail の本体の形(StepRow を除く項目)を StepDetailBody として export する。package.json の exports に入口を足す
2. derive.ts と web/src/api.ts の StepDetail を StepRow & StepDetailBody へ置き換える
3. factory 全体の tsc と vitest(derive.test.ts・sprints.test.tsx)を実行する

I-002 — factory/api/src/organizer/model.ts#laneOf

兆候 手法 重要度 等級 提案元 状態 コミット
duplication consolidate_duplication major high codex 採用 2

なぜ: API の laneOf と runner/src/organizer.ts の laneName が、loop-/run- の接頭辞・小文字化・27/16 字への切り詰めという同じレーン識別規則を別々に実装している。依頼のあるレーンと依頼のないレーンを対応させる同一の知識なので、片側だけの変更は対応関係を崩す。

手順: 1. 現在の長いループ名・実行 ID・ループ名なしの入出力を organizer.test.ts と organizer/control.test.ts で固定する
2. factory/contracts/src/index.ts に実行 ID とループ名を受ける共通の純粋関数を置き、現在の式をそのまま移す
3. laneOf と laneName は既存のシグネチャを保って共通関数へ委譲する
4. API とランナーの既存テストおよび型検査で同じ名前が出ることを確認する。命名規則や衝突時の扱いは変えない

レビューで確かめるテストの差分: factory/api/src/organizer/control.test.ts, factory/runner/src/organizer.test.ts(機械で期待値が変わったか決まらなかった)

I-003 — factory/api/src/progress/authorize.ts#releasePresentedKey

兆候 手法 重要度 等級 提案元 状態 コミット
duplication consolidate_duplication major high codex 採用 1

なぜ: release.presented/progress/settled の冪等キーの組み立てが、受け口の releasePresentedKey・releaseProgressKey・releaseSettledKey と runner/src/organizer.ts の releaseBodies に重複する。送信と照合が必ず同じ規則で変わる必要があり、現在は文字列テンプレートの一致を別々に維持している。

手順: 1. append.test.ts と organizer.test.ts の期待するキー文字列を独立した期待値として保つ
2. 3 種のキー生成関数を factory/contracts/src/index.ts に移し、authorize.ts の利用と releaseBodies の文字列生成を同じ関数へ置き換える
3. 既存の authorize.ts の公開名は互換のため維持し、必要な import を更新する
4. 正しいキーの受理・誤ったキーの拒否・送り直しの冪等性を既存テストで確認する。認可条件とキーの文字列は変えない

I-004 — plugins/ndf/scripts/lib/parallel_external.py#settle_batch

兆候 手法 重要度 等級 提案元 状態 コミット
dead_code remove_dead_code minor high claude 採用 1

なぜ: k = step_k(...) の直後の if batch.get("step") in ("present", "represent"): k = 1 if ... else 2 は、step_k が present に 1・represent に 2 を既に返すため結果を変えない。同じ対応が step_k と settle_batch の 2 か所にある

手順: 1. settle_batch の 294〜295 行(present / represent の再代入)を削除する
2. pytest plugins/ndf/scripts/tests の parallel 系を実行し、present / represent / continue の各 step で results と presented の連番 k が変わらないことを確かめる

I-005 — plugins/ndf/scripts/lib/parallel_external.py#file_errors

兆候 手法 重要度 等級 提案元 状態 コミット
long_method extract_method major medium codex / kiro 採用 2

なぜ: 入口の {file, body} の検査と 7 種類のファイルの検査が同居し、batch.json ではレーンと依頼の入れ子の検査まで担う。契約の一部分を読む際にも全形式の検査を追う必要がある。計測も認知的複雑度 36・CC 18 を示している。

手順: 1. test_parallel_external.py の契約の例の組を確認し、batch の複数レーン・複数の誤りについて現在のエラー配列の内容と順序を固定する
2. batch.json のレーン検査と answers の複数項目の検査を、それぞれ同じファイル内の _batch_errors・_answer_errors に抽出する
3. file_errors には入口の検査とファイル種別の振り分けを残す。閉じたファイル種別の分岐は対応表に置き換えない
4. 契約の例と固定テストを実行する。受け付ける値、bool/int の扱い、例外、エラー文と順序は変更しない

I-006 — factory/runner/src/step-details.ts#collectStepDetails

兆候 手法 重要度 等級 提案元 状態 コミット
long_method extract_method minor medium claude / kiro 採用 1

なぜ: 1 関数に git log の差分の収集・判断の台帳の読み出し・出力ファイルの読み込みと切り詰めが同居し CC 19。どれも失敗を握って項目を省く別々の理由で変わる

手順: 1. git log の実行と parseNumstat の結果を details へ写す部分を async function changesOf(deps, workdir, window, clean): Promise<Pick<StepDetails, "files" | "files_omitted" | "commit_range">> に抽出する
2. 出力ファイルの読み込みを async function outputOf(stateDir, line, clean): Promise<StepDetails["output"] | undefined> に抽出する
3. collectStepDetails は 2 つと decisionsOf の結果を組み立てるだけにする(未定義の項目は足さない現状を保つ)
4. runner/src/step-details.test.ts を実行する

I-007 — factory/web/src/pages/SprintDetailPage.tsx#StepPanel

兆候 手法 重要度 等級 提案元 状態 コミット
long_method extract_method minor medium claude / codex 採用 2

なぜ: StepPanel は約 115 行で、読み込みの effect・概要・変更したファイル・判断・出力の開閉を 1 つのコンポーネントに持つ。ファイルと判断の欄はどちらも「null は記録なし / 空は 0 件 / それ以外は一覧」の同じ 3 分岐の入れ子の三項演算で書かれている

手順: 1. pages/sprints.test.tsx の詳細表示・記録なし・報告の開閉のテストを確認し、抽出するファイル欄の空配列・バイナリ・省略件数、判断欄の空配列について現状の表示を固定する
2. 同じファイル内に StepFiles と StepDecisions を抽出し、必要な StepDetail の項目だけを props で渡す
3. StepPanel は取得・キャンセル・選択した工程の状態と出力の開閉を持ち、2 つの一覧を新しい部品の呼び出しへ置き換える
4. DOM の構造、翻訳キー、リンク、null と空配列の扱いを保って既存と追加の画面テストを実行する

指標の測定

  • 状態: written / 言語とツールの対応: 既定(.ndf/code-metrics.json は無い) / 所要: 29.6 秒(使えた時間 162 秒 / 上限 162 秒)
  • 指標のファイル: /tmp/ndf-worktrees/devbasex--ai-plugins/rf2485/work/.cross_refactoring/code-metrics-rf2485.md
言語 ツール 版 ランナー ファイル 秒 結果
python ruff-complexipy ruff 0.16.9 / complexipy 8.0.1 uvx 237 0.9 測った
shell — — — 10 — unsupported_language
typescript lizard lizard 1.24.0 uvx 74 0.6 測った
重複: python symilar pylint 4.0.9 uvx 237 24.4 測った(2 箇所)
重複: shell, typescript jscpd jscpd 4.3.0 npx 84 2.7 測った(6 箇所)

時間の上限

値 中身
提案の枠の終わり(監視の上限 = 残り + 余裕) 2026-11-04T11:13:05+00:00
改修計画の枠の終わり(同上) 2026-11-04T11:18:29+00:00
テストの追加の終わり = 実装の終わり − Σ(採っていて未検証の項目の実装の見積り) 2026-11-04T11:18:05+00:00
実装の終わり = 最終ゲートの修正の打ち切り − バッファ − Σ(採っていて未検証の項目の検証の見積り) 2026-11-04T11:18:59+00:00
直しの試行の打ち切り 2026-11-04T11:29:57+00:00
想定最大時間の終わり H(子プロセスはすべてここまでに止まる) 2026-11-04T11:46:55+00:00
確かめの開始の締め切り = H − 確かめの見込み(最終ゲート修正と打ち切りの後の取り消しもここまで) 2026-11-04T11:31:33+00:00
確かめの見込み(秒。最終ゲートの確かめ 1 回。バッファの最終ゲートの全体テスト) 922
最終ゲート修正 1 回の見込み(秒。バッファの final_fix。起動は今 + この値が確かめの開始の締め切り以前のときだけ) 96
指標の測定の上限(秒。提案の枠の中から割く) 162
着手前のテスト 1 回の上限(秒) 4644
範囲テスト 1 回の上限(秒) 1689
手元の全体テスト 1 回の上限(秒) 4644
CI の待ちの上限(秒) 2766
余裕(秒。手順の上限と CLI の上限に足す) 162

入力: 予算 54 分 / 全体テストの所要 w 1548.0(ci-steps) / 着手前の実測 x 562.8 / CI の壁時計 c 922.0 / 着手前のテストの所要の見込み s 1548.0(whole) / 戦略 local-scoped-ci-whole

無音の打ち切りは手順の監視の上限と同じ値である。項目ごとの期限は持たない(実装を止めるのは実装の終わりだけ)。

見送った提案

対象 兆候 理由 根拠(MVV) 補足
factory/api/src/runs/control.ts#RunControl.admit long_method budget Value 5 見積り 10.3 分が残りに入らない
factory/api/src/runs/control.ts#RunControl.finalize long_method budget Value 2 / Value 7 見積り 10.3 分が残りに入らない
factory/api/src/runs/loops.ts#loopWriteAfterRun divergent_change budget Value 7 / Value 8 見積り 10.6 分が残りに入らない
factory/api/src/accounts/limits.ts#LimitQuantity embedded_business_rule budget Value 7 / Value 8 見積り 10.3 分が残りに入らない
factory/api/src/runs/memory-table.ts#MemoryRunsTable.createRun long_method budget Value 5 見積り 10.3 分が残りに入らない
factory/api/src/views/derive.ts#stepRows duplication budget Value 8 見積り 10.3 分が残りに入らない
factory/api/src/testing/runs.ts#codeOf duplication budget Value 7 見積り 10.5 分が残りに入らない
factory/api/src/testing/runs.ts#runOf duplication budget Value 7 見積り 10.5 分が残りに入らない
factory/web/src/pages/loops.test.tsx#Where duplication budget Value 7 見積り 10.5 分が残りに入らない
factory/api/src/runs/control.ts#RunControl.admit duplication budget Value 8 / Value 7 見積り 11.1 分が残りに入らない
factory/api/src/routes/sprint-views.ts#positiveInt duplication budget Value 7 / Value 8 見積り 13.4 分が残りに入らない
factory/api/src/runs/control.ts#(anonymous) long_method budget Value 7 見積り 10.3 分が残りに入らない
factory/api/src/runs/memory-table.ts#createRun long_method budget Value 7 見積り 10.3 分が残りに入らない
plugins/ndf/scripts/lib/parallel_external.py#file_errors conditional_chain budget Value 5 見積り 11.3 分が残りに入らない
factory/api/src/organizer/control.ts#OrganizerControl.wait inconsistent_naming budget Value 8 見積り 9.9 分が残りに入らない
factory/api/src/views/derive.ts#stepRows long_method budget Value 7 見積り 10.3 分が残りに入らない
plugins/ndf/scripts/parallel.py#cmd_settle long_method budget Value 7 見積り 10.3 分が残りに入らない
factory/api/src/routes/sprint-views.test.ts#emit duplication budget Value 7 見積り 10.5 分が残りに入らない
factory/web/src/pages/loops.test.tsx#loops.test duplication budget Value 7 見積り 10.5 分が残りに入らない
factory/api/src/runs/deps.ts#ndfVersionFromMarketplace hidden_dependency budget Value 6 / Value 4 見積り 11.0 分が残りに入らない
factory/api/src/runs/loops.ts#loopStateAfter conditional_chain budget Value 5 見積り 11.3 分が残りに入らない
factory/api/src/organizer/control.ts#OrganizerControl.end long_parameter_list budget Value 2 / Value 8 見積り 13.3 分が残りに入らない
factory/api/src/organizer/control.ts#tick duplication budget Value 7 見積り 13.4 分が残りに入らない
factory/api/src/views/derive.ts#StepDetail duplication budget Value 8 / Value 7 見積り 13.4 分が残りに入らない

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 cross-review | round 1 | codex | REQUEST_CHANGES

配布の再開・承認の照合・秘密情報の送信範囲・使用量の重複計上と不要な読み出しを修正してください。

差分の外を指す指摘

  • plugins/ndf/scripts/lib/parallel_external.py:214 [major / 正確性] continue の pipeline を、既存の done を値として渡す queue --resume <done> の形で組み立ててください。現在の queue <release.json> --done <done> --resume は必須の引数が欠け、さらに --resume と位置引数・--done の併用も禁止されているため、止まった配布を再開できません。
  • factory/contracts/src/index.ts:120 [major / 正確性] release.settled の冪等キーを、同じ配布の失敗後に成功を追記できる単位に変更してください。現在は配布の実行全体で1つなので、failed を送った後に同じ実行を再開しても released が重複扱いで捨てられ、依頼元が配布待ちから進めません。
  • plugins/ndf/scripts/lib/parallel_external.py:296 [major / 承認] auto:true の提示は、承認ゲートを通過した記録を確認してから書いてください。presented.json の作成後に mvv の実行自体が失敗した場合も現在は自動承認済みと記録され、再開の選択だけで confirm に進んで人の承認を記録してしまいます。
  • factory/api/src/organizer/control.ts:388 [major / 承認] 承認の答えを、現在待っている提示と結び付けて照合してください。提示1の承認で represent を起こした後、提示2の承認待ちで同じ approvalRequestId の再送を受けると、古い承認で提示2まで confirm:2 に進みます。
  • factory/runner/src/runtime.ts:130 [major / 機密情報] local で子へ渡す環境変数のモデル資格も、送信前の秘密値一覧へ含めてください。local では credential が null のため、ANTHROPIC_API_KEY や AWS の資格がステップのログに出ると伏せられず、新設の output.text としてサービスへ保存されます。
  • factory/runner/src/step-details.ts:130 [major / 機密情報] line.out の参照先を、その状態ディレクトリ内の出力ファイルに制限し、実パスでも範囲を確認してください。現在は ../ やシンボリックリンクで外部のファイルを読めるため、進捗の行に細工するとランナーの秘密鍵などが output.text としてサービスへ送られます。
  • plugins/ndf/scripts/lib/parallel_external.py:93 [major / 互換性] 配布の依頼に保存する NDF の版に、開発版の固定コミットも保持してください。plugin.json の version だけを渡すと <version>@<SHA> が失われ、配布の実行は存在しない開発版のリリースタグを取りに行って起動に失敗します。
  • factory/api/src/organizer/control.ts:163 [major / 正確性] 配布の実行が取り消された場合も、GitHub 上の main へのマージを照合してから rejected にしてください。main のマージ後、ランナーが progress ファイルを送る前に取り消すと現在は未配布として依頼を差し戻し、実際には公開済みの配布を次の配布の対象へ戻します。
  • factory/runner/src/runtime.ts:241 [major / 性能・課金] START=release で復元した進捗ログも、既存部分を読み飛ばしてください。配布の承認・出し直し・再開はいずれも release のままなので、現在は前のジョブの工程と使用量を新しい job_id で再送し、費用と token を重複計上します。
  • factory/api/src/routes/sprint-views.ts:57 [major / 性能] 一覧の最初の listRuns で取得済みの repo を保持し、行ごとの getRun を削除してください。現在は repo を取り戻すためだけに最大50回の追加読み出しが発生し、一覧を30秒ごとに読み直すたびに同じ追加処理を繰り返します。

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 cross-review | round 1 | kiro | APPROVE

指摘なし(抽出した範囲に基準を満たす問題は見つからなかった)

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 cross-review | round 2 | claude | REQUEST_CHANGES

配布の実行で判断(承認ゲートの外の問い)への答えを受けたときの再開の手と承認ゲート 2 の判定、止まった配布の差し戻しの後始末、バックログの読み直しの負荷を直してください。

Comment thread factory/api/src/organizer/control.ts Resolved
Comment thread factory/runner/src/main.ts Resolved
Comment thread factory/api/src/organizer/control.ts Resolved
Comment thread factory/web/src/pages/BacklogPage.tsx Resolved

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 cross-review | round 2 | kiro | APPROVE

指摘なし(ラウンド2の追加コミットは振る舞いを変えない抽出・統合で、基準を満たす問題は見つからなかった)

- 判断への答えはまとめた配布の状態から手を決め、提示の前の止まりで本番のプランへ進まない
- 配布の実行の承認の種類は、提示をそろえたときだけ gate2 にする
- 前の提示への承認の再送を、今の提示の承認にしない
- 差し戻した自分の release/v<版> を外の本番と見なさない。取り消しでも main のマージを照らす
- 続きの pipeline を queue --resume <done> で組む。MVV 判定の通過の記録があるときだけ auto を書く
- 開発版の <version>@<SHA> を配布の依頼へ残す(NDF_VERSION を渡す)
- release.settled の鍵を結果ごとに分ける
- local のモデルの資格を伏せる値へ足し、出力の参照を状態のディレクトリの中に限る
- 配布の実行で復元した進捗を送り直さない。一覧の行ごとの getRun をやめ、バックログを間隔で読み直さない

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@takemi-ohama

Copy link
Copy Markdown
Contributor Author

🔧 /ndf:fix サマリ | round 2 | commit 72e9045

対応件数: critical=0 / major=14 / minor=0(合計 14 件)
決着: 14 件 / 見送り: 0 件 / 却下: 0 件
CI: SUCCESS

レビュー本文の指摘への返事:

  • 対応しました。(72e9045c5)
  • 対応しました。(72e9045c5)
  • 対応しました。(72e9045c5)
  • 対応しました。(72e9045c5)
  • 対応しました。(72e9045c5)
  • 対応しました。(72e9045c5)
  • 対応しました。(72e9045c5)
  • 対応しました。(72e9045c5)
  • 対応しました。(72e9045c5)
  • 対応しました。(72e9045c5)

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 cross-review | round 3 | claude | REQUEST_CHANGES

承認の答えの再送の照合が提示待ちの状態にしか効いていない点、差し戻した配布の release/v<版> の枝を残したまま次の配布の『本番に手を付けた跡』に数える点、local で伏せるモデルの資格が 4 種に限られる点を直してください。

Comment thread factory/api/src/organizer/control.ts Resolved
Comment thread factory/api/src/organizer/control.ts Resolved
Comment thread factory/runner/src/model.ts Resolved

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 cross-review | round 3 | codex | REQUEST_CHANGES

配布中の判断への回答の受け渡し、自動承認後の再開記録、更新前の資格の伏せ字、再開の状態更新とジョブ作成の原子性、見回りの重複読み出しを修正してください。

Comment thread factory/runner/src/main.ts Resolved
Comment thread factory/runner/src/runtime.ts Resolved
Comment thread factory/api/src/organizer/control.ts Resolved
Comment thread factory/api/src/organizer/control.ts Resolved
- 確定・出し直しの後の承認の再送は、その提示に記録した承認の依頼と一致し、実行が承認ゲート 2 で止まっているときだけ同じ手を返す
- 差し戻したまとめた配布が残した release/v<版> の枝を、本番に手を付けた跡に数えない
- local で伏せるモデルの資格に OAuth・認証の token・Bedrock の bearer token を足す
- 引き受けたロールの資格を発行のたびに控え、更新前の値も伏せる
- 配布の実行を判断への答えで再開するとき、答えの本文を最初の指示へ渡す
- continue は前に起動したキューの記録(release-done.json か done.json)から続ける
- 止まった配布の状態の戻しと再開のジョブの作成を同じトランザクションで書く
- deliverAll で依頼の一覧を 1 回だけ読み、書いた答えを写して使い回す

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@takemi-ohama

Copy link
Copy Markdown
Contributor Author

🔧 /ndf:fix サマリ | round 3 | commit 1f2827c

対応件数: critical=0 / major=8 / minor=0(合計 8 件)
決着: 8 件 / 見送り: 0 件 / 却下: 0 件
CI: SUCCESS

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 cross-review | round 4 | codex | REQUEST_CHANGES

配布の再開に必要な承認資料の保存、取り消し・保存失敗後の復旧、managed の資格情報の伏せ字を修正してください。

Comment thread factory/runner/src/state.ts Resolved
Comment thread factory/api/src/organizer/control.ts Resolved
Comment thread factory/api/src/organizer/control.ts Resolved
Comment thread factory/runner/src/runtime.ts Resolved

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 cross-review | round 4 | kiro | REQUEST_CHANGES

終わった実行の詳細画面の30秒ごとの読み直しを止めてください。

…す(PR #2485 round 4)

- 配布の提示が作る承認資料(issues/approval-*-parallel-*.md)を状態の保存と復元へ入れる
- main へマージした後に取り消された配布の実行を止まった配布として残し、続きから流せるようにする
- 提示を受けた後に承認ゲート 2 へ届かずに落ちた配布(presented)も止まった配布にし、提示のプランを流し直す
- managed で子が使うタスクの役割の資格を、更新の前の値も含めて伏せる値へ足す
- 終わった実行の詳細は間隔で読み直さない

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@takemi-ohama

Copy link
Copy Markdown
Contributor Author

🔧 /ndf:fix サマリ | round 4 | commit 9c8d421

対応件数: critical=0 / major=5 / minor=0(合計 5 件)
決着: 5 件 / 見送り: 0 件 / 却下: 0 件
CI: SUCCESS

@takemi-ohama

Copy link
Copy Markdown
Contributor Author

🔧 /ndf:fix サマリ | commit (なし)

対応件数: critical=0 / major=0 / minor=0(合計 0 件)
決着: 0 件 / 見送り: 0 件 / 却下: 0 件
CI: NONE

@takemi-ohama
takemi-ohama marked this pull request as ready for review November 4, 2026 12:56
@takemi-ohama
takemi-ohama merged commit 2144aeb into develop Nov 4, 2026
24 checks passed
@takemi-ohama
takemi-ohama deleted the sprint/lfactory3-1 branch November 4, 2026 12:56
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.

1 participant