mesh-sdk keeps the manifest contract and a lenient decoder; the judge leaves it (ADR 0578, 0579, 0573 §2) #152

Merged
mesh-tools merged 13 commits from feat/judge-once into main 2026-11-01 07:53:58 +00:00
Showing only changes of commit 7cab079e2e - Show all commits
+4 -2
View File
@@ -302,6 +302,8 @@ func TestADefaultFillsAContributionAndAServedFactButNotALiteral(t *testing.T) {
// aside and named, and its module is composed, never left out (novox/hq ADR 0578 §6, which changes ADR 0262); the judge
// refuses it. One case per block whose decoder wraps the decoder's words in its own.
func TestAStoredManifestWithAnUnknownKeyIsSetAsideAndTheJudgeRefusesIt(t *testing.T) {
t.Run("it still provides what it provides", aModuleWithAFieldSetAsideStillProvidesWhatItProvides)
t.Run("it is composed whole", aModuleWithAFieldSetAsideIsComposedWhole)
for where, raw := range map[string]string{
"the top": `{"module": "later", "version": "2", "a-field-from-later": {"x": 1}}`,
"a state": `{"module": "later", "version": "2", "state": [{"name": "s", "a-field-from-later": 1}]}`,
@@ -345,7 +347,7 @@ func TestAStoredManifestWithAnUnknownKeyIsSetAsideAndTheJudgeRefusesIt(t *testin
// A module left out for a key this controller does not know, inside an entry, is read past that key
// alone: it still provides what it provides, its other entries are whole, and a key of the same name
// that another entry knows is kept (novox/hq ADR 0262).
func TestALeftOutModuleStillProvidesWhatItProvides(t *testing.T) {
func aModuleWithAFieldSetAsideStillProvidesWhatItProvides(t *testing.T) {
var m Manifest
raw := `{"module": "later", "version": "2",
"provides": [{"name": "db", "scope": "mesh"}, {"name": "cache", "a-field-from-later": 1}],
@@ -376,7 +378,7 @@ func TestALeftOutModuleStillProvidesWhatItProvides(t *testing.T) {
// A module with a field set aside is composed whole: its files are declared and its data backed up (novox/hq ADR 0578
// §6; before, ADR 0262 left it out and backed up its data alone).
func TestAModuleWithAFieldSetAsideIsComposedWhole(t *testing.T) {
func aModuleWithAFieldSetAsideIsComposedWhole(t *testing.T) {
var later Manifest
if err := json.Unmarshal([]byte(`{"module": "later", "version": "2", "a-field-from-later": 1,
"resources": [{"id": "d", "type": "directory", "mode": "0700"}, {"id": "rc", "type": "file", "path": "/etc/later.conf", "content": "x\n"}],