Skip to content

fix(scripts): require configured tags in script metadata - #963

Open
rudycelekli wants to merge 1 commit into
bee-san:masterfrom
rudycelekli:fix/configured-script-tag-selection-20261028
Open

rudycelekli wants to merge 1 commit into
bee-san:masterfrom
rudycelekli:fix/configured-script-tag-selection-20261028

Conversation

@rudycelekli

Copy link
Copy Markdown

Problem

Custom-script tag selection checks the subset in the opposite direction from the contract documented at the top of src/scripts/mod.rs.

For configuration tags = ["core_approved", "example"]:

  • A script tagged ["core_approved", "example", "extra"] is incorrectly excluded.
  • A script tagged only ["core_approved"] is incorrectly selected despite missing a required tag.

An explicitly empty configured tag list also incorrectly excludes tagged scripts, even though it requires no tags.

Change

Require every configured tag to occur in the script metadata; permit additional script tags. Keep missing configuration opt-in behavior and exclusion of scripts without tag metadata. Extract the selection into a small helper so regression tests exercise the actual production selection logic without changing HOME, reading personal configuration, running scripts, resolving hostnames, or scanning any addresses. Preserve rejected-script debug logging with safe optional path formatting.

Verification

Native qualification on Ubuntu 24.04/current stable Rust, against base 937903340aa6266abb26e93ea3241026b3fd8150:

  • Original predicate, extracted without changing selection behavior, plus new regression tests: 7 pass, 2 expected assertion failures, 0 ignored.
  • Corrected predicate: 9 pass, 0 fail, 0 ignored.
  • Full suite: 70 library + 6 binary + 2 integration + 8 doctests pass; one existing doctest remains ignored.
  • cargo clippy -- --deny warnings, cargo clippy --tests -- --deny warnings, cargo fmt --check, and cargo doc --workspace --all-features --no-deps --document-private-items pass.

Owned qualification run checked out the exact public upstream source and verified the candidate tree 2e387b691a6575ed0fadb52eefd2b959ee9c486f. This is independent qualification, not an upstream CI result or a full platform-matrix run. Compilation and tests used an empty network namespace, unprivileged uid, and offline dependencies. No scans, DNS requests or scripts were executed.

Prepared with AI assistance; the patch and test evidence were independently reviewed before submission.

This branch has not been deployed

No deployments
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