oficina / suite Public

Revision 11, second round: answering Fable 5.1's review of 0a59e7d

H1: doc-owner-left withdrawn from custody.json (the format has no pending
list). §4.3's "no team standing reaches nothing, ownership included" is
marked an unruled proposal; gate 5's reading binds until Paul rules, and the
question is a new NEEDS PAUL item in §14. §6's S2 row, gate 3, gate 5, A.2,
fixtures.go and server.Producer's Rule doc reconciled to say only what is
ruled. The harness's ownerBeforeStanding bend is withdrawn with the case.

M1: at most one CURSOR_RESET per re-read; a second before the tip is a
producer failure that keeps its items withheld, and re-reads back off
(§6.6, A.4, s1.go). §9 item 13: a resetting producer's availability and
embedding cost.
M2: an expired or compacted cursor is answered CURSOR_RESET; "full
re-announce" struck in §6's S1 row and marked in the S5 paragraph.
M3: the harness sees answers, not seeding, and says so (§4.3, §6.5, gate 3).
L1: §6.6 step 1 is a soft drop, step 3 the hard retire.
L2: cursor stamp rule normative (per event, or minted at restore and never
restored; a generation id in the restorable database is not enough).
L3: "most unknown revisions sit below" corrected; new
TestCustodyFixtureUnknownRevisionsBothSides holds the fixture to openable
cases on both sides.
L4: redraw on collision with any revision the log holds for the item.
L5: gate 3's revision-10 "one behind / one ahead" marked superseded.
L6: CheckProducer's anonymous probe goes through storeAudit; RunProducer's
doc says it tests Handler only.

Mutation-tested 2026-11-02, recorded in the tests. Revision 11 is not on
main, so this round amends it in place rather than minting revision 12.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 640d058fc94dddb7f9bdfba9e8d408855e0ab432 parent 0a59e7d
9 files changed, +370 −115
  • conformance/conformance.go +13 −2
  • conformance/conformance_test.go +10 −5
  • docs/superpowers/specs/2026-09-05-suite-sharing-doctrine.md +238 −56
  • fixtures.go +26 −14
  • fixtures/custody.json +13 −25
  • fixtures_test.go +37 −0
  • s1.go +6 −3
  • server/server.go +21 −10
  • server/server_test.go +6 −0
