Commit 8846fd5
feat(azure.ai.agents): scaffold doctor remote-check pipeline (P5.1 C10)
Wire the Cobra/runner pipe for remote (network-dependent) doctor
checks so commits C11-C17 can add individual checks (auth, foundry
endpoint reachability, RBAC, agent status) without touching the
doctor command's Cobra surface or runner internals.
Most of C10's framework was already in place from Phase 4:
- `Check.Remote bool` (runner.go:32-37)
- `Runner.Run` skips remote checks under `Options.LocalOnly`
(runner.go:74-82)
- `report.Remote = true` flipped whenever an executed check is
Remote (runner.go:128-130)
- `--local-only` / `--unredacted` flags bound on the Cobra surface
and threaded through `doctor.Options`
What was missing was the *factory slot* — a `NewRemoteChecks` mirror
of `NewLocalChecks` that the doctor command appends to its check
list. Without that slot the only place to add a remote check was the
command file itself, breaking the convention established by
`NewLocalChecks` (every doctor check lives in the `doctor` package;
the command file is plumbing only).
Changes
-------
* New `internal/cmd/doctor/checks_remote.go`:
- `NewRemoteChecks(deps Dependencies) []Check` — empty today;
documents the conventions C11+ remote checks must follow
(Remote: true, ctx cancellation, skip-cascade against the
local chain via `priorBlocked`, redaction discipline under
`!Options.Unredacted`).
- Names the four follow-up checks the slot is reserved for so
a future reader can immediately see the scope without
cross-referencing the plan: C11 auth, C12 foundry endpoint,
C16 RBAC, C17 agent status.
- Explicitly documents that local-checks-then-remote-checks
ordering is load-bearing for `priorBlocked` skip-cascade.
* `internal/cmd/doctor.go`:
- `runDoctor` now builds the runner from
`append(NewLocalChecks(deps), NewRemoteChecks(deps)...)`
instead of `NewLocalChecks(deps)` alone. Comment on the call
site pins the ordering contract.
- `doctorFlags` doc comment rewritten to describe today's
reality (the wire is fully exercised; remote-checks factory
is empty but populated transparently when C11+ land) instead
of the pre-C10 wording "no-op today, reserved for an upcoming
pass."
- `--local-only` and `--unredacted` user-visible help text
trimmed of internal plan-tracking jargon (no more "subsequent
commits" or "(P5 C11+)"). The first sentence now stands on
its own and reads cleanly under `--help`.
* `internal/cmd/doctor/types.go`:
- `Options.LocalOnly` doc comment updated from "no-op in phase 4
— no remote checks are wired yet" to match the new post-C10
reality (the factory returns empty today; the wire is
exercised).
* New `internal/cmd/doctor/checks_remote_test.go` (5 tests):
- `TestNewRemoteChecks_EmptyTodayButCallable` — pins the
contract; when C11 lands the empty-slice assertion fires and
forces the author to update the count.
- `TestNewLocalAndRemoteChecks_ProductionCompositionLocalsFirst`
— pins the load-bearing local-then-remote ordering by reading
the actual production factories (not synthesized checks).
Asserts (a) every check in NewLocalChecks has Remote=false,
(b) every check in NewRemoteChecks has Remote=true, (c) no
local check appears after any remote check in the combined
slice. Catches a future contributor swapping the append order
or forgetting the Remote flag on a remote check.
- `TestRunner_LocalThenRemote_RemoteSeesLocalPriorResults` —
asserts the runner preserves the slice order so a remote
check's `priorBlocked` guard reads the local results.
- `TestRunner_LocalOnly_AppendedRemoteCheck_NotInvoked` —
exercises the production-shaped `append(local, remote...)`
slice under `LocalOnly: true`.
- `TestRunner_RemoteCheck_RanProducesReportRemoteFlag` —
asserts `report.Remote = true` against the production-shaped
slice when a remote check executes.
User-visible behavior
---------------------
None. The remote-checks factory is empty, so:
- `azd ai agent doctor` produces the same 7-local-check report
it did before this commit.
- `azd ai agent doctor --local-only` produces the same 7-check
report (no remote checks to skip).
- `azd ai agent doctor --output json` envelope has `"remote":
false` (no remote check executed).
The change is exclusively in the *plumbing* for the follow-up
commits.
Preflight
---------
* gofmt -s -w . — clean
* go vet ./... — clean
* go build ./... — clean
* go test ./... -count=1 — green (cmd 15.0s, doctor 6.1s, nextstep
3.7s, etc.)
* golangci-lint run ./internal/cmd/... — 0 issues
* npx cspell lint "internal/cmd/doctor.go" "internal/cmd/doctor/**/*.go"
--relative --config ../../.vscode/cspell.yaml --no-progress —
0 issues across 7 files
Closes Phase 5 commit slot C10.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent a85dcfd commit 8846fd5
4 files changed
Lines changed: 288 additions & 19 deletions
File tree
- cli/azd/extensions/azure.ai.agents/internal/cmd
- doctor
Lines changed: 23 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
126 | | - | |
127 | | - | |
| 129 | + | |
| 130 | + | |
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
| |||
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
136 | | - | |
| 139 | + | |
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
| |||
171 | 174 | | |
172 | 175 | | |
173 | 176 | | |
174 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
175 | 185 | | |
176 | 186 | | |
177 | 187 | | |
| |||
Lines changed: 64 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
Lines changed: 194 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| |||
0 commit comments