dreamteamer 0.32.0 → 0.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +4 -2
  2. package/collections/agents.collection.yaml +41 -32
  3. package/collections/collections.collection.yaml +68 -230
  4. package/collections/command-bindings.collection.yaml +37 -43
  5. package/collections/commands.collection.yaml +50 -35
  6. package/collections/mixins.collection.yaml +49 -0
  7. package/collections/modules.collection.yaml +76 -122
  8. package/collections/repos.collection.yaml +53 -56
  9. package/collections/skills.collection.yaml +32 -21
  10. package/collections/ui-views.collection.yaml +57 -46
  11. package/mixins/docs.mixin.yaml +21 -0
  12. package/mixins/entity.mixin.yaml +22 -0
  13. package/package.json +5 -3
  14. package/scripts/migrate-descriptors-v2.mjs +795 -0
  15. package/skills/using-dreamteamer/SKILL.md +27 -24
  16. package/skills/using-dreamteamer/references/agents.md +1 -1
  17. package/skills/using-dreamteamer/references/before-you-build.md +1 -5
  18. package/skills/using-dreamteamer/references/collections.md +450 -348
  19. package/skills/using-dreamteamer/references/commands.md +49 -35
  20. package/skills/using-dreamteamer/references/data-modeling.md +342 -319
  21. package/skills/using-dreamteamer/references/extensions.md +8 -5
  22. package/skills/using-dreamteamer/references/getting-started.md +6 -4
  23. package/skills/using-dreamteamer/references/records.md +43 -34
  24. package/skills/using-dreamteamer/references/skills.md +4 -3
  25. package/skills/using-dreamteamer/references/ui-components.md +30 -32
  26. package/skills/using-dreamteamer/references/ui-views.md +122 -124
  27. package/src/api.d.ts +22 -2
  28. package/src/api.js +16 -1
  29. package/src/check.js +55 -40
  30. package/src/checkout.js +14 -13
  31. package/src/cli.js +118 -71
  32. package/src/collections-cli.js +136 -144
  33. package/src/commit.js +9 -8
  34. package/src/compile-collections.js +346 -0
  35. package/src/compile.js +232 -1068
  36. package/src/descriptor-v2.js +165 -0
  37. package/src/descriptor.js +90 -0
  38. package/src/doctor.js +57 -0
  39. package/src/events.js +11 -10
  40. package/src/extensions.js +48 -10
  41. package/src/field-values.js +7 -6
  42. package/src/fields.js +254 -0
  43. package/src/filter.js +45 -1
  44. package/src/fractional-index.js +2 -2
  45. package/src/harnesses.js +80 -52
  46. package/src/history.js +3 -3
  47. package/src/init.js +74 -46
  48. package/src/namespace.js +23 -9
  49. package/src/placement.js +26 -16
  50. package/src/presentation.js +153 -299
  51. package/src/record-commands.js +12 -12
  52. package/src/records-api.d.ts +106 -7
  53. package/src/records-api.js +2 -1
  54. package/src/records.js +20 -14
  55. package/src/ref.js +3 -39
  56. package/src/relations.js +23 -24
  57. package/src/runtime.js +12 -35
  58. package/src/schema-ops.js +1181 -1275
  59. package/src/store.js +212 -82
  60. package/src/template.js +100 -24
  61. package/src/temporal.js +11 -3
  62. package/src/views.js +176 -0
  63. package/src/workspace.js +14 -0
  64. package/src/yaml.js +66 -5
  65. package/collection-templates/docs.collection-template.yaml +0 -17
  66. package/collection-templates/entity.collection-template.yaml +0 -20
  67. package/collections/collection-templates.collection.yaml +0 -20
@@ -4,12 +4,13 @@ Core is records plus the workspace compiler. Anything with a lifecycle of its ow
4
4
  Docker host, a behaviour-test runner, an exporter to one vendor — is an **extension**: code the engine
5
5
  calls, which a workspace has when it wants that capability and does without otherwise.
6
6
 
