Mapa design, revision 4: Fable's three conditions for approval
S3 omits absent parts so the custody fixture's bytes match; every draft commit is a POST by the person, same-block conflicts stay drafts; UNKNOWN saves rely on render enforcement, and Fichas refuses an unchecked reference field. Plus the three low notes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+107
−35
docs/superpowers/specs/2026-11-12-mapa-design.md+107 −35
diff --git a/docs/superpowers/specs/2026-11-12-mapa-design.md b/docs/superpowers/specs/2026-11-12-mapa-design.md| index b1658ff..dc41bc0 100644 |
| --- a/docs/superpowers/specs/2026-11-12-mapa-design.md |
| +++ b/docs/superpowers/specs/2026-11-12-mapa-design.md |
| @@ -1,13 +1,17 @@ |
| # 🤖 mapa — design |
| -**Status:** draft, revision 3, 2026-11-12. **Nothing is built.** There is |
| +**Status:** draft, revision 4, 2026-11-12. **Fable APPROVED revision 3 |
| +conditional on three text edits; revision 4 makes them.** **Nothing is built.** There is |
| no module, no schema, no hub repository and no CARLOS app. This line is the |
| one to keep current. |
| **Reviews.** Fable 5.2 reviewed revision 1 (`48e72e6`) and asked for |
| changes (5 high, 9 medium, 9 low). Revision 2 (`2345d97`) answered them. |
| Fable re-reviewed revision 2 and asked for a narrower set of changes (1 |
| -high, 6 medium, 6 low), which revision 3 answers. Appendix A maps every |
| +high, 6 medium, 6 low), which revision 3 (`057d474`) answers. Fable |
| +approved revision 3 conditional on three text edits (M1 to M3) and three |
| +minor notes, all of which revision 4 makes. Fable said no further review |
| +was needed once they were applied. Appendix A maps every |
| finding from both rounds to the section that answers it. |
| **Consumed suite rulings.** This spec consumes `oficina/suite` |
| @@ -236,6 +240,7 @@ must answer a question without the key. The complete plaintext list: |
| | drafts `(page_id or daily print, person, base_revision, updated_at)` | the coalescing rule (§5) runs without unsealing | that a person has an uncommitted edit to a page, and when they last typed in it | |
| | member `id`, address print | admission and S2 by address without unsealing | how many members there are. The print shows equality only | |
| | rastrillo session and sign-in rows | inherited, as in every sibling | when each person signed in | |
| +| *(shown, not stored)* "Ana is editing" on team pages | presence while a draft is under 2 minutes old | that Ana is editing a team page, including edits she later discards. Never shown for private pages | |
| | `owner` (member row id) | S2 answers `private` → owner without unsealing | who has how many private pages | |
| | `created_at`, `updated_at`, `revision` | ordering, S1, §6.6 | **when each person writes**, including private notes. A daily note's creation time narrows its date to about a day. Creation on first edit (§6), not first open, means this records writing, not visiting | |
| | events `(at, actor, object, verb)` | S1 is the event log (Fichas §5's shape) | who did what to which object, and when. Not content | |
| @@ -259,15 +264,36 @@ for revision 11). |
| writes their **draft** (§3.1): a sealed row per person per page, separate |
| from the page. The page body and its revision are never touched in place, |
| so `(item, revision)` always names one byte sequence (doctrine §6.6). |
| -**The draft is committed as a new revision**, with one event, after 2 |
| -minutes idle, on Save, or on the next visit to any page if the tab was |
| -closed. A closed tab therefore loses nothing. Committing is a normal |
| -revision-checked save, so a teammate's revision in between goes through |
| -the §6 block merge. Meanwhile: |
| -- A second tab of the same person reads and writes the same draft. |
| +**The draft is committed as a new revision**, with one event, and every |
| +commit is a `POST` made by the person. A `GET` never writes, and the |
| +platform runs no timers (doctrine §13): |
| +- **On Save**, or **after 2 minutes idle**, the open tab's script `POST`s |
| + the commit. Without script, Save is the only commit. |
| +- **A draft left by a closed tab** is offered on the person's next visit to |
| + that page, or to today's note: "You have unsaved changes: Save or |
| + Discard". Both are `POST`s. |
| +- **A commit is a revision-checked save.** If a teammate's revision landed |
| + in between, the §6 block merge runs. **If two people edited the same |
| + block, the commit does not happen.** It stays a draft, and the person |
| + is shown both versions to choose from the next time they are present. |
| + Nothing is committed that nobody chose. |
| +- **If the base revision has aged out of the 90-day window,** there is no |
| + merge base. The person is shown the current page and their draft side |
| + by side, and chooses. |
| +- **If the draft's page was deleted,** the draft is offered as a new |
| + scratch page. |
| +- **Two tabs** of the same person share one draft, with a version check: a |
| + stale tab's autosave is refused, and that tab reloads the draft rather |
| + than overwriting newer text. |
| +- **An abandoned draft** is kept for 30 days after its last write, then |
| + discarded (proposed). |
| + |
| +Meanwhile: |
| - A teammate sees the last committed revision, plus "Ana is editing" while |
| - Ana's draft is less than 2 minutes old. The page is already team-visible, |
| - so who is editing it is not new information. |
| + Ana's draft on a **team** page is less than 2 minutes old. It is never |
| + shown for a draft on a private page. Who is editing a team page is not a |
| + rung leak, but it is a disclosure: it shows edits Ana later discards, |
| + which never reach history. It is in the leak list (§4). |
| - S1, memoria and the history list see revisions, not drafts. |
| Draft writes are the one write path exempt from gate 8's "every write logs |
| @@ -451,7 +477,12 @@ editor, and it is in history, S3 and export. So the rule is enforced |
| twice. |
| **At render, always.** A team container renders nothing for a payload whose |
| -`team_visible` is false, even for a viewer who could open the item. This |
| +`team_visible` is false, even for a viewer who could open the item. The |
| +one exception is a notice, shown only to a viewer whose own answer was |
| +`VISIBLE`: "This embed isn't shown here because it isn't shared with the |
| +whole team." Without it the item's owner would see the reference in the |
| +editor and nothing on the page. Nobody whose answer was not `VISIBLE` sees |
| +the notice, so it reveals nothing. This |
| closes every path a reference can arrive by: restore, merge, "Make team |
| page", text typed during slice 1 before the check existed, a later import, |
| and the race between the write-time check and commit. It is also the |
| @@ -466,12 +497,16 @@ that holds an embed Ana added, even if that item has since moved down. |
| - **`VISIBLE`, not team-visible, in a team container:** refused, with a |
| plain message. |
| - **`NOT_VISIBLE`:** refused with one message, identical for an unknown |
| - item and one the writer may not open. Nobody can plant a reference to |
| - something they cannot see. |
| -- **`UNKNOWN`:** the save goes through. The typed text is kept and the |
| - embed is marked unchecked, to be checked again on the next save. Render |
| - enforcement already makes an unchecked embed safe, and refusing would |
| - make every page with an embed unsavable while Fichas is cold. |
| + item and one the writer may not open. **When the sibling answers,** |
| + nobody can plant a reference to something they cannot see. |
| +- **`UNKNOWN`, in Markdown:** the save goes through and the typed text is |
| + kept. There is no "unchecked" mark: references live only in memory |
| + (decision 14), so a mark would not survive hibernation, and the diff |
| + rule would never look at the reference again. **Render enforcement |
| + alone covers it.** A reference saved under `UNKNOWN` renders nothing in |
| + a team container unless its payload says `team_visible`. Planting one |
| + leaks only an id the writer already had. Refusing instead would make |
| + every page with an embed unsavable while Fichas is cold. |
| - **The same check runs on restore and on "Make team page"** for the |
| references they bring into a team container. A private daily note may |
| embed anything its owner can open. |
| @@ -481,16 +516,22 @@ In Fichas and Mapa, learning whether it is team-visible tells them nothing |
| new. In a future app with a `granted` rung, a grantee learns the item's |
| rung. S1 deliberately carries no visibility flag, so `team_visible` goes in |
| revision 12's leak-list entry. |
| -- **Fichas → Mapa:** every Fichas card is team-visible (Fichas §6.1), so a |
| - card's reference field may reference **team Mapa pages only**. There is |
| - no picker: no call lets Fichas list Mapa titles, and S1 carries none. The |
| - person pastes a Mapa page URL, and S10's `team_visible` refuses a private |
| - page on save. |
| -- **While both apps are lone shape,** "the team" means each app's own |
| - admission list, and the two lists may differ. `team_visible` is the |
| - owning app's statement about its own list. Provisioning both apps for |
| - one team label from one roster (§10) is what makes the two lists agree. A teammate therefore never sees an empty reference field, or |
| - history naming a change to one, that points at someone's private note. |
| + |
| +**Fichas → Mapa.** Every Fichas card is team-visible (Fichas §6.1), so a |
| +card's reference field may reference **team Mapa pages only**. There is no |
| +picker: no call lets Fichas list Mapa titles, and S1 carries none. The |
| +person pastes a Mapa page URL. **A reference field is a typed value, so |
| +Fichas refuses that one field on anything but `VISIBLE` with |
| +`team_visible`,** `UNKNOWN` included, and the card still saves without it. |
| +"Mapa did not answer, so this reference wasn't saved; try again." Given |
| +that, and while Mapa answers truthfully, a teammate never sees an empty |
| +reference field, or history naming a change to one, that points at |
| +someone's private note. |
| + |
| +**While both apps are lone shape,** "the team" means each app's own |
| +admission list, and the two lists may differ. `team_visible` is the owning |
| +app's statement about its own list. Provisioning both apps for one team |
| +label from one roster (§10) is what makes the two lists agree. |
| - **What remains, and goes in the leak list:** an item that was |
| team-visible when embedded, and that its app later moves down the ladder, |
| leaves a reference string in team pages and their history. It renders as |
| @@ -532,10 +573,15 @@ Mapa serves the producer half, S1, S2 and S3, from **slice 1**. |
| - **S2** is Mapa's own read check: `team` → every admitted member; |
| `private` → its owner. The person is checked before any revision |
| (doctrine §6.6). |
| -- **S3** serves a fixed layout: line 1 is the title for a team page, the |
| - ISO date for a daily note (fixed at creation, so memoria can answer by |
| - day), or empty for a scratch page; then a blank line; then the body |
| - **exactly as stored**: |
| +- **S3** serves a layout that **omits absent parts and their separator**, |
| + as Fichas §6.4 does ("a card with only a title is exactly its title"): |
| + - A team page is its title, then a blank line, then the body. With an |
| + empty body it is exactly its title. |
| + - A daily note is its ISO date (fixed at creation, so memoria can answer |
| + by day), then a blank line, then the body. |
| + - A scratch page is exactly its body. |
| + |
| + The body is served **exactly as stored**: |
| link text as typed, embeds as their reference string, never expanded. Its |
| bytes change only when that page's revision changes (§3.2). memoria gets |
| Fichas content from Fichas. |
| @@ -566,6 +612,13 @@ Mapa serves the producer half, S1, S2 and S3, from **slice 1**. |
| | `doc-guest` | granted to a guest only | someone else's private page | passes, by seeding equivalence: `NOT_VISIBLE` throughout, as the fixture wants | |
| | `doc-granted` | granted to the asker | **cannot be represented** | **three pinned S2 failures**: the fixture wants `VISIBLE`, `STALE` and `UNKNOWN` at the current, prior and never-issued revisions. Mapa answers `NOT_VISIBLE` to each | |
| + **Seeding.** The fixture's private cases are seeded as **scratch |
| + pages**, so S3 is exactly the fixture's one-line `s3_body` |
| + (`conformance.go` compares bytes). A daily note always carries its date |
| + line and could not match. The team cases are seeded as team pages with |
| + the fixture string as the title and an empty body, so S3 is exactly that |
| + string. |
| + |
| That is eight passing cases and one unrepresentable case. The final table |
| is written from the running harness, as Fichas §6.7 was, and sent to the |
| suite as evidence. |
| @@ -623,7 +676,11 @@ from slice 2. On top of that: |
| 5. **Embeds** (slice 2). `NOT_VISIBLE` renders nothing. `UNKNOWN` renders |
| loudly and names the app. No payload byte reaches the database or the |
| index. Embedded pages do not expand embeds. A team container refuses a |
| - non-team item. Hostile app URLs and author-link schemes are refused. |
| + non-team item at write. A Markdown save under `UNKNOWN` goes through and |
| + renders nothing until the payload says `team_visible`. A Fichas |
| + reference field under `UNKNOWN` is refused while the card saves. Only a |
| + `VISIBLE` viewer sees the "not shared with the whole team" notice. |
| + Hostile app URLs and author-link schemes are refused. |
| 6. **Speed at size.** A 10,000-page synthetic fixture. §6.1's warm targets |
| are asserted. The cold-wake figure is measured and recorded. |
| 7. **Scriptless.** `make browser` walks today's note, ⌘K, create, link, |
| @@ -639,8 +696,12 @@ from slice 2. On top of that: |
| 10. **No trace of an unwritten day.** Opening today's note and leaving |
| without typing creates no row, no draft, no event and no S1 entry. |
| 11. **Drafts.** Autosave never changes a page body or revision in place. |
| - Closing the tab and returning commits the draft. A conflicting commit |
| - goes through the block merge. |
| + No `GET` commits. A closed tab's draft is offered on return as Save or |
| + Discard. A same-block conflict leaves the draft uncommitted. A base |
| + revision past the window gets the side-by-side view. A deleted page's |
| + draft is offered as a scratch page. A stale tab cannot overwrite a |
| + newer draft. Drafts are discarded 30 days after their last write. |
| + "Ana is editing" never appears for a private page. |
| 12. **Render enforcement** (slice 2). A team page whose text holds an embed |
| of a non-team item renders nothing for it, whatever path brought the |
| text in. |
| @@ -675,9 +736,9 @@ from slice 2. On top of that: |
| to another card" field already open, extended to any Oficina item? |
| 6. **Date links open your own daily note** (§3.4): yes? The cost: a date |
| link in a team page never shows anyone else's notes for that day. |
| -8. **History window: 90 days** (§5)? |
| 7. ~~Slice 1 without embeds~~ **Ruled: yes** (Paul, 2026-11-12: "makes |
| sense"). |
| +8. **History window: 90 days, and abandoned drafts kept 30 days** (§5)? |
| ## 14. Slices |
| @@ -753,3 +814,14 @@ export (decision 15). |
| | L4: past 64 as links | §7.3: render nothing plus a page note | |
| | L5: URL fields, picker, lone-shape lists | §7.3, §7.4 | |
| | L6: daily note date in S3 | §8 S3 layout | |
| + |
| +### Round 3 — Fable's conditional approval of revision 3 (`057d474`) |
| + |
| +| Finding | Answered in | |
| +|---|---| |
| +| M1: S3 layout fails the byte comparison | §8: absent parts omitted; private cases seeded as scratch pages | |
| +| M2: draft commit on `GET`; unattended conflicts | §5: every commit a `POST` by the person; conflicts stay drafts; window, deleted page, tab version check, 30-day retention; gate 11 | |
| +| M3: `UNKNOWN` saves, the lost mark, the orphaned sentence | §7.4: render enforcement alone for Markdown; Fichas refuses the field; sentence qualified; gate 5 | |
| +| L1: "Ana is editing" | §5, §4 leak list | |
| +| L2: owner sees nothing | §7.4: notice for `VISIBLE` viewers only | |
| +| L3: §13 numbering | §13 | |