SessionHost launch 容量ガードの母数を launch 所有行に絞る(ADR-DOE-AGENTS-004 一括出荷) - #591
Merged
Conversation
…OE-AGENTS-004 law 追加 launch の入場検査が active 全行を数える現行実装に対する失敗テスト (adopted 12 行 + owned 1 行・上限 10 で 13/10 拒否になる形 — 実測 32 ≥ 10 の再現)と、条文 capacity-counts-only-launch-owned-rows (law + enforcement deftest)・enforcement 台帳の追随を先行 commit する(TDD red — 実装は次 commit)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
adopt = 観測の登記であって容量の消費ではない(ADR-007 R2)。adopted 行は 終端遷移の書き手を持たず単調増加するため、active 全行の母数は launch の 恒久 100% 拒否になる(2026-08-17 実測 32 ≥ 10 — 上限値の調整では再発する)。 母数の述語 counts-toward-launch-capacity を policy 所有の純関数として 単一実装し(reap-exempt と同じ家)、launch admission がそれで絞る。 拒否文言の先頭逐語(ACP Scheduler の throttle 分類が infix 照合する 凍結面)は保持。ADR-DOE-AGENTS-004 capacity-counts-only-launch-owned-rows の実装面。テストは前 commit の red 2 本 + ADR enforcement deftest が green。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
proboscis
force-pushed
the
wt/launch-capacity-counts-launch-owned-rows
branch
from
August 16, 2026 19:01
1b7bc8f to
019f8da
Compare
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.
SessionHost launch 容量ガードの母数を launch 所有行に絞る(ADR-DOE-AGENTS-004 一括出荷)
根因と根治
対話席用 SessionHost の台帳(agentd-herdr.sqlite)は active 全 32 行が adopted=1・lifecycle=interactive で、launch の入場検査(
launch.hyの max_running 判定)が「active 状態の全行」を数えるため 32 ≥ 上限 10 でsession.launchが恒久 100% 拒否になっていた(波 1-S1 席の read-only 実測 2026-08-17・会話 ac0301fa-228a-41ad-ae89-2122aec051f8)。根因は母数の型違い: adopt(
session.adopt)は観測の登記であって容量の消費ではない(ADR-DOE-AGENTS-007 R2 — SessionHost はその substrate を作っておらず、鏡原則で刈りもしない)。adopted/interactive 行には終端遷移の書き手が居らず(条文 interactive-rows-are-never-reaped が正しく禁止)active 数は単調増加するため、上限値をいくら上げても再発する。根治 = 母数の述語を「launch 所有の行 = active ∧ 非 adopted」へ。述語は policy 所有の純関数
counts-toward-launch-capacity(policy.hy—reap-exemptと同じ家)に単一実装し、launch.hyの入場検査がそれを使う。lifecycle では絞らない: launch 起点の行は interactive でも substrate を実際に消費するので数える(絞るのは所有であって寿命ではない)。法・反例・テスト・実装の一括出荷:
capacity-counts-only-launch-owned-rowsを追加(実測 fact + 反例 5 本)test-adr-doe-agents-004-capacity-denominator-is-launch-owned(所有×寿命の 4 象限を pin)docs/adr/enforcement-ledger.json): adr_laws 81→82・adr_deftest_enforcements 35→36core
doeff/API への影響なし。変更は
packages/doeff-agents(sessionhost)とdocs/adrのみ。wire・effect 語彙・schema に変更なし。拒否文言の先頭逐語max running agent sessions reachedは ACP Scheduler の throttle 分類(infix 照合 — 席を解放して再試行)が消費する凍結面のため verbatim 保持(law の反例にも明文)。Verification(発注書の負例との 1:1 対応)
packages/doeff-agents/tests/sessionhost_launch_deftests.hy::test-launch-capacity-ignores-adopted-rows(adopted 12 行 > 上限 10 + owned 1 行で launch 成功 — 実測 32 ≥ 10 の再現形。red 確認済み: 旧実装で13/10拒否)packages/doeff-agents/tests/sessionhost_launch_deftests.hy::test-launch-capacity-counts-launch-owned-rows(owned 2 行 / 上限 2 で拒否。ACP が消費する先頭逐語と、分子が launch 所有数(2/2、5/2 でない)であることも pin)docs/adr/defadr_doeff_agents_007_koine_session_surface.hy::test-adr-doe-agents-007-reap-exemption-covers-interactive-and-adopted(既存 — 本便後も green を確認済み。本便は reap 経路に一切触れない)+test-launch-capacity-ignores-adopted-rows内で容量判定が adopted 行の status を変えないことを assertdocs/adr/defadr_doeff_agents_004_effects_session_host.hy::test-adr-doe-agents-004-capacity-denominator-is-launch-owned(所有×寿命 4 象限。red 確認済み: 述語不在の ImportError)Verification deviations
実行した検証コマンド
uv run pytest packages/doeff-agents/tests/test_sessionhost_launch.py— 32 passed(新規 2 本含む。red → green の順で実施)uv run pytest docs/adr/defadr_doeff_agents_004_effects_session_host.hy -k capacity_denominator— 1 passed(red 確認済み)uv run pytest docs/adr/defadr_doeff_agents_007_koine_session_surface.hy -k reap_exemption— 1 passed(不変)uv run pytest tests/test_enforcement_ledger.py— 1 passed(台帳追随)test_sessionhost_policy.py/test_sessionhost_resume.py/test_sessionhost_host.py/test_sessionhost_store.py— passed既知の main 由来 red(本便と無関係・報告済み)
tests/test_sessionhost_resume_cross_binding.pyの 6 件が main(53d19c6)素の断面で red(paste-not-consumed— 準備完了門 #587/#589 と cross-binding deftests の合成界の不整合と推定)。本便の変更を stash した状態で再現することを確認済み。突合(発注書の義務 2 点)
enforcement-ledger.jsonの数値衝突は rebase 時に再計算)。Follow-up
🤖 Generated with Claude Code