Skip to content

fix: Sprint 22.6 — compile error + clippy 1.95 + failing tests + version sync#30

Merged
tang-vu merged 2 commits into
mainfrom
fix/sprint-22-6-clippy-tests-version-sync
Apr 27, 2026
Merged

fix: Sprint 22.6 — compile error + clippy 1.95 + failing tests + version sync#30
tang-vu merged 2 commits into
mainfrom
fix/sprint-22-6-clippy-tests-version-sync

Conversation

@tang-vu
Copy link
Copy Markdown
Owner

@tang-vu tang-vu commented Apr 27, 2026

Summary

Comprehensive cleanup that bundles the contributions from #27 with fixes for additional issues blocking CI on main. Closes #27 (credit retained via Co-authored-by).

Issues fixed

1. Compile error (was blocking ALL PR CI)

2. Clippy 1.95 lints (CI uses -D warnings)

  • repo_intel.rs:281 — replaced sort_by(|a,b| b.score.cmp(&a.score)) with sort_by_key(|b| std::cmp::Reverse(b.score))
  • ast_intel.rs::walk_import_nodes & patrol.rs::check_single_pr — added #[allow(clippy::collapsible_match)]. Refactoring to match-arm guards would change fallthrough semantics for the JS/TS, Rust, Go, Java arms (current code is match Lang { Lang::X => if kind == "..." {...} }; converting the if to a guard would let unmatched kinds fall through to subsequent arms instead of doing nothing).

3. Failing tests (4)

  • analysis::ast_intel::tests::test_multihop_2hop_resolution — 2-hop import resolution looked up file B in parsed_files.keys(). Fixed to iterate file_imports.keys() so chains can follow files whose symbols haven't been parsed yet (which is the whole point of multi-hop).
  • github::guidelines::tests::test_detect_ai_policy_ban — function called text.contains(\"ai contributions are not allowed\") but tests passed mixed-case input. Fixed to lowercase input inside the function.
  • github::guidelines::tests::test_detects_ai_ban_llm — added pattern \b(llm|gpt|...)[-\s]+(generated|written|created)\s+(code|...). Old pattern required no\s+(llm|gpt|...)\s+(generated|...) which fails for "No LLM or GPT generated code".
  • github::guidelines::tests::test_detects_ai_ban_manual_only — added pattern only\s+(accept|allow|welcome|approve)\s+(manual|human|...). Old pattern required manual\s+contributions?\s+only which fails for "only accept manual contributions".

4. Version inconsistency (from #27)

  • Cargo.toml 6.0.0 → 6.2.0
  • install.sh v5.2.0 → v6.2.0
  • install.ps1 v5.2.0 → v6.2.0
  • README badge already shows v6.2.0

Local verification

  • cargo test --lib464 passed, 0 failed (was 460 passed, 4 failed)
  • cargo clippy --lib -- -D warnings → clean (local toolchain 1.92; 1.95 lints addressed via inspection of CI logs)
  • cargo fmt --check → clean

Test plan

  • All 4 previously failing tests pass locally
  • Full lib test suite passes (464 tests)
  • No regressions in negative-case tests (welcome/normal-contributing/conventional-commits still don't trigger ai_ban)
  • CI green on rust 1.95.0

tang-vu and others added 2 commits April 27, 2026 17:11
… sync

Bundles fixes for issues blocking CI on main and gives credit to community
contribution from PR #27.

## Compile error (from PR #27)
- src/generator/json_parser.rs:342 — pass &Value (not &&str) to
  validate_change_schema. Was E0308 blocking cargo test on main.

## Clippy 1.95 lints (deny-warnings on CI)
- src/analysis/repo_intel.rs:281 — sort_by → sort_by_key + Reverse
- src/analysis/ast_intel.rs (walk_import_nodes) — allow collapsible_match
  (refactoring to match guards would change fallthrough semantics)
- src/pr/patrol.rs (check_single_pr) — allow collapsible_match same reason

## Failing tests (4)
- ast_intel::test_multihop_2hop_resolution — 2-hop chain lookup must
  iterate file_imports.keys() (not parsed_files.keys()) so chains can
  follow files whose symbols haven't been parsed yet
- guidelines::test_detect_ai_policy_ban — lowercase input inside the
  function so callers can pass mixed-case text
- guidelines::test_detects_ai_ban_llm — added pattern matching
  "(LLM|GPT|...) generated/written/created code|contributions|prs"
- guidelines::test_detects_ai_ban_manual_only — added pattern matching
  "only accept|allow|welcome manual|human contributions"

## Version sync (from PR #27)
- Cargo.toml 6.0.0 → 6.2.0 (matches README badge)
- install.sh / install.ps1 v5.2.0 → v6.2.0

Co-authored-by: Rudasingwa-kevin <Rudasingwa-kevin@users.noreply.github.com>
@tang-vu tang-vu merged commit cfe4568 into main Apr 27, 2026
5 checks passed
@tang-vu tang-vu deleted the fix/sprint-22-6-clippy-tests-version-sync branch April 27, 2026 10:25
tang-vu pushed a commit that referenced this pull request Apr 27, 2026
Bumps tokio, clap, tree-sitter-c/php/c-sharp/css, uuid, rand, axum, axum-server, criterion. CI green on rust 1.95.0. Merged after #30 fixed pre-existing main breakage.
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