Compose a process's environment as a container's #250

Merged
mesh-admin merged 1 commits from feat/a-process-env-is-composed-like-a-containers into main 2026-10-03 22:29:12 +00:00
Contributor

A module's own code moving out of its container (novox/hq to-be 38 WP4c) becomes a process on the machine and still has to be told what its container was told. ${port:…} and ${seat:…} were filled only in a file's content and a container's env, so in a process's env they reached the machine as literals — and the modules that moved first (mesh-catalog #245) wrote their run-once steps a 0600 env file instead.

Change

  • internal/catalogue/port_into.go: portInto fills env for container and process alike, with the same refusal for an undeclared port; the refusal names the resource kind (…'s process showcase-setup sets X to…).
  • internal/catalogue/seat_into.go: seatInto, same.
  • ${dir:…} / ${access:…} were already resolved in any resource's env (dirInto, accessInto), and a bundle's env (ADR 0192) already resolves ${dir:…} and ${port:…} in bundleWords — unchanged.

Tests (internal/catalogue/process_env_test.go, through Resolution.Declaration)

  • a run-once process with ${port:8080}, ${dir:data} and ${seat:mesh-store:5432} in its env composes to the concrete values, and the manifest's own map is not edited;
  • ${port:9999} (undeclared) and ${dir:date} (no such directory) are refused, naming the process and variable.

Both new tests fail on main (port and seat left as literals; undeclared port not refused). go test ./... against a throwaway Postgres: all green except the known unrelated TestTheResolverIsToldEveryMachineOnTheNetworkAndToldAgainWhenOneLeaves.

A module's own code moving out of its container (novox/hq to-be 38 WP4c) becomes a `process` on the machine and still has to be told what its container was told. `${port:…}` and `${seat:…}` were filled only in a file's content and a container's `env`, so in a process's `env` they reached the machine as literals — and the modules that moved first (mesh-catalog #245) wrote their run-once steps a 0600 env file instead. **Change** - `internal/catalogue/port_into.go`: `portInto` fills `env` for `container` and `process` alike, with the same refusal for an undeclared port; the refusal names the resource kind (`…'s process showcase-setup sets X to…`). - `internal/catalogue/seat_into.go`: `seatInto`, same. - `${dir:…}` / `${access:…}` were already resolved in any resource's `env` (`dirInto`, `accessInto`), and a bundle's `env` (ADR 0192) already resolves `${dir:…}` and `${port:…}` in `bundleWords` — unchanged. **Tests** (`internal/catalogue/process_env_test.go`, through `Resolution.Declaration`) - a run-once process with `${port:8080}`, `${dir:data}` and `${seat:mesh-store:5432}` in its env composes to the concrete values, and the manifest's own map is not edited; - `${port:9999}` (undeclared) and `${dir:date}` (no such directory) are refused, naming the process and variable. Both new tests fail on main (port and seat left as literals; undeclared port not refused). `go test ./...` against a throwaway Postgres: all green except the known unrelated `TestTheResolverIsToldEveryMachineOnTheNetworkAndToldAgainWhenOneLeaves`.
mesh-admin added 1 commit 2026-10-03 22:27:51 +00:00
A module's own code moving out of its container (novox/hq to-be 38 WP4c)
becomes a process on the machine, and still has to be told what its
container was: the port this machine gave the module and where the
foundation's seats are. ${port:…} and ${seat:…} were filled only in a
file's content and a container's env, so in a process's env they reached
the machine as literals, and the modules that moved first (mesh-catalog
#245) wrote their run-once steps a 0600 env file instead. A process's env
now takes the same resolution and the same refusals; ${dir:…} and
${access:…} already did, and a bundle's env (ADR 0192) already resolves
${dir:…} and ${port:…}.
mesh-admin merged commit 5c832f2d19 into main 2026-10-03 22:29:12 +00:00
mesh-admin deleted branch feat/a-process-env-is-composed-like-a-containers 2026-10-03 22:29:12 +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-controller#250