oficina / memoria Public

Spec §8.11 amendments and §8.12: AI label, formatting, feedback, cache, kind words (Paul, 2026-10-27)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 2763ad51f1dcd8d688aa4998d13a31ef18545373 parent 521ae24
1 file changed, +108 −0
  • docs/superpowers/specs/2026-09-03-memoria-design.md +108 −0

CI passed — run details

diff --git a/docs/superpowers/specs/2026-09-03-memoria-design.md b/docs/superpowers/specs/2026-09-03-memoria-design.md
index 4ef96dd..53375ec 100644
--- a/docs/superpowers/specs/2026-09-03-memoria-design.md
+++ b/docs/superpowers/specs/2026-09-03-memoria-design.md
@@ -4339,6 +4339,110 @@ calls: §8.9's on the page, §8.9's again in `/answer`'s own search, and the
answer. At §8.6's 2,200 queries a month that is still single-digit
dollars.
+#### Amendments, 2026-10-27 (Paul, after using it live)
+
+Paul: *"the answers seem pretty good so far"*, then four changes, each
+his ruling:
+
+**1. Say "AI", not the provider.** *"Don't say 'asking TensorX' or show
+the model."* The slot says *"🤖 Asking AI…"* and the answer is headed
+*"🤖 AI answer"*. **This narrows decision 4 ("named on every answer") for
+the AI answer, by Paul.** The provider and model are still on the
+answer, in the heading's `title` (hover, and read by assistive
+technology), and the footer still names TensorX on every page. §8.9's
+address rows are unchanged: they still name TensorX and the model,
+because Paul's words were about AI answers.
+
+**2. The AI formats its answer** (Paul chose this over a fixed lead-and-
+points layout). The model may use exactly two things, and nothing else
+renders:
+- `**bold**`, within one block, in balanced pairs; an unbalanced `**`
+ is shown as typed;
+- a block whose text starts with `- ` is a bullet; consecutive bullets
+ are one list.
+
+Every other character is escaped text. A markdown link, image, heading,
+code span or raw HTML is shown literally, never rendered (§8.5). The
+response shape is unchanged — `{"answer": [{"text", "cite"}]}` — but an
+item is now a **block** (a paragraph or a bullet), and the bound is **8
+blocks**, each at most 400 characters. Citations follow each block.
+
+**3. 👍 / 👎, recorded for review.** Every shown answer carries *"Was
+this right? 👍 👎"*. Nothing learns from them yet, and the page says
+nothing that suggests it does.
+- The fragment carries a **sealed handle** (`seal.PurposeFeedback`,
+ `feedback.handle`) holding the asker, the query and the answer exactly
+ as shown (blocks and the cited documents' titles). The form posts the
+ handle and a verdict; the server opens the handle and stores what it
+ says, so what is kept is what was shown, never text the client
+ composed. A handle that does not open, or whose asker is not the
+ person posting, is a 404.
+- 👍 stores at once and the slot says *"Thanks."* 👎 opens
+ `/answer/feedback`, which shows the answer and asks *"What was wrong?
+ (optional)"*, then stores.
+- Stored in `answer_feedback`: verdict, created time, and three sealed
+ fields under their own purposes — the handle's content
+ (`feedback.body`), the note (`feedback.note`) and the reporter
+ (`feedback.reporter`). Listed on **Reports** beside fact reports, each
+ deletable. Additive migration.
+- Scriptless: both are forms. With script, 👍 posts in place.
+
+**4. A short cache** (Paul chose it over none). An answer is kept **in
+memory only, never on disk**, for **10 minutes**, keyed by a hash of the
+asker, the query as searched, and the exact passages sent, in order. So
+the ruled search still runs on every request — §4.1 is asked every time
+— and a hit skips only the model call. A changed passage, a different
+ruling, or a different person is a different key. Only `answered` and
+`none` are cached; a late, failed or dropped answer asks again next
+time. At most **256** entries; the oldest goes first. Cached content is
+the same class as the in-memory index (§6.3) and dies with the process.
+
+**Cost, amended again.** Enter, a reload, or retyping the same query
+within ten minutes is now free. §8.9's address step is not cached.
+
+### 8.12 Finding a kind by its name (Paul, 2026-10-27)
+
+**The failure.** *"No matches for postcode or eircode … need to be
+smarter about that."* A search for `Eircode` or `Postcode` found
+nothing on a corpus that holds eircodes, because documents write the
+eircode, not the word. §8.8's box runs over search results, so with no
+result there was nothing for it to look at, and the page said *"No
+matches"* — the plausible-empty-list failure, said confidently.
+
+**The rule.** At indexing time, each passage is scanned for the
+validator-backed kinds (§8.8: eircode, phone, IBAN, VAT, email) with the
+same `fact.Scan` the box uses, and the kinds found are written into a
+fifth FTS column, `kinds`, as **the single-word lexicon entries for that
+kind** — for an eircode, `eircode postcode`, generated from the lexicon
+so the two cannot drift. A passage holding an eircode also gets the
+postal kind's single word, `address`: an eircode is part of a postal
+address, and this is what lets *"office address"* find a passage that
+writes `Location: … D02 X285` with no word "address" in it.
+
+- **Weight below every other column** (`KindsWeight`), so a passage that
+ says "phone" outranks one that only holds a number; the column finds
+ passages, it does not reorder them.
+- **Not shown.** `snippet()` stays on body; the kind words never appear
+ in a result.
+- **Validators only.** A span counts if the validator accepts it,
+ label or not, NoBox or not — this is "the passage holds one", not
+ "the box would show it". The model kind (§8.9) is never scanned at
+ indexing: that would send the corpus out.
+- **Authorization is unchanged.** The index already holds every
+ passage's words; one more word per kind says no more than the eircode
+ itself does. Results are ruled exactly as before (§4.1), and the box
+ still runs only over ruled results.
+- **The index stays in memory** (§6.3). Nothing about kinds is stored.
+- **Cost:** one `Scan` per passage at indexing time and at boot. Gate 44
+ bounds it.
+
+**Gate 44.** A corpus with an eircode and no word "eircode" or
+"postcode": `eircode`, `postcode` and `office address` each find the
+passage; a passage with the word "phone" outranks one with only a phone
+number for `phone`; the kind words never appear in a snippet; a
+non-validating look-alike (`D02 X28`) adds nothing; and boot indexing of
+a large corpus stays linear.
+
## 9. Surfaces
### 9.1 What memoria exposes
@@ -5306,6 +5410,10 @@ 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.**
+ - **§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
+ here so the next reader of decision 4 finds it.
- **§8.11's reading of Paul's ruling needs confirming.** Asked "every
search, or only questions?" he said "I think it's worth trying", read
here as every settled search with no checked answer. If he meant