oficina / memoria Public

Spec §8.14: the front page, the typeahead, /documents, and team mode on them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 95f7ad29bee23ecf5e6ef34589e18b9ef3ab252a parent 1797579
1 file changed, +48 −2
  • docs/superpowers/specs/2026-09-03-memoria-design.md +48 −2
diff --git a/docs/superpowers/specs/2026-09-03-memoria-design.md b/docs/superpowers/specs/2026-09-03-memoria-design.md
index 8cba20a..12d7f12 100644
--- a/docs/superpowers/specs/2026-09-03-memoria-design.md
+++ b/docs/superpowers/specs/2026-09-03-memoria-design.md
@@ -4656,6 +4656,47 @@ harmless; under it, that page would have shown one person another's
private document. It was found by reading the page against the ruling,
before any sibling served memoria.
+### 8.14 The front page and the typeahead (Paul, 2026-10-29 – 10-31)
+
+Paul asked for search "a bit more like Google with a simple search box in
+the middle", then for "Google-style typeahead and then press enter to jump
+to the search page where it gives an answer". What was built:
+
+- **`GET /` with no query is a search box and nothing else**, centred, no
+ logo. Under it: the person's **recent searches**, kept in that browser's
+ `localStorage` only (memoria stores no query server-side, gate 4);
+ **"Recently updated"**, five documents this person may see (§8.13); and
+ **"Try"** chips built from memoria's own documents (`trysuggest.go`,
+ recomputed at most every `TryTTL`, 10 minutes). A page loaded *with* a
+ query is the results page, as before.
+- **`GET /suggest?q=`** is the typeahead: `Store.SearchWhileTyping` (the
+ keystroke search — §4.1's ruling, §8.8's box, the last word a prefix),
+ reduced to one row per document, at most `MaxSuggestions` (6), plus the
+ box's single checked fact when there is exactly one and it is not a
+ guess, with a Copy button and ⌘C/Ctrl+C. **A keystroke never runs §8.9's
+ model step or §8.11's AI answer**; nothing found is a 204. Enter submits
+ the form; Enter on a highlighted suggestion opens it.
+- **Live search is retired.** The results region no longer changes as the
+ box is typed into: the AI answer is asked for once, by the results page,
+ for the query that page was rendered for (`rst-search-results-for`), and
+ a new search is a new page. The live-search machinery went with it
+ (`rst-search-status`, the stale-note attribute, the pending-zero rule).
+ `GET /search` is still served and tested, but nothing in the browser
+ calls it now — whether to remove it is open (§13).
+- **`GET /documents`** is the document list that used to sit under the
+ box, with Add content and Delete; **`GET /documents/{id}`** renders each
+ passage as a page on a card (`renderPassage`: escaped first, then
+ headings, properties, tables and bare http(s) links — no other scheme).
+- **Whole rows open** what they link to (rastrillo's list row on the front
+ page, `rst-click-row` on the table), and a **clear** link replaces the
+ browser's own ✕, which emptied the box but left the results.
+
+**Team mode** (§4.3 "Roster team mode", merged 2026-11-02): `/documents`
+is a list route — `teamReaches` before it lists, `teamPartial` after,
+the partial notice when standing is Unknown — and `/suggest` needs
+Member and answers 204 if standing lapsed while it searched. The front
+page's lists are inside the index's own pair and `withhold` clears them.
+
## 9. Surfaces
### 9.1 What memoria exposes
@@ -4686,7 +4727,8 @@ branch and stopped being true on merge. The list stays written down
anyway, because a gate read from a list that matches the app is worth
more than one read from memory:
-`GET /`, `GET /search`, `GET /documents/{id}`, `POST /documents`,
+`GET /`, `GET /search`, `GET /suggest` and `GET /documents` (§8.14),
+`GET /documents/{id}`, `POST /documents`,
`GET` and `POST /documents/{id}/delete` (the GET asks before the POST
deletes), the connector routes under `/connectors/…`, public
`GET /help/open-source`, `POST /appearance` (the shared chrome's
@@ -4704,7 +4746,8 @@ that live search can replace that region on a keystroke. It is a
narrower surface than the page, under the same session gate, and it adds
no passage the page did not already speak. It is not a second query
surface and not a step toward one; delete the script and nothing calls
-it.
+it. *(Since 2026-10-29 nothing calls it either way: the typeahead replaced
+live search, §8.14.)*
**A hand-off whose sources include memoria-owned material is refused, and
that is a real product cost.** Suite §7 lets a person hand an artefact to
@@ -5623,6 +5666,9 @@ unfiled), and **§8.9's constraints and kind list** (what replaced
decision 15's scope when Paul ruled on it). **Nothing else here is a
ruling; the rest is work, measurement or somebody else's repo.**
+ - **`GET /search` has no caller since the typeahead (§8.14).** Work,
+ not a ruling: remove it with its tests, or keep it as the scriptless
+ page's fragment twin. Kept for now so the merge changed one thing.
- **§8.11's AI answer is named by "AI" only, by Paul (2026-10-27)**,
narrowing decision 4's "named on every answer" for that one surface;
the provider stays in the heading's title and the footer. Recorded