Orchestrata Ultimate › Plans › briefs › qwen › Q2b-D-report

Q2b-D Report — scripts/code-review.py ruff-missing verdict restored under ADR-0089

Source: plans/briefs/qwen/Q2b-D-report.md at 8a2cb42ad · last changed 2026-10-12 · first committed 2026-10-12 · 175 lines.

Prose pending.

Plan text

Q2b-D Report — scripts/code-review.py ruff-missing verdict restored under ADR-0089

DESIGN_WAIVER: ADR-0089 (Accepted). Q2b converted scripts/code-review.py's ruff spawns to <interpreter> -m ruff (the same conversion Phase B applied to harness/evaluators/lint.py); this task finishes the conversion by restoring the "ruff never ran" verdict, which the conversion had silently broken.

The defect

The red (defect, worktree at cc4069fe9, both files at HEAD)

bash .hostlock.sh env -u PYTHONPATH -u PYTEST_ADDOPTS .venv/bin/python -m pytest -q -p no:cacheprovider tests/scripts/test_code_review_tool.py → [hostlock] 05:27:28 rc=1, run rc=1:

FAILED tests/scripts/test_code_review_tool.py::test_ruff_checker_file_not_found_when_ruff_missing_from_path
FAILED tests/scripts/test_code_review_tool.py::test_missing_ruff_fails_the_run
FAILED tests/scripts/test_code_review_tool.py::test_ruff_format_checker_file_not_found
3 failed, 76 passed, 1 warning in 9.54s

Quoted assertion:

E   AssertionError: ruff was missing and the run still had no ERROR — a review that never linted would exit 0

The fix (scripts/code-review.py)

Seam mirrored from lint.LintEvaluator.evaluate: a keyword parameter interpreter: str | None = None, defaulting to sys.executable. The CLI wiring (lines 1960–1962, RuffFormatChecker(report) / RuffChecker(report, fix=args.fix)) is unchanged, so the CLI default stays sys.executable.

Branches, each reporting the pre-Q2b RUFF_NOT_FOUND code at its pre-Q2b severity (ERROR — git show origin/master:scripts/code-review.py lines 207–214, 312–319):

Test changes (tests/scripts/test_code_review_tool.py)

Old setup → new setup (setup only; no assertion weakened):

The red of the new tests against HEAD's code-review.py

Rule 11: fixed implementation saved to .q2bd/code-review.fixed.py, HEAD's version restored with git show HEAD:scripts/code-review.py, new tests kept. Run:

FAILED tests/scripts/test_code_review_tool.py::test_ruff_checker_file_not_found_when_ruff_missing_from_path
FAILED tests/scripts/test_code_review_tool.py::test_ruff_checker_interpreter_not_found
FAILED tests/scripts/test_code_review_tool.py::test_ruff_checker_nonzero_exit_with_no_output_is_reported
FAILED tests/scripts/test_code_review_tool.py::test_tool_did_not_run_is_error_severity[RUFF_CHECK_ERROR]
FAILED tests/scripts/test_code_review_tool.py::test_missing_ruff_fails_the_run
FAILED tests/scripts/test_code_review_tool.py::test_ruff_format_checker_file_not_found
6 failed, 76 passed, 1 warning in 12.41s

(hostlock rc=1 at 05:32:04). Fixed implementation then copied back; git diff --stat shows neither target file at HEAD. Quick module check after restore: 82 passed, 1 warning in 11.09s, [hostlock] 05:32:45 rc=0.

The forced run

env -u PYTHONPATH -u PYTEST_ADDOPTS bash .run_exclusive.sh --force --json tests/scripts/test_code_review_tool.py tests/harness/test_evaluator_lint.py tests/scripts/test_review_tools_cli.py tests/infrastructure

Affected-set note: scripts/affected_tests.py --json --files scripts/code-review.py tests/scripts/test_code_review_tool.py → "tests": ["tests/infrastructure", "tests/scripts/test_code_review_tool.py"], "escalate": false, "untested": ["scripts/code-review.py"] (D32 as predicted; the explicit module stays).

Result (stdout parsed from the first {, after the [freshness] lines):

{
  "test_totals": {"passed": 109, "failed": 0, "errors": 0, "skipped": 0},
  "reused": {"modules": 0, "tests": 0}
}

stderr tail: [run_exclusive] 05:45:35 run_tests.py rc=0, run rc=0. Green: 0 failed, 0 errors, 0 skipped, reused 0, rc 0.

Lint / gates

 plans/briefs/qwen/Q2b-D-report.md      | 147 +++++++++++++++++++++++++++++++++
 scripts/code-review.py                 | 103 +++++++++++++++++------
 tests/scripts/test_code_review_tool.py | 113 ++++++++++++++++++-------
 3 files changed, 311 insertions(+), 52 deletions(-)

PENDING marker removed — gates below are final.