oficina / memoria Public

🤖 merge: main into the suite branch, and what the two lines disagreed about

Eighteen commits of main — the Notion connector, multi-file drop, draft 5
of the spec — against the suite strand. Seven files conflicted and the
prose ones were not mechanical: both lines rewrote §1's review history,
§4.1's S2 contract, §4.3's admission and §10's gate list.

WHERE MAIN WAS RIGHT AND THIS BRANCH WAS WRONG. Three places, all mine:

§2 said memoria holds "its own roster copy" four lines above main's
paragraph explaining that the owners list is not a roster and why calling
it one is the mistake. Main's distinction stands; ruling 4's pulled copy
is a third thing and now says so.

§4.2 said "memoria's own grants are authoritative". Main had already found
that memoria has neither members nor grants — the test is admission plus
presence, two facts, nothing else. Taken wholesale.

§6.5 said memoria "pulls the roster and fires a warm-up S2 on wake". Main
had corrected exactly that: S2 takes a person ref and there is nobody there
on a wake. The roster pull is fine (call 8 carries no asker); the S2 was
the same error draft 3 made and draft 4 fixed, reintroduced by me.

THE ONE REAL DISAGREEMENT, LEFT OPEN RATHER THAN DECIDED. Draft 4 cut a
fifth S2 value, AHEAD, for a sibling that is BEHIND memoria — its log stops
short of our revision, or it has no row at all. STALE means we are behind,
NOT_VISIBLE is silent and would delete history the sibling holds, and
UNKNOWN reports that nobody answered when the sibling did. Three wrong
homes, so a fourth value.

suite.Authorization has four constants, and revision 7 rules the case
UNKNOWN — on my word, given to the suite session from a branch that had not
read draft 4. So the wire shape is the contract's four, the loss is
recorded at the point of use and in §13, and it is raised with the suite as
a contract change rather than settled here. §1.10's lesson, one repository
over, with me on the wrong side of it.

GATE NUMBERING. Both lines added gates 22 to 27. Main's six are cited some
thirty times in its prose, so they keep their numbers and mine move to
28-33; §10 now runs 1-33 with no duplicates, and the Go tests follow. Gate
17 caught main's five connector routes on the way in, which is the gate
working: they could not reach the app until somebody declared them.

The egress gate keeps main's allowedNetworkDirs design rather than my
hardcoded path — a list with "exactly N" asserted, each exemption paid for
by a runtime guard the grep cannot perform. The sibling package is the
second entry and pays the same way.

One predicate, not two: main's owners/isOwner and my admits closure were
the same question answered twice inside one struct. Signin collapses back
to plain auth.

make ci green: vet, fmt-check, test, migration-check.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H3VKtXnq6fSmM2F11Bjcsy
Paul Campbell pushed by paul@keymail.dev fac1c737b9eceaf811ff1f271ffce119efaf0863 parent 01e80d2parent 9464a8b
54 files changed, +12745 −447
  • .gitignore +12 −0
  • .impeccable/config.json +17 −0
  • AGENTS.md +51 −21
  • QUESTIONS-FOR-PAUL.md +33 −6
  • README.md +35 −11
  • cmd/memoria/main.go +6 −0
  • docs/superpowers/specs/2026-09-03-memoria-design.md +1303 −118
  • docs/superpowers/specs/2026-09-05-notion-ingest-design.md +860 −0
  • internal/memoria/app.go +105 −1
  • internal/memoria/auth.go +18 −28
  • internal/memoria/chunk/chunk.go +44 −9
  • internal/memoria/connector.go +364 −0
  • internal/memoria/connector_models.go +106 −0
  • internal/memoria/delete_test.go +363 −0
  • internal/memoria/handlers.go +823 −87
  • internal/memoria/handlers_connector.go +294 −0
  • internal/memoria/index/index.go +76 −8
  • internal/memoria/index/path_test.go +227 −0
  • internal/memoria/lag_test.go +204 −0
  • internal/memoria/migrations/0003_document_path.sql +10 −0
  • internal/memoria/migrations/0004_create_connectors.sql +18 −0
  • internal/memoria/migrations/schema.sql +19 −1
  • internal/memoria/models.go +11 −0
  • internal/memoria/notion/client.go +364 −0
  • internal/memoria/notion/client_test.go +455 −0
  • internal/memoria/notion/fake_test.go +336 −0
  • internal/memoria/notion/markdown.go +325 −0
  • internal/memoria/notion/traverse.go +425 −0
  • internal/memoria/notion/verify.go +38 −0
  • internal/memoria/render.go +1 −1
  • internal/memoria/seal/seal.go +15 −0
  • internal/memoria/static/drop.js +834 −0
  • internal/memoria/static/memoria.css +155 −2
  • internal/memoria/store.go +304 −31
  • internal/memoria/sync.go +426 −0
  • internal/memoria/templates/connectors.html +22 −0
  • internal/memoria/templates/index.html +142 −4
  • internal/memoria/templates/layout.html +22 −2
  • internal/memoria/templates/notion.html +139 −0
  • internal/memoriatest/admission_test.go +20 −15
  • internal/memoriatest/ancestry_test.go +195 −0
  • internal/memoriatest/app_test.go +33 −0
  • internal/memoriatest/connector_test.go +630 −0
  • internal/memoriatest/container_test.go +51 −0
  • internal/memoriatest/drop_test.go +1253 −0
  • internal/memoriatest/gates_test.go +326 −73
  • internal/memoriatest/harness_test.go +156 −5
  • internal/memoriatest/refresh_test.go +325 −0
  • internal/memoriatest/regress_test.go +68 −0
  • internal/memoriatest/routes_test.go +16 −1
  • internal/memoriatest/signindial_test.go +19 −20
  • internal/memoriatest/tray_test.go +572 −0
  • tools/drive/main.go +76 −2
  • tools/seed/main.go +3 −1
