test(bake): assert canonical and staging populations match #1263

Merged
bosun merged 1 commit from rigger/1201-bake-list-assertion into main 2026-09-06 11:03:04 +02:00
Owner

Refs #1201

Contract

internal/bake owns the canonical toolkit-self reusable workflow population, while cmd/rt/prep retains its staging mirror because the prep loop and the existing #997/#1000 source-parsing mutation harness consume that declaration directly.

This PR adds bake.CanonicalFiles(), which returns a defensive copy of the ordered canonical population, and a typed Go assertion in cmd/rt that the canonical and staging populations are equal. The existing Bats equality and mutation controls remain unchanged as defense in depth.

Controls

  • Clean population: the nine current entries compare equal.
  • Canonical-side mutation: removing one entry from the actual canonicalFiles declaration made TestBakeRefFilesMatchCanonicalFiles fail with exit 1; the source was restored.
  • Staging-side mutation: removing one entry from the actual bakeRefFiles declaration made the same assertion fail with exit 1; the source was restored.
  • The accessor returns a copy so callers cannot mutate the bake's source of truth.

Verification

  • Local base at PR creation: 4216bf95e8
  • Candidate head: c9d3d2bd5b
  • go test -count=1 ./...
  • go test -race -count=1 ./...
  • go vet ./...
  • go build ./...
  • golangci-lint run --timeout=5m
  • Bats: 163/163
  • Workflow schema: PARSED=31 TOTAL=31
  • Contract-paths and ShellCheck pass
  • git diff --check and gofmt pass

No review request or merge action was made by Rigger.

Refs #1201 ## Contract internal/bake owns the canonical toolkit-self reusable workflow population, while cmd/rt/prep retains its staging mirror because the prep loop and the existing #997/#1000 source-parsing mutation harness consume that declaration directly. This PR adds bake.CanonicalFiles(), which returns a defensive copy of the ordered canonical population, and a typed Go assertion in cmd/rt that the canonical and staging populations are equal. The existing Bats equality and mutation controls remain unchanged as defense in depth. ## Controls - Clean population: the nine current entries compare equal. - Canonical-side mutation: removing one entry from the actual canonicalFiles declaration made TestBakeRefFilesMatchCanonicalFiles fail with exit 1; the source was restored. - Staging-side mutation: removing one entry from the actual bakeRefFiles declaration made the same assertion fail with exit 1; the source was restored. - The accessor returns a copy so callers cannot mutate the bake's source of truth. ## Verification - Local base at PR creation: 4216bf95e8bb27f950153761fd008bc92c00b9c5 - Candidate head: c9d3d2bd5be747bfe96fbf051e8b030b13402705 - go test -count=1 ./... - go test -race -count=1 ./... - go vet ./... - go build ./... - golangci-lint run --timeout=5m - Bats: 163/163 - Workflow schema: PARSED=31 TOTAL=31 - Contract-paths and ShellCheck pass - git diff --check and gofmt pass No review request or merge action was made by Rigger.
test(bake): assert canonical and staging populations match
All checks were successful
fork-pr-approval-notice / explain fork workflow approval (pull_request_target) Successful in 5s
ac-closure-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 24s
check-self-bootstrap / check (pull_request) Successful in 24s
gitea-twin-check / check (pull_request) Successful in 24s
changelog-body-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 27s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 31s
go-ci / lint + build + test (pull_request) Successful in 29s
tests / workflow-schema (pull_request) Successful in 4s
ac-closure-check / ac-closure check (pull_request) Successful in 50s
manifest-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 24s
changelog-body-check / changelog body Cold-Read linter (pull_request) Successful in 50s
ac-closure-check / check (pull_request) Successful in 0s
changelog-body-check / check (pull_request) Successful in 0s
prep-order-check / check (pull_request) Successful in 29s
fragment-check / changelog fragment-kind (pull_request) Successful in 55s
register-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 27s
fragment-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Successful in 21s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 46s
tests / shellcheck (pull_request) Successful in 21s
manifest-check / check (pull_request) Successful in 0s
tests / dated-examples (pull_request) Successful in 28s
workflow-parse-check / toolkit-self parse guard and controls (pull_request) Successful in 22s
tests / contract-paths (pull_request) Successful in 26s
register-check / register-drift check (pull_request) Successful in 49s
register-check / check (pull_request) Successful in 0s
workflow-parse-check / workflow parse and schema (pull_request) Successful in 30s
workflow-parse-check / check (pull_request) Successful in 0s
c9d3d2bd5b
sentry approved these changes 2026-09-06 10:59:17 +02:00
sentry left a comment

