Repository navigation
Closed
Labels
Description
Problem
Users can unknowingly run outdated versions of sequant, leading to confusing behavior and missing bug fixes. This was discovered when a user saw a rocket emoji and hardcoded version "0.1.0" that had been fixed several releases ago.
Root Causes
- Local dependency in package.json - When sequant is added as a dependency (e.g.,
"sequant": "^1.1.2"),npx sequantuses the localnode_modulesversion instead of fetching latest from npm - Stale package-lock.json - Even with
^semver range, the lockfile pins to a specific version until explicitly updated - Git worktree scenario - Worktrees created from old branches inherit the stale lockfile
- npx cache - npx caches packages in
~/.npm/_npx, which can become stale
User Impact
- Users miss bug fixes and new features
- Confusing debugging sessions when behavior does not match current docs
- Hard to diagnose ("it works on my machine" across worktrees)
Proposed Solution (Simplified)
A streamlined version check system focused on what matters: telling users they're outdated and how to fix it.
Design Principles
- Simple over clever - Just compare versions, don't diagnose WHY you're outdated
- Global cache - Store version cache in
~/.cache/sequant/(not project manifest) - Non-blocking - 3-second timeout, silent failures
- User control -
--quietflag for CI/automation
Tier 1: sequant doctor (thorough)
- Fetch latest version from npm registry
- Compare to running version
- Show clear warning with remediation if outdated:
⚠️ sequant 1.5.3 is available (you have 1.2.0) Run: npx sequant@latest or npm update sequant
Tier 2: sequant run (light, cached)
- Check npm registry once per 24 hours (cached)
- Single-line warning if outdated
- Skip check with
--quietflag - Non-blocking: Promise.race with 3-second timeout
- Silent failure on network issues
Tier 3: Documentation
- README: Recommend
npx sequant@latestfor one-off usage - README: Add troubleshooting section for stale versions
Implementation Phases
Phase 1: Core Version Check (~2h)
- Create
src/lib/version-check.tswith:fetchLatestVersion()- fetch from npm registry with 3s timeoutcompareVersions()- semver comparisongetVersionWarning()- formatted warning message
- Add version check to
sequant doctor - Add
--quietflag to suppress warnings
Phase 2: Caching Layer (~1h)
- Create global cache at
~/.cache/sequant/version-check.json:{ "latestVersion": "1.5.3", "checkedAt": "2024-01-15T10:30:00Z" } - 24-hour cache expiry
- Integrate cached check into
sequant run
Phase 3: Documentation (~30m)
- Update README with:
- Recommendation to use
npx sequant@latest - Troubleshooting section for stale versions
- Recommendation to use
Acceptance Criteria
-
sequant doctorshows version comparison against npm registry -
sequant doctorprovides clear remediation steps when outdated -
sequant runshows warning when outdated (cached, max 1x per 24h) -
sequant run --quietsuppresses version warning - Version check has 3-second timeout
- Version check failures are silent (graceful degradation)
- Cache stored globally in
~/.cache/sequant/version-check.json - Works without
.sequant-manifest.json(pure npx usage)
Test Cases
- Up to date - No warning shown
- Outdated - Warning with remediation command
- Offline/timeout - Silent degradation, no error
- Cache fresh - Uses cached version, no fetch
- Cache expired - Re-fetches from registry
- --quiet flag - Suppresses version warning
What We're NOT Doing (Deferred)
These add complexity for marginal benefit:
Detect local vs npx installation- Just show remediation for bothDetect worktree-specific staleness- Same warning appliesCheck lockfile age- Version comparison is sufficientStatus command indicator- Doctor is the health check command
Prior Art
- npm: "Update available" banner
- Homebrew:
brew updatecheck - create-react-app: Global install staleness warning
Activity
feat(#81): add version freshness checks to guard against stale instal…
admarble commentedon Jan 14, 2026
/fullsolve Complete
Issue: #81
Status: READY_FOR_MERGE
Summary
Implemented version freshness checks to help users identify when they're running outdated versions of sequant.
Changes Made
New module:
src/lib/version-check.tsfetchLatestVersion()- fetch from npm registry with 3s timeoutcompareVersions()- semver comparisongetVersionWarning()- formatted warning with remediation stepsreadCache()/writeCache()- global cache management in~/.cache/sequant/isCacheFresh()- 24-hour cache expiry checkdoctor command: Shows thorough version check with remediation
run command: Shows cached version warning (max 1x per 24h)
--quietflagAcceptance Criteria
sequant doctorshows version comparisonsequant doctorprovides remediation stepssequant runshows cached warning (24h)sequant run --quietsuppresses warning~/.cache/sequant/version-check.jsonQuality Metrics
Iterations
PR: #84
Ready for human review and merge.
admarble commentedon Jan 14, 2026
QA Review for Issue #81
AC Coverage
sequant doctorshows version comparison against npm registrysequant doctorprovides clear remediation steps when outdatedsequant runshows warning when outdated (cached, max 1x per 24h)checkVersionCached()with 24h expirysequant run --quietsuppresses version warningVERSION_CHECK_TIMEOUT = 3000with AbortController~/.cache/sequant/version-check.json.sequant-manifest.json(pure npx usage)Coverage: 8/8 AC items fully met
Quality Metrics
any)Code Review
Strengths:
version-check.tsmodule with clear separation of concernsAbortControllersequant run(uses cached check)VersionCache,VersionCheckResult)Minor observations:
compareVersionsfunction is also implemented inmanifest.ts(added recently for downgrade protection). Could be unified, but duplication is harmless.No issues found.
Verdict: READY_FOR_MERGE
All 8 acceptance criteria are met with high code quality:
Documentation
Next Steps
/docs 81to generate any admin documentationQA performed by Claude Code