Post-convergence hygiene for the owned-daemon startup-failure work

Round H-05 converged; three cosmetic items in one commit, no behaviour
change: the test section header names both retriers (the sweep and the
owner's Refresh); the raw Popen.poll() value in _startup_diagnostic is
rendered as `poll=` instead of `exit_code=` so it no longer reads like the
typed exit_code/exit_signal label beside it (the two tests that asserted
the raw spelling now assert `poll=`); and the two I001 import-order
findings in the new test file are fixed by moving the plain import above
the from-imports.

Co-authored-by: Ouroboros <311266734+ouroboros-agent@users.noreply.github.com>
This commit is contained in:
Ouroboros 2026-09-14 09:29:30 +03:00
parent 431c81adb4
commit 86c0f65fab
4 changed files with 6 additions and 6 deletions

View file

@ -787,7 +787,7 @@ class OwnedClaudexorDaemon:
if attempt:
details.append(f"spawn_pid={attempt['pid']}; selected_version={attempt['version']}; "
f"selected_build_sha={attempt['build_sha']}; "
f"exit_code={proc.poll() if proc is not None else 'unknown'}")
f"poll={proc.poll() if proc is not None else 'unknown'}")
interval, _ = read_startup_log_interval( # identity-checked bounds only, no bytes
log_path, start=int(attempt["log_start"]), identity=attempt["log_identity"], limit=0)
details.append(describe_log_interval(interval or []))

View file

@ -2714,7 +2714,7 @@ def test_exited_spawn_times_out_cleanly_with_bounded_liveness_probes(
manager.ensure_running()
assert err.value.code == "daemon_spawn_failed"
assert "exit_code=1" in str(err.value)
assert "poll=1" in str(err.value)
assert "startup log interval=0..18 bytes" in str(err.value)
assert handshake_bounds
assert clock.now == pytest.approx(owned._SPAWN_WAIT_SEC)

View file

@ -149,10 +149,10 @@ class _Stand:
"""
def __init__(self, monkeypatch, tmp_path, *, returncode, banner, write_descriptor=False):
import ouroboros.process_custody as custody_mod
from ouroboros import claudexor_runtime as runtime
from ouroboros.gateways import claudexor as gateway_mod
from ouroboros.gateways.claudexor import ClaudexorUnavailable, DaemonEndpoint
import ouroboros.process_custody as custody_mod
self.data_dir = tmp_path / "data"
self.config_dir = self.data_dir / "claudexor"
@ -609,9 +609,9 @@ def test_a_joined_peer_startup_that_vanished_has_no_exit_fact(monkeypatch, tmp_p
@pytest.mark.skipif(os.name == "nt", reason="POSIX signal exit")
def test_a_real_child_killed_by_a_signal_carries_the_raw_return_code(monkeypatch, tmp_path):
"""Real ``Popen``: a child that dies by SIGTERM after writing the banner into the sink."""
import ouroboros.process_custody as custody_mod
from ouroboros import claudexor_runtime as runtime
from ouroboros.gateways.claudexor import ClaudexorUnavailable
import ouroboros.process_custody as custody_mod
data_dir = tmp_path / "data"
config_dir = data_dir / "claudexor"
@ -653,7 +653,7 @@ def test_a_real_child_killed_by_a_signal_carries_the_raw_return_code(monkeypatch
assert (config_dir / "daemon.log").read_bytes() == _OOM_REACHED
# --- the supervisor sweep is the one retrier ------------------------------------
# --- the supervisor sweep and the owner's Refresh are the retriers --------------
def _track_sweep_threads(monkeypatch) -> list:
"""Capture the threads the sweep starts (the retry runs on one) so tests can join them."""

View file

@ -383,7 +383,7 @@ def test_crashed_startup_reports_current_pid_build_and_log_interval(startup):
elected = _read_json(startup.home / "elected.json")
assert failed.value.code == "daemon_spawn_failed"
text = str(failed.value)
assert f"spawn_pid={elected['pid']}" in text and "exit_code=7" in text
assert f"spawn_pid={elected['pid']}" in text and "poll=7" in text
assert "version=9.9.9" in text and "build_sha=" + "c" * 40 in text
assert f"startup log interval={len(old)}.." in text
assert "old runtime" not in text and str(startup.home / "daemon.log") in text