.gitignore

Loading diff…

.impeccable/config.json

Loading diff…

AGENTS.md

Loading diff…

QUESTIONS-FOR-PAUL.md

Loading diff…

README.md

Loading diff…

cmd/memoria/main.go

Loading diff…

docs/superpowers/specs/2026-09-03-memoria-design.md

Loading diff…

docs/superpowers/specs/2026-09-05-notion-ingest-design.md

Loading diff…

internal/memoria/app.go

Loading diff…

internal/memoria/auth.go

Loading diff…

internal/memoria/chunk/chunk.go

Loading diff…

internal/memoria/connector.go

Loading diff…

internal/memoria/connector_models.go

Loading diff…

internal/memoria/delete_test.go

Loading diff…

internal/memoria/handlers.go

Loading diff…

internal/memoria/handlers_connector.go

Loading diff…

internal/memoria/index/index.go

Loading diff…

internal/memoria/index/path_test.go

Loading diff…

internal/memoria/lag_test.go

Loading diff…

internal/memoria/migrations/0003_document_path.sql

Loading diff…

internal/memoria/migrations/0004_create_connectors.sql

Loading diff…

internal/memoria/migrations/schema.sql

Loading diff…

internal/memoria/models.go

Loading diff…

internal/memoria/notion/client.go

Loading diff…

internal/memoria/notion/client_test.go

Loading diff…

internal/memoria/notion/fake_test.go

Loading diff…

internal/memoria/notion/markdown.go

Loading diff…

internal/memoria/notion/traverse.go

Loading diff…

internal/memoria/notion/verify.go

Loading diff…

internal/memoria/render.go

Loading diff…

internal/memoria/seal/seal.go

Loading diff…

internal/memoria/static/drop.js

Loading diff…

internal/memoria/static/memoria.css

Loading diff…

internal/memoria/store.go

Loading diff…

internal/memoria/sync.go

Loading diff…

internal/memoria/templates/connectors.html

Loading diff…

internal/memoria/templates/index.html

Loading diff…

internal/memoria/templates/layout.html

Loading diff…

internal/memoria/templates/notion.html

Loading diff…

internal/memoriatest/admission_test.go

Loading diff…

internal/memoriatest/ancestry_test.go

Loading diff…

internal/memoriatest/app_test.go

Loading diff…

internal/memoriatest/connector_test.go

Loading diff…

internal/memoriatest/container_test.go

Loading diff…

internal/memoriatest/drop_test.go

Loading diff…

internal/memoriatest/gates_test.go

Loading diff…

internal/memoriatest/harness_test.go

Loading diff…

internal/memoriatest/refresh_test.go

Loading diff…

internal/memoriatest/regress_test.go

Loading diff…

internal/memoriatest/routes_test.go

Loading diff…

internal/memoriatest/signindial_test.go

Loading diff…

internal/memoriatest/tray_test.go

Loading diff…

tools/drive/main.go

Loading diff…

tools/seed/main.go

Loading diff…