fix(review): make cross-review actually run (#51 B3/B4) - #84
Merged
Conversation
…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
This was referenced Aug 24, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
--base <branch>(extracted from the range, not--base-ref),--output-schema,CODEX_HOMEenv (not--config-home).--output-schema/--json-schemapassed 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).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-reviewnow 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