Skip to content

archcheck: one path-scoping option for pattern_ratchet - #687

Merged
ac-pplx merged 1 commit into
mainfrom
ac/archcheck-fold-paths-into-include
Oct 20, 2026
Merged

ac-pplx merged 1 commit into
mainfrom
ac/archcheck-fold-paths-into-include

Conversation

@ac-pplx

@ac-pplx ac-pplx commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • pattern_ratchet had two overlapping scoping keys, include (node-manager: prevent signal-driven btrfs send restarts #591) and paths (the sbx-mgr store stack, sbx-mgr: route every SQLite statement through db/ and fence the rest with cargo arch #561). An instance with both checked only files matching both. This keeps include and removes paths.
  • An empty include is now rejected with its own error (exit 2): include must list at least one glob; omit it to check every production file. Previously an empty include silently measured nothing. No instance in ARCHITECTURE.toml used an empty include.
  • sbxmgr_sqlite moves its globs from paths to include. sbxmgr_sqlite_schema never set paths (it is workspace-wide), so it needed no change; no other instance used paths.
  • The two features' tests are merged into pattern_ratchet_include_scopes_measurement_without_changing_default. The include = [] case becomes the rejection assertion; every other assertion is kept against include. The README drops the "both set" intersection text and documents the single option.

Behavior notes

  • A config that still sets paths now fails as an unknown key (exit 2) like any other, because the structs use deny_unknown_fields.
  • Wording: a stale baseline entry for a file outside an include-only instance now says "is outside the paths ... checks" (what paths instances already said) instead of "has no code lines left". No instance in the repository hits this, and cargo arch output is unchanged.

Validation

cargo arch output is byte-identical before and after in three modes: plain, with --base-baseline/--base-architecture, and --format rdjson. The baseline that --write-baseline writes is identical too. The committed baseline's file_size table has drifted from the tree independently of this change, so the check compares the pre-change and post-change binaries rather than the committed file.

  • bash ci/scripts/run-rust-checks.sh fmt: pass
  • cargo clippy --workspace --locked --all-targets --all-features -- -D warnings: pass
  • cargo test --locked -p pplx-space-archcheck: pass (7 unit, 47 cli, 5 repository)

🤖 Generated with Claude Code

Two overlapping scoping keys had accumulated on pattern_ratchet: `include`
and `paths`. An instance with both checked only files matching both, and
they differed in one way: an empty `include` silently measured nothing
while an empty `paths` was rejected.

Keep `include` and remove `paths`. An empty `include` is now rejected with
its own error (exit 2), since a no-op scope is a footgun. No instance in
ARCHITECTURE.toml used an empty `include`; `sbxmgr_sqlite` moves its globs
from `paths` to `include`. `cargo arch` findings and baselines are
unchanged.

The two features' tests are merged into one covering the default scope, a
scoped instance, `allow` inside the scope, stale entries outside it, and
the empty-list rejection. The README documents the single option.
@ac-pplx
ac-pplx force-pushed the ac/archcheck-fold-paths-into-include branch from 9c32bae to 813d011 Compare October 20, 2026 04:37
@ac-pplx
ac-pplx marked this pull request as ready for review October 20, 2026 04:38
@ac-pplx
ac-pplx added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit e4dde72 Oct 20, 2026
20 checks passed
@ac-pplx
ac-pplx deleted the ac/archcheck-fold-paths-into-include branch October 20, 2026 11:45
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