Repository navigation
Description
Parent: #437 — a network-exposed k8s deployment must not let an authenticated API caller select an arbitrary host/container filesystem root.
Problem
CreateSession (and the other session-creating paths) accepted a client-supplied workspace path, checked only for non-emptiness, then opened it as a real filesystem root. Authentication identified the caller; nothing authorized that principal to select a path. On a network-facing deployment that combines a remote caller with the server's ambient filesystem authority — an authenticated client could root a session at /, /etc, or a service-account secret mount and point the file tools + Bash at it. A loopback bind is not evidence the caller is local (a reverse proxy defeats that inference), so the policy must be a deployment/composition decision, not inferred from the request or the socket.
Design
ADR 0237 and the acceptance plan docs/acceptance/listener-scoped-workspace-authority.md. Workspace selection becomes a deployment policy: a loopback/embedded deployment stays client-selectable; a network-facing deployment is server-assigned (client filesystem workspaces are rejected before cleaning/comparison, and the operator-configured root is assigned). Server-assigned authority is enforced on every create/run-entry/rehydration/schedule-fire/adoption/environment-override path, with a lexical stored-root identity check.
Acceptance criteria
-
mecatedderives client-selected vs server-assigned from API-listener topology, with an explicit--workspace-authorityoverride; a network filesystem deployment without a configured root fails before listener startup. - Server-assigned deployments reject a non-empty client workspace with
InvalidArgumentbefore path cleaning, filesystem access, trust evaluation, or environment creation. - Persisted-session run entry, rehydration, scheduled-fire creation, legacy adoption, and environment overrides all enforce the deployment root; a stale off-root value fails closed.
-
mecatuirejects an explicit--workspaceto a remote target locally, and sends no cwd by default. -
mecak8sis file-less by default (no-FS), and serves an operator-mounted workspace root (e.g. a PVC) as a server-assigned filesystem deployment when--workspaceis set. -
task lint && task testgreen;task docs+task site:buildclean.
Status
Implemented on branch acc/listener-scoped-workspace-authority (all gates green); pending PR + merge. Panel review during implementation surfaced the follow-ups below.
Related
- CreateTeam bypasses listener-scoped workspace authority (ADR 0237) #759 —
CreateTeambypasses this authority (separate fix branch) - Consolidate workspace-authority enforcement: one gate per surface + make the config state unrepresentable #760 — consolidate the enforcement surfaces + make the config state unrepresentable
Activity