oficina / equipo Public
Places slice 1: Neary's goes live
Spec: docs/superpowers/specs/2026-11-26-places-config.md (rev 3, Paul's rulings, the 2026-11-26 carlos correction). Branch places-slice-1 from design-places 9bca9254 with main 7c113ac8 merged. Nothing here touches CARLOS, consoles, temporary sites or the Assistant.
Finish line: Paul, an owner, asks the coordinator to publish Neary's (amadan.net/paulca/nearys, main c069eae7, merged by task tkzmnycab3ml). publish_site raises a place card; he taps "Carloku, account paulca"; the publish card names the app and place; he taps Publish; docs-t1 deploys with his login, creates the app, mints its edge-only deploy credential, the marker answers, and the task shows the confirmed address.
Facts the plan rests on (carlos v0.43.3, read-only)
carlos accounts list --console <o>prints aNAME SQID ROLEtable.deploy,apps listandservices createtake--account-id <sqid>(sqid alphabetabcdefghjkmnpqrstuvwxyz, 3 to 16) and--console.- With
CARLOS_SERVICE_TOKENset, carlos uses only that token and the console from--console/CARLOS_CONSOLE; no credentials file is read. services createhas no--json: it printsminted service:<acct>/<name> (role deploy, app <app>, rungs edge)and oneCARLOS_SERVICE_TOKEN=<t>line. The runner parses both, never logs the output.- The credentials file is JSON
{credentials:[{console, expires_at, ...}]}; the runner decodes onlyconsoleandexpires_at.
Protocol 34 (wire.ProtocolPlaces; 31 at planning, main took 31 to 33)
Capabilities.Reach:Logins[{console, accounts [{name, sqid}]}] (owner rows only; at most 8 consoles, 20 accounts each) = "can set up";Keys[{console, sqid, app}] (deploy credentials held, at most 50) = "can publish".ToolHealth.Carlos(ok, outdated, missing) andToolHealth.CarlosVersion(vX.Y.Z). All validated, no secrets; dropped from hello below 31 (held and resent, as tool health is).PublishDispatchgainsConsole,Account(sqid),AccountName,Place,PlaceRevision,BindingRevision,Destination(wire.SiteDestination: sha256 of a versioned console/sqid/name/app line). Encode refuses every publish dispatch below 31: an older runner would deploy to the old constant account.LeaseCheck.Destinationon the publish check;PublishResult.CreatedandPublishResult.Key{name, fingerprint} on the done report. Dropped below 31.- Tools
places,propose_place,publish_site,site_status; Encode refuses their calls below 31 and the runner answers them locally (placesRefused, asstuckRefused). - Card kind
placewithCard.Place{kind, project, candidates [{id, console, consolelabel, account}]}; options are candidate ids plus `notnow`. Native sends unknown kinds to the web (unchanged).
Tasks (each tests first, mutation-checked, own commit)
- Wire. Protocol 31 constants and downgrades above; validation bounds;
SiteDestination; existing protocol assertions move to 31. Tests: round trips, refusals below 31, bounds. - Storage. Migration 0112:
chat_places(id, kind, adapter, console, accountsqid, accountname, state, revision, proposedby, proposedat, confirmedby, confirmedat, created/updated; unique live kind+adapter+ console+sqid) andchat_project_places(id, projectid, kind, placeid, app, revision, appcreatedat, keyname, keyfingerprint, keyrunner, keymintedby, keymintedat; unique project+kind); `chatcards.place. Models, schema, migration check. Team records, neverscope.Owned`. - Candidates and the place card (instance). Candidates come only from the creator's primary's stored
Reach.Logins: idpc_+ 12 hex of sha256(console, sqid). Fixed rank: flagship (https://console.carloku.com) account named like the repository namespace; else the only owned account; then the rest, flagship first, then by console and name; at most six. (.carlos/confighints wait for slice 3.) Console labels are code's (Carloku, Tito, else the host).propose_place(owner only; kindsite; project; candidate id fromplaces) raises the card to the caller with that candidate first; refused when the project already has a site binding or an open place card. The answer (card person, owner now, open, revision; choice one of the stored ids, its stored hash equal to a recomputed one, still in the primary's current logins) creates or reuses the confirmed place and binds the project with the app fromprojectSite(mint once, stored insite_apptoo). Nothing goes to CARLOS. Auditplace.proposed,place.confirmed,place.declined. If the card names a task still eligible, the publish card follows. - Publish through the place (instance).
primarySitesbecomessiteMode(person, binding): primary at 31 with carlos ok; "publish" whenReach.Keysholds console+sqid+app; "setup" whenReach.Loginshas an owner login on console+sqid; else a fixed missing reason.offerPublishno longer returns silently: no binding raises the place card (owner) or says why in the task's lane; no mode says what is missing, once per merged commit. The publish card question names app, console label and account; setup adds one line that this first publish creates the app and its deploy key with the owner's CARLOS login.answerPublishstores on the step place id, both revisions and the destination hash; the dispatch carries them.publishRefusalalso refuses when the place is not confirmed, a revision moved, the hash differs from the step's, or the check'sDestinationdiffers.acceptPublishDonerecordsCreatedand the key's name, fingerprint and runner on the binding, audited (no secret).publish_site(task, targetsiteonly): creator and owner, task done and merged, Review approved the merged candidate with a site config, nothing publishing and no open card; proposes a place first when none; else raises the publish card for an older merged task.placesandsite_status(read-only, quoted data): bindings, places, app, address and outcome of the newest publish, key holder, the primary's mode and carlos health, candidates when unbound.statusreportsrunner.tools.carlosand its version. - Runner reach and the carlos guard. One carlos lookup (
EQUIPO_CARLOS_PATH, else PATH, else~/.local/bin). The capability probe runscarlos version(5 s), then, when the credentials file passes the existing file checks, decodes console origins and runsaccounts list --console <o>per live console (20 s each, owner rows, validated), and lists its key files. Preview and publish refusecarlos_outdatedbefore building when the version is unreadable or below v0.43.0.EQUIPO_SITE_HOSTand the oficina/Carloku constants go;Sitesis never sent. - Runner publish. The dispatch's console, sqid, name and app must validate and hash to its
Destination. A held key for the app must match console and sqid (elsepublish_key_mismatch); its deploy runsdeploy --kind static --account-id <sqid> --console <o> --app <app> --channel edge ...withCARLOS_SERVICE_TOKENandCARLOS_CONSOLEin the environment andCARLOS_CREDENTIALSnaming an absent file. With no key, setup needs a current owner login there: the taken check (unless the runner's own record owns it), the same deploy with the login, thenservices create --role deploy --app <app> --rungs edge --account-id <sqid> --console <o> eq-<slug>-<4>once the deploy succeeded; the token goes 0600 to<state>/site/keys/<app>.json(dir 0700, outside sandbox mounts), its fingerprint is sha256's first 16 hex. A failed mint leaves the site published and reports no key. The trusted scan (scanPreview) runs on the export before the built report: findings refusepublish_secrets, an unavailable scannerpublish_scanner. The check sends the destination hash. Published exports carry no Equipo_headers; a project's own_headersstays and is scanned with the rest. - Coordinator surface. MCP tool schemas and descriptions, the Claude allowlist,
provider.ConverseTools,MutationKinds/WriteTools/madeCodesfor the two writers, the opening's website sentence (callpublish_site; only the person's tap publishes) andhouseRule. - Places page. Settings, read-only, state first: one line per bound project (app, place, address, checked when), pending proposals, else an empty line. Owners and members read it; nothing writes.
- End to end. A thintest contract: protocol 31 primary with a login on Carloku account paulca, a merged Neary's website task,
publish_site, place card, confirm, publish card, Publish, dispatch fields, check with destination, done with Created and Key, task shows the URL; then a second publish uses mode publish. Refusals: member tap, stale revision, place changed after the tap, wrong destination, runner at 30, carlos outdated, unbound offer says why. Runner tests with a fake carlos: argv and environment exactly, no token in logs or reports, key file mode, mismatch refusal, scan refusal.
Astra round 1 fixes (binding; they override the tasks above)
- The card is the snapshot. Raising a publish card stores on it (
chat_cards.place, publish snapshot JSON) the merged commit, place id and revision, binding id and revision, console, sqid, name, app, mode and destination hash. The tap recomputes all of it in its transaction and refuses (card conflict, card re-raised) when anything moved; the step copies the snapshot.publishBuilt,acceptPublishDoneandsettlePublishcarry the snapshot through (publishRecordembedswire.PublishResultplus the snapshot). Tests change place, binding and login before the tap and after it. - No weaker check, ever. Below 31 Encode refuses a
site_publishlease check outright (not dropped), andLink.ConfirmPublishrefuses locally below 31.authorizePublish,fencePublishes,previewHeld's publish side and everyProtocolPublishgate on the publish path move toProtocolPlaces. A queued publish on a runner that reconnects below 31 is fenced. Tests: reconnect at 30 with a queued step, an instance at 30 (the runner's check refused locally). - The owner's login only creates or mints. Modes:
setuponly while the binding has noapp_created_at(the app was never created by a publish);publishonly with a held deploy key for exactly that console, sqid and app;mint(new) when the app was created but no key is held: the runner uses the owner login only forservices create, then deploys with the new key. A created app is never deployed with the login again. The runner's site record becomes destination-bound (<state>/site/<console>/<sqid>/<app>.json): the taken check is skipped only for an app this runner created at that exact destination. - Mint durability. Before
services createthe runner records a mint intent (name, destination) in the step's phasesite_minting; the secret is written to a temp file 0600 and renamed into place; only then is the key reported. A lost response, a crash before persistence or a refusal reportsPublishResult.MintLost(the name) and no key; the instance recordsdeploy_loston the binding and the Places page says a deploy key of that name may be live on CARLOS without Equipo holding it. Restart insite_mintingnever runs the mint again: it reports the stored key if the file exists, elseMintLost. A new mint needs a new tap (modemint, new name). - Capability is rechecked at dispatch and at the final check. The dispatch builder calls
siteModeand fails the step (publish_not_ready) when the primary, its protocol, carlos health or the mode's capability changed;publishRefusaldoes the same right before the deploy. The runner runs the taken check before the final check, then nothing slow between the check and the deploy. - Migration copies
site_app. 0112 inserts onechat_project_placesrow (kind site, place '' , app =site_app, revision 1, noapp_created_at) for every project with asite_app; an unplaced binding confirms nothing and grants nothing. Confirming a place fills itsplace_idand bumps its revision. Test: rows before 0112 (no app, an app) migrate as described. - Strict list parser. The site path's taken check parses
apps listoutput strictly: ausing ...line, then eitherno apps in this accountor app lines (with or without theAPP STATEheader, with or without the region column); anything else, a non-zero exit or a clipped output counts as taken. Fixtures for each. - Project headers. As corrected in task 6.
site_statuscontract (narrow). It reports what Equipo recorded: the binding, place, app, the newest publish's outcome, address and when, the key's holder and fingerprint (or that it is missing or lost), and the primary's mode. It does not read the live edge version or domains (slice 3, P7), and says so in its description.
Astra round 2 fixes (binding; they override everything above)
- Each use of the login is authorised right before it runs. The tap fixes the mode (
setup,mintorpublish) and, for setup and mint, the key's name (eq-<slug>-<4 random>, minted by code at the tap); both are in the card snapshot, the step and the dispatch (PublishDispatch.Mode,DeployName). The runner never changes mode: a publish whose key is gone failspublish_key_missing. Two final checks, both destination-bound and refused below 31:site_publishright before every deploy, andsite_mint(new purpose) right beforeservices create. Each rechecks the creator is an owner, the primary, the place and binding revisions and the mode. The card says what the tap does: setup creates the app and a deploy key with the owner's login; mint creates a deploy key with it. - Creation is recorded by the authority, pessimistically. The instance sets the binding's
app_created_atwhen it allows a setup step'ssite_publishcheck: from then on the app may exist, so setup is never offered again, whatever any report says. With no key held the mode ismint. In mint mode the runner first lists the account (read-only, strict parser); if the app is definitely absent it failspublish_app_missingwithout minting, and only that reason clearsapp_created_at(the next card is a setup card again, a new tap). If the app is listed, it mints, then deploys with the new key. - The recovery route. When a setup or mint publish ends with no key held (seen in the primary's reach),
publishEndedraises a mint-mode publish card for the same merged commit.publishing()lets exactly that through: a mint-mode card is allowed after a done publish of the commit while the binding has no held key.publish_sitecan raise it too. A mint publish redeploys the same export with the new key, which is how the key is shown to work. Tested end to end: setup, mint lost, mint card, tap, key held, then a plain publish. - Key evidence lives in the runner's hello, not in reports.
PublishResultgains nothing.ReachDeploycarries the key's name and fingerprint andLost(a mint whose answer was lost or unreadable, or a crash between asking and storing: the runner records the intent in its state before asking and keeps it until it holds the key). Every hello repeats them, so an instance rollback loses nothing. The binding stores the name, the runner, who minted it and when, set at the allowedsite_mintcheck; fingerprint, held and lost are read from the primary's current reach. Restart insite_mintingnever asks again: it reports the stored key, or the name as lost. - Migrated bindings. A binding with no place (from
site_app) accepts a place proposal; confirming fillsplace_id, keeps the app, bumps the revision and leavesapp_created_atempty, so its first publish is a setup at the new destination, behind the strict taken check. Runner site records are destination-bound; a legacy app-only record grants nothing, so an app published by the old oficina path is "taken" if that account is chosen (adoption is out of v1). Fixtures: no app, minted-unpublished app, previously published app.
Astra round 3 fixes (made in the build; round limit reached)
- Attempted is not created.
app_created_at(withapp_created_step) means "creation was attempted": setup is never offered again, and nothing is adopted. A mint needs destination-bound evidence that this runner created the app: its own site record at<state>/site/<console>/<sqid>/<app>.json, written only after its setup deploy command succeeded. A listing proves existence only. No record and the app listed:publish_app_unproven, nothing minted or deployed. App definitely absent:publish_app_missing, which alone clears the attempt (the next card is setup, a new tap). Tests: setup authorised then a crash before deploy; another actor creates the app; the mint refuses. - Checks are per phase of the approved attempt. The step's mode never changes; each check asks what that phase needs. Setup: start and
site_publishneed no attempt recorded and the login (the allowedsite_publishrecords the attempt with this step's id);site_mintneeds the attempt to be this step's and the login. Mint: start andsite_mintneed an attempt, no held key and the login (the allowedsite_mintrecordsdeploy_step= this step);site_publishneedsdeploy_stepto be this step, whatever the reach says by then. Publish: every check needs the held key. Each check also rechecks the creator is an owner, the primary at 31 with carlos ok, the place and binding at their snapped revisions and the destination hash. Tests include a hello arriving between mint and deploy.
Build notes (deviations, all deliberate)
- The deploy names the place with explicit flags (
--account-id,--console) andCARLOS_CONFIGnames an empty config of the runner's own, as today, rather than a config holding the destination: no file a repository or person wrote is read either way. - The runner writes its destination-bound creation record right after the setup's final check and before its deploy (the name having just been found free), so a deploy that failed half way can still get its key by a mint. The window is the accepted list and deploy race.
- Repository
.carlos/confighints, team defaults and Change, Undo and Retire wait for slice 3; candidates rank by namespace and the only owned account only.publish_sitetakes a task (not a project and commit). EQUIPO_SITE_HOSTand theSiteshello flag are gone: a runner at 31 reports reach instead, and a publish needs 31. The site host now probes whenever carlos and a state directory exist; without a valid login it still publishes with held keys and sets up none.- Approved copy that says Carloku (
chat.publish_unconfirmed,chat.publish_taken,work.reason.publish_failed) is unchanged; it reads right for Neary's and every Carloku place. - Native clients show place cards on the web (they route unknown kinds there already); no Swift change.
Astra branch review
Round 1 NOT READY (1 blocker, 4 major), fixed in 6a71f098. Round 2 NOT READY (4 major), fixed in 8fa19e4a. Round 3 NOT READY (1 major: an interrupted recovery whose key was stored could never be asked again); the round limit reached, it is fixed after the review (a publish is blocked only by one that went live) with its contract test, and not re-reviewed.
Copy
New strings (card question and setup line, place card, offer reasons, activity lines, task reasons carlos_outdated, publish_secrets, publish_scanner, publish_key_mismatch, Places page) go to /home/paulca/.cache/places-1-copy.json as copy-review entries and into copy.go marked pending with scripts/copy-status.py pending. The pending-copy gate stays red until Paul reviews them.
Verification and handoff
Targeted go test -run per package while building; then make ci once. Mutation checks recorded in each commit body. Astra reviews this plan and the whole branch (max three rounds each). Push places-slice-1; no merge, release or deploy.
After release (Paul)
Upgrade production, then in Equipo: "Publish Neary's". Tap "Carloku, account paulca", then Publish. The task shows the address.