Mapa design, revision 2: answer Fable's review; Paul's rulings on document, saved views, slice 1
All 23 findings answered (Appendix A): S10 not S9, per-viewer scope for every index read, team containers embed only team-visible items, typed payloads with no markup, the link graph sealed and in memory only, and the team label as a prerequisite. Paul ruled: document not outliner, saved views both personal and team, slice 1 without embeds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+504
−345
docs/superpowers/specs/2026-11-12-mapa-design.md+504 −345
diff --git a/docs/superpowers/specs/2026-11-12-mapa-design.md b/docs/superpowers/specs/2026-11-12-mapa-design.md| index 68c0041..12250fb 100644 |
| --- a/docs/superpowers/specs/2026-11-12-mapa-design.md |
| +++ b/docs/superpowers/specs/2026-11-12-mapa-design.md |
| @@ -1,62 +1,65 @@ |
| # 🤖 mapa — design |
| -**Status:** draft, revision 1, 2026-11-12. **Nothing is built.** There is |
| +**Status:** draft, revision 2, 2026-11-12. **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 answers all 23. Appendix A |
| +maps each finding to the section that answers it. |
| + |
| **Consumed suite rulings.** This spec consumes `oficina/suite` |
| `docs/superpowers/specs/2026-09-05-suite-sharing-doctrine.md` at |
| -**revision 11, commit `91affa1`**. It cites rulings 1, 2, 3, 6, 7, 8, 9, 14 |
| -and 15 and never restates them (suite ruling 7). §7 proposes a new contract |
| -call, which would be revision 12 of that doctrine. That is a proposal to |
| -the suite, and nothing here is its ruling. |
| +**revision 11, commit `91affa1`**, including revision 10's "hold private |
| +too, check per person". It cites rulings 7, 8, 9 and 15, plus doctrine |
| +§§4.3, 6, 6.1, 6.3, 6.4, 6.6, 8 and 14. It never restates them (suite |
| +ruling 7). §7 proposes a new contract call, which would be revision 12 of |
| +that doctrine. That is a proposal to the suite, not a ruling. |
| -*Mapa* is Spanish for map. The name is Paul's. It fits a knowledge base |
| -whose structure is the set of links between its pages. |
| +*Mapa* is Spanish for map. The name is Paul's. |
| --- |
| ## 0. The one rule |
| **Mapa is the team's knowledge base. Fichas is the team's database. Docs is |
| -where the team publishes.** Paul, 2026-11-12, in his words: *"In |
| -traditional terms, Fichas is database, Mapa is knowledge base."* |
| - |
| -Every boundary below follows from that sentence: |
| - |
| -- If something wants typed fields, sorting, grouping or a table, it |
| - belongs in Fichas. Mapa embeds it (§7). |
| -- If something wants pagination, page layout, or DOCX/PDF export, it belongs |
| - in Docs. Mapa can promote a page into one (§9). |
| -- If something has no owner, it does not belong in Mapa. Mapa is an app of |
| - record: it owns its pages, answers for them, and is the only thing that |
| - may delete them. memoria indexes Mapa like any other sibling and holds |
| - nothing of its own (memoria decision 7, as fichas §0 reads it). |
| +where the team publishes.** Paul, 2026-11-12: *"In traditional terms, |
| +Fichas is database, Mapa is knowledge base."* |
| + |
| +- If something wants typed fields, sorting, grouping or a table, it belongs |
| + in Fichas, and Mapa embeds it (§7). |
| +- If something wants pagination, page layout or DOCX/PDF export, it belongs |
| + in Docs, and Mapa can promote a page into one (§9). |
| +- **Mapa is an app of record.** It owns its pages, answers for them, and is |
| + the only thing that may delete them. memoria indexes Mapa as a sibling. A |
| + team's notes are not a memoria feature, for the reason Fichas decision 1 |
| + gives for cards: that would make memoria the app of record for content |
| + people author elsewhere. |
| --- |
| ## 1. Decisions, and who made them |
| -The suite's specs keep this table because when the reasoning behind a |
| -decision lives only in a commit message, the decision gets argued again. |
| -**The `Who` column matters: most of this table is proposed by the spec |
| -author and has not been ruled on.** Do not read a proposal as a ruling. |
| +**The `Who` column matters: most of this table is the spec author's |
| +proposal and has not been ruled on.** Do not read a proposal as a ruling. |
| | # | Decision | Rejected | Who, when | |
| |---|---|---|---| |
| -| 1 | **Mapa is a sixth per-team instance app**, with its own DEK and its own origin at `<team>.mapa.oficina.works` | Wiki pages as a Docs mode, because Docs' identity is "the same document everywhere": paginated, WYSIWYG, DOCX/PDF out. Notes as a memoria feature, because memoria is not an app of record. Notes as a Fichas card type, because Fichas entries are append-only and its unit is a typed record, not prose | Paul, 2026-11-12 ("one more Oficina app… probably called Mapa") | |
| +| 1 | **Mapa is a new per-team instance app**, with its own DEK, at `<team>.mapa.oficina.works` | Wiki pages as a Docs mode, because Docs is "the same document everywhere": paginated, WYSIWYG, DOCX/PDF out. Notes inside memoria, per Fichas decision 1's reasoning. Notes as a Fichas card type, because Fichas entries are append-only and its unit is a typed record, not prose | Paul, 2026-11-12 | |
| | 2 | **Linked notes, not a spatial mindmap.** The unit is a page of prose. Structure comes from `[[links]]` in the text. A graph view may come later as one way of looking at the pages | A canvas of nodes and edges as the primary surface | Paul, 2026-11-12 | |
| -| 3 | **Fichas = database, Mapa = knowledge base.** Mapa has no properties, no table views and no typed fields | Notion's database-inside-a-page | Paul, 2026-11-12 | |
| +| 3 | **Fichas = database, Mapa = knowledge base.** No properties, table views or typed fields in Mapa | Notion's database-inside-a-page | Paul, 2026-11-12 | |
| | 4 | **Embeds go both ways.** A Fichas card or saved view can be embedded in a Mapa page, and a Mapa page in a Fichas card | One-way references only | Paul, 2026-11-12 | |
| -| 5 | **Daily notes.** Each person gets one page per day, created on first open, and today's note is the landing page | A blank "new note" as the entry point | Paul, 2026-11-12 ("I'd love to see daily notes") | |
| +| 5 | **Daily notes.** One page per person per day. Today's note is the landing page | A blank "new note" as the entry point | Paul, 2026-11-12 ("I'd love to see daily notes") | |
| | 6 | **One shared namespace per team.** `[[Acme]]` means one page for everyone in the team | Per-person namespaces with team pages layered on top | Paul leaned yes, 2026-11-12 ("Shared namespace makes sense?"); author recommends. **Confirm** | |
| -| 7 | **Only team pages hold titles in the namespace.** Private material is daily notes and untitled scratch pages. Both may link *to* team pages | Private titled pages, which either collide with a teammate's `[[Acme]]` or reveal that a private page exists by refusing the title | **Proposed** (§3.3) | |
| -| 8 | **Links point at page ids, not titles.** A rename keeps every link working, and the old title stays as an alias | Title-keyed links, which break or silently re-point on rename | **Proposed** | |
| -| 9 | **The body is Markdown. A page is a document, not an outliner.** Paragraphs and list items are addressable blocks with stable ids | A strict bullet outliner (Logseq, Roam), which makes every page a tree and every sentence a bullet | **Proposed — ask Paul** (§3.4) | |
| -| 10 | **Saves are revision-checked. There is no real-time co-editing in v1** | Docs' collaboration machinery, which is built for paginated layout and costs more than a knowledge base needs while daily notes are single-writer | **Proposed** | |
| -| 11 | **Embeds are a suite contract call, not glue between two apps.** The owning app serves a typed, structured payload for a named asker, and the embedding app renders it with a shared estilo partial (§7) | An iframe from the owning origin, which needs a session at every sibling and relaxes framing refusals. Server-rendered HTML handed between siblings, which lets one app inject markup into another | **Proposed** | |
| -| 12 | **SQLite, cgo-free (`modernc.org/sqlite`), like every sibling. Bodies are sealed. Search runs over an in-memory index rebuilt from sealed rows on wake** | A plaintext FTS5 table on disk, which puts readable passages into the replicated file (memoria `index.go`; fichas §4.1) | **Proposed** | |
| -| 13 | **Export is an Obsidian-compatible Markdown vault.** It covers the team's pages, plus the exporter's own private pages | No export; a proprietary format | **Proposed** | |
| +| 7 | **Only team pages hold titles in the namespace.** Private material is daily notes and untitled scratch pages, and both may link *to* team pages | Private titled pages, which either collide with a teammate's `[[Acme]]` or reveal that a private page exists by refusing the title | **Proposed** (§3.3) | |
| +| 8 | **A page's rung is fixed when it is created.** Sharing private writing creates a new team page from the chosen text. The private page is never re-ruled | Moving a page between rungs, which either makes its private-era revisions team-readable or needs per-revision rungs | **Proposed** (§3.4) | |
| +| 9 | **Bodies keep link text exactly as typed. Titles resolve through aliases at render** | Rewriting every linking page's body on rename, which mints revisions in pages nobody edited | **Proposed** (§3.2) | |
| +| 10 | **The body is Markdown. A page is a document, not an outliner** | A strict bullet outliner (Logseq, Roam) | Paul, 2026-11-12 ("Document sounds good") | |
| +| 11 | **Saves are revision-checked and merged by block. There is no real-time co-editing in v1** | Docs' collaboration machinery, which is built for paginated layout | **Proposed** | |
| +| 12 | **Embeds are a suite contract call, not glue between two apps.** The owning app serves a typed payload, with no markup, for a named asker. The embedding app renders it with a shared estilo partial (§7) | An iframe from the owning origin, which needs a session at every sibling and relaxes framing refusals. HTML or Markdown handed between siblings, which lets one app put markup into another | **Proposed** | |
| +| 13 | **A team container may embed only team-visible items.** This is checked when the embed is written (§7.4) | Hiding non-team embeds at render only, which cannot hide them from the editor, history, S3 or export | **Proposed** | |
| +| 14 | **SQLite, cgo-free, like every sibling. Everything that is free text or derived from free text is sealed, the link graph included. Search, backlinks and the graph live in an in-memory index rebuilt from sealed rows on wake** | Plaintext link and reference tables, which fail Fichas §4.1's test ("plaintext only where the durable file must answer without the key"), since the graph can be derived at wake | **Proposed** (§4) | |
| +| 15 | **Export is an Obsidian-compatible Markdown vault**: the team's pages, plus the exporter's own private pages | No export; a proprietary format | **Proposed** | |
| ## 2. What Mapa is, and is not |
| @@ -67,389 +70,545 @@ render time. |
| **Is not:** |
| -- **Not a database.** Decision 3. If a page grows a table of records, those |
| - records want to be Fichas cards. |
| -- **Not a publishing tool.** It paginates nothing and exports nothing but |
| - Markdown (decision 13). §9 hands a page to Docs instead. |
| -- **Not an app of record for anything it did not author.** An embed is a |
| - reference, not a copy (§7.4). The owning app decides whether to resolve |
| - it, every time. |
| -- **Never an actor.** Suite ruling 9. Mapa writes as itself only into its |
| - own tables. When a daily note is created on first open, that write names |
| - the person who opened it. |
| +- **Not a database** (decision 3). |
| +- **Not a publishing tool.** It paginates nothing and exports only Markdown. |
| +- **Not an app of record for what it did not author.** An embed is a |
| + reference. The owning app decides every time whether to resolve it. |
| +- **Never an actor** (suite ruling 9). Every write names the person who |
| + made it. |
| ## 3. The data model |
| -### 3.1 Objects |
| - |
| -- **Page:** `(id, kind, rung, owner, title?, revision, created_at, |
| - updated_at)`, with a sealed body. `kind` is `page`, `daily` or `scratch`. |
| - `rung` is `team` or `private` (§3.3). It is versioned (§5). |
| -- **Daily note:** a page with `kind = daily`, keyed `(owner, date)` and |
| - unique on that pair. It has no title in the namespace. It is displayed as |
| - the date in the owner's own time zone, and it is created on first open, |
| - never ahead of time. |
| -- **Alias:** `(page_id, title)`. Every title a team page has ever had, |
| - sealed. It resolves old links and old searches (decision 8). |
| -- **Link:** `(from_page, from_block, to_page)`. The link graph. A link to a |
| - title nobody has created yet is held as `(from_page, from_block, |
| - pending_print)`, where `pending_print` is a keyed one-way print of the |
| - normalised title. When a page takes that title, its pending links bind to |
| - it. |
| -- **Reference:** `(from_page, from_block, app, item, view?)`. It points at |
| - a sibling's item and holds no copy, title or snippet (fichas decision 5, |
| - adopted). |
| -- **Event:** `(at, actor, object, verb, revision)`. One row for every |
| - write, as in Fichas. The in-memory index and S1 (§8) are both fed from |
| - this log, so a write that logs no event is invisible to both. |
| - |
| -### 3.2 Blocks |
| - |
| -Backlinks show the lines around a mention, not just the page that contains |
| -it. That needs addressable blocks. In this design a block is a paragraph, a |
| -list item, a heading or a code fence. Each carries a stable id kept in the |
| -sealed body, so links and references can say which block they came from. |
| -Editing a block's text keeps its id. Splitting a block keeps the id on the |
| -first half. |
| +### 3.1 Objects (durable) |
| + |
| +- **Page:** `(id, kind, rung, owner, revision, created_at, updated_at)` |
| + plus a sealed record holding the title (team pages), the date (daily |
| + notes) and the Markdown body. |
| + - `kind` is `page`, `daily` or `scratch`. |
| + - `rung` is `team` or `private`, fixed at creation (decision 8). |
| + - `owner` is a member row id, as in Fichas, not an address. |
| +- **Alias:** `(page_id, sealed title)`. Every title a team page has had. |
| +- **Title print:** `(print, page_id)`, where `print` is HMAC under the |
| + instance key of the title after case- and accent-folding. It covers |
| + current titles and aliases, and is unique. It lets the durable file |
| + refuse a duplicate title without holding it (§4). |
| +- **Daily print:** `(print, page_id)`, the HMAC of `(owner, date)`, unique. |
| + It enforces one daily note per person per day without a plaintext date. |
| +- **Event:** `(id, at, actor, object, verb, revision)`, one row for every |
| + write. It feeds the in-memory index and S1 (§8). A write that logs no |
| + event is invisible to both. Gate 8 checks this. |
| + |
| +### 3.2 Derived, in memory only |
| + |
| +Rebuilt from sealed bodies on wake and kept current from the event log. |
| +None of it is written to the durable file: |
| + |
| +- **Links:** `from_page → to_page`, resolved by matching each `[[text]]` in |
| + a body against current titles and aliases. |
| +- **Pending links:** `[[text]]` that resolves to no page. |
| +- **References:** `![[app:item]]` in a body. |
| +- **Unlinked mentions:** team-page titles and aliases that appear in a body |
| + without a link. |
| +- **The search index:** titles, aliases and bodies. |
| + |
| +**What a body holds.** The link text exactly as typed: `[[Acme]]` stays |
| +`[[Acme]]` after Acme is renamed "Acme Ltd". It resolves through the alias |
| +at render. Renaming a page therefore mints a revision for that page only. |
| +Pages that link to it are untouched, which keeps doctrine §6.6's "a |
| +revision names one byte sequence for ever" true for S3 (§8). The editor |
| +offers "Update links to the new title" as an explicit, attributed edit, and |
| +never does it silently. |
| + |
| +**Blocks.** A block is a paragraph, a list item, a heading or a code fence. |
| +Backlink context is "the block that contains the link", found at render, |
| +and needs no stored id. **A block gets a stable id only when something |
| +targets it.** That uses Obsidian's syntax: a `^id` marker at the end of the |
| +block, minted when someone creates a block link (`[[Acme#^k3f9]]`) or a |
| +block embed. The marker is visible text, so it survives the scriptless |
| +textarea. Deleting the block drops it, and links to it then resolve to the |
| +page with a "block removed" note. |
| ### 3.3 Rungs, and the namespace |
| The doctrine's ladder (ruling 15) has three rungs. Mapa v1 uses two: |
| -| Kind | Default rung | Title in namespace? | Who opens it | |
| +| Kind | Rung | Title in namespace? | Who opens it | |
| |---|---|---|---| |
| -| `page` | `team` | yes, unique per team, case- and accent-folded | every member | |
| -| `daily` | `private` | no (shown as its date) | its owner | |
| -| `scratch` | `private` | no (shown as its first line) | its owner | |
| - |
| -- **The `granted` rung is not in v1.** Sharing a daily note with one |
| - colleague is a real want, but it is a third rung with its own S2 |
| - semantics, and nothing yet asks for it. Its trigger is in §12. |
| -- **A private page can be made team, and that is when it takes a title.** |
| - If the title is already taken, the person is asked to pick another or to |
| - merge into the existing page. A teammate's private material never claims |
| - a title, so a clash can never reveal that private material exists. |
| -- **Moving a team page to private is not offered.** Taking a page that |
| - others link to out of the shared namespace would break their links, and |
| - would tell them it now exists privately. Deleting it is the verb, and it |
| - goes through a confirm page. |
| -- **Backlinks are ruled per viewer.** The Acme page shows mentions from |
| - team pages to everyone, and mentions from a person's own daily or scratch |
| - notes to that person only. **It never shows a count of mentions the |
| - viewer cannot see** (fichas §9: "render nothing, and never a count"). |
| -- **Leak-list entry.** A team page's link rows record that some private |
| - page links to it, as plaintext page ids in the database file (§4). That |
| - is structure, not content, and it is stated in the README's leak list |
| - rather than hidden. |
| - |
| -### 3.4 Document or outliner? — for Paul |
| +| `page` | `team` | yes: unique per team, after folding, across titles and aliases | every member | |
| +| `daily` | `private` | no: shown as its date | its owner | |
| +| `scratch` | `private` | no: shown as its first line | its owner | |
| + |
| +- **The `granted` rung is not in v1.** Its trigger is in §12. |
| +- **Backlinks, unlinked mentions, search, autocomplete and "Create" are all |
| + ruled per viewer, and so is the order they come in** (§6.3). Every read |
| + of the in-memory index is scoped to team pages plus the viewer's own |
| + private pages. **Nothing anywhere shows a count of what the viewer cannot |
| + see** (Fichas §9). |
| + |
| +### 3.4 Verbs |
| + |
| +- **Create a team page:** any member. Its title must not match any current |
| + title or alias (title print). |
| +- **Rename:** any member. The old title becomes an alias. |
| +- **Delete:** any member, through a confirm page. Delete is the only verb |
| + that changes what teammates can open, so it is logged with its actor. The |
| + page's title and aliases are freed. Inbound `[[text]]` stays as typed and |
| + becomes pending, which is honest: the text was written by its authors and |
| + still says what they wrote. |
| +- **Free an alias:** an explicit action on the page that owns it. It frees |
| + the title for a new page, and links typed with that text become pending |
| + or rebind to the new page. Aliases otherwise reserve titles until their |
| + page is deleted. |
| +- **Share private writing:** select blocks in a daily or scratch note and |
| + choose "Make team page". This creates a **new** team page holding only |
| + those blocks, at its first revision. The private note gets a link to it |
| + in place of the moved blocks. No private-era revision ever becomes |
| + team-readable (decision 8). |
| +- **Undoing an accidental share:** delete the team page. The spec does not |
| + pretend this unshares anything: teammates may already have read it, and |
| + memoria may hold it until its feed pulls `gone`. A team page cannot be |
| + moved to private, for the same reason, and because the move would claim |
| + more than it can deliver. |
| +- **Date links:** a link whose text is a date (`[[2026-11-12]]`) is |
| + reserved. It never names a team page, and it opens **the viewer's own |
| + daily note** for that date. In a team page it means "my notes from that |
| + day" for each reader. The resolution is per viewer and reveals nothing, |
| + because each reader reaches only their own note. **Proposed.** |
| + |
| +### 3.5 Document, not outliner — ruled |
| Reflect and Obsidian are document-shaped: prose, with lists where you want |
| -them. Logseq and Roam are outliners: every line is a bullet in a tree, and |
| -blocks are the only unit. Daily notes are popular in both. |
| +them. Logseq and Roam are outliners: every line is a bullet in a tree. |
| -The author proposes **document**. Mapa's pages are meant to grow into |
| -reference material that people read, and an outliner makes reading |
| -material a tree of fragments. Blocks are still addressable (§3.2), so |
| -backlink context and block embeds are both available without forcing |
| -bullets. **This is Paul's call**, and it changes the editor more than |
| -anything else in this spec. |
| +**RULED, Paul, 2026-11-12: document** ("Document sounds good"). Mapa's |
| +pages are meant to become reference material that people read. Block links |
| +(§3.2) give the addressability outliners are loved for, without forcing |
| +bullets. |
| ## 4. The seal boundary |
| -Mapa's bodies, titles and aliases are free text, so under fichas §4's |
| -defaults they are **sealed**. The plaintext in the database file is: |
| +Under Fichas §4.1's test, plaintext is allowed only where the durable file |
| +must answer a question without the key. The complete plaintext list: |
| -- ids, kinds, rungs, owners, timestamps and revisions; |
| -- the link graph: `(from_page, from_block, to_page)` as ids; |
| -- references: `(app, item)` ids; |
| -- keyed prints: pending-link titles and the title-uniqueness check. |
| - |
| -Title uniqueness is enforced on a keyed print of the folded title, so the |
| -database can refuse a duplicate without holding the title in the clear. |
| -The print leaks equality: two pages with the same folded title are visibly |
| -the same. That is the uniqueness rule, so the leak is the point. |
| +| Column(s) | Why it must be plaintext | What it leaks | |
| +|---|---|---| |
| +| ids, `kind`, `rung` | rows must be addressable and S1/S2 must answer per rung | how many pages, daily notes and scratch pages exist | |
| +| `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 | |
| +| title prints, daily prints | uniqueness without the key | equality: two attempts at the same folded title are visibly the same. The number of aliases per page is a rename count. Prints are HMAC under the instance key, so they cannot be checked against a guessed title without that key | |
| +| ciphertext sizes | inherent | roughly how long each body is | |
| -**Search reads sealed content through the in-memory index** (decision 12), |
| -which is rebuilt from sealed rows when the instance wakes. Sealed means |
| -"not queryable by SQL against the durable file", not "not searchable" |
| -(fichas §4.1). |
| +**Sealed:** titles, aliases, dates, bodies, and so links, pending links, |
| +references and `^id` markers too. The link graph exists only in memory |
| +(decision 14). |
| ## 5. History |
| -Every write is logged with its actor (§3.1). Page bodies keep their |
| -revisions for a bounded window, and restoring a revision works inside that |
| -window, using fichas decision 2's shape. Restore produces a **new** |
| -revision. It never reissues an old one (doctrine §6.6, revision 11: a |
| -revision names one byte sequence for ever). **Revisions are random int63 |
| -values and cursors carry random nonces**, the shape Docs and Fichas adopted |
| -for revision 11. |
| +Every write is logged with its actor. Page bodies keep their revisions for |
| +a bounded window, and restore works inside it, using Fichas decision 2's |
| +shape. Restore mints a **new** revision. Revisions are random int63 values, |
| +and cursors carry random nonces (doctrine §6.6, as Docs and Fichas adopted |
| +for revision 11). |
| + |
| +**Autosave is coalesced.** One editing session, up to 2 minutes idle or |
| +leaving the page, mints one revision and one event. A keystroke pause does |
| +not. S1, memoria and the history list see edits, not pauses. |
| ## 6. The surface |
| -The rastrillo floor applies. **Every screen works with JavaScript off.** |
| -Scripts add speed, and are never a precondition. |
| +The rastrillo floor applies: **every screen works with JavaScript off.** |
| -- **Today.** `/` redirects to today's daily note. The note is created on |
| - first open by `POST` from a one-button page when scripts are off, and |
| - transparently by script. A `GET` never writes. |
| +- **Today.** `/` shows today's daily note. Until there is something to |
| + save, it is an empty editor and **no row exists**: the note is created by |
| + the first save, so a day on which nothing was written leaves no trace in |
| + S1, memoria or the database file. A `GET` never writes. |
| +- **The date and its time zone.** "Today" is in the person's own time zone: |
| + a per-person setting, defaulting to the team's time zone (an instance |
| + setting). Script offers to switch when the browser's zone differs. It |
| + never switches silently. |
| - **A page.** It shows the rendered Markdown, then backlinks grouped by |
| - source page with their context block, then "unlinked mentions" (§6.2). |
| -- **Editing.** The scriptless floor is a `<textarea>` of Markdown and a |
| - Save button, revision-checked (decision 10). Script adds: live preview, |
| - `[[` autocomplete over titles and aliases, saving on pause, and paste |
| - handling for links. A conflicting save is merged by block when the two |
| - edits touch different blocks. When they touch the same block, the second |
| - author sees both versions and chooses. Nothing is lost silently. |
| -- **⌘K.** One box that searches titles, aliases and bodies, and creates a |
| - page when nothing matches ("Create *Acme*"). Without scripts it is |
| + source page with their context block, then unlinked mentions (§6.4). |
| +- **Editing.** The scriptless floor is a Markdown `<textarea>` with a Save |
| + button, revision-checked. Script adds live preview, `[[` autocomplete, |
| + coalesced autosave (§5) and link paste. |
| +- **Conflicts.** A save against an older revision is merged three ways by |
| + block. Edits to different blocks merge silently. When two people edit |
| + the same block, the second sees both versions and chooses. Nothing is |
| + lost silently. |
| +- **⌘K.** One box over titles, aliases and bodies, offering "Create *X*" |
| + when nothing in the viewer's scope matches. Without scripts it is |
| `GET /search?q=` as a full page. |
| -- **Links.** `[[Title]]`, `[[Title|shown text]]`, and `[[Title#block]]` for |
| - a block. A link to a missing page renders as a pending link, and |
| - following it offers to create the page. |
| -- **Embeds.** `![[fichas:…]]` and friends (§7.3) render as cards in the |
| - page. |
| -- **Calma.** estilo's theme and the Oficina door for sign-in. Icons are |
| - the only colour. |
| +- **Links.** `[[Title]]`, `[[Title|shown text]]`, `[[Title#^id]]`. A |
| + pending link renders as one, and following it offers to create the page. |
| +- **Embeds.** `![[fichas:…]]` and friends (§7). A page that embeds is |
| + served `no-store`. |
| +- **Calma**, and the Oficina door for sign-in. |
| -### 6.1 Search must be fast — numbers, not adjectives |
| +### 6.1 Search speed — targets, and what they rest on |
| -| Measure | Target | Precedent | |
| -|---|---|---| |
| -| Server time per typeahead query, at 10,000 pages | p95 ≤ 5 ms | Fichas measured 0.37 ms per search over 15,000 records | |
| -| Keystroke to results painted, warm instance, same region | p95 ≤ 100 ms | | |
| -| Cold wake to first search answered | ≤ 1 s at 10,000 pages | Fichas measured 225 ms cold load at 15,000 records | |
| +| Measure | Target | |
| +|---|---| |
| +| Server time per typeahead query, at 10,000 pages | p95 ≤ 5 ms | |
| +| Keystroke to results painted, warm, same region | p95 ≤ 100 ms | |
| +| Cold wake to first search answered, at 10,000 pages | **unmeasured.** Target ≤ 2 s, to be confirmed by gate 6 before it is promised | |
| + |
| +**What the precedents measured, exactly.** Fichas commit `9179761` |
| +measured, at 5,000 customers with 10,000 calls, a 225 ms cold load once per |
| +wake, and 0.37 ms for a search with a filter and a sort. Those are short |
| +structured fields matched by substring, not ranked search over prose. |
| +memoria §7.2 measured 6.8 s to build its index at 90,000 chunks. That is |
| +the closer precedent for prose, and the reason the cold-wake number is |
| +marked unmeasured rather than borrowed. |
| + |
| +### 6.2 Ranking |
| -The in-memory index is fed by the event log, like Fichas' `index.go`. |
| Titles and aliases are prefix-matched and rank first. Bodies are matched by |
| -term, ranked on BM25-style scores, and boosted by backlink count. Gates |
| -measure these targets in CI at the stated size (§11), so they are tested |
| -claims, not hopes. |
| +term and ranked BM25-style. **Every statistic a ranking uses is computed |
| +over team pages only:** document frequencies, the backlink boost and the |
| +average length. A viewer's own private pages are scored against those |
| +team-only statistics. So nobody's private writing can change the order of |
| +anybody else's results, including the viewer's own. |
| + |
| +### 6.3 What the viewer's scope covers |
| -### 6.2 Unlinked mentions |
| +Every read of the in-memory index is scoped to team pages plus the viewer's |
| +own private pages. That covers search results and their order, ⌘K's |
| +"Create" offer, `[[` autocomplete (team titles and aliases, and the |
| +viewer's own pending link texts only), backlinks, unlinked mentions and any |
| +future graph view. Gate 1 checks this. |
| -A page's text that matches another team page's title or alias, but is not |
| -linked, is shown on the target page as "Mentioned without a link", with a |
| -one-click "Link it". Every serious note tool has this, and it is how a |
| -knowledge base links itself up after the fact. The matching is computed |
| -from the in-memory index and is never stored. It follows the same |
| -per-viewer rule as backlinks. |
| +### 6.4 Unlinked mentions |
| + |
| +Text in a page that matches a team page's title or alias without linking to |
| +it shows on the target page as "Mentioned without a link", with "Link it". |
| +It is computed in memory, never stored, and scoped per viewer (§6.3). |
| ## 7. Embeds: a suite contract call (proposed revision 12) |
| ### 7.1 What has to be true |
| -1. **The viewer, not the embedding app, decides what shows.** An embedded |
| - Fichas card renders only if the person looking may open it in Fichas, |
| - checked at that moment. |
| -2. **"Not visible" renders nothing and never a count** (fichas §9). A page |
| - with three embeds, one of which the viewer may not open, shows two. It |
| - does not show a locked box. |
| -3. **An unavailable sibling is loud** (doctrine §6.3). "Fichas did not |
| - answer", naming the app, with a retry link. It is never silently empty. |
| -4. **No copy at rest.** The embedding app stores the reference only. Embed |
| - content is never written to its database and never enters its search |
| - index, or search would leak what the embed hides. |
| -5. **Scriptless.** The page renders with its embeds server-side. |
| -6. **No markup crosses apps.** One app never hands another app HTML to |
| - insert. |
| - |
| -### 7.2 The call |
| - |
| -**S9 embed:** sibling → sibling, consumer token **+ named asker**, which is |
| -S2's credential shape (ruling 8). S4 and S5 are not reserved (doctrine §6), |
| -and S7 and S8 are taken, so the next free number is S9. |
| - |
| -- **Request:** `(item, view?, asker)`, batched with a cap of 32 per call. |
| -- **Response:** one result per item, using S2's four values. `VISIBLE` |
| - carries a typed payload. `NOT_VISIBLE` carries nothing. `STALE` and |
| - `UNKNOWN` carry nothing and are rendered loudly. |
| -- **Payload: structured, not HTML.** It is one of a small closed set of |
| - shapes in the suite module, each with a strict decoder: |
| - - **`card`**: a title, up to 12 `(label, value, kind)` fields, the last 3 |
| - entries `(kind, actor, at, excerpt)`, and an open-in-app URL. |
| - - **`list`**: a title, column labels, up to 25 rows of cells plus a row |
| - URL, `more: bool`, and an open-in-app URL. Rows are already ruled for |
| - the asker, per row, by the owning app (fichas §9: a card differs per |
| - viewer). |
| - - **`page`**: a title, up to 40 blocks of a restricted Markdown subset |
| - (paragraph, heading, list, quote, code, link), `more: bool`, and an |
| - open-in-app URL. Embeds inside an embedded page are not expanded: |
| - embeds go one level deep, so cycles cannot happen. |
| -- **Never cached.** The S2 rule carries over: a payload crosses no request |
| - boundary. The embedding app fetches on every render, concurrently, with |
| - one deadline for the whole page (proposed 400 ms). Anything past the |
| - deadline is `UNKNOWN`. |
| -- **URLs in a payload are checked.** The suite client refuses any URL whose |
| - `<team>` label differs from its own, using the existing hostile-hosts |
| - fixture (doctrine §4.1). |
| -- **Rendering is one estilo partial per shape.** A Fichas card therefore |
| - looks the same inside Mapa as it does inside Fichas' own lists. |
| - |
| -**Why a named asker is acceptable here.** Doctrine §6.1's reasoning holds |
| -unchanged. A same-team sibling can already read every live item through |
| -S3 since revision 10, so naming the asker adds nothing to what it can read. |
| -S9 only lets the owning app say *less* than S3 would, by ruling per person. |
| - |
| -### 7.3 Syntax and storage |
| - |
| -`![[fichas:<item-id>]]` embeds a card, and `![[fichas:view/<view-id>]]` |
| -embeds a saved view. Pasting an Oficina item URL into the editor offers to |
| -turn it into an embed. Each embed is stored as a Reference row (§3.1), so |
| -"what does this page embed" is a query and not a parse. |
| - |
| -The reverse direction is the same call served by Mapa. A Fichas card holds |
| -a reference to a Mapa page and asks Mapa's S9 for a `page` payload for the |
| -viewer. |
| - |
| -### 7.4 At-rest knowledge |
| - |
| -A team page that embeds a card the viewer may not open still records, in |
| -Mapa's database file, that the reference exists. Fichas §9 left this |
| -unresolved for its own references, and it is the same problem here. Since |
| -revision 10 a sibling holds every live item anyway, so this is not a new |
| -class of exposure. It goes in the leak list. |
| - |
| -### 7.5 What it needs from Fichas |
| - |
| -- **Saved views** for `list` embeds. Fichas' list state already lives in |
| - the URL (`list.go`), so a saved view is a named, stored copy of that |
| - state, per card type, with an id. Open questions for Paul are in §13. |
| - **It must not be built while `feat/level-up` is in flight** (as of |
| - 2026-11-12, about 4,600 uncommitted lines in `../fichas-level-up` |
| - touching the same handlers and templates). |
| -- **An S9 server half for `card` and `list`.** |
| +1. **The viewer decides what shows.** An embed renders only if the person |
| + looking may open the item in its own app, checked at that moment. |
| +2. **Not visible renders nothing, and never a count** (Fichas §9). |
| +3. **An unavailable sibling is loud** (doctrine §6.3): "Fichas did not |
| + answer", naming the app, with a retry link. |
| +4. **No copy at rest.** Embed content is never written to the embedding |
| + app's database and never enters its index. |
| +5. **Scriptless.** Embeds render server-side. |
| +6. **No markup crosses apps.** Payloads are typed data. The receiver parses |
| + nothing. |
| + |
| +### 7.2 Numbering |
| + |
| +**S10.** S4 and S5 are not calls (doctrine §6). S7 is retired (doctrine |
| +§6). S8 is write-as-self. **S9 is reserved** by the cross-rung reach draft |
| +(suite `design/cross-rung-reach`, `2026-09-19-cross-rung-reach-draft.md` |
| +§5, `RouteS9 = "/suite/s9"`) and by Fichas §6 ("S9 (reach) depends on an |
| +unresolved ruling"). This spec does not ask for that draft to be withdrawn. |
| + |
| +### 7.3 The call |
| + |
| +**S10 embed:** sibling → sibling, consumer token **+ named asker**, which is |
| +S2's credential shape (ruling 8, doctrine §6.1). |
| + |
| +- **Request:** up to 32 `(item, view?)` pairs plus one asker. |
| + - **The asker's subject kind:** `address` while either side is lone |
| + shape. Fichas answers `UNKNOWN` to every `person_ref` (Fichas §6.3). |
| + `person_ref` arrives with the home's identity layer. |
| + - **A view** is a named object in the owning app (§7.6), not an S1 item. |
| +- **Response:** one result per pair, with **three** values. There is no |
| + revision in an embed, so `STALE` does not apply (doctrine §6.6 defines it |
| + against an asked revision). |
| + - `VISIBLE` carries a payload. |
| + - `NOT_VISIBLE` carries nothing. It covers an unknown or deleted item or |
| + view, and one the asker may not open. |
| + - `UNKNOWN` carries nothing and is rendered loudly. |
| +- **Payloads** are a closed set of typed shapes in the suite module, each |
| + with a strict decoder and size caps. **None contains HTML or Markdown |
| + source:** |
| + - **`card`:** a title, up to 12 `(label, value, kind)` fields, the last 3 |
| + entries `(kind, actor, at, text)`, an app URL, and `team_visible: bool` |
| + (§7.4). |
| + - **`list`:** a title, column labels, up to 25 rows of `(cells, app |
| + URL)`, `more: bool`, an app URL, and `team_visible`. **The rows, the |
| + 25-row cut and `more` are computed over rows the asker may open,** |
| + after ruling, so `more` is never a signal that unseen rows exist. In |
| + Fichas today every member sees every card (Fichas §6.1), so the per-row |
| + rule is vacuous there and binding for any app with a ladder. |
| + - **`page`:** a title, an app URL, `team_visible`, `more: bool`, and up |
| + to 40 **typed blocks**: `heading(level, spans)`, `paragraph(spans)`, |
| + `list(ordered, items[spans])`, `quote(spans)`, `code(text)`. A span is |
| + `text`, `emphasis`, `strong`, `code` or `link(spans, url)`. Embeds |
| + inside an embedded page are not expanded: one level only, so cycles |
| + cannot happen. |
| +- **Two classes of URL, checked differently by the receiver's suite |
| + client:** |
| + - **App URLs** (every "open in app" and row URL) must be `https`, with |
| + no userinfo, and a host exactly |
| + `<own team>.<answering app>.oficina.works`. |
| + - **Author links** inside page spans may be `http` or `https` only. Every |
| + other scheme (`javascript:`, `data:` and the rest) is refused by the |
| + decoder. They render with `rel="noopener noreferrer"`. They are not |
| + team-checked, because a person may link anywhere. |
| + - Both classes get hostile fixtures beside `hostile_hosts.json`. |
| +- **Never cached.** A payload crosses no request boundary. **Doctrine §6.4 |
| + is amended** by this proposal: "any passage shown to a person without an |
| + S2 `VISIBLE` **or an S10 `VISIBLE`** for that person in the same |
| + request". |
| +- **Deadline and wake.** One deadline per page render, concurrent across |
| + siblings. It starts at **800 ms**, doctrine §14's unmeasured default, and |
| + is to be tuned by measurement. The embedding app **pre-warms** the |
| + siblings it embeds from when it wakes (doctrine §6.3), or the first |
| + render after idle would always say "did not answer". A page with more |
| + than 32 embeds makes several concurrent calls. Past 64 embeds, the rest |
| + render as plain links. |
| +- **Rendering:** one estilo partial per shape, so a Fichas card looks the |
| + same inside Mapa as inside Fichas. |
| + |
| +**What S10 adds to a consumer token, stated plainly:** a holder of a |
| +consumer token can already read every live item through S3 since revision |
| +10. S10 adds **rendered, per-person views**: entry actors and times, which |
| +Fichas' S3 body omits (Fichas §6.4), and saved views with their names and |
| +columns. That goes in the suite leak list (doctrine §9) as a revision-12 |
| +entry. It is not presented as "says less than S3". |
| + |
| +### 7.4 Team containers embed only team-visible items |
| + |
| +Hiding a non-team embed at render cannot hide it everywhere. The reference |
| +string sits in a team page's Markdown, which every member opens in the |
| +editor, and it is in history, S3 and export. So the rule applies when the |
| +embed is written: |
| + |
| +- **The embedding app asks S10 for the writer**, and reads `team_visible` |
| + from the payload. A writer who gets `VISIBLE` may open the item, so |
| + learning whether it is team-visible tells them nothing new. |
| +- **If the container is team-visible and the item is not, the embed is |
| + refused** with a plain message. A private daily note may embed anything |
| + its owner can open. |
| +- **Fichas → Mapa:** every Fichas card is team-visible (Fichas §6.1), so a |
| + card's reference field may reference **team Mapa pages only**. The |
| + picker offers no private pages, and S10's `team_visible` refuses them on |
| + save. A teammate therefore never sees an empty reference field, or |
| + history naming a change to one, that points at someone's private note. |
| +- **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 |
| + nothing. The string is an id. It is never a title or content. |
| + |
| +### 7.5 The reverse direction |
| + |
| +A Fichas card holds a reference to a Mapa page and asks Mapa's S10 for a |
| +`page` payload for the viewer. Mapa answers `VISIBLE` for a team page to |
| +any member, and `NOT_VISIBLE` for a deleted page. Given §7.4, a private |
| +page never appears there. |
| + |
| +### 7.6 What it needs from Fichas |
| + |
| +- **Saved views,** for `list` embeds. List state already lives in the URL |
| + (`list.go`), so a view is a named, stored copy of that state per card |
| + type, with an id. **Both personal and team views** (Paul, 2026-11-12: |
| + "should be both"). A personal view is visible to its owner only, so S10 |
| + answers `NOT_VISIBLE` for it to anyone else, and §7.4 means a team Mapa |
| + page may embed only a team view. One question is still open (§13). **It waits until |
| + `feat/level-up` merges** (as of 2026-11-12, `9976eb1`, one commit ahead |
| + of `origin/main`), because it touches the same handlers and templates. |
| +- **An S10 server half for `card` and `list`.** |
| - **A reference field kind** on cards, for the reverse direction. This |
| overlaps the "link to another card" field already open with Paul. |
| -### 7.6 Mentions across apps (later) |
| +### 7.7 Mentions across apps (later) |
| -A Fichas card showing "Mentioned in 4 Mapa pages", with the lines around |
| -each mention, is arguably worth more than embeds, because it needs no |
| -deliberate act. It would be a second call: Mapa answers "which blocks |
| -visible to this asker reference item X". It is held to slice 3 so that S9 |
| -is proved first. |
| +A Fichas card showing "Mentioned in 4 Mapa pages", with context. This is a |
| +second call: Mapa answers which team blocks reference item X. It is held to |
| +slice 3, so S10 is proved first. |
| ## 8. memoria |
| -Mapa serves the suite contract's producer half, S1, S2 and S3, from |
| -**slice 1**, using the suite module's `RunProducer` and the conformance |
| -harness in CI, as Docs and Fichas do at revision 11. |
| - |
| -- **S1 lists every live page,** daily and scratch pages included (revision |
| - 10: "hold private too, check per person"). `gone` means deleted. |
| -- **S2 is Mapa's own read check:** `team` → every member; `private` → its |
| - owner. |
| -- **S3 serves the page as Markdown, with its title.** Embeds are rendered |
| - as their reference string and never expanded. memoria gets Fichas |
| - content from Fichas, ruled by Fichas. |
| -- **Egress follows doctrine §8 unchanged.** Private pages are not embedded |
| - for semantic recall until Paul rules on doctrine §14. memoria finds them |
| - by their own words only, and says so. |
| -- **Later, not in the contract today:** S3 could carry outbound links, so |
| - memoria can rank by the link graph and use pages like `[[Acme]]` as |
| - anchors for answers. It is a proposal for a later suite revision, and |
| - nothing in slice 1 waits on it. |
| +Mapa serves the producer half, S1, S2 and S3, from **slice 1**. |
| + |
| +- **S1** lists every live page, daily and scratch included (revision 10). |
| + `gone` means deleted. Rows come from the event log, coalesced as in §5. |
| +- **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 the title (team pages) and the body **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. |
| +- **A removed member's private pages.** Doctrine §14 asks Paul whether |
| + ownership survives removal. Until he rules, gate 5's interim reading |
| + binds: a removed person holding no other grant gets `NOT_VISIBLE`, and |
| + that includes their own daily notes. Mapa keeps the rows: it decides |
| + nothing about deletion before the ruling. An app-side test removes a real |
| + member and asserts this, as doctrine §4.3 requires. |
| +- **Egress** follows doctrine §8 unchanged. Until Paul rules, private pages |
| + are not embedded for semantic recall. memoria finds them by their own |
| + words only, and says so. |
| +- **Conformance.** Mapa uses `conformance.CheckProducer` with pinned |
| + expectations, as Fichas does (Fichas §6.7). Mapa has two rungs and no |
| + grants, guests or links, so the fixture's nine cases cannot all be |
| + represented. Expected: |
| + |
| + | Case | Mapa | Expected | |
| + |---|---|---| |
| + | `doc-team`, `doc-deleted` | team page; deleted page | passes | |
| + | `doc-private` (owned by the asker) | private page owned by the asker | passes, **by design** (unlike Fichas) | |
| + | `doc-granted` | no grants | **pinned failure**: Mapa answers `NOT_VISIBLE` where the fixture wants `VISIBLE` | |
| + | `doc-guest` | no guests | depends on how the adapter seeds it. Recorded when built | |
| + | `doc-team-link`, `doc-link`, `doc-link-added-late` | no link capability | the team case passes. The link cases depend on seeding, recorded when built | |
| + | `doc-was-team` | team → private refused (§3.4) | **pinned failure** | |
| + |
| + The final table is written from the running harness when the producer is |
| + built, as Fichas §6.7 was, and sent to the suite as evidence. |
| +- **Later, not in the contract today:** outbound links in S3, so memoria |
| + can rank by the link graph. |
| ## 9. Promote to Doc (later) |
| -"Promote to Doc" creates a Docs document from a team page's Markdown, using |
| -Docs' Markdown import, through the person's own session: the doctrine §7.1 |
| -hand-off, not a sibling write. The Mapa page keeps a reference to the new |
| -document and says it was promoted. The page is not deleted: the thinking |
| -stays in Mapa and the published version lives in Docs. |
| +This creates a Docs document from a team page's Markdown through the |
| +person's own session: the doctrine §7.1 hand-off, not a sibling write. The |
| +Mapa page keeps a reference to the new document. The thinking stays in |
| +Mapa, and the published version lives in Docs. |
| ## 10. Where things live |
| -- Repository: `amadan.net/oficina/mapa`, to be created on the hub when |
| - Paul approves this spec. |
| -- CARLOS: app `mapa`, account `bds`, channel `edge`. Lone shape first, as |
| - Fichas did. The canonical origin is `mapa.oficina.works`, and team |
| - instances follow `teams/provision-team.py`. |
| -- Framework: rastrillo, from the current module path. Not the frozen |
| - `github.com/carlosframework` path (see the busy-rule and rastrillo-path |
| - rollouts). |
| -- Sign-in: the Oficina door, from estilo. The keymail continuation page is |
| - ported from Docs' `auth_navigation.go` from the first commit, because |
| - every new app has hit that CSP trap. |
| +- **Repository:** `amadan.net/oficina/mapa`, created on the hub when Paul |
| + approves this spec. Until then, a local repository only. |
| +- **CARLOS:** account `oficina`, sqid `bds`, app `mapa`, channel `edge` |
| + (`teams/provision-team.py`). |
| +- **Host form: a prerequisite, and Paul's.** The suite client accepts only |
| + `<team>.<app>.oficina.works` (`CheckSiblingHost`), and |
| + `hostile_hosts.json` refuses bare `docs.oficina.works`. Paul's own |
| + instances serve bare hosts today (`fichas.oficina.works`), so no sibling |
| + call can reach them. This is the same question already waiting on Paul |
| + for the memoria hookup: **his team's label.** Mapa launches on |
| + `<label>.mapa.oficina.works` from day one, with bare `mapa.oficina.works` |
| + redirecting to it. Fichas needs the same before S10 can work, and both |
| + apps join `provision-team.py`'s `APPS` (Fichas is not in it today). |
| +- **Framework:** rastrillo at its current module path. Sign-in is the |
| + Oficina door, with Docs' `auth_navigation.go` keymail continuation ported |
| + from the first commit. |
| ## 11. Testing gates |
| -The suite conformance harness for S1/S2/S3 runs in CI from slice 1, and |
| -for S9 from slice 2. On top of that: |
| - |
| -1. **Per-viewer backlinks.** A private daily note linking to a team page |
| - shows on that page for its owner and for nobody else. The other viewer |
| - sees no count, no gap and no placeholder. |
| -2. **Title collision cannot reveal anything.** Making a private page team |
| - with a title that exists asks to merge. No path lets a private page |
| - claim a title. |
| -3. **Renames keep links.** After renaming, every old link and every old |
| - `[[Old title]]` typed afterwards resolves to the page. |
| -4. **The plaintext gate.** Dump the database file. No title, body, alias or |
| - embed payload appears in the clear. This is Fichas' gate, ported. |
| -5. **Embed rules** (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 their own embeds. |
| -6. **Search speed at size.** A 10,000-page synthetic fixture. The §6.1 |
| - targets are asserted, not printed. |
| +The suite conformance harness (S1/S2/S3) runs in CI from slice 1, and S10 |
| +from slice 2. On top of that: |
| + |
| +1. **Scope leaks nothing.** Bo's search results, their order, ⌘K's Create |
| + offer, `[[` autocomplete, backlinks and unlinked mentions are |
| + **byte-identical** whether or not Ana's private notes contain the term, |
| + link to the page, or hold a pending link with that text. A mutation |
| + test proves the gate fails when one scope check is removed. |
| +2. **Titles cannot reveal anything.** No path lets a private page claim a |
| + title. "Make team page" with a taken title asks for another. |
| +3. **Renames keep links and keep revisions honest.** After renaming B, |
| + every `[[Old]]` resolves to B. Page A's revision and S3 bytes are |
| + unchanged. |
| +4. **The plaintext gate.** Dump the database file. No title, alias, date, |
| + body, link, reference or `^id` appears in the clear, and the plaintext |
| + columns are exactly §4's list. This is Fichas' gate, ported. |
| +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. |
| +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, |
| - save and conflict with JavaScript disabled, then again enabled, and |
| - fails loudly on any console error. |
| -8. **Event completeness.** Every write path is checked to log an event, |
| - with a mutation test proving the check works. |
| + save and conflict with JavaScript off, then on, and fails on any console |
| + error. |
| +8. **Event completeness.** Every write path logs an event, with a mutation |
| + test. |
| +9. **A removed member** (§8). Removing a real member makes their private |
| + pages `NOT_VISIBLE` to them through S2. |
| +10. **No trace of an unwritten day.** Opening today's note and leaving |
| + without saving creates no row, no event and no S1 entry. |
| ## 12. Deliberately not built |
| | Thing | Trigger | |
| |---|---| |
| -| Real-time co-editing | Two people editing one team page at once, in real use, often enough that block-merge conflicts annoy | |
| +| Real-time co-editing | Same-block conflicts annoying people in real use | |
| | The `granted` rung | Someone asks to share a daily or scratch note with one colleague | |
| -| Properties, tables, typed fields | Never in Mapa. Decision 3: they are Fichas | |
| -| Graph view | The knowledge base has enough pages that a map tells you something a backlink list does not | |
| -| Folders | Never as the primary structure. Links and search are the structure | |
| -| Public publishing of pages | A real need to publish. Docs is the publishing path first | |
| +| Properties, tables, typed fields | Never in Mapa (decision 3) | |
| +| Graph view | Enough pages that a map tells you something a backlink list does not | |
| +| Folders | Never as the primary structure | |
| +| Public publishing | A real need. Docs is the publishing path first | |
| | Plugins | Never as a general mechanism | |
| -| Import from Obsidian, Reflect, Notion | Paul has a vault to bring. Markdown with `[[links]]` makes Obsidian import cheap | |
| +| Import from Obsidian, Reflect, Notion | Paul has a vault to bring | |
| | Native Mac app | The web app has been lived in | |
| -| AI: "summarise my week", suggested links | After memoria's AI answer has been lived with. Doctrine §8 governs every byte of it | |
| +| AI features | After memoria's AI answer has been lived with. Doctrine §8 governs it | |
| ## 13. Open — for Paul |
| -1. **Document or outliner** (§3.4)? The author proposes document. |
| +1. ~~Document or outliner~~ **Ruled: document** (Paul, 2026-11-12). |
| 2. **Confirm the shared namespace** (decision 6), and that **only team |
| pages hold titles** (decision 7). |
| -3. **Saved views in Fichas:** personal, team, or both? And when a card type |
| - changes, does a view that filters on a removed field break loudly or drop |
| - the filter? The author proposes team views, and breaking loudly. |
| -4. **A Fichas reference field** (§7.5): is it the same thing as the "link |
| - to another card" field already open with you, generalised to any |
| - Oficina item? |
| -5. **Slice 1 without embeds** (§14): acceptable, given that embeds need |
| - Fichas work that cannot start until `feat/level-up` lands? |
| +3. **Your team's label** (§10). It is the same question as the memoria |
| + hookup, and Mapa needs it before launch. |
| +4. **Saved views in Fichas.** ~~Personal, team, or both?~~ **Ruled: both** |
| + (Paul, 2026-11-12). Still open: when a field a view filters on is |
| + removed, does the view break loudly or drop the filter? The author |
| + proposes breaking loudly. |
| +5. **A Fichas reference field** (§7.6): is it the same thing as the "link |
| + to another card" field already open, extended to any Oficina item? |
| +6. **Date links open your own daily note** (§3.4): yes? |
| +7. ~~Slice 1 without embeds~~ **Ruled: yes** (Paul, 2026-11-12: "makes |
| + sense"). |
| ## 14. Slices |
| -**Slice 1: a knowledge base someone can live in.** |
| -1. The repo, rastrillo scaffold, schema, seal, event log and plaintext |
| +**Slice 1: a knowledge base someone can live in.** No embeds: Paul ruled |
| +on 2026-11-12 that slice 1 ships without them. |
| +1. The repo, rastrillo scaffold, schema, seal, event log and the plaintext |
| gate. |
| -2. Team pages, the shared namespace, aliases, `[[links]]`, backlinks with |
| - context, and pending links. |
| -3. Daily notes and scratch pages, both private. |
| -4. The in-memory index, ⌘K, the search page, and gate 6's speed fixture. |
| -5. The scriptless editor, then the script layer: preview, `[[` |
| - autocomplete, autosave, block-merge on conflict. |
| -6. The S1/S2/S3 producer half and the conformance harness. Wire it to |
| - memoria behind the same hookup Paul is still to approve for Docs and |
| - Fichas. |
| +2. Team pages, the shared namespace, aliases, `[[links]]`, backlinks, |
| + pending links, and the §3.4 verbs. |
| +3. Daily notes and scratch pages. "Make team page". |
| +4. The in-memory index with per-viewer scope, ⌘K, the search page, and |
| + gates 1 and 6. |
| +5. The scriptless editor, then the script layer. |
| +6. The S1/S2/S3 producer half with pinned conformance. Wire it to memoria |
| + once Paul approves the hookup and gives the team label. |
| **Slice 2: embeds.** |
| -1. Suite revision 12: S9, its fixtures, and estilo's three partials. |
| -2. Fichas: saved views (after `feat/level-up` lands), the S9 server half, |
| - and the reference field. |
| -3. Mapa: embeds of Fichas cards and views, and the S9 server half for |
| - pages. |
| +1. Suite revision 12: S10, its fixtures, the doctrine §6.4 amendment, the |
| + leak-list entry, and estilo's three partials. |
| +2. Fichas: the team label and provisioning (§10). Saved views after |
| + `feat/level-up` merges. The S10 server half and the reference field. |
| +3. Mapa: embeds of cards and views, the S10 server half for pages, and |
| + pre-warm. |
| 4. Fichas: embedded Mapa pages on cards. |
| -**Slice 3:** mentions across apps (§7.6), unlinked-mention linking at |
| -scale, Promote to Doc (§9), and Markdown vault export (decision 13). |
| +**Slice 3:** mentions across apps (§7.7), Promote to Doc (§9), and vault |
| +export (decision 15). |
| + |
| +--- |
| + |
| +## Appendix A — revision 2's answers to the Fable review of revision 1 |
| + |
| +| Finding | Answered in | |
| +|---|---| |
| +| H1: S9 reserved, S7 retired | §7.2: S10 | |
| +| H2: search, ranking and Create unscoped | §6.2, §6.3, gate 1 | |
| +| H3: non-team embeds visible in source, history, S3 and export | decision 13, §7.4, §7.5 | |
| +| H4: Markdown and URLs crossing apps | decision 12, §7.3 typed blocks and two URL classes | |
| +| H5: bare hosts fail `CheckSiblingHost`; subject kind | §10, §13 item 3, §7.3 subject kind | |
| +| M1: four values without a revision | §7.3: three values | |
| +| M2: "says less than S3" false | §7.3: "What S10 adds", leak-list entry | |
| +| M3: per-row citation; `more` | §7.3 `list` | |
| +| M4: S3 bytes under rename | decision 9, §3.2, §8, gate 3 | |
| +| M5: custody fixture cases | §8 conformance table | |
| +| M6: removed owner | §8, gate 9 | |
| +| M7: plaintext list incomplete; plaintext graph | decision 14, §3.1, §3.2, §4, gate 4 | |
| +| M8: unspecified verbs | decision 8, §3.4, §6 time zone | |
| +| M9: block ids under a textarea | §3.2 `^id` markers | |
| +| L1: precedent numbers | §6.1 | |
| +| L2: memoria citation | §0, decision 1: Fichas decision 1 | |
| +| L3: unused rulings cited | header | |
| +| L4: ordinal | decision 1 | |
| +| L5: account | §10 | |
| +| L6: level-up stale | §7.6 | |
| +| L7: deadline, pre-warm, caps, no-store | §7.3, §6 | |
| +| L8: creation on open, autosave churn | §5, §6, gate 10 | |
| +| L9: doctrine §6.4 | §7.3 | |