The operator, 2026-11-04: logic one module owns lives inside that module as a package of its own, so the take-in step changes no mesh-sdk. TakeIn, its keys and event names, PendingWait and PendingAnswer move to modules/mesh-delivery-indexer/takein (its merges a takein.Merge of its own); Forge whole, with its group fields, ForgeGroupEnd and GroupMerge, moves to modules/mesh-delivery-forge-bridge/forgemsg. Both are nested Go modules that their readers take by replace, as buildrun is. Every importer moves in this commit: the indexer, the bridge, the watchman and the view. Forge's private checks (the repository name, the version) are copied small; mesh-sdk main still holds an unused Forge until its own fold removes it. The indexer, bridge, watchman, view and checker pin mesh-sdk 5a38a12 (origin/main), no feat/take-in commit. The bridge's integration bus now grants the state end-asks that bridge_group_end_again added: without it every test of the package failed on a permissions violation. Test budget: two new test functions (TestForge, TestTakeInEvents) and the two the join added are paid by merging four pairs in internal/bridge; the repository stays at 806 unit tests. Claude-Session: https://claude.ai/code/session_01JG73KG7AfSdh6FP8VrBqCn
37 lines
1.3 KiB
Go
37 lines
1.3 KiB
Go
package bridge
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-forge-bridge/forgemsg"
|
|
)
|
|
|
|
// ADR 0495 clause 1 with the lead's decision L8 of R4e: the forge bridge is no reader of a manifest's `paths`. A merge of a
|
|
// module whose artifacts name their paths (mesh-sdk's module.json at 9cb4d59) gives a message that carries the manifest as
|
|
// the forge answered it and no named path's object: the indexer asks the forge for those itself.
|
|
func TestAMergedMessageCarriesNoNamedPathsTheBridgeDerived(t *testing.T) {
|
|
raw, err := os.ReadFile("testdata/mesh-sdk-9cb4d59.module.json")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
files := func(owner, repo, path, ref string) ([]byte, error) {
|
|
if path == "module.json" {
|
|
return raw, nil
|
|
}
|
|
return nil, ErrNotFound
|
|
}
|
|
var calls []call
|
|
msg, err := Convert(mergedSubject, mergedBody(map[string]any{"repo": "mesh-sdk", "module_dirs": []string{""}}), treesOf(&calls, "r0", map[string]string{"": "r0"}, nil), files)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
f, err := forgemsg.DecodeForge(msg.Data)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if len(f.Paths) != 0 || f.Manifests[""] != string(raw) || len(calls) != 1 {
|
|
t.Errorf("message paths %v, manifest carried %v, trees asked %d times; want no paths, the manifest, one ask", f.Paths, f.Manifests[""] == string(raw), len(calls))
|
|
}
|
|
}
|