From ebc398cc6472280976a2a15b1bfb78caa1a704d3 Mon Sep 17 00:00:00 2001 From: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> Date: Wed, 28 Oct 2026 00:49:07 +0800 Subject: [PATCH] test: stabilize canonical smoke clocks and fixture paths Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> --- .../status-collection-readmodel-smoke.py | 13 ++++++++++--- examples/project/configure-goal-smoke.py | 4 +++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/examples/control_plane/status-collection-readmodel-smoke.py b/examples/control_plane/status-collection-readmodel-smoke.py index c9d36de2bc..3259e6ed84 100644 --- a/examples/control_plane/status-collection-readmodel-smoke.py +++ b/examples/control_plane/status-collection-readmodel-smoke.py @@ -17,6 +17,7 @@ sys.path.insert(0, str(ROOT)) from loopx import status as status_module # noqa: E402 +from loopx.control_plane.goals import coordination_observation # noqa: E402 from loopx.control_plane.status import collection as collection_read_model # noqa: E402 @@ -104,9 +105,15 @@ def assert_wrapper_parity(registry_path: Path, runtime_root: Path) -> None: "goal_id": GOAL_ID, "available_capabilities": ["network", "material_lifecycle"], } - # Compare one observation time without hiding freshness or coverage fields. - with patch.object( - collection_read_model, "now_utc_iso", return_value="2026-01-01T00:00:00Z" + # Both adapters sample time independently; keep complete freshness/provider + # comparisons deterministic even when the two reads cross a wall-clock second. + with ( + patch.object( + collection_read_model, "now_utc_iso", return_value="2026-01-01T00:00:00Z" + ), + patch.object( + coordination_observation, "now_local_iso", return_value="2026-01-01T00:00:00Z" + ), ): wrapper = status_module.collect_status(**kwargs) direct = collection_read_model.collect_status( diff --git a/examples/project/configure-goal-smoke.py b/examples/project/configure-goal-smoke.py index 3fe4be2c85..a3dbcdc503 100644 --- a/examples/project/configure-goal-smoke.py +++ b/examples/project/configure-goal-smoke.py @@ -170,7 +170,9 @@ def goal_from_registry(registry_path: Path) -> dict: def main() -> int: with tempfile.TemporaryDirectory(prefix="loopx-configure-goal-smoke-") as tmp: - root = Path(tmp) + # Canonical import binds the physical project path, including when the + # temporary directory is reached through a filesystem alias. + root = Path(tmp).resolve() registry_path = write_registry(root) original = registry_path.read_text(encoding="utf-8") agent_profile = {