K2: keep the captured claude-code manifest in a test file (issue 1751)

The catalogue's paths check (ADR 0260) reads every file of a module but its documentation and tests, and
the verbatim manifest names claude-code's own paths; as a constant in a _test.go file it stays a real
capture without being taken for one module reaching into another's state.
This commit is contained in:
2026-10-22 21:18:18 +02:00
parent 8f10d3192c
commit 97f0f4813c
6 changed files with 22 additions and 21 deletions
@@ -240,12 +240,9 @@ func TestABuildOutputDirectoryLinkedOutsideTheModuleIsRefused(t *testing.T) {
// Issue 1751 (ADR 0514 §2, the review's K2): a manifest whose config value falls back to a predefined key builds. The
// builder holds no published list of the keys, so it reads the manifest for its inputs (ParseManifestForInputs), not
// as a judge of config values; claude-code's real manifest (testdata/captured) is the fixture.
// as a judge of config values; claude-code's real manifest (capturedClaudeCodeManifest) is the fixture.
func TestAManifestFallingBackToAPredefinedKeyBuilds(t *testing.T) {
raw, err := os.ReadFile(filepath.Join("testdata", "captured", "claude-code-module.json"))
if err != nil {
t.Fatal(err)
}
raw := []byte(capturedClaudeCodeManifest)
if !strings.Contains(string(raw), `"predefined": "agent-managed-settings"`) {
t.Fatal("the captured manifest no longer falls back to a predefined key")
}
@@ -1,4 +1,11 @@
{
package main
// capturedClaudeCodeManifest is modules/claude-code/module.json of this catalogue at 56c68be7, copied verbatim on
// 2026-10-22 for issue 1751 (the R4e review's finding K2): a real manifest whose config value managed_settings falls
// back to the predefined key agent-managed-settings (ADR 0348 §7), which the builder holds no published list for. It
// lives in a test file, not under testdata, because the catalogue's paths check (ADR 0260) reads every other file of a
// module and the manifest names claude-code's own paths.
const capturedClaudeCodeManifest = `{
"module": "claude-code",
"version": "1",
"moved": true,
@@ -247,3 +254,4 @@
]
}
}
`
@@ -24,7 +24,3 @@ The tar streams (the archives gunzipped) of the three archives above, captured t
gunzip and sha256) at origin/main 0205b8f7 on 2026-10-21: directory f8af1d94...d1b6, within 294e2bec...07fb, file
055cffc2...428e. The digests above hold the gzip bytes of go1.27.1. The first try of issue 1589 on the merge check's build node answered
other digests; the tests therefore compare the stream always and the digest only under go1.27.1.
claude-code-module.json is modules/claude-code/module.json of this catalogue at 56c68be7 (copied 2026-10-22 for issue 1751,
the R4e review's finding K2): a real manifest whose config value managed_settings falls back to the predefined key
agent-managed-settings (ADR 0348 §7), which the builder holds no published list for.
@@ -201,13 +201,10 @@ func TestBuildFailsForWhatIsNotAnImageOrNotThere(t *testing.T) {
// Issue 1751 (ADR 0514 §2, the review's K2): a manifest whose config value falls back to a predefined key builds. The
// builder holds no published list of the keys, so it reads the manifest for its inputs (ParseManifestForInputs), not
// as a judge of config values. The manifest is claude-code's real one (testdata/captured) with the image fixture's
// as a judge of config values. The manifest is claude-code's real one (capturedClaudeCodeManifest) with the image fixture's
// base and artifact added to its build, since no image module of the catalogue falls back to a predefined key today.
func TestAManifestFallingBackToAPredefinedKeyBuilds(t *testing.T) {
raw, err := os.ReadFile(filepath.Join("testdata", "captured", "claude-code-module.json"))
if err != nil {
t.Fatal(err)
}
raw := []byte(capturedClaudeCodeManifest)
if !strings.Contains(string(raw), `"predefined": "agent-managed-settings"`) {
t.Fatal("the captured manifest no longer falls back to a predefined key")
}
@@ -1,4 +1,11 @@
{
package main
// capturedClaudeCodeManifest is modules/claude-code/module.json of this catalogue at 56c68be7, copied verbatim on
// 2026-10-22 for issue 1751 (the R4e review's finding K2): a real manifest whose config value managed_settings falls
// back to the predefined key agent-managed-settings (ADR 0348 §7), which the builder holds no published list for. It
// lives in a test file, not under testdata, because the catalogue's paths check (ADR 0260) reads every other file of a
// module and the manifest names claude-code's own paths.
const capturedClaudeCodeManifest = `{
"module": "claude-code",
"version": "1",
"moved": true,
@@ -247,3 +254,4 @@
]
}
}
`
@@ -3,8 +3,3 @@ The stored steps (what a step ends on in the module's `steps` state) of a fetch
the workspace, the commit, digests and the registry's address put to fixed words (STEPID, WORKSPACE, COMMIT, REGISTRY, one
sha256 digest). Written by capture_test.go (MESH_UPDATE_CAPTURED=1) from the unit tests' fake runner on 2026-10-22, and
compared by bus_integration_test.go with the steps a real bus holds. mesh-delivery-builder's tests copy these files.
claude-code-module.json is modules/claude-code/module.json of this catalogue at 56c68be7 (copied 2026-10-22 for issue 1751,
the R4e review's finding K2): a real manifest whose config value managed_settings falls back to the predefined key
agent-managed-settings (ADR 0348 §7). No image module of the catalogue falls back to one today, so the test adds the image
fixture's base and artifact to its build.