Reader release 3 before G: today's manifest validator accepts G's forms #212

Merged
mesh-tools merged 7 commits from feat/47-G-reader-release-3 into main 2026-11-13 11:04:19 +00:00
2 changed files with 7 additions and 0 deletions
Showing only changes of commit 771471c83b - Show all commits
@@ -49,6 +49,9 @@ var busTemplates = map[string]busTemplate{
catalogue.OptionTimeToLive: {kind: optionInt, least: 1, most: 315360000},
catalogue.OptionLifetimePerKey: {kind: optionFlag},
catalogue.OptionPerMachine: {kind: optionFlag},
// The cap of the state's own objects store `<state>-objects`, for a state needing more than the cap planned for it
// (design 47 G §513, §547).
catalogue.OptionObjectsCapMiB: {kind: optionInt, least: catalogue.ObjectsLeastMiB, most: catalogue.ObjectsMostMiB},
},
},
catalogue.TemplateEvents: {
@@ -52,6 +52,10 @@ func TestBusStateIsJudgedOnce(t *testing.T) {
{"template on another storage type", manifest(`{"name":"x","storage":"stream","template":"state"}`), []string{"\"x\"", "template state is on the storage type key-value"}},
{"past values 0", manifest(`{"name":"x","storage":"key-value","template":"state","options":{"history":0}}`), []string{"\"x\"", "options \"history\" is 0", "0 is refused"}},
{"past values 65", manifest(`{"name":"x","storage":"key-value","template":"state","options":{"history":65}}`), []string{"\"x\"", "\"history\" is 65", "1 to 64"}},
// Design 47 G §513, §547: a state needing more for its objects store names objects-max-mib, within the objects' bounds.
{"an objects cap on a state", manifest(`{"name":"x","storage":"key-value","template":"state","options":{"objects-max-mib":64}}`), nil},
{"an objects cap of 0", manifest(`{"name":"x","storage":"key-value","template":"state","options":{"objects-max-mib":0}}`), []string{"\"x\"", "\"objects-max-mib\" is 0"}},
{"an objects cap over 8192", manifest(`{"name":"x","storage":"key-value","template":"state","options":{"objects-max-mib":8193}}`), []string{"\"x\"", "\"objects-max-mib\" is 8193"}},
{"a lifetime that is no number", manifest(`{"name":"x","storage":"key-value","template":"state","options":{"ttl-seconds":"soon"}}`), []string{"\"x\"", "\"ttl-seconds\""}},
{"events age over 30 days", manifest(`{"name":"x","storage":"stream","template":"events","options":{"events":["seen"],"max-age-days":31}}`), []string{"\"x\"", "\"max-age-days\" is 31", "1 to 30"}},
{"events cap over 8192", manifest(`{"name":"x","storage":"stream","template":"events","options":{"events":["seen"],"max-mib":8193}}`), []string{"\"x\"", "\"max-mib\" is 8193"}},