Skip to content

fix(ci): unblock Clippy, Security Audit and the flaky finalize test - #729

Merged
ajianaz merged 5 commits into
developfrom
chore/rusqlite-0.41
Nov 16, 2026
Merged

ajianaz merged 5 commits into
developfrom
chore/rusqlite-0.41

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

What

The three CI fixes that only work together, in one PR: the Clippy needless_bool rewrite, the Cargo.lock bumps for rustix and libz-sys, the rusqlite 0.41 upgrade for the SQLite CVE, and the sorted directory walk that de-flakes a test. It supersedes #728 and #730, whose commits are included here.

Why

Every PR to develop fails the same three checks, none of them caused by the PR, so no single fix can be green on its own and none can be merged under the required checks:

  • Clippy: clippy::needless_bool at src/engine/rules/builtin.rs on Rust 1.100 (the CI toolchain; local 1.97 does not report it).
  • Security Audit (CVE): rustix 1.1.5 (RUSTSEC-2026-0486), libz-sys 1.1.30 (RUSTSEC-2026-0418) and libsqlite3-sys 0.28.0 (CVE-2026-119375, SQLite before 3.54.0).
  • Test: mcp::agent_tools::tests::finalize_agrees_with_prepare_only_for_the_same_filters depends on the filesystem's readdir order.

How

Testing

Related Issues

Supersedes #728 and #730. Unblocks #727, #731, #732, #733, #734, #735, #736, #737.

Checklist

  • Branch name follows convention (chore/)
  • Branch is from develop
  • Commit messages follow Conventional Commits
  • No secrets or credentials committed
  • One logical change per PR: one logical goal (a green CI), several small causes that cannot be separated under the required checks

…st their advisories

- src/engine/rules/builtin.rs: return the condition instead of
  `if cond { return true; } false` (clippy::needless_bool on Rust 1.100, the
  CI toolchain; local 1.97 does not report it).
- Cargo.lock only: rustix 1.1.5 -> 1.1.6 (RUSTSEC-2026-0486) and libz-sys
  1.1.30 -> 1.1.33 (RUSTSEC-2026-0418). No Cargo.toml change.

libsqlite3-sys 0.28.0 (CVE-2026-119375) is not fixed here: the patched 0.39
needs rusqlite 0.41 and Rust 1.89, above the crate's rust-version 1.85.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01F36Uc6swK21c7x7J14k1wc
…VE-2026-119375)

libsqlite3-sys 0.28.0 bundles SQLite 3.46 and is affected by CVE-2026-119375
(uninitialized page-cache memory returned for a database whose -wal has a
different page size). rusqlite 0.41 pulls libsqlite3-sys 0.39.1 (SQLite 3.54.1).

- Cargo.toml: rusqlite 0.31 -> 0.41; rust-version 1.85 -> 1.89 (rusqlite 0.41's
  minimum).
- index/brain.rs: rusqlite no longer binds usize; pass dims and limit as i64.
- Cargo.toml [lints.clippy]: allow collapsible_if for now. Rust 1.89 enables
  let-chains, which makes clippy report 56 hits in untouched code; that wide
  mechanical rewrite is left for its own change.

A cora.db written by the old build opens and is writable with the new one and
back, and passes integrity_check.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01F36Uc6swK21c7x7J14k1wc
…ze test

walk_project followed the filesystem's readdir order. `order: path` (and the
files_fingerprint built from it) therefore differed per machine, and
finalize_agrees_with_prepare_only_for_the_same_filters failed in CI when the
walk happened to equal the default source-first order for its 3-file selection.

- Sort the walk by file name inside each directory.
- Give the test a selection (`**/*`) whose path and source-first orders differ by
  construction, and add a test that pins the walk order.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01F36Uc6swK21c7x7J14k1wc