7
- The verbs that left core in 0.31.0 — `prove` · `land` · `worktree`, `serve`, `notebooklm`, and the
8
- Docker host — return as extensions, and **none is published yet**. Typed against core, each fails with
9
- exit 2 and says so. A workspace that needs one now carries it as its own module (below), or stays on
10
- 0.30.x.
7
+ The verbs core does not ship live in packages: `prove` in `@dreamteamer/proofs`, `land` and
8
+ `worktree` in `@dreamteamer/worktrees`, `serve` in `@dreamteamer/http`, `notebooklm` in
9
+ `@dreamteamer/notebooklm`, and the container verbs in the global `dt-docker` bin. Typed without the
10
+ package, each exits 2 and prints its install line.
11
11
 
12
- `dt status` lists the extensions this workspace loaded, and `dt help` appends each one's usage.
12
+ `dt status` lists the extensions this workspace loaded, `dt help` appends each one's usage, and
13
+ `dt doctor` shows what works on this machine — the engine's rows, then each extension's checks.
13
14
 
14
15
  ## how a workspace turns one on
15
16
 
@@ -47,6 +48,8 @@ never disagree with the one the operator ran. It returns a contribution; every k
47
48
  | `harnesses` | `{ <id>: (ctx) → { blocks: { <file>: text }, summary } }` | a harness adapter writing managed blocks into user-owned files |
48
49
  | `orientation` | a string | one paragraph appended to every orientation block |
49
50
  | `hooks` | `{ <ClaudeHookEvent>: '<dt verb args>' }` | merged into `dt install --print-adapters` |
51
+ | `check` | `({ root, ws, dt }) → [{ file, message }]` | `dt check` reports each as a violation after the schema's, attributed to the extension; a throw is a violation too |
52
+ | `doctor` | `({ root, ws, dt }) → [{ label, state: ok\|warn\|bad, detail?, fix? }]` | `dt doctor` renders the rows as one capability named after the extension: READY, DEGRADED (a warn) or UNAVAILABLE (a bad), each fix on its row |
50
53
 
51
54
  The `draft` is data only: the staged entries, the final merged descriptors, the modules, declared var
52
55
  and env key NAMES, and the previous manifest. No writer, no Store, no environment values — an analysis
@@ -31,9 +31,11 @@ npx dreamteamer check # should report 0 violations over the starter collec
31
31
 
32
32
  `init` writes the `dreamteamer` block into `package.json` (the workspace manifest —
33
33
  `collections.md`), a workspace module at `modules/default/` with a starter `notes` collection,
34
- and `.env.example`. `compile` is what makes it real: the runtime under `.dreamteamer/`, the
35
- harness folders, and the orientation block every future agent session reads — which is how the
36
- next session finds this skill without being told.
34
+ `.env.example`, and a `.gitignore` covering the build output. `compile` is what makes it real: the
35
+ runtime under `.dreamteamer/`, the harness folders, and the root `CLAUDE.md`/`AGENTS.md`/`GEMINI.md`
36
+ whose orientation block every future agent session reads — which is how the next session finds
37
+ this skill without being told. Those three files are compiled, never committed; the workspace's
38
+ own rules go in `DREAMTEAMER.md`, which compile copies into them.
37
39
 
38
40
  ## git, in plain words
39
41
 
@@ -108,7 +110,7 @@ prefers. Nothing about the code moves; `check` and `compile` read only what desc
108
110
  | modeling the whole domain up front | one collection used tomorrow beats five perfect ones — widening is always safe later (`data-modeling.md` Part IX) |
109
111
  | test data in the seed records | real records are what catch the model's mistakes |
110
112
  | skipping git as "too technical" | one local command, no account — and it is the history, the undo and the publish step |
111
- | inventing ids by hand | `id.generate` owns identity — pass `--id` only when the operator named one |
113
+ | inventing ids by hand | `ids.from` owns identity — pass `--id` only when the operator named one |
112
114
  | hand-writing the first descriptor | `dt add collections` is compile-gated and publishes itself; hand-written sources owe `dt compile` |
113
115
  | rewriting existing files to fit a guessed schema | describe reality, compile, `check` — then decide which violations are worth fixing in the data |
114
116
  | waiting for a UI before starting | the CLI and the records are the complete system; any surface renders them later, unchanged |
@@ -23,11 +23,12 @@ the verbs and flags are `dt help`'s job; what to know *about* them:
23
23
  in one `--where`** — its operator grammar is enumerated in `dt help`, and it is
