Skip to content

fix(aaa): repair syntax error that made the AAA pre-gate unimportable - #23

Merged
ZuluYokohama merged 2 commits into
masterfrom
fix/aaa-quality-syntax
Jun 6, 2026
Merged

ZuluYokohama merged 2 commits into
masterfrom
fix/aaa-quality-syntax

Conversation

@ZuluYokohama

@ZuluYokohama ZuluYokohama commented Jun 6, 2026 •

Copy link
Copy Markdown
Collaborator

fix(aaa): repair syntax error that made the AAA pre-gate unimportable

Branch-target note: Fork has no dev branch; default is master. Internal fork PR → master.

Who is submitting this PR? (required)

Field Value
Your model + version Claude Opus 4.8 (claude-opus-4-8) orchestration; opus-tier subagents (exact minor version not surfaced; likely 4.8).
Harness + version Claude Code (CLI); version not surfaced.
All plugins installed superpowers 5.1.0, plugin-dev, context7 (MCP).
Human partner who reviewed this diff b.jones@jtech.ai (ZuluYokohama)

What problem are you trying to solve?

scripts/aaa_quality.py — the "AAA Quality V&V Pre-Gate" — does not import. Line 42 reads def check_radon,\n check_quantum_crypto(target_dir):, a malformed def fusing two names with a comma. python -c "import ast; ast.parse(open('scripts/aaa_quality.py').read())" raises SyntaxError, so the entire module is dead — and scripts/evolution_gate_template.py calls into the AAA suite. A flagship gate has been shipped broken on master. (Found during a session audit of the repo's claims-vs-reality.)

What does this PR change?

One-line syntax repair: def check_radon(target_dir): (the body that followed the broken def is the Radon cyclomatic-complexity check). No new check_quantum_crypto was added — a correct one already exists at line 56 and is wired into run_aaa_suite; the , check_quantum_crypto was a stray fragment. Also adds tests/test_aaa_quality_imports.py — an import-smoke test (following the tests/test_hardware_piping.py pattern) that asserts the module imports and exposes run_aaa_suite + the four check_* functions. That test is the safety net whose absence let the syntax error ship.

Is this change appropriate for the core library?

No. Fork-specific gate script. Internal fork PR.

What alternatives did you consider?

  • Define a new check_quantum_crypto — rejected: it already exists (line 56); a second definition would duplicate/shadow it. Verified the call site (run_aaa_suite, line 74) and grep count (=1).
  • Also fix the pre-existing python3 hardcoding at line 59 (won't resolve on this Windows host) — deliberately deferred: out of scope for a minimal syntax fix; it predates this change.
  • Just fix the syntax, no test — rejected: no test imported this module, which is exactly why the error shipped undetected. The import test closes that gap.

Does this PR contain multiple unrelated changes?

No. One problem: the unimportable AAA gate. The test directly guards the fix.

Existing PRs

Environment tested

Harness Harness version Model Model version/ID
Claude Code (CLI) not surfaced Claude Opus 4.8 orchestration
  • python -c "import ast; ast.parse(...)" → PARSE OK; import aaa_quality → exposes check_bandit, check_flake8, check_quantum_crypto, check_radon.
  • Smoke run against a temp dir (with flake8/bandit/radon installed): Flake8/Bandit/Radon checks run; the suite orchestrates end-to-end without crashing.
  • python -m pytest tests/test_aaa_quality_imports.py -q → 2 passed.
  • Host: Windows 11 ARM64, Python 3.14.

New harness support

N/A.

Evaluation

N/A for skill evals. Functional: the module went from SyntaxError (unimportable) to PARSE OK + IMPORT OK + a passing import test; independently re-verified by a reviewer (grep-confirmed check_quantum_crypto defined once, diff is one def line + the test, python3 hardcoding confirmed pre-existing).

Rigor

  • Skills change — N/A.
  • Tested adversarially — reviewer re-ran parse/import/pytest from the code and confirmed no duplication.
  • Did not modify behavior-shaping content.

Human review

  • A human has reviewed the COMPLETE proposed diff before submission.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed a syntax error in the code-quality utility that prevented the module from importing and running.
  • Tests

    • Added tests to ensure the utility imports correctly and exposes the expected quality-check entry points as callable, guarding against future import or exposure regressions.

- 'def check_radon, check_quantum_crypto(target_dir):' was a malformed def
  fusing two names; the body is the Radon check -> def check_radon(target_dir)
- check_quantum_crypto was a stray fragment on that def: it is already a
  proper standalone function (delegating to scripts/quantum_gate.py) and is
  called from run_aaa_suite, so no new function was needed; adding one would
  have duplicated the existing definition
- add tests/test_aaa_quality_imports.py so the module is import-tested (the
  missing safety net that let the syntax error ship)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f746afd7-dbba-4f82-a7cc-293a741fc506

📥 Commits

Reviewing files that changed from the base of the PR and between f17bc1c and eabd347.

📒 Files selected for processing (1)
  • tests/test_aaa_quality_imports.py

📝 Walkthrough

Walkthrough

Fixes a malformed check_radon function declaration in scripts/aaa_quality.py and adds a unit test to assert the module imports and exposes run_aaa_suite plus the four check_* callables.

Changes

Syntax Fix and Regression Test

Layer / File(s) Summary
Fix malformed check_radon declaration
scripts/aaa_quality.py
The check_radon(target_dir) function declaration is corrected from a malformed line combining check_quantum_crypto into a proper standalone function signature.
Add import regression test
tests/test_aaa_quality_imports.py
New test module imports aaa_quality and verifies it exposes run_aaa_suite, check_flake8, check_bandit, check_radon, and check_quantum_crypto as callables.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • ZuluYokohama/RotarySlider#8: Both PRs touch scripts/aaa_quality.py; this PR fixes the malformed check_radon declaration while the referenced PR added the AAA quality check infrastructure initially.

Poem

🐰 In code where brackets once frowned and spat,
I hopped in, nudged a lonely line intact.
Now tests can import and checks can run,
A tidy function — job well done! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main fix: repairing a syntax error in the AAA pre-gate module that prevented it from being imported.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/aaa-quality-syntax

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/test_aaa_quality_imports.py`:
- Around line 5-6: The test currently uses sys.path.append to add the local
scripts directory which can allow an unrelated aaa_quality module earlier on
sys.path to be imported; change the import setup to use sys.path.insert(0,
os.path.abspath(os.path.join(os.path.dirname(__file__), '../scripts'))) so the
local scripts path is placed at the front before importing aaa_quality, ensuring
the test imports the intended local module.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 425abe60-79ef-4f69-bafd-2e8ec52a69b8

📥 Commits

Reviewing files that changed from the base of the PR and between 67aa8d4 and f17bc1c.

📒 Files selected for processing (2)
  • scripts/aaa_quality.py
  • tests/test_aaa_quality_imports.py

Comment thread tests/test_aaa_quality_imports.py Outdated
@ZuluYokohama
ZuluYokohama merged commit 06b2637 into master Jun 6, 2026
1 of 2 checks passed
@ZuluYokohama
ZuluYokohama deleted the fix/aaa-quality-syntax branch June 6, 2026 14:23
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.

2 participants