oficina / home Public

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

Plain git — no account needed to clone.

Download

Download this file

1# πŸ€– The Oficina home
2
3The suite's glue: identity, directory, provisioning, person preferences.
4Consumed by `oficina/sheets` and `oficina/docs`. **It is not an application
5and holds no documents.**
6
7This file is binding. Where it disagrees with a general skill, this file
8wins. Where it disagrees with the design spec, the spec wins and this file
9is wrong β€” fix it in the same commit.
10
11**The design:** `docs/superpowers/specs/2026-08-30-home-design.md`. Β§1 is
12the settled-decisions table: dated, attributed, with the rejected
13alternative beside each.
14
15---
16
17## The one rule
18
19> **The home is glue: thin, blind, replaceable. It knows that you exist and
20> where your teams are. It never stores a readable address, and it never
21> retains what is in anything.**
22
23**"Retains", amended from "learns" on 2026-09-05** β€” spec ruling 18 and
24`design-activity-pull`, approved that day. The falsifiable form is unchanged **by that amendment** β€” ruling 23 later changed it, and the form above is the current one.
25**It means holds without a bound**: the home does see titles and does keep
26them in RAM across requests, bounded by a TTL and a hard maximum; at rest is
27the unbounded case, and that is what it never does. "Blind" above is Factor
28XI's category label, not a claim it never sees one. Spec Β§0 carries the full
29gloss.
30
31The falsifiable form: **publish this database in full and the worst anyone
32learns is how many people exist, what their teams are called, which person
33refs belong to which team, and which of them own it.** No document. No cell.
34No readable address.
35
36**"And which of them own it" arrived with ruling 23** and is the whole cost
37of the membership roster: an owner row names a person ref from one team plus
38a fact that is usually public, where the old wording needed several teams
39and an outside fact. Spec Β§0 and Β§3.3 carry the full reasoning.
40
41**Ruling 26 (Paul, 2026-11-19, smart-door spec) is the one place a
42readable address may leave Home, and it never comes to rest here:**
43
44> Home may seal **the address this browser last proved** (an opened link, a
45> Keymail callback) into a cookie on **that person's own device**, and render
46> it back **only to the browser that presents it**, on a `no-store` page. It
47> is never written at rest by Home: not to the database, a log, an error, a
48> metric or a queue. It is not evidence of identity, and the page that shows
49> it consults no store.
50
51The falsifiable form above is unchanged by it. Under option (a) it also
52amends Β§4 and gate 5 (Identity, below) for exactly that one string: the
53door on id.* may render the address Home sealed itself (lastsignin's
54cookie, keyed from `HOME_DEK` under `home/lastsignin/v1`), shape-checked
55on read, escaped, as text and as a form field's `value`, and nothing else. It is
56not a licence to render a typed address, a query, a cookie Home did not
57seal, or any team, label or member name. A passkey sign-in keeps the
58remembered address only if its blind index resolves to the same person
59ref; otherwise it is blanked. Gates 1, 2, 5 and 9 are driven with a
60validly sealed canary cookie (`door_gates_test.go`). Only `door.go` holds
61the jar: every write goes through its narrow functions, and
62`internal/guardstest` refuses a `.jar` or a `lastsignin` name in any other
63production file. The pre-ship check that the carlos edge logs neither
64Cookie headers nor response bodies was done for this step (recorded on
65discussion #138); repeat it if the edge's logging changes.
66
67*Two absolutes were argued and lost, and stay lost:* **"never stores your
68address"** β€” a magic link's address is at rest between send and click,
69sealed (Β§3.2), not absent β€” and **"some unidentified person"**: a team-set
70fingerprint plus one outside fact names the row (Β§3.3).
71
72Three gates enforce it (Β§12; Β§13 step 1 lists all three): a **plaintext
73grep** over the raw SQLite file and WAL **plus this app's store objects**,
74against a seeded corpus of known addresses; a **no-address-at-rest** test
75asserting the schema has no address column and that a full sign-in plus
76directory upsert **plus rekey plus the roster seed verb** leaves no readable
77address anywhere, **WAL
78included**; and **no-content-in-logs** (gate 9). **Gate 9 needs no database** β€” it scans strings, and `cmd/home/main.go`
79emits log lines β€” **so it was never sequenced behind one**, and it landed
80beside the skeleton. Gates 1 and 2 do need one, and it now exists: gate 1
81scans the raw file, WAL and SHM for canaries, and gate 2 runs in two
82halves, a static read of every migration and a full sign-in asserted to
83leave no readable address anywhere. Gate 2's expensive half must be
84**extended, not replaced**, when the directory upsert, the rekey and the
85roster seed verb land β€” it asserts the sign-in third of its sentence
86today. A guard written after the code it guards is a guard written to
87pass. (Stated as the rule rather than as a status: which gates exist today
88is a question for `git log`, and a status line in a binding file is a
89sentence that goes stale without anyone noticing.)
90
91---
92
93## The four things this service never does
94
95Each of these is something somebody will propose, in good faith, as an
96improvement.
97
981. **Never *store* content from an instance.** No previews at rest, no sheet
99 thumbnails, no cell values, no titles in a database, a log, an error
100 string, a metric label or an on-disk cache. It **may render**, transiently
101 and per request, **and only to that person**, what an instance hands it
102 for the person it hands it for β€” and nothing wider: no search over pulled
103 content, no cross-person aggregation, no analytics, no operator view, and
104 no retry queue holding a response body.
105
106 **"Per request" does not forbid the cache the spec approves.**
107 `design-activity-pull`'s Β§7 keeps pulled titles in RAM across requests,
108 bounded by a refresh TTL and a hard maximum. Read alone, "transiently and
109 per request" would rule that out, so read it with spec Β§0's gloss:
110 **retains means holds without a bound**, at rest is the unbounded case,
111 and the RAM hold is permitted because it is bounded and tested.
112
113 **Amended 2026-09-05** from *never render*, on spec ruling 18. "Renders"
114 was doing custody's work: the clause exists to stop the home becoming a
115 place documents live, and storage is what makes it that. It also gained a
116 test β€” spec Β§12's gates 1 and 9 grew a corpus of known titles, URLs and
117 actor strings that day, so *never stores* has a grep behind it where
118 *never renders* had none.
1192. **Never hold a per-item grant.** Which sheets you may edit, which
120 document a guest may comment on: all instance-side, decided there on
121 every request. **The home does hold the membership roster** β€”
122 `(team, person_ref, role)`, ruling 23 β€” so it knows who is on a team and
123 who owns it. It never knows what they may do with any particular thing.
124 This replaced *"never hold an authorization model"* on 2026-09-05; the
125 line moved from *facts versus may-this-person* to **resources the home
126 owns versus an instance's items**, because the roster is a person-level
127 entitlement the home now holds on purpose.
1283. **Never cross a team.** Data does not cross a team label; a team's
129 instances across apps are one trust domain (spec ruling 23, suite ruling
130 1). This replaced *"never federate β€” data does not cross an instance
131 boundary"* on 2026-09-05: the boundary was drawn in the wrong place, since
132 `acme.docs` and `acme.sheets` are the same team and always were. **Sharing across teams** is a guest grant on the
133 instance, never a copy. **Team standing is the roster**, not a grant and
134 not a directory row (spec Β§5.5, Β§6: a directory row never grants team
135 standing whatever its `kind` says). Β§6 keeps the
136 two apart deliberately: "a row implying an org membership someone does
137 not have is a lie the directory tells on the org's behalf".
1384. **Never become a support console.** Reading someone's data to help them
139 is precisely what **rule 1 above** forbids β€” "only to that person", "no
140 operator view". It used to be the one rule; since the 2026-09-05
141 amendment "never retains" no longer reaches a console that displays
142 without keeping, so the anchor moved and a reference left pointing at
143 the one rule would rest on nothing.
144
145**And it stays small.** Every proposed feature is weighed against "does this
146belong in an instance instead?" The answer is usually yes. This service has
147a suite-wide blast radius, and a home that grows features grows that radius.
148
149---
150
151## Review β€” RULED 2026-08-30 by Paul
152
153**Every spec and every branch is reviewed by the highest-capability model
154available before it is approved or merged.** Cheaper models draft; the most
155capable available reviews. A review by a weaker model than the author is not
156a review.
157
158**Record which model reviewed** β€” in the spec's status line, and in the
159branch discussion for a branch. A review nobody can attribute is a review
160nobody can check. The model is **discovered, not hardcoded**; a session that
161cannot reach one at least as capable as the author's says so and waits.
162
163---
164
165## Shipping cadence β€” RULED 2026-08-30 by Paul
166
167Everything on a worktree, on a branch. Never directly on `main`.
168
1691. Branch per piece of work, cut from `main`.
1702. Commit regularly and push to the branch.
1713. **Squash-merge to `main` only when** the work is done, it is approved
172 (including the review pass above), and **CI is actually green** β€”
173 checked, not assumed. Any one of the three missing means it does not
174 merge.
175
176Review on a deployed canary, never localhost.
177
178**Every branch gets a discussion, and that discussion is the review
179record** β€” it survives a squash where a PR body does not. Tasks are a
180checklist, not a log. **A refusal gets surfaced in the discussion, never
181routed around** (amadan's own house rule, and the one most likely to be
182quietly ignored).
183
184---
185
186## Mechanical rules
187
188**Identity**
189- The **credential origin** serves sign-in, WebAuthn, recovery and assertion
190 minting, and **never renders an account-authored string** but one: ruling
191 26's carve-out (above, under option (a)), the address Home sealed into
192 this browser's own cookie, on the door only. It is the relying party.
193 This is a permanent constraint with its own test (gate 5, amended for
194 the carve-out and still refusing every other string), not a naming
195 choice.
196- **The RP ID is the full host β€” `id.oficina.works` β€” asserted by a test.**
197 Never widen it to a registrable suffix. WebAuthn *permits* an RP ID that
198 is a suffix of the origin's hostname, so `oficina.works` would be
199 accepted; it is also valid at every host in the zone, the directory and
200 every team instance included, which collapses the very split the two
201 origins exist to make (Β§4, rulings 2 and 13; the host itself is ruling
202 16). Note where the first door actually is: `passkey.Config` has no RP ID
203 field β€” the RP ID is always `Origin`'s hostname β€” so the way to widen it
204 is to widen `Origin`, or to bypass `passkey` and build a
205 `webauthn.Config` directly. The second door is
206 `passkey.Config.LegacyRPID`, passed straight through as an RP ID accepted
207 **for assertions only** (registration never takes it), so it must stay
208 empty unless a rename drill (Β§5.7) is actually running, and then hold a
209 full host. The test asserts both: `Origin`'s hostname is exactly
210 `id.oficina.works`, and `LegacyRPID` is empty or a full host. Both are
211 accepted silently, which is why neither can rest on care.
212- Assertions carry **identity and display preferences, never
213 authorization**. The boundary test (Β§5.4) is **two-sided**: a claim may
214 ride the assertion only if **(a)** the instance makes no trust decision
215 based on it, validating against a **closed enumerated set** and treating a
216 failed match as *absent* rather than as the raw value; **and (b)** the
217 home already holds it for its own purposes, so carrying it adds nothing to
218 what the home knows. Theme passes both. A role fails (a). **"Which
219 documents you can see" passes (a) and fails (b)** β€” it hands the home a
220 document-level graph it has no business holding.
221- **Do not restore "the instance would behave identically given a hostile
222 value."** Β§5.4 retracts it: a hostile theme gives an ugly page, which *is*
223 different behaviour, so the test's own example fails it β€” and without (a)'s
224 closed set, a free-string theme in CSS is an injection, not an ugly page.
225- Assertion expiry is **120 seconds, not "seconds"** β€” sized to worst-case
226 cold wake plus clock skew, because the exchange request *is* what wakes a
227 hibernating instance and a tighter window makes the first sign-in to any
228 cold instance fail and loop. Widening it costs nothing **against the
229 threat model**, because **single-use `jti` is what stops replay**, not
230 brevity. The long-lived thing is the session the instance mints.
231- Every assertion names the **app and instance host** it is for. Without
232 audience binding, team A's assertion replays against team B, and a
233 deployment has thousands of siblings to replay against.
234- **Signed identity claims are trusted for identity; every other claim must
235 be cosmetically failable.** The subject flagrantly fails (a) β€” a hostile
236 subject is account takeover β€” so the test must exempt identity by
237 construction or it proves too much and gets argued around.
238
239 **One narrow exception, added 2026-09-05 with ruling 23: `roster_epoch`.**
240 It is not a closed enumerated set and does not fail cosmetically, so it
241 would fail test (a) as written. What admits it is that **the instance
242 decides nothing from it** β€” an unparseable value is ignored, a differing
243 value buys exactly one call-8 refetch, and call 8's answer is what is
244 enforced. A builder following the test without this exception rejects a
245 claim Β§5.3 now puts on every assertion. Spec Β§5.4 carries the reasoning.
246- **Any "prune when all consumers have caught up" is unbounded in a
247 hibernating fleet.** A dormant instance runs no timers to advance its
248 cursor. Retention is a fixed horizon or a per-consumer TTL, never a
249 slowest-consumer rule. This shipped twice in one spec before it was
250 caught.
251
252**Data**
253- **No address column exists**, so there is none to accidentally populate.
254 Addresses are learned transiently and hashed β€” and where one must survive
255 a restart (a magic link between send and click), it is **sealed before it
256 is written**, never cleaned up afterwards. Deleting a row does not erase
257 bytes: SQLite leaves deleted pages and Litestream ships WAL frames
258 continuously, so a transiently readable write reaches the bucket before
259 any delete. `PRAGMA secure_delete` is on.
260- **The session Subject is an opaque person ref, never an address.**
261 **Corrected 2026-11-13, verified at pin `29e4491`:**
262 `rastrillo/auth.Config.SubjectFor` exists and can map a verified address
263 to an opaque subject before session minting. Without that hook, auth
264 defaults to the address in `sessions.subject`; `auth_sessions` stopped
265 being written at v0.22.0 when rows moved to the shared sessions table.
266 The hook does **not** fix link storage: `auth.New` still installs
267 `Links: &linkStore{db: cfg.DB}`, which writes readable
268 `auth_links.address`. The older claim that no subject-remapping hook
269 exists is stale; the sealed-link-store requirement from upstream
270 `rastrillo/rastrillo` #2 remains. Home keeps its sealed link store and
271 opaque-subject session minting until both guarantees can be supplied
272 upstream. **Re-checked at v0.38.0:** `auth.New` still defaults to
273 `&linkStore{db: cfg.DB}` and `auth.Schema` still has an `address`
274 column (its migrations are unchanged from v0.37.0); v0.36.0 added `auth.Config.BlindLinks`, an app-supplied link
275 store holding no address, aimed at #2. Home has not adopted it β€”
276 switching is its own reviewed change, not a pin bump. Take classification and the Keymail upgrade from
277 **`keymaildev/signin` directly, not from `auth`** β€” corrected 2026-09-05: `auth`'s
278 classification is reachable only through `auth.Begin`, which hardwires
279 `Links: &linkStore{db: cfg.DB}` and writes `auth_links.address`, so "use
280 `auth` only for the parts that hold nothing" was never a thing that could
281 be done. `signin.Flow` takes a `LinkStore` the app supplies, so the app
282 seals what it stores.
283- **The home hashes; instances never hold the pepper.** A pepper on every
284 instance makes one compromise an offline dictionary attack against the
285 whole suite directory.
286- Migrations are additive-only.
287- **No address, team name, queue payload, or pulled content β€” a title, a
288 URL, an actor (added 2026-09-05 with Β§2.2's amendment) β€” in any log line, error string,
289 job status message or metric label.** Platform-held logs are storage we
290 cannot grep.
291
292**Frontend**
293- **Write the attribute spelling: `rst-btn`, not `class="rst-btn"`** β€”
294 spec ruling 20, 2026-09-05. Β§11 ruled the class vocabulary on 2026-08-30
295 and every reason it gave has since died, so it went back to Paul rather
296 than being propped up with a third. rastrillo's design system rules "One
297 spelling, not two. No permanent class fallback" and drops the class
298 selectors before 1.0; this app has no `rst-` markup yet, so it starts on
299 the spelling that survives β€” free today, a sweep after the first
300 template.
301
302 **The seven utilities are the exception, and they are not a loophole.**
303 `rst-sr-only`, `rst-mono`, `rst-m-hide`, `rst-grow`, `rst-nm`,
304 `rst-danger` and `rst-cell-mut` keep `class=`, because at v0.22.0 they
305 have **no attribute twin at all** β€” five `.rst-sr-only` selectors, zero
306 `[rst-sr-only]`. tokens.css's header says why ("Utilities keep the class
307 spelling and are not paired… they stay class after the move") and Β§6-v3
308 agrees ("`class` is for utilities and the app's own CSS"). Write
309 `<span rst-sr-only>` and nothing matches, so screen-reader-only text
310 renders **visible**. Kinds, variants and parts are attributes; these
311 seven are classes. This is also what the 6 surviving `class=` occurrences
312 in v0.22.0's partials are β€” utilities, not residue awaiting a flip.
313
314 Record the graveyard, so neither dead reason is revived:
315 - *"The attribute grammar is ruled but not released."* Dead since
316 **v0.21.0**, this repo's *first* pin. tokens.css there pairs every
317 *component* rule with an attribute twin and says so in its own header: "TWO
318 SPELLINGS, ON PURPOSE, FOR ONE RELEASE." The original claim β€” zero bare
319 `rst-*` selectors against ~528 class occurrences β€” was verified on
320 2026-08-30 against v0.20.x, was true then, and was already false by the
321 time the skeleton existed. No later bump falsified it.
322 - *"The partials we render alongside write classes."* Dead at
323 **v0.22.0**, the current pin, where the shipped partials flipped to the
324 attribute spelling β€” rastrillo's design-system Β§6-v3 stage 2. Counted
325 in `ui/partials/` with template comments stripped, the class spelling
326 falls from **124 occurrences at v0.21.0 to 6 at v0.22.0**, replaced by
327 the attribute spelling. (Count the class spelling, not the attribute
328 one: `class="rst-…"` is unambiguous, while attribute-spelling totals
329 move with how you treat valued attributes like `rst-tone="…"`, and two
330 careful counts of it disagreed.) `callout.html` at the pin
331 is `<div rst-callout rst-tone="…">`. tokens.css's header still claims
332 "the class spelling is what every app and every shipped partial writes
333 today" β€” **that sentence is stale upstream**, and this file quoted it
334 as evidence until it was checked.
335 **Re-check on every pin move, name the version you checked, and count
336 both `ui/tokens.css` and `ui/partials/`** β€” checking one and not the
337 other is how the second reason survived a pass that was looking for
338 exactly this.
339- **rastrillo is `amadan.net/rastrillo/rastrillo`** (moved 2026-10-01),
340 pinned at **v0.38.0** in every module here β€” the root, `connect`,
341 `handoff`, `roster`, `dashboard` and `teammode` (2026-11-20, from
342 v0.26.1 and its 29e4491 pseudo-version by way of v0.37.0; smart-door
343 spec step 3). v0.37.0 needed `go 1.26.0`, so every module's `go` line
344 moved with it; v0.38.0 needs the same. `connect` imports no
345 `lastsignin` (check with `go list -deps ./...` in `connect/`). The old path,
346 `github.com/carlosframework/rastrillo`, stops at v0.23.0: code importing
347 it gets no fix, and its own checks cannot tell β€” Home's sign-in field
348 zoomed iOS on every tap for a month that way (`TestNoZoomOnTap`,
349 `make test-browser`). `internal/guardstest`'s `TestNoPreMoveRastrillo`
350 forbids it in every module here; it stays in go.mod only as estilo's
351 indirect requirement. **Re-checked at v0.38.0** (tokens.css is
352 Fiesta 1.5.0's; Fiesta since v0.34.0): `ui/partials/` has 13
353 `class="rst-…"` occurrences, every one a utility from the seven
354 (`rst-m-hide`, `rst-nm`, `rst-danger`, `rst-sr-only`, `rst-mono`);
355 tokens.css still pairs the spellings (about 1,950 class selectors to
356 1,900 attribute ones, comments stripped) and still says "TWO
357 SPELLINGS"; and none of the seven has an attribute twin. Nothing in the class-versus-attribute reasoning above
358 moved. The CLI is a go.mod
359 `tool`: run it as `go tool rastrillo …`, never a `rastrillo` from PATH.
360 `make release` stamps `amadan.net/rastrillo/rastrillo.BuildVersion`; the
361 old symbol would leave `/api/version` answering "dev".
362- **`rastrillo doctor`.** `internal/home/static/tokens.css` is vendored,
363 and `TestVendoredAssetsMatchTheLibrary` (noscript_test.go) is the
364 standing gate: run `go tool rastrillo doctor --fix` on every rastrillo
365 upgrade rather than re-copying by hand. Since v0.34.0 doctor reads a
366 tokens.css that differs from the library as a deliberate edit (this
367 repo's test keeps no `vendoredIsMine` list) and leaves it alone, so
368 run `go tool rastrillo doctor --fix --force` and check the gate.
369 **Then delete everything else it adds**: at v0.37.0 and v0.38.0 that is
370 `shell.css` and twelve scripts (`rastrillo.js`, `fiesta.js`,
371 `live.js`, `busy.js`, `light.js`, `anchor.js`, `shell.js`,
372 `transition.js`, `copy.js`, `select.js`, `datetime.js`,
373 `calendar.js`). Home serves none of them β€” its `/static/busy.js` is
374 estilo's β€” and rastrillo's shim still carries the old busy rule,
375 which fights estilo's `busy.js` over every submit.
376 `TestNoRastrilloShimBesideBusy` takes its list from
377 `ui.VendoredAssets`, so it fails if any is left on disk or served.
378 Doctor's "Templates" section (the `$L` rewrite) is about rastrillo's
379 partials, which Home does not render; leave it.
380- **What v0.37.0 changed under Home** (each held by a test): passkey's
381 recovery codes and Gate moved to `rastrillo/secondfactor` at v0.27.1,
382 which Home does not wire β€” Home mints, counts and redeems its codes
383 itself on the `passkey_recovery_codes` table `passkey.Schema` still
384 creates, and `secondfactor.Schema` must never be merged (it copies
385 those codes out and drops the table). `webauthn.Config.Register`
386 stopped requiring user verification, so Home refuses an attestation
387 without it, on registration (`TestIDRegistrationRefusesWithoutUserVerification`)
388 and on replacement (`TestIDReplacementProofBinding/bad-uv`). `passkey.Schema` gained
389 `0002_credential_details` (ALTERs `passkey_credentials`); BootSchema
390 is frozen in the admission and compatibility profiles, so it takes
391 `passkey/0001_init` alone (`passkeyFrozen`, models.go), and the
392 Linux-only profile tests are what catch a slip. `rastrillo.Serve` refuses to
393 start without the `en` language pack (`internal/home/locales.go`).
394 rastrillo's default CSP allows no inline style since v0.27.0, so
395 Home's policy matches it and the hop pages link `handoff.css` (and
396 `handoff-noscript.css` inside `<noscript>`) instead of `<style>`
397 blocks. `db.Open` defaults to `synchronous(NORMAL)` since v0.34.0;
398 `cmd/home` opens through `home.OpenDatabase`, which passes
399 `db.DurableCommits()` to keep `FULL` (`TestOpenDatabaseCommitsDurably`
400 reads `PRAGMA synchronous` = 2).
401- **What v0.38.0 changed under Home.** `auth`'s and `lastsignin`'s
402 structs and one-way door are the release's API changes. Since
403 smart-door step 5 the door (`internal/home/door.go`, with `signin.go`)
404 fills an `auth.SigninState` itself and renders rastrillo's `signin`
405 partial in estilo's `estilo-signin-screen`, and remembers the way in
406 with `lastsignin.New`'s jar; nothing else in Home imports either.
407 `passkey` (for its Schema, Config and the door's module, `passkey.JS()`)
408 links `lastsignin` and `secondfactor` itself. Home builds none of
409 passkey's or auth's handlers (its ceremonies and sign-in are its own;
410 `passkeyCfg` is kept only as the record the RP-ID guard reads), and
411 `internal/guardstest`'s `TestHomeNeverMountsFrameworkSignin` fails on
412 a direct import of `secondfactor`; an import of `auth` or `lastsignin`
413 outside the door's files, or any name of theirs beyond the state, its
414 constants and the jar (`doorImports`: never `auth.New`, `auth.Config`
415 or a handler); or a `passkey.New` / `passkey.Handlers`, in production
416 code. `sessions`, `crypto`, `db`, `passkey` and
417 `webauthn`'s Go are byte-identical, `assertion` only moved its
418 validators into an internal package, `auth`'s migrations are
419 unchanged, and `keymaildev/signin` stays v0.1.1. `webauthn.JS()`
420 gained conditional mediation, which a call without `mediation` never
421 uses. Fiesta 1.5.0's tokens.css declares the same day token names as
422 1.3.0, but moved two fallbacks Calma declares: `--rst-focus-edge` to
423 the accent (its one focus ring) and `--rst-ghost-face-hover` to
424 `--rst-surface-2` on the one-way door. estilo main `487cadb`
425 declares both; Home pins it. Names
426 are all `TestVendoredAssetsMatchTheLibrary` checks, so a moved
427 fallback passes here: re-check fallbacks in estilo on every bump
428 (estilo AGENTS.md, Theme). Credits regenerated (`make credits`).
429 v0.38.0's partials are bigger (`signin.html` doubled), and the
430 renderer parsed every partial once per page, in every App the tests
431 build: CI's race run of `internal/home` passed `go test`'s 10-minute
432 limit twice. `newRenderer` now parses the layout and the partials once
433 and clones that tree per page (each clone carries its own `door` and
434 `hop`); the race run fell from about 360 s to 150 s here. Keep it
435 that way rather than raising the timeout (`TestRendererClonesPerPage`
436 holds each page's `door`, `hop`, `layout` and `content` apart).
437 **`rastrillo.Serve` gained endpoints outside Home's router**:
438 `POST /_theme`, which sets a `rastrillo_scheme` cookie without the
439 `__Host-` prefix, and `GET /_speculation-rules` with a
440 `Speculation-Rules` header on every response, on both origins.
441 `home.ServeOptions` (what `cmd/home` hands Serve) sets
442 `NoSchemeSwitch` and `NoSpeculationRules`; `TestServeAddsNoFrameworkRoutes`
443 builds the handler Serve runs (`rastrillo.Handler`) and checks both
444 hosts, with a control that turns them back on. Check `Options` for
445 new defaults like these on every bump.
446- **No script by default; script only to enhance, and always prefer
447 none** (Paul, 2026-09-29, replacing rulings 21/24's closed list of
448 screens). Every screen works with scripts off β€” magic-link sign-in,
449 recovery codes, the springboard, sign-out β€” and a script may be added
450 to a page only to enhance it or to provide interaction HTML and CSS
451 cannot: the passkey ceremonies (`webauthn.JS()` plus a little glue,
452 and on the door rastrillo's own module, `passkey.JS()` at
453 `/static/signin.mjs`, which runs the passkey door and the email field's
454 conditional UI against the direct ceremony's `{ok,to}` finish),
455 the assertion handoff's auto-submit (its Continue button stays for
456 script-off), and estilo's busy rule on every submit button (the
457 spinner, the double-submit guard). Reach for HTML and CSS first; a
458 script is the exception that has to earn its place, not a tool.
459 Scripts are **static same-origin files, never inline `<script>`**, and
460 every one Home serves is named in `noscript_test.go`'s closed list β€”
461 a rule with a list is checkable, a rule with an escape hatch is not.
462- **The shared chrome** (estilo spec shared-chrome, Β§12.1 row 8;
463 `internal/home/chrome.go`). Every page Home draws for a person sits under
464 estilo's 52px bar, branded Oficina β€” except the public front page,
465 which keeps its own design. On the directory a signed-in person has one
466 account menu (Passkeys and Recovery codes on id.*, Appearance, Help β†’
467 Open source, the one Sign out); id.*'s pages are the door, with a
468 brand-only bar: every one sits in the door's card, branded Oficina ID
469 as its sign-in door is, its error page and hops included (Paul,
470 2026-11-20; `doorPages`, `hopPages`, `id_error.html`), Open source's
471 long list being the one exception. Unknown routes get estilo's error page for a browser
472 (`Accept: text/html`) and plain text otherwise. Calma's sky goes only on
473 the door, the team home's header and the front page's hero. Home does
474 not load estilo's `chrome.js`: its menus work without it, and the
475 script rule above prefers none β€” the stated cost is that an open menu
476 closes from its own trigger, not on Escape or a click outside.
477
478**Deploys**
479- One binary, `CGO_ENABLED=0`, cgo-free SQLite.
480- A 200 is not a deploy verification. Only `X-Carlos-Version` on the
481 canonical host, after the watch.
482- A promote is not a deploy. Until the process cycles, the old binary serves.
483- **Production is two carlos apps, neither called `home`.** The one
484 binary runs as `oficina` (the directory, oficina.works) and `oficina-id`
485 (the credential origin, id.oficina.works), both in account `oficina`.
486 `home` is only the preview/canary app. A command written with
487 `--app home` deploys the canary and leaves production as it was, so
488 every production command below names both apps, and both are checked
489 afterwards (`X-Carlos-Version` on oficina.works and id.oficina.works).
490- **Ship with `--mail submit`.** It declares that the build sends through
491 CARLOS mail submission (`mail.FromCarlos`, `loadMailer` in
492 `internal/home/keys.go`, From `$CARLOS_MAIL_FROM`). Until `carlos email
493 submission on` runs for an app, that app keeps sending over
494 `CARLOS_SMTP_*` and still refuses to boot without `CARLOS_SMTP_PASS`;
495 after it the agent sets `CARLOS_MAIL=submit`, the app holds no mail
496 credential, and every instance must run a build shipped with the flag.
497 Both production apps boot the same `loadMailer`, so switch them
498 together. `carlos deploy` has no `--mail` flag yet (carlos main
499 9eec0236), so ship and promote each app:
500
501 for app in oficina oficina-id; do
502 carlos ship --app $app --account oficina --mail submit --version <v> \
503 --target linux-arm64 releases/home-linux-arm64
504 carlos promote --app $app --account oficina <v>
505 done
506
507 (or `carlos deploy --mail submit` once that ships). For the canary, the
508 same with `--app home`.
509- **The home may hibernate** (Paul, 2026-11-21: "I think sleeping home is
510 fine 600ms for signin is totally fine"). This supersedes the earlier "the
511 home does not hibernate": the measured cold wake is about 0.6 s, which
512 is acceptable on a sign-in. Home's own periodic sweeps run when it is
513 awake, not on a wall clock, so nothing it does may assume a timer
514 fired while it slept.
515- **A backup you have never restored is a hope, not a backup.** Losing this
516 database loses credentials **and the roster**, neither of which rebuilds β€” call 2 cannot write membership and no channel carries an instance's copy back, so roster recovery is an operator reading instances out and re-seeding (spec Β§10). The restore drill runs
517 before launch.
518
519---
520
521## Authorship
522
523πŸ€– / πŸ‘¨ markers, `Co-Authored-By: Claude …` trailers, published prompt and
524carbon ledgers. AI is a guest with a name tag: opt-in, disclosed, and every
525path works with it switched off.
526
527## Work in a worktree, and catch main up first
528
529Take a worktree for the work. Do not work in the shared checkout.
530
531 git -C <repo> fetch origin
532 git -C <repo> worktree add ../<repo>-<task> -b <branch> origin/main
533
534Both halves matter, for different reasons.
535
536**The worktree**, because several sessions share this machine and some
537share this repository, and a checkout has one HEAD, one index and one
538working tree between all of them. A branch switch under somebody else's
539uncommitted work destroys it with nothing on screen to say so, and two
540sessions editing the same paths disagree quietly instead of conflicting
541loudly. A worktree gives the work its own HEAD and its own files, and
542costs a directory.
543
544**From `origin/main`, after a fetch** β€” not from whatever the checkout
545happens to be sitting on. A branch cut from a stale main is a merge
546conflict scheduled for later, against files somebody else has renamed in
547the meantime. A branch cut from another task's branch is worse: it
548carries that task's commits into yours, where they are reviewed as
549though you wrote them, and the two can only be separated by hand.
550
551Remove it when the work has landed β€” `git worktree remove` β€” so that
552`git worktree list` keeps saying something true.
553
554Written down because of 2026-09-17, in `meet`. The shared checkout was
555sitting on one task's branch while holding a *different* task's feature
556uncommitted on disk β€” some four hundred lines, a new migration among
557them β€” put there by a session nobody else knew was working in that tree.
558Two other sessions were meanwhile coordinating over the same checkout by
559asking each other not to touch it, which is the arrangement a worktree
560makes unnecessary. Nothing was lost. Nothing about the arrangement would
561have said so if it had been, and by then the same feature existed twice,
562once on each side of a rename, because the two sessions had branched
563from different starting points.
564