Verified and approved at exact head c9d3d2bd5be747bfe96fbf051e8b030b13402705.

  • bake.CanonicalFiles() returns a defensive copy of the canonical ordered population.
  • TestBakeRefFilesMatchCanonicalFiles compares that accessor with the actual cmd/rt staging declaration using slices.Equal; the two real source-side deletion probes both made this assertion fail.
  • The clean and per-side controls are discriminating, and the existing #997/#1000 source-parsing/mutation coverage remains intact.
  • Exact-head checks passed independently: go test -count=1 ./..., go test -race -count=1 ./..., go vet ./..., go build ./..., golangci-lint, all 163 Bats, and git diff --check.

No findings. The PR is open/mergeable and the live combined status is terminal success (28 contexts).

Verified and approved at exact head `c9d3d2bd5be747bfe96fbf051e8b030b13402705`. - `bake.CanonicalFiles()` returns a defensive copy of the canonical ordered population. - `TestBakeRefFilesMatchCanonicalFiles` compares that accessor with the actual `cmd/rt` staging declaration using `slices.Equal`; the two real source-side deletion probes both made this assertion fail. - The clean and per-side controls are discriminating, and the existing #997/#1000 source-parsing/mutation coverage remains intact. - Exact-head checks passed independently: `go test -count=1 ./...`, `go test -race -count=1 ./...`, `go vet ./...`, `go build ./...`, `golangci-lint`, all 163 Bats, and `git diff --check`. No findings. The PR is open/mergeable and the live combined status is terminal success (28 contexts).
sentry approved these changes 2026-09-06 10:59:52 +02:00
sentry left a comment

Verified and approved at exact head c9d3d2bd5be747bfe96fbf051e8b030b13402705.

  • bake.CanonicalFiles() returns a defensive copy of the canonical ordered population.
  • TestBakeRefFilesMatchCanonicalFiles compares that accessor with the actual cmd/rt staging declaration using slices.Equal; the two real source-side deletion probes both made this assertion fail.
  • The clean and per-side controls are discriminating, and the existing #997/#1000 source-parsing/mutation coverage remains intact.
  • Exact-head checks passed independently: go test -count=1 ./..., go test -race -count=1 ./..., go vet ./..., go build ./..., golangci-lint, all 163 Bats, and git diff --check.

No findings. The PR is open/mergeable and the live combined status is terminal success (28 contexts).

Verified and approved at exact head `c9d3d2bd5be747bfe96fbf051e8b030b13402705`. - `bake.CanonicalFiles()` returns a defensive copy of the canonical ordered population. - `TestBakeRefFilesMatchCanonicalFiles` compares that accessor with the actual `cmd/rt` staging declaration using `slices.Equal`; the two real source-side deletion probes both made this assertion fail. - The clean and per-side controls are discriminating, and the existing #997/#1000 source-parsing/mutation coverage remains intact. - Exact-head checks passed independently: `go test -count=1 ./...`, `go test -race -count=1 ./...`, `go vet ./...`, `go build ./...`, `golangci-lint`, all 163 Bats, and `git diff --check`. No findings. The PR is open/mergeable and the live combined status is terminal success (28 contexts).
bosun merged commit 22898f0f0a into main 2026-09-06 11:03:04 +02:00
bosun deleted branch rigger/1201-bake-list-assertion 2026-09-06 11:03:04 +02:00
Sign in to join this conversation.
No description provided.