oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1# Places: where a team's code and sites go
2
3Status: 2026-11-26, revision 3, draft for Paul. Drafted by Claude (Opus 5.5)
4on `design-places` from main c74fd0ac. Nothing is built.
5
6Paul, 2026-11-26: "Equipo is having trouble publishing the site. Is it not
7aware of Carloku and its ability to publish both locally within the tailnet
8and remotely to either Tito CARLOS Platform or Carloku? This again should be
9config ... every Equipo might have a different set of tools, but I want mine
10to be aware of where to put things per project, where to publish temporary
11sites, where to publish sites etc."
12
13## 0. What happens today
14
15Facts from main c74fd0ac and a read-only copy of production
16(equipo.oficina.works, `carlos db query --app equipo --account oficina`,
172026-11-26 09:40 UTC).
18
19- **Publishing is one post-merge card.** `offerPublish`
20 (`internal/equipo/chat/publish.go`) raises a publish card after a merge
21 whose approved Review found `release/preview.json`. It returns silently
22 unless the creator's primary runner reports `Capabilities.Sites`. The
23 runner reports that only when its machine sets `EQUIPO_SITE_HOST=carloku`
24 and holds the person's own signed-in `~/.carlos/credentials`
25 (`internal/runner/thin/site.go`). Console and account are constants:
26 `https://console.carloku.com`, account `oficina`.
27- **Neary's never got a card.** The production runner (docs-t1) reports
28 `preview_host: devbox` and no sites capability. For both Neary's tasks
29 (`tkbstr6cjl7h`, `tkzmnycab3ml`, repo `amadan.net/paulca/nearys`) the task
30 is done and merged, `publish_asked` is empty and the project's `site_app`
31 is NULL: no card, no step, no audit row, nothing said.
32- **Nobody could explain it.** The coordinator has no tool that publishes a
33 site or reads its address; it said so, then had Engineering merge a filler
34 "page not found" change (without checks) only to provoke a publish card,
35 which again did not come. The Assistant looked in Base (`base_apps`),
36 which lists apps installed on Base's own account, found none, and told
37 Paul the site "never appeared there". Base is not where Equipo puts sites.
38- **Previews failed on the production runner.** Since the injection
39 defences (2026-11-19) every preview export carries a `_headers` file with
40 Content-Security-Policy, X-Content-Type-Options, Referrer-Policy and
41 X-DNS-Prefetch-Control. CARLOS accepts all four (merged 343a3394 on
42 2026-11-21, released since v0.43.0, rolled to the flagship), but the
43 production runner's PATH resolved `carlos` to a stale
44 `/usr/local/bin/carlos` v0.32.2, which refuses them "not supported yet".
45 The latest preview (`tkzmnycab3ml` step 4) ended done with reason
46 `preview_headers` and outcome unconfirmed, and its card still offered a
47 link. The earlier one failed `preview_scanner`. *Correction,
48 2026-11-26:* revision 3 blamed CARLOS; the coordinator set
49 `EQUIPO_CARLOS_PATH` to `~/.local/bin/carlos` v0.43.3 on that runner
50 (11:02Z). Equipo never said which carlos it ran, so slice 1 adds a
51 version guard (section 3).
52- **The devbox domain is never learnt.** The runner learns its devbox domain
53 from the first successful share's link (`preview_devbox.go`). No share has
54 succeeded, so the runner logs `domain=""` at start and Machines cannot show
55 an address.
56- **Setup is environment variables.** `EQUIPO_PREVIEW_HOST`,
57 `EQUIPO_SITE_HOST`, `EQUIPO_PREVIEW_CREDENTIAL_PATH` and a person's CLI
58 login on the runner machine. A person sets them by hand, per machine, and
59 nothing in Equipo shows them. That breaks the product rule that agents do
60 setup and people confirm.
61
62The CARLOS capabilities that cover this already exist: `carlos deploy`
63(static kind, `--temporary` with `--ttl`, named destinations in
64`.carlos/config` with `-d`), the `deploy` service role (one app, named rungs,
65read from `CARLOS_SERVICE_TOKEN` with `CARLOS_CONSOLE`), temporary static
66sites (live on dev and flagship since 2026-10-24, `tmp-` names, at most 20
67per account), and `carlos devbox share --dir` for tailnet links. Both
68consoles Paul uses are reachable from docs-t1: console.carloku.com (the
69flagship) and console.platform.tito.io (Tito). Equipo should use these and
70ask CARLOS for what is missing (section 6), not build around them.
71
72## 1. Places
73
74A **place** is a named destination the team has confirmed, of one kind,
75served by one fixed adapter. Places are team records in the instance
76database: the same for every member, never `scope.Owned`.
77
78| Kind | Names | Adapters in v1 |
79| --- | --- | --- |
80| Code home | a forge namespace where new projects go | Amadan (the existing `project_home` setting becomes this place) |
81| 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) |
82| 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) |
83
84Later kinds (object storage, mail senders, domains, native release
85channels) add an adapter each. An unknown kind or adapter is refused at the
86instance and the runner; there is no generic "run this command" place.
87
88**Defaults and overrides.** Each kind has at most one team default. A
89project may override any kind. A site is always per project: the team
90default names the console and account where new sites go, and the project
91binding names its app. Resolution is project override, else team default,
92else none, and none means propose (section 2). Code never guesses a place
93from a name match without a confirmation on record.
94
95**Storage.** Additive migration 0112 (0108 at draft; main took 0108-0111): `chat_places` (id, kind, adapter,
96label, console origin, account sqid and name, app, runner id for adapters
97that live on a machine, state proposed, confirmed or retired, revision,
98proposed by, confirmed by and when) and `chat_project_places` (project, kind,
99place, app, revision). `chat_projects.site_app` is copied into the project
100binding and left in place. Every write checks the current roster inside its
101transaction, is owner-only, and appends its audit event there.
102
103**Credentials, and who holds them.** The runner holds every CARLOS secret.
104The instance holds only metadata: credential name, role, app, rungs,
105console, account, the runner that holds it, a fingerprint (a hash, to tell
106rotations apart), minted and last used.
107
108- *Site.* One CARLOS `deploy` credential per site app, minted with `--app
109 <app> --rungs edge`. It reaches that app only, can ship and promote its
110 `edge` channel and nothing else, and cannot create apps, hostnames or
111 domains, or touch `stable`. On carlos/platform main (18d64564,
112 `internal/console/deployscope.go`) it may promote `edge` on an app with
113 the default edge-only pipeline, which every new app gets; if someone gives
114 the app another pipeline, the deploy is refused and `site_status` says so.
115 First-deploy setup is not open to it: creating the app needs a person or
116 an account-wide credential, and minting the first platform host needs a
117 person or a `publish` credential (`routedecls.go`, the platform-host
118 door). So a new site's first publish, at the owner's tap on its publish
119 card, runs the existing fixed `carlos deploy` with the owner's signed-in
120 carlos on that machine, which creates the app and its host as today, and
121 the existing guard still refuses a name the account already holds. Right
122 after it, the runner runs `carlos services create --role deploy --app
123 <app> --rungs edge <name>` with the same login. Every later publish
124 uses the deploy credential. (carlos v0.43.3 has no `--json` for this
125 verb; the runner reads its one `CARLOS_SERVICE_TOKEN=` line and its
126 `minted service:` line, P6.) The runner process reads the secret from that
127 command's output, never logs the output, and stores it 0600 in its
128 state directory, outside every directory a sandbox mounts. Each later
129 deploy runs one fixed `carlos deploy` with the secret in
130 `CARLOS_SERVICE_TOKEN` and the console in `CARLOS_CONSOLE`, never in argv,
131 a record, a log or a model's context, and with `CARLOS_CONFIG` naming a
132 runner-written config holding exactly the confirmed destination. The
133 owner's own login is used only for a new site's first publish, the mint,
134 and rotation or revocation (no service credential can revoke or rotate
135 any credential, itself included), each at an owner's tap, until P3
136 replaces it.
137- *Two ways a runner can publish a site.* A runner **can set up** a place
138 when its inventory shows an owner login on the place's console and
139 account; it **can publish** to a place when it holds that app's deploy
140 credential. Offering the publish card, accepting the tap and dispatching
141 the step each accept either: setup for a site with no app yet, publish
142 for one that has its credential. The runner reports both per place in its
143 hello, replacing today's single sites flag.
144- *Ownership evidence.* The app name is minted by code, and the first
145 publish's report records that this place created it. A later publish,
146 from any of the team's runners, may deploy to that app only with a deploy
147 credential minted for it, which an owner minted at a tap; the "name
148 already taken" guard applies only to the creating publish. Adopting an app
149 that Equipo did not create is out of scope for v1.
150- *A credential minted elsewhere* (by Base through `carlos platform
151 credentials mint`, or by the consent flow in section 6) arrives sealed to
152 the runner's seal key, as API keys do (connections spec §2.4).
153- *Devbox temporary site.* No credential: the runner's own `carlos devbox`
154 reaches its registrar over a local socket, as today.
155- *CARLOS temporary sites.* `/new-temporary` refuses an app-scoped
156 credential, so `--temporary` needs an account-wide `publish` credential,
157 which can also claim, ship, promote and retire every app in that account.
158 Until CARLOS offers a narrower scope (P4), a public temporary place may
159 only name an account the owner dedicates to previews, and the coordinator
160 proposes devbox first.
161
162A place with a credential belongs to the runner that holds it, which is the
163creator's primary today. If that runner is removed, the place shows "needs a
164machine" and the coordinator proposes setting it up again on another
165runner. Equipo then revokes the old credential with `carlos services
166revoke` through an owner's login, at their tap. A revocation that could not
167run stays on the Places page as "still live on CARLOS" until one does.
168
169**Seeing and changing places.** Settings gains **Places**, state first. One
170line per kind, then one line per project that overrides or has a site:
171
172> Sites go to Carloku, account paulca.
173> Neary's: site-nearys-k3x9qa, live at https://... (checked 10 minutes ago).
174> Temporary sites: docs-t1's devbox, on your tailnet.
175> New projects go in paulca.
176
177Each line offers Change, Undo (after a change) and Retire. Change opens a
178chooser listing only what the runner can see (section 2), one tap each, with
179the destination shown in full before it applies. There are no fields to type
180into. Proposals from the coordinator appear both as a card in chat and as a
181pending line here. Phones get the same single-column page.
182
183## 2. Setup by agents
184
185The coordinator proposes a place the first time one is needed: a merged
186website with no site place, a preview with no temporary place, a new project
187with no code home. It also proposes a starting set when it moves in.
188
189**What the runner can see.** The runner reports a bounded, validated reach
190inventory in its hello, with no secrets: the consoles its carlos is signed in
191to (the console origins in its credential file, read by the runner process
192for their names only, until CARLOS offers a secret-free list, P6), accounts
193it owns on each (`carlos accounts list --console <origin>`, owner rows only),
194apps in an account when asked (`carlos apps list`), whether a devbox
195answers (`carlos devbox list`), and the namespaces it may create repositories
196in (`create_in`, as today). A repository's committed `.carlos/config`
197destinations are hints only, read as untrusted repository text.
198
199**How a proposal is made.** Code ranks candidates from the inventory with
200fixed rules: the account whose name matches the project's namespace on the
201flagship (amadan.net/paulca/nearys proposes Carloku account paulca); else
202the account a repository `.carlos/config` destination names, when the runner
203owns it; else the person's only owned account. Existing apps are shown for
204information only; v1 always publishes to a fresh app Equipo creates. The coordinator calls
205`propose_place` with a kind, a project and one candidate id from the
206inventory; it cannot write a console, account or app itself. Equipo raises a
207card: "Publish Neary's on Carloku, in account paulca?" with the candidates
208(best first, at most six) and Not now. The owner's tap confirms. Code mints
209the app name, as `projectSite` does today. Confirming a place publishes
210nothing and creates nothing on CARLOS; the app and its credential come with
211the first publish the person taps (section 1).
212
213## 3. Coordinator tools
214
215All are runner MCP tools answered by the instance; every CARLOS command runs
216on the runner, from a fixed template, outside every sandbox.
217
218- `places` (read-only): the resolved places for the team or one project,
219 with state, address and last check, returned as quoted data.
220- `propose_place`: kind, optional project, candidate id. Raises the card in
221 section 2. It cannot confirm, change or retire a place.
222- `publish_site`: a task, or a project and a commit on its default branch,
223 and a target (`site` or `temporary_site`). It raises the publish card,
224 which now names the place ("Publish Neary's to site-nearys-k3x9qa on
225 Carloku, account paulca?"). Only the task creator's tap, while they are
226 an owner, places a publish step, as today. A site takes only a commit
227 Equipo merged into the default branch and Review approved; a temporary site takes an approved
228 candidate, as previews do. With no confirmed place it proposes one first.
229 It may raise a card for an older merged task that was never asked, which
230 is what Neary's needs.
231- `site_status`: a project's site: app, console, account, address (the URL
232 the deploy printed, confirmed by fetching the marker), the version its
233 `edge` channel serves (read with the deploy credential), its attached
234 domains once CARLOS lets that credential read them (P7), and the last
235 publish outcome and when.
236
237The publish step keeps what is built: export from git objects, the
238instance's digest-bound publish check right before the deploy, the marker
239fetched back over https, and published or unconfirmed recorded on the task.
240Two things change. The console, account, app and credential come from the
241confirmed place. And the trusted secret scan that previews run
242(`scanPreview`) now runs on the exact publish export before its built
243report; a finding or an unavailable scanner refuses the publish, which
244today's publish path does not. Published sites carry no Equipo `_headers`:
245the preview policy exists to fence unreviewed agent pages, and a published
246site's own headers are the project's.
247
248**Which carlos.** The runner records its carlos CLI's version at start and
249with each capability probe (`carlos version`, parsed to `vX.Y.Z`, never raw
250output). `status` reports it beside the scanner health. A preview or a
251publish refuses with the fixed reason `carlos_outdated`, before it builds
252anything, when the version is unreadable or older than v0.43.0, the first
253release whose deploy and devbox share accept the preview headers.
254
255## 4. What this replaces
256
257- `EQUIPO_SITE_HOST` and the `siteAccount`/`siteConsole` constants are
258 replaced by the site place. The runner's single sites flag becomes "can
259 set up" and "can publish", reported per place (section 1).
260- `EQUIPO_PREVIEW_HOST=devbox` becomes a devbox temporary place bound to that
261 runner, and `EQUIPO_PREVIEW_CREDENTIAL_PATH` becomes the credential of a
262 public temporary place.
263- `offerPublish` stops returning silently. With no site place it raises a
264 place proposal; with a place whose runner lacks the credential it says
265 what is missing; either way the task shows why nothing was offered.
266- A preview the host refused (`preview_headers`) shows "The preview host
267 needs a CARLOS update before previews open" and no link. An unconfirmed
268 preview never shows a link as if it works.
269- The devbox domain comes from `carlos devbox list` once CARLOS reports it
270 (P5), else from the first share, and Places says "address known after the
271 first preview" until then.
272- The Assistant asks Equipo for a site's address (a read-only operation
273 backed by `site_status`) instead of looking in Base.
274
275**Migration.** For one release the runner still reads the old variables, but
276only to report them as observed places. The instance turns them into
277proposed places, never confirmed ones, and the owner confirms once. The
278existing per-project `site_app` names are kept as each project's app. No
279Carloku app exists for Neary's, so it starts fresh.
280
281## 5. Security
282
283- **Scope.** One `deploy` credential per site: one app, its `edge`
284 channel, no app creation, hostnames, domains or `stable`. An
285 account-wide credential only for a public temporary place on a dedicated
286 account, until P4. The owner's own login is used only for a new site's
287 first publish, the mint, rotation and revocation, each at an owner's tap,
288 until P2 and P3 replace it. A runner with that login can do more than
289 this; Equipo's fixed templates are the limit, so the login stays outside
290 every sandbox and no template takes a model-written argument.
291- **Gates.** An owner's tap confirms or changes a place. A tap on the
292 publish card, per merged commit, publishes (unchanged). The existing
293 "Publish previews publicly" project setting still gates public temporary
294 places. A place for one project is never used for another.
295- **Model text never chooses a place.** Tools take inventory ids, and the
296 card shows console, account and app strings that code derived. A tap is
297 bound to the card id, revision, person and a hash of the exact place
298 record, so a stale or altered card is refused. Repository `.carlos/config`
299 is a quoted hint, never authority.
300- **The approval holds to the deploy.** The publish step stores the place
301 id, the place and project-binding revisions and the destination hash the
302 person tapped. The dispatch carries them, and the runner's final publish
303 check right before `carlos deploy` (today bound to app and digest) is also
304 bound to them. If the place or binding changed, or was retired, after the
305 tap, the check refuses and the person is asked again. The runner refuses a
306 dispatch whose console, account or app differs from what it holds the
307 credential for.
308- **Audit.** Place proposed, confirmed, changed and retired; app created;
309 credential minted, rotated and revoked (name and fingerprint only); and
310 the publish events that exist today. CARLOS audits each credential's use
311 on its side.
312- **Revocation.** Retiring a place revokes its credential through an
313 owner's login (section 1). CARLOS service credentials belong to the
314 account, not the person, so an owner leaving the team does not revoke
315 them; the Places view lists live credentials and the owner who minted
316 each, and an owner's removal raises a card offering rotation.
317
318## 6. Platform requests (CARLOS; nothing filed)
319
320- **P1, done.** Accept the four security headers in `_headers`
321 (Content-Security-Policy, X-Content-Type-Options, Referrer-Policy,
322 X-DNS-Prefetch-Control) in ship, deploy and devbox share. Merged as
323 343a3394 on 2026-11-21, released since v0.43.0, rolled to the flagship.
324 Equipo's part is to run a carlos at least that new (section 3).
325- **P2.** Let a new app's first deploy run without a person: a credential
326 that may create one named, brand-new app and mint its first platform host,
327 then deploy it as `deploy` does. Today the app create needs a person or an
328 account-wide credential, and the first host needs a person or `publish`.
329- **P3.** A service credential by consent: Equipo asks for `deploy` on one
330 app (with P2's first-deploy setup), an account owner approves in the
331 console, and the secret is delivered once to the requesting machine, as
332 `carlos auth login` codes travel. Revocation and rotation by the same
333 consent. This lets teams without an owner's CLI login on the runner set up
334 sites, and removes that login from Paul's runner.
335- **P4.** A temporary-sites scope: create, ship and delete only `tmp-` apps
336 in one account, within the existing caps, and nothing else.
337- **P5.** `carlos devbox list` reports the devbox's domain before the first
338 share, in a machine-readable form.
339- **P6.** A secret-free list of the consoles a carlos is signed in to, and
340 JSON from `carlos accounts list` and `carlos apps list`, so the runner's
341 inventory parses no human-readable output.
342- **P7.** Let a `deploy` credential read its own app's attached domains
343 (today `publish` and `instance` may, `deploy` may not), so `site_status`
344 can name a custom domain.
345
346## 7. Slices
347
3481. **Neary's goes live (M).** Migration 0112 and the place records; the
349 site kind with the Carloku adapter, console and account taken from the
350 place; `propose_place` and `publish_site` for sites; the approval bound
351 through dispatch and the final check; the secret scan on publish
352 exports; a new site's first publish with Paul's existing login on
353 docs-t1, then the app's deploy credential minted and used for later
354 publishes; "can set up" and "can publish" through offer, tap and
355 dispatch; `offerPublish` says why instead of returning silently; a
356 read-only Places page. Finish line: Paul confirms "Carloku, account
357 paulca" for Neary's, taps Publish on the merged commit c069eae7, and the
358 task shows a confirmed address. Nothing in slice 1 waits on CARLOS.
3592. **Temporary places (S; P1 already shipped).** Devbox and CARLOS temporary
360 sites as places; the honest preview card; the env variables become
361 observed proposals; the domain from the devbox list once P5 lands.
3623. **Places view and status (S).** Change, Undo and Retire with revocation;
363 `site_status` and `places` tools; the Assistant's read-only site
364 operation; code homes folded in from `project_home`.
3654. **Consent credentials (M, after P2 and P3).** First deploys without a
366 person and consent delivery for teams with no owner login on a runner; P4 for public
367 temporary sites when it lands.
368
369## 8. Open questions for Paul
370
3711. **Where does Neary's live?** Recommend Carloku, account paulca, matching
372 the forge namespace; oficina projects go to account oficina. Tito only
373 for projects that are Tito's.
3742. **May Equipo use your CLI login on docs-t1 for a new site's first
375 publish, to mint its deploy credential, and to revoke one, each at your
376 tap?** Recommend yes for slice 1, and retire that use when P2 and P3
377 land.
3783. **Adopting existing apps.** Recommend leaving it out of v1: every site
379 Equipo publishes is an app it created, so a confirmed place can never
380 overwrite a site someone else runs.
3814. **Temporary sites default.** Recommend docs-t1's devbox (tailnet) as the
382 team default and no public temporary place until P4, or a dedicated
383 previews account if you want public links sooner.
3845. **Ship P1 now?** Answered: P1 shipped in v0.43.0 (section 6).
3856. **Who may confirm places?** Recommend owners only, as with project
386 placement and merge policy; a creator still taps their own task's
387 publish card.
388
389## Paul's rulings (2026-11-26)
390
3911. Neary's lives on Carloku, account paulca. oficina projects default to account oficina; Tito's CARLOS platform only for Tito's own projects.
3922. For a new site's first publish, Equipo may use Paul's own CARLOS login on docs-t1 to create the app and its narrow deploy credential, each at his tap, until CARLOS supports P2/P3.
3933. Temporary sites default to the docs-t1 devbox, tailnet only. No public temporary sites until P4.
3944. The CARLOS security-headers fix (headers-security-allowlist, 77637a40) rides the next CARLOS release. *Superseded the same day:* it had already merged as 343a3394 and shipped in v0.43.0; the production runner ran a stale carlos (section 0).
3955. Adopting existing apps is out of v1; owners confirm places (recommendations accepted).
396