ADR-DOE-AGENTS-008: unify readiness physics into single homes - #552
Merged
Conversation
…-DOE-AGENTS-008 red) TDD red phase for A-1 (ready 判定物理の一本化): - tests/test_ready_physics_single_home.py: identity/source/parity/budget assertions — red because sessionhost/impls/ready_physics.hy does not exist yet and literals still live in adapters/launch.hy - .semgrep.yaml: doeff-agents-ready-pattern-literal-outside-physics-home + doeff-agents-repl-idle-budget-literal-single-home — both verified firing on live code (claude.py:20 / codex.py:23 / launch.hy:81) and on the new hit fixtures in both scan modes - docs/adr/defadr_doeff_agents_008_ready_physics_single_home.hy: executable ADR (laws + deftest/defsemgrep enforcement) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Implements A-1 (ready 判定物理の一本化) — resolves the readiness instance of ADR-DOE-AGENTS-004's protocol-physics-has-one-home law: - NEW sessionhost/impls/ready_physics.hy: doeff-free leaf owning gate-form text physics (CLAUDE_SCREEN_READER_READY_PATTERN, CODEX_READY_PATTERN, has_claude_screen_reader_trust_prompt). Leaf keeps the package root's documented property intact: the imperative transport imports no doeff VM. - adapters/claude.py, codex.py: pattern literals removed; import the home constants (semgrep-guarded against re-definition) - session.py: _screen_reader_trust_prompt_visible physics moved to the home - effects.hy: REPL-IDLE-MAX-WAIT-SECONDS literal single home (MonitorKnobs vocabulary); launch.hy and host.hy now import it - markers.hy header: declares the observation-form home + retired-Rust provenance language per ADR-004 R7/U1 (main.rs is not an oracle) Verified: test_ready_physics_single_home.py + test_ready_gate.py 48/48, docs/adr -k 008 5 passed, make lint-semgrep 192 rules 0 findings, ruff clean on touched files. Registered (not fixed here) divergences discovered by unification: codex trust-dialog frame accepted by has-idle-prompt but rejected by the gate regex (skip_trust_setup fail-closed hole); claude screen-reader trust predicate does not match the first-paint frame (generic onboarding pattern was doing the real dismissal). Both routed to follow-up issues. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 25, 2026
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.
概要
A-1(ready 判定物理の一本化)。ADR-DOE-AGENTS-004 の受理済み law
protocol-physics-has-one-homeに対する readiness 物理の違反状態を解消し、executable ADR ADR-DOE-AGENTS-008 として法・反例・テスト・semgrep・実装を一括出荷する。何が散在していたか(実測)
CLAUDE_READY_PATTERN(screen-reader mode footer)has-idle-prompt(通常 mode❯)— 起動 argv 自体も forkCODEX_READY_PATTERN(regex 形式)_screen_reader_trust_prompt_visible決定(ADR-008)
sessionhost/impls/ready_physics.hy(doeff-free leaf — package root の「命令型 transport は doeff VM 非依存」性質を保つため markers.hy と分離)。observation 形式の家 = markers.hy。消費者は import のみ。一本化が可視化した既存 divergence(本 PR では登記のみ・物理は不変更)
has-idle-promptは› 1.選択 marker を受理 — sessionhost のskip_trust_setup経路に fail-closed guard が無い潜在穴 → follow-up issue。Verification(1:1 対応表)
packages/doeff-agents/tests/test_ready_physics_single_home.py::test_claude_ready_pattern_is_the_physics_home_constant/::test_codex_ready_pattern_is_the_physics_home_constant::test_adapters_do_not_define_ready_pattern_literals+ semgrepdoeff-agents-ready-pattern-literal-outside-physics-home(red 相で claude.py:20 / codex.py:23 に fire 確認済み)::test_physics_leaf_is_doeff_free::test_screen_reader_trust_prompt_predicate_matches_reprompt_frame/::test_session_py_does_not_redefine_trust_prompt_physics::test_codex_gate_regex_and_predicates_agree[...]::test_repl_idle_budget_is_not_redefined_in_launch_hy/::test_host_hy_takes_budget_from_effects_not_launch/::test_repl_idle_budget_values_cohere+ semgrepdoeff-agents-repl-idle-budget-literal-single-home(red 相で launch.hy:81 に fire 確認済み)docs/adr/defadr_doeff_agents_008_ready_physics_single_home.hy(pytest -k 008 → 5 passed)tests/semgrep/test_vm_failfast_semgrep_rules.py::test_ready_physics_single_home_rules_detect_redefinitions+ repo-root モード手動確認packages/doeff-agents/tests/test_ready_gate.py(48/48 green、変更なしで通過)実行した検証コマンド
uv run pytest packages/doeff-agents/tests/test_ready_physics_single_home.py packages/doeff-agents/tests/test_ready_gate.py -q→ 48 passeduv run pytest packages/doeff-agents/tests packages/doeff-agents/conformance -q→ 1711 passed / 36 failed — 36 件全件を基線照合済み(下記 deviations)uv run pytest docs/adr -q -k 008→ 5 passeduv run pytest tests/semgrep/test_vm_failfast_semgrep_rules.py -q -k ready_physics→ 1 passedmake lint-semgrep→ 192 rules / 0 findingsuv run ruff check <touched files>→ All checks passed(基線 96 件は PR Fix issue #530 CliRunner stderr capture + clean ruff baseline to zero #551 で 0 化済み)CONFORMANCE_AGENTD_BIN=doeff-sessionhost): S10 まで green を確認Verification deviations(全件明示)
fail 36 件の内訳と基線照合:
test_s11b_claude_without_config_dir_warns_only)で client readline hang を再現 — 7/21 以降のローカル環境ドリフト(herdr protocol 変更が濃厚)。別 issue で追跡。mcp-live-e2e・test_agentd_deterministic_result_failure_is_not_retriedは main 基線でも fail を実測)。make lint全体: lint-doeff は環境未導入(基線と同条件)。pyright は doeff-agents package を include していない(pyrightconfig.json — 本 PR 以前からの repo 状態。hy module import は shell.py と同型)。A-1 の差分起因の新規 fail はゼロ(全 fail が基線 or 並行 branch で再現)。
Follow-ups(issue 起票)
🤖 Generated with Claude Code