Repository navigation
fix(doctor): the bindings check takes a naming scope, and --json keeps stdout for the document - #1255
Merged
antoinetoussaint-byte merged 1 commit intoOct 30, 2026
Conversation
…s stdout for the document `doctor workspace` compared runnable-bindings with the preparation in the environment's declared naming scope only. Bindings generated for a run under `--naming-scope` resolve other addresses, so a workspace that runs under a scope could never pass doctor. Doctor now takes `--naming-scope`, read as `run` and `generate runnable-bindings` read it (omitted keeps the environment's, empty clears it), and the remedy names the scope. With `--json`, core's configuration reader logged its warnings on a context without a CLI logger, so they reached wool's fallback Console on stdout ahead of the report. `ProtectResultStream`, the guard the composition verbs already use, now also points wool's fallback at stderr, and doctor installs it under `--json`. Closes #1254 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 30, 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.
Two defects in
codefly doctor workspace(#1254)obin-ai/platform-core's composition gate (
scripts/composition-check.sh) found both.1. The runnable-bindings check used a naming scope it could not be told
CheckRunnableBindings(added in #1209) prepares the expected bindings withenv.NamingScope, the environment's declared scope. The gate generates the bindings with--naming-scope composition-gate, asrunandgenerate runnable-bindingsboth allow, so the addresses differ and doctor reportedrunnable-bindings is out of date (required by runtime/worker, robin/chat). On the same file,generate runnable-bindings --naming-scope composition-gate --checkpasses.Fix:
doctor workspace --naming-scope <scope>applies the scope to the selected environment the same wayrun/generate runnable-bindingsdo: if the flag is omitted, doctor uses the environment's declared scope; if it is passed empty, doctor clears it. The bindings check then compares against a run in that scope. The remedy text now comes from the generator's ownrunnableBindingsRegenerate(exported asRunnableBindingsRegenerateCommand), so it includes--naming-scopewhen one applies. Without the flag, behaviour is unchanged.2.
--jsonprinted log lines on stdout before the reportCore's configuration reader logs
composed modules disagree … configuration=fixture-compositiononcmd.Context(), which carries no wool provider. The line therefore went to wool's fallbackConsole, which writes to stdout.Fix: reuse
cli.ProtectResultStream, the guard the composition verbs already use for JSON on stdout. It now also points wool's fallback logger at stderr and restores it afterwards.doctor workspace --jsoninstalls the guard. With--json, stdout carries only the report and every log line goes to stderr.Reused:
cli.ProtectResultStream(stream guard),runnableBindingsRegenerate(remedy), and the run/generate naming-scope semantics. Not built: a second stdout guard, or a doctor-specific logger.Classification
Fix at the owning place. Doctor owns its flags and its JSON contract. The stream guard owns keeping result streams clean.
Gate reproduction: fresh clone of platform-core #119 at 58b1903
Ran the gate's steps from the start through
codefly generate runnable-bindings --env local --naming-scope composition-gate(materialize, config generate, hop seed, model installation; the delivery-key step was skipped). Output:Bound 182 runnable operation(s). No services were started.Before (v0.1.230,
03a6994b),codefly doctor workspace --json:After (this branch),
codefly doctor workspace --json --naming-scope composition-gate:After, without
--naming-scope: sameconfiguration_invalid … out of dateas before (default behaviour kept).Tests
TestDoctorChecksRunnableBindingsInTheNamedScope: bindings generated under scopegate-xpass withgate-x. They reportconfiguration_invalid(stale) without a scope or undergate-y, and each remedy names its scope. The test fails when the scope is not applied.TestDoctorWorkspaceJSONKeepsStdoutForTheReport: uses a two-module fixture-composition workspace that produces the real warning. stdout unmarshals as the report, and the warning is on stderr. The test fails without the fallback redirect.ProtectResultStreamtest now also logs a record with no provider and asserts that stdout stays empty.go build ./...,go test ./cmd ./cmd/generate/... ./cmd/composition/... ./cmd/deploy/... ./pkg/cli/..., andmake lint(0 issues) all pass.docs/cli-reference.mdwas regenerated.Not verified
go test ./pkg/.... The onlypkgpackage touched ispkg/cli.codefly run service …).workspaceReadinessOptionsis now passed by pointer, because the gocritic hugeParam check flagged it at 80 bytes.Closes #1254
🤖 Generated with Claude Code