Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/updates/2026-11-c.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,9 @@
- **What**: Halving the UIA checkpoints (U-20261119-01) was not enough: `test_agent_uia_target` still hit the 120 s timeout on a Windows 3.12 runner, because a capture makes thousands of COM calls and each full runtime checkpoint is a durable budget write plus authority queries. `UiaObservationTarget` now hands the source a capture checkpoint that re-validates the pinned task and owner on every call but runs the full runtime checkpoint at most every 50 ms; the unthrottled checkpoint after the capture still runs before publication, so revocation is observed before anything is published. The same CI rounds also showed two clock/latency follow-ups to U-20261119-02, committed separately: `test/fixtures/semantic_helper.py` still stamped captures with `time.monotonic` (a different clock than `perf_counter` on Windows before 3.13), and `test_agent_memory_target`'s managed read used the probe's 1 s default under per-step durable checkpoints.
- **Evidence**: `uia_target.py` `_capture_checkpoint`; `test_agent_uia_target.py::test_revocation_during_capture_prevents_publication` (both cadences), `::test_throttled_capture_still_validates_scope_on_every_call` (3 full checkpoints per observe, scope checked on every call). The two runtime cases went from 32-139 s to under 1 s locally; 145 UIA tests passed. Job 135058967209 (windows-2022, 3.12) shows the timeout; jobs 135019756708 / 135019756850 / 135019757298 show the memory budget and helper clock failures.
- **Open items**: none.

## U-20261119-04 · 2026-11-19 · Publish helper "entered" markers whole · #incident #ci #agent

- **What**: After #556 merged, `main`'s Code Quality run failed one test on `windows-2022, 3.11`: `test_agent_semantic_helper.py::test_cancel_retires_a_helper_after_it_entered_a_blocked_command` read `''` from the marker its helper writes on entering a blocked command. `Path.write_text` creates the file before it writes the text, and the test stopped polling as soon as the file existed. The follow-on `runtime still has active input or cleanup` came from the helper still being blocked when the assertion failed. The semantic and service helper fixtures now write the marker to a temporary file and `os.replace` it into place, and both tests wait for the expected content, not just the file.
- **Evidence**: job 135178189984 (run 44410830939, `a6fe6ae8`); `test/fixtures/semantic_helper.py`, `test/fixtures/service_helper.py` `mark_entered`; `test_agent_semantic_helper.py`, `test_agent_service_helper.py`. 100 helper tests passed locally. The same test passed in the PR's earlier rounds, so this was intermittent.
- **Open items**: none.
1 change: 1 addition & 0 deletions docs/updates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ In the same commit: delete the item from `Progress.md`, add a `#done` entry here

| ID | Date | Title | Tags | Batch |
|---|---|---|---|---|
| U-20261119-04 | 2026-11-19 | Publish helper "entered" markers whole | #incident #ci #agent | [2026-11-c](2026-11-c.md) |
| U-20261119-03 | 2026-11-19 | Throttle full checkpoints inside read-only UIA captures | #incident #ci #agent #uia | [2026-11-c](2026-11-c.md) |
| U-20261119-02 | 2026-11-19 | Order captures with a fine clock; keep Docker helpers on the full package | #incident #ci #agent | [2026-11-c](2026-11-c.md) |
| U-20261119-01 | 2026-11-19 | Repair PR #556 CI: read-only guard, UIA checkpoint cost, Docker helper imports | #incident #ci #agent | [2026-11-c](2026-11-c.md) |
Expand Down
10 changes: 9 additions & 1 deletion test/fixtures/semantic_helper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Run a repository-owned semantic IPC target without any desktop or memory access."""
from dataclasses import replace
import hashlib
import os
from pathlib import Path
import sys
import threading
Expand All @@ -15,6 +16,13 @@
from je_auto_control.utils.process_memory.models import FailureReason, MemoryObservationError


def mark_entered(marker: Path) -> None:
"""Publish the marker whole: a reader polling for the file never sees it empty."""
staged = marker.with_name(marker.name + ".tmp")
staged.write_text("entered", encoding="utf-8")
os.replace(staged, marker)


class FixtureTarget(SemanticTarget):
"""Only this helper changes its counter; no application or desktop resources are opened."""

Expand Down Expand Up @@ -42,7 +50,7 @@ def perform_grounded(self, name, arguments, *, expected, operation_id):
self.worker._input({"kind": "key_press", "keycode": 65, "is_shift": False})
if arguments.get("hang"):
if self.started_marker is not None:
self.started_marker.write_text("entered", encoding="utf-8")
mark_entered(self.started_marker)
threading.Event().wait(30)
if not arguments.get("no_effect"):
self.state = replace(self.state, fields=(("value", 1),), revision=self.state.revision + 2)
Expand Down
9 changes: 8 additions & 1 deletion test/fixtures/service_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
from je_auto_control.wrapper._input_observer import input_event


def mark_entered(marker: Path) -> None:
"""Publish the marker whole: a reader polling for the file never sees it empty."""
staged = marker.with_name(marker.name + ".tmp")
staged.write_text("entered", encoding="utf-8")
os.replace(staged, marker)


class Function:
def __init__(self, callback):
self.callback = callback
Expand Down Expand Up @@ -43,7 +50,7 @@ def query(self, _handle, _level, output, _size, _needed):

def change(self, state):
if self.marker is not None:
self.marker.write_text("entered", encoding="utf-8")
mark_entered(self.marker)
if self.fault == "hang":
threading.Event().wait(30)
if self.fault == "input":
Expand Down
4 changes: 2 additions & 2 deletions test/unit_test/headless/test_agent_semantic_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ def blocked():
worker = threading.Thread(target=blocked)
worker.start()
deadline = time.monotonic() + 5
while not marker.exists() and time.monotonic() < deadline:
while not (marker.exists() and marker.read_text(encoding="utf-8") == "entered"):
assert time.monotonic() < deadline, "the helper never entered the blocked command"
threading.Event().wait(0.01)
assert marker.read_text(encoding="utf-8") == "entered"
runtime.cancel(task.task_id)
worker.join(timeout=5)
assert not worker.is_alive() and len(failures) == 1
Expand Down
4 changes: 2 additions & 2 deletions test/unit_test/headless/test_agent_service_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ def blocked():
thread = threading.Thread(target=blocked)
thread.start()
deadline = time.monotonic() + 5
while not marker.exists() and time.monotonic() < deadline:
while not (marker.exists() and marker.read_text(encoding="utf-8") == "entered"):
assert time.monotonic() < deadline, "the helper never entered the blocked command"
threading.Event().wait(0.01)
assert marker.read_text() == "entered"
runtime.cancel(task)
thread.join(5)
assert not thread.is_alive() and errors
Expand Down
Loading