Migrate committed release visual evidence

Carry an explicit model-selection decision in every existing visual sidecar and enforce that invariant for future packets after the visual-plan schema became evidence-bearing.
This commit is contained in:
pulse-triage[bot] 2026-08-28 20:16:39 +01:00
parent 87674ec175
commit 7ebda0e87a
5 changed files with 33 additions and 1 deletions

View file

@ -7,6 +7,7 @@ import (
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"encoding/json"
"os"
"os/exec"
"path/filepath"
@ -3240,6 +3241,33 @@ func TestReleaseTriggersReevaluateVisualsInsteadOfTrustingSidecars(t *testing.T)
}
}
func TestCommittedReleaseVisualSidecarsCarrySelectionEvidence(t *testing.T) {
paths, err := filepath.Glob(repoFile("docs", "releases", "*.visuals.json"))
if err != nil {
t.Fatalf("glob release visual sidecars: %v", err)
}
if len(paths) == 0 {
t.Fatal("no committed release visual sidecars found")
}
for _, path := range paths {
content, err := os.ReadFile(path)
if err != nil {
t.Fatalf("read %s: %v", path, err)
}
var plan struct {
SchemaVersion int `json:"schema_version"`
Decision string `json:"decision"`
Captures json.RawMessage `json:"captures"`
}
if err := json.Unmarshal(content, &plan); err != nil {
t.Fatalf("parse %s: %v", path, err)
}
if plan.SchemaVersion != 1 || strings.TrimSpace(plan.Decision) == "" || len(plan.Captures) == 0 {
t.Fatalf("%s must carry schema version, visual selection evidence, and a captures decision", path)
}
}
}
func assertFileContainsAllNormalized(t *testing.T, path string, required ...string) {
t.Helper()
content, err := os.ReadFile(path)