ADR 0052 — a module runs its code as its own process, with its own account #20

Closed
jschoubben wants to merge 0 commits from worktree-adr-module-runtime into main
Owner

The runtime-model gap the review surfaced — the thing that unblocks actually running the converted catalogue.

Problem: the catalogue's modules now have tools and events (code), but nothing runs it — only the audit-logger got a runtime, treated as an exception. And a node-wide runtime can't be the answer: it would hold one account with the union of every module's permissions, the exact isolation ADR 0048 draws.

Decision: per-module. A module with tools or events runs one process (a container: the tool runtime carrying its code) holding the one scoped account ADR 0048 gave it. It serves its tools each on its own key (serve.<tool> — a caller names a tool and only its module answers, superseding the shared tools.invoke dispatch); runs its events in the same process under the same account; and its runtime image is the tool runtime + the module's code — the audit-logger's shape, made the rule. A plain service module (plex the server, dnsmasq) runs no such process.

Consequences it names: a process/image per tools-or-events module (the cost of 0048's isolation, paid deliberately); serve.<tool> per key in the sdk; and — the fix for the provisioner-emit bug the review found — a provider's provisioner is a runtime process too, so one that emits must carry a broker credential or not emit.

Proposed; extends 0048; references 0045, 0047, 0044.

https://claude.ai/code/session_01LrgweAeERJYBg88c5cKDzF

The runtime-model gap the review surfaced — the thing that unblocks actually running the converted catalogue. **Problem:** the catalogue's modules now have tools and events (code), but nothing runs it — only the audit-logger got a runtime, treated as an exception. And a node-wide runtime *can't* be the answer: it would hold one account with the union of every module's permissions, the exact isolation ADR 0048 draws. **Decision:** per-module. A module with tools or events runs **one process** (a container: the tool runtime carrying its code) holding the **one scoped account** ADR 0048 gave it. It serves its tools each on its own key (`serve.<tool>` — a caller names a tool and only its module answers, superseding the shared `tools.invoke` dispatch); runs its events in the same process under the same account; and its runtime image is the tool runtime + the module's code — the audit-logger's shape, made the rule. A plain service module (plex the *server*, dnsmasq) runs no such process. **Consequences it names:** a process/image per tools-or-events module (the cost of 0048's isolation, paid deliberately); `serve.<tool>` per key in the sdk; and — the fix for the provisioner-emit bug the review found — **a provider's provisioner is a runtime process too**, so one that emits must carry a broker credential or not emit. Proposed; extends 0048; references 0045, 0047, 0044. https://claude.ai/code/session_01LrgweAeERJYBg88c5cKDzF
jschoubben added 1 commit 2026-09-04 19:25:05 +00:00
The runtime-model gap the review found. A module with tools or events runs one
container — the tool runtime carrying its code — holding the one scoped account
ADR 0048 gave it. A node-wide runtime can't: it would hold the union of every
module's permissions, the isolation 0048 draws. So per-module: one module, one
process, one account. Tools served per key (serve.<tool>) so a caller names a
tool and only its module answers (superseding a shared tools.invoke); events in
the same process under the same account; the runtime image is the tool runtime
plus the module's code (the audit-logger's shape, made the rule). A plain
service module runs no such process. A provider's provisioner is a runtime too —
which is why a provisioner that emits must carry a broker credential or not emit.

Claude-Session: https://claude.ai/code/session_01LrgweAeERJYBg88c5cKDzF
jschoubben closed this pull request 2026-09-05 01:18:31 +00:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/hq#20