test(#838): bound adapter failure proof
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful

This commit is contained in:
ms-lead-reviewer
2026-07-18 01:52:00 -05:00
parent 6ae214a4a2
commit b5dd5963cf
2 changed files with 17 additions and 7 deletions

View File

@@ -40,3 +40,5 @@ Eliminate high-contention uncaught JSON parse failures in lease-broker and mutat
- Review RED evidence: delayed cross-chunk garbage resolved `{ ok: true }` instead of rejecting, and a truncated `promotion_token` remained in the typed error. The tests use separate timed writes to prevent kernel/event-loop coalescing. - Review RED evidence: delayed cross-chunk garbage resolved `{ ok: true }` instead of rejecting, and a truncated `promotion_token` remained in the typed error. The tests use separate timed writes to prevent kernel/event-loop coalescing.
- Review remediation: the shared client now accumulates through EOF, requires exactly one terminal newline, then parses inside a rejecting error boundary. Diagnostic bodies are capped at 256 bytes, sensitive broker fields are fully redacted, and a SHA-256 digest preserves correlation without credential disclosure. - Review remediation: the shared client now accumulates through EOF, requires exactly one terminal newline, then parses inside a rejecting error boundary. Diagnostic bodies are capped at 256 bytes, sensitive broker fields are fully redacted, and a SHA-256 digest preserves correlation without credential disclosure.
- Post-review coverage: `broker-test-client.ts` 99.35% statements/lines, 86.66% branches, 100% functions. Final full suite is 73 files / 1,394 tests plus all Python/shell gates; recursive build, typecheck, lint, and format are green. - Post-review coverage: `broker-test-client.ts` 99.35% statements/lines, 86.66% branches, 100% functions. Final full suite is 73 files / 1,394 tests plus all Python/shell gates; recursive build, typecheck, lint, and format are green.
- Fresh exact-head Codex security review: risk `none`, no findings. Fresh code review found only that the real-adapter subprocess proof lacked a timeout; it now has a five-second bound and fails with runtime/wire context while closing the fake server. The focused Python suite remains 15/15 green.
- Mandatory Opus SECREV remains coordinator-owned and pending before any push/PR decision; this build is intentionally local-only.

View File

@@ -254,13 +254,21 @@ class ExecutableEntrypointTest(unittest.TestCase):
"MOSAIC_LEASE_SESSION_ID": "d" * 64, "MOSAIC_LEASE_SESSION_ID": "d" * 64,
"MOSAIC_RUNTIME_GENERATION": "1", "MOSAIC_RUNTIME_GENERATION": "1",
} }
result = subprocess.run( try:
[sys.executable, str(TOOLS_DIR / "mutator-gate.py"), "--runtime", runtime], result = subprocess.run(
input=b'{"tool_name":"Read"}\n', [sys.executable, str(TOOLS_DIR / "mutator-gate.py"), "--runtime", runtime],
capture_output=True, input=b'{"tool_name":"Read"}\n',
env=environment, capture_output=True,
check=False, env=environment,
) check=False,
timeout=5,
)
except subprocess.TimeoutExpired as exc:
server.close()
thread.join(timeout=2)
self.fail(
f"{runtime} gate hung on wire reply {wire_reply!r}: {exc}"
)
thread.join(timeout=2) thread.join(timeout=2)
self.assertFalse(thread.is_alive()) self.assertFalse(thread.is_alive())