Skip to content

Guard config wiring and function-call parameters - #80

Merged
BiosSystem merged 1 commit into
masterfrom
feature/config-call-integrity-guards
Sep 24, 2026
Merged

BiosSystem merged 1 commit into
masterfrom
feature/config-call-integrity-guards

Conversation

@BiosSystem

Copy link
Copy Markdown
Owner

Two more static checks over every script Winnow loads, in the config-to-GUI area that has little runtime coverage. Both pass on the current code - this is prevention, not a live fix, following the two guards that did catch bugs (#74 unloaded files, #78 keyword-as-command).

  • Function-call parameters (Test-SafetyGuards): a named argument to a Winnow function must match a declared parameter (by unambiguous prefix, as PowerShell allows) or a common parameter; functions taking $args are skipped. A mismatch would fail at run time with "A parameter cannot be found that matches parameter name". Scan of the current tree: 0 mismatches across 308 functions.
  • Config wiring (Test-FeaturesJson): every feature's category must be defined; every UiGroup must name a real category and map each combobox option to a feature that exists and has a CLI parameter. A dangling UiGroup FeatureId would make a GUI option silently apply nothing. Scan of the current config: 0 problems.

Confirmed both catch breakage: a UiGroup FeatureId typo and a call with a bogus parameter each fail the relevant test.

Test-only, no product change; no release needed. Local: static validation clean (134 files), Tests\Unit 212 passed / 0 failed.

Extends the static checks over the loaded scripts to two more classes of
error that only surface at run time, in the config-to-GUI wiring that has
little other coverage. Both pass on the current code; these keep it that way.

- A named argument passed to a Winnow function must match one of its
  parameters, by unambiguous prefix as PowerShell allows, or a common
  parameter. A mismatch fails with "A parameter cannot be found that matches
  parameter name". Functions taking $args are skipped.
- Every feature's category must be one the config defines, and every UiGroup
  must name a real category and map its options to features that exist and
  have a CLI parameter. A combobox option pointing at a missing feature
  applies nothing when selected.

Both were confirmed to fail against a deliberately broken config and a call
with a bogus parameter.
@BiosSystem
BiosSystem merged commit dd0e23e into master Sep 24, 2026
1 check passed
@BiosSystem
BiosSystem deleted the feature/config-call-integrity-guards branch September 24, 2026 20:25
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