24
24
  the same one views and gates use — e.g.
25
25
  `dt list health/prescriptions --where '{"_and":[{"patient":{"_eq":"health/patients/dana-levi"}},{"status":{"_eq":"active"}}]}'`.
26
- ⚠ an unknown field or a dangling ref **narrows to nothing** rather than erroring — filter field
27
- names deserve the same care as code.
28
- - ⚠ **there is no `@me` and no `users` collection** (both removed in 0.8.0). when a person is
29
- needed, read `git config user.name`; filter on a person only when this workspace ships its own
30
- collection of people.
26
+ `$today` and `$now` are the two value tokens (`{"date":{"_lte":"$today"}}`); any other `$word`
27
+ is refused. `--filter` and `--sort` refuse a field the collection lacks, but inside `--where`
28
+ ⚠ an unknown field or a dangling ref **narrows to nothing** rather than erroring.
29
+ - ⚠ **there is no `@me` and no `users` collection.** when a person is needed, read
30
+ `git config user.name`; filter on a person only when this workspace ships its own collection of
31
+ people.
31
32
  - `dt values <collection> <field>` is a field's *actual* vocabulary — what a proposal, a filter
32
33
  or a validator should offer as choices.
33
34
  - `--json` works on every record and reporting verb (`resolve` excepted) — use it whenever
@@ -38,29 +39,35 @@ the verbs and flags are `dt help`'s job; what to know *about* them:
38
39
  ## writing through the CLI
39
40
 
40
41
  - **validation is hard and includes unknown fields.** a typo'd key (`--assinee`), a dangling ref,
41
- a bad enum value (the error echoes what it got), an id missing `id.pattern` — rejected with
42
+ a bad enum value (the error echoes what it got), an id missing `ids.pattern` — rejected with
42
43
  nothing written. a rejected write leaves no partial state.
43
44
  - **a write puts the record on disk; `dt commit` publishes it** — committing is workspace policy
44
- (`auto-commit` in `package.json`, default off), never part of the write.
45
- - `set <collection>/<id> <field>=` with an empty value **removes** the field; the `x-body` field is
45
+ (`auto_commit` in `package.json`, default off), never part of the write.
46
+ - `set <collection>/<id> <field>=` with an empty value **removes** the field; the body field is
46
47
  set like any other field.
48
+ - **some fields refuse every writer**, naming why: a generated mirror (set the owner's field
49
+ instead), `created` (the engine stamps it at add), and `id` / `last_modified` (computed on read).
50
+ a `unique` value another record holds is refused too, naming that record.
47
51
  - an **array field** takes a comma-separated value (`--tags a,b`, `tags=a,b`) — or the flag/pair
48
52
  **repeated**, one element per sighting (`--tags a --tags b`), which is how a value that itself
49
- contains a comma gets written. ⚠ repeating a **scalar** field is refused, naming it: it used to
50
- keep the last value silently, so the first one never reached disk.
53
+ contains a comma gets written. ⚠ repeating a **scalar** field is refused, naming it.
51
54
  - ids generate from the record's own creation-time values — pass `--id` only when the operator
