Check whether a decision function ignores a given input
check_mutation_invarianceCheck if a function's output changes when a protected attribute, geography, or price is mutated. Re-runs your function per scenario and flags vacuous mutations.
Instructions
Checks -- for the scenarios you supply, not a formal proof for every possible input -- whether a decision, score, or ranking function's output changes depending on a variable it claims not to depend on: a protected attribute (name, inferred ethnicity/gender/age signal), geography, price, or any axis you name. Re-runs your actual function once per named mutation scenario and confirms the output is byte-identical to the unmutated baseline; a scenario whose mutation didn't actually change the input is flagged 'vacuous' rather than silently counting as a pass. This is the general form of check_payout_invariance -- use this one for hiring/lending/insurance/housing-style fairness claims or any other 'should not depend on X' claim; use check_payout_invariance specifically for the payout/commission axis (it also has a static-import-grep mode this tool doesn't need). Pass JS source for the function under test and each mutation -- this runs in a worker thread with a bounded timeout, not a sandbox, so only pass code you wrote or trust. A pass covers only the mutations you ran: it says nothing about values you didn't try, fields changed one at a time but never together, or a proxy field you never touched (a ZIP code standing in for race, a graduation year for age). Re-run this in CI whenever the function changes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fnSource | Yes | JS source for the pure function `(input) => output` under test, e.g. "(applicant) => scoreApplicant(applicant)". Built and run in a worker thread with a bounded timeout (default 10s, see README). | |
| baseInput | Yes | The baseline input to fn. | |
| scenarios | Yes | Named mutation scenarios to re-run fn under. |