test(copilot): add dedicated test suite for Glossary OS Copilot#42
Open
paollacq wants to merge 4 commits intosolanabr:mainfrom
Open
test(copilot): add dedicated test suite for Glossary OS Copilot#42paollacq wants to merge 4 commits intosolanabr:mainfrom
paollacq wants to merge 4 commits intosolanabr:mainfrom
Conversation
…concepts inside the product itself
…concepts inside the product itself sem chave de api
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.
Summary
This PR adds a dedicated Vitest suite for Glossary Copilot inside
apps/glossary-os, turning Copilot quality into something visible and verifiable instead of implicit. The suite covers the Copilot core from multiple angles: concept detection, domain classification, error pattern matching, context building, prompt construction, structured response parsing, API input validation, and end-to-end Copilot action flows with mocked Gemini responses. In total, the PR adds 67 passing tests across 13 test files, plus a few runtime fixes discovered while building the suite. The goal is straightforward: make the Copilot behavior defensible for reviewers and judges.What This PR Adds
apps/glossary-os/src/__tests__generateCopilotAnswer(...)in all action modes:explaindebuggenerateplan/api/copilotTest Coverage
Current suite size:
Covered modules:
src/lib/copilot/concept-detector.tssrc/lib/copilot/domain-classifier.tssrc/lib/copilot/error-patterns.tssrc/lib/copilot/prompt-builder.tssrc/lib/copilot/response-parser.tssrc/lib/copilot.tssrc/lib/glossary.tssrc/app/api/copilot/route.tsTest layers:
Why This Matters
This PR does not add another Copilot surface area. It makes the existing Copilot reliable.
That matters because Glossary Copilot is not a static page feature. It includes:
Without a dedicated suite, regressions in any of those layers would be easy to miss. With this PR, the Copilot behavior becomes much easier to review, maintain, and trust.
Validation
Commands run:
npm run test --workspace @stbr/glossary-os npm run typecheck:webResult:
Screenshots
Copilot Workspace
Local Run
From the repository root:
npm install npm run test --workspace @stbr/glossary-os npm run typecheck:web