Skip to content

ci: ratchet unwrap/expect, oversized modules and undated cargo-deny ignores - #382

Merged
hanthor merged 1 commit into
mainfrom
ci/count-ratchet
Nov 20, 2026
Merged

hanthor merged 1 commit into
mainfrom
ci/count-ratchet

Conversation

@hanthor

@hanthor hanthor commented Nov 20, 2026

Copy link
Copy Markdown
Member

Adds a Ratchet workflow using the shared count-ratchet action (tuna-os/.github#389), pinned to 8ecf20e. Budgets live in .ratchet.toml, seeded at today's counts on main.

Metric Definition Budget
unwrap .unwrap() in non-test Rust under crates/ 6
expect .expect( in non-test Rust under crates/ 70
oversized-modules scripts/architecture/module-size.py: files over 1500 lines not in allowlist.txt 4
deny-undated deny.toml advisory ignores without a dated reason 0

Non-test excludes test/bench/example/fuzz dirs, *_test.rs/tests.rs, and #[cfg(test)] / #[cfg(all(test, ...))] modules (the earlier 143/111 counts included #[cfg(all(test, unix))] modules, e.g. 55 unwraps in compass-xdg/src/brand.rs tests).

deny.toml: the 8 undated ignores now end in ; review by 2027-01-01 (house form, as in gtk-office-suite). The advisory module-size step in rust.yaml is unchanged and still prints per-file warnings.

Rules: count > budget fails; count < budget fails with the exact new budget to write (so improvements lock in); a PR that raises a budget or removes a metric needs the ratchet-raise label. A job-summary table shows count/budget/delta. actions.lock regenerated with gh actions-lock.

🤖 Generated with Claude Code

…gnores

Freezes non-test .unwrap() and .expect( at today's counts, turns the
advisory module-size report into a ratchet on the number of
non-allowlisted files over 1500 lines, and requires every deny.toml
advisory ignore to carry a review date. The eight existing ignores get
'review by 2027-01-01'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: James Reilly <jreilly1821@gmail.com>
@tuna-reef-hive

Copy link
Copy Markdown
75f40c1

ℹ️ Sentinel notice — informational; author is trusted (owner), merge is not blocked

Hive flagged this PR (author @hanthor, head 75f40c117ba9) because it matches behaviors that can override security controls, escalate privileges or damage the codebase. This is a heuristic, not an accusation — a maintainer should confirm the change is intended before it merges.

  • sensitive_path — changes 2 sensitive path(s) (Touches a sensitive path (OWNERS, workflows, policies, hive config, security docs, …))
    • .github/workflows/actions.lock
    • .github/workflows/ratchet.yaml

Hive did not add the sentinel-alert label because this author is trusted. The finding remains recorded for audit and the dashboard Security tab; set sentinel.trusted_authors_block: true to require the blocking label for trusted authors too.

@hanthor
hanthor merged commit d5bcdeb into main Nov 20, 2026
21 checks passed
@hanthor
hanthor deleted the ci/count-ratchet branch November 20, 2026 03:59
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