oficina / equipo Public

spec: places, where a team's code and sites go

Per-team places (code homes, temporary sites, sites) with per-project
overrides, agent-proposed and owner-confirmed; coordinator tools to
publish and read a site's address through per-app CARLOS deploy
credentials held by the runner. Lists CARLOS platform requests and
slices; slice 1 publishes the Neary's site.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 56b80b336f830e5e65b80149d7c75e9208d1eede parent c74fd0a
1 file changed, +316 −0
  • docs/superpowers/specs/2026-11-26-places-config.md +316 −0
diff --git a/docs/superpowers/specs/2026-11-26-places-config.md b/docs/superpowers/specs/2026-11-26-places-config.md
new file mode 100644
index 00000000..d56df979
--- /dev/null
+++ b/docs/superpowers/specs/2026-11-26-places-config.md
@@ -0,0 +1,316 @@
+# Places: where a team's code and sites go
+
+Status: 2026-11-26, revision 1, draft for Paul. Drafted by Claude (Opus 5.5)
+on `design-places` from main c74fd0ac. Nothing is built.
+
+Paul, 2026-11-26: "Equipo is having trouble publishing the site. Is it not
+aware of Carloku and its ability to publish both locally within the tailnet
+and remotely to either Tito CARLOS Platform or Carloku? This again should be
+config ... every Equipo might have a different set of tools, but I want mine
+to be aware of where to put things per project, where to publish temporary
+sites, where to publish sites etc."
+
+## 0. What happens today
+
+Facts from main c74fd0ac and a read-only copy of production
+(equipo.oficina.works, `carlos db query --app equipo --account oficina`,
+2026-11-26 09:40 UTC).
+
+- **Publishing is one post-merge card.** `offerPublish`
+ (`internal/equipo/chat/publish.go`) raises a publish card after a merge
+ whose approved Review found `release/preview.json`. It returns silently
+ unless the creator's primary runner reports `Capabilities.Sites`. The
+ runner reports that only when its machine sets `EQUIPO_SITE_HOST=carloku`
+ and holds the person's own signed-in `~/.carlos/credentials`
+ (`internal/runner/thin/site.go`). Console and account are constants:
+ `https://console.carloku.com`, account `oficina`.
+- **Neary's never got a card.** The production runner (docs-t1) reports
+ `preview_host: devbox` and no sites capability. For both Neary's tasks
+ (`tkbstr6cjl7h`, `tkzmnycab3ml`, repo `amadan.net/paulca/nearys`) the task
+ is done and merged, `publish_asked` is empty and the project's `site_app`
+ is NULL: no card, no step, no audit row, nothing said.
+- **Nobody could explain it.** The coordinator has no tool that publishes a
+ site or reads its address; it said so, then had Engineering merge a filler
+ "page not found" change (without checks) only to provoke a publish card,
+ which again did not come. The Assistant looked in Base (`base_apps`),
+ which lists apps installed on Base's own account, found none, and told
+ Paul the site "never appeared there". Base is not where Equipo puts sites.
+- **Previews are broken on every host.** Since the injection defences
+ (2026-11-19) every export carries a `_headers` file with
+ Content-Security-Policy, X-Content-Type-Options, Referrer-Policy and
+ X-DNS-Prefetch-Control. The carlos static-header parser accepts only
+ Cache-Control, Access-Control-Allow-Origin, Access-Control-Expose-Headers,
+ Cross-Origin-Resource-Policy and Timing-Allow-Origin, and refuses the rest
+ "not supported yet", in `carlos deploy` and in `carlos devbox share`
+ alike. The latest preview (`tkzmnycab3ml` step 4) ended done with reason
+ `preview_headers` and outcome unconfirmed, and its card still offered a
+ link. The earlier one failed `preview_scanner`.
+- **The devbox domain is never learnt.** The runner learns its devbox domain
+ from the first successful share's link (`preview_devbox.go`). No share has
+ succeeded, so the runner logs `domain=""` at start and Machines cannot show
+ an address.
+- **Setup is environment variables.** `EQUIPO_PREVIEW_HOST`,
+ `EQUIPO_SITE_HOST`, `EQUIPO_PREVIEW_CREDENTIAL_PATH` and a person's CLI
+ login on the runner machine. A person sets them by hand, per machine, and
+ nothing in Equipo shows them. That breaks the product rule that agents do
+ setup and people confirm.
+
+The CARLOS capabilities that cover this already exist: `carlos deploy`
+(static kind, `--temporary` with `--ttl`, named destinations in
+`.carlos/config` with `-d`), the `deploy` service role (one app, named rungs,
+read from `CARLOS_SERVICE_TOKEN` with `CARLOS_CONSOLE`), temporary static
+sites (live on dev and flagship since 2026-10-24, `tmp-` names, at most 20
+per account), and `carlos devbox share --dir` for tailnet links. Both
+consoles Paul uses are reachable from docs-t1: console.carloku.com (the
+flagship) and console.platform.tito.io (Tito). Equipo should use these and
+ask CARLOS for what is missing (section 6), not build around them.
+
+## 1. Places
+
+A **place** is a named destination the team has confirmed, of one kind,
+served by one fixed adapter. Places are team records in the instance
+database: the same for every member, never `scope.Owned`.
+
+| Kind | Names | Adapters in v1 |
+| --- | --- | --- |
+| Code home | a forge namespace where new projects go | Amadan (the existing `project_home` setting becomes this place) |
+| Temporary site | where previews and short-lived sites go | CARLOS devbox on one runner's machine (tailnet only); CARLOS temporary sites on one console and account (public, expires) |
+| Site | where a project's real site lives | a CARLOS app on one console and account (Carloku, Tito, or any console the runner is signed in to) |
+
+Later kinds (object storage, mail senders, domains, native release
+channels) add an adapter each. An unknown kind or adapter is refused at the
+instance and the runner; there is no generic "run this command" place.
+
+**Defaults and overrides.** Each kind has at most one team default. A
+project may override any kind. A site is always per project: the team
+default names the console and account where new sites go, and the project
+binding names its app. Resolution is project override, else team default,
+else none, and none means propose (section 2). Code never guesses a place
+from a name match without a confirmation on record.
+
+**Storage.** Additive migration 0108: `chat_places` (id, kind, adapter,
+label, console origin, account sqid and name, app, runner id for adapters
+that live on a machine, state proposed, confirmed or retired, revision,
+proposed by, confirmed by and when) and `chat_project_places` (project, kind,
+place, app, revision). `chat_projects.site_app` is copied into the project
+binding and left in place. Every write checks the current roster inside its
+transaction, is owner-only, and appends its audit event there.
+
+**Credentials, and who holds them.** The runner holds every CARLOS secret.
+The instance holds only metadata: credential name, role, app, rungs,
+console, account, the runner that holds it, a fingerprint (a hash, to tell
+rotations apart), minted and last used.
+
+- *Site.* One CARLOS `deploy` credential per site app, minted with
+ `--app <app> --rungs edge`. It can ship and promote that app's `edge`
+ channel and nothing else: it cannot create apps, touch domains, retention
+ or `stable`. A deploy credential cannot create its own app, so when the
+ owner confirms a site place the runner runs two fixed commands with the
+ owner's signed-in carlos on that machine: `carlos apps create` (only when
+ the app does not exist) and `carlos services create --role deploy --app
+ <app> --rungs edge --json <name>`. The runner process reads the secret
+ from that command's output and stores it 0600 in its state directory,
+ outside every directory a sandbox mounts. Each later deploy runs one fixed
+ `carlos deploy` with the secret in `CARLOS_SERVICE_TOKEN` and the console
+ in `CARLOS_CONSOLE`, never in argv, a record, a log or a model's context,
+ and with `CARLOS_CONFIG` naming a runner-written config holding exactly
+ the confirmed destination. The person's own credential is used only for
+ setup, at their tap, never to deploy.
+- *A credential minted elsewhere* (by Base through `carlos platform
+ credentials mint`, or by the consent flow in section 6) arrives sealed to
+ the runner's seal key, as API keys do (connections spec §2.4).
+- *Devbox temporary site.* No credential: the runner's own `carlos devbox`
+ reaches its registrar over a local socket, as today.
+- *CARLOS temporary sites.* `/new-temporary` refuses an app-scoped
+ credential, so `--temporary` needs an account-wide `publish` credential,
+ which can also claim, ship, promote and retire every app in that account.
+ Until CARLOS offers a narrower scope (P3), a public temporary place may
+ only name an account the owner dedicates to previews, and the coordinator
+ proposes devbox first.
+
+A place with a credential belongs to the runner that holds it, which is the
+creator's primary today. If that runner is removed, the place shows "needs a
+machine" and the coordinator proposes setting it up again on another
+runner. Equipo then revokes the old credential with `carlos services
+revoke`, or asks the owner to.
+
+**Seeing and changing places.** Settings gains **Places**, state first. One
+line per kind, then one line per project that overrides or has a site:
+
+> Sites go to Carloku, account paulca.
+> Neary's: site-nearys-k3x9qa, live at https://... (checked 10 minutes ago).
+> Temporary sites: docs-t1's devbox, on your tailnet.
+> New projects go in paulca.
+
+Each line offers Change, Undo (after a change) and Retire. Change opens a
+chooser listing only what the runner can see (section 2), one tap each, with
+the destination shown in full before it applies. There are no fields to type
+into. Proposals from the coordinator appear both as a card in chat and as a
+pending line here. Phones get the same single-column page.
+
+## 2. Setup by agents
+
+The coordinator proposes a place the first time one is needed: a merged
+website with no site place, a preview with no temporary place, a new project
+with no code home. It also proposes a starting set when it moves in.
+
+**What the runner can see.** The runner reports a bounded, validated reach
+inventory in its hello, with no secrets: consoles its carlos is signed in to
+(`carlos auth whoami --console`), accounts it owns on each (`carlos accounts
+list`), apps in an account when asked (`carlos apps list`), whether a devbox
+answers (`carlos devbox list`), and the namespaces it may create repositories
+in (`create_in`, as today). A repository's committed `.carlos/config`
+destinations are hints only, read as untrusted repository text.
+
+**How a proposal is made.** Code ranks candidates from the inventory with
+fixed rules: an existing app the repository's destination names, in an
+account the runner owns; else the account whose name matches the project's
+namespace on the flagship (amadan.net/paulca/nearys proposes Carloku account
+paulca); else the person's only owned account. The coordinator calls
+`propose_place` with a kind, a project and one candidate id from the
+inventory; it cannot write a console, account or app itself. Equipo raises a
+card: "Publish Neary's on Carloku, in account paulca?" with the candidates
+(best first, at most six) and Not now. The owner's tap confirms. The runner
+then creates the app and mints the credential, and the card says when that
+is done or why it failed. Confirming a place publishes nothing.
+
+## 3. Coordinator tools
+
+All are runner MCP tools answered by the instance; every CARLOS command runs
+on the runner, from a fixed template, outside every sandbox.
+
+- `places` (read-only): the resolved places for the team or one project,
+ with state, address and last check, returned as quoted data.
+- `propose_place`: kind, optional project, candidate id. Raises the card in
+ section 2. It cannot confirm, change or retire a place.
+- `publish_site`: a task, or a project and a commit on its default branch,
+ and a target (`site` or `temporary_site`). It raises the publish card,
+ which now names the place ("Publish Neary's to site-nearys-k3x9qa on
+ Carloku, account paulca?"). Only the task creator's tap, while they are
+ an owner, places a publish step, as today. A site takes only a commit Equipo merged into the
+ default branch and Review approved; a temporary site takes an approved
+ candidate, as previews do. With no confirmed place it proposes one first.
+ It may raise a card for an older merged task that was never asked, which
+ is what Neary's needs.
+- `site_status`: a project's site: app, console, account, address (the URL
+ the deploy printed, confirmed by fetching the marker), the version its
+ `edge` channel serves (read with the deploy credential), and the last
+ publish outcome and when.
+
+The publish step itself stays as built: export from git objects, the
+instance's digest-bound publish check right before the deploy, the marker
+fetched back over https, and published or unconfirmed recorded on the task.
+What changes is where the console, account, app and credential come from.
+
+## 4. What this replaces
+
+- `EQUIPO_SITE_HOST` and the `siteAccount`/`siteConsole` constants are
+ replaced by the site place. The runner's sites capability becomes "holds a
+ credential for this place", reported per place.
+- `EQUIPO_PREVIEW_HOST=devbox` becomes a devbox temporary place bound to that
+ runner, and `EQUIPO_PREVIEW_CREDENTIAL_PATH` becomes the credential of a
+ public temporary place.
+- `offerPublish` stops returning silently. With no site place it raises a
+ place proposal; with a place whose runner lacks the credential it says
+ what is missing; either way the task shows why nothing was offered.
+- A preview the host refused (`preview_headers`) shows "The preview host
+ needs a CARLOS update before previews open" and no link. An unconfirmed
+ preview never shows a link as if it works.
+- The devbox domain comes from `carlos devbox list` once CARLOS reports it
+ (P4), else from the first share, and Places says "address known after the
+ first preview" until then.
+- The Assistant asks Equipo for a site's address (a read-only operation
+ backed by `site_status`) instead of looking in Base.
+
+**Migration.** For one release the runner still reads the old variables, but
+only to report them as observed places. The instance turns them into
+proposed places, never confirmed ones, and the owner confirms once. The
+existing per-project `site_app` names are kept as each project's app. No
+Carloku app exists for Neary's, so it starts fresh.
+
+## 5. Security
+
+- **Scope.** Per-app `deploy` credentials on `edge` only. An account-wide
+ credential only for a public temporary place on a dedicated account, until
+ P3. The person's own credential is used only to create an app and mint
+ its credential, at the owner's tap.
+- **Gates.** An owner's tap confirms or changes a place. A tap on the
+ publish card, per merged commit, publishes (unchanged). The existing
+ "Publish previews publicly" project setting still gates public temporary
+ places. A place for one project is never used for another.
+- **Model text never chooses a place.** Tools take inventory ids, and the
+ card shows console, account and app strings that code derived. A tap is
+ bound to the card id, revision, person and a hash of the exact place
+ record, so a stale or altered card is refused. The publish dispatch reads
+ its target from the confirmed place, never from tool arguments, and the
+ runner refuses a dispatch whose console, account or app differs from what
+ it minted the credential for. Repository `.carlos/config` is a quoted
+ hint, never authority.
+- **Audit.** Place proposed, confirmed, changed and retired; app created;
+ credential minted, rotated and revoked (name and fingerprint only); and
+ the publish events that exist today. CARLOS audits each credential's use
+ on its side.
+- **Revocation.** Retiring a place revokes its credential. CARLOS service
+ credentials belong to the account, not the person, so an owner leaving the
+ team does not revoke them; the Places view lists live credentials and the
+ owner who minted each, and an owner's removal raises a card offering
+ rotation.
+
+## 6. Platform requests (CARLOS; nothing filed)
+
+- **P1, blocking previews.** Accept the four security headers in `_headers`
+ (Content-Security-Policy, X-Content-Type-Options, Referrer-Policy,
+ X-DNS-Prefetch-Control) in ship, deploy and devbox share. The work exists
+ on carlos/platform `headers-security-allowlist` (77637a40, 2026-11-21),
+ not merged into main.
+- **P2.** A service credential by consent: Equipo asks for `deploy` on one
+ app (creating the app if needed), an account owner approves in the
+ console, and the secret is delivered once to the requesting machine, as
+ `carlos auth login` codes travel. This lets teams without an owner's CLI
+ login on the runner set up sites, and removes that login from Paul's
+ runner.
+- **P3.** A temporary-sites scope: create, ship and delete only `tmp-` apps
+ in one account, within the existing caps, and nothing else.
+- **P4.** `carlos devbox list` reports the devbox's domain before the first
+ share, in a machine-readable form.
+- **P5.** Let the `deploy` role read its own app's public addresses
+ (routes and attached domains are person-only today), so `site_status` can
+ name a custom domain.
+
+## 7. Slices
+
+1. **Neary's goes live (M).** Migration 0108 and the place records; the
+ site kind with the Carloku adapter, console and account taken from the
+ place; `propose_place` and `publish_site` for sites; app create and
+ per-app deploy credential minting on the runner with Paul's existing
+ login; `offerPublish` says why instead of returning silently; a
+ read-only Places page. Finish line: Paul confirms "Carloku, account
+ paulca" for Neary's, taps Publish on the merged commit c069eae7, and the
+ task shows a confirmed address.
+2. **Temporary places (S, after P1 ships).** Devbox and CARLOS temporary
+ sites as places; the honest preview card; the env variables become
+ observed proposals; the domain from the devbox list once P4 lands.
+3. **Places view and status (S).** Change, Undo and Retire; `site_status`
+ and `places` tools; the Assistant's read-only site operation; code homes
+ folded in from `project_home`.
+4. **Consent credentials (M, after P2).** Credentials by consent for teams
+ with no owner login on a runner; rotation and revocation cards; P3 for
+ public temporary sites when it lands.
+
+## 8. Open questions for Paul
+
+1. **Where does Neary's live?** Recommend Carloku, account paulca, matching
+ the forge namespace; oficina projects go to account oficina. Tito only
+ for projects that are Tito's.
+2. **May Equipo use your CLI login on docs-t1 to create the app and mint its
+ deploy credential, at your tap?** Recommend yes for slice 1, and retire
+ that use when P2 lands.
+3. **Temporary sites default.** Recommend docs-t1's devbox (tailnet) as the
+ team default and no public temporary place until P3, or a dedicated
+ previews account if you want public links sooner.
+4. **Ship P1 now?** Recommend reviewing and merging
+ `headers-security-allowlist` in the next platform release; every preview
+ fails until it rolls to the boxes and to the devbox's carlos.
+5. **Who may confirm places?** Recommend owners only, as with project
+ placement and merge policy; a creator still taps their own task's
+ publish card.