chore: retire check 31 (bn chrome sync) — chrome is host-only since P3
The cms↔pluginsdk bn-chrome byte-compare no longer applies: pluginsdk deleted templates/bn at v0.2.0, so cms's copy is host-only and authoritative. Remove check_templatesync.go, drop check 31 from the registry-order test, and regenerate golden snapshots (34→33 checks). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
ff4de855cc
commit
56cca5b4b8
@ -1,67 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// The bn chrome files authored in cms/backend/templates/bn and mechanically
|
||||
// synced (make sync-templates) into the sibling pluginsdk repo's templates/bn.
|
||||
// Guest-side plugin templates compile pluginsdk's copy into their wasm, so the
|
||||
// two checkouts must stay byte-identical. validation.go is intentionally NOT in
|
||||
// this set (cms's is a two-context-key bridge over the SDK tracker); neither
|
||||
// is img.templ (cms-only, not referenced by the chrome).
|
||||
// See cms docs/superpowers/specs/2026-07-07-bn-chrome-single-source-design.md.
|
||||
var templateSyncSet = []string{
|
||||
"head.templ",
|
||||
"toolbar.templ",
|
||||
"engagement.templ",
|
||||
"asset_hooks.go",
|
||||
}
|
||||
|
||||
func init() {
|
||||
register(Check{
|
||||
Seq: 310,
|
||||
ID: "31",
|
||||
Title: "bn chrome templates in sync between cms and pluginsdk",
|
||||
Run: func(ctx *ScanContext, rep *Reporter) {
|
||||
cmsDir := filepath.Join(ctx.repoRoot, "backend", "templates", "bn")
|
||||
if _, err := os.Stat(cmsDir); err != nil {
|
||||
rep.Skip("no backend/templates/bn in this repo — template-sync gate not applicable")
|
||||
return
|
||||
}
|
||||
sdkDir := filepath.Join(ctx.repoRoot, "..", "pluginsdk", "templates", "bn")
|
||||
if _, err := os.Stat(sdkDir); err != nil {
|
||||
rep.Skip("sibling pluginsdk checkout not found — cannot verify template sync")
|
||||
return
|
||||
}
|
||||
|
||||
var drifted []string
|
||||
for _, name := range templateSyncSet {
|
||||
cmsBytes, err := os.ReadFile(filepath.Join(cmsDir, name))
|
||||
if err != nil {
|
||||
drifted = append(drifted, name+" (unreadable in cms: "+err.Error()+")")
|
||||
continue
|
||||
}
|
||||
sdkBytes, err := os.ReadFile(filepath.Join(sdkDir, name))
|
||||
if err != nil {
|
||||
drifted = append(drifted, name+" (missing in pluginsdk)")
|
||||
continue
|
||||
}
|
||||
if !bytes.Equal(cmsBytes, sdkBytes) {
|
||||
drifted = append(drifted, name)
|
||||
}
|
||||
}
|
||||
|
||||
if len(drifted) > 0 {
|
||||
rep.Fail("%d bn chrome file(s) drifted between cms and pluginsdk", len(drifted))
|
||||
for _, name := range drifted {
|
||||
rep.Findingf("templates/bn/%s differs — cms is the authoring source; run `make sync-templates` in cms, then commit + tag + push pluginsdk", name)
|
||||
}
|
||||
} else {
|
||||
rep.OK("bn chrome sync set byte-identical across cms and pluginsdk (%d files)", len(templateSyncSet))
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
@ -18,7 +18,7 @@ func TestRegistryOrder(t *testing.T) {
|
||||
"1", "2", "2b", "2c", "2d", "2e", "2f", "3", "3b", "4",
|
||||
"5", "6", "7", "8", "9", "10", "10b", "10disc", "11", "12",
|
||||
"13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
|
||||
"28", "29", "30", "31",
|
||||
"28", "29", "30",
|
||||
}
|
||||
|
||||
ordered := make([]Check, len(registry))
|
||||
|
||||
2
testdata/golden/clean/expected.stdout
vendored
2
testdata/golden/clean/expected.stdout
vendored
@ -1,2 +1,2 @@
|
||||
check-safety FIXTURE_DIR
|
||||
34 checks: 20 ok 14 skip -> OK
|
||||
33 checks: 20 ok 13 skip -> OK
|
||||
|
||||
2
testdata/golden/nomod/expected.stdout
vendored
2
testdata/golden/nomod/expected.stdout
vendored
@ -10,4 +10,4 @@ FAIL 15 1 err.Error() leak(s) to HTTP clients — log via slog.Error() and retur
|
||||
FAIL 17 1 TODO marker(s) found — ship explicit behavior, not placeholders
|
||||
internal/service/handler.go:14 // TODO: add proper initialisation
|
||||
|
||||
34 checks: 14 ok 15 skip 5 fail -> FAIL
|
||||
33 checks: 14 ok 14 skip 5 fail -> FAIL
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user