Revision 10, review round 2 (GPT-6 Astra): paged feeds, asker kinds, future revisions, stale rulings
- Harness follows S1's cursor to the tip (bounded at 100 pages; a cursor back unchanged with rows fails) before judging each item's last row; S3 refuses a future revision as well as a superseded one; S2 is asked under the kind the app does not key on, which must be UNKNOWN for the whole call (gate 2). RunAs/CheckAs let an address-keyed (lone-shape) app run the fixture under its own kind. The reference server now checks the asker's kind and pages its feed; six more broken variants refused. - Doctrine: §0's inside test, rulings 3/14/15 and leak-list item 2 marked as revision 10 overrides them; A.3 Sheets noted; s1.go and s3.go comments brought to revision 10. - server/: exactly-at-limit pages and empty item ids pinned. Eight new mutations, all red.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 files changed,
+211
−39
conformance/conformance.go+88 −19conformance/conformance_test.go+61 −4docs/superpowers/specs/2026-09-05-suite-sharing-doctrine.md+19 −9s1.go+3 −2s3.go+5 −5server/server_test.go+35 −0
CI passed — run details
CI log
=== gate === ok amadan.net/oficina/suite 0.009s ok amadan.net/oficina/suite/conformance 0.015s ok amadan.net/oficina/suite/server 0.007s
diff --git a/conformance/conformance.go b/conformance/conformance.go| index 9e0e6d9..87dadf6 100644 |
| --- a/conformance/conformance.go |
| +++ b/conformance/conformance.go |
| @@ -14,6 +14,7 @@ import ( |
| "fmt" |
| "net/http" |
| "net/http/httptest" |
| + "net/url" |
| "sort" |
| "strconv" |
| "strings" |
| @@ -45,11 +46,33 @@ func Run(t *testing.T, h http.Handler) { |
| } |
| } |
| +// RunAs is Run for an app that keys its askers on kind — a lone-shape app |
| +// keys on addresses, a suite-shape one on person refs (§3). The fixture's |
| +// asker and stranger keep their values and take that kind, and the harness |
| +// also asks with the other kind, which must be UNKNOWN for the whole call |
| +// (gate 2). |
| +func RunAs(t *testing.T, h http.Handler, kind suite.SubjectKind) { |
| + t.Helper() |
| + report := CheckAs(h, kind) |
| + for _, f := range report.Failures { |
| + t.Error(f) |
| + } |
| + if report.Checked == 0 { |
| + t.Error("conformance ran no checks; a gate that asserts nothing passes everything") |
| + } |
| +} |
| + |
| // Check drives the handler and returns what it found, without touching a |
| // *testing.T. It exists so the harness itself can be tested: a harness that |
| // passes every server is worse than no harness, and the only way to know is to |
| -// point it at servers that should fail. |
| +// point it at servers that should fail. It asks as the fixture's own kind, |
| +// person_ref. |
| func Check(h http.Handler) Report { |
| + return CheckAs(h, suite.SubjectPersonRef) |
| +} |
| + |
| +// CheckAs is Check for an app that keys on kind (see RunAs). |
| +func CheckAs(h http.Handler, kind suite.SubjectKind) Report { |
| var r Report |
| fixture, err := suite.LoadCustodyFixture() |
| @@ -57,13 +80,37 @@ func Check(h http.Handler) Report { |
| r.fail("loading the custody fixture: %v", err) |
| return r |
| } |
| + if kind != suite.SubjectPersonRef && kind != suite.SubjectAddress { |
| + r.fail("unknown asker kind %q", kind) |
| + return r |
| + } |
| + fixture.Asker.Kind, fixture.Stranger.Kind = kind, kind |
| checkS3(h, fixture, &r) |
| checkS2(h, fixture, &r) |
| + checkWrongKind(h, fixture, kind, &r) |
| checkS1(h, fixture, &r) |
| return r |
| } |
| +// Gate 2's kind rule: an asker of a kind the app does not key on is UNKNOWN |
| +// for the whole call, never NOT_VISIBLE and never an answer read off the |
| +// value alone (Astra, 2026-11-01: the reference server compared values only |
| +// and answered VISIBLE to the right string under the wrong kind). |
| +func checkWrongKind(h http.Handler, f suite.CustodyFixture, kind suite.SubjectKind, r *Report) { |
| + other := suite.SubjectAddress |
| + if kind == suite.SubjectAddress { |
| + other = suite.SubjectPersonRef |
| + } |
| + wrong := suite.Subject{Kind: other, Value: f.Asker.Value} |
| + pairs := make([]suite.ItemRevision, 0, len(f.Cases)) |
| + for _, c := range f.Cases { |
| + pairs = append(pairs, suite.ItemRevision{ItemID: c.ItemID, Revision: c.Revision}) |
| + } |
| + askS2(h, f, r, "the asker's value under the kind this app does not key on", wrong, pairs, |
| + func(suite.CustodyCase) suite.Authorization { return suite.UNKNOWN }) |
| +} |
| + |
| // Gate 3, the content half. Since revision 10 (Paul, 2026-11-01) every live |
| // item is served — the consumer holds private and granted items too, and S2 |
| // decides who sees them — and a deleted item answers the same 404 as one |
| @@ -78,15 +125,18 @@ func checkS3(h http.Handler, f suite.CustodyFixture, r *Report) { |
| r.fail("S3 for an item that does not exist: got %d, want 404", baseline.Code) |
| } |
| - // A superseded revision is never served: a consumer asking for revision |
| - // 6 of an item now at 7 gets the refusal, not today's bytes under |
| - // yesterday's number (Astra, 2026-11-01: the reference server served it). |
| + // Only the current revision is ever served: a consumer asking for |
| + // revision 6 or 8 of an item now at 7 gets the refusal, not today's |
| + // bytes under another number (Astra, 2026-11-01: the reference server |
| + // served the older one; a mutant serving the newer one passed). |
| for _, c := range f.Cases { |
| - rec := do(h, "GET", suite.RouteS3+"/"+c.ItemID+"?revision="+strconv.FormatInt(c.Revision-1, 10), nil) |
| - r.Checked++ |
| - if refusal(rec) != refusal(baseline) { |
| - r.fail("S3 %s at superseded revision %d: %s, want the refusal for an item that does not exist (%s)", |
| - c.ItemID, c.Revision-1, refusal(rec), refusal(baseline)) |
| + for _, rev := range []int64{c.Revision - 1, c.Revision + 1} { |
| + rec := do(h, "GET", suite.RouteS3+"/"+c.ItemID+"?revision="+strconv.FormatInt(rev, 10), nil) |
| + r.Checked++ |
| + if refusal(rec) != refusal(baseline) { |
| + r.fail("S3 %s at revision %d (current %d): %s, want the refusal for an item that does not exist (%s)", |
| + c.ItemID, rev, c.Revision, refusal(rec), refusal(baseline)) |
| + } |
| } |
| } |
| @@ -199,17 +249,36 @@ func askS2(h http.Handler, f suite.CustodyFixture, r *Report, what string, asker |
| // would keep a person's own documents out of their search. The last row for |
| // an item is its state; a deleted item may be absent or gone, never live. |
| func checkS1(h http.Handler, f suite.CustodyFixture, r *Report) { |
| - rec := do(h, "GET", suite.RouteS1+"?cursor=", nil) |
| - r.Checked++ |
| - |
| - feed, err := suite.DecodeS1(rec.Code, rec.Body.Bytes()) |
| - if err != nil { |
| - r.fail("S1: %v", err) |
| - return |
| - } |
| + // Every page, as a consumer reads them: follow the cursor until it |
| + // comes back unchanged with no rows (Astra, 2026-11-01: the first |
| + // version read one page and failed a correct server that paged). A |
| + // cursor that comes back unchanged WITH rows, or a feed that will not |
| + // end, is a server a consumer cannot finish reading. |
| + const maxPages = 100 |
| last := map[string]suite.FeedRow{} |
| - for _, row := range feed.Rows { |
| - last[row.ItemID] = row |
| + cursor := "" |
| + for page := 0; ; page++ { |
| + if page == maxPages { |
| + r.fail("S1: no tip after %d pages — a consumer polls a feed like this for ever", maxPages) |
| + return |
| + } |
| + rec := do(h, "GET", suite.RouteS1+"?cursor="+url.QueryEscape(cursor), nil) |
| + r.Checked++ |
| + feed, err := suite.DecodeS1(rec.Code, rec.Body.Bytes()) |
| + if err != nil { |
| + r.fail("S1: %v", err) |
| + return |
| + } |
| + for _, row := range feed.Rows { |
| + last[row.ItemID] = row |
| + } |
| + if feed.Cursor == cursor { |
| + if len(feed.Rows) > 0 { |
| + r.fail("S1: the cursor came back unchanged with %d rows; a consumer cannot make progress", len(feed.Rows)) |
| + } |
| + break |
| + } |
| + cursor = feed.Cursor |
| } |
| for _, c := range f.Cases { |
| r.Checked++ |
diff --git a/conformance/conformance_test.go b/conformance/conformance_test.go| index 6f94f1b..5fe45d9 100644 |
| --- a/conformance/conformance_test.go |
| +++ b/conformance/conformance_test.go |
| @@ -31,6 +31,12 @@ type referenceServer struct { |
| revisionBeforePerson bool // STALE for a stranger at an old revision |
| privateAsGone bool // revision 9's feed: non-team items gone |
| leakHeaderInRefusal bool // the right 404, with a title in a header |
| + serveFuture bool // 200 with today's bytes for a newer revision |
| + ignoreKind bool // answers by the asker's value, whatever its kind |
| + deletedLive bool // a deleted item advertised live in the feed |
| + staleFeedRevision bool // feed rows one revision behind |
| + neverEnds bool // a new cursor every page, for ever |
| + stuckWithRows bool // the same cursor back, with rows |
| } |
| func (s *referenceServer) find(itemID string) (suite.CustodyCase, bool) { |
| @@ -71,7 +77,7 @@ func (s *referenceServer) serveS3(w http.ResponseWriter, r *http.Request) { |
| // Revision 10: every live item is held, so every live item is served — |
| // at its current revision only. |
| rev, _ := strconv.ParseInt(r.URL.Query().Get("revision"), 10, 64) |
| - if c.Rung != suite.RungDeleted && (rev == c.Revision || s.serveSuperseded) { |
| + if c.Rung != suite.RungDeleted && (rev == c.Revision || (s.serveSuperseded && rev < c.Revision) || (s.serveFuture && rev > c.Revision)) { |
| w.WriteHeader(200) |
| if s.wrongBodyForTeamItem { |
| w.Write([]byte("the bytes of some other document entirely")) |
| @@ -110,6 +116,16 @@ func (s *referenceServer) serveS2(w http.ResponseWriter, r *http.Request) { |
| Results []result `json:"results"` |
| }{} |
| + if req.Asker.Kind != s.fixture.Asker.Kind && !s.ignoreKind { |
| + // An asker of a kind this server does not key on: UNKNOWN for the |
| + // whole call (gate 2). |
| + for _, p := range req.Pairs { |
| + out.Results = append(out.Results, result{ItemID: p.ItemID, Revision: p.Revision, Result: suite.UNKNOWN}) |
| + } |
| + w.Header().Set("Content-Type", "application/json") |
| + json.NewEncoder(w).Encode(out) |
| + return |
| + } |
| stranger := req.Asker.Value != s.fixture.Asker.Value |
| // mayOpen is the app's own read check (revision 10): the team rung for |
| @@ -172,10 +188,14 @@ func (s *referenceServer) serveS2(w http.ResponseWriter, r *http.Request) { |
| func (s *referenceServer) serveS1(w http.ResponseWriter, r *http.Request) { |
| rows := []map[string]any{} |
| for _, c := range s.fixture.Cases { |
| + rev := c.Revision |
| + if s.staleFeedRevision { |
| + rev-- |
| + } |
| row := map[string]any{ |
| "item_id": c.ItemID, |
| - "revision": c.Revision, |
| - "gone": c.Rung == suite.RungDeleted || (s.privateAsGone && c.Rung != suite.RungTeam), |
| + "revision": rev, |
| + "gone": (c.Rung == suite.RungDeleted && !s.deletedLive) || (s.privateAsGone && c.Rung != suite.RungTeam), |
| "touched_at": "2026-09-05T09:00:00Z", |
| } |
| if s.leakVisibilityInFeed { |
| @@ -183,8 +203,28 @@ func (s *referenceServer) serveS1(w http.ResponseWriter, r *http.Request) { |
| } |
| rows = append(rows, row) |
| } |
| + // Two pages of rows, and then the tip, which answers the cursor it was |
| + // given. A correct feed may page; the harness must follow it. |
| + cursor := r.URL.Query().Get("cursor") |
| + half := len(rows) / 2 |
| + var page []map[string]any |
| + next := cursor |
| + switch cursor { |
| + case "": |
| + page, next = rows[:half], "c-1" |
| + case "c-1": |
| + page, next = rows[half:], "c-2" |
| + default: |
| + page = []map[string]any{} |
| + } |
| + if s.neverEnds { |
| + next = cursor + "x" |
| + } |
| + if s.stuckWithRows && cursor == "c-1" { |
| + next = cursor |
| + } |
| w.Header().Set("Content-Type", "application/json") |
| - json.NewEncoder(w).Encode(map[string]any{"cursor": "c-" + strconv.Itoa(len(rows)), "rows": rows}) |
| + json.NewEncoder(w).Encode(map[string]any{"cursor": next, "rows": page}) |
| } |
| func newReference(t *testing.T) *referenceServer { |
| @@ -323,6 +363,12 @@ func TestHarnessCatchesWhatTheFirstRevision10HarnessMissed(t *testing.T) { |
| "STALE for a stranger": func(s *referenceServer) { s.revisionBeforePerson = true }, |
| "private items gone from the feed": func(s *referenceServer) { s.privateAsGone = true }, |
| "a title in a refusal's headers": func(s *referenceServer) { s.leakHeaderInRefusal = true }, |
| + "a future revision served": func(s *referenceServer) { s.serveFuture = true }, |
| + "the asker's kind ignored": func(s *referenceServer) { s.ignoreKind = true }, |
| + "a deleted item advertised live": func(s *referenceServer) { s.deletedLive = true }, |
| + "feed rows a revision behind": func(s *referenceServer) { s.staleFeedRevision = true }, |
| + "a feed that never ends": func(s *referenceServer) { s.neverEnds = true }, |
| + "a cursor stuck with rows": func(s *referenceServer) { s.stuckWithRows = true }, |
| } { |
| s := newReference(t) |
| bend(s) |
| @@ -331,3 +377,14 @@ func TestHarnessCatchesWhatTheFirstRevision10HarnessMissed(t *testing.T) { |
| } |
| } |
| } |
| + |
| +// A lone-shape app keys on addresses. RunAs gives the fixture's asker and |
| +// stranger that kind; the reference server, keyed on addresses, passes, and |
| +// asks under person_ref are UNKNOWN. |
| +func TestHarnessRunsForAnAddressKeyedApp(t *testing.T) { |
| + s := newReference(t) |
| + s.fixture.Asker.Kind, s.fixture.Stranger.Kind = suite.SubjectAddress, suite.SubjectAddress |
| + if report := conformance.CheckAs(s, suite.SubjectAddress); len(report.Failures) != 0 { |
| + t.Errorf("an address-keyed reference server failed: %v", report.Failures) |
| + } |
| +} |
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 63095e8..1d5c190 100644 |
| --- a/docs/superpowers/specs/2026-09-05-suite-sharing-doctrine.md |
| +++ b/docs/superpowers/specs/2026-09-05-suite-sharing-doctrine.md |
| @@ -173,7 +173,11 @@ The falsifiable form, in two halves: |
| - **Inside.** Take a team's instances of every app. Publish what any one of |
| them holds and the worst anyone learns is what that team could read in |
| - the owning app **at the moment the copy was taken**. An honest instance |
| + the owning app **at the moment the copy was taken**. *(Since revision |
| + 10 (Paul, 2026-11-01) an instance holds every live item, so "what that |
| + team could read" becomes "every live item in the team's apps", and a copy |
| + is retired when its item is deleted, not when it leaves the team rung. |
| + The sentence that follows is revision 9's.)* An honest instance |
| retires a copy that has left team-visibility within one feed pull plus |
| **the retention its own spec states** — memoria §7.4 holds that number |
| today, and a consumer that states none is not conformant. §4.2 carries |
| @@ -215,7 +219,7 @@ happened to fall while every CARLOS app was one process. |
| |---|---|---|---| |
| | 1 | **The team is the boundary. An instance is a process.** A team's instances across every app are one trust domain at `<team>.<app>.oficina.works`. | One boundary per process, which left memoria holding person-initiated snapshots and made the home's activity feed a federation question | Paul, 2026-09-03 (memoria decision 1); reaffirmed suite-wide 2026-09-05 | |
| | 2 | **Sharing is membership across teams, unchanged.** No data crosses a team label. A guest is a scoped member of the granting team. A link share moves nothing. | Any federation story; a "copy to my team" verb | Pegamento §3, applied | |
| -| 3 | **Custody and authorization are two rules.** Custody bounds what a sibling may *hold*: team-visible items only. Authorization is what a *person* may read: asked of the app of record, per person, per query, **never cached**. Team standing is not authorization; it is the roster, a pulled copy refreshed by epoch (§5). A copy is never an authority. | One ACL copied between apps; "is a member" as the only question | Paul, 2026-09-03 (memoria decision 3); generalised 2026-09-05 | |
| +| 3 | **Custody and authorization are two rules.** *(Custody's half superseded by revision 10, Paul, 2026-11-01: a sibling holds every live item; authorization's half stands and now carries the whole weight.)* Custody bounds what a sibling may *hold*: team-visible items only. Authorization is what a *person* may read: asked of the app of record, per person, per query, **never cached**. Team standing is not authorization; it is the roster, a pulled copy refreshed by epoch (§5). A copy is never an authority. | One ACL copied between apps; "is a member" as the only question | Paul, 2026-09-03 (memoria decision 3); generalised 2026-09-05 | |
| | 4 | **The home owns identity and the team, including the membership roster. It never owns a per-item grant.** | Per-instance rosters as the record, reconciled by asking siblings; the home holding document-level grants | Paul, 2026-09-05 | |
| | 5 | **Two shapes, one switch.** A *lone* instance is its own identity authority and its own roster. A *suite* instance takes both from the home. Membership authority follows identity authority; an instance never has one without the other. | A suite instance half-trusting its local table; a lone instance dialling a home for a roster it does not need | Paul, 2026-08-31 (Docs §8.1, two shapes); extended to the roster 2026-09-05 | |
| | 6 | **Egress is one suite sentence.** Egress that is a property of the product is forbidden. Egress that is per-team opt-in, to one named recipient, disclosed, with a working floor when off, is admissible. | Two contradicting texts, Docs §11.2 and memoria §8.3 | Paul, 2026-09-03 (memoria decision 4); made suite-wide 2026-09-05 | |
| @@ -226,8 +230,8 @@ happened to fall while every CARLOS app was one process. |
| | 11 | **Activity is pulled at render and held nowhere at rest** — `oficina/home` ruling 18 and the `design-activity-pull` spec, adopted as suite contract call 7. | Push into the home; a contentless heat map | Paul, 2026-09-05 (home ruling 18) | |
| | 12 | **Membership is its own record at the home, written only by an owner.** `(team, person, role)`, written at the directory origin behind step-up, or seeded by the drain with the team's first owner. A directory row says where a person has things; it never grants or revokes team standing. Call 2 cannot write membership and call 8 reads only the membership record. | Deriving the roster from call-2 directory rows, which revision 1 chose. The row has no owner role to project (home §6: `kind` is member or guest; home §7: who counts as an owner "is the instance's business… and the home never learns the answer"); it is scoped per (team, app) where the roster is per team, so a projection can express "member of acme.docs but not acme.sheets", which ruling 1 forbids; and any instance writes it under a consumer token, so deriving from it routes around §5.4's step-up. Those three are verified against home §§6 and 7; whether they are together *unbuildable* is a stronger claim than the evidence carries, and revision 3 made it | Paul, 2026-09-05, on Fable's recommendation after the GPT-6 review (finding 1) | |
| | 13 | **A compromised home is three compromises and each is conceded on its own.** A leaked database reveals the graph, the roster, and who owns each team. A compromised directory origin can add a member, and a member reads everything team-visible in every instance of that team. A compromised credential origin can sign in as anyone, owners included, and no instance can tell. | One undifferentiated "compromised home" that "cannot read a document", which took home §2's careful *directory* and widened it to *home*, and counted as evidence what only honest code leaves behind | Paul, 2026-09-05, on Fable's recommendation after the GPT-6 review (finding 2) | |
| -| 14 | **Custody is bounded at acquisition and retired by the feed. It is not enforced by erasure.** What an instance may *acquire* is team-visible at the time; what it may *render* is live-authorized (ruling 3); what it must *retire* is stated and timed. Three rules, not one. | §0's inside test stated instantaneously; source-driven tombstone push (home §6: no channel reaches a hibernating instance); sealing pulled content under a source-held key, which buys nothing once a consumer has indexed, since an embedding is content in another costume (memoria §3.1) | Paul, 2026-09-05, on Fable's recommendation after the GPT-6 review (finding 6) | |
| -| 15 | **Three rungs and a read-only link.** An item is *private*, *granted* to named people, or *team*. Orthogonally it may carry a **read-only** link capability — view, or comment where the app has that role. **Only the `team` rung is team-visible**, so custody keys on the rung and never on the link. **Every write has a named actor**: a member, or a guest who signed in and took a grant. | Treating a link as team-visible because "anyone can read it", which turns a capability held by whoever has the URL into a listing every team member finds by search. **And anonymous link editing**, which Sheets ruling 12 rejected on 2026-08-30 and which revision 3 rebuilt without citing it. An "edit link" is a capability to *obtain a guest grant at sign-in* — the `granted` rung, and how Docs already builds its commenter link | Paul, 2026-09-05, confirming Sheets ruling 12 | |
| +| 14 | **Custody is bounded at acquisition and retired by the feed. It is not enforced by erasure.** *(Revision 10, Paul, 2026-11-01: what may be acquired is every live item, and the feed retires on deletion only; the three-rules shape stands.)* What an instance may *acquire* is team-visible at the time; what it may *render* is live-authorized (ruling 3); what it must *retire* is stated and timed. Three rules, not one. | §0's inside test stated instantaneously; source-driven tombstone push (home §6: no channel reaches a hibernating instance); sealing pulled content under a source-held key, which buys nothing once a consumer has indexed, since an embedding is content in another costume (memoria §3.1) | Paul, 2026-09-05, on Fable's recommendation after the GPT-6 review (finding 6) | |
| +| 15 | **Three rungs and a read-only link.** An item is *private*, *granted* to named people, or *team*. Orthogonally it may carry a **read-only** link capability — view, or comment where the app has that role. **Only the `team` rung is team-visible**, so custody keys on the rung and never on the link. *(Revision 10, Paul, 2026-11-01: custody no longer keys on the rung — a sibling holds every live item — and the ladder decides who may open what through S2; a link is still never a grant.)* **Every write has a named actor**: a member, or a guest who signed in and took a grant. | Treating a link as team-visible because "anyone can read it", which turns a capability held by whoever has the URL into a listing every team member finds by search. **And anonymous link editing**, which Sheets ruling 12 rejected on 2026-08-30 and which revision 3 rebuilt without citing it. An "edit link" is a capability to *obtain a guest grant at sign-in* — the `granted` rung, and how Docs already builds its commenter link | Paul, 2026-09-05, confirming Sheets ruling 12 | |
| --- |
| @@ -1091,11 +1095,12 @@ apps are a suite, and every one is a consequence of ruling 1 or 4. |
| leaves; a compromised one retires nothing, and no revocation reaches a |
| copy it already holds (ruling 14). |
| 2. **A compromised sibling can name any asker on S2**, and so learn which |
| - team-visible items a given member may see. Bounded by item 1: it can |
| - already read them all. **The bound holds only because S2 is intersected |
| - with custody** (§4.3); without the intersection it would also learn |
| - which private items exist, which item 1 does not cover and §4.2 |
| - forbids. |
| + items a given member may open — private ones included, since revision |
| + 10 removed the intersection (Paul, 2026-11-01). Bounded by item 1 as |
| + revision 10 states it: it already holds every live item, so what S2 |
| + adds is who may open each, which a compromised holder of the items and |
| + the roster could largely infer anyway. *Revision 9 bounded this by the |
| + custody intersection; that bound no longer exists.* |
| 3. **A compromised sibling can write into its own designated area** as |
| itself (S8). It cannot write as a person or touch a person-authored |
| item. |
| @@ -1562,6 +1567,11 @@ several apps sharing one trust domain (suite ruling 1), and same-team |
| siblings may pull team-visible sheets under the suite contract. There is |
| no federation story across teams and there will not be one."* |
| +> **Revision 10 (Paul, 2026-11-01):** "team-visible sheets" becomes |
| +> **every live sheet**, with S2 Sheets' own per-person read check, when |
| +> Sheets adopts the producer half (§6.5). Until then Sheets serves no |
| +> suite routes at all. |
| + |
| §8.2: append *"Team standing comes from the roster the home holds (suite |
| §5) in suite shape, and from `$SHEETS_OWNERS` in lone shape. Per-sheet |
| roles stay here."* |
diff --git a/s1.go b/s1.go| index cccee5f..ba5c3d2 100644 |
| --- a/s1.go |
| +++ b/s1.go |
| @@ -13,8 +13,9 @@ import ( |
| // no visibility flag. memoria's draft 1 carried a visible-to-team field and it |
| // was a leak: `visible=false, gone=false` told a consumer that a guest-only |
| // item existed, at what revision and when it was touched, which is what S3's |
| -// "404, never 403" is there to hide. §4.2: departure from team-visibility is |
| -// `gone`, indistinguishable from deletion. |
| +// "404, never 403" is there to hide. Since revision 10 (Paul, 2026-11-01) |
| +// the feed carries every live item and `gone` means deleted; a row still |
| +// carries nothing but these four fields, and who may open an item is S2's. |
| type FeedRow struct { |
| ItemID string `json:"item_id"` |
| Revision int64 `json:"revision"` |
diff --git a/s3.go b/s3.go| index 31dbdd2..b4c225e 100644 |
| --- a/s3.go |
| +++ b/s3.go |
| @@ -7,11 +7,11 @@ import ( |
| // ErrNotAvailable is the whole vocabulary of an S3 refusal. |
| // |
| -// Doctrine §4.2: a content fetch for anything outside the custody predicate |
| -// answers 404, never 403, and the status is identical for "not team-visible" |
| -// and "does not exist". Deleted, never team-visible, and departed from |
| -// team-visibility are one answer here on purpose — a consumer that could tell |
| -// them apart would learn that a private item exists. |
| +// Doctrine §4.2: a content fetch for anything outside custody answers 404, |
| +// never 403, identical to "does not exist". Since revision 10 (Paul, |
| +// 2026-11-01) custody is every live item, so the refusal covers a deleted |
| +// item, an unknown id and a revision that is not current — one answer, so a |
| +// consumer cannot tell a deletion from an id it made up. |
| var ErrNotAvailable = errors.New("suite: item not available") |
| // ErrContractBreach marks a sibling answering in a way the contract forbids. |
diff --git a/server/server_test.go b/server/server_test.go| index c5541cc..81595d4 100644 |
| --- a/server/server_test.go |
| +++ b/server/server_test.go |
| @@ -71,6 +71,12 @@ func (p *fixtureProducer) Rule(_ context.Context, asker suite.Subject, pairs []s |
| return nil, p.ruleErr |
| } |
| out := make([]suite.Authorization, 0, len(pairs)) |
| + if asker.Kind != p.f.Asker.Kind { |
| + for range pairs { |
| + out = append(out, suite.UNKNOWN) |
| + } |
| + return out, nil |
| + } |
| for _, pr := range pairs { |
| c, ok := p.find(pr.ItemID) |
| may := ok && asker == p.f.Asker && c.Rung != suite.RungDeleted && (c.Rung == suite.RungTeam || c.Owner == "asker" || c.AskerGrant) |
| @@ -413,3 +419,32 @@ func TestTheSurvivors(t *testing.T) { |
| } |
| } |
| } |
| + |
| +// S1's guards at their edges (Astra, 2026-11-01). |
| +// |
| +// MUTATION-TESTED 2026-11-01, each reverted: the page limit off by one |
| +// (>= for >) → "exactly the limit"; the empty item id check removed → "an |
| +// empty item id". |
| +func TestS1Edges(t *testing.T) { |
| + p := producer(t) |
| + h := server.Routes(p, nil) |
| + p.extraRows = server.FeedPageLimit - len(p.f.Cases) |
| + if rec := do(h, "GET", suite.RouteS1, "", nil); rec.Code != 200 { |
| + t.Errorf("exactly the limit: %d, want 200", rec.Code) |
| + } |
| + p.extraRows = 0 |
| + bad := &emptyIDProducer{fixtureProducer: p} |
| + if rec := do(server.Routes(bad, nil), "GET", suite.RouteS1, "", nil); rec.Code != 500 { |
| + t.Errorf("an empty item id: %d, want 500", rec.Code) |
| + } |
| +} |
| + |
| +type emptyIDProducer struct{ *fixtureProducer } |
| + |
| +func (p *emptyIDProducer) Feed(ctx context.Context, cursor string, limit int) (suite.Feed, error) { |
| + f, err := p.fixtureProducer.Feed(ctx, cursor, limit) |
| + if len(f.Rows) > 0 { |
| + f.Rows[0].ItemID = "" |
| + } |
| + return f, err |
| +} |