Skip to content

feat: limit _helpers/ bucket counts and package and crate code lines - #135

Merged
kvlonge merged 4 commits into
mainfrom
feat/container-and-crate-size-limits
Nov 15, 2026
Merged

kvlonge merged 4 commits into
mainfrom
feat/container-and-crate-size-limits

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Why

Two size problems went unreported: a _helpers/ container could grow to a hundred or more buckets, and one package or crate could hold most of a codebase. Both hide missing boundaries, and an oversized Rust crate is rebuilt on every change.

Changes

  • max_helpers_container_buckets (default 15): FFR312 (Python) and RSR312/FPRSR312 (Rust) report a _helpers/ container with more buckets. A bucket is a direct subdirectory holding a source file; empty, __pycache__ and asset-only folders do not count.
  • max_crate_code_lines (default 75,000): FFR602 reports a top-level Python package, RSR602/FPRSR602 a crate at its Cargo.toml. Blank and comment-only lines do not count; Rust also skips doc comments, tests/ targets, inline test trees and top-level #[cfg(test)] items.
  • Rust targets honour [thresholds] and path-scoped [[threshold_overrides]] for both limits. fensu-rust API: analyze_repository takes a ThresholdLookup; analyze_repository_with_ownership_roots takes a RepositoryAnalysisRequest. Rust cache contract rust-rules-v8.
  • Python layout rules use the root that owns each file rather than the first configured root, which also corrects FFR301/FFR302 in multi-root targets. The native check cache covers Python files outside the evaluated set, which these rules count.
  • Catalogue, native corpora, docs and skills updated.

Verification

  • make check-ci, make test-rust and make test on the final head.
  • New tests: at and over each limit, empty and asset-only folders, several roots, path overrides, rule exceptions, identical cold and warm runs, and a recount after a counted file changes, including one excluded from evaluation.
  • Cold fensu check --no-cache on this repository, three alternating runs each on one machine: median 1.36 s before, 1.41 s after, within noise.

…Python content

Python layout rules took the first configured root for every file, so in a
target with several roots each root was measured against the first one. They
now use the root that owns the file. The native check cache also hashes the
content of Python files outside the evaluated set, which the code-line limit
counts, so a change to one of them is no longer served from the cache.
@kvlonge
kvlonge enabled auto-merge (squash) November 15, 2026 11:53
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying fensu with  Cloudflare Pages  Cloudflare Pages

Latest commit: a5c2323
Status: ✅  Deploy successful!
Preview URL: https://3ae597f0.fensu.pages.dev
Branch Preview URL: https://feat-container-and-crate-siz.fensu.pages.dev

View logs

@kvlonge
kvlonge merged commit 6152dc9 into main Nov 15, 2026
37 checks passed
@kvlonge
kvlonge deleted the feat/container-and-crate-size-limits branch November 15, 2026 12:06
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