CAT-BN2: mesh-build-node regenerates a contracts module's TypeScript and names each file out of step

The unit level fails on one, a module with no tests of its own too; a build ask answers
them in its out-of-step through buildstep's compare (lead's ruling on A2k finding 1).

Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
2026-11-04 15:07:56 +01:00
parent c5bec10bb5
commit b5495d0cc8
3 changed files with 51 additions and 0 deletions
@@ -79,6 +79,29 @@ func TestAPackageWithNeitherScriptNorTypeScriptHasNoTests(t *testing.T) {
if len(f.calls) != 0 {
t.Errorf("%d commands ran for a package with no tests", len(f.calls))
}
// CAT-BN2: a contracts module (a package artifact naming generated-from) with no tests of its own still fails its
// unit level on a generated TypeScript file out of step with the seat generator, each named; its Go files are
// mesh-build-go's to compare.
m, _, work = newMachine(t)
workspaceWith(t, work, map[string]string{
"module.json": `{"module":"c","build":{"artifacts":[{"name":"ts","kind":"package","language":"typescript","paths":["ts"],"generated-from":"."}]}}`,
"seats/index.json": `{"format":1,"seats":["one-store"]}`,
"seats/one-store/seat.json": `{"format":1,"seat":"one-store","scope":"mesh","grain":"seat-list","decision":"ADR 1","verbs":[{"name":"query","input":{"type":"object"}}]}`,
"go/go.mod": "module example.org/c/go\n", "go/stray.go": "package stray\n",
"ts/package.json": `{"name":"@example/c"}`, "ts/stray.ts.txt": "not written by the generator\n",
})
out, err := m.test(context.Background(), testArgs("unit"))
r := out.(*TestResult)
stray := false
for _, p := range r.OutOfStep {
stray = stray || p == "ts/stray.ts.txt"
if !strings.HasPrefix(p, "ts/") {
t.Errorf("%s is not under the TypeScript root", p)
}
}
if err != nil || r.Passed || r.NoTests || !stray || !strings.Contains(r.Why, "ts/stray.ts.txt") {
t.Errorf("a contracts module out of step = %+v, %v", r, err)
}
}
// 1491/AC4: with test:integration present the integration level runs it, and reports the setup (the type-check) and