Conformance as an address-keyed app: suite 983114a, conformance.CheckAs
The suite branch moved to 983114a (review round 2): CheckAs(h, SubjectAddress) sends the fixture's askers as addresses, asks under person_ref and requires UNKNOWN, follows S1 to its tip, and refuses S3 one revision either side. The test's adapter now renames item ids only; pers_ana is seeded on the owners list, pers_bo is not. Failures are still exactly the twelve of spec §6.7. Conformance mutations re-measured and recorded; spec pinned to 983114a.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 files changed,
+50
−49
docs/superpowers/specs/2026-09-19-fichas-design.md+19 −18go.mod+1 −1go.sum+2 −2internal/fichas/suite.go+1 −1internal/fichas/suite_conformance_test.go+27 −27
CI passed — run details
diff --git a/docs/superpowers/specs/2026-09-19-fichas-design.md b/docs/superpowers/specs/2026-09-19-fichas-design.md| index 9d66122..782bfde 100644 |
| --- a/docs/superpowers/specs/2026-09-19-fichas-design.md |
| +++ b/docs/superpowers/specs/2026-09-19-fichas-design.md |
| @@ -336,7 +336,7 @@ of the contract, and the first-server design tax, both. |
| **Amended 2026-11-01 (this session, implementing the ruling below).** The |
| contract this section builds against is suite doctrine **revision 10** — |
| introduced at `amadan.net/oficina/suite` commit `12848f8` and pinned at |
| -`53b79d5`, the same revision after its review pass (branch |
| +`983114a`, the same revision after two review rounds (branch |
| `feat/server-half`, not yet landed): its status block, the revision-10 |
| notes at §4.2 and §4.3, and §6.5, the producer half |
| `amadan.net/oficina/suite/server`. What they |
| @@ -475,13 +475,17 @@ every other route keeps the check. |
| ### 6.6 Gates |
| -- **Conformance.** `conformance.Check` runs in `make ci` against |
| - `server.Routes` over the real producer and a real database, through a |
| - test-only naming adapter: the fixture's item ids map to the card ids |
| - seeded for them (and feed rows map back) (one Customer card per case, its name the case's |
| - `s3_body`, edited up to the case's revision; the deleted case deleted), |
| - and its `person_ref` askers map to an admitted address (`asker`) and a |
| - non-admitted one (`stranger`). The adapter renames; it decides nothing. |
| +- **Conformance.** `conformance.CheckAs(h, suite.SubjectAddress)` — the |
| + harness's entry point for an address-keyed app — runs in `make ci` |
| + against `server.Routes` over the real producer and a real database, |
| + through a test-only naming adapter: the fixture's item ids map to the |
| + card ids seeded for them (and feed rows map back) (one Customer card per case, its name the case's |
| + `s3_body`, edited up to the case's revision; the deleted case deleted). |
| + `CheckAs` sends the fixture's asker and stranger as addresses with their |
| + values unchanged; `pers_ana` is put on the owners list and `pers_bo` is |
| + not. The harness also asks under `person_ref`, which Fichas must answer |
| + `UNKNOWN`, follows S1 to its tip, and asks S3 one revision either side. |
| + The adapter renames ids; it decides nothing. |
| The test asserts the failures are **exactly** the twelve listed in §6.7 |
| — no more, no fewer — so a fixture change on the suite branch fails |
| loudly here rather than being absorbed. |
| @@ -498,7 +502,7 @@ every other route keeps the check. |
| Evidence for the suite, where its AGENTS.md says fixtures are corrected by |
| the second implementation. Not changed there from here. |
| -The fixture (`fixtures/custody.json` at `53b79d5`) describes a world with |
| +The fixture (`fixtures/custody.json` at `983114a`) describes a world with |
| a sharing ladder. Fichas has none: |
| | Case | Fixture state | Fichas | Result | |
| @@ -512,19 +516,16 @@ a sharing ladder. Fichas has none: |
| | `doc-was-team` | moved from team to private | no private state | **fails**, as above | |
| | `doc-link-added-late` | private, link added later | no private state, no links | **fails**, as above | |
| -Two more gaps, neither a failure because the adapter bridges them: |
| +One more gap, not a failure because the test's adapter bridges it (a |
| +second, the fixture's suite-shape-only askers, was closed upstream at |
| +`983114a` by `CheckAs`): |
| -- **The asker is suite-shape only.** Both fixture subjects are `person_ref`. |
| - A lone-shape producer keys on `address` and must answer `UNKNOWN` to a |
| - `person_ref`, so run unadapted every S2 check fails. A fixture with an |
| - `address` twin of each subject would let a lone producer run it as |
| - shipped. |
| - **Item ids are names, not an app's ids.** `doc-team` is not a card id; |
| an app whose ids it allocates itself cannot seed them as given. |
| S3 (current and superseded revisions) and S1 (every live item at its |
| -current revision, the deleted one gone) pass in full, as does every |
| -stranger question. The twelve failures — four cases, three revisions each |
| +current revision, the deleted one gone, paged to the tip) pass in full, as |
| +do every stranger question and every `person_ref` question. The twelve failures — four cases, three revisions each |
| — are not bugs to fix in Fichas: |
| bending the producer to refuse cards that every member can open in the app |
| would make memoria hide what Fichas shows. |
| @@ -691,7 +692,7 @@ In order, and small: |
| 4. The S1/S2/S3 server half and the conformance harness in CI (§6), so |
| memoria indexes fichas like a Doc. **Built 2026-11-01** on |
| `feat/suite-producer` (over `feat/contract-demo`) against suite |
| - revision 10 at `53b79d5`, under Paul's ruling of that day (§6.1): S1 |
| + revision 10 at `983114a`, under Paul's ruling of that day (§6.1): S1 |
| from the events table, S2 as admission, S3 as the card's text, mounted |
| only when `FICHAS_SUITE_CONSUMERS` is set. Conformance runs in CI with |
| the inexpressible cases asserted (§6.7). Not deployed, not merged. |
diff --git a/go.mod b/go.mod| index f6469dd..7580718 100644 |
| --- a/go.mod |
| +++ b/go.mod |
| @@ -6,7 +6,7 @@ toolchain go1.26.5 |
| require ( |
| amadan.net/oficina/estilo.git v0.0.0-20261001113457-a264aa5b9540 |
| - amadan.net/oficina/suite v0.0.0-20261101214529-53b79d50971f |
| + amadan.net/oficina/suite v0.0.0-20261101215312-983114acce54 |
| amadan.net/rastrillo/rastrillo v0.26.1-0.20260908075707-29e4491631bd |
| github.com/chromedp/cdproto v0.0.0-20250724212937-08a3db8b4327 |
| github.com/chromedp/chromedp v0.14.2 |
diff --git a/go.sum b/go.sum| index 57e23a9..249e768 100644 |
| --- a/go.sum |
| +++ b/go.sum |
| @@ -1,7 +1,7 @@ |
| amadan.net/oficina/estilo.git v0.0.0-20261001113457-a264aa5b9540 h1:lG6hyBqz13XGisiyhKMHzPoBK6QP8weHQ02je/2gquk= |
| amadan.net/oficina/estilo.git v0.0.0-20261001113457-a264aa5b9540/go.mod h1:4u0jNBtIdMLOsJyrScfqoEuYDJF7BBM3qM9YWbzt6aw= |
| -amadan.net/oficina/suite v0.0.0-20261101214529-53b79d50971f h1:weOUYorsrOCUwYvuBGTf/Bvfyi4f1CL2aTeoeKQYC3g= |
| -amadan.net/oficina/suite v0.0.0-20261101214529-53b79d50971f/go.mod h1:Xgw0N+DBiDzkhQHm/nIhgumfaiMElDg/KIFD1OxTm5w= |
| +amadan.net/oficina/suite v0.0.0-20261101215312-983114acce54 h1:h2/Pv6hQ/F6CvEqv5wgrxhlYn7/fqoDrNAR0Tqnv6VQ= |
| +amadan.net/oficina/suite v0.0.0-20261101215312-983114acce54/go.mod h1:Xgw0N+DBiDzkhQHm/nIhgumfaiMElDg/KIFD1OxTm5w= |
| amadan.net/rastrillo/rastrillo v0.26.1-0.20260908075707-29e4491631bd h1:jlFSt95M1ontOg+VePU+kIJpChtWqDQAbnmlxqCnbgc= |
| amadan.net/rastrillo/rastrillo v0.26.1-0.20260908075707-29e4491631bd/go.mod h1:RpyHVPD0udcSfHJroY0KZE/FUjgw6Tvfo8SJm2qeZGE= |
| github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk= |
diff --git a/internal/fichas/suite.go b/internal/fichas/suite.go| index 10ec570..96a69e1 100644 |
| --- a/internal/fichas/suite.go |
| +++ b/internal/fichas/suite.go |
| @@ -15,7 +15,7 @@ import ( |
| ) |
| // suiteProducer is Fichas' half of the suite contract (spec §6; suite |
| -// doctrine revision 10, pinned at 53b79d5, §6.5). server.Handler owns the wire — |
| +// doctrine revision 10, pinned at 983114a, §6.5). server.Handler owns the wire — |
| // the bearer check, the decoding, the one S3 refusal — and this owns only |
| // what Fichas knows: its log, its admission list, and a card's text. |
| // |
diff --git a/internal/fichas/suite_conformance_test.go b/internal/fichas/suite_conformance_test.go| index 3a04877..31e6e15 100644 |
| --- a/internal/fichas/suite_conformance_test.go |
| +++ b/internal/fichas/suite_conformance_test.go |
| @@ -14,13 +14,13 @@ import ( |
| // fixtureNames lets the suite's custody fixture address a real Fichas |
| // world. It RENAMES and decides nothing: the fixture's item ids become the |
| -// card ids seeded for them (and back again in feed rows), and its person_ref askers become the addresses |
| -// a lone instance keys on (spec §6.7 — the fixture is suite-shape only). |
| -// Every answer is the real producer's, over a real database. |
| +// card ids seeded for them, and back again in feed rows (spec §6.7 — a |
| +// fixture id is a name, not an id Fichas could allocate). The askers need |
| +// no renaming: conformance.CheckAs sends them as addresses. Every answer is |
| +// the real producer's, over a real database. |
| type fixtureNames struct { |
| - inner server.Producer |
| - ids map[string]string |
| - askers map[suite.Subject]suite.Subject |
| + inner server.Producer |
| + ids map[string]string |
| } |
| // Feed renames each row's card id back to the fixture id it was seeded |
| @@ -39,9 +39,6 @@ func (n fixtureNames) Feed(ctx context.Context, cursor string, limit int) (suite |
| } |
| func (n fixtureNames) Rule(ctx context.Context, asker suite.Subject, pairs []suite.ItemRevision) ([]suite.Authorization, error) { |
| - if a, ok := n.askers[asker]; ok { |
| - asker = a |
| - } |
| renamed := make([]suite.ItemRevision, len(pairs)) |
| for i, pr := range pairs { |
| renamed[i] = suite.ItemRevision{ItemID: n.name(pr.ItemID), Revision: pr.Revision} |
| @@ -62,11 +59,14 @@ func (n fixtureNames) name(id string) string { |
| return id |
| } |
| -// The suite's own conformance harness, run against Fichas' real producer |
| +// The suite's own conformance harness, run as an address-keyed app |
| +// (conformance.CheckAs, suite.SubjectAddress) against Fichas' real producer |
| // over a world seeded from the custody fixture: one Customer card per case, |
| // named with the case's s3_body (so S3's exact-body check is a real check |
| // of the text shape: a card with only a title is exactly its title), edited |
| -// up to the case's revision, and the deleted case deleted. |
| +// up to the case's revision, and the deleted case deleted. The harness also |
| +// asks under person_ref, a kind Fichas does not key on, and requires |
| +// UNKNOWN; follows S1 to its tip; and refuses S3 one revision either side. |
| // |
| // The fixture describes a sharing ladder Fichas does not have (spec §6.7): |
| // every admitted person sees every card. So four cases — guest-only, |
| @@ -76,16 +76,20 @@ func (n fixtureNames) name(id string) string { |
| // ahead (a member may open the card, so a revision the log never issued is |
| // UNKNOWN for them, §4.3). This test asserts the failures are EXACTLY those |
| // twelve: any other failure, or one of these passing, is red, so a change |
| -// to the fixture on the suite branch (53b79d5, after review) is noticed |
| +// to the fixture on the suite branch (983114a, review round 2) is noticed |
| // here rather than absorbed. |
| // |
| -// MUTATION-TESTED 2026-11-01 against 53b79d5, each reverted, by how many |
| +// MUTATION-TESTED 2026-11-01 against 983114a, each reverted, by how many |
| // failures the harness then reports (12 expected): both of Content's |
| -// revision checks removed → 20 (superseded S3 served); a trailing newline |
| -// on the text → 20; admission skipped → 36 (the stranger sees everything); |
| -// gone cards answered in Rule → 15; the title repeated as a "Name:" line → |
| -// 20; feed rows never gone → 13; feed rows at revision 1 → 20; a revision |
| -// ahead answered STALE → 16. |
| +// revision checks removed → 28 (S3 served at revision ±1); a trailing |
| +// newline on the text → 20; admission skipped → 36; the person_ref branch |
| +// removed → 21 (wrong kind answered NOT_VISIBLE); gone cards answered in |
| +// Rule → 15; the title repeated as a "Name:" line → 20; feed rows never |
| +// gone → 13; feed rows at revision 1 → 20; one-row pages under a cursor |
| +// that never settles → 13 (no tip); a revision ahead answered STALE → 16. |
| +// One survivor here: the next cursor taken from a page's FIRST row repeats |
| +// rows but still ends on the right state, which is all the harness reads; |
| +// TestSuiteFeedIsTheEventLog catches it. |
| func TestSuiteConformanceFailsOnlyWhereFichasCannotExpress(t *testing.T) { |
| f, err := suite.LoadCustodyFixture() |
| if err != nil { |
| @@ -132,15 +136,11 @@ func TestSuiteConformanceFailsOnlyWhereFichasCannotExpress(t *testing.T) { |
| ids[c.ItemID] = strconv.FormatInt(card.ID, 10) |
| } |
| - names := fixtureNames{ |
| - inner: p, |
| - ids: ids, |
| - askers: map[suite.Subject]suite.Subject{ |
| - f.Asker: address(admittedAsker), // admitted: on FICHAS_OWNERS |
| - f.Stranger: address("bo@example.com"), // not admitted |
| - }, |
| - } |
| - report := conformance.Check(server.Routes(names, nil)) |
| + // CheckAs sends the fixture's asker and stranger as addresses with |
| + // their values unchanged: pers_ana is put on the owners list, as |
| + // FICHAS_OWNERS would, and pers_bo is not. |
| + a.owners = ParseOwners(f.Asker.Value) |
| + report := conformance.CheckAs(server.Routes(fixtureNames{inner: p, ids: ids}, nil), suite.SubjectAddress) |
| if report.Checked == 0 { |
| t.Fatal("conformance checked nothing") |
| } |