A runtime serves what the mesh issued it, and a seat's verbs are implemented under the seat's name (hq ADR 0160) #23

Merged
mesh-admin merged 1 commits from feat/a-runtime-serves-what-it-is-issued into main 2026-10-01 13:23:55 +00:00
Contributor

The runtime half of novox/hq ADR 0160 (the controller half is mesh-controller #188).

  • The one address a runtime derives for itself is mesh.assignment.<node>.<module>. It reads the membership there with a direct get on the ASSIGNMENTS stream, serves each tool exactly where the membership says (the plain subject in the module's queue when the mesh issued one, this machine's beside it), and follows the subject, re-serving when a new membership arrives. A mesh that has issued nothing yet gets the shape it always derived, and the log says so.
  • A seat's verbs are the role's, not the software's (ADR 0159): a module implements them with registerModuleTools("<seat>", …); the runtime serves that on the seat's subjects when the credential claims the seat, and never lists it among the module's own tools. A module named like its seat registers once and is both.
  • The tools answer carries each tool's subjects; the console and CLI call the subject the listing gave them instead of composing one.

Tests: test/membership.test.ts (four cases against a real NATS with JetStream) plus the existing suite, all green.

Roll-out: safe before the controller's membership exists (derived shape); modules rebuilt on this runtime pick the membership up on their next start. The postgres seat implementation (mesh-catalog #203) is reworked to register under mesh-store after this lands.

The runtime half of novox/hq ADR 0160 (the controller half is mesh-controller #188). - The one address a runtime derives for itself is `mesh.assignment.<node>.<module>`. It reads the membership there with a direct get on the ASSIGNMENTS stream, serves each tool exactly where the membership says (the plain subject in the module's queue when the mesh issued one, this machine's beside it), and follows the subject, re-serving when a new membership arrives. A mesh that has issued nothing yet gets the shape it always derived, and the log says so. - A seat's verbs are the role's, not the software's (ADR 0159): a module implements them with `registerModuleTools("<seat>", …)`; the runtime serves that on the seat's subjects when the credential claims the seat, and never lists it among the module's own tools. A module named like its seat registers once and is both. - The `tools` answer carries each tool's subjects; the console and CLI call the subject the listing gave them instead of composing one. Tests: `test/membership.test.ts` (four cases against a real NATS with JetStream) plus the existing suite, all green. Roll-out: safe before the controller's membership exists (derived shape); modules rebuilt on this runtime pick the membership up on their next start. The postgres seat implementation (mesh-catalog #203) is reworked to register under `mesh-store` after this lands.
mesh-admin added 1 commit 2026-10-01 13:17:28 +00:00
The one address a runtime derives for itself is mesh.assignment.<node>.<module>. It reads the
membership there with a direct get on the ASSIGNMENTS stream, serves each tool exactly where the
membership says — the plain subject in the module's queue when the mesh issued one, this machine's
beside it — and follows the subject, re-serving when a new membership arrives. A mesh that has issued
nothing yet gets the shape it always derived, and the log says so.

A seat's verbs are the role's, not the software's (ADR 0159): a module implements them with
registerModuleTools("<seat>", …), the runtime serves that on the seat's subjects when the credential
claims the seat, and never lists it among the module's own tools. A module named like its seat
registers once and is both.

The tools answer carries each tool's subjects, and the console and CLI call the subject the listing
gave them instead of composing one.
mesh-admin merged commit 56f82588af into main 2026-10-01 13:23:55 +00:00
mesh-admin deleted branch feat/a-runtime-serves-what-it-is-issued 2026-10-01 13:23:55 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-tools#23