fix(cli): platform-aware doctor diagnostics and cobol wrapper resolution for the bundled CLI#199
Merged
Merged
Conversation
…ion for the bundled CLI Three install-diagnostic fixes so the CLI tells the truth on unsupported platforms. A. doctor's three @ladybugdb/core failure paths handed a futile `pnpm install` hint even on win32-arm64 / musl where no prebuilt ships. Extract a shared helper in @opencodehub/storage (graphBindingPlatformNote + GRAPH_BINDING_SUPPORTED_PLATFORMS) — the single source of truth the runtime GraphDbBindingError already used — and have doctor emit platform-aware guidance via lbugFailureHint() so the two never drift. B. add a non-fatal embedder native-binding probe to doctor. onnxruntime-node prebuilds skip darwin-x64 and musl; the real failure is a silent degrade to BM25, not a crash. The probe mirrors the duckdb/lbug dynamic-import pattern, reports "retrieval will use BM25 only" + the platform note, and stays a warn (optional capability), gated by skipNative like the other native probes. C. resolveWrapperJavaSource now resolves dist/java via an import.meta.url walk-up (mirroring resolveVendorWasmsDir), so npm-installed users of `codehub setup --cobol-proleap` find the bundled cobol_to_scip.java shipped by #189. Fix the "wrapper Java source not found" message to stop pointing at an unwired --java-source flag. Tests: storage helper unit tests; doctor lbug-hint + embedder-probe tests; cobol wrapper-resolution tests across bundled/monorepo/legacy layouts.
resolve() re-anchors a drive-less path to process.cwd()'s drive on Windows (injecting C:/D:), making a module-relative resolver depend on the cwd — the test (windows-latest, 24) cell caught both fallback cases producing a drive-prefixed path. The candidates already join '..' segments lexically, so join() collapses them cwd-independently. Drops the now-unused resolve import.
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
Make install diagnostics tell the truth on unsupported platforms, and fix the COBOL wrapper path for the single-bundle CLI (#189).
A — doctor lbug hint is platform-aware
The three
@ladybugdb/corefailure paths handed a futilepnpm installhint even on win32-arm64 / musl, where no prebuilt ships. ExtractedgraphBindingPlatformNote()+GRAPH_BINDING_SUPPORTED_PLATFORMSinto@opencodehub/storage(the source of truthGraphDbBindingErroralready used) and routed doctor's hints throughlbugFailureHint()so the runtime error and the diagnostic never drift.B — embedder binding probe
onnxruntime-nodeprebuilds skip darwin-x64 (Intel mac) and musl; the real failure is a silent degrade to BM25, not a crash. Added a non-fatalembedder native bindingprobe mirroring the duckdb/lbug dynamic-import pattern:warn+ "retrieval will use BM25 only" + the platform note. Optional capability — gated by--skip-native, never escalates the exit code.C — cobol wrapper resolution in the bundled CLI
resolveWrapperJavaSourcenow resolvesdist/java/cobol_to_scip.javavia animport.meta.urlwalk-up (mirroringresolveVendorWasmsDir), so npm users ofcodehub setup --cobol-proleapfind the source #189 ships. Fixed the "not found" message to stop pointing at the unwired--java-sourceflag.Tests
Storage helper unit tests; doctor lbug-hint + embedder-probe (warn/ok/no-ctor) tests; cobol wrapper-resolution tests across bundled / monorepo / legacy layouts. Windows-portable (
path.join, injectableexists). Verified: storage 169 pass / 0 fail, cli 302 pass / 0 fail, tsc 0 errors, biome clean.Risk
Low. Diagnostic/messaging + a resolver walk-up; no change to analyze, the graph tier, or the embedder runtime path. The embedder probe is non-fatal by design.
🤖 Surfaced by an automated roadmap-survey workflow (the retry of a timed-out batch); implemented + verified in an isolated worktree, pushed from the main repo.