@aestheticfunction/dspack-emit 0.5.0 → 0.6.0

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.
@@ -59,3 +59,417 @@ export const SHADCN_V2_SURFACES: Record<string, SurfaceV2> = {
59
59
  ],
60
60
  },
61
61
  };
62
+
63
+ /**
64
+ * T1 resolutions for the production v3 contract — the transparent-identity
65
+ * spellings proven by src/t1.test.ts against the named production failure
66
+ * (`card > form > form-field > form-item > form-label + input`). Consumed by
67
+ * the eval fixture builder as committed mapping evidence; the fixture's other
68
+ * unresolved decisions stay deliberately open.
69
+ */
70
+ export const SHADCN_V3_T1_SURFACES: Record<string, SurfaceV2> = {
71
+ form: {
72
+ transparent: true,
73
+ subs: {
74
+ "form-field": "transparent",
75
+ "form-control": "transparent",
76
+ "form-item": { transparent: { donate: [{ from: "sub(form-label).text", to: "prop:label" }] } },
77
+ "form-description": { asText: "caption" },
78
+ "form-message": { drop: "validation state is runtime data the declarative surface does not carry" },
79
+ },
80
+ },
81
+ };
82
+
83
+ /**
84
+ * T2 resolutions for the production v3 contract — item-mode collection
85
+ * spellings proven by src/t2.test.ts. `radio-group` collects what each item
86
+ * itself carries ({value: self.id}); its htmlFor-joined sibling labels are
87
+ * the measured T3 frontier, dropped with record until declared joins land.
88
+ * `select` is the pure homogeneous shape ({label: self.text}).
89
+ *
90
+ * Each entry carries the full receiving plan (structural options schema) —
91
+ * unlike T1's transparent plans, a collecting plan IS a catalog component.
92
+ */
93
+ export const SHADCN_V3_T3_PLANS: Record<string, Record<string, unknown>> = {
94
+ tabs: {
95
+ a2ui: "Tabs",
96
+ dspackId: "tabs",
97
+ commons: ["ComponentCommon"],
98
+ structural: {
99
+ sections: {
100
+ schema: {
101
+ type: "array",
102
+ items: {
103
+ type: "object",
104
+ properties: { title: { type: "string" }, value: { type: "string" }, child: { $ref: "#/$defs/ComponentId" } },
105
+ required: ["title", "child"],
106
+ additionalProperties: false,
107
+ },
108
+ },
109
+ description: "The tab sections: a title and the panel it reveals.",
110
+ synthNote: "A2UI models paired trigger/panel families as one array of {title, child} records (T3 declared join; the worked example keys on ids).",
111
+ },
112
+ },
113
+ propMap: { defaultValue: { a2ui: "defaultValue", kind: "string" } },
114
+ required: ["sections"],
115
+ surface: {
116
+ collects: [
117
+ {
118
+ of: ["tabs-trigger"],
119
+ into: "prop:sections",
120
+ item: { title: "self.text", value: "self.id" },
121
+ join: { with: ["tabs-content"], on: { left: "self.id", right: "self.id" }, fields: { child: "children" } },
122
+ },
123
+ ],
124
+ },
125
+ },
126
+ };
127
+
128
+ export const SHADCN_V3_T2_PLANS: Record<string, Record<string, unknown>> = {
129
+ "radio-group": {
130
+ a2ui: "RadioGroup",
131
+ dspackId: "radio-group",
132
+ commons: ["ComponentCommon"],
133
+ structural: {
134
+ label: {
135
+ schema: { type: "string" },
136
+ description: "The group-level label naming the choice being made.",
137
+ synthNote: "Sourced by T1 form-label donation when the group sits inside a form field; a group without one relies on context.",
138
+ },
139
+ options: {
140
+ schema: { type: "array", items: { type: "object", properties: { value: { type: "string" }, label: { type: "string" } }, required: ["value"], additionalProperties: false } },
141
+ description: "The selectable options, one record per item.",
142
+ synthNote: "A2UI models repeated options as data on the group; dspack models them as repeated sub-components (T2 item-mode collection).",
143
+ },
144
+ },
145
+ propMap: {
146
+ name: { a2ui: "name", kind: "string" },
147
+ defaultValue: { a2ui: "defaultValue", kind: "string" },
148
+ },
149
+ required: ["options"],
150
+ // T3: the htmlFor->id join carries each item's sibling label into its
151
+ // record. Value still sources from self.id — a documented limitation:
152
+ // ids are DOM identity, not semantic values ("reimbursement-payroll" vs
153
+ // defaultValue "payroll"); the real shadcn API declares value on the
154
+ // item, and the contract gap is filed upstream.
155
+ surface: {
156
+ collects: [
157
+ {
158
+ of: ["radio-group-item"],
159
+ into: "prop:options",
160
+ item: { value: "self.id" },
161
+ join: { with: ["label"], on: { left: "self.id", right: "self.props.htmlFor" }, fields: { label: "self.text" } },
162
+ },
163
+ ],
164
+ },
165
+ },
166
+ select: {
167
+ a2ui: "Select",
168
+ dspackId: "select",
169
+ commons: ["ComponentCommon"],
170
+ structural: {
171
+ options: {
172
+ schema: { type: "array", items: { type: "object", properties: { label: { type: "string" } }, required: ["label"], additionalProperties: false } },
173
+ description: "The selectable options.",
174
+ synthNote: "A2UI models repeated options as data on the control (T2 item-mode collection).",
175
+ },
176
+ },
177
+ propMap: { defaultValue: { a2ui: "defaultValue", kind: "string" } },
178
+ required: ["options"],
179
+ surface: {
180
+ collects: [{ of: ["select-item"], into: "prop:options", item: { label: "self.text" } }],
181
+ subs: {
182
+ "select-trigger": { drop: "the trigger renders from the bound value, not authored content" },
183
+ "select-value": { drop: "the visible value is runtime state derived from the selection" },
184
+ "select-label": { drop: "group headings are not carried by the flat options shape" },
185
+ "select-separator": { drop: "visual grouping chrome with no data meaning" },
186
+ },
187
+ },
188
+ },
189
+ };
190
+
191
+ /**
192
+ * A0 authoring resolutions (the zero-new-capability milestone): production
193
+ * profile judgment for the families the shipped Identity/Routing/Repetition
194
+ * model already supports, proven by src/a0.test.ts. Six compound plans plus
195
+ * label-slot additions on the five controls that appear as a field's single
196
+ * control (the T1 donation destination). No new primitive anywhere.
197
+ *
198
+ * Grounded in measured usage across the 14 worked examples (contract 3.2.0):
199
+ * alert-title 5/5 + alert-description 5/5 carry the content; avatar-fallback
200
+ * carries text while avatar-image is an EMPTY node (the contract declares no
201
+ * src/alt — the dspack#39 class, recorded on the drop); scroll-area's two
202
+ * subs are scrollbar chrome; the field family follows the corrected
203
+ * declaration (dspack#40) with field as its own donating boundary.
204
+ */
205
+ export const SHADCN_V3_A0_PLANS: Record<string, Record<string, unknown>> = {
206
+ alert: {
207
+ a2ui: "Alert",
208
+ dspackId: "alert",
209
+ commons: ["ComponentCommon"],
210
+ structural: {
211
+ title: {
212
+ schema: { type: "string" },
213
+ description: "The one-line heading naming what happened.",
214
+ synthNote: "Lifted from the alert-title sub (5/5 worked examples carry it there).",
215
+ },
216
+ description: {
217
+ schema: { type: "string" },
218
+ description: "Supporting detail under the title.",
219
+ synthNote: "Lifted from the alert-description sub.",
220
+ },
221
+ },
222
+ propMap: {
223
+ variant: { a2ui: "variant", kind: "enum", targetEnum: ["default", "destructive"], default: "default" },
224
+ },
225
+ required: ["title"],
226
+ surface: {
227
+ routes: [
228
+ { from: ["sub(alert-title).text"], to: "prop:title" },
229
+ { from: ["sub(alert-description).text"], to: "prop:description" },
230
+ ],
231
+ subs: {
232
+ "alert-action": {
233
+ drop:
234
+ "an action slot holds component children (a button), and routing a sub's children to a slot is T4's mechanism — dropped WITH RECORD until T4, not approximated (one production instance: ex.import-run-status)",
235
+ },
236
+ },
237
+ },
238
+ },
239
+ avatar: {
240
+ a2ui: "Avatar",
241
+ dspackId: "avatar",
242
+ commons: ["ComponentCommon"],
243
+ structural: {
244
+ fallback: {
245
+ schema: { type: "string" },
246
+ description: "Initials shown while no image is available.",
247
+ synthNote: "Lifted from the avatar-fallback sub's text.",
248
+ },
249
+ },
250
+ propMap: { size: { a2ui: "size", kind: "enum", targetEnum: ["sm", "default", "lg"], default: "default" } },
251
+ required: ["fallback"],
252
+ surface: {
253
+ routes: [{ from: ["sub(avatar-fallback).text"], to: "prop:fallback" }],
254
+ subs: {
255
+ "avatar-image": {
256
+ drop: "the contract declares no src/alt on avatar-image — an empty node carries nothing to project (contract-gap class, cf. dspack#39)",
257
+ },
258
+ "avatar-badge": { drop: "no worked example exercises it; no measured shape to project — revisit with usage evidence" },
259
+ "avatar-group": { drop: "no worked example exercises it; a grouped-avatars shape is repetition to be measured, not guessed" },
260
+ "avatar-group-count": { drop: "no worked example exercises it; belongs to the unmeasured avatar-group shape" },
261
+ },
262
+ },
263
+ },
264
+ "scroll-area": {
265
+ a2ui: "ScrollArea",
266
+ dspackId: "scroll-area",
267
+ commons: ["ComponentCommon"],
268
+ structural: {},
269
+ required: [],
270
+ surface: {
271
+ transparent: true,
272
+ subs: {
273
+ "scroll-area-scrollbar": { drop: "scrollbar chrome: presentation of the scroll container, not content" },
274
+ "scroll-area-thumb": { drop: "the scrollbar's drag indicator: chrome, not content" },
275
+ },
276
+ },
277
+ },
278
+ field: {
279
+ a2ui: "Field",
280
+ dspackId: "field",
281
+ commons: ["ComponentCommon"],
282
+ structural: {},
283
+ required: [],
284
+ surface: {
285
+ transparent: { donate: [{ from: "sub(field-label).text", to: "prop:label" }] },
286
+ subs: {
287
+ "field-content": "transparent",
288
+ "field-title": { asText: "h4" },
289
+ "field-description": { asText: "caption" },
290
+ "field-error": { drop: "validation state is runtime data the declarative surface does not carry (mirrors form-message)" },
291
+ },
292
+ },
293
+ },
294
+ "field-set": {
295
+ a2ui: "FieldSet",
296
+ dspackId: "field-set",
297
+ commons: ["ComponentCommon"],
298
+ structural: {},
299
+ required: [],
300
+ surface: {
301
+ transparent: true,
302
+ subs: { "field-legend": { asText: "h4" } },
303
+ },
304
+ },
305
+ "field-group": {
306
+ a2ui: "FieldGroup",
307
+ dspackId: "field-group",
308
+ commons: ["ComponentCommon"],
309
+ structural: {},
310
+ required: [],
311
+ surface: {
312
+ transparent: true,
313
+ subs: {
314
+ "field-separator": { drop: "a visual section boundary; its optional inline text is presentation of the divider, and no worked example carries one" },
315
+ },
316
+ },
317
+ },
318
+ };
319
+
320
+ /**
321
+ * A0 label additions: the five controls that appear as a field's (or
322
+ * form-item's) single control across the worked examples — input already
323
+ * declares `label`; these gain the same structural slot so the T1 donation
324
+ * has a declared destination. Merged onto the scaffolded plans (select's T2
325
+ * plan) by the fixture builder; nothing else on those plans changes.
326
+ */
327
+ export const SHADCN_V3_A0_LABEL_ADDITIONS: Record<string, { description: string; synthNote: string }> = {
328
+ switch: {
329
+ description: "The label naming what the switch turns on or off.",
330
+ synthNote: "Sourced by the T1 field-label/form-label donation; 4/4 worked-example switches sit inside a field.",
331
+ },
332
+ checkbox: {
333
+ description: "The label naming what checking the box asserts.",
334
+ synthNote: "Sourced by the T1 form-label donation (ex.expense-report-form's billable field).",
335
+ },
336
+ textarea: {
337
+ description: "The label naming the long-text entry.",
338
+ synthNote: "Sourced by the T1 field-label/form-label donation, exactly as on input.",
339
+ },
340
+ progress: {
341
+ description: "The label naming what is progressing.",
342
+ synthNote: "Sourced by the T1 field-label donation; 2/2 worked-example progress bars sit inside a field.",
343
+ },
344
+ select: {
345
+ description: "The label naming the choice being made.",
346
+ synthNote: "Sourced by the T1 field-label/form-label donation when the select is a field's control (ex.invite-teammates-dialog).",
347
+ },
348
+ };
349
+
350
+ /**
351
+ * T4 resolutions: multi-slot compounds, proven by src/t4.test.ts. The new
352
+ * primitive is ONE closed spelling — `sub(x).children -> slot:name` — the
353
+ * region's ordered children emitted as instances, the slot carrying the
354
+ * reference (multi wraps in Column, exactly like T3's joined-children).
355
+ *
356
+ * Measured shapes (contract 3.2.0 worked examples):
357
+ * - dialog/sheet: trigger and close labels are TEXT lifts (the alert-dialog
358
+ * idiom); title/description lift; header dissolves; content minus the
359
+ * claimed regions is the body slot; footer minus close is the footer slot.
360
+ * - popover: same family; its measured body is EMPTY after the header
361
+ * dissolves — the slot stays absent and gate A3 arbitrates. The unused
362
+ * popover-anchor drops pending usage evidence.
363
+ * - dropdown-menu is DATA-shaped, not slot-shaped: its items are a T2
364
+ * item-mode collect and its labels are scalar text routes — resolved with
365
+ * ZERO new primitive. The historic taxonomy called it T4; measurement
366
+ * says otherwise, and the plan follows the measurement.
367
+ */
368
+ export const SHADCN_V3_T4_PLANS: Record<string, Record<string, unknown>> = {
369
+ dialog: {
370
+ a2ui: "Dialog",
371
+ dspackId: "dialog",
372
+ commons: ["ComponentCommon"],
373
+ structural: {
374
+ title: { schema: { type: "string" }, description: "The dialog's title (aria-labelledby).", synthNote: "Lifted from dialog-title." },
375
+ description: { schema: { type: "string" }, description: "Supporting context under the title.", synthNote: "Lifted from dialog-description." },
376
+ triggerLabel: { schema: { type: "string" }, description: "Label of the control that opens the dialog.", synthNote: "Lifted from the trigger's button label (the alert-dialog idiom)." },
377
+ closeLabel: { schema: { type: "string" }, description: "Label of the explicit close control.", synthNote: "Lifted from dialog-close." },
378
+ child: { schema: { $ref: "#/$defs/ComponentId" }, description: "The dialog body: content minus the claimed regions, Column-wrapped when several.", synthNote: "T4 slot route from dialog-content's children." },
379
+ footer: { schema: { $ref: "#/$defs/ComponentId" }, description: "The action row minus the close control.", synthNote: "T4 slot route from dialog-footer's children." },
380
+ },
381
+ required: ["title"],
382
+ surface: {
383
+ routes: [
384
+ { from: ["sub(dialog-title).text"], to: "prop:title" },
385
+ { from: ["sub(dialog-description).text"], to: "prop:description" },
386
+ { from: ["sub(dialog-trigger).label", "sub(dialog-trigger).firstText"], to: "prop:triggerLabel" },
387
+ { from: ["sub(dialog-close).text"], to: "prop:closeLabel" },
388
+ { from: ["sub(dialog-content).children"], to: "slot:child" },
389
+ { from: ["sub(dialog-footer).children"], to: "slot:footer" },
390
+ ],
391
+ subs: { "dialog-header": "transparent" },
392
+ },
393
+ },
394
+ sheet: {
395
+ a2ui: "Sheet",
396
+ dspackId: "sheet",
397
+ commons: ["ComponentCommon"],
398
+ structural: {
399
+ title: { schema: { type: "string" }, description: "The panel's title.", synthNote: "Lifted from sheet-title." },
400
+ description: { schema: { type: "string" }, description: "Supporting copy beneath the title.", synthNote: "Lifted from sheet-description." },
401
+ triggerLabel: { schema: { type: "string" }, description: "Label of the control that opens the sheet.", synthNote: "Lifted from the trigger's button label." },
402
+ closeLabel: { schema: { type: "string" }, description: "Label of the explicit close control.", synthNote: "Lifted from sheet-close." },
403
+ child: { schema: { $ref: "#/$defs/ComponentId" }, description: "The panel body: content minus the claimed regions, Column-wrapped when several.", synthNote: "T4 slot route from sheet-content's children." },
404
+ footer: { schema: { $ref: "#/$defs/ComponentId" }, description: "The action row minus the close control.", synthNote: "T4 slot route from sheet-footer's children." },
405
+ },
406
+ required: ["title"],
407
+ surface: {
408
+ routes: [
409
+ { from: ["sub(sheet-title).text"], to: "prop:title" },
410
+ { from: ["sub(sheet-description).text"], to: "prop:description" },
411
+ { from: ["sub(sheet-trigger).label", "sub(sheet-trigger).firstText"], to: "prop:triggerLabel" },
412
+ { from: ["sub(sheet-close).text"], to: "prop:closeLabel" },
413
+ { from: ["sub(sheet-content).children"], to: "slot:child" },
414
+ { from: ["sub(sheet-footer).children"], to: "slot:footer" },
415
+ ],
416
+ subs: { "sheet-header": "transparent" },
417
+ },
418
+ },
419
+ popover: {
420
+ a2ui: "Popover",
421
+ dspackId: "popover",
422
+ commons: ["ComponentCommon"],
423
+ structural: {
424
+ title: { schema: { type: "string" }, description: "The panel's visible title.", synthNote: "Lifted from popover-title." },
425
+ description: { schema: { type: "string" }, description: "Supporting copy beneath the title.", synthNote: "Lifted from popover-description." },
426
+ triggerLabel: { schema: { type: "string" }, description: "Label of the control that toggles the popover.", synthNote: "Lifted from the trigger's button label." },
427
+ child: { schema: { $ref: "#/$defs/ComponentId" }, description: "The panel body beyond title and description; absent when the measured body is empty.", synthNote: "T4 slot route from popover-content's children; the worked example's body is empty after the header dissolves." },
428
+ },
429
+ required: ["triggerLabel"],
430
+ surface: {
431
+ routes: [
432
+ { from: ["sub(popover-title).text"], to: "prop:title" },
433
+ { from: ["sub(popover-description).text"], to: "prop:description" },
434
+ { from: ["sub(popover-trigger).label", "sub(popover-trigger).firstText"], to: "prop:triggerLabel" },
435
+ { from: ["sub(popover-content).children"], to: "slot:child" },
436
+ ],
437
+ subs: {
438
+ "popover-header": "transparent",
439
+ "popover-anchor": { drop: "no worked example exercises it; an alternative positioning reference is presentation until measured" },
440
+ },
441
+ },
442
+ },
443
+ "dropdown-menu": {
444
+ a2ui: "DropdownMenu",
445
+ dspackId: "dropdown-menu",
446
+ commons: ["ComponentCommon"],
447
+ structural: {
448
+ triggerLabel: { schema: { type: "string" }, description: "Label of the element that opens the menu.", synthNote: "Lifted from the trigger's button label." },
449
+ menuLabel: { schema: { type: "string" }, description: "The non-interactive heading above the items.", synthNote: "Lifted from dropdown-menu-label." },
450
+ items: {
451
+ schema: { type: "array", items: { type: "object", properties: { label: { type: "string" } }, required: ["label"], additionalProperties: false } },
452
+ description: "The actionable menu items, in order.",
453
+ synthNote: "T2 item-mode collect — the menu is DATA, not slots; measurement overruled the historic T4 classification.",
454
+ },
455
+ },
456
+ required: ["items"],
457
+ surface: {
458
+ routes: [
459
+ { from: ["sub(dropdown-menu-trigger).label", "sub(dropdown-menu-trigger).firstText"], to: "prop:triggerLabel" },
460
+ { from: ["sub(dropdown-menu-label).text"], to: "prop:menuLabel" },
461
+ ],
462
+ collects: [{ of: ["dropdown-menu-item"], into: "prop:items", item: { label: "self.text" } }],
463
+ subs: {
464
+ "dropdown-menu-separator": { drop: "a visual divider between item groups; grouping is not carried by the flat items shape" },
465
+ "dropdown-menu-group": { drop: "grouping chrome; no worked example gives it meaning beyond adjacency" },
466
+ "dropdown-menu-checkbox-item": { drop: "no worked example exercises it; a toggleable item is a different record shape to measure, not guess" },
467
+ "dropdown-menu-radio-group": { drop: "no worked example exercises it" },
468
+ "dropdown-menu-radio-item": { drop: "no worked example exercises it" },
469
+ "dropdown-menu-sub": { drop: "nested menus are unmeasured; representing them is a decision for evidence, not defaults" },
470
+ "dropdown-menu-sub-trigger": { drop: "belongs to the unmeasured nested-menu shape" },
471
+ "dropdown-menu-sub-content": { drop: "belongs to the unmeasured nested-menu shape" },
472
+ },
473
+ },
474
+ },
475
+ };
@@ -22,7 +22,7 @@
22
22
  import type { DspackDoc } from "../types.js";