52
- named one.
55
+ named one, or when the generated id collides (the refusal names the record holding it).
56
+ - a `type: position` field is the collection's manual order: `dt reorder <collection>/<id>
57
+ --after|--before <id> | --top | --bottom`, never a hand-set value.
53
58
 
54
59
  ## before writing anything
55
60
 
56
- read the compiled descriptor: `.dreamteamer/collections/<collection>.collection.yaml`. it defines
57
- `storage` (path/codec/shape/suffix), `id` (`generate` template + `pattern`), and `schema` (JSON
58
- Schema; the `x-` keywords carry the domain semantics — `x-reference`, `x-body`, `x-inverse`). it
59
- also carries `title` (what to call the collection) and `title_template` (how to label one record).
61
+ read the compiled descriptor: `.dreamteamer/collections/<collection>.collection.yaml`. it holds
62
+ what the author wrote — `fields` (each with its `type`, `required`, `enum`, `description`…),
63
+ `storage`, `ids` (`from` + `pattern`), `record_title`, `display` — and a `compiled:` block with
64
+ what compile decided: `defaults` (every value it supplied), `fields` (resolved, the injected `id`,
65
+ `created` and `last_modified` included) and `json_schema` (what the validator runs). the field
66
+ vocabulary is `collections.md`.
60
67
 
61
- the schema is the CONTRACT, and it is required to be sufficient: each field's `description`
62
- carries its conventions, an `examples:` annotation (standard JSON Schema — compile passes it
63
- through to the compiled descriptor) carries a canonical value where the shape is non-obvious, and
68
+ the descriptor is the CONTRACT, and it is required to be sufficient: each field's `description`
69
+ carries its conventions, an `examples:` list carries a canonical value where the shape is
70
+ non-obvious, and
64
71
  `dt values` shows a vocabulary's real spread. so **with a sufficient schema, do not open sibling
65
72
  records for shape** — the descriptor answers faster than a peek, the validator rejects a wrong
66
73
  write before disk, and a sibling is a bet on whichever record you grabbed being representative
@@ -83,13 +90,14 @@ the same breath, so the next writer needs no peek. then:
83
90
  - put the file where the id says: the id IS its path inside `storage.path`, minus suffix and
84
91
  extension (folder-shape records are a folder named `<id>` holding the descriptor's `entry`).
85
92
  the id template is evaluated ONCE, at creation, and never re-derived — a later edit to a field
86
- it named does not move the record — and the result must satisfy `id.pattern`.
93
+ it named does not move the record — and the result must satisfy `ids.pattern`.
87
94
  - **materialize defaults explicitly** — write `status: todo` even though it's the schema default;
88
- a file should be legible without its schema.
95
+ a file should be legible without its schema. leave `created` out: a hand-written record reads
96
+ it from the commit that added the file (or from its id, when `ids.from` names `created`).
89
97
  - `dt check` is the only validation a hand-write gets. run it before you commit.
90
98
 
91
- example — `data/tasks/2026-07-25--fix-login-flow.task.md` (`md` codec: frontmatter holds the
92
- fields, the body is the single `x-body: true` field):
99
+ example — `data/tasks/2026-07-25--fix-login-flow.task.md` (`format: md`: frontmatter holds the
100
+ fields, the body is the single `body: true` field):
93
101
 
94
102
  ```markdown
95
103
  ---
@@ -103,8 +111,8 @@ Users report the login button does nothing on mobile.
103
111
 
104
112
  ## namespaced collections
105
113
 
