From 3151a9b42a2d33d6366a1ed439b6fa3f2805990c Mon Sep 17 00:00:00 2001 From: mintaka Date: Sat, 21 Nov 2026 22:39:06 -0500 Subject: [PATCH] test(ledgergate): keep violation messages as goldens (RIG-8124) 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 9bc47354. 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 --- go/cmd/design-ledger-gate/golden_test.go | 39 ++++ go/internal/ledgergate/run/golden_test.go | 214 ++++++++++++++++++ .../testdata/ts-golden/MANIFEST.json | 24 ++ .../testdata/ts-golden/anchor-not-found.txt | 4 + .../ts-golden/config-legacy-exempt-key.txt | 1 + .../ts-golden/decision-area-mismatch.txt | 4 + .../ts-golden/duplicate-decision-id.txt | 4 + .../ts-golden/historical-outside-chain.txt | 4 + .../ts-golden/large-record-without-anchor.txt | 4 + .../malformed-or-prohibited-status.txt | 4 + .../ts-golden/merge-conflict-marker.txt | 6 + .../ts-golden/no-valid-decision-file.txt | 4 + .../record-link-does-not-resolve.txt | 4 + .../status-disagrees-with-decision.txt | 4 + .../status-supersession-unresolved.txt | 5 + .../ts-golden/superseded-by-itself.txt | 4 + .../supersession-cycle-independent.txt | 5 + .../testdata/ts-golden/supersession-cycle.txt | 4 + .../ts-golden/supersession-missing-target.txt | 4 + .../touch-coupling-branch-prefix.txt | 4 + .../ts-golden/touch-coupling-declaration.txt | 4 + 21 files changed, 350 insertions(+) create mode 100644 go/cmd/design-ledger-gate/golden_test.go create mode 100644 go/internal/ledgergate/run/golden_test.go create mode 100644 go/internal/ledgergate/testdata/ts-golden/MANIFEST.json create mode 100644 go/internal/ledgergate/testdata/ts-golden/anchor-not-found.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/config-legacy-exempt-key.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/decision-area-mismatch.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/duplicate-decision-id.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/historical-outside-chain.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/large-record-without-anchor.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/malformed-or-prohibited-status.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/merge-conflict-marker.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/no-valid-decision-file.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/record-link-does-not-resolve.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/status-disagrees-with-decision.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/status-supersession-unresolved.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/superseded-by-itself.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/supersession-cycle-independent.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/supersession-cycle.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/supersession-missing-target.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/touch-coupling-branch-prefix.txt create mode 100644 go/internal/ledgergate/testdata/ts-golden/touch-coupling-declaration.txt diff --git a/go/cmd/design-ledger-gate/golden_test.go b/go/cmd/design-ledger-gate/golden_test.go new file mode 100644 index 0000000..419d7ff --- /dev/null +++ b/go/cmd/design-ledger-gate/golden_test.go @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +package main + +import ( + "os" + "path/filepath" + "strings" + "testing" +) + +// TestGoldenConfigLegacyExemptKey compares the CLI's stderr for a legacy +// exemption key to the TypeScript golden for the same config. +func TestGoldenConfigLegacyExemptKey(t *testing.T) { + config := filepath.Join(t.TempDir(), "config.json") + body := `{"designsRoot":"docs/designs","surfaceDepth":1,` + + `"counter":{"url":"x","partition":"p"},"exemptBranchPrefixes":[]}` + err := os.WriteFile(config, []byte(body), 0o600) + if err != nil { + t.Fatal(err) + } + var stdout, stderr strings.Builder + code := Main(t.Context(), []string{"--config", config}, func(string) string { return "" }, &stdout, &stderr) + if code != 2 { + t.Fatalf("exit = %d, want 2; stderr:\n%s", code, stderr.String()) + } + if stdout.Len() != 0 { + t.Fatalf("stdout = %q, want empty", stdout.String()) + } + want, err := os.ReadFile(filepath.Join( + "..", "..", "internal", "ledgergate", "testdata", "ts-golden", "config-legacy-exempt-key.txt", + )) + if err != nil { + t.Fatal(err) + } + if stderr.String() != string(want) { + t.Fatalf("stderr mismatch\n got: %q\nwant: %q", stderr.String(), want) + } +} diff --git a/go/internal/ledgergate/run/golden_test.go b/go/internal/ledgergate/run/golden_test.go new file mode 100644 index 0000000..81d08c7 --- /dev/null +++ b/go/internal/ledgergate/run/golden_test.go @@ -0,0 +1,214 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +//nolint:exhaustruct_v5,lll // Keep TS-derived fixtures direct; the goldens are the contract. +package run + +import ( + "os" + "path" + "path/filepath" + "slices" + "strings" + "testing" + + "github.com/samber/mo" + + "github.com/RigelBuild/meissa/go/internal/ledgergate/core" +) + +const ( + goldenDecisionDir = "docs/designs/decisions" + goldenRecordPath = "docs/designs/ui/record/design.md" + goldenServerRec = "docs/designs/server/record/design.md" + goldenOtherRec = "docs/designs/server/other/design.md" + goldenNextRec = "docs/designs/ui/next/design.md" + goldenSmallBody = "# Record\n\nBody\n" + goldenActive = "Active (Matt, 2026-07-22)" +) + +// goldenConfig is the TypeScript CONFIG fixture: depth zero, eight governed roots. +func goldenConfig() core.Config { + return core.Config{ + DesignsRoot: gateDesignsRoot, + SurfaceDepth: 0, + GovernedRoots: []string{"ui", "agent", "server", "meta", "infra", "observability", "repo", "gamma"}, + Counter: core.Counter{URL: "https://example.invalid/counter", Partition: "test"}, + } +} + +// goldenDecision builds one decision file in the TS decisionText shape. +func goldenDecision(id, status, record string) string { + return strings.Join([]string{ + "---", + "id: " + id, + `decision: "Use the stable design."`, + `status: "` + status + `"`, + "record: " + record, + "---", + "# Decision", + "", + "Use the stable design.", + "", + }, "\n") +} + +// goldenPath is the decision file for id in area, the TS decisionFile path. +func goldenPath(id, area string) string { + return path.Join(goldenDecisionDir, area, id+".md") +} + +// goldenFiles maps paths to text. Every path in it is readable, as the TS +// readRecord stub makes every record path readable. +type goldenFiles map[string]string + +// goldenCase is one TS fixture. The golden holds the full stderr the TS CLI +// printed. listed names the paths the TS listDesignFiles returned; the rest of +// files are readable but not listed, as in the TS fixture. +type goldenCase struct { + name string + files goldenFiles + listed []string + cfg core.Config + changed core.Changed + wantExit int +} + +// goldenCases lists the 17 messages Once prints. The CLI config case is in cmd. +func goldenCases() []goldenCase { + ui := goldenConfig() + historical := goldenConfig() + historical.HistoricalChain = []string{} + uiDecision := goldenPath("DL-001", "ui") + return []goldenCase{ + {name: "duplicate-decision-id", wantExit: 1, cfg: ui, + files: goldenFiles{ + goldenPath("DL-001", "ui"): goldenDecision("DL-001", goldenActive, "../../ui/record/design.md"), + goldenPath("DL-001", "server"): goldenDecision("DL-001", goldenActive, "../../server/other/design.md"), + goldenRecordPath: goldenSmallBody, + goldenOtherRec: goldenSmallBody, + }, + listed: []string{goldenPath("DL-001", "ui"), goldenPath("DL-001", "server")}}, + {name: "supersession-missing-target", wantExit: 1, cfg: ui, + files: goldenFiles{ + uiDecision: goldenDecision("DL-001", "Superseded by DL-999 (Matt, 2026-07-22)", "../../ui/record/design.md"), + goldenRecordPath: goldenSmallBody, + }, + listed: []string{uiDecision}}, + {name: "superseded-by-itself", wantExit: 1, cfg: ui, + files: goldenFiles{ + uiDecision: goldenDecision("DL-001", "Superseded by DL-001 (Matt, 2026-07-22)", "../../ui/record/design.md"), + goldenRecordPath: goldenSmallBody, + }, + listed: []string{uiDecision}}, + {name: "supersession-cycle", wantExit: 1, cfg: ui, + files: goldenFiles{ + goldenPath("DL-001", "ui"): goldenDecision("DL-001", "Superseded by DL-002 (Matt, 2026-07-22)", "../../ui/record/design.md"), + goldenPath("DL-002", "ui"): goldenDecision("DL-002", "Superseded by DL-003 (Matt, 2026-07-22)", "../../ui/record/design.md"), + goldenPath("DL-003", "ui"): goldenDecision("DL-003", "Superseded by DL-004 (Matt, 2026-07-22)", "../../ui/record/design.md"), + goldenPath("DL-004", "ui"): goldenDecision("DL-004", "Superseded by DL-003 (Matt, 2026-07-22)", "../../ui/record/design.md"), + goldenRecordPath: goldenSmallBody, + }, + listed: []string{goldenPath("DL-001", "ui"), goldenPath("DL-002", "ui"), goldenPath("DL-003", "ui"), goldenPath("DL-004", "ui")}}, + {name: "supersession-cycle-independent", wantExit: 1, cfg: ui, + files: goldenFiles{ + goldenPath("DL-001", "ui"): goldenDecision("DL-001", "Superseded by DL-002 (Matt, 2026-07-22)", "../../ui/record/design.md"), + goldenPath("DL-002", "ui"): goldenDecision("DL-002", "Superseded by DL-001 (Matt, 2026-07-22)", "../../ui/record/design.md"), + goldenPath("DL-003", "ui"): goldenDecision("DL-003", "Superseded by DL-004 (Matt, 2026-07-22)", "../../ui/record/design.md"), + goldenPath("DL-004", "ui"): goldenDecision("DL-004", "Superseded by DL-003 (Matt, 2026-07-22)", "../../ui/record/design.md"), + goldenRecordPath: goldenSmallBody, + }, + listed: []string{goldenPath("DL-001", "ui"), goldenPath("DL-002", "ui"), goldenPath("DL-003", "ui"), goldenPath("DL-004", "ui")}}, + {name: "anchor-not-found", wantExit: 1, cfg: ui, + files: goldenFiles{ + uiDecision: goldenDecision("DL-001", goldenActive, "../../ui/record/design.md#missing"), + goldenRecordPath: "# Present\n\nBody\n", + }, + listed: []string{uiDecision}}, + {name: "record-link-does-not-resolve", wantExit: 1, cfg: ui, + files: goldenFiles{uiDecision: goldenDecision("DL-001", goldenActive, "../../ui/record/design.md")}, + listed: []string{uiDecision}}, + {name: "large-record-without-anchor", wantExit: 1, cfg: ui, + files: goldenFiles{ + uiDecision: goldenDecision("DL-001", goldenActive, "../../ui/record/design.md"), + goldenRecordPath: strings.Repeat("x", 50*1024+1), + }, + listed: []string{uiDecision}}, + {name: "decision-area-mismatch", wantExit: 1, cfg: ui, + files: goldenFiles{ + uiDecision: goldenDecision("DL-001", goldenActive, "../../server/record/design.md"), + goldenServerRec: goldenSmallBody, + }, + listed: []string{uiDecision}}, + {name: "malformed-or-prohibited-status", wantExit: 1, cfg: ui, + files: goldenFiles{ + uiDecision: goldenDecision("DL-001", goldenActive, "../../ui/record/design.md"), + goldenRecordPath: "# Title\n\nStatus: Draft\n", + }, + listed: []string{uiDecision, goldenRecordPath}}, + {name: "historical-outside-chain", wantExit: 1, cfg: historical, + files: goldenFiles{ + uiDecision: goldenDecision("DL-001", goldenActive, "../../ui/record/design.md"), + goldenRecordPath: "# Title\n\nStatus: Historical\n", + }, + listed: []string{uiDecision, goldenRecordPath}}, + {name: "status-disagrees-with-decision", wantExit: 1, cfg: ui, + files: goldenFiles{ + uiDecision: goldenDecision("DL-001", goldenActive, "../../ui/record/design.md"), + goldenRecordPath: "# Title\n\nStatus: Superseded by ../next/design.md\n", + goldenNextRec: goldenSmallBody, + }, + listed: []string{uiDecision, goldenRecordPath}}, + {name: "status-supersession-unresolved", wantExit: 1, cfg: ui, + files: goldenFiles{ + uiDecision: goldenDecision("DL-001", goldenActive, "../../ui/record/design.md"), + goldenRecordPath: "# Title\n\nStatus: Superseded by ../next/design.md\n", + }, + listed: []string{uiDecision, goldenRecordPath}}, + {name: "no-valid-decision-file", wantExit: 1, cfg: ui, + files: goldenFiles{ + uiDecision: goldenDecision("DL-001", goldenActive, "../../ui/record/design.md"), + goldenServerRec: "# Title\n", + goldenRecordPath: goldenSmallBody, + }, + listed: []string{uiDecision, goldenServerRec}}, + {name: "touch-coupling-declaration", wantExit: 1, cfg: ui, + files: goldenFiles{uiDecision: goldenDecision("DL-001", goldenActive, "../../ui/record/design.md"), goldenRecordPath: goldenSmallBody}, + listed: []string{uiDecision, goldenRecordPath}, + changed: core.Changed{Files: []string{goldenRecordPath}, Body: mo.Some("unrelated text"), HeadBranch: "feature/change"}}, + {name: "touch-coupling-branch-prefix", wantExit: 1, cfg: ui, + files: goldenFiles{uiDecision: goldenDecision("DL-001", goldenActive, "../../ui/record/design.md"), goldenRecordPath: goldenSmallBody}, + listed: []string{uiDecision, goldenRecordPath}, + changed: core.Changed{Files: []string{goldenRecordPath}, Body: mo.Some(""), HeadBranch: "feature/renovate/x"}}, + {name: "merge-conflict-marker", wantExit: 1, cfg: ui, + files: goldenFiles{ + uiDecision: goldenDecision("DL-001", goldenActive, "../../ui/record/design.md") + "\n<<<<<<< HEAD\n=======\n>>>>>>> theirs", + goldenRecordPath: goldenSmallBody, + }, + listed: []string{uiDecision}}, + } +} + +// TestGoldenViolationMessages compares the full stderr of Once to each TS golden. +func TestGoldenViolationMessages(t *testing.T) { + for _, tc := range goldenCases() { + t.Run(tc.name, func(t *testing.T) { + fake := newGateFake(tc.files) + fake.paths = slices.Clone(tc.listed) + fake.changed = tc.changed + code, stdout, stderr := runGate(t, fake, tc.cfg) + if code != tc.wantExit { + t.Fatalf("exit = %d, want %d; stderr:\n%s", code, tc.wantExit, stderr) + } + if stdout != "" { + t.Fatalf("stdout = %q, want empty", stdout) + } + want, err := os.ReadFile(filepath.Join("..", "testdata", "ts-golden", tc.name+".txt")) + if err != nil { + t.Fatal(err) + } + if stderr != string(want) { + t.Fatalf("stderr mismatch\n got: %q\nwant: %q", stderr, want) + } + }) + } +} diff --git a/go/internal/ledgergate/testdata/ts-golden/MANIFEST.json b/go/internal/ledgergate/testdata/ts-golden/MANIFEST.json new file mode 100644 index 0000000..2b27cca --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/MANIFEST.json @@ -0,0 +1,24 @@ +{ + "revision": "9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "provenance": "Captured from the TypeScript ledger gate at revision 9bc47354. These goldens are frozen and are not regenerated. The capture tool retires with the TypeScript gate; its sources exist only in git history.", + "goldens": { + "duplicate-decision-id.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "supersession-missing-target.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "superseded-by-itself.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "supersession-cycle.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "supersession-cycle-independent.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "anchor-not-found.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "record-link-does-not-resolve.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "large-record-without-anchor.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "decision-area-mismatch.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "malformed-or-prohibited-status.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "historical-outside-chain.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "status-disagrees-with-decision.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "status-supersession-unresolved.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "no-valid-decision-file.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "touch-coupling-declaration.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "touch-coupling-branch-prefix.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "merge-conflict-marker.txt": "exit=1 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99", + "config-legacy-exempt-key.txt": "exit=2 revision=9bc47354cc2cafc2ecab2f4e61aa8070deb45b99" + } +} diff --git a/go/internal/ledgergate/testdata/ts-golden/anchor-not-found.txt b/go/internal/ledgergate/testdata/ts-golden/anchor-not-found.txt new file mode 100644 index 0000000..cbbc2e2 --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/anchor-not-found.txt @@ -0,0 +1,4 @@ + +design-ledger-gate: 1 violation(s): + docs/designs/decisions/ui/DL-001.md:5: DL-001: Record link #anchor not found in ../../ui/record/design.md: #missing + diff --git a/go/internal/ledgergate/testdata/ts-golden/config-legacy-exempt-key.txt b/go/internal/ledgergate/testdata/ts-golden/config-legacy-exempt-key.txt new file mode 100644 index 0000000..a1f67c1 --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/config-legacy-exempt-key.txt @@ -0,0 +1 @@ +design-ledger-gate: Config key "exemptBranchPrefixes" is no longer supported; use exemptBranches diff --git a/go/internal/ledgergate/testdata/ts-golden/decision-area-mismatch.txt b/go/internal/ledgergate/testdata/ts-golden/decision-area-mismatch.txt new file mode 100644 index 0000000..5f5728c --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/decision-area-mismatch.txt @@ -0,0 +1,4 @@ + +design-ledger-gate: 1 violation(s): + docs/designs/decisions/ui/DL-001.md:5: DL-001: decision area must match its Record path (docs/designs/server/record/design.md) + diff --git a/go/internal/ledgergate/testdata/ts-golden/duplicate-decision-id.txt b/go/internal/ledgergate/testdata/ts-golden/duplicate-decision-id.txt new file mode 100644 index 0000000..cda0335 --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/duplicate-decision-id.txt @@ -0,0 +1,4 @@ + +design-ledger-gate: 1 violation(s): + docs/designs/decisions/ui/DL-001.md:2: DL-001: duplicate decision id (also defined in docs/designs/decisions/server/DL-001.md) + diff --git a/go/internal/ledgergate/testdata/ts-golden/historical-outside-chain.txt b/go/internal/ledgergate/testdata/ts-golden/historical-outside-chain.txt new file mode 100644 index 0000000..1060755 --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/historical-outside-chain.txt @@ -0,0 +1,4 @@ + +design-ledger-gate: 1 violation(s): + docs/designs/ui/record/design.md:3: `Status: Historical` but the record is not in the configured historical chain + diff --git a/go/internal/ledgergate/testdata/ts-golden/large-record-without-anchor.txt b/go/internal/ledgergate/testdata/ts-golden/large-record-without-anchor.txt new file mode 100644 index 0000000..90396d9 --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/large-record-without-anchor.txt @@ -0,0 +1,4 @@ + +design-ledger-gate: 1 violation(s): + docs/designs/decisions/ui/DL-001.md:5: DL-001: Record link into a large record must carry a #anchor: ../../ui/record/design.md + diff --git a/go/internal/ledgergate/testdata/ts-golden/malformed-or-prohibited-status.txt b/go/internal/ledgergate/testdata/ts-golden/malformed-or-prohibited-status.txt new file mode 100644 index 0000000..9391b82 --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/malformed-or-prohibited-status.txt @@ -0,0 +1,4 @@ + +design-ledger-gate: 1 violation(s): + docs/designs/ui/record/design.md:3: malformed or prohibited `Status:` header + diff --git a/go/internal/ledgergate/testdata/ts-golden/merge-conflict-marker.txt b/go/internal/ledgergate/testdata/ts-golden/merge-conflict-marker.txt new file mode 100644 index 0000000..c3b5db6 --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/merge-conflict-marker.txt @@ -0,0 +1,6 @@ + +design-ledger-gate: 3 violation(s): + docs/designs/decisions/ui/DL-001.md:11: unresolved merge conflict marker: <<<<<<< + docs/designs/decisions/ui/DL-001.md:12: unresolved merge conflict marker: ======= + docs/designs/decisions/ui/DL-001.md:13: unresolved merge conflict marker: >>>>>>> + diff --git a/go/internal/ledgergate/testdata/ts-golden/no-valid-decision-file.txt b/go/internal/ledgergate/testdata/ts-golden/no-valid-decision-file.txt new file mode 100644 index 0000000..3bec8e6 --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/no-valid-decision-file.txt @@ -0,0 +1,4 @@ + +design-ledger-gate: 1 violation(s): + docs/designs/decisions/server: docs/designs/server/ has records but no valid decision file in decisions/server/ + diff --git a/go/internal/ledgergate/testdata/ts-golden/record-link-does-not-resolve.txt b/go/internal/ledgergate/testdata/ts-golden/record-link-does-not-resolve.txt new file mode 100644 index 0000000..82293b6 --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/record-link-does-not-resolve.txt @@ -0,0 +1,4 @@ + +design-ledger-gate: 1 violation(s): + docs/designs/decisions/ui/DL-001.md:5: DL-001: Record link path does not resolve: ../../ui/record/design.md + diff --git a/go/internal/ledgergate/testdata/ts-golden/status-disagrees-with-decision.txt b/go/internal/ledgergate/testdata/ts-golden/status-disagrees-with-decision.txt new file mode 100644 index 0000000..598d013 --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/status-disagrees-with-decision.txt @@ -0,0 +1,4 @@ + +design-ledger-gate: 1 violation(s): + docs/designs/ui/record/design.md:3: record Status supersession disagrees with its decision status + diff --git a/go/internal/ledgergate/testdata/ts-golden/status-supersession-unresolved.txt b/go/internal/ledgergate/testdata/ts-golden/status-supersession-unresolved.txt new file mode 100644 index 0000000..8e81856 --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/status-supersession-unresolved.txt @@ -0,0 +1,5 @@ + +design-ledger-gate: 2 violation(s): + docs/designs/ui/record/design.md:3: Status supersession does not resolve to a record: ../next/design.md + docs/designs/ui/record/design.md:3: record Status supersession disagrees with its decision status + diff --git a/go/internal/ledgergate/testdata/ts-golden/superseded-by-itself.txt b/go/internal/ledgergate/testdata/ts-golden/superseded-by-itself.txt new file mode 100644 index 0000000..9faefb1 --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/superseded-by-itself.txt @@ -0,0 +1,4 @@ + +design-ledger-gate: 1 violation(s): + docs/designs/decisions/ui/DL-001.md:4: DL-001: superseded by itself + diff --git a/go/internal/ledgergate/testdata/ts-golden/supersession-cycle-independent.txt b/go/internal/ledgergate/testdata/ts-golden/supersession-cycle-independent.txt new file mode 100644 index 0000000..46b599e --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/supersession-cycle-independent.txt @@ -0,0 +1,5 @@ + +design-ledger-gate: 2 violation(s): + docs/designs/decisions/ui/DL-001.md:4: supersession cycle: DL-001 → DL-002 → DL-001 + docs/designs/decisions/ui/DL-003.md:4: supersession cycle: DL-003 → DL-004 → DL-003 + diff --git a/go/internal/ledgergate/testdata/ts-golden/supersession-cycle.txt b/go/internal/ledgergate/testdata/ts-golden/supersession-cycle.txt new file mode 100644 index 0000000..0e13bdc --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/supersession-cycle.txt @@ -0,0 +1,4 @@ + +design-ledger-gate: 1 violation(s): + docs/designs/decisions/ui/DL-003.md:4: supersession cycle: DL-003 → DL-004 → DL-003 + diff --git a/go/internal/ledgergate/testdata/ts-golden/supersession-missing-target.txt b/go/internal/ledgergate/testdata/ts-golden/supersession-missing-target.txt new file mode 100644 index 0000000..d9b9bb5 --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/supersession-missing-target.txt @@ -0,0 +1,4 @@ + +design-ledger-gate: 1 violation(s): + docs/designs/decisions/ui/DL-001.md:4: DL-001: Superseded by DL-999, which is not a decision file + diff --git a/go/internal/ledgergate/testdata/ts-golden/touch-coupling-branch-prefix.txt b/go/internal/ledgergate/testdata/ts-golden/touch-coupling-branch-prefix.txt new file mode 100644 index 0000000..7156b31 --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/touch-coupling-branch-prefix.txt @@ -0,0 +1,4 @@ + +design-ledger-gate: 1 violation(s): + (pull request): PR touches a governed design record without a changed decision file or Ledger-impact declaration + diff --git a/go/internal/ledgergate/testdata/ts-golden/touch-coupling-declaration.txt b/go/internal/ledgergate/testdata/ts-golden/touch-coupling-declaration.txt new file mode 100644 index 0000000..7156b31 --- /dev/null +++ b/go/internal/ledgergate/testdata/ts-golden/touch-coupling-declaration.txt @@ -0,0 +1,4 @@ + +design-ledger-gate: 1 violation(s): + (pull request): PR touches a governed design record without a changed decision file or Ledger-impact declaration +