23
23
  import type { Profile } from "./profiles.js";
24
24
  import { surfaceModelOf } from "./desugar.js";
25
- import { referencedSubs, unclassifiedSubs, type SurfaceModel } from "./model.js";
25
+ import { describeDestination, referencedSubs, unclassifiedSubs, type Donation, type SurfaceModel } from "./model.js";
26
26
 
27
27
  export interface ProfileContractIssue {
28
28
  path: string;
@@ -93,11 +93,16 @@ export function validateProfileAgainstContract(profile: Profile, doc: DspackDoc)
93
93
  const declaredProps = new Set(Object.keys(component.props ?? {}));
94
94
  const model = surfaceModelOf(plan);
95
95
 
96
+ // A referenced name resolves against the compound's declared subs OR the
97
+ // contract's top-level components — a T3 join may pair a sub-family with
98
+ // a component family (the production radio-group joins its items to
99
+ // sibling `label` COMPONENTS via htmlFor), and surfaces carry both kinds
100
+ // of node identically.
96
101
  for (const sub of namedSubs(model)) {
97
- if (!declaredSubs.includes(sub)) {
102
+ if (!declaredSubs.includes(sub) && !(sub in components)) {
98
103
  issues.push({
99
104
  path: at,
100
- message: `'${sub}' is not a declared sub-component of '${plan.dspackId}' in this contract (declared: ${declaredSubs.length ? declaredSubs.join(", ") : "none"})`,
105
+ message: `'${sub}' is neither a declared sub-component of '${plan.dspackId}' nor a component of this contract (declared subs: ${declaredSubs.length ? declaredSubs.join(", ") : "none"})`,
101
106
  });
102
107
  }
103
108
  }
@@ -134,5 +139,36 @@ export function validateProfileAgainstContract(profile: Profile, doc: DspackDoc)
134
139
  }
135
140
  }
