Skip to content

fix(cli): platform-aware doctor diagnostics and cobol wrapper resolution for the bundled CLI#199

Merged
theagenticguy merged 5 commits into
mainfrom
roadmap/install-diagnostics-final
Jun 6, 2026
Merged

fix(cli): platform-aware doctor diagnostics and cobol wrapper resolution for the bundled CLI#199
theagenticguy merged 5 commits into
mainfrom
roadmap/install-diagnostics-final

Conversation

@theagenticguy
Copy link
Copy Markdown
Owner

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/core failure paths handed a futile pnpm install hint even on win32-arm64 / musl, where no prebuilt ships. Extracted graphBindingPlatformNote() + GRAPH_BINDING_SUPPORTED_PLATFORMS into @opencodehub/storage (the source of truth GraphDbBindingError already used) and routed doctor's hints through lbugFailureHint() so the runtime error and the diagnostic never drift.

B — embedder binding probe

onnxruntime-node prebuilds skip darwin-x64 (Intel mac) and musl; the real failure is a silent degrade to BM25, not a crash. Added a non-fatal embedder native binding probe 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

resolveWrapperJavaSource now resolves dist/java/cobol_to_scip.java via an import.meta.url walk-up (mirroring resolveVendorWasmsDir), so npm users of codehub setup --cobol-proleap find the source #189 ships. Fixed the "not found" message to stop pointing at the unwired --java-source flag.

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, injectable exists). 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.

theagenticguy and others added 5 commits June 5, 2026 23:06
…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.
@theagenticguy theagenticguy merged commit 743aa98 into main Jun 6, 2026
42 checks passed
@theagenticguy theagenticguy deleted the roadmap/install-diagnostics-final branch June 6, 2026 04:46
@github-actions github-actions Bot mentioned this pull request Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant