Skip to content

fix(review): make cross-review actually run (#51 B3/B4) - #84

Merged
huiyu merged 1 commit into
3.0from
fix/51-cross-review-runtime
Aug 24, 2026
Merged

fix(review): make cross-review actually run (#51 B3/B4)#84
huiyu merged 1 commit into
3.0from
fix/51-cross-review-runtime

Conversation

@huiyu

@huiyu huiyu commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Third fix off the 3.0 audit. Both cross-review reviewer paths were dead; now they're correct and gated by a live flag test.

  • B3 — codex argv fixed against the installed codex 0.149.1: --base <branch> (extracted from the range, not --base-ref), --output-schema, CODEX_HOME env (not --config-home).
  • B4--output-schema/--json-schema passed so reviewers emit structured JSON; the runner drains stdout (the un-drained pipe deadlocked the Claude path to timeout) and reads per output mode (codex→file, claude→stdout).
  • M1/M2/M3/L2 — read-only tool allowlist + CLAUDE_CONFIG_DIR; DEVMUSE_CROSS_REVIEW_* env overrides; private 0700 temp dir for schema/output with cleanup; the blind adapter substitution corrected (Codex mu-review now reads "Codex skills invoke their vendored…").

Live flag-acceptance smoke — the gate the fake-spawn tests couldn't be

test:cross-review now runs <binary> ... --help (skipped when absent) and asserts every built flag is accepted by the installed CLI. It ran green here against codex 0.149.1 / claude 2.1.241 — and would have failed on --base-ref.

18 tests pass. Base 3.0. Resolves PR #81 threads B3/B4a/B4b. The trigger stays appropriately model-gated (H3).

Relates to #51

…capture

Addresses the #51 ship-blockers: both reviewer paths were functionally dead —
the Codex command used flags codex rejects, and the Claude path's output was
never captured.

- **B3** codex argv corrected against the installed codex 0.149.1: `--base
  <branch>` (a branch, extracted from the range — not `--base-ref` with a
  range), `--output-schema <file>`, and `CODEX_HOME` env (not `--config-home`).
- **B4** output capture fixed: `--output-schema`/`--json-schema` are passed so
  reviewers emit structured JSON; the runner now DRAINS stdout (an un-drained
  pipe deadlocked the Claude path until the 180s timeout) and reads per
  outputMode — codex from its output file, claude from stdout.
- **M1** Claude reviewer hardened: read-only tool allowlist (Read/Glob/Grep),
  `CLAUDE_CONFIG_DIR` env (not `--settings`). **M2** env overrides implemented
  (DEVMUSE_CROSS_REVIEW_BINARY / _CONFIG_HOME / _TIMEOUT_MS). **M3** runReview
  owns a private 0700 temp dir for the output schema + result and cleans it up.
  **L2** the blind adapter substitution is fixed — the Codex mu-review now reads
  "Codex skills invoke their vendored ..." via a dedicated build collapse.
- **Live flag-acceptance smoke test** (skipped when binaries absent, but ran
  green here against codex 0.149.1 / claude 2.1.241): asserts every built flag
  is listed in the CLI's own --help — the gate the fake-spawn tests could not
  provide, and which would have caught B3.

18 cross-review tests pass (incl. stdout-mode drain, runReview temp-dir cleanup,
env overrides, baseBranch extraction). Relates to #51. Resolves PR #81 threads
B3/B4a/B4b. The trigger remains appropriately model-gated (H3).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwyFyRC6pepaK6DuMK7YeT
@huiyu
huiyu merged commit 45d91a5 into 3.0 Aug 24, 2026
1 check passed
huiyu added a commit that referenced this pull request Aug 24, 2026
Independent re-verification found #84 fixed only the codex direction; the entire
claude reviewer path (the Codex->Claude direction) was dead.

- C2: claude's --json-schema takes INLINE JSON, not a file path (verified against
  claude 2.1.241 — a path exits 1 with "not valid JSON"). Pass
  JSON.stringify(FINDINGS_SCHEMA) on the claude branch; codex's --output-schema
  keeps the file path.
- C3: claude -p --output-format json returns an ARRAY of stream events, not
  {findings}. The runner treated the event list as the findings list -> 9 phantom
  empty findings. Added extractClaudeStructuredOutput() to unwrap the terminal
  result event (or {result} envelope) to the schema-conforming payload before
  normalizing; a non-conforming reviewer degrades to invalid, never phantoms.
- H3 (meta-lesson): the tests were falsely green — the claude runner test fed a
  fabricated {findings} claude never emits, and the smoke test checked flag NAMES
  only. Now: the invocation test asserts --json-schema is inline JSON (not the
  path) deterministically; the runner test drives the REAL event-array shape and
  asserts one real finding not one-per-event; a new binary-gated live test runs
  claude with our inline schema and asserts the flag-parse error is absent (would
  have caught C2). extractClaudeStructuredOutput unit-tested across every shape.

Adapters regenerated (the codex mu-review mirror carried the identical bug —
and it is the copy that runs under the Codex host).


Claude-Session: https://claude.ai/code/session_01KwyFyRC6pepaK6DuMK7YeT

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant