Skip to content

build: warn on unread control-store state and unconstructed enum variants - #1306

Merged
kvlonge merged 2 commits into
mainfrom
feat/fensu-unread-state-rules
Nov 5, 2026
Merged

kvlonge merged 2 commits into
mainfrom
feat/fensu-unread-state-rules

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Why

A simplicity audit of the scheduler stack found state written but never read and enum variants never produced; rustc misses pub items and nothing flags write-only SQL columns. These rules surface both, in warn mode first.

Changes

  • XSB076 control-store-unread-state: tables and columns created by CREATE TABLE / ALTER TABLE ... ADD COLUMN under the configured store directory that no production SQL reads (SQL files or Rust string literals outside tests). Writes, excluded. upsert values, DELETE targets, indexes and comments do not count.
  • XSB077 unconstructed-enum-variant: Rust enum variants, pub included, that no production code names by path, Self:: in an impl, or a glob/brace import. Macro-declared enums and #[from] variants are skipped.
  • Both listed only under warn on the Rust target, so fensu check stays green and fensu check --warn reports them.
  • Require fensu 0.28.3 (as feat/orchestration-backend does): 0.28.0 overflows the Rust rule host's output when a rule reads every file.
  • No DuckShop case: this is lint tooling, not compiler behaviour.

Verification

  • Unit tests: 6 passed; each fails when excluded-value or test-module handling is removed.
  • fensu check --warn: main 0 faults, 31 XSB077 warnings (wire enums built by serde, plus two config error kinds); the pre-simplification scheduler baseline 50 XSB076 and 38 XSB077.
  • ruff, ty, fensu check, fensu dupes --since origin/main (0 clusters) and make check-ci clean.

…ants

Two custom fensu rules in warn mode on the Rust target:
- XSB076 reports control-store tables and columns created in the store
  SQL that no production SQL reads; writes, indexes and tests do not count.
- XSB077 reports Rust enum variants, pub included, that production code
  never constructs or matches.
…t output

fensu 0.28.0 sends complete file fact dependencies back from the Rust
custom-rule host, which overflows its 16 MiB capture once a project rule
reads every file, as XSB077 does under fensu check --warn.
@kvlonge
kvlonge enabled auto-merge (squash) November 5, 2026 05:07
@kvlonge
kvlonge merged commit 1799171 into main Nov 5, 2026
44 checks passed
@kvlonge
kvlonge deleted the feat/fensu-unread-state-rules branch November 5, 2026 05:42
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