106
- a collection may be scoped under a namespace declared in the workspace `package.json`
107
- (`dreamteamer.namespaces`). working with its records is unchanged except that the QUALIFIED name
114
+ a collection may be scoped under a namespace its module declares (`dreamteamer.namespaces` in
115
+ the module's `package.json`). working with its records is unchanged except that the QUALIFIED name
108
116
  is the collection's name everywhere: `health/doctors/dana-levi` is the collection `health/doctors`
109
117
  and the id `dana-levi` — a reference splits at the end of the **declared** prefix, never at the
110
118
  first slash. the default namespace has no prefix (`tasks/kickoff`, exactly as always), and an
@@ -114,7 +122,9 @@ undeclared prefix reads as a nested id and dangles — `dt check` says so. decla
114
122
  ## records stored under another record — the folder follows the owner
115
123
 
116
124
  a collection may declare `storage.under` (`collections.md`): a meeting with a `company` lives in
117
- that company's folder, one without stays in `data/meetings/`. working with it is unchanged in
125
+ that company's folder, one without stays in `data/meetings/`. with `under.id: nested` the id
126
+ begins with the parent's and changing the parent is a `dt rename`, not a `dt set`; the rest of
127
+ this section is the default, independent id. working with it is unchanged in
118
128
  every way that names a record — `list` is the whole collection, `get`/`set`/`rm`/`rename` take
119
129
  `meetings/<id>` wherever the file sits, references never carry a folder — and different in one:
120
130
  **the owner field moves the file.** `dt set meetings/<id> company=companies/harbor` relocates the
@@ -130,9 +140,8 @@ the declaration is removed or its path changed: `dt relocate <collection> --to-r
130
140
 
131
141
  ## two-way relations — the mirror is generated, and read-only
132
142
 
133
- a reference field may declare `x-inverse`: compile GENERATES the field it names on the TARGET
134
- collection, and the store maintains that value in the same write as every change to the owning
135
- side. so **never set or hand-edit a mirror** — `dt set` refuses it, and a hand-edit is what
143
+ a field on the TARGET collection may declare `mirror_of: <owner field>`: it is GENERATED, and
144
+ the store maintains its value in the same write as every change to the owning side. so **never set or hand-edit a mirror** — `dt set` refuses it, and a hand-edit is what
136
145
  `check` reports as `<field>: stale`; write the owning side's reference and the mirror follows.
137
146
  `dt relations` lists every pair (owner.field → target.mirror, cardinality, on-delete) and
138
147
  `dt relations rebuild <collection>` recomputes mirror values from the owning side — the repair
@@ -158,8 +167,8 @@ source_file: ${env:FILES_FOLDER}/2026/q3.pdf
158
167
  - **an attached FILE follows the filing convention**: a files folder is named after the
159
168
  collection or field that indexes it, and the path below it is the record id —
160
169
  `${env:FILES_FOLDER}/visit-recordings/<record id>.m4a` needs no lookup table. a collection
161
- whose records ARE files (`codec: file` — icons, images) is written with
162
- `dt add <collection> --from <path>`, never with field flags: the fields derive from the file.
170
+ whose records ARE files (`format: binary` — icons, images) is written with
171
+ `dt add <collection> <id> --from <path>`, never with field flags: the fields derive from the file.
163
172
  - ⚠ **templates are ordinary data — write them literally.** `get`, `list`, `check` and every
164
173
  harness read the template verbatim; nothing substitutes until resolve is called.
165
174
 
@@ -167,7 +176,7 @@ source_file: ${env:FILES_FOLDER}/2026/q3.pdf
167
176
 
168
177
  - **commit when a logical change is complete.** an uncommitted write is invisible to `dt changes` and to every
169
178
  other CLONE — while a session SHARING this tree sees it immediately, which is why the sweep
170
- rules below exist — `auto-commit` off makes the commit a deliberate act, not a
179
+ rules below exist — `auto_commit` off makes the commit a deliberate act, not a
171
180
  forbidden one, and publishing what the operator asked you to write needs scope, not permission.
172
181
  `dt status` says what is pending.
173
182
  - **records are `dt commit`'s to publish; sources are git's.** a module source change (a
@@ -189,7 +198,7 @@ source_file: ${env:FILES_FOLDER}/2026/q3.pdf
189
198
  own owner is dirty from someone else: scope to the pair rather than publish half of anyone's
190
199
  work. the COLLECTION form publishes exactly what it names and prints the partners it left
191
200
  pending — HEAD then fails `dt check` until they land.
192
- - **one commit per REPO.** a module can own its records (`owns-data` in its package.json), and
201
+ - **one commit per REPO.** a module can own its records (`owns_data` in its package.json), and
193
202
  git has no cross-repo commit — a rename whose inbound refs live in another repo is TWO commits;
194
203
  `dt commit` prints both.
195
204
  - when git is used directly (hand-edited markdown bodies), stage the specific files — never
@@ -216,7 +225,7 @@ every inbound reference; `dt rename` moves the file and rewrites
216
225
  every inbound ref in the same WRITE — `dt commit` then publishes the whole rename together (the
217
226
  entanglement guard prints the set to name). **never
218
227
  delete a referenced record** — `rm` refuses while anything points at it, unless that field
219
- declares `x-on-delete: set-null`, which clears it instead; retarget first. **a changed title
228
+ declares `on_delete: set-null`, which clears it instead; retarget first. **a changed title
220
229
  never changes the id.** **one logical change, one commit** — a bulk import is ONE change, not
221
230
  two hundred.
222
231
 
@@ -231,7 +240,7 @@ two hundred.
231
240
  | `--force` to get past an `rm` refusal | it leaves inbound refs dangling — retarget them first (unless the refusal named a *prose* mention, which isn't a real reference) |
232
241
  | omitting schema defaults from a hand-written file | the file stops being legible without the schema |
233
242
  | unquoted `due: 2026-07-28` in hand-written YAML | dreamteamer parses CORE_SCHEMA so it stays a string *here*, but a default-schema YAML reader turns it into a timestamp — quote dates |
234
- | setting a generated mirror | refused by `set`; a hand-edit goes stale — write the owning side |
243
+ | setting a generated mirror, or `created` | refused by `set`; a hand-edit of a mirror goes stale — write the owning side |
235
244
  | CLI-editing a skill / agent / command / collection | system sources — edit the module file, then `dt compile` |
236
245
  | resolving a template by hand | `dt resolve` is the only substitution point |
237
246
 
@@ -32,7 +32,8 @@ duplicate beside it is worse than the gap.
32
32
 
33
33
  - **One-off fixes** — just do them. A narrative of how you solved something once is a story, not a
34
34
  skill; keep the *technique* if it generalizes, drop the episode.
35
- - **Workspace conventions** — `CLAUDE.md` is loaded always and needs no trigger; a convention in a
35
+ - **Workspace conventions** — `DREAMTEAMER.md` is compiled into every harness's instruction file,
36
+ loaded always, and needs no trigger; a convention in a
36
37
  skill is a convention a session might not load.
37
38
  - **Anything a validator can enforce** — automate it and save prose for judgment calls. A regex in
38
39
  `check` never gets skimmed past; a sentence does.
@@ -44,9 +45,9 @@ duplicate beside it is worse than the gap.
44
45
 
45
46
  How a skill is found differs by harness, and both routes run through the same line. claude-code
46
47
  discovers skills natively — the harness reads each description and offers the skill when it
47
- matches. Every other harness gets the descriptions compiled into the committed orientation block
48
+ matches. Every other harness gets the descriptions compiled into the generated orientation block
48
49
  (`AGENTS.md`, `GEMINI.md`, `.cursor/rules/…`) as a trigger index. Two consequences: the description
49
- travels into committed files (one line, third person, nothing sensitive), and it is the **only**
50
+ travels into every harness file (one line, third person, nothing sensitive), and it is the **only**
50
51
  thing any session sees before deciding to load.
51
52
 
52
53
  So the description states **when to load** — symptoms, situations, verbs — and never what the skill
@@ -11,9 +11,9 @@ you climb only as far as the job forces you:
11
11
 
12
12
  | you want | try first |
13
13
  |---|---|
14
- | a different control for a field | the **descriptor** — shape drives the control (`data-modeling.md` Part VII: enum → dropdown, array → chips, `x-body` → the page) |
15
- | a different arrangement of a collection | a **ui-view** with a registered layout (`ui-views.md`) |
16
- | the same layout, tuned | the view's `options` |
14
+ | a different control for a field | the **descriptor** — shape drives the control (`data-modeling.md` Part VII: enum → dropdown, `many` → chips, `body: true` → the page), and a field's `display.editor` / `display.viewer` names a registered one |
15
+ | a different arrangement of a collection | `display.list.layout` — on the collection, or a **ui-view** (`ui-views.md`) |
16
+ | the same layout, tuned | `display.list.options` |
17
17
  | a rendering or editing behaviour nothing registered has | **component code** — this reference |
18
18
 
19
19
  | the question | read |
@@ -28,10 +28,10 @@ you climb only as far as the job forces you:
28
28
 
29
29
  | registry | what it holds | bound by |
30
30
  |---|---|---|
31
- | `edits` | field editors, **and whole-record Edit pages** (`scope: 'record'`) | a field's resolved edit id; record pages via presets |
32
- | `views` | field read-renderers, and whole-record View pages | a field's resolved view id; record pages via presets |
33
- | `lists` | collection browse arrangements (table, cards, kanban, …) | a `ui-view` record's `layout` |
34
- | `apps` | routed subtrees + a nav icon (mounted under `/a/<id>`) | registration alone; a `page`-target ui-view can name one |
31
+ | `edits` | field editors, **and whole-record Edit pages** (`scope: 'record'`) | a field's `display.editor`, else its type's kind default |
32
+ | `views` | field read-renderers, and whole-record View pages | a field's `display.viewer`, else its type's kind default; `display.record.layout` for a record page |
33
+ | `lists` | collection browse arrangements (table, cards, kanban, …) | `display.list.layout`, on a collection or a ui-view |
34
+ | `apps` | routed subtrees + a nav icon (mounted under `/a/<id>`) | registration alone; a `scope: page` ui-view can name one |
35
35
  | `panels`, `operations` | dashboard panels, flow operations | registration alone |
36
36
 
37
37
  "A record page is an Edit/View too": the built-in record pages (`form`, `doc`, `properties`,
@@ -41,14 +41,14 @@ reference implementation for everything on this page.
41
41
 
42
42
  ## resolution — how the surface picks a component
43
43
 
44
- For a **field**, the chain is: the explicit edit/view id on the field's presentation row → the
45
- **kind default** for the field's wire type → the ultimate fallback (`input` / `text`). Two facts
46
- worth internalizing:
44
+ For a **field**, the chain is: the `editor`/`viewer` on the field's presentation row (its
45
+ `display.editor`/`display.viewer`, when authored) → the **kind default** for the field's wire type
46
+ and role → the ultimate fallback (`input` / `text`). Two facts worth internalizing:
47
47
 
48
- - **The explicit ids are derived by the engine, not authored.** The presentation projection maps
49
- descriptor shape to component ids (enum → `select-dropdown`, string array → `tags`, object array
50
- → `list`, `x-body` → the markdown editor…). You change a field's control by changing its
51
- *shape*, not by naming a widget in the descriptor.
48
+ - **The row carries the authored type name, `role` and `many`** (`data-modeling.md` §29), and the
49
+ surface picks the control from them — so most fields need no id at all: change the *shape* and
50
+ every surface follows. Name an id in `display` only for a field whose shape genuinely cannot say it
51
+ (a location drawn as a map pin).
52
52
  - **The kind-default maps are module-extensible**: `registerKindDefault('view', 'geometry', 'map')`
53
53
  makes your component the default for a wire type across the whole workspace without touching
54
54
  core resolution.
@@ -56,19 +56,18 @@ worth internalizing:
56
56
  Every miss in the chain **degrades with a reported reason, never a blank** — the same posture as
57
57
  everything else on this page.
58
58
 
59
- For a **collection browse**, a `ui-view.layout` names a List id (unregistered → visible degrade to
60
- `table`). For a **record page**, preset records pick a record-scoped Edit/View (built-in default:
61
- `properties`), workspace-local default beating a module-shipped one.
59
+ For a **collection browse**, `display.list.layout` names a List id (unregistered → visible degrade
60
+ to `table`). For a **record page**, `display.record.layout` names a record-scoped Edit/View
61
+ (default `page`).
62
62
 
63
- So a module has three binding surfaces, none of which is "edit a descriptor": a ui-view's `layout`
64
- for a browse, `registerKindDefault` for all fields of a wire type, and a preset default for record
65
- pages.
63
+ So a module has four binding surfaces: `display.list.layout` for a browse, `display.record.layout`
64
+ for a record page, a field's `display.editor`/`viewer`, and `registerKindDefault` for all fields of
65
+ a wire type.
66
66
 
67
67
  ## the module contract
68
68
 
69
69
  A module ships a browser entry — `ui/app.js` (plain JS, host-provided Vue) or a built
70
- `ui/dist/app.js` (which wins when both exist; `studio/` is the legacy folder name and still
71
- accepted). Compile stages it to `.dreamteamer/ui/<shortName>/app.js` — shortName is the package
70
+ `ui/dist/app.js` (which wins when both exist; a `studio/` folder is read the same way). Compile stages it to `.dreamteamer/ui/<shortName>/app.js` — shortName is the package
72
71
  name made url-safe (`@a/crm` → `a--crm`; a collision fails compile) — and the surface
73
72
  dynamic-imports every staged entry at boot. The **default export** is a register function:
74
73
 
@@ -87,7 +86,7 @@ export default ({ registerEdit, registerView, registerList, registerApp, registe
87
86
  `import { useRouter } from 'vue-router'` — only Vue itself is host-exposed. Use it for
88
87
  programmatic navigation.
89
88
  - **`registerApp` routes mount under `/a/<id>`** — a module route `path: 'board'` resolves at
90
- `/a/<id>/board`, `path: ''` is the app index. A `page`-target ui-view renders the app's **first
89
+ `/a/<id>/board`, `path: ''` is the app index. A `scope: page` ui-view renders the app's **first
91
90
  declared route**, so list the index first.
92
91
  - A UI bundle **is** a module contribution: a module that ships only a layout is a legitimate
93
92
  module.
@@ -95,7 +94,7 @@ export default ({ registerEdit, registerView, registerList, registerApp, registe
95
94
  ## design rules — the sharp edges
96
95
 
97
96
  - **Give every entry an explicit, stable `id`.** That string is the entire binding surface — every
98
- ui-view `layout`, preset and kind default names it. Renaming it breaks all of them, silently.
97
+ `display.*.layout`, `display.editor`/`viewer` and kind default names it. Renaming it breaks all of them, silently.
99
98
  - **`types` advertises picker candidacy — it never sets a default.** A non-empty `types` array
100
99
  offers your Edit/View in the field designer's picker for those wire types; the *actual* kind
101
100
  defaults live in one place — the kind-default maps, changed only by `registerKindDefault` (or by
@@ -114,7 +113,7 @@ export default ({ registerEdit, registerView, registerList, registerApp, registe
114
113
  - **Failures are isolated, not surfaced.** A module whose entry fails to import or throws while
115
114
  registering is caught, warned and skipped — the surface still loads, your component just never
116
115
  appears. **Read the browser console**; nothing else will tell you. (The visible symptom
117
- elsewhere: a `page` ui-view rendering its "not registered" placeholder.)
116
+ elsewhere: a `scope: page` ui-view rendering its "not registered" placeholder.)
118
117
  - ⚠ **Portalled UI cannot rely on scoped CSS.** Menus, popovers and dialogs are teleported outside
119
118
  the component subtree, so a scoped rule looks correct in the source and is simply absent at
120
119
  runtime — the failure mode is invisible chrome, not an error. Define those styles globally.
@@ -128,26 +127,25 @@ export default ({ registerEdit, registerView, registerList, registerApp, registe
128
127
 
129
128
  1. **Write** the component in the module's `ui/` tree.
130
129
  2. **Register** it in that module's `app.js` with a stable `id`. Plain-JS `app.js` needs no build;
131
- a module wanting a toolchain builds to `ui/dist/app.js` itself. (No `package.json` declaration
132
- is needed — a `studio.layouts` allowlist once existed, had zero users ever, and was removed;
133
- unregistered ids degrade visibly instead. Decision 195.)
130
+ a module wanting a toolchain builds to `ui/dist/app.js` itself. No `package.json` declaration
131
+ is needed; an unregistered id degrades visibly.
134
132
  3. **Compile** — that stages the bundle into the runtime.
135
133
  4. **Look at it in the real surface** — reload the window so boot re-imports the staged bundle,
136
134
  and open the console before deciding it "didn't work".
137
- 5. **Bind it** — a ui-view's `layout`, a `registerKindDefault` call, or a preset default. Only
138
- this step touches records.
135
+ 5. **Bind it** — a `display.*.layout`, a field's `display.editor`/`viewer`, or a
136
+ `registerKindDefault` call. Only this step touches sources.
139
137
 
140
138
  ## common mistakes
141
139
 
142
140
  | mistake | reality |
143
141
  |---|---|
144
142
  | looking for a ui-components collection | there isn't one; this is code |
145
- | naming a widget in a descriptor | field controls are derived from shape — change the shape, or register a kind default |
143
+ | naming a widget in `display.editor` where a shape would say it | the shape reaches every surface; an id reaches only surfaces that registered it |
146
144
  | bundling Vue | two copies; reactivity dies silently |
147
145
  | assuming a registration error is reported | swallowed by fault isolation — read the console |
148
146
  | `types: ['string']` on a bespoke widget | it is offered in the picker for every string field — candidacy, not default; defaults change only via `registerKindDefault` |
149
147
  | omitting `id`, or renaming it later | the id is the binding surface; every record naming it breaks |
150
148
  | reusing a core layout id | silently shadows the built-in with no warning |
151
- | declaring layouts in `package.json` | retired (decision 195) — registration in `app.js` is the whole mechanism |
149
+ | declaring layouts in `package.json` | registration in `app.js` is the whole mechanism |
152
150
  | binding before building | the id does not exist yet; the view degrades to `table` |
153
151
  | scoped CSS on a menu or dialog | portalled outside the subtree — style those globally |