test: add 32 unit tests for triage classifier#50
Closed
TerminalGravity wants to merge 6 commits intomainfrom
Closed
test: add 32 unit tests for triage classifier#50TerminalGravity wants to merge 6 commits intomainfrom
TerminalGravity wants to merge 6 commits intomainfrom
Conversation
… and contracts The README references .preflight/ config extensively but there were no concrete example files to copy. This adds a ready-to-use examples/.preflight/ directory with annotated config.yml, triage.yml, and contracts/api.yml, plus a README explaining how to use them.
Created examples/USAGE_EXAMPLES.md with 8 real-world scenarios showing what each tool looks like in practice: preflight_check catching vague prompts, scope_work creating execution plans, enrich_agent_task for sub-agents, sharpen_followup resolving ambiguity, session health checks, semantic history search, weekly scorecards, and prompt grading. Added link to usage examples in README nav bar.
- Reorder options: npx (zero install) → npm global → clone - Add -y flag to npx for non-interactive use - Explain what CLAUDE_PROJECT_DIR enables - Note that .mcp.json paths must be absolute - Use 'absolute' in path placeholders to prevent confusion
Previously, triagePrompt() checked multi-step before cross-service and returned early, so prompts that were BOTH multi-step AND cross-service lost all cross-service context (no cross_service_hits, no search-related-projects in recommended tools). Now both signals are detected upfront and combined when co-occurring. Also adds resetConfig() export for testing/runtime config reloads. Adds 3 tests covering the interaction.
Cover all 5 triage levels (trivial, clear, ambiguous, cross-service, multi-step), config overrides (skip, alwaysCheck, strictness, crossServiceKeywords, relatedAliases), and edge cases (empty input, very long prompts, priority ordering).
TerminalGravity
commented
Mar 3, 2026
Collaborator
Author
TerminalGravity
left a comment
There was a problem hiding this comment.
Node 18 CI failed and Node 20 was cancelled. Needs a CI re-run now that the matrix has been updated. The 32 triage tests look comprehensive — worth rebasing and re-running.
Collaborator
Author
|
Closing — superseded by newer PRs. |
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.
The triage system is the brain of preflight — it had zero tests. This adds comprehensive coverage:
All 32 tests passing.