fix: CLI doctor reports engines bundled in an installed app (#209) - #217
Merged
drawmeanelephant merged 2 commits intoAug 26, 2026
Merged
drawmeanelephant merged 2 commits into
drawmeanelephant merged 2 commits into
Conversation
…elephant#209) A bare-machine CLI has no bundle of its own, so doctor warned 'not found — builtin' even when an installed BANAL.app carried boris and oliver in Contents/Helpers. The CLI speaks for the machine: after the locator chain comes up empty, doctor consults ~/Applications/BANAL.app then /Applications/BANAL.app. The probes stay out of the locator's injectable auxiliary list — they are machine-global, and default-injection tests must stay isolated from whatever is installed on the host. Doctor-only by design: publish keeps the plain locator chain, so a bare-CLI publish matches the app's own engine choice rather than borrowing an installed app's bundle.
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.
Follow-up to the bundled helpers (#209 / #211).
Problem
banal doctoron a consumer machine — no boris/oliver on PATH, none configured — warnsnot found — builtin HTML will be usedeven when an installed BANAL.app carries both engines inContents/Helpers. The CLI is a bare executable: itsBundle.mainhas no Helpers, so the locator chain (configured → this-bundle → env → PATH → sibling checkout) comes up empty, and doctor under-reports what the machine can actually do.Approach
One new tier, doctor-only, after the existing chain:
BundledHelper.installedAppHelperURLs(named:)probes~/Applications/BANAL.app/Contents/Helpers/<name>then/Applications/..., and doctor's engine checks consult it when the locator returns nil.Two deliberate boundaries, both adversarially reviewed:
executables(). They are machine-global (any installed app), so the locator's default-injection tests (testLocatorReturnsNilWhenIsolated& co.) must not see them. Verified: full suite green with a staged installed app present on the host, and green without one.banal publishdelegates engine choice to the publisher's own locators — a bare-CLI publish matches the app's engine rules rather than silently borrowing a GUI app's bundled copies. Doctor reports machine capability; publish does the app's work. (Same-machine divergence — doctorokwhile publish saysbuiltin— is the honest outcome of that split; noted in the CHANGELOG.)Sibling-checkout precedence over the installed app is unchanged and verified live: a dev hacking on boris keeps winning.
Verification (DEVELOPER_DIR=Xcode-beta)
~/Applications/BANAL.app(the isolation proof).swift build -Xswiftc -warnings-as-errors— clean.env -i PATH=/usr/bin:/bin, bare vault:warn, exit 64okwith the Helpers paths, contract ok, exit 0;--jsonreports"ok": truetestInstalledAppHelperProbesAreMachineGlobalNotBundledpins the probe shape (two candidates, user-local first) and their absence from the bundle-local list.Adversarial gate held the branch until its findings were folded: the first version's test was dead (file-scope, never discovered — now inside the class and strengthened), the doc comment promised a publish path that didn't exist (now doctor-only and true), and the commit subject now matches the house convention.