oficina / docs Public

Suite producer half for memoria, and the Team rung open

On branch feat/suite-producer

Docs serves the suite contract's producer half (S1, S2, S3) so memoria can index Docs documents, and gains a Team sharing rung.

Paul's rulings (2026-11-01):

  • "New docs Team, old private": new documents are shared with the whole team (read for every admitted member; editing stays with the owner and writer grants); existing documents stay private until their owner shares them. Samples stay private.
  • Suite revision 10, "Hold private too, check per person": Docs sends memoria every live document; S2 is Docs' own read check for the named person (team rung for a member, ownership, a live grant, never a link), never cached.

What it builds (spec §8.2, §8.2.1, §8.2.2, §14a; suite c38e3ad):

  • documents.visibility (private|team), documents.revision, suite_feed (append-only, same transaction as every change), migration 0011_suite.sql.
  • Team clause in permissionScope (read only); share page "Your team" section, POST /d/{sqid}/share/team.
  • Producer through suite/server: S1 pages the feed (cursor <id>.<random nonce>), S2 person-first, STALE decided from the document's own log, standing re-checked after the last read, S3 current revision only. DOCS_SUITE_CONSUMERS (sha256 hashes); no consumers, no routes.
  • Restore safety: revisions are random positive 63-bit values (62 in the migration), never ordered; cursors carry random nonces.

Review so far: GPT-6 (Codex, "Astra"), four rounds — REQUEST CHANGES ×3 (restore reissuing revisions twice, roster-lease expiry mid-S2 twice, guest 403, feed-insert rollback coverage), APPROVE on 65acd67. Main (5039cf6, agent access) merged in at 74c255a; agent create/edit go through the same draw/feed paths; hub CI green at 74c255a. Pending: Fable whole-branch review (AGENTS.md).

For Paul: agents acting for a person can read team-rung documents like any member (agent reads use the shared read check) — consistent with the rung, not separately ruled.

Whole-branch review, as AGENTS.md requires — Claude Fable 5.1 (claude-fable-5-1), on 74c255a: APPROVE, nothing blocking.

No authorization regression on any path (web pages, lists, search, export, stream, update log, public links, native API, agent API, dashboard provider); the team clause is read-only; "existing private" is airtight in the migration; S1/S2/S3 match suite revision 10 and pass conformance in both shapes; restore safety holds under the three Astra sequences; the CSRF/session bypass is exactly the three routes. 27 mutations of the key guards: 26 red, one green (the Feed's owner_id > 0 filter — unreachable defence in depth).

Follow-ups being made before merge: AGENTS.md pointers to the new invariants (bump in the same transaction, deletes through deleteDocument, no fallback from randomSource, S2 never caches, only the three outer-mux routes); test or drop the owner_id > 0 filter; migration header cites c38e3ad; the two "Your team" sentences made true; an operator note for DOCS_SUITE_CONSUMERS.

For Paul (not blocking): agents acting for a member read team-rung documents (flagged above); a visibility change makes memoria re-fetch unchanged text; S1's touched_at tells the consumer when private documents were edited (a consequence of "hold private too"); dev instances (no allowlist) make every address a member.

Earlier: GPT-6 (Codex, "Astra") four rounds, APPROVE on 65acd67. Suite revision 11 (Fable's review of suite c38e3ad: CURSOR_RESET on an unrecognised cursor, explicit prior/unknown revisions in the fixture, no-store) will need a follow-up here after it lands.