Remove chat command + add CI coverage gate (P0) - #81
Merged
Conversation
The chat command advertised three conflicting default models (kimi-k2.6 in help text, openai/gpt-oss in the option builder, google/gemma-3-27b-it in the service) and was effectively untested (1.21% line coverage). Remove the command entirely per product direction. Removed: - src/commands/chat.ts, src/services/chat-service.ts (+ their tests) - src/utils/markdown-renderer.ts (only used by chat) - marked, marked-terminal runtime deps + @types/* dev deps (orphaned) - CHAT entries from command-structure constants - Chat Command section from README Kept DefaultApiKeyManager: still used by auth/credentials/api-key.ts and the api-keys set-default/get-default subcommands. Add a CI coverage gate to prevent silent coverage regressions: - vitest.config.ts: v8 coverage, include all src, exclude generated types/ schemas/__tests__, thresholds ratcheted just below the post-removal baseline (50/52/48/50 stmt/branch/func/line) - package.json: test:coverage script - test.yml: run npm run test:coverage in CI (replaces plain test:run) - .gitignore: ignore coverage/ (artifacts were previously committed)
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
Addresses the two P0 items from the code-quality review.
1. Remove the
chatcommandThe chat command advertised three conflicting default models in a single request flow:
kimi-k2.6in the--helptextopenai/gpt-ossinbuildCompletionOptionsgoogle/gemma-3-27b-itas the service fallbackIt was also the largest command (524 lines) at 1.21% line coverage. Per product direction, the command is removed entirely rather than fixing the default.
Deleted:
commands/chat.ts,services/chat-service.ts(+ tests),utils/markdown-renderer.ts(used only by chat), and the now-orphanedmarked/marked-terminalruntime deps +@types/*dev deps.CHATentries stripped fromcommand-structure.ts.Kept:
DefaultApiKeyManager— still wired intoauth/credentials/api-key.tsand theapi-keys set-default/get-defaultsubcommands. (Its "for chat commands" copy is now slightly stale; left for a follow-up.)2. Add a CI coverage gate
@vitest/coverage-v8was installed but never run in CI; coverage could regress silently. Now:vitest.config.ts: v8 coverage over all src files (excluding generated types/schemas/__tests__), thresholds ratcheted just below the post-removal baseline.package.json:test:coveragescript.test.yml: CI runsnpm run test:coverage(enforces thresholds) instead oftest:run..gitignore: ignorecoverage/(artifacts were previously committed by accident; cleaned up here).Post-removal coverage baseline
All source files (40): 52.36% stmt / 54.72% branch / 50.72% func / 52.47% line — up from ~60% on the test-imported set, and the chat removal eliminated the worst drag on the average. Thresholds set at 50/52/48/50 with a small anti-flake margin.
Verification
All gates green locally:
npm run typecheck✅npm run lint✅npm run format:check✅npm run build✅npm run test:coverage✅ (259 tests, thresholds met)User-facing note: removing a published command is intentional; flag for the next release notes.
Plan:
PLAN-P0.md(kept out of this PR's scope).