🤖 Branch sidecar-environment (61b926da) implements this. The branch description could not be set from here: this CLI build refuses branch describe without a session block. Here is the description:
🤖 What: carlos sidecars create -environment <e> (plus the console's create body) binds a sidecar to a named config environment instead of the app's default bundle. Closes the gap in discussion #340.
Why: a sidecar used to read the app's default bundle, which is the same bundle the app's instances read. So a secret that the sidecar needs, and that the app's server must never hold, had nowhere to live. The motivating case is Eleven's bot sidecar, which holds an ANTHROPIC_API_KEY and one-time invites; the chat server must never see them. sidecarRouteFor already carried Record.Environment onto the route, and config delivery already keys on it. Only the doors (console + CLI) were missing.
Changes:
internal/console/apisidecars.go: the create body takesenvironmentand stamps it on the record.internal/provision/sidecar.go:ValidateSidecarShapechecks the environment name, using the instance record's[a-z0-9-]{1,32}rule.sidecars_cli.go/apimode.go: a-environmentflag and usage text, and the "created" line names the binding.- Tests:
TestAPISidecarCreateBindsAnEnvironment(named, blank, omitted, traversal refused) and an extended shape test.
Authority: the same binding power an instance create already has (instanceGateFor). The sidecar still runs only the app's own release with the manifest's argv.
Census (needs a ruling):
- Record-write census:
handleAPISidecarCreate's digest is re-pinned. It is still the single create-onlyCreateSidecarRecordwrite; the record now also carries Environment. - Plan 14: a PROPOSED envelope-only overlay,
plan14-root-reads-sidecar-environment.tsv, loaded last. It re-pins the root,internal/consoleandinternal/provisionenvelopes. No root-read unit changed and the seal stands. This awaits the Plan 14 owner's ruling: re-word it to a ruling marker, or reject it.
Tested:
- Locally on macOS, the sidecar, provision and root tests pass.
- Some console tests and the Plan 14 census also fail on unchanged main locally, so they are unrelated: - the hostops-contract tests; - the case-insensitive filesystem test; - 6682 local-only census discrepancies. This branch adds none beyond base.
- Linux CI is the gate.
Follow-up, not in this branch: set-environment for an existing sidecar.
Do not merge until the census overlay is ruled.