| 1 | # π€ Team members: the Team page, and roster mode in every app |
| 2 | |
| 3 | **Status:** APPROVED (design), 2026-10-27. Drafted by Claude Opus 5.5 for |
| 4 | Paul. **Reviewed by Claude Fable 5.1 (claude-fable-5-1), 2026-10-27, |
| 5 | discussion 92, APPROVED (design, round 3)** at `93f8209`, after rounds 1 |
| 6 | and 2 (CHANGES REQUIRED). Not approved by that verdict and gated separately: |
| 7 | the shared `handoff` change (`ConsumerConfig.StartPath`) before the Team |
| 8 | page; each slice (Team page, resolve, each app's roster port) β whole-code |
| 9 | review, CI green, verified canary (amendment status, items 1 and 3). |
| 10 | **Part A implemented** on branch `team-page` (base `82d9388`) by Claude |
| 11 | Opus 5.5, 2026-10-28; its deviations are Β§11. **Slice A (Team page, resolve, |
| 12 | added_at, membership_names) reviewed by Claude Fable 5.1 (claude-fable-5-1), |
| 13 | 2026-10-28, discussion 95, APPROVED at `1388016`**; non-blocking notes 1β7 |
| 14 | applied before the squash, 8β10 recorded. Not deployed: the verified canary |
| 15 | and production resolve keys come first. |
| 16 | Base: Home origin/main `e2ec1ab`; Docs `d867db1`, Sheets `af8deeb`, Slides |
| 17 | `ebbb08f`, Calendar `00d8e3d`, Calls (repo `oficina/meet`, `cmd/calls`) |
| 18 | `47afcb9`, Memoria `521ae24`. |
| 19 | **Paul's rulings, 2026-10-27, applied here:** owner-chosen member names, |
| 20 | sealed, refusing `@`; unnamed members show role plus a short ref; **every |
| 21 | member of a team sees its member list, only owners write**; no "you've been |
| 22 | added" mail from Home (owners tell people); port order Sheets, Slides, |
| 23 | Memoria, Calendar, Calls. |
| 24 | **Implements** spec ruling 23, Β§10 (`memberships` "written only at the |
| 25 | directory origin, by a team owner, behind a fresh-assertion step-up"), Β§14's |
| 26 | step-up row, and gate 21. Companions: `team-provisioning-amendment.md` |
| 27 | (seeds the first owner) and `team-provisioning-app.md`. |
| 28 | |
| 29 | --- |
| 30 | |
| 31 | ## 1. Scope |
| 32 | |
| 33 | Part A: a **Team page** on `https://oficina.works` that shows a team's |
| 34 | members to every member of that team and lets an owner add, remove, promote, |
| 35 | demote and name them. |
| 36 | Part B: the follow-on β **roster team mode** in Sheets, Slides, Calendar, |
| 37 | Calls and Memoria, which only Docs has today. Until Part B lands for an app, |
| 38 | that app ignores the Team page and keeps admitting by its own allowlist. |
| 39 | |
| 40 | ## 2. The page |
| 41 | |
| 42 | - **Route:** `GET /team?team=<sqid>` (ruling 22: team views carry `?team=`). |
| 43 | Linked from the springboard's account menu as "Team" when the signed-in |
| 44 | person is on the selected team. |
| 45 | - **Signed out:** an anonymous `GET /team?team=<sqid>` follows the chooser |
| 46 | (`docs_chooser.go:142-154`): 303 to `/auth/start?return_to=β¦` with the |
| 47 | query preserved (spec Β§5.6), so a shared team link survives sign-in. |
| 48 | - **Who sees it:** a directory session whose subject has a `memberships` |
| 49 | row (owner or member) for that team. **Everyone else signed in β a guest, |
| 50 | a member of another team, a stranger, an unknown or malformed sqid β gets |
| 51 | the same 404** as an unknown route (gate 4's pattern). **The page's own |
| 52 | answers are never 403**; `csrf.Protect` and the host check, which run |
| 53 | before the handler, keep their own codes. |
| 54 | - **Who writes:** owners only. A member sees no write controls, and a |
| 55 | member's POST to any write route gets the same 404 (gate 21). |
| 56 | - **Reading needs a session; writing needs a fresh one (round 1, blocker |
| 57 | 4; round 2, blocker 2).** The directory gains a **second |
| 58 | `handoff.Consumer`** on the same `Store`, same `ConsumerID` (`directory`), |
| 59 | with `RequireFreshAuth: true`, at its own start path |
| 60 | **`/auth/fresh/start`**; `Callback` and `Finish` stay shared because they |
| 61 | are store-level and the fresh requirement rides the pending row's path |
| 62 | prefix. The existing consumer at `/auth/start` stays ordinary |
| 63 | (`RequireFreshAuth` is per consumer, `handoff/http.go:139-141`). **This |
| 64 | cannot be mounted on today's `handoff`:** `Start` calls `c.guard(w, r, |
| 65 | http.MethodGet, StartPath)` and `guard` 404s when `r.URL.Path != path` |
| 66 | (`handoff/http.go:70-80`, `:107`), with `StartPath` a package constant and |
| 67 | no path field in `ConsumerConfig`. So it needs a **reviewed change to the |
| 68 | shared `handoff` module**: `ConsumerConfig.StartPath`, defaulting to the |
| 69 | constant, used by `Start`'s guard. **Sequencing:** that change, its tests |
| 70 | and its review land first; the Team page and the directory operator |
| 71 | confirm page (amendment Β§4) both depend on it and come after. The fresh |
| 72 | consumer asks the issuer for `max_age=300` and enforces the five-minute |
| 73 | window itself on finish. Every Team-page POST checks the directory session's |
| 74 | `auth_time` is within 300 s and not in the future; if not, it renders the |
| 75 | existing continuation page to |
| 76 | `/auth/fresh/start?return_to=%2Fteam%3Fteam%3D<sqid>`, and the person |
| 77 | repeats the action on return. The submitted change is **not** retained |
| 78 | across the step-up (the chooser's expired-session rule). The same fresh |
| 79 | consumer fronts the operator confirm page (amendment Β§4). |
| 80 | `noscript_test.go`'s route list gains `/team`, `/team/add`, |
| 81 | `/team/resolved`, `/team/confirm`, the role/name/remove POSTs and |
| 82 | `/auth/fresh/start`. |
| 83 | - **Inherited gap, stated:** `fresh-assertion.md`'s open rastrillo item |
| 84 | applies. The fresh consumer's `max_age=300` makes the issuer refuse a |
| 85 | Keymail session with no reported gesture; but a directory session minted by |
| 86 | ordinary SSO from such a session inside the last 300 s carries |
| 87 | `auth_time = At` and passes a directory-side freshness check. The page |
| 88 | inherits that gap until rastrillo lets an assertion carry an absent |
| 89 | `auth_time`, exactly as Docs linking does. Writes that arrive through |
| 90 | `/auth/fresh/start` are not affected. **Recovery codes:** a recovery-code |
| 91 | sign-in mints `AuthTime: now` (`passkey.go:28-39`) and no method claim |
| 92 | rides the assertion, so a fresh exchange from such a session passes here. |
| 93 | For the Team page that is accepted β recovery is a current credential. |
| 94 | The directory operator confirm page inherits the same two gaps; the |
| 95 | credential confirm page is where Paul's method is visible and refused |
| 96 | (amendment Β§4 step 3). |
| 97 | - **Scriptless.** Every action is a plain form POST with CSRF; estilo's |
| 98 | `busy.js` is the only script, already on Home's closed list. |
| 99 | - **Shape (estilo, Calma door rules β sky only on the team header):** |
| 100 | |
| 101 | ``` |
| 102 | Owner's view |
| 103 | Oficina βΎ Lagged [account βΎ] |
| 104 | βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
| 105 | Team [Add person] |
| 106 | Till Owner added 27 Oct [Make member] [Remove] [Name] |
| 107 | You Owner added 27 Oct [Make member] [Name] |
| 108 | Member β¦k7q Member added 28 Oct [Make owner] [Remove] [Name] |
| 109 | Changes reach every app in this team within a minute. |
| 110 | |
| 111 | Member's view: the same list, no buttons, and |
| 112 | "Only owners can change who is on this team." |
| 113 | ``` |
| 114 | |
| 115 | ## 3. Rules every write keeps |
| 116 | |
| 117 | 1. **Owner only, re-checked inside the write transaction** (the page render |
| 118 | is not authority). |
| 119 | 2. **Never zero owners.** Removing or demoting the last owner refuses with |
| 120 | fixed copy. Without this a team's roster becomes unwritable and the only |
| 121 | exit is the operator seed (Β§5.2's "operator reset in all but name"). |
| 122 | 3. **One membership row per (team, person).** Adding an existing member |
| 123 | refuses with "already on this team"; role changes use their own button. |
| 124 | 4. **Epoch bumps** come from the existing `memberships_epoch_*` triggers; no |
| 125 | second increment. Instances see a change within the roster lease |
| 126 | (refresh due 30 s, hard expiry 60 s β `roster-contract.md`). |
| 127 | 5. **`added_at`** (round 1, blocker 5): `memberships` gains a **nullable** |
| 128 | `added_at` (integer day, coarsened per Β§3.3), written by |
| 129 | `directory.seed-team` for the first owner β its `INSERT INTO |
| 130 | memberships(team_id,person_ref,role)` (`directory.go:254`) changes to |
| 131 | write it, part of "verbs wrapped" β and by `/team/confirm`; pre-migration |
| 132 | rows hold NULL and show no date. Additive migration |
| 133 | `directorydata/migrations/0002_membership_added_at.sql`; gate 2's static |
| 134 | half reads it. |
| 135 | 6. **Bounds:** 500 members per team (well inside the roster's 10,000 and |
| 136 | 100-per-page limits; a number with a reason: a team page, not a |
| 137 | directory). 30 writes per owner per hour. |
| 138 | 7. **Call 2 still cannot write `memberships`**, and nothing here changes |
| 139 | that. |
| 140 | |
| 141 | ## 4. Adding someone by email |
| 142 | |
| 143 | **The problem.** The owner knows an address. The roster keys on a person |
| 144 | ref. Turning one into the other needs the pepper, which only the credential |
| 145 | role holds (ruling 4), and `home-operator-seed.md` rules that *"the |
| 146 | directory cannot request address resolution over HTTP."* The directory must |
| 147 | also never see the address at all β it is the origin that renders |
| 148 | account-authored strings and holds the roster. |
| 149 | |
| 150 | **The design: the browser carries the owner to the credential origin, which |
| 151 | resolves and signs.** The address is typed on `id.oficina.works`, never on |
| 152 | `oficina.works`. |
| 153 | |
| 154 | 1. **Directory, `POST /team/add` (owner, fresh).** Stores an add-intent row: |
| 155 | hash of a random 32-byte intent id, team id, requester person ref, chosen |
| 156 | role, sealed optional display name (Β§5), expiry 10 minutes. 303s (via |
| 157 | the continuation page) to |
| 158 | `https://id.oficina.works/resolve?consumer=directory&intent=<id>`. |
| 159 | 2. **Credential, `GET /resolve`.** Requires a complete credential session. |
| 160 | Renders fixed copy only β "Enter the email address of the person to |
| 161 | add" β **no team name, label or sqid on the page** (origin separation, |
| 162 | gate 5). The intent id rides a sealed `__Host-` cookie, as `/authorize` |
| 163 | does. |
| 164 | 3. **Credential, `POST /resolve`.** Normalizes and blind-indexes with the |
| 165 | sign-in helper; finds the person, or mints a person stub as spec Β§6 |
| 166 | describes for a never-signed-in guest, using the helper that exists, |
| 167 | `findOrMintPersonOn` (`links.go:156`) β call 2, which Β§6 names, is not |
| 168 | implemented. Rate limited: 20 per subject per |
| 169 | hour, plus the existing per-IP budget. Signs a **member-resolution |
| 170 | receipt**: `{v, purpose:"member-resolve", iss, aud:<directory>, |
| 171 | requester:<session sub>, intent, person_ref, iat, exp β€ 120 s, jti}` with |
| 172 | a new dedicated P-256 key (private half `HOME_RESOLVE_KEY` on the |
| 173 | credential role only) under context `oficina/home/member-resolve/v1`. The |
| 174 | directory pins the public half as **`HOME_RESOLVE_PUBLIC_KEY`** β a fourth |
| 175 | pinned key beside `HOME_ASSERTION_KEYS`, the operator key and the roster |
| 176 | keys β and it joins `NewDirectory`'s key-inequality set. Auto-POSTs it to the directory with the |
| 177 | existing handoff page (static script, Continue button with script off). |
| 178 | The address is dropped. **The response never says whether the person |
| 179 | already existed.** |
| 180 | 4. **Directory, `POST /team/resolved`.** Verifies the receipt (key, context, |
| 181 | `aud`, expiry, single-use `jti` in its own store), loads the intent by |
| 182 | hash, and requires `requester` = intent requester = current directory |
| 183 | session subject. Like the assertion callback it does **not** write here: |
| 184 | it stores the verified result in the sealed inbox and 303s to |
| 185 | `GET /team/confirm`. |
| 186 | 5. **Directory, `POST /team/confirm`** (same-origin, CSRF, still fresh): |
| 187 | re-checks owner, writes `(team, person_ref, role)` and the sealed name in |
| 188 | one transaction, deletes the intent. Done. |
| 189 | |
| 190 | **Telling the person: Home sends nothing** (Paul, 2026-10-27). The owner |
| 191 | tells them; the confirm page says so: "Let them know β they sign in at |
| 192 | oficina.works." Rejected: a fixed "you've been added" mail from the |
| 193 | credential role. |
| 194 | |
| 195 | **What this costs the one rule.** Nothing new at rest: the address is |
| 196 | transient on the credential role, as on every sign-in; the directory holds a |
| 197 | person ref, as it does for every member. Gate 2 gains a fifth path (resolve) |
| 198 | that receives an address and must leave none readable, WAL included. |
| 199 | |
| 200 | ## 5. What the page shows β RULED 2026-10-27 by Paul |
| 201 | |
| 202 | **Owner-chosen display names, sealed at rest; a member without one shows |
| 203 | role plus a short ref** ("Member β¦k7q"). Rejected, recorded so they are not |
| 204 | re-proposed: refs only (unusable past a few people); a name each person sets |
| 205 | for themselves suite-wide (a new per-person preference, Β§8 keeps that set |
| 206 | small); addresses pulled from the team's instances and rendered in RAM |
| 207 | (grows Home, and Home-only members have no address in any instance); an |
| 208 | address kept by Home (forbidden by the one rule). |
| 209 | |
| 210 | **Storage.** `membership_names(team_id, person_ref, sealed_name, |
| 211 | updated_at day)` in the directory DB, FK to `memberships` with |
| 212 | `ON DELETE CASCADE`, sealed with the existing ID-bound helper under a new |
| 213 | purpose (`directory.member-name/v1/<team id>/<person ref>`). 1β64 UTF-8 |
| 214 | bytes; **any value containing `@` is refused** with a field hint saying why, |
| 215 | so a name is not quietly an address. A determined owner can still type |
| 216 | "till at lagged dot biz"; it is sealed, so it is not *readable at rest* β |
| 217 | the rule's test. Set when adding (optional) or later via [Name]; owners |
| 218 | only; deleted with the membership row. Names never ride an assertion, call |
| 219 | 8, a log or an error string. |
| 220 | |
| 221 | **Spec text this changes:** Β§3.2's "Sealed" list gains "member display |
| 222 | names"; Β§10's data-model list gains `membership_names` and |
| 223 | `memberships.added_at`; the README's published list says owners can name |
| 224 | members. Gate 2's static half reads the `membership_names` migration |
| 225 | (`directorydata/migrations/0003_membership_names.sql`) and asserts the name |
| 226 | column is a sealed BLOB. |
| 227 | |
| 228 | ## 5a. Every member sees the list β RULED 2026-10-27 by Paul |
| 229 | |
| 230 | **Checked against the rules:** |
| 231 | |
| 232 | - **The one rule** (no readable address at rest, retains nothing from an |
| 233 | instance): untouched. The list is rendered from the roster and the sealed |
| 234 | names β Home's own records, not instance content β and nothing is added at |
| 235 | rest beyond Β§5's sealed column. |
| 236 | - **Β§2.2's "only to that person" / "no operator view"** governs content an |
| 237 | *instance* hands Home; the roster is not that. The closest honest analogue |
| 238 | is applied anyway: the list is rendered **per request, only to a person |
| 239 | who is on that team**, and never to anyone else β no operator view, no |
| 240 | cross-team view, no export, no API. A guest, a member of another team or |
| 241 | Paul as operator gets 404 like any stranger. |
| 242 | - **Never cross a team:** the query is keyed on the requested team and the |
| 243 | viewer's own membership in it; gate 4 tests the cross-team case. |
| 244 | - **Never a support console:** no path renders another team's list. |
| 245 | |
| 246 | **The privacy cost, stated plainly:** every member learns **who else is on |
| 247 | the team, who the owners are, when each was added, and the name an owner |
| 248 | chose for each person** β including names the named person never saw or |
| 249 | agreed to. An owner's private note used as a name ("Till β contractor, leaving March") |
| 250 | is published to the whole team. The field hint says so: "Everyone on this |
| 251 | team sees this name." Before this ruling only owners learned the roster |
| 252 | from Home; members could already infer much of it from shared items in the |
| 253 | instances, but not owner status or names. |
| 254 | |
| 255 | ## 6. Gates |
| 256 | |
| 257 | - **Gate 21** β every write requires a fresh assertion (`auth_time` 301 s |
| 258 | refuses; future refuses); call 2 cannot write `memberships` or names; a |
| 259 | write naming a team the caller does not own answers the same 404 as an |
| 260 | unknown team; a member (non-owner) can GET the list but gets 404 on every |
| 261 | POST, and the page renders no write control for them. |
| 262 | - **Gate 4** β a member of Acme opening `/team?team=<beta>` gets 404; a |
| 263 | guest of `acme.docs` (no roster row) gets 404 on Acme's list. |
| 264 | - **Gate 2** β resolve path extended; names containing `@` are refused, and |
| 265 | canary names appear only as ciphertext in the file, WAL and SHM. |
| 266 | - **Gate 5** β `/resolve` renders no account-authored string (scan with a |
| 267 | canary team name and member name present in the directory). |
| 268 | - **Gate 9** β no address, member name, team name or person ref fragment in logs. |
| 269 | - **Step-up route** β a stale-session POST renders the continuation to |
| 270 | `/auth/fresh/start`; an assertion through it with `auth_time` 301 s old is |
| 271 | refused at finish; the ordinary `/auth/start` consumer is unchanged. |
| 272 | Anonymous `GET /team?team=<sqid>` 303s to `/auth/start` with the query |
| 273 | preserved. |
| 274 | - **`added_at`** β seed and confirm write a day value; pre-migration rows |
| 275 | render no date; gate 2's static half covers both new migrations. |
| 276 | - **Last-owner** β remove/demote the sole owner refuses; with two owners, |
| 277 | either may leave. |
| 278 | - **Cross-origin** β receipt replay, wrong `aud`, wrong requester (another |
| 279 | owner's session), expired intent, a receipt for team A confirmed into team |
| 280 | B, and a directory-only attacker (no credential session) all fail. |
| 281 | |
| 282 | ## 7. Part B β roster mode in the other five apps |
| 283 | |
| 284 | **What Docs already does** (`internal/docs/team_config.go`, |
| 285 | `team_access.go`, `teamstate`): `DOCS_TEAM_ID`, `_DIRECTORY_ORIGIN`, |
| 286 | `_PROVISIONING_BASE64`, `_OPERATOR_KEYS_BASE64`, `_ROSTER_TOKEN` (all or |
| 287 | none, and only with `DOCS_HOME_*`); a verified provisioning record; the |
| 288 | `home/roster` cache; tri-state admission (Member / NotMember / Unknown); |
| 289 | grant-only query mode when not a member; lease re-check before every commit |
| 290 | and stream event; a fingerprint marker that refuses to boot back into |
| 291 | allowlist mode. Each port copies that shape with `<APP>_TEAM_*` names and |
| 292 | the same five variables. Shared code to extract first: a small |
| 293 | `home/teammode` helper (config parse, record verification, admission |
| 294 | middleware, fingerprint marker) so five apps do not re-implement Docs' |
| 295 | `team_config.go`. (Built after the Sheets port, per Fable's sequencing on |
| 296 | oficina/sheets #52: `teammode-package.md`.) Then per app: |
| 297 | |
| 298 | | App | Admission today | Port work beyond the shared helper | Hard part | |
| 299 | |---|---|---|---| |
| 300 | | Sheets | `SHEETS_OWNERS` (everyone is co-owner) | Member = the team rung; grant-only mode for any per-sheet sharing; close live edit channels at lease expiry | None special | |
| 301 | | Slides | `SLIDES_ALLOWED_ADDRESSES` | As Sheets. Team instances ship **without uploads** (no object storage on the account); when storage arrives, cap presigned GETs at the lease ceiling (60 s) | Asset URLs outliving removal, later | |
| 302 | | Calendar | `CALENDAR_ALLOWED_ADDRESSES` | Published `.ics` feed tokens stay capability links (like Docs public links) and need an owner revoke; reminders need an address | Home-only members have no address in the instance β reminders need an in-app "email for reminders" the instance stores (ruling 5 allows instances to) | |
| 303 | | Calls | `CALLS_ALLOWED_ADDRESSES` | Check standing at room join and on every signaling reconnect; close the signaling socket at lease expiry | Native Mac/iOS clients assume one host; they need a team-host picker and Home sign-in | |
| 304 | | Memoria | `MEMORIA_OWNERS` | Grant-only mode applies to search results and the AI answer's sources; sibling calls already bind to `MEMORIA_TEAM` hosts | AI stays off unless the team owner asks and Paul agrees (see `team-provisioning-app.md` Β§5) | |
| 305 | |
| 306 | **Order β RULED 2026-10-27 by Paul:** Sheets, Slides, Memoria, Calendar, |
| 307 | Calls. Calls last because of native clients and live media. |
| 308 | |
| 309 | **Until an app is ported**, its `lagged` instance runs Home sign-in plus its |
| 310 | own allowlist holding only the owner's address (Track 1). Alta registers it |
| 311 | as a credential consumer so Home sign-in works, but leaves its directory |
| 312 | `team_instances` row **pending**: `roster-contract.md` forbids marking an |
| 313 | instance live in the chooser before TeamMode passes its gates. Adding someone |
| 314 | on the Team page therefore does nothing in that app until it is ported; |
| 315 | Alta's per-instance allowlist edit (Paul only, retyping the address β Alta |
| 316 | keeps none after a team is live) is the stopgap. |
| 317 | |
| 318 | **Acceptance per port:** Docs' existing roster test list (two teams, removal |
| 319 | within 60 s under failing refresh, grant-only vs owner shortcut, stream |
| 320 | closure, fingerprint lock-in), plus a readiness probe `GET /api/team` |
| 321 | returning only `{team_mode, consumer, roster:"ok"|"stale"|"unknown"}` for |
| 322 | Alta's activation evidence. Full app CI, top-model review, verified canary. |
| 323 | |
| 324 | ## 8. Not in this design |
| 325 | |
| 326 | Guests (unchanged: instance grants, `kind = guest`); per-team 2FA floor |
| 327 | (Β§14); ownership transfer as its own verb (promote + leave covers it); |
| 328 | invitations that wait for acceptance (membership is immediate; standing |
| 329 | does nothing until the person signs in); suite-wide sign-out. |
| 330 | |
| 331 | ## 9. Still open |
| 332 | |
| 333 | Nothing for Paul in this file; all four questions were ruled on 2026-10-27 |
| 334 | (names, no mail, members read, port order). Round-2 review is owed on Β§2 and |
| 335 | Β§5. |
| 336 | |
| 337 | ## 10. Round-1 findings: disposition |
| 338 | |
| 339 | Blocker 4 (no route to start a step-up; "no 403 anywhere") β Β§2: a second |
| 340 | `handoff.Consumer` with `RequireFreshAuth` at `/auth/fresh/start`, named in |
| 341 | the noscript route list; anonymous GET follows the chooser; 403 claim |
| 342 | narrowed to the page's own answers. Blocker 5 (no `added_at`) β Β§3 rule 5, |
| 343 | Β§5 spec-text list. Notes: `findOrMintPersonOn` cited (Β§4 step 3); freshness |
| 344 | gap inherited and stated (Β§2); `HOME_RESOLVE_PUBLIC_KEY` pinned and in the |
| 345 | inequality set (Β§4 step 3); `membership_names` in Β§10 and gate 2 (Β§5); |
| 346 | Calls repo named (status). **Round 2:** blocker 2 (fresh consumer not |
| 347 | mountable) β Β§2: reviewed `handoff` change (`ConsumerConfig.StartPath`), |
| 348 | guard cited, sequenced first; recovery-code acceptance stated and |
| 349 | cross-referenced; `added_at` nullable and the seed INSERT change (Β§3); the |
| 350 | stopgap allowlist edit retypes the address (Β§7). None declined. |
| 351 | |
| 352 | ## 11. Part A as built (branch `team-page`): deviations and notes |
| 353 | |
| 354 | Recorded in the same branch as the code, for the whole-code review. None |
| 355 | changes a ruling; each is a choice the text left open or could not make. |
| 356 | |
| 357 | 1. **The migrations are their own set,** `oficina_directory_team` |
| 358 | (`directorydata/team_migrations/migrations/0001_membership_added_at.sql`, |
| 359 | `0002_membership_names.sql`, `0003_member_add.sql`), applied by |
| 360 | `Runtime.ServingSchema`, not files 0002/0003 in the frozen |
| 361 | `oficina_directory` set β the shape round 4 (#94) ruled for the operator |
| 362 | endpoint's tables, so the compatibility, admission and legacy profiles do |
| 363 | not move. Because 0001 alters a frozen table, the legacy diagnostic now |
| 364 | replays the whole serving schema beside the frozen one; an exact serving |
| 365 | `memberships` stands in for the frozen one, any other change is still a |
| 366 | mismatch. The native command refuses such a database, as it already does |
| 367 | one carrying the operator set. |
| 368 | 2. **`added_at` is written by `seed-team` over the operator endpoint only** |
| 369 | ("verbs wrapped"); the native command's path keeps its three-column |
| 370 | INSERT, because its schema has no such column. |
| 371 | 3. **The resolve key's inequality set:** on the directory it is checked |
| 372 | against `HOME_ASSERTION_KEYS` and the roster key at load, and added to the |
| 373 | operator endpoint's distinct-key set (Alta's key, the owner-seed public |
| 374 | key, the provisioning key, the roster keys) β the set `NewDirectory`'s |
| 375 | keys come from β rather than as a new `NewDirectory` parameter. On the |
| 376 | credential role it is likewise kept apart from the assertion key and that |
| 377 | role's operator keys. |
| 378 | 4. **Both resolve keys are optional.** Without them the page lists and edits |
| 379 | members and offers no Add person; `/team/add`, `/team/resolved`, |
| 380 | `/team/confirm` and `/resolve` answer 404. |
| 381 | 5. **The account menu links "Team" once per directory team the person is |
| 382 | on** (at most eight; "Team: <name>" when several). The springboard's |
| 383 | selected team is a `HOME_DASHBOARD_TEAMS` grouping, not a directory sqid, |
| 384 | so "the selected team" has nothing to map to. It costs one indexed read |
| 385 | per signed-in directory page. |
| 386 | 6. **One live add per owner** (`team_add_intents.requester` is unique); a |
| 387 | newer add replaces the older. |
| 388 | 7. **`/team/resolved` also requires the browser's intent cookie** |
| 389 | (`__Host-oficina-team-add`, set by `/team/add`) to equal the receipt's |
| 390 | intent, beside the receipt's, the intent's and the session's subject. The |
| 391 | jti is recorded inside the resolving transaction. |
| 392 | 8. **A stale `GET /team/confirm` redirects to `/auth/fresh/start` back to |
| 393 | `/team/confirm`,** keeping the server-held intent (ten minutes); a stale |
| 394 | confirm POST gets the continuation page to the same. Nothing was in the |
| 395 | form to keep or lose, and the confirm POST still needs a fresh session. |
| 396 | Every other stale write returns to `/team?team=<sqid>` and is not kept. |
| 397 | 9. **The receipt:** `base64url(JSON payload) "." base64url(signature)`, the |
| 398 | design's fields, β€ 2 KiB; `iat` may lead the directory's clock by 5 s |
| 399 | (two processes, perhaps two hosts); `exp` is strict. |
| 400 | 10. **The 30-writes budget counts every owner POST,** `/team/add` and |
| 401 | `/team/confirm` included; in memory, per process, like sign-in's. |
| 402 | 11. **Small things:** the short ref is four characters ("Member β¦k7qz"); |
| 403 | the sole owner is drawn no Make member or Remove; the `@` refusal also |
| 404 | covers the fullwidth and small commercial at; the page is plain under |
| 405 | the bar (AGENTS.md: the sky goes on the door, the team home's header and |
| 406 | the front page β "sky only on the team header" read as the team home's). |
| 407 | 12. **Spec text:** Β§3.2's sealed and plaintext lists and Β§10's data model |
| 408 | are updated. There is no README in this repository to carry "owners can |
| 409 | name members"; Β§3.2 carries it. |
| 410 | 13. **"Call 2 cannot write `memberships` or names"** β call 2 is not built, |
| 411 | so gate 21's clause is a source scan: no production file but |
| 412 | `directorydata/members.go` and `internal/operator/directory.go` writes |
| 413 | either table. |
| 414 | |
| 415 | **The inherited freshness gap** (Β§2) is recorded where the gap lives, |
| 416 | `fresh-assertion.md`'s open rastrillo item, and on `teamFresh`. |
| 417 | |
| 418 | **Not in Part A:** the roster ports (Β§7, Part B); the verified canary on |
| 419 | deployed previews; production `HOME_RESOLVE_KEY`/`HOME_RESOLVE_PUBLIC_KEY`. |
| 420 | |