test: extend processor schema-vs-factory parity checks to all processors - #1867
Merged
Merged
Conversation
Follow-ups from PR #1859. - Export the seven remaining `tool*Factories` maps (commands, hooks, ignore, mcp, permissions, skills, subagents) so tests can assert their keys, matching the visibility already given to `toolRuleFactories`. - Apply the strong bidirectional schema-vs-factory parity check (schema enum set-equals factory Map keys) to every processor, not just RulesProcessor, so drift in either direction is caught uniformly. - Clarify in comments that the subset check intentionally guards only the "target declared by a processor must exist in ALL_TOOL_TARGETS" direction, and that the reverse is not asserted because not every tool supports every feature. - Note that the hand-maintained `processors` list must be kept in sync as a known footgun until a central processor registry exists. Closes #1866
Owner
Author
|
@dyoshikawa Thank you! |
Merged
This was referenced Jul 31, 2026
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.
Background
Follow-ups from PR #1859, which added consistency checks for processor tool target schemas. That PR applied the strong schema-vs-factory parity check to
RulesProcessoronly and left low-severity clarity/coverage items for later. This PR addresses them.Changes
tool*Factoriesmaps (commands, hooks, ignore, mcp, permissions, skills, subagents) — matching the visibility already given totoolRuleFactories— and assert that each processor's schema enum set-equals its factoryMapkeys. This catches drift in either direction (a target in the schema with no factory, or a factory for a target the schema rejects) uniformly across all 8 processors, not just rules.ALL_TOOL_TARGETS" direction; the reverse is deliberately not asserted because not every tool supports every feature.processorslist must be kept in sync until a central processor registry exists.Item 3 (
.toSorted()requiring ES2023) needs no action:.toSorted()is already the dominant sorting idiom acrosssrc(45 occurrences), so this is consistent with the codebase.The only production change is widening the visibility of existing
constfactory maps toexport; there is no behavioral change. All checks pass viapnpm cicheck.Closes #1866