136
141
 
142
+ // T1 donations: every donated destination must be declared by at least one
143
+ // mapped, NON-transparent plan — otherwise no surface could ever satisfy
144
+ // the exactly-one-eligible-control rule and every use would refuse at emit.
145
+ // Checked profile-wide (the eligible control is chosen per surface).
146
+ const receiverProps = new Set<string>();
147
+ for (const plan of [...profile.components, ...profile.synthesized]) {
148
+ const m = surfaceModelOf(plan);
149
+ if (m.transparent) continue;
150
+ for (const k of Object.keys(plan.structural ?? {})) receiverProps.add(k);
151
+ for (const p of Object.values(plan.propMap ?? {})) receiverProps.add(p.a2ui);
152
+ }
153
+ for (const [collection, plans] of collections) {
154
+ for (const [i, plan] of plans.entries()) {
155
+ const m = surfaceModelOf(plan);
156
+ const donations: Array<{ d: Donation; at: string }> = [
157
+ ...m.transparentDonate.map((d) => ({ d, at: `/${collection}/${i}/surface/transparent/donate` })),
158
+ ...Object.values(m.subIdentity).flatMap((id) =>
159
+ id.kind === "transparent" && id.donate ? id.donate.map((d) => ({ d, at: `/${collection}/${i}/surface/subs` })) : [],
160
+ ),
161
+ ];
162
+ for (const { d, at } of donations) {
163
+ if (!receiverProps.has(d.to.name)) {
164
+ issues.push({
165
+ path: at,
166
+ message: `donation writes ${describeDestination(d.to)}, but no mapped non-transparent plan declares '${d.to.name}' — no surface could ever satisfy it`,
167
+ });
168
+ }
169
+ }
170
+ }
171
+ }
172
+
137
173
  if (issues.length > 0) throw new ProfileContractError(issues);
