Skip to content

test(ledgergate): keep violation messages as goldens (RIG-8124) - #101

Merged
rigel-nemo[bot] merged 1 commit into
mainfrom
go-migration/rig-8124-keep-violation-messages-as-goldens
Nov 22, 2026
Merged

rigel-nemo[bot] merged 1 commit into
mainfrom
go-migration/rig-8124-keep-violation-messages-as-goldens

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What does this do

Adds 18 frozen goldens under go/internal/ledgergate/testdata/ts-golden/, one per violation message the TypeScript ledger gate prints. Adds two golden_test.go files that compare the Go output to those bytes.

Why do we need it

The Go ledger gate must print the same violation messages as the TypeScript gate. The TypeScript gate retires with meissa #100, so its output has to be pinned now.

Summary

  • 18 goldens and MANIFEST.json, captured from the TypeScript gate at revision 9bc4735.
  • The goldens are frozen. They are not regenerated, and no golden file is edited after capture.
  • The capture tool is not in this PR. It retires with the TypeScript gate, and its sources exist only in git history.
  • This PR does not depend on chore(golden): retire the TS golden capture tool (RIG-5901) #100 and does not touch tools/.

Verification

  • CGO_ENABLED=0 go vet ./go/... passes.
  • CGO_ENABLED=0 go test ./go/internal/ledgergate/... ./go/cmd/design-ledger-gate/... passes, including TestGoldenViolationMessages and TestGoldenConfigLegacyExemptKey.
  • gofmt -l reports no files.

Risks

Low. The change adds test data and tests only. Because the goldens are frozen, changing a violation message means a deliberate decision to edit a frozen golden. Nothing regenerates them.

Spec-impact: none

Refs RIG-8124

Co-authored-by: Matt Wilkinson matt@rigel.build

Add 18 goldens under go/internal/ledgergate/testdata/ts-golden, one per
violation message the TypeScript gate prints. Each golden is the stderr
that production TypeScript printed at 9bc4735. A MANIFEST.json records
that revision for every golden.

The goldens are frozen. They are not regenerated and no golden file is
edited after capture. The capture tool (tools/golden/capture.ts) is not
part of this commit. It retires with the TypeScript gate, and its
sources exist only in git history.

Goldens list the duplicate-decision-id locus from runOnce's sorted read
order (ui before server). The TypeScript test asserts the locus from the
evaluate input order (server), so the golden does not pin that assertion.
The case where a record is parsed but its decision link does not resolve
is not in the Go set. Production readText and readRecord both call
resolve(root, path) on the same path, and recordPath is normalized in
decision-files.ts, so a listed record always resolves.

Refs RIG-8124
Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Nov 22, 2026

Copy link
Copy Markdown

RIG-8124

@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

All-clear at 3151a9b
Base: main

@rigel-nemo

rigel-nemo Bot commented Nov 22, 2026

Copy link
Copy Markdown

Checks read:

@rigel-nemo
rigel-nemo Bot merged commit f8d06b3 into main Nov 22, 2026
1 check passed
@rigel-nemo
rigel-nemo Bot deleted the go-migration/rig-8124-keep-violation-messages-as-goldens branch November 22, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant