gosalyn: Case 2 C2-01c brief, playground levels: kind values and draft entries, other-universe refusal replacing outside-book, classify checks prefixes first with book null, the readers and every file that pins the old code; C2-05a brief gains one line for the null book and drafts, C2-06 needs none (mos-1240, sage-2218, ruling 51fdfb7e2, Vikunja 464)

This commit is contained in:
jason.woltje committed 2026-10-21 17:45:38 -05:00
1 parent 5f73b388c4
commit 524e169b8c
1 file changed
+103 -5
+103 -5
View File
@@ -340,7 +340,11 @@ reader from C2-01 has no index or query layer.
An index per commit (types, names, links, backlinks), cached in memory by commit id. Queries for find, get,
search, manuscript and universe, with the arguments and result shapes in the design 3 table. `universe`
is required. Results never leave it, except a hybrid's declared sources minus exclusions. Every result
carries `scope`. Unmapped files never appear. `links_out` and `links_in` drop other-universe and unmapped
carries `scope`. Unmapped files never appear. Playground files can have `book: null` and an entry can be a
draft with no books (design ruling after r11, three levels, built in C2-01c): a lookup that names a
`book` leaves book-null files out, `library_manuscript` never reads them, a draft has no canon so its
lookups return files only with `scope: "playground"`, and `library_universe` on a draft returns its
kind, name and prefixes. One test each. `links_out` and `links_in` drop other-universe and unmapped
targets. Results page under `REPLY_CAP` (`packages/harness/src/tools.mjs:271-280`) and are never cut.
Tests: isolation, scope labels on every query, unmapped files never returned, paging under `REPLY_CAP`,
@@ -1175,8 +1179,9 @@ Dewey runs the script and approves. It is green on Sage's gate with every `scrip
Gosalyn, 2026-10-21 (from `date -u`), for mos-1233 (Vikunja 464). Mos reads Q211 to put rooms with @tags
(TARGET.md:99) and hybrid universes (TARGET.md:82) in v1. Design 9.2's "Not ready by 10-27" is a
capacity estimate, not a cut. If one misses 10-27 it is reported late. These three briefs follow the
form above and keep every rule listed at the top of this file. Bus writes and the editor rows (C2-02,
capacity estimate, not a cut. If one misses 10-27 it is reported late. C2-01c, the playground levels
of the design ruling after r11, comes first because C2-05a and C2-06 read its `classify` (mos-1240). These
four briefs follow the form above and keep every rule listed at the top of this file. Bus writes and the editor rows (C2-02,
C2-03b, C2-11a, C2-11b, C2-19) stay as they are, since Q195 makes the editor an add-on. C2-16 to C2-18
stay later. Owners follow design 8 and Q177. Where a brief names only a model, Sage picks the seat.
@@ -1184,8 +1189,101 @@ Base: `refactor` at cca206cdc. Each row builds on its parents' candidates and re
landings (Q177). C2-09a is row 219, C2-05a row 216, C2-05b row 224, C2-06 row 217 and C2-10b row 225,
all briefed and not landed. Line cites are at cca206cdc. A builder re-reads them on its base.
New refusal codes below go to Sage with these briefs, as the rule at the top asks: `room-not-open` and
`addressee-ambiguous` (C2-09b), and the problem code R8 (C2-15).
New refusal codes below go to Sage with these briefs, as the rule at the top asks:
`library-playground-other-universe` (C2-01c, replacing `library-playground-outside-book`), `room-not-open`
and `addressee-ambiguous` (C2-09b), and the problem code R8 (C2-15).
---
## C2-01c playground levels: universe-level prefixes and draft universes
### Problem
TARGET.md:92-95 asks for a playground "where new universes can be created" and one "for books in a
universe", and says "universe-level and book-level playgrounds must be provided". C2-01 puts every
playground prefix inside one of its universe's book folders and refuses anything else with
`library-playground-outside-book` (`packages/library/src/mapping.mjs:81-86`). `classify` looks for a
book first and only then for a prefix inside it (`scope.mjs:10-20`), so a prefix outside every book
can't be playground. The design ruling after r11, "playgrounds at three levels" (gosalyn/case2-design
51fdfb7e2, Webby approved in webby-0089), sets out the fix, and this row builds it.
### Owner and reviewer
- Owner: an Opus 5.5 seat that Sage picks (design 8). Gosalyn wrote C2-01 and the ruling.
- Reviewer: Webby, who reviewed C2-01 and the ruling.
- After: C2-01 (row 212, landed ee7b2f137). Before C2-05a (row 216) and C2-06 (row 217), which read
`classify`. If either has a candidate by then, this row's change goes into that candidate as well, and
its owner reruns its tests on the new `classify`. C2-05a's brief gains one What ships line for the null
book and drafts in this same commit. C2-06's brief needs none: its guard takes `universe` from
`classify`, so a draft is its own universe and `citation-cross-universe` covers it unchanged.
### Files owned
- `packages/library/src/mapping.mjs` (the universe entry checks) and `src/scope.mjs` (`classify`).
- `packages/library/README.md`: the universe keys at `:36` and the refusal table at `:44-45`.
- `packages/library/tests/mapping.test.mjs` (`:16-20` and `:72` pin the old code) and a scope test file.
- `packages/business/tests/business.test.mjs:24-25`. Its `Elsewhere/Playground/` prefix becomes a valid
universe-level playground, so the case moves to a prefix inside another universe's book and the new
code.
- `docs/case2/SETUP-SHEET.md` ("Your playground", `:23-27`): one line per level and the draft entry.
- `docs/case2/SURVEY-RUN.md:114`: the refusal line names the new code and text.
### What ships
From the ruling, which wins if this brief and it disagree:
- `kind` is absent for a plain universe, `"hybrid"` or `"draft"`. Any other value refuses
`library-mapping-invalid`. A draft takes only `kind`, `name` and `playground`, and needs at least one
prefix. A draft with `books` refuses `library-mapping-invalid`. A plain universe and a hybrid keep
their key lists.
- Three levels, set by where a prefix sits. Book level is a prefix inside one of the entry's own book
folders, as now. Universe level is a prefix in a plain universe's `playground` that lies outside every
book folder of every entry. A draft's prefixes lie outside every book folder.
- Refusals. A prefix inside, or holding, another entry's book folder refuses
`library-playground-other-universe`. A prefix holding one of its own entry's book folders, or equal to a
book folder, refuses `library-mapping-invalid`. The rules that no prefix holds another and none is
listed twice cover all levels and entries (`:123-124`). A hybrid's `sources` naming a draft refuses
`library-mapping-invalid` (`:115-120`). `library-playground-outside-book` is gone.
- `classify` checks prefixes first. A `.md` file under any entry's prefix is `playground`, with that
entry's id as `universe`, the book folder that holds the prefix as `book`, or `null` at universe level
and in a draft. `type` and `folder` come from the first folder under the prefix, as now. Otherwise a
`.md` file in a book folder is `canon`, and everything else is `unmapped`. The comment at
`scope.mjs:5-7` says so.
- Readers at cca206cdc that see the change: `reader.mjs:182` and `:194` copy `book` into each file
record, and `:206-209` gives R6 for a canon link into a draft, since a draft is never a source.
`survey.mjs:66` and `mirror.mjs:246` read only `scope`. A builder re-reads these on its base, and
checks C2-05a's and C2-06's candidates, if any exist, for code that assumes a non-null `book` or a
non-empty `books`.
Tests:
- One case per level. A book-level file has its universe and book. A universe-level file has its
universe and `book: null`. A draft file has the draft's id and `book: null`. A `.canvas` under a prefix
stays `unmapped`.
- One case per refusal: a prefix inside another entry's book, a prefix holding another entry's book, a
prefix holding its own book, a draft with `books`, a draft with no prefix, an unknown `kind`, a hybrid
source naming a draft, and two overlapping prefixes in different entries.
- A reader case: a canon file linking into a draft gives R6, and linking into a universe-level prefix of
its own universe gives R5.
- `business.test.mjs` refuses the moved prefix with the new code through `validateBusinessDocument`.
### Out of scope
The lookups' handling of a null book and of drafts: `library_find`'s book filter, `library_manuscript`
and the `library_universe` reply belong to C2-05a (its brief's What ships line), and the guard's
universe check to C2-06. This row
only gives them the right `classify`. Promotion of a draft is her hand edit under M9 (C2-04), with no
verb. Hybrid `exclude` and `pin` (C2-15).
### Gate
Webby approves the manifest. The library and business suites are green on Sage's gate, along with every
`scripts/test-*.sh`. Grep `packages/*/tests` and `docs` for `library-playground-outside-book` before
in-review: no hit may remain.
### Handoffs
Every seat hands off directly (DECISIONS Q210, mos-1221). When the owner pushes a build or a new round,
or the reviewer posts a verdict, that seat messages the next seat's T3 thread and Sage's with
`mcp__t3__t3_send_message`. Copy Mos's thread only when Mos has a step.
---