I6 (5): the judge's tests read the catalogue at the group's head

The captured catalogue beside the judge (testdata/beside) is re-archived from
mesh-catalog 30a3e665 (feat/47-H2, the delivery group's catalogue head), so the
judge's rules are tested against manifests that name their class where they
claim a seat; the catalogue fixtures of judge and internal/index move from
835bf22b and a67f0196 to 30a3e665 (ca-trust refreshed; avahi, audit-logger and
netcheck kept at a67f0196, which they still match). Tested against mesh-sdk
a323a3fd (seatlisttest holds the group's definitions); the build seats' check
now holds current, pause and resume among the verbs the seats' definitions
serve, which have grown since 1887.

Builds: design 47 H2 §814, H-A-428, H-A-452
This commit is contained in:
2026-11-22 02:31:52 +01:00
parent 5e94328066
commit ce6c39e46c
227 changed files with 6836 additions and 1143 deletions
@@ -9,7 +9,8 @@ import (
) )
// The manifests these tests carry are real files, copied unchanged into testdata: the module.json of modules of // The manifests these tests carry are real files, copied unchanged into testdata: the module.json of modules of
// mesh-catalog at its main commit a67f01963f0d9ef0913a63720b89e573ca7a16ef (testdata/catalogue-a67f0196-<module>.module.json) // mesh-catalog at its main commit a67f01963f0d9ef0913a63720b89e573ca7a16ef (testdata/catalogue-a67f0196-<module>.module.json),
// at 30a3e665e0070ae5b0ebfede985da5759af8affd for those that claim a seat (testdata/catalogue-30a3e665-<module>.module.json)
// and of build-agent from mesh-controller at its main commit f2d7bc94 (testdata/controller-f2d7bc94-build-agent.module.json). // and of build-agent from mesh-controller at its main commit f2d7bc94 (testdata/controller-f2d7bc94-build-agent.module.json).
func fixture(t *testing.T, name string) string { func fixture(t *testing.T, name string) string {
t.Helper() t.Helper()
@@ -20,8 +21,14 @@ func fixture(t *testing.T, name string) string {
return string(b) return string(b)
} }
// catalogueManifest is a module's captured module.json of mesh-catalog: ca-trust's at 30a3e665, the group's catalogue head
// of design 47 H2 (it claims a seat, so it names its class, §810, §814; H-A-430 (3)), every other at a67f0196.
func catalogueManifest(t *testing.T, module string) string { func catalogueManifest(t *testing.T, module string) string {
return fixture(t, "catalogue-a67f0196-"+module) at := "a67f0196"
if module == "ca-trust" {
at = "30a3e665"
}
return fixture(t, "catalogue-"+at+"-"+module)
} }
// avahiGoSum is the sha256 of modules/avahi/go.sum in mesh-catalog at a67f0196 (sha256sum of that file). // avahiGoSum is the sha256 of modules/avahi/go.sum in mesh-catalog at a67f0196 (sha256sum of that file).
@@ -7,10 +7,10 @@ import (
// Issue 1751: a manifest whose config value falls back to a predefined key (novox/hq ADR 0348) is read by the indexer, so // Issue 1751: a manifest whose config value falls back to a predefined key (novox/hq ADR 0348) is read by the indexer, so
// the module gets its new-form inputs. The manifests are claude-code's, dunst's and xterm's module.json from mesh-catalog // the module gets its new-form inputs. The manifests are claude-code's, dunst's and xterm's module.json from mesh-catalog
// at 835bf22b. // at 30a3e665.
func TestAManifestFallingBackToAPredefinedKeyIsRead(t *testing.T) { // 1751 func TestAManifestFallingBackToAPredefinedKeyIsRead(t *testing.T) { // 1751
for _, module := range []string{"claude-code", "dunst", "xterm"} { for _, module := range []string{"claude-code", "dunst", "xterm"} {
raw := fixture(t, "catalogue-835bf22b-"+module) raw := fixture(t, "catalogue-30a3e665-"+module)
if !strings.Contains(raw, `"predefined"`) { if !strings.Contains(raw, `"predefined"`) {
t.Fatalf("%s: the fixture names no predefined key", module) t.Fatalf("%s: the fixture names no predefined key", module)
} }
@@ -20,7 +20,7 @@ func TestAManifestFallingBackToAPredefinedKeyIsRead(t *testing.T) { // 1751
} }
} }
// A predefined key of another type than its value is still refused: the read judges what it can. // A predefined key of another type than its value is still refused: the read judges what it can.
raw := strings.Replace(fixture(t, "catalogue-835bf22b-xterm"), `"predefined": "font-size"`, `"predefined": "font-size", "trusted": "yes"`, 1) raw := strings.Replace(fixture(t, "catalogue-30a3e665-xterm"), `"predefined": "font-size"`, `"predefined": "font-size", "trusted": "yes"`, 1)
if in := inputsOf("xterm", raw, "newtree", nil, func(string) (string, string) { return "", "none" }); in.Kept != nil { if in := inputsOf("xterm", raw, "newtree", nil, func(string) (string, string) { return "", "none" }); in.Kept != nil {
t.Errorf("inputs = %+v, want a manifest the catalogue refuses still refused", in) t.Errorf("inputs = %+v, want a manifest the catalogue refuses still refused", in)
} }
@@ -1,6 +1,7 @@
{ {
"module": "ca-trust", "module": "ca-trust",
"version": "1", "version": "0.1",
"class": "core",
"slug": "catrust", "slug": "catrust",
"capabilities": [ "capabilities": [
"service-manager" "service-manager"
@@ -1,6 +1,7 @@
{ {
"module": "claude-code", "module": "claude-code",
"version": "1", "version": "0.1",
"class": "leaf",
"moved": true, "moved": true,
"slug": "agent", "slug": "agent",
"capabilities": [ "capabilities": [
@@ -11,6 +12,25 @@
{ {
"name": "gitea-read", "name": "gitea-read",
"optional": true "optional": true
},
{
"name": "finding-events",
"storage": "stream",
"template": "events",
"options": {
"events": [
"finding-written.*",
"finding-cleared.*",
"findings-stated.*"
],
"max-age-days": 7,
"max-mib": 8
}
},
{
"name": "findings",
"storage": "key-value",
"template": "state"
} }
], ],
"binds": { "binds": {
@@ -22,6 +42,31 @@
"uses": [ "uses": [
"operator-channel" "operator-channel"
], ],
"invokes": [
"seat:mesh-hand-acts.warranted",
"seat:mesh-hand-acts.hand-act",
"seat:mesh-catalog.seat-definitions",
"seat:mesh-catalog.revision",
"seat:mesh-catalog.registrations",
"seat:mesh-delivery.source",
"mesh-delivery-assigner.assigner_read_assignments",
"seat:anthropic-licence-manager.bindings",
"seat:anthropic-licence-manager.current",
"seat:mesh-vault.get",
"seat:operator-channel.notify"
],
"consumes": [
"mesh-catalog.catalog-revision",
"mesh-catalog.registration-changed",
"mesh-delivery.source-moved",
"mesh-delivery-assigner.views.assignments",
"mesh-catalog.seat-definition-changed",
"mesh-catalog.seat-definition-removed",
"mesh-conditions.findings-asked",
"claude-licence-manager.holdings.asked",
"claude-licence-manager.binding.changed.*",
"mesh-vault.secret-changed"
],
"state": [ "state": [
"servers", "servers",
"holdings", "holdings",
@@ -31,13 +76,13 @@
"memory", "memory",
"waits" "waits"
], ],
"reads": [ "emits": [
"claude-licence-manager.bindings" "judged",
"holdings-changed"
], ],
"tools": [ "tools": [
"claude_code_status", "claude_code_status",
"claude_code_render", "claude_code_render",
"claude_code_guard",
"claude_code_pull", "claude_code_pull",
"claude_code_grant", "claude_code_grant",
"claude_code_add_api_key", "claude_code_add_api_key",
@@ -83,7 +128,11 @@
"claude_code_home_removed", "claude_code_home_removed",
"claude_code_home_restore", "claude_code_home_restore",
"claude_code_judge", "claude_code_judge",
"claude_code_judged" "claude_code_judged",
"claude_code_first_views",
"claude_code_first_view_again",
"claude_code_seat_list",
"claude_code_seat_list_again"
], ],
"data": { "data": {
"own": [ "own": [
@@ -210,7 +259,16 @@
"path": "${dir:state}/settings.json", "path": "${dir:state}/settings.json",
"mode": "0600", "mode": "0600",
"owner": "${machine:account}", "owner": "${machine:account}",
"takes-config": ["role", "mcp_servers", "managed_settings", "instructions", "output_styles", "skills", "commands", "agents"], "takes-config": [
"role",
"mcp_servers",
"managed_settings",
"instructions",
"output_styles",
"skills",
"commands",
"agents"
],
"merge": "json", "merge": "json",
"template": "files/settings.json" "template": "files/settings.json"
} }
@@ -236,7 +294,8 @@
"env": { "env": {
"MESH_CLAUDE_CODE_STATE": "${dir:state}", "MESH_CLAUDE_CODE_STATE": "${dir:state}",
"MESH_CLAUDE_CODE_FACTS": "${dir:state}/facts.json", "MESH_CLAUDE_CODE_FACTS": "${dir:state}/facts.json",
"MESH_CLAUDE_CODE_SETTINGS": "${dir:state}/settings.json" "MESH_CLAUDE_CODE_SETTINGS": "${dir:state}/settings.json",
"MESH_CLAUDE_CODE_FORGE": "${dir:state}/gitea-read.secret"
} }
}, },
{ {
@@ -1,6 +1,7 @@
{ {
"module": "dunst", "module": "dunst",
"version": "1", "version": "0.1",
"class": "core",
"moved": true, "moved": true,
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
@@ -1,6 +1,7 @@
{ {
"module": "xterm", "module": "xterm",
"version": "1", "version": "0.1",
"class": "core",
"moved": true, "moved": true,
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
@@ -4147,12 +4147,16 @@ func caseNodeBuildAgentIsRetiredForTheBuildSeats(t *testing.T) {
if !s.Yields { if !s.Yields {
t.Errorf("%s does not yield (ADR 0553)", name) t.Errorf("%s does not yield (ADR 0553)", name)
} }
// The seat's definition is the catalogue's (mesh-contracts'), and it serves more than these since (drop,
// kept-artifact, steps, output, answer): the retirement holds current, pause and resume among them.
var verbs []string var verbs []string
for _, v := range s.Serves { for _, v := range s.Serves {
verbs = append(verbs, v.Name) verbs = append(verbs, v.Name)
} }
if strings.Join(verbs, ",") != "current,pause,resume" { for _, want := range []string{"current", "pause", "resume"} {
t.Errorf("%s serves %v", name, verbs) if !slices.Contains(verbs, want) {
t.Errorf("%s serves %v, without %s", name, verbs, want)
}
} }
} }
// The build seats are the seats that yield, and no other (ADR 0553 §1). // The build seats are the seats that yield, and no other (ADR 0553 §1).
@@ -4302,13 +4306,13 @@ func caseOnlyChannelAndIntakeAreKinded(t *testing.T) {
} }
// The indexer and the builder hold no published list of predefined keys; a manifest whose config values fall back to // The indexer and the builder hold no published list of predefined keys; a manifest whose config values fall back to
// one (claude-code, dunst, xterm at mesh-catalog 835bf22b) is still read for its build's and fingerprint's inputs // one (claude-code, dunst, xterm at mesh-catalog 30a3e665) is still read for its build's and fingerprint's inputs
// (issue 1751). // (issue 1751).
func caseParseManifestForInputsReadsAValueFallingBackToAPredefinedKey(t *testing.T) { // issue 1751 func caseParseManifestForInputsReadsAValueFallingBackToAPredefinedKey(t *testing.T) { // issue 1751
was := catalogue.ReplacePublished(nil) // the indexer's and the builder's case: no published list was := catalogue.ReplacePublished(nil) // the indexer's and the builder's case: no published list
defer catalogue.ReplacePublished(was) defer catalogue.ReplacePublished(was)
for _, module := range []string{"claude-code", "dunst", "xterm"} { for _, module := range []string{"claude-code", "dunst", "xterm"} {
raw, err := os.ReadFile("testdata/catalogue-835bf22b-" + module + ".module.json") raw, err := os.ReadFile("testdata/catalogue-30a3e665-" + module + ".module.json")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@@ -1,6 +1,7 @@
{ {
"module": "claude-code", "module": "claude-code",
"version": "1", "version": "0.1",
"class": "leaf",
"moved": true, "moved": true,
"slug": "agent", "slug": "agent",
"capabilities": [ "capabilities": [
@@ -11,6 +12,25 @@
{ {
"name": "gitea-read", "name": "gitea-read",
"optional": true "optional": true
},
{
"name": "finding-events",
"storage": "stream",
"template": "events",
"options": {
"events": [
"finding-written.*",
"finding-cleared.*",
"findings-stated.*"
],
"max-age-days": 7,
"max-mib": 8
}
},
{
"name": "findings",
"storage": "key-value",
"template": "state"
} }
], ],
"binds": { "binds": {
@@ -22,6 +42,31 @@
"uses": [ "uses": [
"operator-channel" "operator-channel"
], ],
"invokes": [
"seat:mesh-hand-acts.warranted",
"seat:mesh-hand-acts.hand-act",
"seat:mesh-catalog.seat-definitions",
"seat:mesh-catalog.revision",
"seat:mesh-catalog.registrations",
"seat:mesh-delivery.source",
"mesh-delivery-assigner.assigner_read_assignments",
"seat:anthropic-licence-manager.bindings",
"seat:anthropic-licence-manager.current",
"seat:mesh-vault.get",
"seat:operator-channel.notify"
],
"consumes": [
"mesh-catalog.catalog-revision",
"mesh-catalog.registration-changed",
"mesh-delivery.source-moved",
"mesh-delivery-assigner.views.assignments",
"mesh-catalog.seat-definition-changed",
"mesh-catalog.seat-definition-removed",
"mesh-conditions.findings-asked",
"claude-licence-manager.holdings.asked",
"claude-licence-manager.binding.changed.*",
"mesh-vault.secret-changed"
],
"state": [ "state": [
"servers", "servers",
"holdings", "holdings",
@@ -31,13 +76,13 @@
"memory", "memory",
"waits" "waits"
], ],
"reads": [ "emits": [
"claude-licence-manager.bindings" "judged",
"holdings-changed"
], ],
"tools": [ "tools": [
"claude_code_status", "claude_code_status",
"claude_code_render", "claude_code_render",
"claude_code_guard",
"claude_code_pull", "claude_code_pull",
"claude_code_grant", "claude_code_grant",
"claude_code_add_api_key", "claude_code_add_api_key",
@@ -83,7 +128,11 @@
"claude_code_home_removed", "claude_code_home_removed",
"claude_code_home_restore", "claude_code_home_restore",
"claude_code_judge", "claude_code_judge",
"claude_code_judged" "claude_code_judged",
"claude_code_first_views",
"claude_code_first_view_again",
"claude_code_seat_list",
"claude_code_seat_list_again"
], ],
"data": { "data": {
"own": [ "own": [
@@ -210,7 +259,16 @@
"path": "${dir:state}/settings.json", "path": "${dir:state}/settings.json",
"mode": "0600", "mode": "0600",
"owner": "${machine:account}", "owner": "${machine:account}",
"takes-config": ["role", "mcp_servers", "managed_settings", "instructions", "output_styles", "skills", "commands", "agents"], "takes-config": [
"role",
"mcp_servers",
"managed_settings",
"instructions",
"output_styles",
"skills",
"commands",
"agents"
],
"merge": "json", "merge": "json",
"template": "files/settings.json" "template": "files/settings.json"
} }
@@ -236,7 +294,8 @@
"env": { "env": {
"MESH_CLAUDE_CODE_STATE": "${dir:state}", "MESH_CLAUDE_CODE_STATE": "${dir:state}",
"MESH_CLAUDE_CODE_FACTS": "${dir:state}/facts.json", "MESH_CLAUDE_CODE_FACTS": "${dir:state}/facts.json",
"MESH_CLAUDE_CODE_SETTINGS": "${dir:state}/settings.json" "MESH_CLAUDE_CODE_SETTINGS": "${dir:state}/settings.json",
"MESH_CLAUDE_CODE_FORGE": "${dir:state}/gitea-read.secret"
} }
}, },
{ {
@@ -1,6 +1,7 @@
{ {
"module": "dunst", "module": "dunst",
"version": "1", "version": "0.1",
"class": "core",
"moved": true, "moved": true,
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
@@ -1,6 +1,7 @@
{ {
"module": "xterm", "module": "xterm",
"version": "1", "version": "0.1",
"class": "core",
"moved": true, "moved": true,
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
+3 -6
View File
@@ -8,15 +8,12 @@ private addresses. That is acceptable while mesh-sdk is private; if it ever goes
a second place to clean besides the catalogue itself. a second place to clean besides the catalogue itself.
Only what go/catalogue's tests read is captured (R4b, issue 1379), copied here from mesh-sdk with the judge's tests Only what go/catalogue's tests read is captured (R4b, issue 1379), copied here from mesh-sdk with the judge's tests
(issue 1585). mesh-host refreshed 2026-11-01 from its main, the catalogue 2026-10-21 from its main; before that it (issue 1585). mesh-host refreshed 2026-11-01 from its main, the catalogue 2026-11-22 from its feat/47-H2 (milestone 47/H2's group); before that it
was mesh-controller's copy, which still held two modules that had left the catalogue. was mesh-controller's copy, which still held two modules that had left the catalogue.
mesh-catalog b5dbfbb784507e211372a7c9640d91f7d6dadd84 modules/*/module.json, modules/*/files/**, modules/*/templates/**, predefined.json mesh-catalog 30a3e665e0070ae5b0ebfede985da5759af8affd (feat/47-H2, the delivery group's catalogue head; design 47 H2
H-A-428, H-A-430 (3)) modules/*/module.json, modules/*/files/**, modules/*/templates/**, predefined.json
mesh-host 233bb23bbcb1a829ce2a6164a31a5c5cc4f3d950 internal/apply/placement_guard.go mesh-host 233bb23bbcb1a829ce2a6164a31a5c5cc4f3d950 internal/apply/placement_guard.go
mesh-catalog 2d5358b8 (milestone 47/G's AM-K1) modules/zsh/module.json alone: the login shell uses operator-channel for
its seat's marked execute (design 46 approval mark §21), which the validator requires (§4)
mesh-catalog cd3b8fe8 (restic's secrets-owner, ADR 0680) modules/restic/module.json and modules/restic/files/** alone: its
processes run as the operator account, so the validator (ADR 0680 §3) needs the secrets-owner it names
To move them, from mesh-delivery's modules/mesh-delivery-indexer directory, with the two repositories checked out To move them, from mesh-delivery's modules/mesh-delivery-indexer directory, with the two repositories checked out
beside mesh-delivery: beside mesh-delivery:
@@ -1,6 +1,7 @@
{ {
"module": "adwaita", "module": "adwaita",
"version": "1", "version": "0.1",
"class": "leaf",
"moved": true, "moved": true,
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
@@ -0,0 +1 @@
${seat:container-image-registry:reach}
@@ -1,26 +1,64 @@
{ {
"module": "artifact-store-tools", "module": "artifact-store-tools",
"version": "1", "version": "0.1",
"class": "core",
"packages": {
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds": "0.1"
},
"claims": [
{
"name": "mesh-artifact-sweep",
"scope": "mesh",
"serves": [
"artifacts",
"held",
"collect",
"mirrors",
"images"
]
}
],
"invokes": [ "invokes": [
"seat:mesh-controller.artifacts", "seat:mesh-hand-acts.hand-act",
"seat:mesh-controller.collect", "seat:mesh-catalog.modules",
"mesh-catalog.catalog_modules", "seat:mesh-catalog.module",
"mesh-catalog.catalog_module" "mesh-delivery-assigner.assigner_read_wants",
"mesh-delivery-indexer.indexer_read_manifests",
"seat:oci-artifact-registry.hold",
"seat:oci-artifact-registry.release",
"seat:oci-artifact-registry.remove",
"seat:container-image-registry.hold",
"seat:container-image-registry.release",
"seat:container-image-registry.remove",
"seat:container-image-registry.list",
"seat:oci-artifact-registry.list"
],
"reads": [
"mesh-delivery-builder.builds",
"mesh-delivery-builder.build-log",
"node-engine.have"
],
"consumes": [
"mesh-delivery-assigner.views.wants",
"mesh-delivery-indexer.views.manifests",
"mesh-conditions.findings-asked"
], ],
"tools": [ "tools": [
"artifact_store_repositories", "artifact_store_repositories",
"artifact_store_usage", "artifact_store_usage",
"artifact_store_references", "artifact_store_references",
"artifact_store_collect" "artifact_store_collect",
"artifact_store_first_views",
"artifact_store_first_view_again"
], ],
"config": { "config": {
"older-store-names": { "older-store-names": {
"type": "string", "type": "string",
"description": "The names the artifact store had before, as host names or host:port separated by spaces, or none when it had no other. artifact_store_references reads every definition under these as well as under the store's current name, so an image a definition pins under one is said to be named by a definition (novox/hq issue 323).", "description": "The names the artifact store had before, as host names or host:port separated by spaces, or none when it had no other. artifact_store_references reads every definition under these as well as under the store's current name, so an image a definition pins under one is said to be named by a definition (novox/hq issue 323).",
"pattern": "none|[A-Za-z0-9.:-]+( [A-Za-z0-9.:-]+)*", "pattern": "none|[A-Za-z0-9.:-]+( [A-Za-z0-9.:-]+)*",
"default": "none" "default": "none"
} }
}, },
"resources": [ "resources": [
{ {
"id": "state", "id": "state",
@@ -36,6 +74,14 @@
"mode": "0600", "mode": "0600",
"trusted": false, "trusted": false,
"template": "files/store-names" "template": "files/store-names"
},
{
"id": "store-address",
"type": "file",
"path": "${dir:state}/store-address",
"mode": "0600",
"trusted": false,
"template": "files/store-address"
} }
], ],
"build": { "build": {
@@ -51,8 +97,8 @@
"artifact-store-tools" "artifact-store-tools"
], ],
"env": { "env": {
"MESH_ARTIFACT_STORE_CONTAINER": "mesh-registry", "MESH_ARTIFACT_STORE_NAMES_FILE": "${dir:state}/store-names",
"MESH_ARTIFACT_STORE_NAMES_FILE": "${dir:state}/store-names" "MESH_ARTIFACT_STORE_ADDRESS_FILE": "${dir:state}/store-address"
} }
}, },
{ {
@@ -61,5 +107,29 @@
"from": "files" "from": "files"
} }
] ]
} },
"requires": [
{
"name": "findings",
"storage": "key-value",
"template": "state",
"options": {
"max-mib": 8
}
},
{
"name": "finding-events",
"storage": "stream",
"template": "events",
"options": {
"events": [
"finding-written.*",
"finding-cleared.*",
"findings-stated.*"
],
"max-age-days": 7,
"max-mib": 8
}
}
]
} }
@@ -1,6 +1,7 @@
{ {
"module": "asus-zephyrus-g14", "module": "asus-zephyrus-g14",
"version": "1", "version": "0.1",
"class": "leaf",
"moved": true, "moved": true,
"templates": "templates", "templates": "templates",
"capabilities": [ "capabilities": [
@@ -1,6 +1,7 @@
{ {
"module": "audit-logger", "module": "audit-logger",
"version": "1", "version": "0.1",
"class": "leaf",
"slug": "audit", "slug": "audit",
"consumes": [ "consumes": [
"**" "**"
@@ -1,6 +1,7 @@
{ {
"module": "avahi", "module": "avahi",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"package-manager", "package-manager",
"service-manager" "service-manager"
@@ -1,6 +1,7 @@
{ {
"module": "baserow", "module": "baserow",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"container-runtime" "container-runtime"
], ],
@@ -1,3 +0,0 @@
{
"accounts": {}
}
@@ -1,10 +0,0 @@
#!/bin/sh
# Betterbird's start, written by the mesh (module betterbird, novox/hq ADR 0316). Replaced at every push.
#
# Before Betterbird starts, the module's tools place its user.js in the profile (the settings prefs, accounts, identities, calendars,
# address-books and tags) and write what Betterbird rewrites itself: the account lists and each declared account's filters. They do
# it only while no Betterbird of this account runs, because Betterbird rewrites its saved preferences when it quits; a
# second start while one runs only hands over to it. What the preparation could not do it says here, and
# betterbird_check says it too. Betterbird starts either way: its configuration never holds the mail back.
/usr/local/lib/mesh-betterbird/betterbird-tools prepare || echo "betterbird: the mesh's preparation did not complete; betterbird_check says why" >&2
exec /opt/betterbird/betterbird "$@"
@@ -1,6 +0,0 @@
{
"identities": {},
"calendars": {},
"address-books": {},
"filters": {}
}
@@ -1,25 +0,0 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=Betterbird
GenericName=Mail Client
Comment=Send and receive mail with Betterbird
Exec=/usr/local/bin/betterbird %u
Icon=/opt/betterbird/chrome/icons/default/default128.png
Terminal=false
Categories=Network;Email;
MimeType=message/rfc822;x-scheme-handler/mailto;application/x-xpinstall;application/x-extension-ics;text/calendar;text/vcard;text/x-vcard;x-scheme-handler/webcal;x-scheme-handler/webcals;x-scheme-handler/mid;
StartupNotify=true
StartupWMClass=eu.betterbird.Betterbird
Keywords=Email;E-mail;Calendar;Thunderbird;
Actions=ComposeMessage;OpenAddressBook;
# Written by the mesh (module betterbird, novox/hq ADR 0316 §3), in place of the community package's entry:
# it starts Betterbird through the module's start, and names the icon in the installation, with no link.
[Desktop Action ComposeMessage]
Name=Write new message
Exec=/usr/local/bin/betterbird -compose
[Desktop Action OpenAddressBook]
Name=Open address book
Exec=/usr/local/bin/betterbird -addressbook
@@ -1,3 +0,0 @@
{
"prefs": {}
}
@@ -1,3 +0,0 @@
{
"tags": {}
}
@@ -1,253 +0,0 @@
{
"module": "betterbird",
"version": "1",
"upgrade": {
"policy": "record",
"why": "a new build may remove the community package betterbird-bin and replaces the installation in /opt/betterbird, which a running Betterbird has open: the switch on each node and every upgrade wait for the operator, who quits Betterbird first and then pushes (novox/hq ADR 0316 §4, §5)"
},
"requires": [
"x11-display"
],
"invokes": [
"seat:mesh-controller.settings",
"seat:mesh-controller.nodes",
"seat:mesh-controller.node",
"betterbird.betterbird_derive"
],
"tools": [
"betterbird_status",
"betterbird_prefs",
"betterbird_config",
"betterbird_config_apply",
"betterbird_user_js",
"betterbird_log",
"betterbird_restart",
"betterbird_check",
"betterbird_accounts",
"betterbird_identities",
"betterbird_calendars",
"betterbird_address_books",
"betterbird_filters",
"betterbird_tags",
"betterbird_derive",
"betterbird_drift",
"betterbird_reminder_test"
],
"config": {
"prefs": {
"type": "object",
"description": "Betterbird's preferences the operator sets, by their own names (mailnews.*, calendar.* and the like), laid into prefs.json; an account's, a server's and a tag's are refused, as accounts, the four kinds and tags own them (novox/hq ADR 0329 §6).",
"trusted": true,
"default": {}
},
"accounts": {
"type": "object",
"description": "The mail accounts Betterbird is set up with, each by a name of the operator's: its address, its sender's name and its incoming and outgoing servers; no password, token or cookie (novox/hq ADR 0329 §2).",
"trusted": true,
"default": {}
},
"identities": {
"type": "object",
"description": "The identities beside an account's own, each by a name of the operator's: the address and name it sends as, its signature as a list of lines, and the profile's key to adopt on a node.",
"trusted": true,
"default": {}
},
"calendars": {
"type": "object",
"description": "The calendars Betterbird shows, each by a name of the operator's: where it is and how it is reached, and the profile's key to adopt on a node.",
"trusted": true,
"default": {}
},
"address-books": {
"type": "object",
"description": "The address books Betterbird uses, each by a name of the operator's: where it is and how it is reached, and the profile's key to adopt on a node.",
"trusted": true,
"default": {}
},
"filters": {
"type": "object",
"description": "The message filters of each account, by account: what each matches and what it does with the mail.",
"trusted": true,
"default": {}
},
"tags": {
"type": "object",
"description": "The tags Betterbird offers, each by its own key: its name, colour and order; trusted since issue 751, so a change to it is the operator's to approve.",
"trusted": true,
"default": {}
}
},
"resources": [
{
"id": "configuration-dir",
"type": "directory",
"path": "${machine:account-home}/.config/betterbird",
"owner": "${machine:account}",
"mode": "0755",
"unknown": "move-out",
"knows": ["accounts-record.json", "configuration-record.json", "kept/"]
},
{
"id": "prefs",
"type": "file",
"path": "${machine:account-home}/.config/betterbird/prefs.json",
"owner": "${machine:account}",
"mode": "0644",
"merge": "json",
"takes-config": [
"prefs"
],
"template": "files/prefs.json",
"trusted": true
},
{
"id": "accounts",
"type": "file",
"path": "${machine:account-home}/.config/betterbird/accounts.json",
"owner": "${machine:account}",
"mode": "0600",
"merge": "json",
"takes-config": [
"accounts"
],
"template": "files/accounts.json",
"trusted": true
},
{
"id": "configuration",
"type": "file",
"path": "${machine:account-home}/.config/betterbird/configuration.json",
"owner": "${machine:account}",
"mode": "0600",
"merge": "json",
"takes-config": [
"identities",
"calendars",
"address-books",
"filters"
],
"template": "files/configuration.json",
"trusted": true
},
{
"id": "tags",
"type": "file",
"path": "${machine:account-home}/.config/betterbird/tags.json",
"owner": "${machine:account}",
"mode": "0644",
"merge": "json",
"takes-config": [
"tags"
],
"template": "files/tags.json",
"trusted": true
},
{
"id": "community-package",
"type": "package",
"package": "betterbird-bin",
"absent": true
},
{
"id": "installation",
"type": "archive",
"path": "/opt/betterbird",
"artifact": "archive",
"unknown": "program"
},
{
"id": "owl",
"type": "archive",
"path": "/opt/betterbird/owl",
"artifact": "owl",
"unknown": "program"
},
{
"id": "policies",
"type": "archive",
"path": "/opt/betterbird/distribution",
"artifact": "distribution",
"unknown": "program"
},
{
"id": "spelling",
"type": "archive",
"path": "/opt/betterbird/defaults/pref",
"artifact": "defaults",
"unknown": "program"
},
{
"id": "preparation",
"type": "archive",
"path": "/usr/local/lib/mesh-betterbird",
"artifact": "tools",
"unknown": "program"
},
{
"id": "start",
"type": "file",
"path": "/usr/local/bin/betterbird",
"mode": "0755",
"template": "files/betterbird"
},
{
"id": "launcher",
"type": "file",
"path": "/usr/local/share/applications/eu.betterbird.Betterbird.desktop",
"mode": "0644",
"template": "files/eu.betterbird.Betterbird.desktop"
}
],
"build": {
"artifacts": [
{
"name": "tools",
"kind": "bundle",
"language": "go",
"system": "arch",
"from": "cmd/betterbird-tools",
"binary": "betterbird-tools",
"loads": [
"betterbird-tools"
]
},
{
"name": "archive",
"kind": "archive",
"url": "https://www.betterbird.eu/downloads/LinuxArchive/betterbird-153.4.0esr-bb10.en-US.linux-x86_64.tar.xz",
"sha256": "38dd24890a66b4cf9a45bc24e15192e00c26b929e1bb8df7974c16a4539129e2",
"version": "153.4.0esr-bb10",
"within": "betterbird",
"names-on-purpose": {
"www.betterbird.eu": "Betterbird's project publishes its Linux release there; the build seat fetches it once, by its pinned sha256 (novox/hq ADR 0316 §2)"
}
},
{
"name": "owl",
"kind": "archive",
"url": "https://www.beonex.com/owl/owl.xpi",
"sha256": "a54cc3d52113b34f97942ee19190947dee23561e2217f18db3d80ac023991221",
"version": "1.5.6.1",
"file": "owl.xpi",
"names-on-purpose": {
"www.beonex.com": "Owl's vendor publishes its xpi there; the build seat fetches it once, by its pinned sha256 (novox/hq ADR 0316 §6)"
}
},
{
"name": "distribution",
"kind": "archive",
"from": "install/distribution"
},
{
"name": "defaults",
"kind": "archive",
"from": "install/defaults-pref"
},
{
"name": "files",
"kind": "archive",
"from": "files"
}
]
}
}
@@ -1,6 +1,7 @@
{ {
"module": "blueman", "module": "blueman",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
], ],
@@ -1,6 +1,7 @@
{ {
"module": "bluetooth", "module": "bluetooth",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"package-manager", "package-manager",
"service-manager" "service-manager"
@@ -0,0 +1,3 @@
{
"bucket": "${bound:s3-bucket:bucket}"
}
@@ -0,0 +1,3 @@
{
"mesh-range": "${machine:mesh-range}"
}
@@ -1,8 +1,22 @@
{ {
"module": "brother", "module": "brother",
"version": "1", "version": "0.1",
"class": "core",
"requires": [ "requires": [
"s3-bucket" {
"name": "s3-bucket",
"shares": [
{
"to": "seat:node-files",
"methods": [
"put"
]
}
]
}
],
"invokes": [
"seat:node-files.upload"
], ],
"binds": { "binds": {
"s3-bucket": "${dir:state}/store-binding.json" "s3-bucket": "${dir:state}/store-binding.json"
@@ -199,6 +213,21 @@
"mode": "0600", "mode": "0600",
"template": "files/store.json" "template": "files/store.json"
}, },
{
"id": "bucket",
"type": "file",
"path": "${dir:state}/bucket.json",
"mode": "0644",
"template": "files/bucket.json"
},
{
"id": "fetch",
"type": "file",
"path": "${dir:state}/fetch.json",
"owner": "brother-device",
"mode": "0600",
"template": "files/fetch.json"
},
{ {
"id": "device", "id": "device",
"type": "process", "type": "process",
@@ -213,11 +242,13 @@
"BROTHER_SETTINGS": "${dir:state}/settings.json", "BROTHER_SETTINGS": "${dir:state}/settings.json",
"BROTHER_ADMIN_PASSWORD": "${dir:state}/admin-password.secret", "BROTHER_ADMIN_PASSWORD": "${dir:state}/admin-password.secret",
"BROTHER_BROKER": "${dir:state}/broker-device.secret", "BROTHER_BROKER": "${dir:state}/broker-device.secret",
"BROTHER_STORE": "${dir:state}/store.json" "BROTHER_STORE": "${dir:state}/store.json",
"BROTHER_FETCH": "${dir:state}/fetch.json"
}, },
"restart-on": [ "restart-on": [
"settings", "settings",
"store" "store",
"fetch"
], ],
"bus": { "bus": {
"queues": [ "queues": [
@@ -228,6 +259,9 @@
], ],
"emits": [ "emits": [
"scan.added" "scan.added"
],
"invokes": [
"seat:document-converter.convert"
] ]
}, },
"health": { "health": {
@@ -267,7 +301,8 @@
"brother" "brother"
], ],
"env": { "env": {
"BROTHER_SETTINGS": "${dir:state}/settings.json" "BROTHER_SETTINGS": "${dir:state}/settings.json",
"BROTHER_BUCKET": "${dir:state}/bucket.json"
} }
}, },
{ {
@@ -0,0 +1,25 @@
{
"module": "buildah",
"version": "0.1",
"class": "leaf",
"capabilities": [
"package-manager",
"user-namespaces"
],
"provides": [
{
"name": "rootless-image-build",
"reach": "machine",
"credential": {
"form": "none"
}
}
],
"resources": [
{
"id": "buildah",
"type": "package",
"package": "buildah"
}
]
}
@@ -1,6 +1,7 @@
{ {
"module": "ca-trust", "module": "ca-trust",
"version": "1", "version": "0.1",
"class": "core",
"slug": "catrust", "slug": "catrust",
"capabilities": [ "capabilities": [
"service-manager" "service-manager"
@@ -5,9 +5,5 @@ agent='${machine:agent-account}'
if [ "$(id -un)" = "$agent" ]; then if [ "$(id -un)" = "$agent" ]; then
exec claude "$@" exec claude "$@"
fi fi
# Another account, the operator's, becomes the agent's through its own sudo: the person is the authority. The # Another account, the operator's, becomes the agent's through its own sudo: the person is the authority.
# operator's override of the guard travels only when it is set in this shell, as it would reach claude.
if [ -n "$MESH_GUARD_OVERRIDE" ]; then
exec sudo -iu "$agent" env MESH_GUARD_OVERRIDE="$MESH_GUARD_OVERRIDE" claude "$@"
fi
exec sudo -iu "$agent" claude "$@" exec sudo -iu "$agent" claude "$@"
@@ -1,6 +1,7 @@
{ {
"module": "claude-code", "module": "claude-code",
"version": "1", "version": "0.1",
"class": "leaf",
"moved": true, "moved": true,
"slug": "agent", "slug": "agent",
"capabilities": [ "capabilities": [
@@ -11,6 +12,25 @@
{ {
"name": "gitea-read", "name": "gitea-read",
"optional": true "optional": true
},
{
"name": "finding-events",
"storage": "stream",
"template": "events",
"options": {
"events": [
"finding-written.*",
"finding-cleared.*",
"findings-stated.*"
],
"max-age-days": 7,
"max-mib": 8
}
},
{
"name": "findings",
"storage": "key-value",
"template": "state"
} }
], ],
"binds": { "binds": {
@@ -22,21 +42,47 @@
"uses": [ "uses": [
"operator-channel" "operator-channel"
], ],
"invokes": [
"seat:mesh-hand-acts.warranted",
"seat:mesh-hand-acts.hand-act",
"seat:mesh-catalog.seat-definitions",
"seat:mesh-catalog.revision",
"seat:mesh-catalog.registrations",
"seat:mesh-delivery.source",
"mesh-delivery-assigner.assigner_read_assignments",
"seat:anthropic-licence-manager.bindings",
"seat:anthropic-licence-manager.current",
"seat:mesh-vault.get",
"seat:operator-channel.notify"
],
"consumes": [
"mesh-catalog.catalog-revision",
"mesh-catalog.registration-changed",
"mesh-delivery.source-moved",
"mesh-delivery-assigner.views.assignments",
"mesh-catalog.seat-definition-changed",
"mesh-catalog.seat-definition-removed",
"mesh-conditions.findings-asked",
"claude-licence-manager.holdings.asked",
"claude-licence-manager.binding.changed.*",
"mesh-vault.secret-changed"
],
"state": [ "state": [
"servers", "servers",
"holdings", "holdings",
"config", "config",
"proposals", "proposals",
"questions", "questions",
"memory" "memory",
"waits"
], ],
"reads": [ "emits": [
"claude-licence-manager.bindings" "judged",
"holdings-changed"
], ],
"tools": [ "tools": [
"claude_code_status", "claude_code_status",
"claude_code_render", "claude_code_render",
"claude_code_guard",
"claude_code_pull", "claude_code_pull",
"claude_code_grant", "claude_code_grant",
"claude_code_add_api_key", "claude_code_add_api_key",
@@ -67,6 +113,7 @@
"claude_code_proposals", "claude_code_proposals",
"claude_code_ask", "claude_code_ask",
"claude_code_answer", "claude_code_answer",
"claude_code_wait",
"claude_code_settings_get", "claude_code_settings_get",
"claude_code_settings_set", "claude_code_settings_set",
"claude_code_settings_clear", "claude_code_settings_clear",
@@ -81,7 +128,11 @@
"claude_code_home_removed", "claude_code_home_removed",
"claude_code_home_restore", "claude_code_home_restore",
"claude_code_judge", "claude_code_judge",
"claude_code_judged" "claude_code_judged",
"claude_code_first_views",
"claude_code_first_view_again",
"claude_code_seat_list",
"claude_code_seat_list_again"
], ],
"data": { "data": {
"own": [ "own": [
@@ -208,7 +259,16 @@
"path": "${dir:state}/settings.json", "path": "${dir:state}/settings.json",
"mode": "0600", "mode": "0600",
"owner": "${machine:account}", "owner": "${machine:account}",
"takes-config": ["role", "mcp_servers", "managed_settings", "instructions", "output_styles", "skills", "commands", "agents"], "takes-config": [
"role",
"mcp_servers",
"managed_settings",
"instructions",
"output_styles",
"skills",
"commands",
"agents"
],
"merge": "json", "merge": "json",
"template": "files/settings.json" "template": "files/settings.json"
} }
@@ -234,7 +294,8 @@
"env": { "env": {
"MESH_CLAUDE_CODE_STATE": "${dir:state}", "MESH_CLAUDE_CODE_STATE": "${dir:state}",
"MESH_CLAUDE_CODE_FACTS": "${dir:state}/facts.json", "MESH_CLAUDE_CODE_FACTS": "${dir:state}/facts.json",
"MESH_CLAUDE_CODE_SETTINGS": "${dir:state}/settings.json" "MESH_CLAUDE_CODE_SETTINGS": "${dir:state}/settings.json",
"MESH_CLAUDE_CODE_FORGE": "${dir:state}/gitea-read.secret"
} }
}, },
{ {
@@ -1 +0,0 @@
postgresql://${bound:postgres-database:as}:${secret:postgres-database}@${bound:postgres-database:at}:${bound:postgres-database:port}/${bound:postgres-database:as}
@@ -3,5 +3,11 @@
"floor_minutes": 60, "floor_minutes": 60,
"failures_to_notify": 3, "failures_to_notify": 3,
"cooldown_hours": 24, "cooldown_hours": 24,
"refresh_warn_days": 3 "refresh_warn_days": 3,
"switch_auto": true,
"switch_at_pct": 99,
"room_below_pct": 90,
"warn_at_pct": 90,
"usage_minutes": 5,
"usage_stale_minutes": 15
} }
@@ -1,29 +1,86 @@
{ {
"module": "claude-licence-manager", "module": "claude-licence-manager",
"version": "1", "version": "0.1",
"class": "core",
"slug": "licmgr", "slug": "licmgr",
"runs-as": "claude-licence-manager",
"requires": [ "requires": [
"postgres-database", {
"secret" "name": "licences",
"storage": "key-value",
"template": "state",
"options": {
"history": 1
}
},
{
"name": "bindings",
"storage": "key-value",
"template": "state",
"options": {
"history": 8
}
},
{
"name": "leases",
"storage": "key-value",
"template": "state",
"options": {
"history": 1,
"key-ttl": true
}
},
{
"name": "offered",
"storage": "key-value",
"template": "state",
"options": {
"history": 1,
"key-ttl": true
}
},
{
"name": "carried",
"storage": "key-value",
"template": "state",
"options": {
"history": 1
}
},
{
"name": "conditions",
"storage": "key-value",
"template": "state",
"options": {
"history": 1
}
}
], ],
"contributes": { "logs": [
"postgres-database": { {
"name": "claude_licences", "name": "usage",
"readable": [ "max-age-days": 35,
"audit", "max-mib": 256
"binding" },
] {
} "name": "audit",
}, "max-mib": 64
"binds": {
"postgres-database": "${dir:state}/database.json"
},
"secrets": {
"postgres-database": "${dir:state}/database.secret",
"secret": {
"grant-key": "${dir:state}/grant.key"
} }
],
"own-secrets": {
"broker": "${dir:state}/broker"
}, },
"secrets-owner": "claude-licence-manager",
"uses": [
"operator-channel"
],
"invokes": [
"seat:operator-channel.tell",
"seat:mesh-vault.licence-put",
"seat:mesh-vault.get",
"seat:mesh-config.config",
"claude-code.claude_code_grant"
],
"seats": [ "seats": [
{ {
"name": "anthropic-licence-manager", "name": "anthropic-licence-manager",
@@ -63,18 +120,14 @@
"emits": [ "emits": [
"licence.adopted", "licence.adopted",
"licence.refused", "licence.refused",
"licence.bound",
"licence.switched", "licence.switched",
"licence.released",
"licence.rotated",
"licence.failing", "licence.failing",
"usage.read" "usage.read",
"binding.changed",
"holdings.asked"
], ],
"state": [ "consumes": [
"bindings" "claude-code.holdings-changed"
],
"reads": [
"claude-code.holdings"
], ],
"config": { "config": {
"cadence_minutes": { "cadence_minutes": {
@@ -111,69 +164,130 @@
"minimum": 0, "minimum": 0,
"trusted": true, "trusted": true,
"default": 3 "default": 3
},
"switch_auto": {
"type": "boolean",
"description": "Whether the manager moves every consumer off a licence whose weekly usage reaches switch_at_pct, to the licence with the most room; off, it still raises its no-room and near-limit conditions.",
"trusted": true,
"default": true
},
"switch_at_pct": {
"type": "number",
"description": "The weekly usage of a licence, in percent, at which its consumers are moved to the licence with the most room.",
"minimum": 1,
"maximum": 100,
"trusted": true,
"default": 99
},
"room_below_pct": {
"type": "number",
"description": "What the weekly usage of a licence must be below, in percent, for it to be a target of a switch.",
"minimum": 1,
"maximum": 100,
"trusted": true,
"default": 90
},
"warn_at_pct": {
"type": "number",
"description": "The weekly usage of a licence with consumers, in percent, at which it is warned about once.",
"minimum": 1,
"maximum": 100,
"trusted": true,
"default": 90
},
"usage_minutes": {
"type": "number",
"description": "How often each subscription's usage is read, in minutes.",
"minimum": 1,
"maximum": 60,
"trusted": true,
"default": 5
},
"usage_stale_minutes": {
"type": "number",
"description": "How old a subscription's last successful usage reading may grow before its room is not known and it is said, in minutes.",
"minimum": 5,
"maximum": 180,
"trusted": true,
"default": 15
} }
}, },
"resources": [ "resources": [
{
"id": "account",
"type": "user",
"name": "claude-licence-manager",
"shell": "/usr/bin/nologin",
"home": "/var/lib/claude-licence-manager"
},
{ {
"id": "state", "id": "state",
"type": "directory", "type": "directory",
"mode": "0700", "mode": "0700",
"owner": "claude-licence-manager",
"place": ".", "place": ".",
"unknown": "program" "unknown": "program"
}, },
{
"id": "database-url",
"type": "file",
"path": "${dir:state}/database.url",
"mode": "0600",
"template": "files/database.url"
},
{ {
"id": "settings", "id": "settings",
"type": "file", "type": "file",
"path": "${dir:state}/settings.json", "path": "${dir:state}/settings.json",
"mode": "0600", "mode": "0600",
"takes-config": ["cadence_minutes", "floor_minutes", "failures_to_notify", "cooldown_hours", "refresh_warn_days"], "owner": "claude-licence-manager",
"takes-config": [
"cadence_minutes",
"floor_minutes",
"failures_to_notify",
"cooldown_hours",
"refresh_warn_days",
"switch_auto",
"switch_at_pct",
"room_below_pct",
"warn_at_pct",
"usage_minutes",
"usage_stale_minutes"
],
"merge": "json", "merge": "json",
"template": "files/settings.json" "template": "files/settings.json"
},
{
"id": "prepare",
"type": "process",
"name": "claude-licence-manager-prepare",
"artifact": "code",
"run": [
"./claude-licence-manager",
"prepare"
],
"run-once": true,
"env": {
"DATABASE_URL_FILE": "${dir:state}/database.url"
},
"restart-on": [
"database-url"
]
} }
], ],
"tools": [
"licences_switches",
"licences_read_usage",
"licences_switch_now",
"licences_settings",
"licences_kept",
"licences_resync",
"licences_conditions"
],
"build": { "build": {
"artifacts": [ "artifacts": [
{ {
"name": "code", "name": "manager",
"kind": "bundle", "kind": "bundle",
"language": "go", "language": "go",
"system": "arch", "system": "arch",
"from": "cmd/claude-licence-manager", "from": "cmd/manager",
"binary": "claude-licence-manager", "binary": "claude-licence-manager",
"loads": [ "loads": [
"claude-licence-manager" "claude-licence-manager"
], ],
"env": { "env": {
"DATABASE_URL_FILE": "${dir:state}/database.url",
"MESH_LICENCE_STATE": "${dir:state}", "MESH_LICENCE_STATE": "${dir:state}",
"MESH_LICENCE_KEY_FILE": "${dir:state}/grant.key",
"MESH_LICENCE_SETTINGS": "${dir:state}/settings.json" "MESH_LICENCE_SETTINGS": "${dir:state}/settings.json"
} }
}, },
{
"name": "tools",
"kind": "bundle",
"language": "go",
"system": "arch",
"from": "cmd/tools",
"binary": "claude-licence-manager-tools",
"loads": [
"claude-licence-manager-tools"
]
},
{ {
"name": "files", "name": "files",
"kind": "archive", "kind": "archive",
@@ -1,6 +1,7 @@
{ {
"module": "clipmenu", "module": "clipmenu",
"version": "1", "version": "0.1",
"class": "core",
"moved": true, "moved": true,
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
@@ -1,6 +1,7 @@
{ {
"module": "confluence", "module": "confluence",
"version": "1", "version": "0.1",
"class": "leaf",
"slug": "confl", "slug": "confl",
"own-secrets": { "own-secrets": {
"token": "${dir:state}/token" "token": "${dir:state}/token"
@@ -1,6 +1,7 @@
{ {
"module": "cups", "module": "cups",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"package-manager", "package-manager",
"service-manager" "service-manager"
@@ -1,6 +1,7 @@
{ {
"module": "dbus", "module": "dbus",
"version": "1", "version": "0.1",
"class": "core",
"capabilities": [ "capabilities": [
"package-manager", "package-manager",
"service-manager" "service-manager"
@@ -1,6 +1,7 @@
{ {
"module": "desk-channel", "module": "desk-channel",
"version": "1", "version": "0.1",
"class": "core",
"slug": "desk", "slug": "desk",
"runs-as": "desk-channel", "runs-as": "desk-channel",
"claims": [ "claims": [
@@ -1,6 +1,7 @@
{ {
"module": "dev-tools", "module": "dev-tools",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
], ],
@@ -1,12 +1,17 @@
{ {
"module": "disk-load", "module": "disk-load",
"version": "1", "version": "0.1",
"class": "leaf",
"tools": [ "tools": [
"disk_load", "disk_load",
"disk_top", "disk_top",
"disk_filesystems", "disk_filesystems",
"disk_folders",
"disk_devices", "disk_devices",
"cpu_top" "cpu_top",
"disk_readings",
"disk_round",
"disk_measure"
], ],
"build": { "build": {
"artifacts": [ "artifacts": [
@@ -20,7 +25,26 @@
"loads": [ "loads": [
"disk-load" "disk-load"
] ]
},
{
"name": "diskreadings",
"kind": "package",
"language": "go",
"paths": [
"diskreadings"
],
"series": "0.1"
} }
] ]
} },
"state": [
"readings",
{
"name": "rounds",
"per-machine": true
}
],
"reads": [
"mesh-host.data"
]
} }
@@ -1,36 +1,96 @@
{ {
"module": "distribution", "module": "distribution",
"version": "1", "version": "0.1",
"class": "core",
"provides": [ "provides": [
{ {
"name": "artifact-store", "name": "artifact-store",
"scope": "mesh" "scope": "mesh",
"credential": {
"form": "none"
}
} }
], ],
"serves": {
"artifact-store": {
"port": 5100
}
},
"claims": [ "claims": [
{
"name": "container-image-registry",
"scope": "mesh",
"serves": [
"hold",
"list",
"mirror",
"publish",
"publish-part",
"release",
"remove",
"tags",
"versions"
]
},
{
"name": "oci-artifact-registry",
"scope": "mesh",
"serves": [
"hold",
"list",
"publish",
"publish-part",
"release",
"remove",
"versions"
]
},
{ {
"name": "mesh-artifact-store", "name": "mesh-artifact-store",
"scope": "mesh" "scope": "mesh"
} }
], ],
"tools": [
"registry_direct_writes",
"registry_health",
"registry_holds",
"registry_incoming",
"registry_mirrors",
"registry_old_name"
],
"invokes": [
"seat:mesh-builds.reserved",
"mesh-delivery-view.node_haves",
"seat:node-engine.manifest-reads",
"seat:mesh-hand-acts.hand-act",
"seat:mesh-catalog.entry",
"seat:mesh-catalog.registrations",
"seat:mesh-catalog.revision",
"seat:mesh-delivery.source",
"seat:mesh-module-assigner.assignments"
],
"consumes": [
"mesh-delivery-view.delivered",
"node-engine.manifest-reads-changed",
"mesh-conditions.findings-asked",
"mesh-catalog.catalog-revision",
"mesh-catalog.registration-changed",
"mesh-delivery.source-moved"
],
"capabilities": [ "capabilities": [
"container-runtime" "container-runtime"
], ],
"own-secrets": { "own-secrets": {
"broker": "/var/lib/mesh/registry/broker" "broker": "/var/lib/mesh/registry/broker"
}, },
"serves": { "secrets-owner": "distribution",
"artifact-store": {
"port": 5000
}
},
"listens": [ "listens": [
{ {
"name": "registry", "name": "registry",
"port": 5000, "port": 5100,
"protocol": "tcp", "protocol": "tcp",
"from": "mesh", "from": "mesh",
"why": "every machine pulls images and artifacts from here" "why": "every machine pulls images and artifacts from here; distribution's program serves it in front of the store"
} }
], ],
"data": { "data": {
@@ -46,19 +106,28 @@
] ]
}, },
"resources": [ "resources": [
{
"id": "account",
"type": "user",
"name": "distribution",
"shell": "/usr/bin/nologin",
"home": "/var/lib/mesh/registry"
},
{ {
"id": "state", "id": "state",
"type": "directory", "type": "directory",
"path": "/var/lib/mesh/registry", "path": "/var/lib/mesh/registry",
"mode": "0700", "mode": "0700",
"unknown": "program" "unknown": "program",
"owner": "distribution"
}, },
{ {
"id": "registry-data", "id": "registry-data",
"type": "directory", "type": "directory",
"path": "/var/lib/mesh-registry", "path": "/var/lib/mesh-registry",
"mode": "0700", "mode": "0700",
"unknown": "program" "unknown": "program",
"owner": "distribution"
}, },
{ {
"id": "store", "id": "store",
@@ -66,13 +135,47 @@
"name": "mesh-registry", "name": "mesh-registry",
"image": "registry@sha256:a3d8aaa63ed8681a604f1dea0aa03f100d5895b6a58ace528858a7b332415373", "image": "registry@sha256:a3d8aaa63ed8681a604f1dea0aa03f100d5895b6a58ace528858a7b332415373",
"ports": [ "ports": [
"5000:5000" "127.0.0.1:5001:5001"
], ],
"volumes": [ "volumes": [
"/var/lib/mesh-registry:/var/lib/registry" "/var/lib/mesh-registry:/var/lib/registry"
], ],
"env": { "env": {
"REGISTRY_HTTP_ADDR": ":5001",
"REGISTRY_STORAGE_DELETE_ENABLED": "true" "REGISTRY_STORAGE_DELETE_ENABLED": "true"
},
"health": {
"kind": "http",
"endpoint": "registry",
"path": "/v2/",
"status": 200,
"interval": "60s",
"timeout": "10s",
"looks": 2,
"grace": "90s"
}
},
{
"id": "program",
"type": "process",
"name": "distribution",
"artifact": "program",
"run": [
"./distribution"
],
"env": {
"MESH_BROKER_FILE": "/var/lib/mesh/registry/broker",
"MESH_REGISTRY_LOOPBACK": "http://127.0.0.1:5001",
"MESH_REGISTRY_LISTEN": ":5100"
},
"user": "distribution",
"health": {
"kind": "tool",
"tool": "registry_health",
"interval": "60s",
"timeout": "10s",
"looks": 2,
"grace": "90s"
} }
}, },
{ {
@@ -92,5 +195,99 @@
"store" "store"
] ]
} }
] ],
"build": {
"artifacts": [
{
"name": "program",
"kind": "bundle",
"language": "go",
"system": "arch",
"from": "cmd/distribution",
"binary": "distribution"
},
{
"name": "tools",
"kind": "bundle",
"language": "go",
"system": "arch",
"from": "cmd/distribution-tools",
"binary": "distribution-tools",
"loads": [
"distribution-tools"
],
"env": {
"MESH_REGISTRY_CONTAINER": "mesh-registry"
}
}
]
},
"streams": [
{
"name": "distribution-findings",
"events": [
"finding-written.*",
"finding-cleared.*",
"findings-stated.*"
],
"max-age-days": 7,
"max-mib": 16
},
{
"name": "distribution-events",
"events": [
"old-name-closed",
"direct-writes-closed"
],
"max-age-days": 7,
"max-mib": 16
}
],
"objects": [
{
"name": "incoming",
"max-mib": 8192
}
],
"state": [
{
"name": "transfers",
"max-mib": 8
},
{
"name": "idle",
"key-ttl": true,
"max-mib": 8
},
{
"name": "holds",
"max-mib": 8
},
{
"name": "windows",
"max-mib": 8
},
{
"name": "mirrors",
"max-mib": 8
},
{
"name": "findings",
"max-mib": 8
},
{
"name": "taken",
"key-ttl": true,
"max-mib": 8
}
],
"config": {
"ask-taken-bound": {
"type": "string",
"description": "How long the registry keeps the id of a publish ask it took, as a duration such as 10m (design 47 H2 §775): a publish given again with that id within it acts not again but answers the transfer as it stands. The largest caller's bound, the pipeline runner's ask-unanswered-bound, by default.",
"trusted": false,
"runtime": true,
"default": "10m"
}
}
} }
@@ -1,6 +1,7 @@
{ {
"module": "dmenu", "module": "dmenu",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
], ],
@@ -57,12 +57,12 @@ listen-address=127.0.0.1
# upstreams would find itself, and every query it could not answer locally would # upstreams would find itself, and every query it could not answer locally would
# loop until its receive queue filled. That is not theoretical: it filled with # loop until its receive queue filled. That is not theoretical: it filled with
# 15KB of queries and every lookup on the machine hung. no-resolv makes that loop # 15KB of queries and every lookup on the machine hung. no-resolv makes that loop
# impossible: the upstreams are the two lines below, and nothing on the machine # impossible: the upstreams are the two lines below (the module's settings upstream-resolver-first and -second), and nothing on the machine
# can redirect them. The mesh's own names never reach them: the local= line in # can redirect them. The mesh's own names never reach them: the local= line in
# the file above stops them here, answered or refused. # the file above stops them here, answered or refused.
no-resolv no-resolv
server=1.1.1.1 server=${config:upstream-resolver-first}
server=8.8.8.8 server=${config:upstream-resolver-second}
# Both upstreams validate DNSSEC and say so with the Authenticated Data bit, # Both upstreams validate DNSSEC and say so with the Authenticated Data bit,
# and this passes that bit down rather than dropping it, which dnsmasq does # and this passes that bit down rather than dropping it, which dnsmasq does
@@ -1,14 +1,15 @@
# Written by the mesh (module dnsmasq, novox/hq issue 348). Replaced on every push. # Written by the mesh (module dnsmasq, novox/hq issue 348). Replaced on every push.
# #
# The resolver binds its addresses once, at start (bind-interfaces), so it starts only once this # The resolver binds its addresses once, at start (bind-interfaces), so it starts only once this
# machine's private address is there: it waits up to 80 seconds for it, and a start that found it # machine's private address is there: a start that finds it missing fails after at most two seconds and
# missing is tried again every ten seconds rather than left failed. # is tried again every ten seconds (Restart=on-failure, no start limit) until the tunnel has brought it.
# It does not order itself After= or Wants= network-online.target, and its wait is short: the packaged
# unit is Before= network-online.target and nss-lookup.target, and the tunnel is ordered after them, so
# a long wait would hold the tunnel back and a drop-in ordering would be a cycle (issue 1126).
[Unit] [Unit]
After=network-online.target
Wants=network-online.target
StartLimitIntervalSec=0 StartLimitIntervalSec=0
[Service] [Service]
ExecStartPre=/usr/bin/sh -c 'for i in $(seq 1 80); do ip -4 -o addr show to ${machine:address} | grep -q . && exit 0; sleep 1; done; echo "${machine:address} is not on this machine" >&2; exit 1' ExecStartPre=/usr/bin/sh -c 'for i in $(seq 1 2); do ip -4 -o addr show to ${machine:address} | grep -q . && exit 0; sleep 1; done; echo "${machine:address} is not on this machine" >&2; exit 1'
Restart=on-failure Restart=on-failure
RestartSec=10s RestartSec=10s
@@ -1,6 +1,7 @@
{ {
"module": "dnsmasq", "module": "dnsmasq",
"version": "1", "version": "0.1",
"class": "core",
"upgrade": { "upgrade": {
"policy": "record", "policy": "record",
"why": "the mesh's resolver: a build that breaks it can stop a machine resolving the bus, and then neither the gate's rollback nor a push reaches it (hq ADR 0236, issue 260)" "why": "the mesh's resolver: a build that breaks it can stop a machine resolving the bus, and then neither the gate's rollback nor a push reaches it (hq ADR 0236, issue 260)"
@@ -9,7 +10,10 @@
{ {
"name": "wildcard-resolution", "name": "wildcard-resolution",
"scope": "mesh", "scope": "mesh",
"identity": false "identity": false,
"credential": {
"form": "none"
}
} }
], ],
"requires": [ "requires": [
@@ -35,6 +39,22 @@
"dnsmasq_names", "dnsmasq_names",
"dnsmasq_resolve" "dnsmasq_resolve"
], ],
"config": {
"upstream-resolver-first": {
"type": "string",
"description": "The first public resolver this resolver forwards to for every name that is not the mesh's own, as an IP address. It is placed as a server line beside no-resolv, so it must never be an address that resolves through this machine; both upstreams should validate DNSSEC, since the authenticated-data bit is passed down (ADR 0194, ADR 0223). Set per node or for the whole mesh.",
"trusted": false,
"pattern": "^[0-9A-Fa-f.:]+$",
"default": "1.1.1.1"
},
"upstream-resolver-second": {
"type": "string",
"description": "The second public resolver this resolver forwards to, as an IP address, tried beside the first so one upstream being down does not stop name resolution. The same rules as upstream-resolver-first.",
"trusted": false,
"pattern": "^[0-9A-Fa-f.:]+$",
"default": "8.8.8.8"
}
},
"listens": [ "listens": [
{ {
"name": "dns-udp", "name": "dns-udp",
@@ -1,6 +1,7 @@
{ {
"module": "docker-compose", "module": "docker-compose",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
], ],
@@ -1 +1 @@
{"live-restore": true, "insecure-registries": ["${seat:mesh-artifact-store:reach}"], "log-driver": "json-file", "log-opts": {"max-size": "${config:log-max-size}", "max-file": "${config:log-max-file}"}} {"live-restore": true, "insecure-registries": ["${seat:container-image-registry:reach}"], "log-driver": "json-file", "log-opts": {"max-size": "${config:log-max-size}", "max-file": "${config:log-max-file}"}}
@@ -1,13 +1,14 @@
{ {
"module": "docker", "module": "docker",
"version": "1", "version": "0.1",
"class": "core",
"capabilities": [ "capabilities": [
"package-manager", "package-manager",
"service-manager", "service-manager",
"privileged" "privileged"
], ],
"invokes": [ "invokes": [
"seat:mesh-controller.images" "seat:mesh-artifact-sweep.images"
], ],
"claims": [ "claims": [
{ {
@@ -33,6 +34,7 @@
"docker_disk_usage", "docker_disk_usage",
"docker_networks", "docker_networks",
"docker_volumes", "docker_volumes",
"docker_volumes_remove_anonymous",
"docker_events", "docker_events",
"docker_daemon_config", "docker_daemon_config",
"docker_unlabelled", "docker_unlabelled",
@@ -1,6 +1,7 @@
{ {
"module": "dunst", "module": "dunst",
"version": "1", "version": "0.1",
"class": "core",
"moved": true, "moved": true,
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
@@ -1,6 +1,7 @@
{ {
"module": "fail2ban", "module": "fail2ban",
"version": "1", "version": "0.1",
"class": "core",
"capabilities": [ "capabilities": [
"firewall" "firewall"
], ],
@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# The wallpaper (module feh, novox/hq ADR 0208). Owned by the mesh: replaced at every push. The # The wallpaper (module feh, novox/hq ADR 0208). Owned by the mesh: replaced at every delivery. The
# session's start runs it, and so may anything that wants the declared wallpaper back. The image is # session's start runs it, and so may anything that wants the declared wallpaper back. The image is
# the module's own, in ~/.local/share/feh/wallpapers. feh_set changes the wallpaper for a session # the module's own, in ~/.local/share/feh/wallpapers. feh_set changes the wallpaper for a session
# without touching this file. # without touching this file (design 47 H1, proof 1 (second run): delivered by its pipeline, 2026-11-21).
feh --no-fehbg --bg-fill "$HOME/.local/share/feh/wallpapers/default.jpg" feh --no-fehbg --bg-fill "$HOME/.local/share/feh/wallpapers/default.jpg"
@@ -1,6 +1,7 @@
{ {
"module": "feh", "module": "feh",
"version": "1", "version": "0.1",
"class": "leaf",
"moved": true, "moved": true,
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
@@ -1,6 +1,7 @@
{ {
"module": "flatpak", "module": "flatpak",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
], ],
@@ -1,6 +1,7 @@
{ {
"module": "fonts", "module": "fonts",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
], ],
@@ -1,6 +1,7 @@
{ {
"module": "forticlient", "module": "forticlient",
"version": "1", "version": "0.1",
"class": "leaf",
"upgrade": { "upgrade": {
"policy": "record", "policy": "record",
"why": "its adapter routes the company's domains on the machine a person works on: a build that breaks it cuts the person off from work names until a person pushes the next (hq ADR 0236, ADR 0247)" "why": "its adapter routes the company's domains on the machine a person works on: a build that breaks it cuts the person off from work names until a person pushes the next (hq ADR 0236, ADR 0247)"
@@ -1 +1 @@
{} {"main-mergers": ["jschoubben"]}
@@ -1 +1 @@
{"repositories": ${config:repositories}} {"repositories": ${config:repositories}, "keep-main-rules": ${config:keep-main-rules}}
@@ -5,3 +5,8 @@ GITEA__database__NAME=${bound:postgres-database:as}
GITEA__database__USER=${bound:postgres-database:as} GITEA__database__USER=${bound:postgres-database:as}
GITEA__database__PASSWD=${secret:postgres-database} GITEA__database__PASSWD=${secret:postgres-database}
GITEA__webhook__ALLOWED_HOST_LIST=172.17.0.1 GITEA__webhook__ALLOWED_HOST_LIST=172.17.0.1
# Issue 1966: cap the forge's own pool; the store's 100 connections are shared by every module on this machine.
# SSH git operations go through the forge's private API, so this pool carries them.
GITEA__database__MAX_OPEN_CONNS=${config:database-max-open-connections}
GITEA__database__MAX_IDLE_CONNS=${config:database-max-idle-connections}
GITEA__database__CONN_MAX_LIFETIME=${config:database-connection-lifetime}
@@ -1,6 +1,7 @@
{ {
"module": "gitea", "module": "gitea",
"version": "1", "version": "0.1",
"class": "core",
"moved": true, "moved": true,
"requires": [ "requires": [
"postgres-database", "postgres-database",
@@ -41,14 +42,9 @@
"emits": [ "emits": [
"repo.created", "repo.created",
"issue.opened", "issue.opened",
"pull.merged",
"pull.updated",
"pull.closed",
"forge.push", "forge.push",
"forge.create", "forge.create",
"forge.delete",
"forge.fork", "forge.fork",
"forge.status",
"forge.pull-request.opened", "forge.pull-request.opened",
"forge.pull-request.reopened", "forge.pull-request.reopened",
"forge.pull-request.synchronized", "forge.pull-request.synchronized",
@@ -85,10 +81,6 @@
"forge.wiki.changed", "forge.wiki.changed",
"forge.other" "forge.other"
], ],
"consumes": [
"mesh-controller.checked",
"node-build-agent.started"
],
"listens": [ "listens": [
{ {
"name": "web", "name": "web",
@@ -122,24 +114,61 @@
"git": { "git": {
"scheme": "http", "scheme": "http",
"port": 3000 "port": 3000
},
"go-package-registry": {
"scheme": "http",
"port": 3000,
"go-path": "/api/packages/novox/go"
} }
}, },
"receives": {
"npm-package-registry": "${dir:grants}/npm.json"
},
"grants": {
"npm-package-registry": "${dir:grants}"
},
"claims": [ "claims": [
{ {
"name": "npm-package-registry", "name": "npm-package-registry",
"scope": "mesh" "scope": "mesh",
"serves": [
"publish",
"publish-part",
"remove",
"versions"
]
},
{
"name": "go-package-registry",
"scope": "mesh",
"serves": [
"publish",
"publish-part",
"remove",
"versions"
]
}, },
{ {
"name": "git", "name": "git",
"scope": "mesh" "scope": "mesh",
"serves": [
"pull",
"branch",
"open-pulls",
"tags",
"trees",
"file",
"contains",
"statuses",
"status",
"comment",
"view",
"note",
"merge-pull",
"tag"
]
} }
], ],
"uses": [
"operator-channel"
],
"needs-approval": [
"gitea_branch_protection_loosen"
],
"data": { "data": {
"own": [ "own": [
{ {
@@ -148,16 +177,29 @@
"class": "valuable", "class": "valuable",
"why": "every repository, its issues and attachments, and the package registry" "why": "every repository, its issues and attachments, and the package registry"
} }
], ]
"consumers": {
"npm-package-registry": {
"class": "rebuildable",
"in": "data",
"why": "a consumer's packages are published again from its source"
}
}
}, },
"config": { "config": {
"database-max-open-connections": {
"type": "number",
"description": "The most connections the forge's own database pool holds open to the store. The store's 100 connections are shared by every module on its machine, and the forge's git operations over ssh go through the forge's private API, which this pool carries: 40 leaves room for the others.",
"trusted": false,
"minimum": 1,
"default": 40
},
"database-max-idle-connections": {
"type": "number",
"description": "The connections the forge's database pool keeps idle, ready for the next request. They count against the store's 100 connections, shared on its machine, so keep this well under the open-connection cap.",
"trusted": false,
"minimum": 0,
"default": 10
},
"database-connection-lifetime": {
"type": "string",
"description": "How long the forge's database pool keeps one connection before it closes and reopens it, as a duration such as 5m. A shorter lifetime gives back connections of the store's 100 connections, shared on its machine, sooner.",
"trusted": false,
"default": "5m"
},
"url": { "url": {
"type": "string", "type": "string",
"description": "The address the module's tools reach the forge at, as a URL; unset, the code falls back to its environment, else this machine's gitea on its port.", "description": "The address the module's tools reach the forge at, as a URL; unset, the code falls back to its environment, else this machine's gitea on its port.",
@@ -170,11 +212,53 @@
"trusted": true, "trusted": true,
"default": {} "default": {}
}, },
"call-retention": {
"type": "number",
"description": "How many days the forge module keeps a merge call in its state calls (design 47 H §766): a call older than this is deleted when a new call is written, oldest first.",
"trusted": false,
"minimum": 1,
"default": 30
},
"keep-main-rules": {
"type": "boolean",
"description": "Whether the module keeps main's branch protection as the mesh wants it. True: when the tools' account's token is minted, main's rule in every repository of the organisation novox is put to no push and the tools' account alone merging, and each apply of the `repositories` value narrows the main rule of the repositories it lists, requiring no status. False (the default): the module changes no existing repository's branch protection, whoever set it at the forge, but takes away a required status it finds on a rule covering main, once (ADR 0534 §1); a repository listed in `repositories` that does not exist is still made, with its first protection.",
"trusted": true,
"default": false
},
"repositories": { "repositories": {
"type": "object", "type": "object",
"description": "The repositories of the organisation novox the mesh holds (ADR 0428): each by name, {\"<name>\": {\"private\": true, \"description\": \"...\"}}. One that does not exist is made by the module's setup login under its own account, its main protected and given a first commit (a README naming the description and a merge-check.sh), its rule narrowed to no push and the tools' merge requiring mesh/repo-check and mesh/merge-gate, and only then moved into the organisation; one that exists only has main's rule put right, its statuses kept. A repository taken out of the value is never touched.", "description": "The repositories of the organisation novox the mesh holds (ADR 0428): each by name, {\"<name>\": {\"private\": true, \"description\": \"...\"}}. One that does not exist is made by the module's setup login under its own account, its main protected and given a first commit (a README naming the description ), its rule narrowed to no push, the tools' account and main-mergers alone merging, and no status required (ADR 0534), and only then moved into the organisation; one that exists only has main's rule put right so. Every other repository has the statuses its main requires taken off; nothing else of a repository out of the value is touched. With keep-main-rules false a listed repository that exists likewise has only its required statuses taken off, once.",
"trusted": true, "trusted": true,
"default": {} "default": {}
},
"main-mergers": {
"type": "list",
"description": "The forge logins that may merge into main beside the tools' account, on every repository of the organisation (ADR 0534 §2): the operator's own, so the operator can always merge by hand at the forge. The tools' account is always on main's merge whitelist; no agent's account belongs here.",
"trusted": true,
"default": [
"jschoubben"
]
},
"ask-taken-bound": {
"type": "string",
"description": "How long the forge module keeps the id of an act of the seat git it took, as a duration such as 10m (design 47 H2 §775): an act given again with that id within it acts not again but answers what the forge holds of it. The largest caller's bound, the pipeline runner's ask-unanswered-bound, by default.",
"trusted": false,
"runtime": true,
"default": "10m"
},
"token-ttl": {
"type": "string",
"description": "How old the forge module's token of an account may grow, as a duration such as 24h (design 47 H2 \u00a7808): a token the vault has kept longer than this, by its changed-at, is minted again, one process at a time, and the one it replaces is deleted at the forge.",
"trusted": false,
"runtime": true,
"default": "24h"
},
"mint-lease": {
"type": "string",
"description": "How long one process of the forge module may hold the lease to mint a token, as a duration such as 60s (design 47 H2 \u00a7808): the lease key mint in the state token-lease lives this long, so a process that died holding it is replaced after it, and a process that finds it taken waits at most this long.",
"trusted": false,
"runtime": true,
"default": "60s"
} }
}, },
"facts": { "facts": {
@@ -213,12 +297,6 @@
"place": ".", "place": ".",
"unknown": "program" "unknown": "program"
}, },
{
"id": "grants",
"type": "directory",
"mode": "0700",
"unknown": "program"
},
{ {
"id": "server-env", "id": "server-env",
"type": "file", "type": "file",
@@ -236,6 +314,9 @@
{ {
"id": "server", "id": "server",
"type": "container", "type": "container",
"restart-on": [
"server-env"
],
"health": { "health": {
"kind": "http", "kind": "http",
"endpoint": "web", "endpoint": "web",
@@ -248,7 +329,8 @@
"env": { "env": {
"DB_TYPE": "postgres", "DB_TYPE": "postgres",
"USER_UID": "1000", "USER_UID": "1000",
"USER_GID": "1000" "USER_GID": "1000",
"SSH_MAX_STARTUPS": "100:30:200"
}, },
"env-file": [ "env-file": [
"${dir:state}/server.env" "${dir:state}/server.env"
@@ -303,7 +385,10 @@
"template": "files/config.json", "template": "files/config.json",
"merge": "json", "merge": "json",
"takes-config": [ "takes-config": [
"url" "url",
"keep-main-rules",
"main-mergers",
"call-retention"
] ]
}, },
{ {
@@ -366,24 +451,35 @@
"MESH_GITEA_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret", "MESH_GITEA_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret",
"MESH_GITEA_TOOLS_USER": "mesh-tools", "MESH_GITEA_TOOLS_USER": "mesh-tools",
"MESH_REPOSITORIES_FILE": "${dir:mesh-state}/repositories.json", "MESH_REPOSITORIES_FILE": "${dir:mesh-state}/repositories.json",
"MESH_REPOSITORIES_OUTCOME": "${dir:runtime-state}/repositories-outcome.json" "MESH_REPOSITORIES_OUTCOME": "${dir:runtime-state}/repositories-outcome.json",
"MESH_GITEA_CONFIG_FILE": "${dir:mesh-state}/config.json"
}, },
"restart-on": [ "restart-on": [
"repositories-file" "repositories-file",
"runtime-config"
] ]
} }
], ],
"provides": [ "provides": [
{ {
"name": "npm-package-registry", "name": "npm-package-registry",
"scope": "mesh", "credential": {
"identity": { "form": "none"
"max": 40, },
"in": "a Gitea user name" "scope": "mesh"
} },
{
"name": "go-package-registry",
"credential": {
"form": "none"
},
"scope": "mesh"
}, },
{ {
"name": "git", "name": "git",
"credential": {
"form": "none"
},
"scope": "mesh" "scope": "mesh"
}, },
{ {
@@ -396,7 +492,11 @@
}, },
{ {
"name": "forge-account", "name": "forge-account",
"scope": "mesh" "credential": {
"form": "none"
},
"scope": "mesh",
"answered-by": "helper"
} }
], ],
"build": { "build": {
@@ -405,15 +505,16 @@
"name": "code", "name": "code",
"kind": "bundle", "kind": "bundle",
"language": "typescript", "language": "typescript",
"needs": [
"mesh-delivery-assigner:program"
],
"entrypoints": [ "entrypoints": [
"index.js", "index.js",
"tools/index.js", "tools/index.js"
"provisioner/index.js"
], ],
"loads": [ "loads": [
"index.js", "index.js",
"tools/index.js", "tools/index.js"
"provisioner/index.js"
], ],
"env": { "env": {
"MESH_GITEA_URL": "http://127.0.0.1:${port:3000}", "MESH_GITEA_URL": "http://127.0.0.1:${port:3000}",
@@ -422,26 +523,25 @@
"MESH_GITEA_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret", "MESH_GITEA_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret",
"MESH_GITEA_TOOLS_USER": "mesh-tools", "MESH_GITEA_TOOLS_USER": "mesh-tools",
"MESH_GITEA_STATE_DIR": "${dir:runtime-state}", "MESH_GITEA_STATE_DIR": "${dir:runtime-state}",
"MESH_RECEIVES": "${dir:grants}/npm.json",
"MESH_GITEA_HOOK_URL": "http://172.17.0.1:3047", "MESH_GITEA_HOOK_URL": "http://172.17.0.1:3047",
"MESH_GITEA_HOOK_PORT": "3047", "MESH_GITEA_HOOK_PORT": "3047",
"MESH_GITEA_HOOK_HOST": "172.17.0.1" "MESH_GITEA_HOOK_HOST": "172.17.0.1"
} }
}, },
{ {
"name": "npm-registry", "name": "package-registry",
"kind": "bundle", "kind": "bundle",
"language": "go", "language": "go",
"system": "arch", "system": "arch",
"from": "cmd/npm-registry", "from": "cmd/package-registry",
"binary": "npm-registry", "binary": "package-registry",
"loads": [ "loads": [
"npm-registry" "package-registry"
], ],
"env": { "env": {
"MESH_GITEA_URL": "http://127.0.0.1:${port:3000}", "MESH_GITEA_URL": "http://127.0.0.1:${port:3000}",
"MESH_GITEA_ADMIN_USER": "mesh-admin", "MESH_GITEA_TOOLS_USER": "mesh-tools",
"MESH_GITEA_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret", "MESH_GITEA_PACKAGES_USER": "mesh-packages",
"MESH_NPM_OWNER": "novox" "MESH_NPM_OWNER": "novox"
} }
}, },
@@ -458,7 +558,6 @@
"env": { "env": {
"MESH_GITEA_URL": "http://127.0.0.1:${port:3000}", "MESH_GITEA_URL": "http://127.0.0.1:${port:3000}",
"MESH_GITEA_TOOLS_USER": "mesh-tools", "MESH_GITEA_TOOLS_USER": "mesh-tools",
"MESH_GITEA_TOKEN_FILE": "${dir:runtime-state}/token",
"MESH_GITEA_PATCH_DIR": "${dir:forge-patches}" "MESH_GITEA_PATCH_DIR": "${dir:forge-patches}"
} }
}, },
@@ -522,6 +621,7 @@
"MESH_GITEA_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret", "MESH_GITEA_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret",
"MESH_GITEA_ORIGINS_FILE": "${dir:mesh-state}/origins", "MESH_GITEA_ORIGINS_FILE": "${dir:mesh-state}/origins",
"MESH_GITEA_SSH_PORT": "222", "MESH_GITEA_SSH_PORT": "222",
"MESH_GITEA_HOST_KEY_FILE": "${dir:data}/ssh/ssh_host_ed25519_key.pub",
"MESH_FORGE_HOST_FILE": "/etc/gitea/forge-host" "MESH_FORGE_HOST_FILE": "/etc/gitea/forge-host"
} }
} }
@@ -535,13 +635,96 @@
} }
], ],
"state": [ "state": [
"bound", {
"announced" "name": "bound",
"max-mib": 8
},
{
"name": "announced",
"max-mib": 8
},
{
"name": "findings",
"max-mib": 8
},
{
"name": "first-views",
"history": 1,
"max-mib": 8
},
{
"name": "transfers",
"max-mib": 8
},
{
"name": "idle",
"key-ttl": true,
"max-mib": 8
},
{
"name": "failed-steps",
"history": 1,
"max-mib": 8
},
{
"name": "calls",
"history": 1,
"max-mib": 8
},
{
"name": "taken",
"key-ttl": true,
"max-mib": 8
},
{
"name": "token-lease",
"key-ttl": true,
"max-mib": 1
}
], ],
"reads": [ "reads": [
"mesh-controller.assignments", "mesh-provisioner.plans",
"mesh-provisioner.provisions",
"ssh-client.keys", "ssh-client.keys",
"mesh-build-go.keys", "mesh-build-go.keys",
"mesh-build-node.keys" "mesh-build-node.keys",
"mesh-build-image.keys"
],
"invokes": [
"seat:mesh-catalog.revision",
"seat:mesh-catalog.registrations",
"seat:mesh-hand-acts.hand-act",
"seat:mesh-builds.reserved",
"seat:mesh-vault.own-put",
"seat:mesh-vault.get"
],
"consumes": [
"mesh-catalog.catalog-revision",
"mesh-catalog.registration-changed",
"mesh-pipeline-runner.step-ended.*.*.*",
"git.branch-moved",
"git.pull-updated",
"git.pull-closed",
"git.pull-merged",
"mesh-conditions.findings-asked",
"mesh-vault.secret-changed"
],
"streams": [
{
"name": "gitea-findings",
"events": [
"finding-written.*",
"finding-cleared.*",
"findings-stated.*"
],
"max-age-days": 7,
"max-mib": 8
}
],
"objects": [
{
"name": "incoming",
"max-mib": 2048
}
] ]
} }
@@ -1,6 +1,7 @@
{ {
"module": "gitlab", "module": "gitlab",
"version": "1", "version": "0.1",
"class": "leaf",
"own-secrets": { "own-secrets": {
"token": "${dir:state}/token" "token": "${dir:state}/token"
}, },
@@ -1,6 +1,7 @@
{ {
"module": "gnome-keyring", "module": "gnome-keyring",
"version": "1", "version": "0.1",
"class": "core",
"moved": true, "moved": true,
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
@@ -1,13 +1,17 @@
{ {
"module": "go", "module": "go",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
], ],
"provides": [ "provides": [
{ {
"name": "go-toolchain", "name": "go-toolchain",
"reach": "machine" "reach": "machine",
"credential": {
"form": "none"
}
} }
], ],
"resources": [ "resources": [
@@ -1,6 +1,7 @@
{ {
"module": "grafana", "module": "grafana",
"version": "1", "version": "0.1",
"class": "leaf",
"emits": [ "emits": [
"alert.firing" "alert.firing"
], ],
@@ -1,7 +1,8 @@
{ {
"module": "hello-web", "module": "hello-web",
"slug": "hello", "slug": "hello",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"container-runtime" "container-runtime"
], ],
@@ -1,6 +1,7 @@
{ {
"module": "home-assistant", "module": "home-assistant",
"version": "1", "version": "0.1",
"class": "leaf",
"slug": "hass", "slug": "hass",
"capabilities": [ "capabilities": [
"container-runtime" "container-runtime"
@@ -1,6 +1,7 @@
{ {
"module": "hostname", "module": "hostname",
"version": "1", "version": "0.1",
"class": "core",
"claims": [ "claims": [
{ {
"name": "node-hostname", "name": "node-hostname",
@@ -1,6 +1,7 @@
{ {
"module": "i3", "module": "i3",
"version": "1", "version": "0.1",
"class": "core",
"moved": true, "moved": true,
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
@@ -1,6 +1,7 @@
{ {
"module": "i3status-rust", "module": "i3status-rust",
"version": "1", "version": "0.1",
"class": "core",
"moved": true, "moved": true,
"capabilities": [ "capabilities": [
"package-manager" "package-manager"
@@ -1,6 +1,7 @@
{ {
"module": "icecast", "module": "icecast",
"version": "1", "version": "0.1",
"class": "leaf",
"requires": [ "requires": [
"route", "route",
"secret" "secret"
@@ -1,12 +1,16 @@
{ {
"module": "influxdb", "module": "influxdb",
"version": "1", "version": "0.1",
"class": "leaf",
"provides": [ "provides": [
{ {
"name": "influxdb-api", "name": "influxdb-api",
"scope": "mesh", "scope": "mesh",
"identity": { "identity": {
"in": "an InfluxDB v1 authorization" "in": "an InfluxDB v1 authorization"
},
"credential": {
"form": "pair"
} }
} }
], ],
@@ -1,6 +1,7 @@
{ {
"module": "invoicing", "module": "invoicing",
"version": "1", "version": "0.1",
"class": "leaf",
"slug": "invoice", "slug": "invoice",
"capabilities": [ "capabilities": [
"container-runtime" "container-runtime"
@@ -1,6 +1,7 @@
{ {
"module": "jira", "module": "jira",
"version": "1", "version": "0.1",
"class": "leaf",
"own-secrets": { "own-secrets": {
"token": "${dir:state}/token" "token": "${dir:state}/token"
}, },
@@ -0,0 +1,13 @@
# Module kernel, novox/hq ADR 0508 §9, issue 1841. After a kernel image is installed, upgraded or removed, the
# fallback kernel's boot entry (or the GRUB menu) is placed again. Written by the mesh; change the module.
[Trigger]
Operation = Install
Operation = Upgrade
Operation = Remove
Type = Path
Target = usr/lib/modules/*/vmlinuz
[Action]
Description = Placing the fallback kernel on the boot menu
When = PostTransaction
Exec = ${dir:state}/boot-entries run
@@ -0,0 +1,133 @@
#!/bin/sh
# The fallback kernel's place on this machine's boot menu (module kernel, novox/hq ADR 0508 §9 and §10,
# issue 1841). Written by the mesh and run as root by mesh-kernel-boot-entries.service at boot and when the
# module is applied, and by the pacman hook 90-mesh-kernel-boot-entries.hook after a kernel is installed,
# upgraded or removed. Replaced on every push; change the module, never this file.
#
# boot-entries run [<root> [<this module's state> [<room needed in /boot, KiB>]]]
#
# The three are arguments only so the module's tests can run this against a stand-in tree.
#
# It reads from the machine which loader booted it, never from a setting:
# systemd-boot the EFI variable LoaderEntrySelected is present: the entry mesh-linux-lts.conf is written
# from the command line the machine booted with.
# GRUB /boot/grub/grub.cfg exists and that variable does not: the menu is generated again, only
# when the set of kernels in /boot differs from the menu's.
# neither it fails loudly. The default entry is never touched.
# And a pacman hook of someone else's that copies kernel images to one fixed name in /boot is moved into this
# module's state first (ADR 0508 §10): it would put the fallback kernel in the default kernel's place.
set -eu
root=/
state='${dir:state}'
[ $# -ge 2 ] && root=$(printf '%s' "$2" | sed 's|/$||')
[ $# -ge 3 ] && state=$3
boot=$root/boot
hooks=$root/etc/pacman.d/hooks
efivar=$root/sys/firmware/efi/efivars/LoaderEntrySelected-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
ours=90-mesh-kernel-boot-entries.hook
# The fallback kernel and its initramfs are about 72 MB in /boot (issue 1836): less room fails the unit
# before a package writes half of them.
need_kib=98304
[ $# -ge 4 ] && need_kib=$4
[ $# -ge 1 ] && [ "$1" = run ] || {
echo "usage: boot-entries run [<root> [<state directory> [<KiB needed>]]]" >&2
exit 2
}
# A hook that is not ours, triggered by kernel images, whose action copies to one fixed name in /boot.
copies_kernels() {
grep -Eqi '^[[:space:]]*Target[[:space:]]*=.*(vmlinuz|usr/lib/modules)' "$1" &&
grep -Eq '^[[:space:]]*Exec[[:space:]]*=.*(cp|install|ln|rsync)[[:space:]].*/boot/[A-Za-z0-9._+-]+([^A-Za-z0-9._+/%$*-]|$)' "$1"
}
if [ -d "$hooks" ]; then
for hook in "$hooks"/*.hook; do
[ -f "$hook" ] || continue
[ "$(basename "$hook")" = "$ours" ] && continue
copies_kernels "$hook" || continue
mkdir -p "$state/taken-over"
mv -f "$hook" "$state/taken-over/$(basename "$hook")"
echo "taken over: the pacman hook $(basename "$hook") copied kernel images to one fixed name in /boot; moved to $state/taken-over/ so each kernel keeps its own package's name"
done
fi
if [ -e "$efivar" ]; then
loader=systemd-boot
elif [ -f "$boot/grub/grub.cfg" ]; then
loader=grub
else
echo "no boot loader found: the machine was not booted by systemd-boot (no LoaderEntrySelected variable) and there is no $boot/grub/grub.cfg; the fallback kernel has no menu to be placed on" >&2
exit 1
fi
# Room first, only while the fallback kernel is not in /boot yet.
if [ ! -e "$boot/vmlinuz-linux-lts" ]; then
free=$(df -Pk "$boot" | awk 'NR==2 {print $4}')
[ -n "$free" ] || free=0
if [ "$free" -lt "$need_kib" ]; then
echo "$boot has $free KiB free and the fallback kernel needs $need_kib KiB: free room there before the kernel is installed" >&2
exit 1
fi
fi
case "$loader" in
systemd-boot)
entries=$boot/loader/entries
cmdline=$(sed -e 's/BOOT_IMAGE=[^ ]*//g' -e 's/initrd=[^ ]*//g' "$root/proc/cmdline" | tr -s ' \n' ' ' | sed -e 's/^ //' -e 's/ $//')
[ -n "$cmdline" ] || {
echo "$root/proc/cmdline holds no command line to boot the fallback kernel with" >&2
exit 1
}
want=$(
echo "title Arch Linux (linux-lts, fallback)"
echo "linux /vmlinuz-linux-lts"
for ucode in intel-ucode.img amd-ucode.img; do
[ -e "$boot/$ucode" ] && echo "initrd /$ucode"
done
echo "initrd /initramfs-linux-lts.img"
echo "options $cmdline"
)
mkdir -p "$entries"
if [ "$(cat "$entries/mesh-linux-lts.conf" 2>/dev/null || true)" = "$want" ]; then
echo "systemd-boot: mesh-linux-lts.conf, as it was"
else
printf '%s\n' "$want" >"$entries/mesh-linux-lts.conf"
echo "systemd-boot: wrote $entries/mesh-linux-lts.conf from the command line the machine booted with; the default entry is as it was"
fi
;;
grub)
cfg=$boot/grub/grub.cfg
menu=$(sed -n 's|^[[:space:]]*linux[[:space:]]*\(/boot\)\{0,1\}/\(vmlinuz-[^[:space:]]*\).*|\2|p' "$cfg" | sort -u)
have=$(cd "$boot" && ls -d vmlinuz-* 2>/dev/null | sort -u || true)
if [ "$menu" = "$have" ]; then
echo "grub: the menu lists the kernels in /boot, left as it is"
else
# GRUB lists kernels in reverse version order, so the fallback kernel would come first and become the
# default entry: the kernel the machine booted is put first (GRUB_TOP_LEVEL; /etc/default/grub still
# overrides it when it sets one), the fallback kernel never.
top=$(tr ' ' '\n' <"$root/proc/cmdline" | sed -n 's|^BOOT_IMAGE=\(.*\)$|\1|p' | head -n 1)
top=$(printf '%s' "$top" | sed 's|.*/||')
case "$top" in
vmlinuz-linux-lts | "") top= ;;
esac
[ -n "$top" ] && [ -e "$boot/$top" ] || top=
if [ -z "$top" ]; then
if [ -e "$boot/vmlinuz-linux" ]; then
top=vmlinuz-linux
else
top=$(printf '%s\n' $have | grep -v '^vmlinuz-linux-lts$' | head -n 1 || true)
fi
fi
if [ -n "$top" ]; then
GRUB_TOP_LEVEL=/boot/$top grub-mkconfig -o "$cfg"
else
grub-mkconfig -o "$cfg"
fi
first=$top
[ -n "$first" ] || first="the menu's own order"
echo "grub: the kernels in /boot changed ($(echo $have | tr '\n' ' ')); the menu is generated again with $first first; the default entry is as it was"
fi
;;
esac
@@ -0,0 +1,71 @@
#!/bin/sh
# The initramfs images as the mesh builds them (module kernel, novox/hq issue 1977). Run by
# mesh-kernel-initramfs.service:
#
# initramfs apply [<the microcode drop-in> [<this module's state> [<preset directory> [<boot directory>]]]]
#
# `apply` builds every image again (mkinitcpio -P) when the drop-in differs from the one the images were last built
# with, kept in the state as `initramfs-built`, and records the drop-in only after mkinitcpio succeeded. Later
# kernel upgrades build the images through the distribution's own hook, with the drop-in in place.
#
# A preset that names the default configuration (ALL_config="/etc/mkinitcpio.conf") makes mkinitcpio pass -c and skip
# mkinitcpio.conf.d, so the drop-in is never read: before building, that line is taken out of the preset, a copy of
# the preset kept in the state's taken-over directory (novox/hq ADR 0508 §10's way with a file the mesh did not
# write); any other ALL_config is left and named. After building, every image must hold microcode in its first
# 64 KiB (the early uncompressed archive), else the unit fails and records nothing. The arguments are only for the
# module's tests.
set -eu
dropin=/etc/mkinitcpio.conf.d/mesh-microcode.conf
state='${dir:state}'
[ $# -ge 2 ] && dropin=$2
[ $# -ge 3 ] && state=$3
presets=/etc/mkinitcpio.d
boot=/boot
[ $# -ge 4 ] && presets=$4
[ $# -ge 5 ] && boot=$5
[ $# -ge 1 ] && [ "$1" = apply ] || {
echo "usage: initramfs apply [<drop-in> [<state directory>]]" >&2
exit 2
}
[ -f "$dropin" ] || {
echo "initramfs: $dropin is not there, so the images cannot be built with the microcode hook" >&2
exit 1
}
if [ -f "$state/initramfs-built" ] && cmp -s "$dropin" "$state/initramfs-built"; then
echo "initramfs: the images were built with this drop-in, as it was"
exit 0
fi
for preset in "$presets"/*.preset; do
[ -f "$preset" ] || continue
if grep -qx 'ALL_config="/etc/mkinitcpio.conf"' "$preset"; then
mkdir -p "$state/taken-over"
cp "$preset" "$state/taken-over/$(basename "$preset")"
grep -vx 'ALL_config="/etc/mkinitcpio.conf"' "$preset" >"$preset.new" || true
cat "$preset.new" >"$preset"
rm -f "$preset.new"
echo "initramfs: $preset named the default configuration, which skips mkinitcpio.conf.d; that line is taken out, a copy is in $state/taken-over"
elif grep -q '^ALL_config=' "$preset"; then
echo "initramfs: $preset sets $(grep '^ALL_config=' "$preset" | head -n 1), so the microcode drop-in may not be read; left as it is"
fi
done
if ! mkinitcpio -P; then
echo "initramfs: mkinitcpio failed; nothing recorded, the next start tries again" >&2
exit 1
fi
missing=
for img in "$boot"/initramfs-*.img; do
[ -e "$img" ] || continue
if ! head -c 65536 "$img" >"$state/image-head.tmp" || ! grep -aq 'kernel/x86/microcode/' "$state/image-head.tmp"; then
missing="$missing $(basename "$img")"
fi
done
rm -f "$state/image-head.tmp"
if [ -n "$missing" ]; then
echo "initramfs: mkinitcpio ran, but no microcode is in the early archive of:$missing; nothing recorded" >&2
exit 1
fi
cp "$dropin" "$state/initramfs-built.new"
mv "$state/initramfs-built.new" "$state/initramfs-built"
echo "initramfs: the images are built with the microcode drop-in"
@@ -0,0 +1,22 @@
[Unit]
Description=The fallback kernel's place on this machine's boot menu
# Module kernel, novox/hq ADR 0508 §9, issue 1841. Starting this unit reads which loader booted the machine and
# places the fallback kernel's boot entry (systemd-boot) or generates the menu again (GRUB); it fails, and says
# why, when there is no loader or the boot partition has no room. The kernel packages are declared after this
# unit, so the entry is in place before they are installed.
After=local-fs.target
Wants=local-fs.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=${dir:state}/boot-entries run
# It writes the boot partition, the pacman hook directory and its own state, and nothing else.
ProtectSystem=strict
ReadWritePaths=/boot ${dir:state} /etc/pacman.d/hooks
ProtectHome=yes
PrivateNetwork=yes
NoNewPrivileges=yes
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,22 @@
[Unit]
Description=The initramfs images with the CPU's current microcode
# Module kernel, novox/hq issue 1977. Starting this unit builds the images again when the microcode drop-in
# changed since they were last built; a failed mkinitcpio fails the unit. The microcode packages are declared
# before this unit.
After=local-fs.target
Wants=local-fs.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=${dir:state}/initramfs apply
# It writes the boot partition, the presets and its own state; mkinitcpio keeps its work in a private /tmp.
ProtectSystem=strict
ReadWritePaths=/boot /etc/mkinitcpio.d ${dir:state}
PrivateTmp=yes
ProtectHome=yes
PrivateNetwork=yes
NoNewPrivileges=yes
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,8 @@
# Module kernel, novox/hq issue 1977. mkinitcpio reads this after /etc/mkinitcpio.conf: it adds the microcode
# hook, which puts the CPU's current microcode (amd-ucode) at the front of every initramfs, so
# every boot entry loads it, the default one too. HOOKS that name it already are left as they are.
# Written by the mesh; change the module.
case "$(declare -p HOOKS)" in
*'"microcode"'*) ;;
*) HOOKS+=(microcode) ;;
esac
@@ -0,0 +1,4 @@
# Written by the mesh's kernel module (systemd-modules-load reads it at boot).
# tun: buildah's network for a RUN line (pasta) and every other user-space tunnel open /dev/net/tun.
# Loaded at boot, so an upgrade that removes the running kernel's modules cannot keep it out later.
tun
@@ -1,6 +1,7 @@
{ {
"module": "kernel", "module": "kernel",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"service-manager" "service-manager"
], ],
@@ -13,7 +14,8 @@
} }
}, },
"tools": [ "tools": [
"kernel_huge_pages" "kernel_huge_pages",
"kernel_boot"
], ],
"resources": [ "resources": [
{ {
@@ -53,6 +55,113 @@
"health": { "health": {
"kind": "unit" "kind": "unit"
} }
},
{
"id": "boot-entries",
"type": "file",
"path": "${dir:state}/boot-entries",
"mode": "0755",
"trusted": true,
"template": "files/boot-entries.sh"
},
{
"id": "boot-unit",
"type": "file",
"path": "/etc/systemd/system/mesh-kernel-boot-entries.service",
"mode": "0644",
"template": "files/mesh-kernel-boot-entries.service"
},
{
"id": "boot-hook",
"type": "file",
"path": "/etc/pacman.d/hooks/90-mesh-kernel-boot-entries.hook",
"mode": "0644",
"template": "files/90-mesh-kernel-boot-entries.hook"
},
{
"id": "boot-apply",
"type": "service",
"unit": "mesh-kernel-boot-entries.service",
"state": "running",
"boot": "enabled",
"restart-on": [
"boot-unit",
"boot-entries"
],
"health": {
"kind": "unit"
}
},
{
"id": "linux-lts",
"type": "package",
"package": "linux-lts"
},
{
"id": "linux-lts-headers",
"type": "package",
"package": "linux-lts-headers"
},
{
"id": "modules-load",
"type": "file",
"path": "/etc/modules-load.d/mesh-kernel.conf",
"mode": "0644",
"template": "files/modules-load.conf"
},
{
"id": "modules-keep",
"type": "package",
"package": "kernel-modules-hook"
},
{
"id": "modules-cleanup",
"type": "service",
"unit": "linux-modules-cleanup.service",
"state": "stopped",
"boot": "enabled"
},
{
"id": "amd-ucode",
"type": "package",
"package": "amd-ucode"
},
{
"id": "microcode-hook",
"type": "file",
"path": "/etc/mkinitcpio.conf.d/mesh-microcode.conf",
"mode": "0644",
"template": "files/mesh-microcode.conf"
},
{
"id": "initramfs",
"type": "file",
"path": "${dir:state}/initramfs",
"mode": "0755",
"trusted": true,
"template": "files/initramfs.sh"
},
{
"id": "initramfs-unit",
"type": "file",
"path": "/etc/systemd/system/mesh-kernel-initramfs.service",
"mode": "0644",
"template": "files/mesh-kernel-initramfs.service"
},
{
"id": "initramfs-apply",
"type": "service",
"unit": "mesh-kernel-initramfs.service",
"state": "running",
"boot": "enabled",
"restart-on": [
"initramfs-unit",
"initramfs",
"microcode-hook"
],
"health": {
"kind": "unit"
}
} }
], ],
"build": { "build": {
@@ -1,6 +1,7 @@
{ {
"module": "keycloak", "module": "keycloak",
"version": "1", "version": "0.1",
"class": "leaf",
"moved": true, "moved": true,
"upgrade": { "upgrade": {
"policy": "record", "policy": "record",
@@ -9,6 +10,7 @@
"provides": [ "provides": [
{ {
"name": "oidc-client", "name": "oidc-client",
"credential": {"form": "pair"},
"scope": "mesh", "scope": "mesh",
"identity": { "identity": {
"max": 255, "max": 255,
@@ -240,6 +242,7 @@
"bound" "bound"
], ],
"reads": [ "reads": [
"mesh-controller.assignments" "mesh-provisioner.plans",
"mesh-provisioner.provisions"
] ]
} }
@@ -0,0 +1,5 @@
[url "ssh://${bound:forge-account:ssh_alias}/"]
insteadOf = ${bound:forge-account:https_base}
insteadOf = ${config:forge}/
[core]
sshCommand = ssh -F ${dir:state}/forge.ssh
@@ -0,0 +1 @@
${bound:forge-account:ssh_alias} ${bound:forge-account:host_key}
@@ -0,0 +1,10 @@
Host ${bound:forge-account:ssh_alias}
HostName ${bound:forge-account:ssh_host}
Port ${bound:forge-account:ssh_port}
HostKeyAlias ${bound:forge-account:ssh_alias}
User git
IdentityFile ~/.ssh/mesh_ed25519
IdentitiesOnly yes
UserKnownHostsFile ${dir:state}/forge.known_hosts
StrictHostKeyChecking yes
BatchMode yes
@@ -1,3 +1,3 @@
MESH_LAB_FORGE=${config:forge} MESH_LAB_FORGE=${config:forge}
MESH_LAB_FORGE_BINDING=${dir:state}/package-registry.json MESH_LAB_FORGE_BINDING=${dir:state}/package-registry.json
MESH_LAB_FORGE_SECRET=${dir:state}/package-registry.secret MESH_LAB_FORGE_GIT=${dir:state}/forge.gitconfig
@@ -1,26 +1,21 @@
{ {
"module": "lab", "module": "lab",
"version": "1", "version": "0.1",
"class": "leaf",
"moved": true,
"capabilities": [ "capabilities": [
"container-runtime", "container-runtime",
"virtualisation" "virtualisation"
], ],
"requires": [ "requires": [
"npm-package-registry", "npm-package-registry",
"forge-account",
"go-toolchain", "go-toolchain",
"node-toolchain" "node-toolchain"
], ],
"contributes": {
"npm-package-registry": {
"access": "read"
}
},
"binds": { "binds": {
"npm-package-registry": "${dir:state}/package-registry.json" "npm-package-registry": "${dir:state}/package-registry.json"
}, },
"secrets": {
"npm-package-registry": "${dir:state}/package-registry.secret"
},
"data": { "data": {
"own": [ "own": [
{ {
@@ -61,11 +56,37 @@
"mode": "0600", "mode": "0600",
"template": "files/lab.env" "template": "files/lab.env"
}, },
{
"id": "forge-git",
"type": "file",
"path": "${dir:state}/forge.gitconfig",
"mode": "0600",
"template": "files/forge.gitconfig"
},
{
"id": "forge-ssh",
"type": "file",
"path": "${dir:state}/forge.ssh",
"mode": "0600",
"template": "files/forge.ssh"
},
{
"id": "forge-known-hosts",
"type": "file",
"path": "${dir:state}/forge.known_hosts",
"mode": "0644",
"template": "files/forge.known_hosts"
},
{ {
"id": "git", "id": "git",
"type": "package", "type": "package",
"package": "git" "package": "git"
}, },
{
"id": "openssh",
"type": "package",
"package": "openssh"
},
{ {
"id": "make", "id": "make",
"type": "package", "type": "package",
@@ -108,7 +129,7 @@
"MESH_LAB_WORK": "${dir:work}", "MESH_LAB_WORK": "${dir:work}",
"MESH_LAB_ENV_FILE": "${dir:state}/lab.env", "MESH_LAB_ENV_FILE": "${dir:state}/lab.env",
"MESH_LAB_FORGE_BINDING": "${dir:state}/package-registry.json", "MESH_LAB_FORGE_BINDING": "${dir:state}/package-registry.json",
"MESH_LAB_FORGE_SECRET": "${dir:state}/package-registry.secret" "MESH_LAB_FORGE_GIT": "${dir:state}/forge.gitconfig"
} }
}, },
{ {
@@ -1,6 +1,7 @@
{ {
"module": "lemurs", "module": "lemurs",
"version": "1", "version": "0.1",
"class": "core",
"capabilities": [ "capabilities": [
"package-manager", "package-manager",
"service-manager", "service-manager",
@@ -1,6 +1,7 @@
{ {
"module": "letta", "module": "letta",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"container-runtime" "container-runtime"
], ],
@@ -1,6 +1,7 @@
{ {
"module": "local-model-consumer", "module": "local-model-consumer",
"version": "1", "version": "0.1",
"class": "leaf",
"slug": "local", "slug": "local",
"requires": [ "requires": [
"model-access" "model-access"
@@ -1,6 +1,7 @@
{ {
"module": "localization", "module": "localization",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"service-manager" "service-manager"
], ],
@@ -1,6 +1,7 @@
{ {
"module": "logrotate", "module": "logrotate",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"package-manager", "package-manager",
"service-manager" "service-manager"
@@ -1,6 +1,7 @@
{ {
"module": "mailu", "module": "mailu",
"version": "1", "version": "0.1",
"class": "leaf",
"upgrade": { "upgrade": {
"policy": "record", "policy": "record",
"why": "people's mail: any change to how its containers are declared recreates them together in one send, and the mail is down for everyone until they are up again — a person chooses the moment (hq ADR 0242, issue 295)" "why": "people's mail: any change to how its containers are declared recreates them together in one send, and the mail is down for everyone until they are up again — a person chooses the moment (hq ADR 0242, issue 295)"
@@ -215,12 +216,6 @@
"class": "rebuildable", "class": "rebuildable",
"why": "certificates, issued again" "why": "certificates, issued again"
}, },
{
"id": "automx",
"path": "${dir:data-automx}",
"class": "rebuildable",
"why": "client autoconfiguration, written again"
},
{ {
"id": "fetchmail", "id": "fetchmail",
"path": "${dir:data-fetchmail}", "path": "${dir:data-fetchmail}",
@@ -307,12 +302,6 @@
"mode": "0700", "mode": "0700",
"unknown": "program" "unknown": "program"
}, },
{
"id": "data-automx",
"type": "directory",
"mode": "0700",
"unknown": "program"
},
{ {
"id": "config-env", "id": "config-env",
"type": "file", "type": "file",
@@ -677,14 +666,35 @@
"path": "${dir:mesh-state}/config.json", "path": "${dir:mesh-state}/config.json",
"mode": "0600", "mode": "0600",
"template": "files/config.json", "template": "files/config.json",
"takes-config": ["domain", "proxy-address", "sitename", "website", "url", "container"], "takes-config": [
"domain",
"proxy-address",
"sitename",
"website",
"url",
"container"
],
"merge": "json" "merge": "json"
}, },
{
"id": "program-automx",
"type": "archive",
"path": "${dir:state}/automx",
"artifact": "automx",
"unknown": "program"
},
{ {
"id": "automx", "id": "automx",
"type": "container", "type": "container",
"name": "mailu-automx", "name": "mailu-automx",
"artifact": "automx", "artifact": "alpine",
"health": {
"kind": "http",
"endpoint": "autoconfig",
"path": "/",
"status": 200,
"body": "Show Thunderbird-style"
},
"network": "mailu", "network": "mailu",
"env-file": [ "env-file": [
"${dir:state}/mailu.env" "${dir:state}/mailu.env"
@@ -693,17 +703,18 @@
"4243" "4243"
], ],
"volumes": [ "volumes": [
"${dir:data-automx}:/data" "${dir:state}/automx:/opt/mesh:ro"
],
"args": [
"/opt/mesh/automx"
],
"restart-on": [
"program-automx",
"config-env"
] ]
} }
], ],
"build": { "build": {
"on": [
{
"arg": "PYTHON_BASE",
"image": "python@sha256:25f3cfeaceca14921366af4d1240b56457ef46273bdb508c7b0e8f469f6fd228"
}
],
"artifacts": [ "artifacts": [
{ {
"name": "code", "name": "code",
@@ -730,8 +741,16 @@
}, },
{ {
"name": "automx", "name": "automx",
"kind": "image", "kind": "bundle",
"from": "automx/Dockerfile" "language": "go",
"system": "alpine",
"from": "cmd/automx",
"binary": "automx"
},
{
"name": "alpine",
"kind": "upstream",
"from": "alpine@sha256:28bd5fe8b56d1bd048e5babf5b10710ebe0bae67db86916198a6eec434943f8b"
}, },
{ {
"name": "files", "name": "files",
@@ -747,6 +766,9 @@
"identity": { "identity": {
"max": 64, "max": 64,
"in": "a mailbox's local part" "in": "a mailbox's local part"
},
"credential": {
"form": "pair"
} }
} }
], ],
@@ -1,6 +1,7 @@
{ {
"module": "marrytts", "module": "marrytts",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"container-runtime" "container-runtime"
], ],
@@ -1,6 +1,7 @@
{ {
"module": "matrix", "module": "matrix",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"container-runtime" "container-runtime"
], ],
@@ -1,6 +1,7 @@
{ {
"module": "memory-pressure", "module": "memory-pressure",
"version": "1", "version": "0.1",
"class": "leaf",
"capabilities": [ "capabilities": [
"package-manager", "package-manager",
"service-manager" "service-manager"
@@ -0,0 +1,5 @@
{
"capacity": 0,
"cores-per-step": 6,
"build-hours": ""
}

Some files were not shown because too many files have changed in this diff Show More