Commit 4e293f7
fix(azure.ai.agents): align doctor types to design spec
Cross-checked the committed Phase 4.1 doctor types (`internal/cmd/doctor/
types.go`) against the JSON envelope contract in the design spec
(`cli/azd/docs/design/azd-ai-agent-nextsteps.md`, lines 357-383). Found
nine drift deltas. Per the user's "design spec is a guide, not a
contract — keep what's better" direction, this commit adopts the design's
unintentional-drift fixes and documents the deliberate improvements that
diverge from the spec.
Adopted from the design spec
- `CurrentSchemaVersion`: "1" → "1.0" (standard semver-ish form).
- New field `Result.Links []string` (`json:"links,omitempty"`) for
TSG / docs URLs surfaced by Phase 5 remote checks.
- New field `Result.DurationMs int64` (`json:"durationMs,omitempty"`)
populated by the runner via `time.Since(start).Milliseconds()`.
Observability for slow checks.
- `Report.Summary` JSON tag → `json:"-"`. Still computed in-memory and
consumed by `Report.ExitCode()`; not part of the wire format.
Consumers can compute it from `checks[]` if needed.
- Namespaced check IDs (e.g., `local.azure-yaml`, `remote.rbac`) called
out in doc comments. Phase 4.2 onward emits IDs in this form.
Kept as deliberate improvements over the design spec
- JSON tags `name`/`message`/`suggestion` retained (design uses
`title`/`detail`/`fix`). `name` is shorter and universal; `message`
is primary text vs `detail`'s "supplementary" connotation;
`suggestion` is broader than `fix` (covers warnings, not just
blocking failures).
- `Result.Details map[string]any` (`json:"details,omitempty"`) kept
as the design-spec extension for Phase 5 RBAC payloads (role lists,
scope ARNs, etc.). Doc comment now explicitly identifies this as a
documented extension.
Runner
- `runner.go` now wraps every `check.Fn(...)` call with `start :=
time.Now()` / `result.DurationMs = time.Since(start).
Milliseconds()`. Single integration point, applies uniformly to all
checks present and future.
Tests
- `TestRunner_Run_DurationMsIsPopulated` — 5ms sleep inside a check
function, asserts `DurationMs >= 1`. All 16 existing tests still
pass.
Cspell
- Added `nextsteps` override for `internal/cmd/doctor/types.go`.
Doc comments now reference the design doc filename
(`azd-ai-agent-nextsteps.md`), which trips the existing `nextstep`
(singular) entry.
No new review pass on this commit — same trivial align-to-design shape
as 4.1.1 (precedent: doc/contract cleanups land pre-validated).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 20f83ae commit 4e293f7
4 files changed
Lines changed: 56 additions & 18 deletions
File tree
- cli/azd
- .vscode
- extensions/azure.ai.agents/internal/cmd/doctor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
412 | 415 | | |
413 | 416 | | |
414 | 417 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
| 96 | + | |
93 | 97 | | |
| 98 | + | |
94 | 99 | | |
95 | 100 | | |
96 | 101 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
322 | 323 | | |
323 | 324 | | |
324 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
Lines changed: 30 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
65 | | - | |
66 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
67 | 75 | | |
68 | 76 | | |
69 | 77 | | |
| |||
81 | 89 | | |
82 | 90 | | |
83 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
84 | 97 | | |
85 | 98 | | |
86 | 99 | | |
87 | 100 | | |
88 | 101 | | |
89 | | - | |
| 102 | + | |
90 | 103 | | |
91 | 104 | | |
92 | 105 | | |
| |||
0 commit comments