fix: reword misleading 'stale' warning in info command#510
Conversation
The native version mismatch between npm package and binary is cosmetic — the package version is authoritative. Replace alarming 'stale' label with 'cosmetic only' to avoid confusion.
|
Claude finished @carlos-alm's task —— View job PR Review AnalysisTodo List:
Root Cause AnalysisProblem Being Solved: Users were confused by the word "stale" in Why This Approach: Rewording from "stale" to "cosmetic only" directly addresses the confusion without changing functionality. The binary works correctly regardless of version string mismatch. Risk Assessment: Extremely low risk. Pure message improvement with no behavioral changes. Backlog Compliance
Critical ConcernsNone. This is a straightforward UX improvement. Code Quality Assessment
Final Recommendation
The PR author correctly identified a UX pain point and applied the most surgical fix possible. The test plan is appropriate for a diagnostic message change. |
Greptile SummaryThis PR rewrites one diagnostic string in Key observations:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant InfoCmd as info command
participant Native as infrastructure/native.js
participant Parser as domain/parser.js
User->>InfoCmd: codegraph info
InfoCmd->>Native: isNativeAvailable()
Native-->>InfoCmd: true / false
InfoCmd->>Parser: getActiveEngine({ engine })
Parser-->>InfoCmd: { name, version }
alt native is available
InfoCmd->>Native: loadNative()
Native-->>InfoCmd: native addon (loaded OK)
InfoCmd->>Native: native.engineVersion()
Native-->>InfoCmd: binaryVersion string
InfoCmd->>Native: getNativePackageVersion()
Native-->>InfoCmd: pkgVersion string
alt pkgVersion !== binaryVersion
InfoCmd->>User: "Native version: {pkgVersion} (binary built as {binaryVersion}, engine loaded OK)"
else versions match
InfoCmd->>User: "Native version: {pkgVersion}"
end
end
InfoCmd->>InfoCmd: try open DB, read build metadata
InfoCmd->>User: build metadata (engine, version, built_at) + stale warnings if applicable
Last reviewed commit: "Merge branch 'fix/in..." |
src/cli/commands/info.js
Outdated
| if (pkgVersion && knownBinaryVersion && pkgVersion !== knownBinaryVersion) { | ||
| console.log( | ||
| ` Native version: ${pkgVersion} (binary reports ${knownBinaryVersion} — stale)`, | ||
| ` Native version: ${pkgVersion} (binary built as ${knownBinaryVersion}, cosmetic only)`, |
There was a problem hiding this comment.
"cosmetic only" may over-reassure in edge cases
The phrase cosmetic only implies the engine is always unaffected by the version mismatch. However, if the npm wrapper package and the compiled binary diverge across a breaking native-API change (e.g., a napi-rs interface update), the mismatch could affect runtime behaviour, not just a display string.
A slightly more precise label would scope the claim to what the code actually knows — that the binary loaded without error — without asserting that all mismatches are harmless:
| ` Native version: ${pkgVersion} (binary built as ${knownBinaryVersion}, cosmetic only)`, | |
| ` Native version: ${pkgVersion} (binary built as ${knownBinaryVersion}, engine loaded OK)`, |
This keeps the friendly tone ("not a crash") while avoiding a blanket guarantee that the PR description itself doesn't establish.
There was a problem hiding this comment.
Fixed — changed to engine loaded OK as suggested, which scopes the claim to what the code actually verifies (that the binary loaded without error) without asserting all mismatches are harmless.
…smatch Scopes the reassurance to what the code actually verifies — that the binary loaded without error — rather than implying all mismatches are harmless.
…degraph into fix/info-stale-warning
Summary
codegraph infocommand showed(binary reports X.Y.Z — stale)when the npm package version differed from the binary's compiled-in version, even though the engine works correctly(binary built as X.Y.Z, cosmetic only)to clarify this is a harmless version-string mismatch, not a broken engineTest plan
codegraph infowith a native engine where package and binary versions differ — confirm new wording appearscodegraph infowith matching versions — confirm no parenthetical note