138
174
  }
package/src/types.ts CHANGED
@@ -124,7 +124,19 @@ export interface SurfaceFidelityEntry {
124
124
  /** The profile rule that caused it (route/collect origin, propMap key, or synthesis). */
125
125
  origin: string;
126
126
  /** What happened to the content. */
127
- kind: "projected" | "moved" | "lifted" | "flattened" | "synthesized" | "wrapped" | "dropped" | "deduplicated";
127
+ kind:
128
+ | "projected"
129
+ | "moved"
130
+ | "lifted"
131
+ | "flattened"
132
+ | "synthesized"
133
+ | "wrapped"
134
+ | "dropped"
135
+ | "deduplicated"
136
+ /** T1: a value harvested in a dissolving boundary, written onto its single eligible control. */
137
+ | "donated"
138
+ /** T3: a counterpart's data merged into a collected record via a declared key join. */
139
+ | "joined";
128
140
  class: FidelityClass;
129
141
  note?: string;
130
142
  }
@@ -102,7 +102,7 @@ describe("v2 contract validation refuses before emission", () => {
102
102
  ...RESOLVED,
103
103
  subs: { ...RESOLVED.subs, "card-sidebar": "transparent" },
104
104
  });
105
- expect(out).toContain("'card-sidebar' is not a declared sub-component of 'card'");
105
+ expect(out).toContain("'card-sidebar' is neither a declared sub-component of 'card' nor a component");
106
106
  });
107
107
 
108
108
  it("reading an undeclared prop into a renamed destination refuses; the passthrough shape passes", () => {