Repository navigation
fix(search): reject unknown --family values and flags with no value - #4
Merged
NullLabTests merged 1 commit intoDec 1, 2026
Conversation
`npm run search -- message --family action` printed "No matching elements." because the family is compared verbatim and the valid id is `actions`. During the duplicate check the ontology proposal template asks for, that reads as "this concept is not in the table". `--family Actions` failed the same way, and `--family` or `--symbol` with no value (or `--symbol=`) silently listed all 115 elements. The family is now lower-cased and checked against FAMILY_IDS, with the valid names in the error; a flag with no value exits 1 with "Missing value for --family/--symbol". The help text lists the families. Adds test/search.test.ts (8 cases, run against the real script), lists it in the README test inventory, and notes the fix under Unreleased.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
scripts/search.ts(npm run search) is the duplicate check the ontology proposal template points to. It matched--familyverbatim against the family ids and didn't check flag values:npm run search -- message --family action(singular) printed "No matching elements." The valid id isactions, so the search couldn't match anything. That reads as "this concept isn't in the table", which is exactly the wrong answer for a duplicate check.--family Actionsfailed the same way, because the comparison was case-sensitive.--familyor--symbolwith no value,--family --list, or--symbol=either swallowed the next flag or silently listed all 115 elements.What changed
FAMILY_IDS. An unknown family exits 1 withUnknown family "action". Expected one of: objects, properties, actions, interfaces, intelligence, rules.--family/--symbolwith a missing or empty value exits 1 withMissing value for --family(or--symbol).--helplists the valid families.test/search.test.ts(8 cases) runs the real script withnode --import tsxand checks exit codes, stdout and stderr.test/project.test.tsrequires it) and anUnreleased → Fixedentry to the CHANGELOG.There are no dependency changes, and valid searches behave exactly as before.
How it was verified
npm run cipasses locally on Node 24: validate, coverage, lint (biome), type-check, 414/414 tests, build, examples and the eval self-check.scripts/search.tsgives 6 failures (case-insensitive family, unknown family, and the four missing-value cases), so the tests catch the bug.message --family actionnow errors out;message --family ActionsfindsMg Message;--symbol tkstill findsTk Task.