@ajianaz ajianaz changed the title fix(deps): upgrade rusqlite to 0.41 for the patched bundled SQLite (CVE-2026-119375) fix(ci): unblock Clippy, Security Audit and the flaky finalize test Nov 16, 2026
@ajianaz
ajianaz merged commit d6b246e into develop Nov 16, 2026
16 checks passed
ajianaz added a commit that referenced this pull request Nov 16, 2026
…complete (#733)

> Replaces #726 (same commit, `8a9e0ed`). That PR's head branch
`claude/...` failed the Branch Naming check and a head branch cannot be
renamed.

## What
`cora review` now splits a diff above `review.max_chunk_chars` (default
48,000 chars) into chunks, also with `--ci`; adds `review.exclude`
(globs removed from the reviewed diff); and adds
`review.fail_on_incomplete` (default `true`) so a review that skipped
part of the diff names the files and exits 1.

## Why
Closes #720.
- Chunking only started above `hook.max_diff_size` (5 MB) and never with
`--ci`, so a ~1,850-line diff went to the model in one request and
failed with `finish_reason=length`.
- `ignore.files` does not filter the reviewed diff, so docs, lockfiles
and changelogs always counted toward its size.
- A failed model call degraded silently to deterministic findings and
the run exited 0.
- Found while testing: the chunker lost files. It cut each file block at
the wrong header and joined blocks without a newline, so only the last
file of a multi-file chunk parsed back (3 files in, 1 out).

## How
- `engine/chunker.rs`: splitting follows `diff --git` boundaries and is
lossless; a file larger than the budget is split at hunk boundaries with
its header repeated; new `exclude_paths` reuses
`path_match::PathMatcher`.
- `commands/review.rs`: chunk when `diff > min(review.max_chunk_chars,
hook.max_diff_size)`; failed chunks and judge fallbacks are collected
and named; `incomplete_exit_code` turns exit 0 into 1 and never lowers
2.
- `ReviewResponse.judge_failure` (not serialized, like
`dropped_findings`) marks a judge fallback. It replaces the
`starts_with("LLM review failed")` check in the commit gate. JSON and
SARIF output are unchanged.
- Behaviour change: a failed model call in `--format sarif` still emits
valid SARIF but now exits 1 unless `review.fail_on_incomplete: false`.
- Not in this PR: file bundling by CALLS/IMPORTS edges, and the
`exclude` input of `cora-review-action` (separate repo).

## Testing

- [x] `cargo test --features tree-sitter` passes (1329 unit tests +
integration suites)
- [x] `cargo fmt --all -- --check` passes
- [x] `cargo clippy --all-targets --features tree-sitter -- -D warnings`
passes (the CI toolchain additionally reports an unrelated
`needless_bool` in `builtin.rs`, fixed by #728)
- [ ] `cargo build --release --features tree-sitter` passes (left to CI)
- [x] Manual smoke-test with the real binary and a local fake
OpenAI-compatible server:
  - tiny budget in `--ci` mode splits into 3 chunks (before: none);
- `exclude: [CHANGELOG.md]` drops its 200+ findings and names the file;
- chunk 2/2 returns HTTP 500: exit 1 plus "Review incomplete ... Not
reviewed: src/b.rs";
  - same with `fail_on_incomplete: false`: exit 0;
  - single request failing: exit 1; all chunks ok: exit 0.

Regression tests: `every_file_survives_chunking` (fails on the old
chunker), lossless join, hunk split keeps every hunk once, plain unified
diffs, binary/deleted paths, `exclude_paths`, config merge/validate,
`incomplete_exit_code`, coverage note, and `judge_failure` set on the
judge fallback.

## Related Issues
Closes #720. Related: #718 (#727), #728, #729, #730.

## Checklist

- [x] Branch name follows convention (`feat/`)
- [x] Branch is from `develop`
- [x] Commit messages follow [Conventional
Commits](https://www.conventionalcommits.org/)
- [x] No secrets or credentials committed
- [x] One logical change per PR (no mixed concerns)

---
_Generated by [Claude
Code](https://claude.ai/code/session_01F36Uc6swK21c7x7J14k1wc)_

Co-authored-by: Claude <[email protected]>
ajianaz pushed a commit that referenced this pull request Nov 16, 2026
The walk-order fix (#729) and the stray-JSON fix (#718) vanished from
[Unreleased] on develop: my changelog resolver dropped bullets that sat before
the first section heading inside a conflict block. The resolver now keeps the
union of both sides and merges sections afterwards.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01F36Uc6swK21c7x7J14k1wc
ajianaz added a commit that referenced this pull request Nov 16, 2026
The walk-order fix (#729) and the stray-JSON fix (#718) vanished from
[Unreleased] on develop: my changelog resolver dropped bullets that sat before
the first section heading inside a conflict block. The resolver now keeps the
union of both sides and merges sections afterwards.
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