From 04270ef75490385981d4980ae627880842249346 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 11 Nov 2026 10:34:52 +0100 Subject: [PATCH 001/553] CT1: the seat mesh-pipeline-runner, its twelve verbs with callers and class, its kept events and acts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Definition and fixtures only: the generated Go and TypeScript contracts and the module.json artifacts come with CT11, once the reader of G-9's forms and the generator read them (seatgen refuses these forms today). Builds: design 47 G §306, §394, §391 (verbs, callers, class), §73, §332 (event subjects; group-ended under branch and group), §331, §396 (each event's keep object: 90 days and its cap), §65, §203, §266 (acts pipeline, bound 30m), §261 (fixtures name each subject), §419 (pipeline-ended: tests, over-budget yes/no), §441 (widens says could not run). Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ --- .../mesh-pipeline-runner/fixtures/events.json | 315 ++++ .../mesh-pipeline-runner/fixtures/states.json | 81 + .../mesh-pipeline-runner/fixtures/verbs.json | 147 ++ .../seats/mesh-pipeline-runner/seat.json | 1554 +++++++++++++++++ 4 files changed, 2097 insertions(+) create mode 100644 contracts/seats/mesh-pipeline-runner/fixtures/events.json create mode 100644 contracts/seats/mesh-pipeline-runner/fixtures/states.json create mode 100644 contracts/seats/mesh-pipeline-runner/fixtures/verbs.json create mode 100644 contracts/seats/mesh-pipeline-runner/seat.json diff --git a/contracts/seats/mesh-pipeline-runner/fixtures/events.json b/contracts/seats/mesh-pipeline-runner/fixtures/events.json new file mode 100644 index 00000000..cdd9d6c9 --- /dev/null +++ b/contracts/seats/mesh-pipeline-runner/fixtures/events.json @@ -0,0 +1,315 @@ +[ + { + "name": "a pipeline started with the steps its policy gives", + "of": "event:pipeline-started", + "subject": "mesh.seat.mesh-pipeline-runner.event.pipeline-started.nats.main.0123456789abcdef0123456789abcdef01234567", + "given": { + "pipeline": "main.12.nats", + "module": "nats", + "branch": "main", + "revision": 12, + "source": 3589, + "commit": "0123456789abcdef0123456789abcdef01234567", + "fp": "fp-0123", + "v": 1, + "steps": [ + { + "step": "lint", + "artifact": "nats:program", + "status": "required" + }, + { + "step": "review", + "status": "bypass" + } + ], + "at": "2026-11-10T10:00:00Z" + } + }, + { + "name": "a pipeline ended passed, an optional step failed, over budget and widening named", + "of": "event:pipeline-ended", + "subject": "mesh.seat.mesh-pipeline-runner.event.pipeline-ended.nats.main.0123456789abcdef0123456789abcdef01234567", + "given": { + "pipeline": "main.12.nats", + "module": "nats", + "branch": "main", + "revision": 12, + "source": 3589, + "commit": "0123456789abcdef0123456789abcdef01234567", + "fp": "fp-0123", + "v": 1, + "outcome": "passed", + "steps": [ + { + "step": "lint", + "artifact": "nats:program", + "status": "required", + "outcome": "passed", + "fingerprint": "fp-0123", + "seat": "node-build-go", + "node": "ace", + "ask": "m2kx9a1b3c4d5e" + }, + { + "step": "unit", + "artifact": "nats:program", + "status": "required", + "outcome": "carried", + "fingerprint": "fp-0123", + "carried-from": "main.11.nats", + "tests": { + "unit": 42 + } + }, + { + "step": "integration", + "artifact": "nats:program", + "status": "optional", + "outcome": "failed", + "why": "TestTheBusWhole failed", + "fingerprint": "fp-0123", + "seat": "node-build-go", + "node": "g14", + "tests": { + "integration": 3 + } + }, + { + "step": "composition", + "status": "required", + "outcome": "passed", + "seat": "mesh-wants" + }, + { + "step": "review", + "status": "bypass", + "outcome": "bypassed" + }, + { + "step": "approval", + "status": "required", + "outcome": "passed" + } + ], + "tests": { + "unit": 42, + "integration": 3 + }, + "over-budget": true, + "widens": [ + { + "what": "serving part", + "name": "mesh-build-go:program", + "said": "its test runner" + } + ], + "started": "2026-11-10T10:00:00Z", + "ended": "2026-11-10T10:20:00Z" + } + }, + { + "name": "a pipeline ended failed, naming the step that held it", + "of": "event:pipeline-ended", + "subject": "mesh.seat.mesh-pipeline-runner.event.pipeline-ended.nats.main.0123456789abcdef0123456789abcdef01234567", + "given": { + "pipeline": "main.12.nats", + "module": "nats", + "branch": "main", + "revision": 12, + "source": 3589, + "commit": "0123456789abcdef0123456789abcdef01234567", + "fp": "fp-0123", + "v": 1, + "outcome": "failed", + "why": "unit of nats:program failed", + "steps": [ + { + "step": "unit", + "artifact": "nats:program", + "status": "required", + "outcome": "failed", + "fingerprint": "fp-0123" + }, + { + "step": "approval", + "status": "required", + "outcome": "waiting", + "on": "the operator" + } + ], + "over-budget": true + } + }, + { + "name": "a group's one pipeline ended on a watched branch", + "of": "event:group-ended", + "subject": "mesh.seat.mesh-pipeline-runner.event.group-ended.main.registry-1966", + "given": { + "v": 1, + "group": "registry-1966", + "branch": "main", + "revision": 12, + "source": 3589, + "outcome": "passed", + "pipelines": [ + { + "pipeline": "main.12.nats", + "module": "nats", + "branch": "main", + "revision": 12, + "source": 3589, + "commit": "0123456789abcdef0123456789abcdef01234567", + "fp": "fp-0123", + "v": 1, + "group": "registry-1966", + "outcome": "passed", + "steps": [ + { + "step": "lint", + "artifact": "nats:program", + "status": "required", + "outcome": "passed", + "fingerprint": "fp-0123", + "seat": "node-build-go", + "node": "ace", + "ask": "m2kx9a1b3c4d5e" + } + ] + } + ], + "ended": "2026-11-10T10:20:00Z" + } + }, + { + "name": "a run on request started", + "of": "event:run-started", + "subject": "mesh.seat.mesh-pipeline-runner.event.run-started.nats.main.0123456789abcdef0123456789abcdef01234567", + "given": { + "v": 1, + "run": "run-m2kx9a", + "members": [ + { + "module": "nats", + "commit": "0123456789abcdef0123456789abcdef01234567", + "branch": "feature/1966-x" + } + ], + "by": "fix-1965@shanks", + "at": "2026-11-10T10:00:00Z" + } + }, + { + "name": "a step started", + "of": "event:step-started", + "subject": "mesh.seat.mesh-pipeline-runner.event.step-started.nats.main.0123456789abcdef0123456789abcdef01234567", + "given": { + "pipeline": "main.12.nats", + "module": "nats", + "branch": "main", + "revision": 12, + "source": 3589, + "commit": "0123456789abcdef0123456789abcdef01234567", + "fp": "fp-0123", + "v": 1, + "result": { + "step": "lint", + "artifact": "nats:program", + "status": "required", + "outcome": "running", + "seat": "node-build-go", + "ask": "m2kx9a1b3c4d5e" + }, + "at": "2026-11-10T10:00:00Z" + } + }, + { + "name": "a rerun step ended passed, with its proved caller", + "of": "event:step-ended", + "subject": "mesh.seat.mesh-pipeline-runner.event.step-ended.nats.main.0123456789abcdef0123456789abcdef01234567", + "given": { + "pipeline": "main.12.nats", + "module": "nats", + "branch": "main", + "revision": 12, + "source": 3589, + "commit": "0123456789abcdef0123456789abcdef01234567", + "fp": "fp-0123", + "v": 1, + "result": { + "step": "unit", + "artifact": "nats:program", + "status": "required", + "outcome": "passed", + "fingerprint": "fp-0123", + "seat": "node-build-go", + "node": "ace", + "tests": { + "unit": 42 + }, + "rerun": true, + "by": "operator@shanks" + }, + "at": "2026-11-10T10:05:00Z" + } + }, + { + "name": "a bypassed step said", + "of": "event:step-ended", + "subject": "mesh.seat.mesh-pipeline-runner.event.step-ended.nats.main.0123456789abcdef0123456789abcdef01234567", + "given": { + "pipeline": "main.12.nats", + "module": "nats", + "branch": "main", + "revision": 12, + "source": 3589, + "commit": "0123456789abcdef0123456789abcdef01234567", + "fp": "fp-0123", + "v": 1, + "result": { + "step": "review", + "status": "bypass", + "outcome": "bypassed" + } + } + }, + { + "name": "an approval waits on the operator", + "of": "event:wait-held", + "subject": "mesh.seat.mesh-pipeline-runner.event.wait-held.nats.main.0123456789abcdef0123456789abcdef01234567", + "given": { + "pipeline": "main.12.nats", + "module": "nats", + "branch": "main", + "revision": 12, + "source": 3589, + "commit": "0123456789abcdef0123456789abcdef01234567", + "fp": "fp-0123", + "v": 1, + "step": "approval", + "on": "person", + "who": "the operator", + "since": "2026-11-10T10:10:00Z" + } + }, + { + "name": "the wait ended answered", + "of": "event:wait-ended", + "subject": "mesh.seat.mesh-pipeline-runner.event.wait-ended.nats.main.0123456789abcdef0123456789abcdef01234567", + "given": { + "pipeline": "main.12.nats", + "module": "nats", + "branch": "main", + "revision": 12, + "source": 3589, + "commit": "0123456789abcdef0123456789abcdef01234567", + "fp": "fp-0123", + "v": 1, + "step": "approval", + "on": "person", + "who": "the operator", + "since": "2026-11-10T10:10:00Z", + "how": "answered" + } + } +] diff --git a/contracts/seats/mesh-pipeline-runner/fixtures/states.json b/contracts/seats/mesh-pipeline-runner/fixtures/states.json new file mode 100644 index 00000000..318e10d5 --- /dev/null +++ b/contracts/seats/mesh-pipeline-runner/fixtures/states.json @@ -0,0 +1,81 @@ +[ + { + "name": "a pipeline kept", + "of": "state:pipelines/..", + "given": { + "pipeline": "main.12.nats", + "module": "nats", + "branch": "main", + "revision": 12, + "source": 3589, + "commit": "0123456789abcdef0123456789abcdef01234567", + "fp": "fp-0123", + "v": 1, + "outcome": "passed", + "steps": [ + { + "step": "lint", + "artifact": "nats:program", + "status": "required", + "outcome": "passed", + "fingerprint": "fp-0123", + "seat": "node-build-go", + "node": "ace", + "ask": "m2kx9a1b3c4d5e" + }, + { + "step": "unit", + "artifact": "nats:program", + "status": "required", + "outcome": "carried", + "fingerprint": "fp-0123", + "carried-from": "main.11.nats", + "tests": { + "unit": 42 + } + }, + { + "step": "integration", + "artifact": "nats:program", + "status": "optional", + "outcome": "failed", + "why": "TestTheBusWhole failed", + "fingerprint": "fp-0123", + "seat": "node-build-go", + "node": "g14", + "tests": { + "integration": 3 + } + }, + { + "step": "composition", + "status": "required", + "outcome": "passed", + "seat": "mesh-wants" + }, + { + "step": "review", + "status": "bypass", + "outcome": "bypassed" + }, + { + "step": "approval", + "status": "required", + "outcome": "passed" + } + ], + "started": "2026-11-10T10:00:00Z", + "ended": "2026-11-10T10:20:00Z" + } + }, + { + "name": "a kept result", + "of": "state:kept/.", + "given": { + "package": "git.novox.be/novox/nats", + "digest": "sha256:aa", + "level": "unit", + "pipeline": "main.12.nats" + } + } +] diff --git a/contracts/seats/mesh-pipeline-runner/fixtures/verbs.json b/contracts/seats/mesh-pipeline-runner/fixtures/verbs.json new file mode 100644 index 00000000..ab97a8c2 --- /dev/null +++ b/contracts/seats/mesh-pipeline-runner/fixtures/verbs.json @@ -0,0 +1,147 @@ +[ + { + "name": "run asks one member at a commit", + "of": "verb:run.input", + "given": { + "members": [ + { + "module": "nats", + "commit": "0123456789abcdef0123456789abcdef01234567", + "branch": "feature/1966-x" + } + ] + } + }, + { + "name": "run answers its id and pipelines", + "of": "verb:run.answer", + "given": { + "run": "run-m2kx9a", + "pipelines": [ + "feature~2f1966-x.0.nats" + ] + } + }, + { + "name": "review of a commit", + "of": "verb:review.input", + "given": { + "module": "nats", + "commit": "0123456789abcdef0123456789abcdef01234567", + "fingerprint": "fp-0123", + "outcome": "passed", + "said": "reads well" + } + }, + { + "name": "review answers its step", + "of": "verb:review.answer", + "given": { + "pipeline": "main.12.nats", + "result": { + "step": "review", + "status": "optional", + "outcome": "passed" + } + } + }, + { + "name": "show answers a pipeline with its log and fill", + "of": "verb:show.answer", + "given": { + "pipeline": { + "pipeline": "main.12.nats", + "module": "nats", + "branch": "main", + "revision": 12, + "source": 3589, + "commit": "0123456789abcdef0123456789abcdef01234567", + "fp": "fp-0123", + "v": 1, + "outcome": "running", + "steps": [ + { + "step": "lint", + "artifact": "nats:program", + "status": "required", + "outcome": "passed", + "fingerprint": "fp-0123", + "seat": "node-build-go", + "node": "ace", + "ask": "m2kx9a1b3c4d5e" + } + ] + }, + "log": [ + { + "pipeline": "main.12.nats", + "step": "lint", + "artifact": "nats:program", + "what": "started", + "at": "2026-11-10T10:00:00Z" + } + ], + "outputs": [ + "main.12.nats.lint.nats:program" + ], + "fill": [ + { + "store": "pipelines", + "bytes": 4096, + "cap": 268435456 + } + ] + } + }, + { + "name": "accept asks with why", + "of": "verb:accept.input", + "given": { + "pipeline": "main.12.nats", + "step": "integration", + "artifact": "nats:program", + "why": "flaky upstream, issue 1966" + } + }, + { + "name": "stands answers a wait on a build node", + "of": "verb:stands.answer", + "given": { + "stands": [ + { + "pipeline": "main.12.nats", + "module": "nats", + "branch": "main", + "revision": 12, + "source": 3589, + "commit": "0123456789abcdef0123456789abcdef01234567", + "fp": "fp-0123", + "v": 1, + "step": "unit", + "artifact": "nats:program", + "on": "build node", + "since": "2026-11-10T10:00:00Z" + } + ] + } + }, + { + "name": "kept answers by digest", + "of": "verb:kept.answer", + "given": { + "kept": [ + { + "package": "git.novox.be/novox/nats", + "digest": "sha256:aa", + "level": "unit", + "pipeline": "main.12.nats" + } + ], + "fill": { + "store": "kept", + "bytes": 300, + "cap": 134217728 + } + } + } +] diff --git a/contracts/seats/mesh-pipeline-runner/seat.json b/contracts/seats/mesh-pipeline-runner/seat.json new file mode 100644 index 00000000..91df6fff --- /dev/null +++ b/contracts/seats/mesh-pipeline-runner/seat.json @@ -0,0 +1,1554 @@ +{ + "format": 1, + "seat": "mesh-pipeline-runner", + "scope": "mesh", + "grain": "whole", + "domain": "Delivery", + "decision": "novox/hq ADR 0666", + "description": "The pipeline runner: it runs each module's pipeline on each of its watched branches, asking each step of the seat that serves it and hearing its end, and says each pipeline's and each step's start and end (design 47 *Pipelines per module*). Held once for the mesh; a foundation part.", + "acts": [ + { + "step": "pipeline", + "bound": "30m" + } + ], + "verbs": [ + { + "name": "run", + "description": "The run on request of one or more members, each a module at a named commit, through their pipelines; delivers nothing, replacing the checker's try (ADR 0666 section 18). Says run-started.", + "callers": [ + "sessions", + "operator" + ], + "input": { + "type": "object", + "properties": { + "members": { + "type": "array", + "items": { + "$ref": "#/defs/Member" + }, + "minItems": 1 + }, + "why": { + "type": "string" + } + }, + "required": [ + "members" + ] + }, + "answer": { + "type": "object", + "properties": { + "run": { + "type": "string" + }, + "pipelines": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the pipelines' keys" + } + }, + "required": [ + "run" + ] + }, + "class": "act" + }, + { + "name": "start", + "description": "A delivering pipeline for a watched branch's head, by hand; written in the hand-act log.", + "callers": [ + "operator", + "healers" + ], + "input": { + "type": "object", + "properties": { + "module": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "why": { + "type": "string", + "description": "why, written with the caller the runtime proves in the hand-act log" + } + }, + "required": [ + "module", + "branch", + "why" + ] + }, + "answer": { + "type": "object", + "properties": { + "pipeline": { + "type": "string" + } + }, + "required": [ + "pipeline" + ] + }, + "class": "act" + }, + { + "name": "show", + "description": "One pipeline whole: its steps, its step log and its outputs, with the stores' fill. Reads only.", + "callers": [ + "persons", + "sessions", + "healers" + ], + "input": { + "type": "object", + "properties": { + "pipeline": { + "type": "string", + "description": "the pipeline's key" + } + }, + "required": [ + "pipeline" + ] + }, + "answer": { + "type": "object", + "properties": { + "pipeline": { + "$ref": "#/defs/Pipeline" + }, + "log": { + "type": "array", + "items": { + "$ref": "#/defs/LogEntry" + } + }, + "outputs": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the outputs' names in step-outputs" + }, + "fill": { + "type": "array", + "items": { + "$ref": "#/defs/Fill" + } + } + }, + "required": [ + "pipeline" + ] + }, + "class": "read" + }, + { + "name": "list", + "description": "The pipelines and runs of a module, a branch or a commit, newest first, with the store's fill. Reads only.", + "callers": [ + "persons", + "sessions", + "healers" + ], + "input": { + "type": "object", + "properties": { + "module": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "commit": { + "type": "string" + }, + "run": { + "type": "string" + }, + "limit": { + "type": "integer" + } + } + }, + "answer": { + "type": "object", + "properties": { + "pipelines": { + "type": "array", + "items": { + "$ref": "#/defs/Pipeline" + } + }, + "fill": { + "$ref": "#/defs/Fill" + } + }, + "required": [ + "pipelines" + ] + }, + "class": "read" + }, + { + "name": "stands", + "description": "What stands still, and since when: each step not ended and each wait held. Reads only.", + "callers": [ + "persons", + "sessions", + "healers" + ], + "input": { + "type": "object", + "properties": {} + }, + "answer": { + "type": "object", + "properties": { + "stands": { + "type": "array", + "items": { + "$ref": "#/defs/Wait" + } + } + }, + "required": [ + "stands" + ] + }, + "class": "read" + }, + { + "name": "why-carried", + "description": "Where a step's result was carried from, with the kept results it rests on. Reads only.", + "callers": [ + "persons", + "sessions", + "healers" + ], + "input": { + "type": "object", + "properties": { + "pipeline": { + "type": "string", + "description": "the pipeline's key" + }, + "step": { + "type": "string", + "enum": [ + "lint", + "unit", + "integration", + "composition", + "review", + "approval" + ] + }, + "artifact": { + "type": "string" + } + }, + "required": [ + "pipeline", + "step" + ] + }, + "answer": { + "type": "object", + "properties": { + "carried-from": { + "type": "string" + }, + "kept": { + "type": "array", + "items": { + "$ref": "#/defs/KeptResult" + } + } + } + }, + "class": "read" + }, + { + "name": "kept", + "description": "The kept results, by digest, package or level, with the store's fill. Reads only.", + "callers": [ + "persons", + "sessions", + "healers" + ], + "input": { + "type": "object", + "properties": { + "digest": { + "type": "string" + }, + "package": { + "type": "string" + }, + "level": { + "type": "string" + } + } + }, + "answer": { + "type": "object", + "properties": { + "kept": { + "type": "array", + "items": { + "$ref": "#/defs/KeptResult" + } + }, + "fill": { + "$ref": "#/defs/Fill" + } + }, + "required": [ + "kept" + ] + }, + "class": "read" + }, + { + "name": "review", + "description": "A code review's result for a commit and fingerprint, taken from the reviewer's account and refused from the commit's author (ADR 0666 section 22).", + "callers": [ + "sessions" + ], + "input": { + "type": "object", + "properties": { + "module": { + "type": "string" + }, + "commit": { + "type": "string" + }, + "fingerprint": { + "type": "string" + }, + "outcome": { + "type": "string", + "enum": [ + "passed", + "failed" + ] + }, + "said": { + "type": "string", + "description": "what the review found" + } + }, + "required": [ + "module", + "commit", + "fingerprint", + "outcome" + ] + }, + "answer": { + "type": "object", + "properties": { + "pipeline": { + "type": "string" + }, + "result": { + "$ref": "#/defs/StepResult" + } + }, + "required": [ + "result" + ] + }, + "class": "act" + }, + { + "name": "rerun", + "description": "One step again; its step-ended says it is a rerun and the caller the runtime proved. Written in the hand-act log.", + "callers": [ + "operator", + "healers" + ], + "input": { + "type": "object", + "properties": { + "pipeline": { + "type": "string", + "description": "the pipeline's key" + }, + "step": { + "type": "string", + "enum": [ + "lint", + "unit", + "integration", + "composition", + "review", + "approval" + ] + }, + "artifact": { + "type": "string" + }, + "why": { + "type": "string", + "description": "why, written with the caller the runtime proves in the hand-act log" + } + }, + "required": [ + "pipeline", + "step", + "why" + ] + }, + "answer": { + "type": "object", + "properties": { + "pipeline": { + "type": "string" + }, + "result": { + "$ref": "#/defs/StepResult" + } + }, + "required": [ + "pipeline" + ] + }, + "class": "act" + }, + { + "name": "accept", + "description": "A failed optional step accepted, with who and why, in the hand-act log.", + "callers": [ + "operator" + ], + "input": { + "type": "object", + "properties": { + "pipeline": { + "type": "string", + "description": "the pipeline's key" + }, + "step": { + "type": "string", + "enum": [ + "lint", + "unit", + "integration", + "composition", + "review", + "approval" + ] + }, + "artifact": { + "type": "string" + }, + "why": { + "type": "string", + "description": "why, written with the caller the runtime proves in the hand-act log" + } + }, + "required": [ + "pipeline", + "step", + "why" + ] + }, + "answer": { + "type": "object", + "properties": { + "result": { + "$ref": "#/defs/StepResult" + } + }, + "required": [ + "result" + ] + }, + "class": "act" + }, + { + "name": "cancel", + "description": "A pipeline ended cancelled, its waiting asks dropped by each build seat's drop. Written in the hand-act log.", + "callers": [ + "operator", + "healers" + ], + "input": { + "type": "object", + "properties": { + "pipeline": { + "type": "string", + "description": "the pipeline's key" + }, + "why": { + "type": "string", + "description": "why, written with the caller the runtime proves in the hand-act log" + } + }, + "required": [ + "pipeline", + "why" + ] + }, + "answer": { + "type": "object", + "properties": { + "pipeline": { + "$ref": "#/defs/Pipeline" + } + }, + "required": [ + "pipeline" + ] + }, + "class": "act" + }, + { + "name": "ask-again", + "description": "A declined approval step asked again (ADR 0666 section 10). Written in the hand-act log.", + "callers": [ + "operator" + ], + "input": { + "type": "object", + "properties": { + "pipeline": { + "type": "string", + "description": "the pipeline's key" + }, + "why": { + "type": "string", + "description": "why, written with the caller the runtime proves in the hand-act log" + } + }, + "required": [ + "pipeline", + "why" + ] + }, + "answer": { + "type": "object", + "properties": { + "result": { + "$ref": "#/defs/StepResult" + } + }, + "required": [ + "result" + ] + }, + "class": "act" + } + ], + "events": [ + { + "name": "pipeline-started", + "subject": "pipeline-started...", + "body": { + "$ref": "#/defs/PipelineStarted" + }, + "keep": { + "max-age-days": 90, + "max-mib": 32 + } + }, + { + "name": "pipeline-ended", + "subject": "pipeline-ended...", + "body": { + "$ref": "#/defs/PipelineEnded" + }, + "keep": { + "max-age-days": 90, + "max-mib": 192 + } + }, + { + "name": "group-ended", + "subject": "group-ended..", + "body": { + "$ref": "#/defs/GroupEnded" + }, + "keep": { + "max-age-days": 90, + "max-mib": 64 + } + }, + { + "name": "run-started", + "subject": "run-started...", + "body": { + "$ref": "#/defs/RunStarted" + }, + "keep": { + "max-age-days": 90, + "max-mib": 16 + } + }, + { + "name": "step-started", + "subject": "step-started...", + "body": { + "$ref": "#/defs/StepEvent" + }, + "keep": { + "max-age-days": 90, + "max-mib": 128 + } + }, + { + "name": "step-ended", + "subject": "step-ended...", + "body": { + "$ref": "#/defs/StepEvent" + }, + "keep": { + "max-age-days": 90, + "max-mib": 128 + } + }, + { + "name": "wait-held", + "subject": "wait-held...", + "body": { + "$ref": "#/defs/Wait" + }, + "keep": { + "max-age-days": 90, + "max-mib": 32 + } + }, + { + "name": "wait-ended", + "subject": "wait-ended...", + "body": { + "$ref": "#/defs/Wait" + }, + "keep": { + "max-age-days": 90, + "max-mib": 32 + } + } + ], + "family": { + "name": "mesh-pipeline-runner.events", + "max-age-days": 7 + }, + "states": [ + { + "name": "pipelines", + "template": "state", + "history": 1, + "description": "one key per pipeline, written by compare-and-set; kept in the runner's old state section (ADR 0666 section 4)", + "key-forms": [ + { + "key": "..", + "value": { + "$ref": "#/defs/Pipeline" + }, + "description": "a pipeline" + } + ] + }, + { + "name": "kept", + "template": "state", + "history": 1, + "description": "each package's passing result per level, under the digest of what its tests read; kept in the runner's old state section", + "key-forms": [ + { + "key": ".", + "value": { + "$ref": "#/defs/KeptResult" + }, + "description": "a kept result" + } + ] + }, + { + "name": "step-log", + "template": "log", + "max-age-days": 90, + "description": "one entry per step's start and end, its output by name; kept on the runner's old streams section", + "key-forms": [ + { + "key": "", + "value": { + "$ref": "#/defs/LogEntry" + }, + "description": "an entry of a pipeline's log" + } + ] + }, + { + "name": "step-outputs", + "template": "objects", + "description": "a lint or test step's output, named in the step log; kept in the runner's old objects section", + "key-forms": [ + { + "key": "..", + "value": { + "type": "string", + "description": "the output, UTF-8 text" + }, + "description": "one step's output" + } + ] + } + ], + "defs": { + "TestCounts": { + "type": "object", + "properties": { + "unit": { + "type": "integer" + }, + "integration": { + "type": "integer" + } + }, + "description": "how many tests a step ran and carried, per level (ADR 0666 section 8)" + }, + "ToolchainUsed": { + "type": "object", + "properties": { + "language": { + "type": "string" + }, + "version": { + "type": "string" + }, + "recipe": { + "type": "string" + } + }, + "required": [ + "language", + "version", + "recipe" + ], + "description": "the toolchain a build was made with: the language, the installed version and the build module's recipe" + }, + "KeptResult": { + "type": "object", + "properties": { + "package": { + "type": "string" + }, + "digest": { + "type": "string", + "description": "sha256: of what the package's tests read" + }, + "level": { + "type": "string", + "description": "unit or integration" + }, + "toolchain": { + "$ref": "#/defs/ToolchainUsed" + }, + "pipeline": { + "type": "string", + "description": "the pipeline whose step kept it" + } + }, + "description": "a package's passing result the runner keeps, by the digest of what its tests read (ADR 0666 section 8)", + "required": [ + "package", + "digest", + "level" + ] + }, + "Fill": { + "type": "object", + "properties": { + "store": { + "type": "string", + "description": "the kept data, by its name in the holder's manifest" + }, + "bytes": { + "type": "integer" + }, + "cap": { + "type": "integer", + "description": "bytes" + }, + "at": { + "type": "string", + "format": "date-time" + } + }, + "description": "a store's fill against its cap", + "required": [ + "store", + "bytes", + "cap" + ] + }, + "Accepted": { + "type": "object", + "properties": { + "by": { + "type": "string", + "description": "who accepted it, as the runtime proved the caller" + }, + "why": { + "type": "string" + }, + "at": { + "type": "string", + "format": "date-time" + } + }, + "description": "a failed optional step a person accepted, recorded in the hand-act log", + "required": [ + "by", + "why" + ] + }, + "StepResult": { + "type": "object", + "properties": { + "step": { + "type": "string", + "enum": [ + "lint", + "unit", + "integration", + "composition", + "review", + "approval" + ] + }, + "artifact": { + "type": "string", + "description": "the artifact reference, :; absent for a step of the whole module (review, approval)" + }, + "status": { + "type": "string", + "enum": [ + "required", + "optional", + "bypass" + ], + "description": "the step's status in the module's policy" + }, + "outcome": { + "type": "string", + "enum": [ + "running", + "waiting", + "passed", + "failed", + "nothing to run", + "bypassed", + "carried", + "could not run", + "waiting for a build node", + "did not build", + "accepted", + "declined", + "superseded", + "cancelled" + ], + "description": "never passed for a step that ran nothing (design 47 *Pipeline steps and the policy*)" + }, + "why": { + "type": "string", + "description": "what the outcome rests on: the part not heard, the seat with no holder, what a waiting step waits on" + }, + "on": { + "type": "string", + "description": "for a waiting step, who or what it waits on: a person, a build node, the revision view" + }, + "fingerprint": { + "type": "string", + "description": "the artifact's build-input fingerprint the step ran at" + }, + "seat": { + "type": "string", + "description": "the seat that serves the step, whose holder alone may end it (ADR 0666 section 21)" + }, + "node": { + "type": "string", + "description": "the node whose holder ended it" + }, + "ask": { + "type": "string", + "description": "the step's ask on the serving seat's work queue" + }, + "tests": { + "$ref": "#/defs/TestCounts" + }, + "carried-from": { + "type": "string", + "description": "for a carried result, the pipeline it was carried from" + }, + "rerun": { + "type": "boolean", + "description": "the step was asked again by the runner's rerun" + }, + "by": { + "type": "string", + "description": "for a rerun, the caller the runtime proved" + }, + "accepted": { + "$ref": "#/defs/Accepted" + }, + "output": { + "type": "string", + "description": "the step's output, by its name in the runner's objects step-outputs" + }, + "started": { + "type": "string", + "format": "date-time" + }, + "ended": { + "type": "string", + "format": "date-time" + } + }, + "description": "one step of a pipeline: its status in the policy and its outcome (design 47 *Pipeline steps and the policy*)", + "required": [ + "step", + "status", + "outcome" + ] + }, + "Widening": { + "type": "object", + "properties": { + "what": { + "type": "string", + "enum": [ + "serving part", + "acting rule", + "grant", + "credential", + "could not run" + ] + }, + "name": { + "type": "string", + "description": "the part, rule, grant or credential" + }, + "said": { + "type": "string", + "description": "what the change alters in it; for \"could not run\" the grants part did not answer grants-for (design 47 G section 441)" + } + }, + "description": "a part serving a step the change alters, or an acting rule, a grant or a credential it widens, computed by the running runner (ADR 0666 section 23)", + "required": [ + "what", + "name" + ] + }, + "Pipeline": { + "type": "object", + "properties": { + "pipeline": { + "type": "string", + "description": "the pipeline's key, .., a branch escaped as a key's name is" + }, + "module": { + "type": "string" + }, + "branch": { + "type": "string", + "description": "the watched branch, or the branch of a run on request" + }, + "revision": { + "type": "integer", + "description": "the catalog graph revision of the branch the pipeline runs for" + }, + "source": { + "type": "integer", + "description": "the source revision of the watched branch; the pipeline is keyed by it (ADR 0666 section 9)" + }, + "commit": { + "type": "string", + "description": "the commit the module's entry was last changed at" + }, + "group": { + "type": "string", + "description": "the gathered group, when the pipeline is its" + }, + "run": { + "type": "string", + "description": "the run on request's id, for a pipeline of a run; such a pipeline delivers nothing" + }, + "fp": { + "type": "string", + "description": "the module's build-input fingerprint at the commit" + }, + "v": { + "type": "integer", + "description": "the layout version" + }, + "repository": { + "type": "string" + }, + "outcome": { + "type": "string", + "enum": [ + "running", + "passed", + "failed", + "refused", + "superseded", + "cancelled" + ] + }, + "why": { + "type": "string", + "description": "for a pipeline that did not pass, the steps that held it" + }, + "steps": { + "type": "array", + "items": { + "$ref": "#/defs/StepResult" + }, + "description": "every step, approval last" + }, + "tests": { + "$ref": "#/defs/TestCounts" + }, + "over-budget": { + "type": "boolean", + "description": "yes when the module is over its test budget (design 47 G section 419)" + }, + "widens": { + "type": "array", + "items": { + "$ref": "#/defs/Widening" + } + }, + "started": { + "type": "string", + "format": "date-time" + }, + "ended": { + "type": "string", + "format": "date-time" + } + }, + "description": "one pipeline as the runner keeps it in its state pipelines, by compare-and-set (design 47 *The runner's kept data*)", + "required": [ + "module", + "branch", + "commit", + "outcome", + "steps" + ] + }, + "PipelineEnded": { + "type": "object", + "properties": { + "pipeline": { + "type": "string", + "description": "the pipeline's key, .., a branch escaped as a key's name is" + }, + "module": { + "type": "string" + }, + "branch": { + "type": "string", + "description": "the watched branch, or the branch of a run on request" + }, + "revision": { + "type": "integer", + "description": "the catalog graph revision of the branch the pipeline runs for" + }, + "source": { + "type": "integer", + "description": "the source revision of the watched branch; the pipeline is keyed by it (ADR 0666 section 9)" + }, + "commit": { + "type": "string", + "description": "the commit the module's entry was last changed at" + }, + "group": { + "type": "string", + "description": "the gathered group, when the pipeline is its" + }, + "run": { + "type": "string", + "description": "the run on request's id, for a pipeline of a run; such a pipeline delivers nothing" + }, + "fp": { + "type": "string", + "description": "the module's build-input fingerprint at the commit" + }, + "v": { + "type": "integer" + }, + "outcome": { + "type": "string", + "enum": [ + "running", + "passed", + "failed", + "refused", + "superseded", + "cancelled" + ] + }, + "why": { + "type": "string" + }, + "steps": { + "type": "array", + "items": { + "$ref": "#/defs/StepResult" + } + }, + "tests": { + "$ref": "#/defs/TestCounts" + }, + "over-budget": { + "type": "boolean", + "description": "yes when the module is over its test budget (500 unit or 50 integration tests; design 47 G section 419)" + }, + "widens": { + "type": "array", + "items": { + "$ref": "#/defs/Widening" + } + }, + "started": { + "type": "string", + "format": "date-time" + }, + "ended": { + "type": "string", + "format": "date-time" + } + }, + "description": "a pipeline's end with every step's result, its test counts, the source revision and widens (design 47 *Health and going back*); the assigner writes a want only from one whose every required step passed", + "required": [ + "v", + "pipeline", + "module", + "branch", + "commit", + "outcome", + "steps" + ] + }, + "PipelineStarted": { + "type": "object", + "properties": { + "pipeline": { + "type": "string", + "description": "the pipeline's key, .., a branch escaped as a key's name is" + }, + "module": { + "type": "string" + }, + "branch": { + "type": "string", + "description": "the watched branch, or the branch of a run on request" + }, + "revision": { + "type": "integer", + "description": "the catalog graph revision of the branch the pipeline runs for" + }, + "source": { + "type": "integer", + "description": "the source revision of the watched branch; the pipeline is keyed by it (ADR 0666 section 9)" + }, + "commit": { + "type": "string", + "description": "the commit the module's entry was last changed at" + }, + "group": { + "type": "string", + "description": "the gathered group, when the pipeline is its" + }, + "run": { + "type": "string", + "description": "the run on request's id, for a pipeline of a run; such a pipeline delivers nothing" + }, + "fp": { + "type": "string", + "description": "the module's build-input fingerprint at the commit" + }, + "v": { + "type": "integer" + }, + "steps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "step": { + "type": "string", + "enum": [ + "lint", + "unit", + "integration", + "composition", + "review", + "approval" + ] + }, + "artifact": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "required", + "optional", + "bypass" + ] + } + }, + "required": [ + "step", + "status" + ] + }, + "description": "the steps the policy gives it" + }, + "at": { + "type": "string", + "format": "date-time" + } + }, + "description": "a pipeline's start", + "required": [ + "v", + "pipeline", + "module", + "branch", + "commit" + ] + }, + "GroupEnded": { + "type": "object", + "properties": { + "v": { + "type": "integer" + }, + "group": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "source": { + "type": "integer", + "description": "the group's one source revision of the watched branch" + }, + "outcome": { + "type": "string", + "enum": [ + "running", + "passed", + "failed", + "refused", + "superseded", + "cancelled" + ] + }, + "why": { + "type": "string" + }, + "pipelines": { + "type": "array", + "items": { + "$ref": "#/defs/PipelineEnded" + }, + "description": "every member module's pipeline, each ended" + }, + "ended": { + "type": "string", + "format": "date-time" + } + }, + "description": "a group's one pipeline's end on a watched branch, said once every member's modules have ended; a group's wants are written on it alone (ADR 0666 section 9)", + "required": [ + "v", + "group", + "branch", + "outcome", + "pipelines" + ] + }, + "Member": { + "type": "object", + "properties": { + "module": { + "type": "string" + }, + "commit": { + "type": "string" + }, + "branch": { + "type": "string", + "description": "the branch the commit is on" + } + }, + "description": "a module at a named commit", + "required": [ + "module", + "commit" + ] + }, + "RunStarted": { + "type": "object", + "properties": { + "v": { + "type": "integer" + }, + "run": { + "type": "string" + }, + "members": { + "type": "array", + "items": { + "$ref": "#/defs/Member" + } + }, + "by": { + "type": "string", + "description": "the caller the runtime proved" + }, + "at": { + "type": "string", + "format": "date-time" + } + }, + "description": "a run on request's start, with its members at their commits (ADR 0666 section 18)", + "required": [ + "v", + "run", + "members", + "by" + ] + }, + "StepEvent": { + "type": "object", + "properties": { + "pipeline": { + "type": "string", + "description": "the pipeline's key, .., a branch escaped as a key's name is" + }, + "module": { + "type": "string" + }, + "branch": { + "type": "string", + "description": "the watched branch, or the branch of a run on request" + }, + "revision": { + "type": "integer", + "description": "the catalog graph revision of the branch the pipeline runs for" + }, + "source": { + "type": "integer", + "description": "the source revision of the watched branch; the pipeline is keyed by it (ADR 0666 section 9)" + }, + "commit": { + "type": "string", + "description": "the commit the module's entry was last changed at" + }, + "group": { + "type": "string", + "description": "the gathered group, when the pipeline is its" + }, + "run": { + "type": "string", + "description": "the run on request's id, for a pipeline of a run; such a pipeline delivers nothing" + }, + "fp": { + "type": "string", + "description": "the module's build-input fingerprint at the commit" + }, + "v": { + "type": "integer" + }, + "result": { + "$ref": "#/defs/StepResult" + }, + "at": { + "type": "string", + "format": "date-time" + } + }, + "description": "a step's start or end: the step, its status, its outcome, its fingerprint, its test counts, what a carried result was carried from, and for a rerun that it is one and its proved caller; a bypassed step too", + "required": [ + "v", + "pipeline", + "module", + "branch", + "commit", + "result" + ] + }, + "Wait": { + "type": "object", + "properties": { + "pipeline": { + "type": "string", + "description": "the pipeline's key, .., a branch escaped as a key's name is" + }, + "module": { + "type": "string" + }, + "branch": { + "type": "string", + "description": "the watched branch, or the branch of a run on request" + }, + "revision": { + "type": "integer", + "description": "the catalog graph revision of the branch the pipeline runs for" + }, + "source": { + "type": "integer", + "description": "the source revision of the watched branch; the pipeline is keyed by it (ADR 0666 section 9)" + }, + "commit": { + "type": "string", + "description": "the commit the module's entry was last changed at" + }, + "group": { + "type": "string", + "description": "the gathered group, when the pipeline is its" + }, + "run": { + "type": "string", + "description": "the run on request's id, for a pipeline of a run; such a pipeline delivers nothing" + }, + "fp": { + "type": "string", + "description": "the module's build-input fingerprint at the commit" + }, + "v": { + "type": "integer" + }, + "step": { + "type": "string", + "enum": [ + "lint", + "unit", + "integration", + "composition", + "review", + "approval" + ] + }, + "artifact": { + "type": "string" + }, + "on": { + "type": "string", + "enum": [ + "person", + "build node", + "revision view" + ], + "description": "what the step waits on (design 47 *Health and going back*)" + }, + "who": { + "type": "string", + "description": "for a wait on a person, who: the operator, a reviewer" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "how": { + "type": "string", + "description": "for its end, how it ended: answered, ran, released, superseded" + } + }, + "description": "a step's wait, held and ended; a wait on a person is said as waiting on that person, never a stall (ADR 0283)", + "required": [ + "v", + "pipeline", + "module", + "branch", + "step", + "on", + "since" + ] + }, + "LogEntry": { + "type": "object", + "properties": { + "pipeline": { + "type": "string" + }, + "step": { + "type": "string", + "enum": [ + "lint", + "unit", + "integration", + "composition", + "review", + "approval" + ] + }, + "artifact": { + "type": "string" + }, + "what": { + "type": "string", + "enum": [ + "started", + "ended" + ] + }, + "outcome": { + "type": "string", + "enum": [ + "running", + "waiting", + "passed", + "failed", + "nothing to run", + "bypassed", + "carried", + "could not run", + "waiting for a build node", + "did not build", + "accepted", + "declined", + "superseded", + "cancelled" + ] + }, + "output": { + "type": "string", + "description": "the output's name in step-outputs" + }, + "at": { + "type": "string", + "format": "date-time" + } + }, + "description": "one entry of the step log", + "required": [ + "pipeline", + "step", + "what", + "at" + ] + } + } +} From 7f0fbf15ae3d67db353a450f201b74350503dbc3 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 11 Nov 2026 10:35:25 +0100 Subject: [PATCH 002/553] CT2: the seat mesh-builds, held once for the mesh: package-published, toolchain-agreed, reserved MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Definition and fixtures; the generated contracts come with CT11. Builds: design 47 G §52, §307 (seat held once, event package-published), §334 (artifact reference, version, digest, branch, source revision), §374 (resolved dependencies with version and digest), §376 (toolchain-agreed: language, version, toolchain digest), §369 (verb reserved, callers the registry seats' holders), §331, §396 (keep: package-published 128 MiB, toolchain-agreed 16 MiB, 90 days), §391 (class read). Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ --- .../seats/mesh-builds/fixtures/events.json | 43 ++++ .../seats/mesh-builds/fixtures/verbs.json | 26 +++ contracts/seats/mesh-builds/seat.json | 221 ++++++++++++++++++ 3 files changed, 290 insertions(+) create mode 100644 contracts/seats/mesh-builds/fixtures/events.json create mode 100644 contracts/seats/mesh-builds/fixtures/verbs.json create mode 100644 contracts/seats/mesh-builds/seat.json diff --git a/contracts/seats/mesh-builds/fixtures/events.json b/contracts/seats/mesh-builds/fixtures/events.json new file mode 100644 index 00000000..25c23b77 --- /dev/null +++ b/contracts/seats/mesh-builds/fixtures/events.json @@ -0,0 +1,43 @@ +[ + { + "name": "a package published with the dependencies the build resolved", + "of": "event:package-published", + "subject": "mesh.seat.mesh-builds.event.package-published", + "given": { + "v": 1, + "artifact": "mesh-sdk:go", + "module": "mesh-sdk", + "version": "0.1.15", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", + "branch": "main", + "source": 3589, + "dependencies": [ + { + "artifact": "mesh-contracts:go-nodeengine", + "kind": 1, + "version": "0.1.4", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + }, + { + "artifact": "mesh-build-go:toolchain", + "kind": 3, + "version": "1.26.0", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + } + ], + "at": "2026-11-10T10:00:00Z" + } + }, + { + "name": "a toolchain agreed", + "of": "event:toolchain-agreed", + "subject": "mesh.seat.mesh-builds.event.toolchain-agreed", + "given": { + "v": 1, + "language": "go", + "version": "1.26.0", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", + "at": "2026-11-10T10:00:00Z" + } + } +] diff --git a/contracts/seats/mesh-builds/fixtures/verbs.json b/contracts/seats/mesh-builds/fixtures/verbs.json new file mode 100644 index 00000000..668a960c --- /dev/null +++ b/contracts/seats/mesh-builds/fixtures/verbs.json @@ -0,0 +1,26 @@ +[ + { + "name": "reserved asks a module", + "of": "verb:reserved.input", + "given": { + "module": "mesh-sdk" + } + }, + { + "name": "reserved answers the version and each artifact's digest", + "of": "verb:reserved.answer", + "given": { + "module": "mesh-sdk", + "version": "0.1.15", + "artifacts": [ + { + "artifact": "mesh-sdk:go", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + }, + { + "artifact": "mesh-sdk:ts" + } + ] + } + } +] diff --git a/contracts/seats/mesh-builds/seat.json b/contracts/seats/mesh-builds/seat.json new file mode 100644 index 00000000..489c52a9 --- /dev/null +++ b/contracts/seats/mesh-builds/seat.json @@ -0,0 +1,221 @@ +{ + "format": 1, + "seat": "mesh-builds", + "scope": "mesh", + "grain": "whole", + "domain": "Delivery", + "decision": "novox/hq ADR 0666", + "description": "The builder's seat: it says each artifact it published and each agreed toolchain, and answers a module's reserved version. Held once for the mesh (design 47 G section 52, section 307).", + "verbs": [ + { + "name": "reserved", + "class": "read", + "callers": [ + "seat:go-package-registry", + "seat:npm-package-registry", + "seat:container-image-registry", + "seat:oci-artifact-registry" + ], + "description": "A module's reserved version with each artifact's digest, for a registry holder deciding whether to publish (design 47 G section 369; design 51, Publishing).", + "input": { + "type": "object", + "properties": { + "module": { + "type": "string", + "description": "the module" + }, + "version": { + "type": "string", + "description": "the version, when asked for a particular one" + } + }, + "required": [ + "module" + ] + }, + "answer": { + "type": "object", + "properties": { + "module": { + "type": "string", + "description": "the module" + }, + "version": { + "type": "string", + "description": "the reserved version, MAJOR.MINOR.PATCH" + }, + "artifacts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "artifact": { + "type": "string", + "description": "the artifact reference, :" + }, + "digest": { + "type": "string", + "description": "its digest once built; empty before" + } + }, + "required": [ + "artifact" + ] + } + } + }, + "required": [ + "module", + "version", + "artifacts" + ] + } + } + ], + "events": [ + { + "name": "package-published", + "subject": "package-published", + "keep": { + "max-age-days": 90, + "max-mib": 128 + }, + "body": { + "$ref": "#/defs/PackagePublished" + } + }, + { + "name": "toolchain-agreed", + "subject": "toolchain-agreed", + "keep": { + "max-age-days": 90, + "max-mib": 16 + }, + "body": { + "$ref": "#/defs/ToolchainAgreed" + } + } + ], + "family": { + "name": "mesh-builds.events", + "max-age-days": 7 + }, + "defs": { + "Dependency": { + "type": "object", + "properties": { + "artifact": { + "type": "string", + "description": "the dependency's artifact reference, :" + }, + "kind": { + "type": "integer", + "enum": [ + 1, + 3 + ], + "description": "1 an imported package, 3 the build toolchain (design 47 G section 374)" + }, + "version": { + "type": "string", + "description": "the version of the dependency the build resolved" + }, + "digest": { + "type": "string", + "description": "the digest of the part, as the build used it" + } + }, + "required": [ + "artifact", + "kind", + "version", + "digest" + ], + "description": "a dependency the build resolved, named by the build module in its step key and carried by the builder (design 47 G section 374)" + }, + "PackagePublished": { + "type": "object", + "properties": { + "v": { + "type": "integer" + }, + "artifact": { + "type": "string", + "description": "the package's artifact reference, :, from the catalog entry" + }, + "module": { + "type": "string", + "description": "the module" + }, + "version": { + "type": "string", + "description": "the version the build reserved, MAJOR.MINOR.PATCH" + }, + "digest": { + "type": "string", + "description": "the published artifact's digest" + }, + "branch": { + "type": "string", + "description": "the watched branch the build was made from" + }, + "source": { + "type": "integer", + "description": "the source revision of that branch the build was made from" + }, + "dependencies": { + "type": "array", + "items": { + "$ref": "#/defs/Dependency" + }, + "description": "each dependency the build resolved, with its version and digest" + }, + "at": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "v", + "artifact", + "module", + "version", + "digest", + "branch", + "source" + ], + "description": "one artifact published at the module's reserved version (design 47 G section 52, section 334)" + }, + "ToolchainAgreed": { + "type": "object", + "properties": { + "v": { + "type": "integer" + }, + "language": { + "type": "string", + "description": "the language whose agreed toolchain changed" + }, + "version": { + "type": "string", + "description": "the agreed toolchain's version" + }, + "digest": { + "type": "string", + "description": "the toolchain part's digest" + }, + "at": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "v", + "language", + "version", + "digest" + ], + "description": "the agreed toolchain of a language changed (design 47 G section 376, ADR 0584 section 1)" + } + } +} From c8b11baf04c845955e3722cbd001b7a2a6cbcb8f Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 11 Nov 2026 10:44:02 +0100 Subject: [PATCH 003/553] CT3: the seat mesh-catalog: registrations, versions, outdated, input, entry, version-released, versions-filled, entries with languages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Definition and fixtures; the generated contracts come with CT11 (their fixture test is the proof: it fails on a fixture the definition does not read). Builds: design 47 G §2, §3, §4, §100, §108, §394 (registrations read; register, policy, watch, unwatch act, callers operator and sessions), §349, §372, §375, §354, §443 (versions, outdated, input, entry; version-released, versions-filled with no age limit; layouts versions, build-edges, inputs), §307, §260 (catalog-revision.), §47, §323, §365, §374, §378 (entry: artifacts with language, edges with stale/order, word and part, the events the streams declare), §331, §396 (keep objects), §400 (no verb optional), §391 (class). Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ --- .../seats/mesh-catalog/fixtures/events.json | 111 ++ .../seats/mesh-catalog/fixtures/states.json | 371 ++++ .../seats/mesh-catalog/fixtures/verbs.json | 420 +++++ contracts/seats/mesh-catalog/seat.json | 1571 ++++++++++++++++- .../containerimageregistry/tsconfig.json | 12 - .../ts/seats/gopackageregistry/tsconfig.json | 12 - .../ts/seats/meshartifactsweep/tsconfig.json | 12 - contracts/ts/seats/meshcatalog/tsconfig.json | 12 - contracts/ts/seats/meshdelivery/tsconfig.json | 12 - .../seats/meshdeliverychecker/tsconfig.json | 12 - contracts/ts/seats/meshwants/tsconfig.json | 12 - contracts/ts/seats/nodebuildgo/tsconfig.json | 12 - .../ts/seats/nodebuildimage/tsconfig.json | 12 - .../ts/seats/nodebuildnode/tsconfig.json | 12 - .../ts/seats/npmpackageregistry/tsconfig.json | 12 - .../seats/ociartifactregistry/tsconfig.json | 12 - 16 files changed, 2466 insertions(+), 151 deletions(-) create mode 100644 contracts/seats/mesh-catalog/fixtures/events.json create mode 100644 contracts/seats/mesh-catalog/fixtures/verbs.json delete mode 100644 contracts/ts/seats/containerimageregistry/tsconfig.json delete mode 100644 contracts/ts/seats/gopackageregistry/tsconfig.json delete mode 100644 contracts/ts/seats/meshartifactsweep/tsconfig.json delete mode 100644 contracts/ts/seats/meshcatalog/tsconfig.json delete mode 100644 contracts/ts/seats/meshdelivery/tsconfig.json delete mode 100644 contracts/ts/seats/meshdeliverychecker/tsconfig.json delete mode 100644 contracts/ts/seats/meshwants/tsconfig.json delete mode 100644 contracts/ts/seats/nodebuildgo/tsconfig.json delete mode 100644 contracts/ts/seats/nodebuildimage/tsconfig.json delete mode 100644 contracts/ts/seats/nodebuildnode/tsconfig.json delete mode 100644 contracts/ts/seats/npmpackageregistry/tsconfig.json delete mode 100644 contracts/ts/seats/ociartifactregistry/tsconfig.json diff --git a/contracts/seats/mesh-catalog/fixtures/events.json b/contracts/seats/mesh-catalog/fixtures/events.json new file mode 100644 index 00000000..f0d61ef2 --- /dev/null +++ b/contracts/seats/mesh-catalog/fixtures/events.json @@ -0,0 +1,111 @@ +[ + { + "name": "a trunk revision kept, on the seat's subject", + "of": "event:catalog-revision", + "subject": "mesh.seat.mesh-catalog.event.catalog-revision.main", + "given": { + "v": 1, + "revision": 12, + "kind": "trunk", + "source": 3589, + "entries": 2, + "changed": [ + "xclip" + ], + "at": "2026-11-09T19:00:00Z", + "branch": "main" + } + }, + { + "name": "a candidate's revision kept", + "of": "event:catalog-revision", + "subject": "mesh.seat.mesh-catalog.event.catalog-revision.main", + "given": { + "v": 1, + "revision": 13, + "kind": "candidate", + "source": 3589, + "group": "feat/47-G", + "heads": "0123456789ab", + "entries": 2, + "branch": "main" + } + }, + { + "name": "the store past 80 % of its cap", + "of": "event:filling", + "subject": "mesh.seat.mesh-catalog.event.filling", + "given": { + "store": "catalog-revisions", + "bytes": 450000000, + "cap": 536870912, + "at": "2026-11-09T19:00:00Z" + } + }, + { + "name": "the store full, naming what it refuses", + "of": "event:full", + "subject": "mesh.seat.mesh-catalog.event.full", + "given": { + "store": "catalog-revisions", + "bytes": 536870912, + "cap": 536870912, + "at": "2026-11-09T19:00:00Z", + "refused": "the next revision; source revision 3590 held pending with the reason objects full" + } + }, + { + "name": "the store back below its cap", + "of": "event:room", + "subject": "mesh.seat.mesh-catalog.event.room", + "given": { + "store": "catalog-revisions", + "bytes": 300000000, + "cap": 536870912, + "at": "2026-11-09T19:00:00Z" + } + }, + { + "name": "a registration changed on its warrant", + "of": "event:registration-changed", + "subject": "mesh.seat.mesh-catalog.event.registration-changed", + "given": { + "v": 1, + "module": "nats", + "version": 2, + "moved": [ + "nats:program unit: required -> bypass" + ], + "by": "operator@shanks", + "warrant": "ask-m2kx9a1b3c4d5e", + "at": "2026-11-10T10:00:00Z" + } + }, + { + "name": "a version released", + "of": "event:version-released", + "subject": "mesh.seat.mesh-catalog.event.version-released", + "given": { + "v": 1, + "module": "mesh-sdk", + "version": "0.1.15", + "artifacts": [ + { + "artifact": "mesh-sdk:go", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + } + ], + "source": 3589 + } + }, + { + "name": "the versions filled", + "of": "event:versions-filled", + "subject": "mesh.seat.mesh-catalog.event.versions-filled", + "given": { + "v": 1, + "at": "2026-11-11T10:00:00Z", + "modules": 120 + } + } +] diff --git a/contracts/seats/mesh-catalog/fixtures/states.json b/contracts/seats/mesh-catalog/fixtures/states.json index 43af3306..c3c1aacc 100644 --- a/contracts/seats/mesh-catalog/fixtures/states.json +++ b/contracts/seats/mesh-catalog/fixtures/states.json @@ -219,5 +219,376 @@ "repository": "novox/mesh-catalog" } } + }, + { + "name": "a watched branch's catalog graph revision", + "of": "state:catalog-revisions/.", + "given": { + "v": 1, + "revision": 12, + "kind": "trunk", + "source": 3589, + "trunk": [ + { + "repository": "novox/mesh-catalog", + "commit": "f469eb387a3015569d9b16c66ed418e9dd098f64" + } + ], + "definitions": [ + { + "seat": "node-build-go", + "digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + ], + "at": "2026-11-09T19:00:00Z", + "entries": [ + { + "module": "mesh-build-go", + "digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "module": "xclip", + "digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + ], + "branch": "main" + } + }, + { + "name": "a candidate's catalog graph revision", + "of": "state:catalog-revisions/candidate..", + "given": { + "v": 1, + "revision": 13, + "kind": "candidate", + "source": 3589, + "trunk": [ + { + "repository": "novox/mesh-catalog", + "commit": "f469eb387a3015569d9b16c66ed418e9dd098f64" + } + ], + "definitions": [ + { + "seat": "node-build-go", + "digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + ], + "at": "2026-11-09T19:00:00Z", + "entries": [ + { + "module": "mesh-build-go", + "digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "module": "xclip", + "digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + ], + "group": "feat/47-G", + "heads": "0123456789ab" + } + }, + { + "name": "a catalog graph entry (xclip)", + "of": "state:catalog-revisions/entry.", + "given": { + "v": 1, + "module": "xclip", + "repository": "novox/mesh-catalog", + "path": "modules/xclip", + "commit": "f469eb387a3015569d9b16c66ed418e9dd098f64", + "manifest": { + "module": "xclip", + "version": "1" + }, + "verdict": "accepted", + "fp": "src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56", + "inputs": { + "from": { + "tree": "4b825dc642cb6eb9a060e54bf8d69288fbee4904", + "bases": [ + "arch" + ], + "locks": { + "go.sum": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "packages": [ + "git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30" + ] + }, + "toolchains": { + "go": { + "language": "go", + "version": "1.26.0", + "recipe": "1" + } + }, + "src": 41, + "fp-src": 41 + }, + "bases": [ + "arch" + ], + "packages": { + "git.novox.be/novox/mesh-sdk/go": "v0.0.0-20261101000000-f469eb387a30" + }, + "toolchains": { + "go": { + "module": "mesh-build-go", + "version": "1.26.0", + "recipe": "1" + } + }, + "invokes": [ + "node-files.read" + ] + } + }, + { + "name": "an acting part's entry carries the rule of the seat it claims", + "of": "state:catalog-revisions/entry.", + "given": { + "v": 1, + "module": "mesh-build-go", + "repository": "novox/mesh-catalog", + "path": "modules/mesh-build-go", + "commit": "f469eb387a3015569d9b16c66ed418e9dd098f64", + "manifest": { + "module": "mesh-build-go", + "version": "1" + }, + "verdict": "accepted", + "fp": "src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56", + "serves": [ + "node-build-go.run" + ], + "left-out": [ + "mesh-catalog.revision" + ], + "needs": [ + "form:setting", + "word:claims" + ], + "awaits": [ + "database" + ], + "main": "cmd/mesh-build-go", + "acts": [ + { + "seat": "node-build-go", + "step": "build", + "on": "go", + "bound": "60m" + } + ] + } + }, + { + "name": "a module's registration", + "of": "state:registrations/", + "given": { + "v": 1, + "module": "nats", + "origin": "novox/mesh-catalog", + "path": "modules/nats/module.json", + "branches": [ + "main" + ], + "policy": { + "steps": { + "lint": "required", + "unit": "required", + "integration": "required", + "composition": "required", + "review": "optional", + "approval": "bypass" + }, + "artifacts": { + "program": { + "unit": "bypass" + } + } + }, + "version": 2, + "by": "operator@shanks", + "warrant": "ask-m2kx9a1b3c4d5e", + "at": "2026-11-10T10:00:00Z" + } + }, + { + "name": "one version kept in the history", + "of": "state:registration-history/.", + "given": { + "v": 1, + "module": "nats", + "origin": "novox/mesh-catalog", + "path": "modules/nats/module.json", + "branches": [ + "main" + ], + "policy": { + "steps": { + "lint": "required", + "unit": "required", + "integration": "required", + "composition": "required", + "review": "optional", + "approval": "bypass" + }, + "artifacts": { + "program": { + "unit": "bypass" + } + } + }, + "version": 2, + "by": "operator@shanks", + "warrant": "ask-m2kx9a1b3c4d5e", + "at": "2026-11-10T10:00:00Z" + } + }, + { + "name": "an entry with its artifacts and the edges into them, per artifact", + "of": "state:catalog-revisions/entry.", + "given": { + "v": 1, + "module": "mesh-grants", + "repository": "novox/mesh-catalog", + "path": "modules/xclip", + "commit": "f469eb387a3015569d9b16c66ed418e9dd098f64", + "manifest": { + "module": "mesh-grants", + "version": "1" + }, + "verdict": "accepted", + "fp": "src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56", + "inputs": { + "from": { + "tree": "4b825dc642cb6eb9a060e54bf8d69288fbee4904", + "bases": [ + "arch" + ], + "locks": { + "go.sum": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "packages": [ + "git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30" + ] + }, + "toolchains": { + "go": { + "language": "go", + "version": "1.26.0", + "recipe": "1" + } + }, + "src": 41, + "fp-src": 41 + }, + "bases": [ + "arch" + ], + "packages": { + "git.novox.be/novox/mesh-sdk/go": "v0.0.0-20261101000000-f469eb387a30" + }, + "toolchains": { + "go": { + "module": "mesh-build-go", + "version": "1.26.0", + "recipe": "1" + } + }, + "invokes": [ + "node-files.read" + ], + "artifacts": [ + { + "ref": "mesh-grants:program", + "language": "go" + }, + { + "ref": "mesh-grants:tools", + "language": "go" + } + ], + "edges": [ + { + "from": "mesh-grants:program", + "to": "node-tools:runtime", + "kind": 6, + "why": "seat mesh-grants verb grants" + }, + { + "from": "node-tools:runtime", + "to": "mesh-grants:tools", + "kind": 4, + "why": "the tool runner runs the tools" + }, + { + "from": "mesh-sdk:go", + "to": "mesh-grants:program", + "kind": 1, + "why": "git.novox.be/novox/mesh-sdk/go" + }, + { + "from": "nats:program", + "to": "mesh-grants:program", + "kind": 4, + "declared": true, + "why": "declared in needs" + } + ] + } + }, + { + "name": "a released version", + "of": "state:versions/.", + "given": { + "v": 1, + "module": "mesh-sdk", + "version": "0.1.15", + "source": 3589, + "artifacts": [ + { + "artifact": "mesh-sdk:go", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + } + ], + "edges": [ + { + "kind": 1, + "stale": true, + "word": "imports", + "part": "mesh-contracts:go-nodeengine", + "version": "0.1.4", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + } + ] + } + }, + { + "name": "a build of another branch", + "of": "state:build-edges/.", + "given": { + "v": 1, + "fp": "src2:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", + "source": 3589, + "edges": [ + { + "kind": 1, + "stale": true, + "word": "imports", + "part": "mesh-contracts:go-nodeengine", + "version": "0.1.4", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + } + ] + } + }, + { + "name": "an input", + "of": "state:inputs/