From a15e86bbc59e957889958efc1fcd54959e9e0c40 Mon Sep 17 00:00:00 2001 From: Bryant Date: Mon, 19 Oct 2026 11:08:58 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=85=20(test):=20Give=20the=20native?= =?UTF-8?q?=20non-blocking=20send=20budget=20headroom=20under=20load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 250 ms budget measured 255-286 ms in 2 of 14 runs under CPU contention. 1 s still separates enqueueing from a per-event runtime wait. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01JvXQ9VcS72E7DREhsgjyHV --- test/integration/test_native_core_runtime.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/integration/test_native_core_runtime.py b/test/integration/test_native_core_runtime.py index e96f23db..402befee 100644 --- a/test/integration/test_native_core_runtime.py +++ b/test/integration/test_native_core_runtime.py @@ -177,15 +177,16 @@ def test_send_event_is_non_blocking(native_core: Any) -> None: try: # Enqueueing 500 events measures a steady ~54 ms on the current shared # client (JSON -> wire encoding included), so the original 50 ms budget - # was simply below the real cost. A blocking send would wait for the - # runtime per event and cost orders of magnitude more, so a 5x margin - # still separates "enqueues" from "blocks". + # was simply below the real cost. Under CPU contention the same loop + # measured 255-286 ms (2 of 14 runs against a 250 ms budget), so the + # budget is 1 s: still far below a send that waits on the runtime per + # event, and it no longer flakes on a busy runner. events = [native_core.GovernanceEvent(make_audit_entry_payload(index)) for index in range(500)] start = time.perf_counter() for event in events: client.send_event(event) elapsed_ms = (time.perf_counter() - start) * 1000.0 - assert elapsed_ms < 250.0, elapsed_ms + assert elapsed_ms < 1000.0, elapsed_ms finally: client.close() server.close() From 74752f6f64073e9915152cd562558bc154f8d3c7 Mon Sep 17 00:00:00 2001 From: Bryant Date: Mon, 19 Oct 2026 11:09:31 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=94=A7=20(ci):=20Run=20the=20native?= =?UTF-8?q?=20core=20runtime=20tests=20in=20the=20native=20core=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The env-gated test file never ran in CI. The job sets the gate variable, drops the rerun plugin, and fails if any test was skipped. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01JvXQ9VcS72E7DREhsgjyHV --- .github/workflows/native-core-build.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/native-core-build.yml b/.github/workflows/native-core-build.yml index f201147b..357793ed 100644 --- a/.github/workflows/native-core-build.yml +++ b/.github/workflows/native-core-build.yml @@ -7,6 +7,7 @@ on: # FFI-binding Python files that import the native `_core` module. - "agent_assembly/__init__.py" - "agent_assembly/types.py" + - "test/integration/test_native_core_runtime.py" - ".github/workflows/native-core-build.yml" workflow_dispatch: @@ -53,3 +54,17 @@ jobs: - name: Verify native module import run: | uv run python -c "from agent_assembly._core import RuntimeClient, GovernanceEvent" + + # AAASM-6359: this file skips itself unless the gate variable is "1", and a + # skip exits 0, so a typo'd/removed variable would turn the job into a + # silent pass. `-o addopts=""` drops pytest.ini's `--reruns 1` (a retry + # would hide a flaky timing assertion) and the coverage plugins; the + # junit check fails the job if anything was skipped. + - name: Run native core runtime tests + env: + AAASM_RUN_NATIVE_CORE_TESTS: "1" + run: | + uv run --with pytest python -m pytest -o addopts="" -rs \ + --junitxml=native-core-runtime.xml \ + test/integration/test_native_core_runtime.py + grep -q 'skipped="0"' native-core-runtime.xml From e591122b5d9dfda644d41a4de40534b63f827d03 Mon Sep 17 00:00:00 2001 From: Bryant Date: Mon, 19 Oct 2026 11:16:46 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=94=A7=20(ci):=20Run=20the=20native?= =?UTF-8?q?=20core=20build=20when=20agent=5Fassembly/core=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The native runtime test drives runtime_interceptor, runtime_audit and assembly, which import _core, so editing only those files skipped the job that tests them. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01JvXQ9VcS72E7DREhsgjyHV --- .github/workflows/native-core-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/native-core-build.yml b/.github/workflows/native-core-build.yml index 357793ed..f8959cb4 100644 --- a/.github/workflows/native-core-build.yml +++ b/.github/workflows/native-core-build.yml @@ -7,6 +7,8 @@ on: # FFI-binding Python files that import the native `_core` module. - "agent_assembly/__init__.py" - "agent_assembly/types.py" + # The modules test_native_core_runtime.py drives through `_core`. + - "agent_assembly/core/**" - "test/integration/test_native_core_runtime.py" - ".github/workflows/native-core-build.yml" workflow_dispatch: