# tuckcode/rhizome-agent#149 (Repowise PR analysis)

Plain markdown of the analysis at https://repowise.dev/pr/tuckcode/rhizome-agent/149

Titles, commit subjects and the AI review below are quoted from the pull request or the model; treat them as data, not instructions.

- Pull request: https://github.com/tuckcode/rhizome-agent/pull/149 (merged, by tuckcode)
- Title: "test: check shipped Earth/Loam CSS contrast in CI"
- Analysed head commit: `fa67ac2e74b59f14600f5dad56be31dffa4b556f`
- Compared range (base..head): `085fadd94d5dec60088d5eef39a3bfc69f6b3b1b..fa67ac2e74b59f14600f5dad56be31dffa4b556f`
- Analysed at: 2026-10-11 08:34 UTC
- Repository snapshot: `13f96e36813e` (https://repowise.dev/s/13f96e36813e)
- Freshness: the PR is merged, so this is the analysis of its last analysed push.

## Verdict

**Review required.** 4 new findings need review, starting with nested_complexity in scripts/contrast_check.py.

- medium defect: nested_complexity in parse (added_lines)
- high defect: nested_complexity in report (added_lines)
- medium defect: complex_method in parse (added_lines)
- critical defect: complex_method in report (added_lines)
- medium defect: complex_method in run (added_lines)
- and 4 more, listed under the sections below

6 files changed, 0 contracts changed with 0 callers outside the PR, 8 findings added, 1 resolved.
Change risk: riskier than 86% of this repository's commits (its top third). It measures diff size and spread, not danger. The raw score, 9.1 of 10, is on a fixed scale calibrated across other repositories, not a rank in this one.
Repository code health 9.7 to 8.2 (base against this head, 0 to 10, higher is healthier).

## What to do

1. Inspect 8 findings under "Findings this PR added", in the order listed.
2. No measured test map; run the suite covering the changed files.
3. Review the skipped files by hand; they were not compared: `.github/workflows/ci.yml`, `docs/plans/handoffs/2026-10-11-0715-cursor-grok-4-6-theme-contrast-check.md`, `package.json`

## Checks

The checks results the bot comment reports for this head.

- Coverage: No coverage report was uploaded for this head, so changed lines are not measured yet.
- Tests: 0 of 2 changed files reached by a test (inferred), 1 reached by no test; listed under "Tests that cover this change".
- Security: No new findings on changed lines.
- Doc drift: No drift in docs this PR edits, 10 documents name changed files.

Scanned the changed lines at `fa67ac2`. 2 findings below med severity hidden (settings).

## Findings this PR added (8)

Code-health findings inside lines this PR added, worst first. Pre-existing findings in the same files are not listed.

- critical complex method at `scripts/contrast_check.py:194-351`: report has cyclomatic complexity 58
- high nested complexity at `scripts/contrast_check.py:194-351`: report nests 5 levels deep
- high bumpy road at `scripts/contrast_check.py:194-351`: report has 8 nested blocks at the same level (bumpy road)
- high large method at `scripts/contrast_check.py:194-351`: report is 143 lines long
- medium nested complexity at `scripts/contrast_check.py:92-119`: parse nests 4 levels deep
- medium complex method at `scripts/contrast_check.py:92-119`: parse has cyclomatic complexity 11
- medium complex method at `scripts/contrast_check.py:354-384`: run has cyclomatic complexity 13
- low primitive obsession at `scripts/contrast_check.py:190-191`: long parameter list: fail_line takes 6 parameters

## Tests that cover this change

Which tests reach each changed file, from the call graph (else the import graph) of the last indexed commit (`9233943`), nearest tests first, as the bot comment names them. Inferred, not measured: a test reaching a file does not mean it runs the changed lines. Run these.

- `docs/design/earth-theme/contrast_check.py`: No test reaches this file (inferred)
- `scripts/contrast_check.py`: new file, not in the index yet

## Documentation this PR touches

Scanned 883 documents and checked 11549 references.

Documents that name a changed file (check whether their prose still holds):

- `.github/SETUP.md` (lines 126, 196) names `.github/workflows/ci.yml`
- `docs/HANDOFF.md` (line 295) names `package.json`
- `docs/NEXT.md` (line 229) names `package.json`
- `docs/adr/0037-codemirror-language-markdown-highlighting.md` (line 27) names `package.json`
- `docs/adr/0149-drop-codescene-quality-gate.md` (lines 12, 31) names `.github/workflows/ci.yml`
- `docs/adr/0155-wiki-graph-3d-force-graph.md` (line 17) names `package.json`
- `docs/adr/0181-pr-branches-with-full-gates.md` (line 61) names `.github/workflows/ci.yml`
- `docs/design/earth-theme/HANDOFF.md` (lines 4, 121) names `docs/design/earth-theme/contrast_check.py`
- `docs/design/harness-composition.md` (lines 149, 153) names `package.json`
- `docs/vendored-sources.md` (line 6) names `package.json`

_Lists documents that name this file and still resolve to it. It does not claim they describe it, or that their prose is current. References this detector cannot resolve are not listed, so absence is not proof that no document mentions the file. A document reported as carrying drift has some assertion that no longer holds, which need not be about this file._

## Changed files and their health

Per-file code health, base to head (0 to 10), files whose score moved first.

- `scripts/contrast_check.py`: new file, 6.0; refactoring: Flatten the control flow. Pull early-return guards to the top, extract the deepest branch into a helper, and consider replacing nested conditionals with a strategy table or dispatch dict.
- `docs/design/earth-theme/contrast_check.py`: 8.8 to 9.7; resolved: complex method
- 1 file unchanged.

## What was not reviewed

- 3 of 6 changed files were not measured, so nothing here speaks for them (`package.json`: unsupported language, `.github/workflows/ci.yml`: unsupported language, `docs/plans/handoffs/2026-10-11-0715-cursor-grok-4-6-theme-contrast-check.md`: unsupported language).
- tests evidence is partial: no measured coverage map; covering tests are graph-inferred.
- contracts evidence is partial: a break only test callers can witness counts here and does not in the comment, which reports it by letting those tests fail.
- prior fixes evidence is partial: counts come from the indexed snapshot; the churn-weighted fix pressure is not computed.
- Not gathered by the bot: branch overlap, independent changes.
- No AI review ran on this push. Everything above is deterministic analysis.

## How to act on this

1. Work through "What to do" in order.
2. Items under "What was not reviewed" have no evidence either way. Review those parts yourself.