diff --git a/conformance/conformance.go b/conformance/conformance.go
index 7bfa0cf..74b81ce 100644
--- a/conformance/conformance.go
+++ b/conformance/conformance.go
@@ -73,6 +73,12 @@ func RunAs(t *testing.T, h http.Handler, kind suite.SubjectKind) {
// producer mounted through server.Handler, exactly as the app mounts it, and
// driven with a token the harness mints (revision 11). kind is the asker
// kind the app keys on.
+//
+// It tests Handler and the Producer behind it, nothing else: middleware an
+// app puts in front of Handler — its own router, a proxy, a cache, a CSRF
+// or session layer — is not in the request path here and is not covered.
+// Nor can it see how the app seeded its world from the fixture's owner,
+// asker_grant and rung; a case seeded wrongly can pass.
func RunProducer(t *testing.T, p server.Producer, kind suite.SubjectKind) {
t.Helper()
report := CheckProducer(p, kind)
@@ -86,7 +92,8 @@ func RunProducer(t *testing.T, p server.Producer, kind suite.SubjectKind) {
// CheckProducer is RunProducer without a *testing.T. Beyond CheckAs it
// asks once with no token, which must be the 401 — Handler, not routes
-// served to anybody.
+// served to anybody — and that 401 is held to the same Cache-Control and
+// Vary as every other response (Fable's review of 0a59e7d, L6).
func CheckProducer(p server.Producer, kind suite.SubjectKind) Report {
var r Report
raw := make([]byte, 32)
@@ -100,7 +107,11 @@ func CheckProducer(p server.Producer, kind suite.SubjectKind) Report {
Tokens: []server.Token{{Epoch: 1, SHA256: server.TokenHash(token)}},
}}, nil)
- anon := do(h, "GET", suite.RouteS3+"/"+suite.NonexistentItemID+"?revision=1", nil)
+ // Through the header audit, as every request in CheckAs is: the 401 is
+ // a response like any other, and a cache keeping it keyed without
+ // Authorization would serve it to the next caller.
+ audit := &storeAudit{next: h, r: &r, seen: map[string]bool{}}
+ anon := do(audit, "GET", suite.RouteS3+"/"+suite.NonexistentItemID+"?revision=1", nil)
r.Checked++
if anon.Code != http.StatusUnauthorized {
r.fail("a request with no token: got %d, want 401", anon.Code)
diff --git a/conformance/conformance_test.go b/conformance/conformance_test.go
index eb8dfc8..a0de44f 100644
--- a/conformance/conformance_test.go
+++ b/conformance/conformance_test.go
@@ -43,7 +43,6 @@ type referenceServer struct {
// Revision 11 (Fable's review of c38e3ad).
numericRevisions bool // STALE for any revision below current, held in the log or not
failOpen bool // VISIBLE for an id it does not know
- ownerBeforeStanding bool // an owner who lost team standing still opens their item
titleInS2Row bool // an S2 row carrying the item's title
missingRevisionIsNow bool // S3 with no ?revision serves the current bytes
malformedRevision400 bool // S3 answers 400 for a malformed revision
@@ -166,9 +165,10 @@ func (s *referenceServer) serveS2(w http.ResponseWriter, r *http.Request) {
return false
}
if stranger {
- // No team standing reaches nothing, ownership included
- // (revision 11).
- return s.ownerBeforeStanding && c.Owner == "stranger"
+ // The fixture's stranger owns nothing and holds no grant, so
+ // nothing opens for them. Whether a removed member keeps what
+ // they own is not ruled (doctrine §14) and not in the fixture.
+ return false
}
if s.linkCountsAsGrant && c.Link != "" {
return true
@@ -506,11 +506,16 @@ func TestHarnessRound3(t *testing.T) {
// its Vary half alone → "no Vary: Authorization". (The stranger questions at
// prior and unknown revisions removed → "STALE for a stranger", in the test
// above.)
+//
+// 2026-11-02 (Fable's review of 0a59e7d, H1): the bend "an owner without
+// standing" is withdrawn with the fixture case doc-owner-left it needed.
+// That case was revision 11's proposal, unruled by Paul and contrary to
+// gate 5's reading; with no stranger-owned case the bend breaks nothing
+// the harness asks about, so keeping it would only fail this test.
func TestHarnessCatchesWhatRevision10Missed(t *testing.T) {
for name, bend := range map[string]func(*referenceServer){
"revisions compared as numbers": func(s *referenceServer) { s.numericRevisions = true },
"an unknown id answered VISIBLE": func(s *referenceServer) { s.failOpen = true },
- "an owner without standing": func(s *referenceServer) { s.ownerBeforeStanding = true },
"a title in an S2 row": func(s *referenceServer) { s.titleInS2Row = true },
"no revision serves today's bytes": func(s *referenceServer) { s.missingRevisionIsNow = true },
"a malformed revision answered 400": func(s *referenceServer) { s.malformedRevision400 = true },
diff --git a/docs/superpowers/specs/2026-09-05-suite-sharing-doctrine.md b/docs/superpowers/specs/2026-09-05-suite-sharing-doctrine.md
index 164d49e..d94e758 100644
--- a/docs/superpowers/specs/2026-09-05-suite-sharing-doctrine.md
+++ b/docs/superpowers/specs/2026-09-05-suite-sharing-doctrine.md
@@ -3,12 +3,49 @@
How the apps of the suite share identity, membership and content with
each other, and where the line is that nothing crosses.
-**Status:** design, **revision 11**, 2026-11-01. Revision 11 is this
+**Status:** design, **revision 11**, 2026-11-02. Revision 11 is this
session's answer to a review of revision 10 (at c38e3ad) by Fable
-(claude-fable-5-1); **revision 11 has not itself been reviewed.** Revision
-10 carries Paul's ruling and was reviewed by GPT-6 (Codex, "Astra") in
-three passes: REQUEST CHANGES on 12848f8 and 53b79d5, **APPROVE** on
-983114a, its polish items applied after.
+(claude-fable-5-1). Fable 5.1 then reviewed revision 11 at **0a59e7d** and
+returned **REQUEST CHANGES** (one high, three medium, seven low findings);
+**this round answers that review and has not itself been reviewed.**
+Revision 10 carries Paul's ruling and was reviewed by GPT-6 (Codex,
+"Astra") in three passes: REQUEST CHANGES on 12848f8 and 53b79d5,
+**APPROVE** on 983114a, its polish items applied after.
+
+**This round (2026-11-02, this session, answering Fable 5.1's review of
+0a59e7d).** Revision 11 is not on `main` (`origin/main` is c38e3ad,
+revision 10), so this round amends it in place rather than minting revision
+12; a citation of revision 11 names this round's commit or a later one,
+never 0a59e7d, and a session that read 0a59e7d reads again. Nothing in it
+is Paul's. What changes:
+
+- **H1 — the removed-owner case is withdrawn, and asked.** §4.3's "no team
+ standing reaches nothing, ownership included" contradicted gate 5 and §6's
+ S2 row, and Paul has not ruled. It is now marked an **unruled proposal**;
+ gate 5's reading binds until he does; the fixture case `doc-owner-left` is
+ out of `custody.json` (the format has no pending list) and recorded in
+ §14 as a **NEEDS PAUL** item; `server.Producer`'s doc says only what is
+ ruled. The harness's matching broken variant is withdrawn with it.
+- **M1** — at most **one `CURSOR_RESET` per re-read**: a second before the
+ tip is a producer failure that keeps its items withheld, and re-reads
+ back off (§6.6, A.4); §9 gains item 13, the cost a resetting producer
+ can still impose.
+- **M2** — an expired or compacted cursor is answered `CURSOR_RESET` too;
+ the S1 row's "full re-announce" is struck, and S5's paragraph is marked.
+- **M3** — where revision 11 said the fixture "holds every app" to the
+ owner rule, it now says the harness sees answers and not seeding, and
+ cannot (§4.3, §6.5, gate 3).
+- **L1** — §6.6's step 1 is a soft drop (hidden, pending); step 3 is the
+ hard retire. **L2** — the cursor stamp rule is normative: per event, or
+ minted at restore and never restored; a generation id in the restorable
+ database is not enough. **L3** — "most unknown revisions sit below" was
+ false (four of ten) and is corrected, and the module now tests that the
+ fixture has openable cases on both sides. **L4** — a revision is redrawn
+ on a collision with any revision the log holds for the item. **L5** —
+ gate 3's revision-10 "one behind / one ahead" is marked superseded.
+ **L6** — `conformance.CheckProducer`'s unauthenticated probe goes
+ through the header audit, and `RunProducer`'s doc says it tests `Handler`
+ only. L7 needed no change.
**Revision 11 makes a restore safe, and makes S2 and S3 fail closed where
the harness could not see them fail open.** Who: this session, answering
@@ -27,8 +64,9 @@ What changes, each where it lives:
decided from the producer's own log, and a revision the log does not hold
is `UNKNOWN` on S2 and the refusal on S3. A cursor the log does not
recognise is answered with one fixed `409 {"code":"CURSOR_RESET"}`, and
- the consumer drops everything it holds from that producer and reads it
- again from the beginning (Fable H1).
+ the consumer hides everything it holds from that producer and reads it
+ again from the beginning, at most once per re-read (Fable H1; bounded
+ 2026-11-02, M1).
- **The fixture** names each case's `prior_revision` and
`unknown_revision`; the harness computes no "one behind" any more. It
asks S2 about an id the producer does not know (`NOT_VISIBLE`, never a
@@ -37,7 +75,8 @@ What changes, each where it lives:
requires `Cache-Control: no-store` and `Vary: Authorization` on every
response (Fable H1, H2, M3, M5). A new case, `doc-owner-left`, is a
private item whose owner has lost team standing: `NOT_VISIBLE` to them
- too — this session's proposal (§4.3), not a ruling.
+ too — this session's proposal (§4.3), not a ruling. *(Withdrawn
+ 2026-11-02, answering Fable's review of 0a59e7d, H1: see above and §14.)*
- **Gate 3c** gains a flip case: an answer is never cached, so the next
request on every surface follows the sibling's new answer (Fable H3).
- **`suite/server`**: `Handler` is the only thing an app mounts, and
@@ -48,8 +87,11 @@ What changes, each where it lives:
(Fable M6); revision-9 text left unmarked in §6 and §6.4 is marked
(Fable M1, low items).
-**Paul's question (§14, NEEDS PAUL):** may a consumer send private items to
-its model provider to embed them? Revision 10 put private documents in the
+**Paul's questions (§14, NEEDS PAUL).** First, does a person removed from
+the team keep S2 access to items they own or were individually granted
+(gate 5's reading, Docs today), or reach nothing (revision 11's proposal)?
+Until he rules, gate 5's reading holds. Second: may a consumer send
+private items to its model provider to embed them? Revision 10 put private documents in the
corpus that §8 compares to "whole-corpus egress", and nobody ruled on that
egress. Until he does, a consumer embeds nothing private and sends a model
only passages already ruled `VISIBLE` for the person asking (§8).
@@ -475,15 +517,34 @@ this defect open in its §13; A.4 closes it. *(GPT-6 review, finding 11.)*
> open the item (and `NOT_VISIBLE` for one who may not — the person is
> checked first). §6.6 states it as the contract.
-> **Revision 11 (this session's proposal, 2026-11-01; not ruled by Paul):
-> no team standing reaches nothing, ownership included.** A member who
-> owns private items and is then removed from the team gets `NOT_VISIBLE`
-> on S2 for their own items, as every stranger does for every item. A
-> consumer serves the team's members; a person off the roster is not one,
-> and "they own it" is a fact inside the app of record, where they can
-> still be served by its own rules. The fixture's `doc-owner-left` holds
-> every app to it. If Paul wants a removed owner to keep their own items
-> in a consumer, this proposal and that case change together.
+> **UNRULED PROPOSAL — not the contract.** *(This session, 2026-11-01, in
+> revision 11; demoted 2026-11-02, answering Fable's review of 0a59e7d, H1,
+> because it contradicts gate 5 and §6's S2 row and Paul has not ruled.)*
+> The proposal: **no team standing reaches nothing, ownership included** —
+> a member who owns private items and is then removed from the team gets
+> `NOT_VISIBLE` on S2 for their own items, as every stranger does for
+> every item, on the reasoning that a consumer serves the team's members,
+> a person off the roster is not one, and "they own it" is a fact inside
+> the app of record, where its own rules can still serve them.
+>
+> **What binds until Paul rules is gate 5's reading** (§11): a member
+> removed at the home **holding no other grant** gets `NOT_VISIBLE`, and
+> losing team standing does not by itself revoke an instance-side grant —
+> asserting otherwise would implement a complete-offboarding policy §5.2
+> has not agreed to. Docs answers that way today, as Fable's review of
+> 0a59e7d records. The question is §14's
+> NEEDS PAUL item. Revision 11 also put a fixture case, `doc-owner-left`,
+> behind the proposal; it is **withdrawn from `custody.json`** and no
+> binding case asks about a removed owner either way.
+>
+> **Whichever way Paul rules, the harness cannot hold an app to it alone.**
+> An app seeds its own world from the fixture's `owner`, `asker_grant` and
+> `rung`, and the harness sees only the answers, not the seeding: an app
+> could map a "removed owner" to an ownerless item, or to a person who was
+> never a member, and pass without implementing either reading. Revision
+> 11 said the fixture case "holds every app to it"; it did not. The rule,
+> once ruled, needs an app-side test that removes a real member from a
+> real roster and asks again.
**Never cached, at any scope.** Not per session, not per page, not for
the life of a warm process. Caching authorization is what makes a stale
@@ -819,8 +880,8 @@ spec, which owns them, and are cited here for completeness of direction.
| 1–6 | person → home, instance → home | session; consumer token | — | Home §9. Unchanged. |
| 7 activity | home → instance | **assertion** for the person, `aud` = instance | who the front door is for | `design-activity-pull` §4–5 owns the wire shape. The home renders and holds rendered output only, under two ages (§4.3). Not in the contract module yet — §12 step 2 is S1, S2 and S3. When it arrives, the fixtures **cite** that spec's gates 10–20 rather than restate them, or this contract rebuilds §2's drift one layer down. |
| 8 roster | instance → home | consumer token | which instance asks | §5.3. Scoped to the caller's team. Paged; the copy has a TTL. |
-| S1 change feed | sibling → sibling | consumer token | same-team sibling | `(item_id, revision, gone, touched_at)`. No title, no content, no visibility flag. Per-consumer TTL; past it, full re-announce. A cursor the producer's log does not recognise is `409 {"code":"CURSOR_RESET"}` and nothing else; the consumer drops what it holds from that producer and reads from the beginning (§6.6, revision 11). |
-| S2 authorization | sibling → sibling | consumer token **+ named asker** | same-team sibling, asking for a person | Four values, total decoder, cap 256 pairs. **Never cached**: a passage crosses no request boundary without an S2 `VISIBLE` in the request that carried it (memoria §8.4, gate 26). Asker is a typed subject (§3); the answer is the app's own read check for that person — team rung, ownership, a live grant, never a link — with no custody intersection since revision 10 (§4.3). An id the app does not know is `NOT_VISIBLE`; a revision its log does not hold is `UNKNOWN` (§6.6). |
+| S1 change feed | sibling → sibling | consumer token | same-team sibling | `(item_id, revision, gone, touched_at)`. No title, no content, no visibility flag. Per-consumer TTL; past it, ~~full re-announce~~ the cursor is reset *(revision 11, answering Fable's review of 0a59e7d, M2: one start-over mechanism, not two)*. A cursor the producer's log does not recognise — restored, foreign, or expired or compacted past the TTL — is `409 {"code":"CURSOR_RESET"}` and nothing else; the consumer hides what it holds from that producer and reads from the beginning, at most one reset per re-read (§6.6, revision 11). |
+| S2 authorization | sibling → sibling | consumer token **+ named asker** | same-team sibling, asking for a person | Four values, total decoder, cap 256 pairs. **Never cached**: a passage crosses no request boundary without an S2 `VISIBLE` in the request that carried it (memoria §8.4, gate 26). Asker is a typed subject (§3); the answer is the app's own read check for that person — team rung, ownership, a live grant, never a link — with no custody intersection since revision 10 (§4.3). For a person removed from the team, gate 5's reading (§11) stands until Paul rules (§14): holding no other grant, `NOT_VISIBLE`; whether ownership or an individual grant survives removal is open, and revision 11's "reaches nothing" is a proposal, not this row. An id the app does not know is `NOT_VISIBLE`; a revision its log does not hold is `UNKNOWN` (§6.6). |
| S3 content | sibling → sibling | consumer token | same-team sibling | `(id, revision)`, **no person**. Every live item at its current revision since revision 10 (team-visible only before it); one identical 404 for deleted, unknown or superseded. Never 403. |
| S6 aggregate | sibling → Sheets | consumer token + named asker | as S2 | Enumerated function over cell refs, never expression text. Cap 64. Typed subject and the app's own read check, as S2 (no custody intersection since revision 10). |
| S8 write-as-self | sibling → sibling | consumer token | same-team sibling | §7.2. Into the caller's designated area only; only items the caller authored. |
@@ -862,7 +923,11 @@ and departure from team-visibility indistinguishably *(superseded by
revision 10, Paul, 2026-11-01: `gone` means deleted and nothing else; a
move down the ladder is not a departure from custody, and S2 rules on it.
Marked in revision 11, which found it unmarked)* — and S5, consumer
-expiry, into the per-consumer TTL, since expiry is the decommission verb.
+expiry, into the per-consumer TTL, since expiry is the decommission verb
+*(what follows expiry changed in revision 11, answering Fable's review of
+0a59e7d, M2: a consumer coming back past its TTL is answered §6.6's
+`CURSOR_RESET`, not a "full re-announce", which was a second start-over
+mechanism nobody specified)*.
Both are settled; they are recorded here because a table that runs S1, S2,
S3, S6, S8 leaves two holes, and a hole in a numbered contract is somewhere
a later call falls. *(Review pass, 2026-09-05.)*
@@ -930,10 +995,20 @@ footgun with a scarier name is still a footgun, and the harness no longer
needs one at all). The package keeps the module's rule: standard library
only.
+**Its reach, said plainly** *(answering Fable's review of 0a59e7d, L6 and
+M3)*: it tests `Handler` and the `Producer` behind it and nothing in front
+— an app's own router, proxy, cache or session middleware is not in the
+request path and is not covered. And it tests the answers of a world the
+app seeded from the fixture, not the seeding: an app that maps a case's
+`owner` or `asker_grant` wrongly can pass. Its unauthenticated probe goes
+through the same header audit as every other request.
+
### 6.6 Revisions and cursors survive a restore (revision 11)
*This session, 2026-11-01, answering Fable's review of c38e3ad (H1). Found
-by both producers: Fichas `main` c837d28 and Docs `feat/suite-producer`.*
+by both producers: Fichas `main` c837d28 and Docs `feat/suite-producer`.
+Amended 2026-11-02 by this session, answering Fable's review of 0a59e7d (M1,
+M2, L1 to L4); not yet reviewed.*
**A revision names one byte sequence for ever.** Once a producer has
issued `(item, revision)`, that pair names those bytes and no others, for
@@ -949,8 +1024,12 @@ So, normatively:
- A revision is **unique per item for ever**. The recommended shape is the
one both producers chose: a random positive int63 drawn per change, and
- drawn again on a collision with the current one. It has no order, and
- nothing may compare two revisions by size.
+ drawn again on a collision with **any revision the log holds for that
+ item**, not only the current one — a draw equal to a prior revision gives
+ an old name to new bytes, which is the reissue this section forbids
+ *(revision 11 said "the current one"; corrected answering Fable's review
+ of 0a59e7d, L4)*. It has no order, and nothing may compare two revisions
+ by size.
- **`STALE` comes from the producer's own log**: the asked revision is one
the log holds for that item, and it is not the current one.
- **A revision the log does not hold is `UNKNOWN` on S2** for a person who
@@ -961,8 +1040,13 @@ So, normatively:
loudly and re-fetched, never shown.
- The fixture names, per case, a `prior_revision` (held, not current) and
an `unknown_revision` (never issued), and the harness asks about both
- rather than computing "one behind". Most unknown revisions sit *below*
- the current one, so a producer still comparing numbers fails.
+ rather than computing "one behind". Some cases put the unknown revision
+ *below* the current one and the rest above it, among the cases the asker
+ may open, so a producer still comparing numbers fails and so does one
+ answering `STALE` for anything not current; the module's own tests hold
+ the fixture to having both *(revision 11 said "most" sat below; it was
+ four of ten, and is three of nine since `doc-owner-left` was withdrawn —
+ Fable's review of 0a59e7d, L3)*.
**A cursor carries the identity of the log that issued it.** A cursor that
is only a position is reissued by a restore exactly as a counted revision
@@ -971,14 +1055,28 @@ the consumer continues silently from the wrong place. Both producers stamp
each cursor with a random value written alongside the event it names, and
check it on every request.
+**The stamp rule is normative** *(answering Fable's review of 0a59e7d,
+L2)*. A cursor's stamp is either **drawn at random per event and written
+with that event**, so a restored log holds only the stamps of the events it
+actually has; or **minted when the log is restored and never itself
+restored from a backup**, so a restore always changes it. A generation id
+kept in the same restorable database as the log is **not sufficient**: the
+restore brings the old generation back with the old events, and the
+cursors it issued before still match a log that has since diverged.
+
**A cursor the log does not recognise** — the log was restored, or the
-cursor was issued by some other log, or it does not parse — is answered
+cursor was issued by some other log, or it does not parse, or it names a
+position the producer has expired or compacted away (a consumer back past
+its per-consumer TTL, §6) — is answered
with **status 409 and exactly the body `{"code":"CURSOR_RESET"}`**: no
other field, no position, no count, no reason. It is never answered as the
tip (which leaves a consumer holding a dead log's items for ever) and never
as a generic 5xx (which stalls it for ever, as Docs' and Fichas' 503 and
manual reset did). It means: *your cursor names no position in my log;
-discard everything you hold from me and read from the beginning.* The
+set aside everything you hold from me and read from the beginning.* It is the
+**one** way a producer tells a consumer to start over: an expired cursor is
+answered with it too, and there is no separate "full re-announce" *(§6's S1
+row said there was; answering Fable's review of 0a59e7d, M2)*. The
beginning, `""`, is never reset. The module carries it as
`suite.CursorResetStatus`, `suite.CursorResetBody`, `suite.ErrCursorReset`
(what `DecodeS1` returns for exactly that answer, and for nothing else —
@@ -988,20 +1086,40 @@ for the package to write it).
**The consumer's half, binding.** On `ErrCursorReset` a consumer:
-1. drops **every** item it holds from that producer — the text, every
- passage, embedding and derived artefact built from it — and its cursor
- for that producer, before it reads anything else from it;
+1. **soft-drops** every item it holds from that producer — the text,
+ every passage, embedding and derived artefact built from it: each is
+ hidden from **every** surface and marked *pending*, and its cursor for
+ that producer is discarded — before it reads anything else from it;
2. reads S1 again from `""` to the tip, ingesting as it would a new
- producer;
-3. retires as gone **every item absent from that complete re-read**, so an
- item the restored log no longer has cannot survive in the consumer
- because nothing told it to leave.
-
-Step 1 comes first because steps 2 and 3 can fail part-way; a consumer that
-re-read before dropping could be left serving a mix of two logs. Until the
-re-read reaches the tip, the consumer names that producer's items nowhere
-and says the app is being re-read — the loud withholding §4.3 requires,
-not a silently shorter answer.
+ producer; an item the re-read lists is re-fetched, and a pending copy
+ may be replaced or reused only where the re-read names the same
+ `(item, revision)` (the first rule of this section makes that the same
+ bytes);
+3. when the re-read reaches the tip, **hard-retires** every item still
+ pending — every item absent from that complete re-read — and deletes
+ it, so an item the restored log no longer has cannot survive in the
+ consumer because nothing told it to leave.
+
+*(Revision 11's step 1 "dropped every item", which left step 3 nothing to
+retire; corrected answering Fable's review of 0a59e7d, L1.)* Step 1 comes
+first because steps 2 and 3 can fail part-way; a consumer that re-read
+before hiding could be left serving a mix of two logs. Until the re-read
+reaches the tip, the consumer names that producer's items nowhere and says
+the app is being re-read — the loud withholding §4.3 requires, not a
+silently shorter answer.
+
+**At most one reset per re-read** *(answering Fable's review of 0a59e7d,
+M1)*. A second `CURSOR_RESET` from the same producer **before the re-read
+reaches the tip** is a **failure** of that producer, not another reset: the
+consumer abandons that re-read rather than starting over at once, treats
+the producer as unavailable (§6.3) and says so to people by naming the app,
+and keeps everything it held from that producer **pending and withheld
+from every answer** until a later re-read completes — fail closed, never
+back to showing the pre-reset copy. Every re-read, the first after a reset
+and any after such a failure, waits on the consumer's ordinary backoff for
+that producer, so a producer that resets every request costs one read per
+backoff interval and not a loop.
+Leak list item 13 (§9) records what such a producer can still cost.
### 6.1 Why two credentials
@@ -1357,6 +1475,20 @@ apps are a suite, and every one is a consequence of ruling 1 or 4.
URL reads or writes the item, the app cannot name them, and a
forwarded link is a grant nobody recorded. This is what "anyone with
the link" means and there is no version of it that is not this.
+13. **A buggy or hostile producer can force a consumer to drop and re-read
+ it** (§6.6). `CURSOR_RESET` needs no proof that a restore happened, so a
+ sibling that answers it — wrongly, or on purpose, or on every request —
+ makes the consumer hide everything it held from that sibling, read its
+ whole feed again, re-fetch every item and re-embed whatever it embeds
+ (§8). That is an **availability and embedding cost**, not a leak:
+ nothing is shown that
+ was not shown before, a second reset inside one re-read is a failure
+ that keeps the sibling's items withheld rather than another reset, and
+ re-reads are subject to backoff, so the cost is bounded by the backoff
+ and the size of that sibling's own feed. A compromised sibling can
+ already do worse to its own items (item 1); this records that it can
+ also make a consumer pay for them repeatedly. *(Answering Fable's review
+ of 0a59e7d, M1.)*
---
@@ -1415,8 +1547,11 @@ that cannot be written as stated is a spec bug.
`VISIBLE` for the team rung, the owner and a live grantee; `NOT_VISIBLE`
for a link-only, guest-only or moved-to-private item the asker neither
owns nor holds a grant on, for a deleted one, and for a stranger at any
- revision; `STALE` one revision behind and `UNKNOWN` one ahead for a
- person who may open it. S1 carries every live item at its current
+ revision; ~~`STALE` one revision behind and `UNKNOWN` one ahead~~ for a
+ person who may open it *(superseded by the revision-11 paragraph below:
+ `STALE` at the case's `prior_revision` and `UNKNOWN` at its
+ `unknown_revision`, never a computed ±1 — marked answering Fable's
+ review of 0a59e7d, L5)*. S1 carries every live item at its current
revision, and `gone` only for deletion. The paragraph below is revision
9's gate 3, superseded.
@@ -1433,9 +1568,20 @@ that cannot be written as stated is a spec bug.
`revision` and `result` fails the whole call. S1 at a cursor the log
never issued (`NeverIssuedCursor`) is `409 {"code":"CURSOR_RESET"}`.
Every response carries `Cache-Control: no-store` and `Vary:
- Authorization`. `doc-owner-left` — private, owned by the stranger — is
- `NOT_VISIBLE` to everybody (§4.3's proposal). An app on `suite/server`
- runs it as `conformance.RunProducer` (§6.5).
+ Authorization`, the unauthenticated 401 included. An app on
+ `suite/server` runs it as `conformance.RunProducer` (§6.5).
+
+ *Withdrawn 2026-11-02 (answering Fable's review of 0a59e7d, H1):*
+ revision 11 also added a case, `doc-owner-left` — private, owned by the
+ stranger, `NOT_VISIBLE` to everybody — on §4.3's proposal that no team
+ standing reaches nothing, ownership included. Paul has not ruled, and
+ the case contradicted gate 5's reading below. It is out of the fixture
+ until he rules (§14). **What the harness does not hold an app to,**
+ said plainly: it sees the answers of a world the app seeded from the
+ fixture's `owner`, `asker_grant` and `rung`, and not the seeding, so
+ whatever Paul rules about a removed owner needs a test in the app that
+ removes a real member and asks again; and it drives `Handler` alone, so
+ middleware in front of it is the app's to test (§6.5).
*Revision 9:* **Custody, one fixture per rung.** S3 answers 200 for a `team` item and
404 for `private`, `granted`, guest-only, **link-shared-but-not-team**
@@ -1484,7 +1630,11 @@ that cannot be written as stated is a spec bug.
that admits nobody. A **guest fixture** keeps exactly the activity its
own grant reaches: losing team standing does not revoke an
instance-side grant, and asserting an empty list for that person would
- implement a complete-offboarding policy §5.2 has not agreed to. A
+ implement a complete-offboarding policy §5.2 has not agreed to. *(This
+ reading also governs a removed member who owns items or holds an
+ individual grant, until Paul answers §14's question; revision 11's
+ contrary proposal in §4.3 is not ruled. Noted 2026-11-02, answering
+ Fable's review of 0a59e7d, H1.)* A
**failed refresh** past the TTL yields `UNKNOWN`, not `NOT_VISIBLE`,
admits nobody new **and stops serving team standing to an existing
session**. A **home rewound** — both to a lower epoch, and to the same
@@ -1640,6 +1790,24 @@ change to where the list comes from.
exists. **Until he rules, §8's interim rule holds**: nothing private is
embedded, and only passages S2 has ruled `VISIBLE` for the asker in the
same request reach a model.
+- **NEEDS PAUL — does a person removed from the team keep S2 access to
+ items they own or were individually granted (gate 5's reading, Docs
+ today), or reach nothing (the revision-11 proposal)?** *(Raised by this
+ session, 2026-11-02, answering Fable's review of 0a59e7d, H1; not decided
+ here.)* Gate 5 (§11) reads that losing team standing does not revoke an
+ instance-side grant, because the opposite is a complete-offboarding
+ policy §5.2 has not agreed to; §6's S2 row says the answer is the app's
+ own read check — team rung, ownership, a live grant. Revision 11's §4.3
+ proposed instead that a person off the roster reaches nothing through a
+ consumer, ownership included, since a consumer serves the team's members
+ and the app of record can still serve the person by its own rules. The
+ two disagree only for a removed member who owns items or holds an
+ individual grant. **Until he rules, gate 5's reading holds**, and the
+ fixture asks nothing about the case: `doc-owner-left` (private, owner
+ `"stranger"`, revisions 12 / 11 / 10, `NOT_VISIBLE` to everybody) is
+ withdrawn from `custody.json` and goes back, with whichever answers he
+ rules, together with an app-side test that removes a real member, since
+ the harness cannot see how an app seeds an owner (§4.3).
- **A third review pass, on revision 3.** Two models have read this and
the second returned *request changes*; revision 3 answers all sixteen of
its findings and adds four rulings, so what needs reading now is
@@ -1781,9 +1949,16 @@ S1 to S3 and S8 **wherever sibling consumer tokens are configured**."*
> stamped cursors are §6.6's recommended shape, now normative. An
> unrecognised cursor returns `server.ErrCursorReset` (the 409), not the
> 503 and manual reset; the conformance tests move from `server.Routes` to
-> `conformance.RunProducer`; the seeding adds `doc-owner-left`, owned by
-> the stranger, and reads `prior_revision` from the fixture. Fichas, which
-> has no appendix here, adopts the same three.
+> `conformance.RunProducer`; ~~the seeding adds `doc-owner-left`, owned by
+> the stranger, and~~ the seeding reads `prior_revision` from the fixture.
+> Fichas, which has no appendix here, adopts the same. *(`doc-owner-left`
+> was withdrawn 2026-11-02, answering Fable's review of 0a59e7d, H1: Paul
+> has not ruled what a removed owner keeps, §14. Docs answers today by
+> gate 5's reading — a removed member keeps what they own or were granted
+> — as that review records, and that stands until he rules. A Docs branch
+> that seeded the case drops it. And §6.6's stamp rule is now normative:
+> a cursor stamp drawn per event, or minted at restore and never restored;
+> a generation id in the restorable database is not enough.)*
The sibling switch is independent of shape (suite §3): §12 steps 2 and 3
have Docs and Sheets serving lone peers before the home exists, so "in
suite shape" would forbid the sequencing this document depends on.
@@ -1875,11 +2050,18 @@ removed the asker rather than adding one.
>
> **Revision 11 (this session, 2026-11-01) adds three.** On
> `suite.ErrCursorReset` from a sibling's S1, memoria follows §6.6's three
-> steps — drop everything held from that app and its cursor, re-read from
-> `""`, retire whatever the complete re-read did not list — and withholds
-> that app's items loudly until the re-read reaches the tip; today any S1
-> error, this one included, leaves the cursor where it is, which is safe
-> but never recovers. Gate 3c's flip case (§11) is memoria's to write.
+> steps — hide everything held from that app on every surface and mark it
+> pending, drop its cursor, re-read from `""`, hard-retire whatever the
+> complete re-read did not list — and withholds that app's items loudly
+> until the re-read reaches the tip; today any S1 error, this one
+> included, leaves the cursor where it is, which is safe but never
+> recovers. **At most one reset per re-read**: a second `CURSOR_RESET`
+> from that app before the re-read reaches the tip is a failure, not
+> another reset — memoria names the app as unavailable and keeps its
+> pending items withheld from every answer until a later re-read completes
+> — and each re-read waits on memoria's backoff for that app (§6.6, §9 item
+> 13; amended 2026-11-02, answering Fable's review of 0a59e7d, M1 and L1).
+> Gate 3c's flip case (§11) is memoria's to write.
> And until Paul answers §14's egress question, memoria embeds no private
> or individually granted item. `DecodeS2` now refuses a result row with
> any field beyond the three; memoria's own fakes emit exactly the three,
diff --git a/fixtures.go b/fixtures.go
index beac5cd..8df22a3 100644
--- a/fixtures.go
+++ b/fixtures.go
@@ -50,12 +50,19 @@ type CustodyCase struct {
Revision int64 `json:"revision"`
Rung Rung `json:"rung"`
Link string `json:"link"`
- // Owner is "asker" when the fixture's asker owns the item, "other" when
- // another member does, and "stranger" when the fixture's stranger does —
- // a person who owned it as a member and has since lost team standing
- // (revision 11). AskerGrant is whether the asker holds a live individual
- // grant on it. Together with Rung they are what an app seeds so its own
- // read check produces the S2 answers below (revision 10).
+ // Owner is "asker" when the fixture's asker owns the item and "other"
+ // when another member does. AskerGrant is whether the asker holds a live
+ // individual grant on it. Together with Rung they are what an app seeds
+ // so its own read check produces the S2 answers below (revision 10). The
+ // harness cannot see how an app mapped them while seeding, so a case
+ // seeded wrongly can pass; what an owner keeps is held to the app's own
+ // tests as much as to this fixture.
+ //
+ // Revision 11 added a third value, "stranger" (an owner who has since
+ // lost team standing, case doc-owner-left). That case was withdrawn on
+ // 2026-11-02, answering Fable's review of 0a59e7d (H1): Paul has not
+ // ruled whether such a person keeps their own items, and gate 5 reads
+ // that they do (doctrine §14). No binding case uses "stranger".
Owner string `json:"owner"`
AskerGrant bool `json:"asker_grant"`
S3Status int `json:"s3_status"`
@@ -72,12 +79,16 @@ type CustodyCase struct {
// never computes it — a revision is a name, and a producer whose
// revisions are random has no "one behind" (doctrine §6.6, revision 11).
PriorRevision int64 `json:"prior_revision"`
- // UnknownRevision is a revision the item's log never issued. Most cases
+ // UnknownRevision is a revision the item's log never issued. Some cases
// put it BELOW Revision and away from PriorRevision, so a producer that
// decides STALE by comparing numbers — the counter's habit, which is
// what a restore turns into a leak — answers STALE where it owes
// UNKNOWN; the rest put it above, so one that says STALE for anything
- // not current fails too. An app must never issue it while seeding.
+ // not current fails too. (Revision 11 said "most" are below; it was
+ // four of ten, and is three of nine since doc-owner-left was withdrawn.
+ // TestCustodyFixtureUnknownRevisionsBothSides holds the fixture to
+ // having both among the cases the asker may open.) An app must never
+ // issue it while seeding.
UnknownRevision int64 `json:"unknown_revision"`
// S2ResultSuperseded is the answer at PriorRevision: STALE for a person
// who may open the item — readable, but the app of record has moved on —
@@ -107,15 +118,16 @@ const NonexistentItemID = "doc-no-such-item-ever"
// it.
const NeverIssuedCursor = "suite-conformance-cursor-never-issued"
-// CustodyFixture is gate 3's world: one case per rung, plus team-plus-link,
-// the after-ingest transitions the reviews asked for, and (revision 11) a
-// private item whose owner has since lost team standing.
+// CustodyFixture is gate 3's world: one case per rung, plus team-plus-link
+// and the after-ingest transitions the reviews asked for.
type CustodyFixture struct {
Team string `json:"team"`
Asker Subject `json:"asker"`
- // Stranger has no team standing. Every case refuses them, the team rung
- // and the one they own included: without team standing a person reaches
- // nothing, ownership included (revision 11, this session's proposal).
+ // Stranger has no team standing, owns nothing in the fixture and holds
+ // no grant on any of it, so every case refuses them, the team rung
+ // included. Whether a person removed from the team keeps items they own
+ // or were individually granted is NOT ruled (doctrine §14, NEEDS PAUL);
+ // the fixture asks nothing about it.
Stranger Subject `json:"stranger"`
Cases []CustodyCase `json:"cases"`
}
diff --git a/fixtures/custody.json b/fixtures/custody.json
index 6cfe521..71fe641 100644
--- a/fixtures/custody.json
+++ b/fixtures/custody.json
@@ -29,15 +29,20 @@
"who may open the item, NOT_VISIBLE for one who may not.",
"s2_result_ahead is the answer at unknown_revision: UNKNOWN for a person",
"who may open the item (§4.3), NOT_VISIBLE for one who may not — a person",
- "with no right to the item learns nothing about its revisions. Most",
- "unknown revisions sit BELOW the current one, so a producer comparing",
- "numbers (the counter's habit) says STALE where it owes UNKNOWN. Both S3",
- "revisions are refused with the identical 404.",
+ "with no right to the item learns nothing about its revisions. Some",
+ "cases put unknown_revision BELOW the current one (doc-team, doc-private",
+ "and doc-team-link among those the asker may open) and the rest above,",
+ "so a producer comparing numbers (the counter's habit) says STALE where",
+ "it owes UNKNOWN, and one saying STALE for anything not current fails",
+ "too. Both S3 revisions are refused with the identical 404.",
"",
- "owner \"stranger\" (doc-owner-left, revision 11, this session's proposal):",
- "the item's owner has lost team standing. They get NOT_VISIBLE like every",
- "stranger: without team standing a person reaches nothing, ownership",
- "included."
+ "WITHDRAWN 2026-11-02 (answering Fable's review of 0a59e7d, H1): the",
+ "case doc-owner-left — private, owned by a member who has since lost",
+ "team standing, NOT_VISIBLE to everybody — was revision 11's proposal",
+ "and Paul has not ruled on it. It contradicted gate 5's reading (a",
+ "removed member keeps what their own grant reaches). It is out of the",
+ "binding cases until he rules (doctrine §14, NEEDS PAUL). The stranger",
+ "below owns nothing in this fixture and holds no grant on any of it."
],
"team": "acme",
"asker": {
@@ -201,23 +206,6 @@
"s2_result_superseded": "NOT_VISIBLE",
"s2_result_ahead": "NOT_VISIBLE",
"s2_result_stranger": "NOT_VISIBLE"
- },
- {
- "name": "private, owned by a member who has since lost team standing",
- "item_id": "doc-owner-left",
- "s3_body": "the old offsite notes, private to a former member",
- "revision": 12,
- "prior_revision": 11,
- "unknown_revision": 10,
- "rung": "private",
- "link": null,
- "owner": "stranger",
- "asker_grant": false,
- "s3_status": 200,
- "s2_result": "NOT_VISIBLE",
- "s2_result_superseded": "NOT_VISIBLE",
- "s2_result_ahead": "NOT_VISIBLE",
- "s2_result_stranger": "NOT_VISIBLE"
}
]
}
diff --git a/fixtures_test.go b/fixtures_test.go
index 77f39e2..a15d9d5 100644
--- a/fixtures_test.go
+++ b/fixtures_test.go
@@ -93,3 +93,40 @@ func TestCustodyFixtureRevisionsAreDistinct(t *testing.T) {
}
}
}
+
+// The fixture puts some unknown revisions below the current one and some
+// above, among the cases the asker may open (where the answer is UNKNOWN
+// and a wrong STALE shows). Without a case below, a producer comparing
+// numbers passes; without one above, a producer answering STALE for
+// anything not current passes. Revision 11 claimed "most" sat below, which
+// was never checked and was false (four of ten); this holds the claim the
+// harness actually depends on (Fable's review of 0a59e7d, L3).
+//
+// MUTATION-TESTED 2026-11-02, reverted: doc-granted's unknown_revision moved
+// from 10 to 7 (below its current 9, leaving no openable case above) → "no
+// case the asker may open puts unknown_revision above". doc-team's,
+// doc-private's and doc-team-link's moved above their current revisions
+// (8, 5, 4) → "no case the asker may open puts unknown_revision below".
+func TestCustodyFixtureUnknownRevisionsBothSides(t *testing.T) {
+ f, err := LoadCustodyFixture()
+ if err != nil {
+ t.Fatal(err)
+ }
+ below, above := 0, 0
+ for _, c := range f.Cases {
+ if c.S2ResultAhead != UNKNOWN {
+ continue
+ }
+ if c.UnknownRevision < c.Revision {
+ below++
+ } else {
+ above++
+ }
+ }
+ if below == 0 {
+ t.Error("no case the asker may open puts unknown_revision below the current revision; a producer comparing numbers passes")
+ }
+ if above == 0 {
+ t.Error("no case the asker may open puts unknown_revision above the current revision; a producer answering STALE for anything not current passes")
+ }
+}
diff --git a/s1.go b/s1.go
index 32a602e..7300b6a 100644
--- a/s1.go
+++ b/s1.go
@@ -44,9 +44,12 @@ const (
// ErrCursorReset is DecodeS1's answer to exactly CursorResetStatus with
// exactly CursorResetBody: "your cursor names no position in my log". The
-// consumer drops every item it holds from that producer and its cursor,
-// reads from "" again, and retires whatever that complete re-read does not
-// list as if it were gone (doctrine §6.6). Any other 409 is a plain failure,
+// consumer hides every item it holds from that producer on every surface
+// and marks it pending, drops its cursor, reads from "" again, and retires
+// as gone whatever that complete re-read does not list (doctrine §6.6). One
+// reset per re-read: a second before the re-read reaches the tip is a
+// failure of that producer, not another reset, and its items stay withheld.
+// Any other 409 is a plain failure,
// because a reset destroys a consumer's whole copy and must not be read into
// a body that merely resembles one.
var ErrCursorReset = errors.New("suite: S1 cursor reset: the producer's log holds no such position")
diff --git a/server/server.go b/server/server.go
index 4caf8f8..fc5099d 100644
--- a/server/server.go
+++ b/server/server.go
@@ -38,8 +38,10 @@ import (
// holds then matches different bytes, and Rule says VISIBLE over text the
// item no longer has. A producer whose revisions can be reissued is not
// conformant. Draw them at random (Docs and Fichas use a random positive
-// int63, redrawn on a collision with the current one) and decide STALE from
-// the producer's own log, never by comparing numbers.
+// int63) and redraw on a collision with ANY revision the log holds for the
+// item, not only the current one — a draw equal to a prior revision would
+// give an old name to new bytes. Decide STALE from the producer's own log,
+// never by comparing numbers.
type Producer interface {
// Feed returns the rows after cursor — "" is the beginning — at most
// limit of them, in the app's own log order, and the cursor to ask from
@@ -50,12 +52,17 @@ type Producer interface {
// more.
//
// A cursor the producer's log does not recognise — the log was restored
- // from a backup, or another log issued it — is ErrCursorReset, never the
- // tip and never a failure: this package answers it with S1's one fixed
- // 409, and the consumer drops everything it holds from this producer and
- // reads from "" (§6.6). So a cursor must carry enough to be recognised:
- // a position alone is reissued by a restore; a position and a random
- // stamp written with it is not. "" is never reset.
+ // from a backup, another log issued it, or it names a position the log
+ // has since expired or compacted away — is ErrCursorReset, never the tip
+ // and never a failure: this package answers it with S1's one fixed 409,
+ // the one way a consumer is told to start over, and the consumer hides
+ // everything it holds from this producer and reads from "" (§6.6). So a
+ // cursor must carry enough to be recognised: a position alone is
+ // reissued by a restore. Its stamp is normative: either drawn at random
+ // per event and written with that event, or minted when the log is
+ // restored and never itself restored from a backup. A generation id kept
+ // in the same restorable database is not enough — the restore brings the
+ // old generation back with it. "" is never reset.
//
// Since revision 10 the feed carries every live item, private and
// granted ones included; gone means deleted, and nothing else.
@@ -63,8 +70,12 @@ type Producer interface {
// Rule answers, for each pair in order, whether asker may open that item
// now: the app's own read check (team rung, ownership, a live grant;
- // never a link; and nothing at all for a person with no team standing,
- // their own items included). VISIBLE at the current revision; STALE when
+ // never a link). For a person removed from the team, doctrine gate 5's
+ // reading stands: one holding no other grant gets NOT_VISIBLE, and losing
+ // team standing does not by itself revoke what they own or were granted
+ // individually. Revision 11 proposed that such a person reach nothing,
+ // ownership included; Paul has not ruled, so that is not the contract
+ // (doctrine §4.3, §14). VISIBLE at the current revision; STALE when
// the asker may open it and the asked revision is one the log holds that
// is not current; NOT_VISIBLE when the asker may not, or the item is
// deleted or an id the app does not know; UNKNOWN when the app cannot
diff --git a/server/server_test.go b/server/server_test.go
index 5ccc190..5d82a51 100644
--- a/server/server_test.go
+++ b/server/server_test.go
@@ -167,6 +167,12 @@ func do(h http.Handler, method, url, tok string, body []byte) *httptest.Response
//
// MUTATION-TESTED 2026-11-01, reverted: CheckProducer driving the deprecated
// Routes in place of Handler → "a request with no token: got 404".
+//
+// MUTATION-TESTED 2026-11-02 (Fable's review of 0a59e7d, L6), reverted:
+// Authenticate's no-token 401 stripped of Cache-Control and Vary → "GET
+// /suite/s3 401: Cache-Control "" and Vary """ here; with CheckProducer's
+// anonymous probe sent around the header audit instead of through it (as
+// before), the same mutant passed this test.
func TestRoutesPassConformance(t *testing.T) {
conformance.RunProducer(t, producer(t), suite.SubjectPersonRef)
}