refactor(coding-agent): extract shared QA helpers from app-server

Merged
CO
11d ago
+382-299

Changes

Move scratch environments, process cleanup, the HTTP model fixture, and cleanup tests into scripts/qa-shared/lib. The native CLI's socket-based integration checks now import these shared files instead of depending on the Codex-compatible server's directory.

Existing imports from qa-app-server/lib/env.mjs and cleanup.mjs still reach the same exported values. This keeps callers working until they switch paths. Token and thread-input helpers used only by the Codex-compatible server stay in its directory.

The next PR can delete that server directory without deleting the native CLI checks. It will close #3167.

Verification

Current head: d29a2fa4dc5a7f3891697453e60429b2f3b45190.
Tested commit: 3ebfb6e85a3d7deb87fe4b66f9a04b63f5771d68, tree 6c2a3d4c31b6cc35b7febda4b861614b2a04eb63.
The current head adds only the upstream Windows CI zip-install retry and its change record. Runtime and test inputs are unchanged.

The approved native Linux arm64 run used Node 24.21.0 and Bun 1.4.2. Install, build and the actual sh .husky/pre-commit all exited 0, including typechecks, lint, lock/graph checks, package-manager build verification and browser smoke. The hook left the input tree unchanged. Focused checks passed 16 files and 276 tests.

The real CLI probe used a local HTTP model fixture. A turn persisted user and assistant messages, both clients observed its lifecycle, malformed input returned an error without killing the host, and a reconnect read the saved history. Cleanup passed. This was not a paid-provider turn, and not all five repointed QA entrypoints were executed.

The repository excludes these .mjs paths from Biome; no zero-file lint invocation counts as a pass. The old full-suite orphan-reaper failure is recorded in #2527. It isn't relabeled green.

A wrapper syntax error followed the successful stage sentinels while the shared wrapper was being edited. Its cause remains unproven. Stage logs are retained; the owned container and execution directory were removed with read-back receipts.

Evidence is held locally in 20261012-final-hooks-maineb80. Hook log SHA-256: 773868b607713eaaf1066a26e57eceadffd4a449551c8453e7df859f04fa3019; focused log: e9ec281d7bc0d70132965cd75031fab76a464b1eec38a15c11e39f80daeb4617; RPC log: 1f44d47b72c43a2159b9d5f873dad0ddaf8ca576a55031edbf254995ead9303f.

Independent Opus review approved this exact head with no blockers after inspecting the diff, consumers and evidence hashes. Its actual session model was independently checked; the reviewer did not rerun tests.

Current-head CI passed, including all three coding-agent shards, workspace/script tests, static checks and platform checks. The head also passes the changelog, read-binary parity and review-claim gates. A fresh fetch found main at 5ef3c50aef4a4ba7a95de2d74bb77fbed40a0e18; git rev-list --left-right --count HEAD...origin/main returned 7 0, so the head is behind by zero commits. This head is ready for the lead's merge decision.

Refs #3167

Requested-by: @code-yeongyu


Summary by cubic

Extracts shared QA helpers from the app-server directory so native RPC QA can use them without depending on the legacy Codex JSON-RPC client, in preparation for its removal in #3167.

  • Moves the scratch environment, process cleanup, HTTP model fixture, and cleanup regression tests into scripts/qa-shared/lib.
  • Adds the shared PASS/FAIL reporter to scripts/qa-shared/lib/report.mjs and switches native RPC QA scripts to the neutral imports.
  • Keeps the old qa-app-server env.mjs and cleanup.mjs entry points as re-exports so external OmO QA consumers keep working until they adopt the new paths.
  • Adds regression coverage for package-root resolution, hermetic environment handling, shared scratch ownership, and a real HTTP fixture request.
  • Protocol-specific token and thread-input helpers stay in the app-server directory for the follow-up removal PR.