Repository navigation
refactor(kuna): decide Kuna readiness once for doctor and runtime - #10997
Merged
Merged
Conversation
Runtime availability admitted Kuna from its settings and a runnable command, while doctor also required a passing version probe and cache inspection, so doctor could report Kuna unavailable while runtime admitted it. admitKunaCommand is now the one readiness decision: provider availability, the installation inspection and doctor's installation check all project it. Doctor reports the version probe and the cache inspection as separate health checks (version, cache) beside admission; they no longer decide availability, and runtime still does not pay for them. Setup continues to list Kuna as a ready provider only when every check passes.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
[Medium impact] The PR appears safe to merge; no blocking issue was found. SummaryKuna now shares one readiness decision between runtime and doctor.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["admitKunaCommand: settings and executable file"] --> B["Runtime availability"]
A --> C["Doctor installation check"]
C --> D["Doctor version health check"]
C --> E["Doctor cache health check"]
C --> F["Setup ready list"]
D --> F
E --> F
F --> G["Include Kuna only when every check passes"]
Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
# Conflicts: # tests/boundary/providers/kuna/kunaDoctor.test.ts
22 tasks
| diagnostics: { configured: true, command }, | ||
| }); | ||
| try { | ||
| accessSync(command, constants.X_OK); |
| }); | ||
| try { | ||
| accessSync(command, constants.X_OK); | ||
| if (!statSync(command).isFile()) |
This was referenced Nov 15, 2026
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.
Summary
Kuna readiness is now one decision shared by runtime availability and
rea doctor: valid settings and aREA_KUNA_COMMANDthat is an executable regular file. Doctor reports its version probe and cache inspection as separate health checks beside that decision instead of folding them into availability.Problem and expected behavior
KunaProvider.inspectAvailabilityadmitted Kuna from its settings and an executable command, while doctor'savailablealso required a successfulkuna --versionprobe and a usable cache root. The two disagreed: with a command whose version probe fails, or a cache root that is a file, doctor reported Kuna unavailable while the runtime provider reported it available. Each also kept its own copy of the settings-to-failure mapping and the executable check.Expected: doctor's availability equals runtime's. The probes runtime does not pay for at readiness remain visible in doctor as labelled health checks.
Change and scope
src/kuna/KunaAdmission.ts(admitKunaCommand): reads the Kuna configuration and checks the command is an executable regular file; it launches nothing and touches no cache.KunaProvider.inspectAvailabilityprojects the admission (its ownaccessSync/statSynccopy and the unusedcommand_not_filedocument code are removed).inspectKunaInstallationstarts from the admission (its configuration-failure mapping and access/stat checks are removed; it keepsrealpathfor the executable identity, then fingerprints and probes as before). An already-cancelled caller is checked before admission, preserving the existing pre-abort test.inspectKunaProvider(doctor):availableand theinstallationcheck come from the admission. When admitted, it adds aversionhealth check (the existing probe, fingerprint and cleanup/cancellation handling) and acachehealth check; neither changesavailable.docs/kuna-provider.mddocuments the readiness decision and the two health checks.Not changed:
rea setupstill lists Kuna as a ready provider only when every Kuna check passes (the intent of f5d1012, #5105), so a blocked cache still keeps Kuna out of setup's ready list whileavailablereports true.Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.
Contract and boundary impact
admitKunaCommandowns Kuna readiness; provider availability, the installation inspection and doctor project it.rea doctor --jsonKuna inspection:availablenow follows admission; checks areinstallation(admission; its ok detail names the command),version(moved frominstallation: version, sha256, verified-version note) andcache(unchanged). Projected doctor check names becomekuna-prefixedinstallation,version,cache. Runtime availability diagnostics for a refused setting gainsetting. No tool-catalog change.versioncheck.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
kunaDoctor.test.tsadds "agrees with runtime availability" for a failing version probe, a non-executable command and a missing command (doctoravailableequalsKunaProvider.inspectAvailability(), and a refusal carries the runtime's code, reason and remediation). Existing doctor, setup-readiness, hash-owner and CLI setup tests updated for theversioncheck and for cache health no longer decidingavailable.src/kunarestored).available: truewith a failedcachecheck; a Kuna whose--versionfails reportsavailable: truewith a failedversioncheck (version_unresolved).For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.
For evidence-bearing changes:
Validation performed
npm run test:focused -- tests/boundary/providers/kuna/kunaDoctor.test.ts— 20 passed (7 fail with the basesrc/kuna).npm run test:focused -- tests/boundary/providers/kuna/kunaSetupReadiness.test.ts tests/boundary/cli/setupProviderReadiness.test.ts tests/boundary/providers/kuna/kunaProvider.test.ts tests/boundary/providers/kuna/kunaSelectedCommand.test.ts tests/boundary/providers/kuna/kunaVersionProbeOwnership.test.ts tests/boundary/providers/kuna/kunaInstallationLifetime.test.ts tests/boundary/providers/kuna/kunaInstallationAttribution.test.ts tests/boundary/providers/kuna/kunaInstallationCancellation.test.ts tests/boundary/providers/readinessRemediationInventory.test.ts src/doctorRuntime.test.ts tests/boundary/providers/kuna/kunaCommandFailures.test.ts— 121 passed, 1 skipped.npm run test:focused -- tests/boundary/providers/kuna/kunaHashOwnerPropagation.test.ts tests/boundary/providers/kuna/kunaInstallation.test.ts tests/boundary/cli/setupProviderReadiness.test.ts tests/boundary/providers/kuna/kunaSetupReadiness.test.ts— 43 passed.npm run check:fast— passed.npm run docs:check— passed.node scripts/verify/architecture-guards.mjs— passed.Compatibility, safety, and release
installationcheck now find it on theversioncheck;availableno longer reflects cache or version-probe health.Author readiness
Human owner:
Before merge
type(scope): outcome.