Repository navigation
fix(coverage): resolve UAT wiring from the reservation registry - #2138
Conversation
|
Welcome to AICR, @Dhirenderchoudhary! Thanks for your first pull request. Before review, please ensure:
A maintainer will review this soon. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe coverage generator now reads UAT enrollment, cloud pipeline phases, shared UAT libraries, and nightly version inputs. It reports distinct stub causes and fails on invalid wiring. Matrix construction returns errors before rendering. Tests add fixture-backed regression coverage. Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/user/coverage-matrix.md`:
- Line 18: Update the coverage-matrix rendering for the stub rows: when
noteJourneyStepDisabled applies, display “GPU (H100, real)” and “nightly”; when
noteIntentNotEnrolled applies, retain “GPU (unwired)” and “—”.
In `@tools/coverage/build_test.go`:
- Around line 507-517: Replace the equalStrings helper and its call site with
the standard library slices.Equal function, adding the slices import to
tools/coverage/build_test.go. Remove the now-unused equalStrings function and
preserve the existing comparison behavior.
In `@tools/coverage/scan.go`:
- Around line 64-65: Update the UAT scanning flow around scanVerbs and the
shared tests/uat/lib target so it includes only function bodies for phases
enabled by each enrolled lane’s wiredUAT.lane.phases, rather than all
shared-library commands whenever runners exist. Ensure unknown or invalid phase
configuration fails closed. Add coverage for an enrolled train phase and
disabled serve phase containing a unique CLI verb, verifying only the train verb
is reported.
- Around line 49-68: Update scanVerbs and BuildMatrix to propagate a structured
error when any enrolled runner path or the gated tests/uat/lib target is
missing, rather than relying on walkSignalFiles to skip it. Preserve normal
scanning for existing targets, and ensure callers receive the error so
incomplete coverage cannot produce a successful matrix.
In `@tools/coverage/wiring.go`:
- Line 257: Update the os.Open call in the coverage wiring code so the rationale
is a separate ordinary comment immediately before it, and leave //nolint:gosec
alone on its own line. Preserve the existing suppression and
repository-relative-path rationale while making the directive self-contained.
- Around line 193-199: Update the phase detection around phaseRef and the
wf.Jobs step iteration to ignore shell-commented command lines before matching
runner invocations. Ensure lines whose executable content begins with # do not
populate phases, while valid commands continue to be detected; add a fixture and
assertion confirming a commented runner command produces no UAT coverage, with
ambiguous or disabled signals failing closed.
- Around line 256-268: Update BuildMatrix and readBoundedFile to accept and
propagate a timeout-bounded context using the project’s named timeout default,
and use context-aware I/O for opening and reading files. Before reading,
validate the target is a supported regular file and reject special files or
symlink-resolved unsupported types.
- Around line 181-183: Validate the computed relative workflow path in the
surrounding wiring function before joining it with repoRoot: call
filepath.IsLocal on the native relative path derived from cloud and return the
established structured invalid-request error when validation fails. Keep the
existing readBoundedFile flow unchanged for local paths, and do not replace this
check with substring-based validation.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 3436042f-751d-4709-8de8-53d5f56d38ca
📒 Files selected for processing (10)
.github/workflows/merge-gate.yamlMakefiledocs/user/coverage-matrix.mdtools/coverage/build.gotools/coverage/build_test.gotools/coverage/main.gotools/coverage/model.gotools/coverage/render.gotools/coverage/scan.gotools/coverage/wiring.go
| func readBoundedFile(path, rel string) ([]byte, error) { | ||
| f, err := os.Open(path) //nolint:gosec // fixed repo-relative path under the repo root | ||
| if err != nil { | ||
| return nil, errors.Wrap(errors.ErrCodeNotFound, "open "+rel, err) | ||
| } | ||
| defer func() { _ = f.Close() }() | ||
|
|
||
| data, err := io.ReadAll(io.LimitReader(f, maxScanFileBytes+1)) | ||
| if err != nil { | ||
| return nil, errors.Wrap(errors.ErrCodeInternal, "read "+rel, err) | ||
| } | ||
| if int64(len(data)) > maxScanFileBytes { | ||
| return nil, errors.New(errors.ErrCodeInvalidRequest, rel+" exceeds the scan size limit") |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
Bound read time as well as read size.
io.LimitReader limits bytes only. os.Open or io.ReadAll can block indefinitely on a special file reached through a repository symlink.
Thread a timeout-bounded context from BuildMatrix into file reads. Reject unsupported file types before reading them.
As per coding guidelines, all I/O operations must use a timeout-bounded context and named defaults.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tools/coverage/wiring.go` around lines 256 - 268, Update BuildMatrix and
readBoundedFile to accept and propagate a timeout-bounded context using the
project’s named timeout default, and use context-aware I/O for opening and
reading files. Before reading, validate the target is a supported regular file
and reject special files or symlink-resolved unsupported types.
Source: Coding guidelines
| // against the repo-relative name rel. Bounded rather than os.ReadFile so an | ||
| // unexpectedly huge (or symlinked) input cannot balloon the generator. | ||
| func readBoundedFile(path, rel string) ([]byte, error) { | ||
| f, err := os.Open(path) //nolint:gosec // fixed repo-relative path under the repo root |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
Keep the nolint directive self-contained.
Move the rationale to a normal comment before the directive. Keep //nolint:gosec on its own line.
Based on learnings, directive-shaped comments must be self-contained because gofmt can separate continuation text from the directive.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tools/coverage/wiring.go` at line 257, Update the os.Open call in the
coverage wiring code so the rationale is a separate ordinary comment immediately
before it, and leave //nolint:gosec alone on its own line. Preserve the existing
suppression and repository-relative-path rationale while making the directive
self-contained.
Source: Learnings
d693818 to
d7307ae
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tools/coverage/build_test.go`:
- Around line 343-346: Update the rowByItem assertion for
"cuj2-inference-dynamo" to retain and validate its ok result before inspecting
r.Harnesses[HarnessUAT]. Fail the test when the row is absent, then preserve the
existing negative UAT-coverage assertion for an existing row.
In `@tools/coverage/wiring.go`:
- Around line 194-211: Update the phaseRef pattern used in the phase scan to
match valid phase tokens containing digits, hyphens, or underscores, while
preserving the existing cloud-specific path and command boundary. Ensure phases
such as “cuj2-serve” are captured so the downstream phases map and runsJourney
logic receive the correct enabled phase.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 42c24872-5347-4823-9002-3b893584da23
📒 Files selected for processing (4)
tools/coverage/build.gotools/coverage/build_test.gotools/coverage/scan.gotools/coverage/wiring.go
Signed-off-by: Dhirender Choudhary <[email protected]>
21530e3 to
34f506f
Compare
njhensley
left a comment
There was a problem hiding this comment.
Review — multi-persona + adversarial meta-review
Method: four independent persona reviewers (Correctness · CI/Operability · Domain & Architecture · Test-coverage), then an adversarial senior meta-reviewer that re-derived every finding against the resolved code at 34f506f6.
Legend: 🔴 Blocker · 🟠 Major · 🟡 Minor · 🔵 Nitpick
Overall — Approve with comments
Well-reasoned, well-tested fix for a real silent-downgrade bug (#1977). The old generator regex-scraped uat-*.yaml for literal tests/uat/<cloud>/tests/<name>.yaml config paths that no longer exist after the reservation-registry rewrite, so it saw zero wired lanes and quietly demoted every UAT row. The rewrite sources each fact from the artifact that owns it — which lanes/intents from infra/uat/reservations.yaml (via pkg/uatbroker), which phases from the per-cloud pipelines decoded as YAML — fails closed on unresolvable inputs, and gates freshness in both make qualify and the merge gate.
Verified the honesty contract against the real files: all four pipelines (aws/gcp/azure/kind) enable train and comment out serve, so cuj1→covered and cuj2→stubbed with the accurate journey-step-disabled note. The test suite is strong (86.2%; all three advertised mutations genuinely caught; the fail-closed table's error substrings all match real errors). No blockers, no majors.
Two 🟡 (both latent, not live in the current tree) and three 🔵 are inline / below.
Additional nitpicks (anchor to unchanged lines, so noted here)
- 🔵 Verb-level UAT coverage doesn't honor disabled phases —
tools/coverage/scan.go#L193.scanVerbsreadsphases.shas one blob, so a verb reachable only from a disabled phase function would still be UAT-covered — asymmetric with the phase-gated CUJ rows. Harmless today (phase_servehas noaicrinvocation); latent if a serve-only verb is added later. - 🔵
looksLikeTextbranch has 0% coverage —tools/coverage/scan.go#L181. Extensionless text-sniff path is never walked; a one-line extensionless-script fixture undertests/chainsaw/would close it. - 🔵
kindsingle-GPU nvkind collapses into the coarse "GPU (H100, real)" class —tools/coverage/build.go. The hardware/cadence columns union all lanes, so today enrolling kind flips no verdict; latent overclaim only if a future intent runs only on the kind lane. Not introduced by this PR.
Confirmed non-issues (examined, cleared)
- Refuted — "axis prose overclaims by ignoring
nightly-intent-min-versions": the premise was wrong — v0.18.0 and v0.19.0 are both shipped, so the>= v0.18.0gate is satisfied by the previous-release cell; and the generator usesNightlyIntentsOrDefault, neverEligibleNightlyIntents, so the min-version gate never touches the matrix. Prose is accurate. readBoundedFilebounded-read pattern is correct (LimitReader(f, max+1),>maxreject; read-onlyCloseignored per repo rules).yaml:"on"tag decodes correctly under yaml.v3 (no YAML 1.1 boolean-alias issue).- Determinism holds (sorted clouds, membership-only maps). All-opted-out registry → zero lanes with no error is correct-by-design, not fail-open.
coverage-freshness/-skipare mutually exclusive over the boolean paths-filter output; the aggregate gate can't deadlock; pinned SHAs; no network/cluster/tool deps ("in-repo signals only" confirmed — noos/exec,net/http, orgo build).pkg/uatbrokercoupling is the correct dependency direction and eliminates schema drift; the paths-filter watches every signal the generator reads.
Summary
🔴 Blocker 0 · 🟠 Major 0 · 🟡 Minor 2 · 🔵 Nitpick 3 — Approve with comments. Neither 🟡 is live in the current tree; both are cheap hardening opportunities, not merge blockers.
| w.runners = append(w.runners, r) | ||
| if len(phases) == 0 { | ||
| return nil, errors.New(errors.ErrCodeNotFound, | ||
| rel+" declares no enabled UAT runner step, but its cloud is enrolled in the nightly batch") |
There was a problem hiding this comment.
🟡 Minor — Fail-closed on a fully-commented enrolled pipeline breaks every local make qualify
When an enrolled cloud (non-empty nightly-intents in reservations.yaml) has ALL runner steps commented out in its uat-<cloud>.yaml, scanLanePhases returns this error → BuildMatrix fails → make coverage-check exits 1. Because coverage-check is wired into qualify UNCONDITIONALLY (Makefile:296) — unlike the path-filtered merge-gate job — this breaks every developer's make qualify regardless of what they changed, until the state is reconciled.
Blast radius: The realistic trigger is contrived (the real disabled-serve case keeps train enabled), so this is design tension rather than a bug — but the opt-out that fixes it (nightly-intents: [] on that cloud's reservation) is documented only in reservations.yaml, not at this error site or the Makefile.
Fix: Name the opt-out in the error string (or the coverage-check Makefile comment) so a pipeline maintenance window doesn't turn into a confusing toolchain-wide make qualify failure. Optionally degrade a single otherwise-reachable lane to a stubbed row rather than a hard BuildMatrix error.
| // commented line inside one survives into step.Run and would otherwise | ||
| // read as an executed phase. | ||
| for _, line := range strings.Split(step.Run, "\n") { | ||
| if strings.HasPrefix(strings.TrimSpace(line), "#") { |
There was a problem hiding this comment.
🟡 Minor — scanLanePhases only strips full-line comments — a trailing/echo-embedded runner ref is a false phase match
This filter skips a line only when its trimmed prefix is # (full-line comment), then runs phaseRef against the whole surviving line. A trailing inline comment or echo-embedded reference — e.g. echo done # ./tests/uat/aws/run serve "${TEST_CONFIG}" — registers serve as executed (reproduced independently by two reviewers as map[serve:true]), flipping cuj2-inference-dynamo from stubbed to covered and claiming real GPU-nightly coverage that never ran. This is exactly the comment-block false-credit the YAML-decode design exists to prevent — the fix went halfway.
Blast radius: Latent, not live: today's disabled serve steps are full YAML comment blocks (stripped by yaml.Unmarshal before reaching step.Run) and enabled steps are bare invocations, so nothing triggers it in-repo. A future contributor disabling a phase with an inline comment would silently over-report the journey.
Fix: Cut each line at its first unquoted # before matching (or anchor the match to the line's first command token), and add a trailing-comment-only case to TestShellCommentedPhaseIsNotExecuted.
| return VersionAxis{}, errors.New(errors.ErrCodeNotFound, | ||
| nightlyBatchRelPath+" declares no "+previousNInput+" input; the version axis cannot be derived") | ||
| } | ||
| n, err := strconv.Atoi(input.Default) |
There was a problem hiding this comment.
🔵 Nitpick — Version axis reads the workflow_dispatch input default, not the cron's || '1' fallback (comment misstates GHA semantics)
scanVersionAxis reads on.workflow_dispatch.inputs.previous_n.default, and the comment above claims the cron uses that default. It does not: on a schedule event the inputs context is empty and workflow_dispatch defaults are NOT applied — which is precisely why uat-nightly-batch.yaml uses a separate literal PREVIOUS_N: ${{ inputs.previous_n || '1' }}. The true scheduled value is the || '1' fallback, not the input default.
Blast radius: Both literals are '1' today so the rendered prose is correct, and the freshness gate reads the same default so CI stays green even under drift — only a human reader is misled if someone bumps one literal and not the other. Cosmetic doc prose.
Fix: Source the axis from the || 'N' fallback the cron actually uses (or assert the two literals agree and fail closed on mismatch), and correct the comment about GitHub schedule/inputs semantics.
Resolve merge-gate.yaml conflict by keeping both coverage-freshness and docs-mdx path filters. Signed-off-by: Dhirender Choudhary <[email protected]>
Strip trailing shell comments before phase matching, name the nightly-intents opt-out in the empty-pipeline error, and require the schedule || 'N' fallback to agree with the dispatch default. Signed-off-by: Dhirender Choudhary <[email protected]>
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Thanks for the thorough review really helpful. Addressed both yellows and the version-axis nit in
Also merged |
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (3)
tools/coverage/wiring.go (2)
188-189: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winValidate the derived workflow path before joining it to
repoRoot.
cloudcomes from the reservation registry and buildsrel. A traversal segment makesfilepath.Joinresolve outside the repository. Check the native relative path withfilepath.IsLocaland return a structured invalid-request error when the check fails.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tools/coverage/wiring.go` around lines 188 - 189, Validate the derived rel path immediately after constructing it in the workflow-loading flow, before joining it with repoRoot. Use filepath.IsLocal on the native relative path and, when validation fails, return the established structured invalid-request error; otherwise preserve the existing readBoundedFile call.
320-334: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftBound read time as well as read size.
io.LimitReadercaps bytes only.os.Openandio.ReadAllcan block on a special file reached through a repository symlink. Pass a timeout-bounded context fromBuildMatrixinto the file reads, and reject non-regular files before reading.As per coding guidelines, "All I/O operations need context with timeout".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tools/coverage/wiring.go` around lines 320 - 334, The readBoundedFile flow currently limits bytes but not I/O duration and accepts special files. Update BuildMatrix to create and pass a timeout-bounded context into each file read, change readBoundedFile to use that context and abort reads when it expires, and validate the opened path with FileInfo.Mode().IsRegular() before io.ReadAll, returning an appropriate error for non-regular files.Source: Coding guidelines
tools/coverage/scan.go (1)
71-72: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftShared-library verbs are still not filtered by enabled phases.
scanTargetsadds all oftests/uat/libwhen any runner is enrolled.wiredUAT.lanes[].phasesis not consulted here, so a CLI verb that only appears in a disabled phase function reads as UAT-covered.scanCUJapplies the phase gate for CUJ rows, but CLI verb rows keep the unfiltered signal.Scan only the shared function bodies for phases enabled on an enrolled lane. Add a test with an enabled
trainphase and a disabledservephase that contains a unique CLI verb.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tools/coverage/scan.go` around lines 71 - 72, Update scanTargets and the shared-library scanning flow to consult each enrolled lane’s wiredUAT.lanes[].phases, scanning only function bodies belonging to enabled phases; prevent CLI verbs defined exclusively in disabled phases from being reported as UAT-covered. Add coverage for an enabled train phase and disabled serve phase containing a unique CLI verb, asserting the disabled-phase verb is excluded.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/merge-gate.yaml:
- Around line 175-200: Add `.github/workflows/merge-gate.yaml` to the `coverage`
filter’s watched paths so changes to the `coverage-freshness` job definition
trigger that gate, matching the existing self-gating behavior of the `deps` and
`docs` filters.
In `@tools/coverage/model.go`:
- Around line 88-92: Update the comment above PreviousReleases to state that
scheduled runs use the literal `${{ inputs.previous_n || 'N' }}` fallback
because the schedule event has no inputs, rather than the workflow input
default. Keep the explanation that zero runs main only and ensure the documented
fallback agrees with scanVersionAxis.
In `@tools/coverage/wiring.go`:
- Around line 238-254: Update stripShellComment so backslash escape handling
applies only inside double quotes or outside quotes, never while inSingle is
true. Preserve skipping the next character for those permitted contexts,
allowing literal backslashes in single-quoted text and escaped # characters
outside quotes to avoid starting a comment.
---
Duplicate comments:
In `@tools/coverage/scan.go`:
- Around line 71-72: Update scanTargets and the shared-library scanning flow to
consult each enrolled lane’s wiredUAT.lanes[].phases, scanning only function
bodies belonging to enabled phases; prevent CLI verbs defined exclusively in
disabled phases from being reported as UAT-covered. Add coverage for an enabled
train phase and disabled serve phase containing a unique CLI verb, asserting the
disabled-phase verb is excluded.
In `@tools/coverage/wiring.go`:
- Around line 188-189: Validate the derived rel path immediately after
constructing it in the workflow-loading flow, before joining it with repoRoot.
Use filepath.IsLocal on the native relative path and, when validation fails,
return the established structured invalid-request error; otherwise preserve the
existing readBoundedFile call.
- Around line 320-334: The readBoundedFile flow currently limits bytes but not
I/O duration and accepts special files. Update BuildMatrix to create and pass a
timeout-bounded context into each file read, change readBoundedFile to use that
context and abort reads when it expires, and validate the opened path with
FileInfo.Mode().IsRegular() before io.ReadAll, returning an appropriate error
for non-regular files.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 7a168e3a-9ac6-498a-95ff-480b1cb8dcda
📒 Files selected for processing (10)
.github/workflows/merge-gate.yamlMakefiledocs/user/coverage-matrix.mdtools/coverage/build.gotools/coverage/build_test.gotools/coverage/main.gotools/coverage/model.gotools/coverage/render.gotools/coverage/scan.gotools/coverage/wiring.go
Self-gate coverage-freshness via merge-gate.yaml, align the PreviousReleases comment with the schedule fallback, tighten stripShellComment escapes, and reject non-local UAT cloud paths. Signed-off-by: Dhirender Choudhary <[email protected]>
|
@Dhirenderchoudhary, please ensure your commits are |
|
@njhensley Verified and signed |
|
@Dhirenderchoudhary, please address linting issues. Should be good to go after that. |
Signed-off-by: Dhirender Choudhary <[email protected]>
97e6469 to
fc82377
Compare
|
FIxed lint CI failures |
njhensley
left a comment
There was a problem hiding this comment.
All good on my end — approving! ✅
Everything from the review is now buttoned up:
- Fail-closed opt-out names nightly-intents: [] in both the error string and the Makefile comment — no more mystery make qualify failures during pipeline maintenance. 👍
- Comment stripping got a proper quote/backslash-aware stripShellComment with its own TestStripShellComment plus a trailing-comment case in TestShellCommentedPhaseIsNotExecuted. Closes the false-credit gap cleanly.
- Version axis now reads the real || 'N' schedule fallback and asserts it agrees with the dispatch default (fails closed on drift), with the GHA semantics fixed in the comment and the model.go godoc.
- gofmt — confirmed fixed in fc82377; lint is clean now.
Re-verified against the real repo: go test ./tools/coverage/... -race passes (including TestRepoUATLanesAreVisible), and coverage-matrix.md regenerates byte-identical and stable across runs. The filepath.IsLocal guard and merge-gate self-gating hunk are both correct too.
Really thorough follow-through on every point — thanks for that. 🚀
Summary
The coverage-matrix generator went blind to the nightly UAT lanes after the reservation-registry rewrite, so
make coverage-docssilently downgraded every UAT row. Rewires the scanner to read the registry and the per-cloud pipelines directly, and gates matrix freshness at PR time.Motivation / Context
Regenerating
docs/user/coverage-matrix.mdon currentmaindropsuatfrom 6 rows and demotesevidence verifyfromcovered/nightlytonot-yet-covered. The committed page was only accurate because nobody regenerated it — #1967 hand-edited it rather than running the generator.Two independent causes:
uatConfigRefmatched a literaltests/uat/<cloud>/tests/<name>.yamlin the workflows. None remain — the pipelines buildTEST_CONFIGfrom inputs resolved out of the reservation registry, sowired.intentscame back empty.tests/uat/*/runare shims that sourcetests/uat/lib/phases.sh. Scanning only the shims found noaicrinvocations at all. The one row that keptuat(validate) was matching prose inside a comment inaws/run, not a real invocation.Fixes: #1977
Related: #1967, #1644
Type of Change
Component(s) Affected
cmd/aicr,pkg/cli)cmd/aicrd,pkg/server)pkg/recipe)pkg/bundler,pkg/component/*)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/)tools/coverage,.github/workflows/merge-gate.yaml,MakefileImplementation Notes
Each fact now comes from the artifact that owns it.
infra/uat/reservations.yaml(viapkg/uatbroker) answers which lanes and intents the nightly batch dispatches; the per-clouduat-<cloud>.yamlpipelines answer which runner phases are enabled steps.tests/uat/libbecomes a UAT signal root, gated on there being at least one enrolled lane so an inert library can't read as live coverage.Both scans fail closed. Returning an empty result on a moved registry or a renamed input is indistinguishable from "nothing is wired" — that's the exact silent downgrade this generator exists to prevent, and the old fail-open behaviour is why this rotted unnoticed.
Journey coverage requires both halves. A reservation enrolled for the intent and its pipeline actually executing the journey's workload phase. This is the one judgment call worth review: once the scanner reads the registry,
cuj2-inference-dynamowants to flip tocovered, because inference is enrolled nightly on aws/gcp/azure/gb200. Butserveis commented out in all four pipelines (#1644) — the stack is deployed and validated, the journey never runs. Marking itcoveredwould trade this issue's false negative for a false positive and then lock that into the merge gate, so it staysstubbedwith a note pointing at the disabled step instead of the current one citing DC3/DC6, both closed.Decoding the pipelines as YAML rather than grepping is what makes that readable: a commented-out step is absent from the parsed document, where a raw-text scan matches its invocation verbatim.
Version axis is derived from
uat-nightly-batch.yaml'sprevious_ninstead of the hardcoded "the live axis today ismain" claim, which stopped being true when the multi-version matrix landed.Freshness gating:
coverage-checkjoinsmake qualify, and acoverage-freshness/-skipjob pair joins the merge gate (mirroringbom-freshness), watching every signal source. The generator reads only in-repo signals — no network, no cluster — so unlikebom-checkit's cheap enough to gate directly.Net effect on the committed matrix: the 6 UAT rows are restored and now reproducible (the CLI-verb table regenerates byte-identical to what was committed), the version-axis paragraph is corrected, and
cuj2-inferencekeeps an accurate note.Testing
All green.
golangci-lintreports 0 issues module-wide.Coverage delta —
tools/coverage: 82.2% → 85.5% (+3.3%).I mutation-tested the new guards to confirm they aren't vacuous (each mutation reverted after):
tests/uat/libscan target (the original bug)TestBuildMatrixStatusFromSignals,TestUATVerbsResolveThroughSharedPhaseLibrary,TestRepoUATLanesAreVisibleTestJourneyStepDisabledIsNotCoveredTestBuildMatrixFailsClosedTestRepoUATLanesAreVisibleruns the real scanner against the real repo as a standing anti-rot guard — if the registry moves or the phase commands migrate out oftests/uat/libagain, it fails there instead of silently downgrading the next regeneration.Two caveats on the full suite: I could not run
make qualifyend to end (e2eandscanneed Docker + registry access I don't have locally), and fullmake testhas pre-existing failures inpkg/oci(TestHelmV4_2_3ExplicitVersionPull) andtests/releasepolicy(needs GNUtimeout, absent on macOS). I confirmed the identical failure set on unmodifiedorigin/main, so neither is from this change. Leaving those to CI.Risk Assessment
The generator change itself is isolated and revertible, but this adds a new blocking merge-gate job, so a false positive there would block unrelated PRs.
Rollout notes:
coverage-freshnessonly fires on PRs touching the matrix inputs (the doc,tools/coverage,pkg/cli,pkg/uatbroker,infra/uat/reservations.yaml, theuat-*.yamlpipelines,tests/uat,tests/chainsaw,demos,Makefile); everything else hits the-skipcompanion. The failure message names the fix (make coverage-docsand commit). No migration, no flags, backwards compatible — revert the workflow hunk to disable the gate without touching the generator.Checklist
make testwith-race) — see the caveat above on two pre-existing env failuresmake lint)git commit -S)