refactor(mcp): derive version literals instead of hand-syncing them - #4161
Merged
Conversation
packages/gittensory-mcp/bin/gittensory-mcp.js's packageVersion/packageName and src/services/mcp-compatibility.ts's LATEST_RECOMMENDED_MCP_VERSION were independently hardcoded literals that had to be bumped by hand every release (the exact bug #751 fixed last cycle by re-bumping the literal, not by removing it). Both now derive from packages/gittensory-mcp/package.json directly -- the bin script reads its own package.json at runtime (always present in any install, npm ships it regardless of the "files" allowlist), and mcp-compatibility.ts imports it the same way src/server.ts:14 already imports the root package.json. Two of the three hand-synced version-pin sites from today's release are now impossible to forget, by construction. Also makes the version-pinned test assertions in mcp-cli-basics.test.ts, mcp-cli-profiles.test.ts, mcp-cli-doctor.test.ts, and mcp-compatibility.test.ts derive from the real package.json/constants instead of hardcoded literals -- required for future release-please-automated version bumps to pass CI without a human editing these files every time. Verified genuinely self-updating by temporarily bumping the local package version and confirming all 95 tests still pass unmodified; that stress test also caught a real pre-existing fragility (mcp-cli-doctor.test.ts hardcoded latestVersion: "1.0.0" as "clearly above local", which silently breaks once the package naturally reaches 1.0.0) and fixed it the same way.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 3402cd5 | Commit Preview URL Branch Preview URL |
Jul 08 2026, 08:44 AM |
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Contributor
|
Important 🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪 🔍 Gittensory is reviewing…AI analysis is in progress. This comment will update when the review is complete. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟪 Reviewing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4161 +/- ##
=======================================
Coverage 93.73% 93.73%
=======================================
Files 387 387
Lines 36304 36304
Branches 13298 13298
=======================================
Hits 34031 34031
Misses 1617 1617
Partials 656 656
🚀 New features to boost your workflow:
|
This was referenced Jul 8, 2026
Closed
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
packages/gittensory-mcp/bin/gittensory-mcp.js'spackageVersion/packageNameandsrc/services/mcp-compatibility.ts'sLATEST_RECOMMENDED_MCP_VERSIONwere independently hardcoded literals that had to be bumped by hand every release (the exact bug #751 fixed last cycle by re-bumping the literal, not by removing it). Both now derive frompackages/gittensory-mcp/package.jsondirectly:package.jsonat runtime (always present in any install — npm ships it regardless of thefilesallowlist)mcp-compatibility.tsimports it the same waysrc/server.ts:14already imports the rootpackage.jsonTwo of the three hand-synced version-pin sites from today's release are now impossible to forget, by construction.
Also makes the version-pinned test assertions in
mcp-cli-basics.test.ts,mcp-cli-profiles.test.ts,mcp-cli-doctor.test.ts, andmcp-compatibility.test.tsderive from the realpackage.json/constants instead of hardcoded literals — required for future release-please-automated version bumps to pass CI without a human editing these files every time.Test plan
npm run typecheck— cleannpx vitest run test/unit/mcp-cli-basics.test.ts test/unit/mcp-cli-profiles.test.ts test/unit/mcp-cli-doctor.test.ts test/unit/mcp-compatibility.test.ts test/integration/api.test.ts— 95 tests passmcp-cli-doctor.test.tshardcodedlatestVersion: "1.0.0"as "clearly above local," which silently breaks once the package naturally reaches 1.0.0 — fixed the same way.