@happyvertical/smrt-vitest 0.61.3 → 0.61.5

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.
@@ -0,0 +1,1040 @@
1
+ export const minimalRowExpectedFailures = [
2
+ {
3
+ model: '@happyvertical/smrt-commerce:BillingPeriodClose',
4
+ field: 'periodEnd',
5
+ reason: 'The real epoch defaults satisfy required metadata, but billing/period-close.ts reads the stored end to select carried-forward credits; periodEnd must be later than periodStart, a cross-field date rule that requiredFor cannot express.',
6
+ error: 'A billing period must end after it starts.',
7
+ },
8
+ {
9
+ model: '@happyvertical/smrt-commerce:Invoice',
10
+ field: 'tenantId',
11
+ reason: 'Invoice money calculation scopes tax reads by tenantId, so tenant-scope fits. A required declaration makes the legacy-money upgrade fixture fail on invoices.tenant_id NOT NULL; correcting that fixture exceeds the permitted test edits, so retain this finding pending that coordinated change.',
12
+ error: 'Commerce money documents require a tenant',
13
+ },
14
+ {
15
+ model: '@happyvertical/smrt-commerce:PaymentAllocation',
16
+ field: 'amount',
17
+ reason: 'PaymentAllocation.save() requires a positive safe-integer amount and adds it to both balance caps; the real zero initializer already satisfies required metadata, and none of the five reasons describes a positive monetary amount.',
18
+ error: 'PaymentAllocation amount must be a positive number',
19
+ },
20
+ {
21
+ model: '@happyvertical/smrt-commerce:Payout',
22
+ field: 'paymentId',
23
+ reason: 'Payout.assertCappedBySourcePayment() loads paymentId and caps remittance by the source Payment. Identity fits, but the plain-string reference cannot supply a resolvable parent in a minimal row; changing the reference contract or fixture is outside this declaration-only audit.',
24
+ error: 'a paymentId is required \u2014 a payout must reference the source Payment that funded it (use createFromPayment()).',
25
+ },
26
+ {
27
+ model: '@happyvertical/smrt-commerce:TaxComponent',
28
+ field: 'name',
29
+ reason: 'The name is copied into immutable tax snapshots and DocumentTax rejects empty component snapshots; no reason value describes display/snapshot content. Removing the save guard needs a review of those readers, outside declaration-only edits.',
30
+ error: 'Tax component requires a nonempty name',
31
+ },
32
+ {
33
+ model: '@happyvertical/smrt-education:EducationGroup',
34
+ field: 'name',
35
+ reason: 'name reaches the empty-name guard at packages/education/src/group-sharing-models.ts:90; packages/education/src/group-sharing-service.ts:52 only displays the name. Retain conservatively until the parent guard and other optional inputs in this minimal-row graph can be audited together; the guard alone is not identity evidence.',
36
+ error: 'Group sharing requires exact identity',
37
+ },
38
+ {
39
+ model: '@happyvertical/smrt-expenses:Expense',
40
+ field: 'currency',
41
+ reason: 'Expense totals group by currency (ExpenseCollection.ts:346), and commitment/refund guards compare it (Expense.ts:1198,1332); no requiredFor value describes a monetary unit. Keep this exception pending that decision.',
42
+ error: "currency must be a three-letter ISO 4217 code (for example 'USD'), got ''.",
43
+ },
44
+ {
45
+ model: '@happyvertical/smrt-facts:Fact',
46
+ field: 'catalogSearch',
47
+ reason: 'Fact.normalizePersistenceData derives catalogSearch from serialized text (fact.ts:142-149); the helper expects optional defaults to survive, but this read-only column must be recomputed for correct catalog queries. It is not caller-required.',
48
+ error: 'optional field catalogSearch read back populated',
49
+ },
50
+ {
51
+ model: '@happyvertical/smrt-manufacturing:ProductionRun',
52
+ field: 'targetQty',
53
+ reason: 'ProductionRun.validateBeforeSave rejects targetQty = 0 (ProductionRun.ts); the real decimal initializer is outside this audit, and no reason value expresses a positive planning quantity. Retain the domain-value exception.',
54
+ error: 'A production run needs a target quantity greater than zero.',
55
+ },
56
+ {
57
+ model: '@happyvertical/smrt-messages:NotificationDelivery',
58
+ field: 'recipientUserId',
59
+ reason: 'Validation requires exactly one typed recipient (user or profile). Neither column can be required alone, so the entry stays (#4935, P9). A populated recipientUserId advances through CRUD.',
60
+ error: 'Notification requires exactly one matching typed recipient and reserved protected email policy for profiles.',
61
+ },
62
+ {
63
+ model: '@happyvertical/smrt-subscriptions:SubscriptionPlanVersion',
64
+ field: 'version',
65
+ reason: 'Version must be a positive contiguous sequence for an existing plan (SubscriptionPlanVersion.validateBeforeSave); required alone accepts the real initializer 0 and cannot encode the next-version or parent-plan rules.',
66
+ error: 'Plan version must be a positive integer',
67
+ },
68
+ {
69
+ model: '@happyvertical/smrt-approvals:ApprovalEvent',
70
+ kind: 'service-only',
71
+ field: '(service-only write)',
72
+ error: 'ApprovalRequest rows are created only by ApprovalService.requestApproval().',
73
+ reason: 'ApprovalRequest writes are owned by ApprovalService.requestApproval(); its owner must run once against a minimal row. Required-parent path: requestId.',
74
+ },
75
+ {
76
+ model: '@happyvertical/smrt-approvals:ApprovalPolicy',
77
+ kind: 'needs-domain-value',
78
+ field: 'kind',
79
+ error: "Approval kind 'minimal' is not defined in this process.",
80
+ reason: 'A kind registered by defineApprovalKind() must exist in this process.',
81
+ },
82
+ {
83
+ model: '@happyvertical/smrt-approvals:ApprovalRequest',
84
+ kind: 'service-only',
85
+ field: '(service-only write)',
86
+ error: 'ApprovalRequest rows are created only by ApprovalService.requestApproval().',
87
+ reason: 'ApprovalRequest writes are owned by ApprovalService.requestApproval(); its owner must run once against a minimal row.',
88
+ },
89
+ {
90
+ model: '@happyvertical/smrt-comments:ParticipationPolicy',
91
+ kind: 'needs-domain-value',
92
+ field: 'action',
93
+ error: 'Invalid participation policy.',
94
+ reason: 'action must be comment/react/vote/report; the required string has no declared enum.',
95
+ },
96
+ {
97
+ model: '@happyvertical/smrt-commerce:ContractLineItem',
98
+ kind: 'optional-field',
99
+ field: 'tenantId',
100
+ error: 'Commerce money documents require a tenant',
101
+ reason: 'Contract money recomputation scopes tax reads by tenantId. Requiring this field alone exposed the omitted contractId (Money parent id must be a nonempty identifier); that unassigned parent field blocks removing this ledger entry under declaration-only scope.',
102
+ },
103
+ {
104
+ model: '@happyvertical/smrt-commerce:DocumentTax',
105
+ kind: 'service-only',
106
+ field: '(service-only write)',
107
+ error: 'DocumentTax rows are derived and cannot be saved directly',
108
+ reason: 'DocumentTax writes are owned by Commerce document-money commands (saveInvoice/saveInvoiceLineItem); its owner must run once against a minimal row.',
109
+ },
110
+ {
111
+ model: '@happyvertical/smrt-commerce:HistoricalCustomerFunds',
112
+ kind: 'service-only',
113
+ field: '(service-only write)',
114
+ error: 'Historical financial records require their public historical Commerce command',
115
+ reason: 'HistoricalCustomerFunds writes are owned by recordHistoricalCustomerFunds/refundHistoricalCustomerFunds; its owner must run once against a minimal row.',
116
+ },
117
+ {
118
+ model: '@happyvertical/smrt-commerce:HistoricalCustomerFundsAllocation',
119
+ kind: 'service-only',
120
+ field: '(service-only write)',
121
+ error: 'Historical financial records require their public historical Commerce command',
122
+ reason: 'HistoricalCustomerFundsAllocation writes are owned by recordHistoricalCustomerAllocation/applyHistoricalCustomerFunds; its owner must run once against a minimal row.',
123
+ },
124
+ {
125
+ model: '@happyvertical/smrt-commerce:HistoricalSalesLine',
126
+ kind: 'service-only',
127
+ field: '(service-only write)',
128
+ error: 'Historical financial records require their public historical Commerce command',
129
+ reason: 'HistoricalSalesLine writes are owned by recordHistoricalSalesMoney; its owner must run once against a minimal row.',
130
+ },
131
+ {
132
+ model: '@happyvertical/smrt-commerce:InvoiceLineItem',
133
+ kind: 'optional-field',
134
+ field: 'tenantId',
135
+ error: 'Commerce money documents require a tenant',
136
+ reason: 'Invoice money recomputation scopes tax reads by tenantId. Requiring this field alone exposed the omitted invoiceId (Invoice was not found); that unassigned parent field blocks removing this ledger entry under declaration-only scope.',
137
+ },
138
+ {
139
+ model: '@happyvertical/smrt-commerce:PurchasePriceObservation',
140
+ kind: 'service-only',
141
+ field: '(service-only write)',
142
+ error: 'Purchase price observations require their owning commands',
143
+ reason: 'PurchasePriceObservation writes are owned by recordPurchasePriceObservation/completePurchasePriceObservation; its owner must run once against a minimal row.',
144
+ },
145
+ {
146
+ model: '@happyvertical/smrt-commerce:TaxCode',
147
+ kind: 'optional-field',
148
+ field: 'code, name',
149
+ error: 'Tax code requires a nonempty code and name',
150
+ reason: 'code is a tenant conflict key and lookup identity, while name is snapshot/display content with no matching reason. The combined save guard and taxable-component requirement prevent this model passing after a code-only declaration; retain the combined finding pending a wider guard/fixture audit.',
151
+ },
152
+ {
153
+ model: '@happyvertical/smrt-commerce:TaxSummaryReport',
154
+ kind: 'needs-domain-value',
155
+ field: 'tenantId',
156
+ error: 'Tax summary report reads require a tenant context.',
157
+ reason: 'Reads require an ambient authenticated tenant context, not just a tenantId on the row.',
158
+ },
159
+ {
160
+ model: '@happyvertical/smrt-commerce:TenantPaymentAccount',
161
+ kind: 'service-only',
162
+ field: '(service-only write)',
163
+ error: 'TenantPaymentAccount is written only by the connected-payments commands',
164
+ reason: 'TenantPaymentAccount writes are owned by onboardTenantPaymentAccount/linkTenantPaymentAccount and the connected-payments account commands; its owner must run once against a minimal row.',
165
+ },
166
+ {
167
+ model: '@happyvertical/smrt-commerce:TenantPaymentDispute',
168
+ kind: 'service-only',
169
+ field: '(service-only write)',
170
+ error: 'Disputes are written only by connected-payments commands',
171
+ reason: 'TenantPaymentDispute writes are owned by handleConnectedPaymentWebhook; its owner must run once against a minimal row.',
172
+ },
173
+ {
174
+ model: '@happyvertical/smrt-content:ContentContributionType',
175
+ kind: 'optional-field',
176
+ field: 'promotion',
177
+ error: 'must define promotion.targetContentType.',
178
+ reason: 'packages/content/src/content-contribution-type.ts:210 and content-contribution.ts:595 require nested promotion.targetContentType to choose the promoted Content subtype. A required string only forbids empty JSON text, not a missing nested target; no reason names promotion configuration, so retain pending a nested-rule/default decision outside declaration-only scope.',
179
+ },
180
+ {
181
+ model: '@happyvertical/smrt-education:CourseRevision',
182
+ kind: 'optional-field',
183
+ field: 'authorUserId',
184
+ error: 'Revision requires an author',
185
+ reason: 'CourseRevision.authorUserId is checked by the save guard (course-authoring-models.ts:117) and returned as provenance (course-authoring-service.ts:1461); no key or authorization read was found. Keep until the provenance guard is decided; none of the five reasons justifies that read alone.',
186
+ },
187
+ {
188
+ model: '@happyvertical/smrt-education:LessonRevision',
189
+ kind: 'optional-field',
190
+ field: 'lessonKey',
191
+ error: 'Lesson revision requires a lesson key',
192
+ reason: 'LessonRevision.lessonKey identifies a conflict-key member (course-authoring-models.ts:147), but a trial required declaration exposed the next optional title guard. Keep the original finding pending a coordinated decision on the remaining guards; the model has not been shown to pass.',
193
+ },
194
+ {
195
+ model: '@happyvertical/smrt-education:CourseDraftHead',
196
+ kind: 'optional-field',
197
+ field: 'headRevisionId.authorUserId',
198
+ error: 'Revision requires an author',
199
+ reason: 'Required-parent path headRevisionId.authorUserId reaches the CourseRevision save guard (course-authoring-models.ts:117); its only observed later author read is provenance (course-authoring-service.ts:1461). Keep pending the provenance-guard decision; no identity or authorization dependency was found for the author.',
200
+ },
201
+ {
202
+ model: '@happyvertical/smrt-education:CourseRelease',
203
+ kind: 'optional-field',
204
+ field: 'revisionId.authorUserId',
205
+ error: 'Revision requires an author',
206
+ reason: 'Required-parent path revisionId.authorUserId reaches the CourseRevision save guard (course-authoring-models.ts:117); its only observed later author read is provenance (course-authoring-service.ts:1461). Keep pending the provenance-guard decision; the model still fails.',
207
+ },
208
+ {
209
+ model: '@happyvertical/smrt-education:ReleasedLesson',
210
+ kind: 'optional-field',
211
+ field: 'releaseId.revisionId.authorUserId',
212
+ error: 'Revision requires an author',
213
+ reason: 'Required-parent path releaseId.revisionId.authorUserId reaches the CourseRevision save guard (course-authoring-models.ts:117); author is only returned as provenance (course-authoring-service.ts:1461). Nullable section metadata does not repair this independent parent failure.',
214
+ },
215
+ {
216
+ model: '@happyvertical/smrt-education:CourseArchiveDecision',
217
+ kind: 'optional-field',
218
+ field: 'actorUserId',
219
+ error: 'Archive decision requires an actor',
220
+ reason: 'actorUserId is checked by the save guard (course-authoring-models.ts:414) and returned in archive history (course-authoring-service.ts:1773), with no authorization or conflict-key read. Keep pending a decision on the provenance-only guard; display alone does not establish a requiredFor reason.',
221
+ },
222
+ {
223
+ model: '@happyvertical/smrt-education:CourseVisibilityChange',
224
+ kind: 'optional-field',
225
+ field: 'actorUserId',
226
+ error: 'Visibility change requires an actor',
227
+ reason: 'actorUserId is checked by the save guard (course-authoring-models.ts:465); setVisibility replays by requestKey, visibility and delegationId (course-authoring-service.ts:2528), without reading the stored actor. Keep pending a decision on the provenance-only guard; no permitted reason was established.',
228
+ },
229
+ {
230
+ model: '@happyvertical/smrt-education:CourseCoverChange',
231
+ kind: 'optional-field',
232
+ field: 'actorUserId',
233
+ error: 'Cover change requires an actor',
234
+ reason: 'actorUserId is checked by the save guard (course-authoring-models.ts:518); setCover replays by requestKey, assetId and delegationId (course-authoring-service.ts:2741), without reading the stored actor. Keep pending a decision on the provenance-only guard; no permitted reason was established.',
235
+ },
236
+ {
237
+ model: '@happyvertical/smrt-education:CourseDiscardTombstone',
238
+ kind: 'optional-field',
239
+ field: 'actorUserId',
240
+ error: 'Discard requires an actor',
241
+ reason: 'actorUserId is checked by the save guard (course-authoring-models.ts:565); discard replay checks request_key and delegation_id (course-authoring-service.ts:2889), without reading the stored actor. Keep pending a decision on the provenance-only guard; no permitted reason was established.',
242
+ },
243
+ {
244
+ model: '@happyvertical/smrt-education:EnrollmentReleasePin',
245
+ kind: 'needs-domain-value',
246
+ field: 'enrollmentId.curriculumId.learnerId.userId, enrollmentId.curriculumId.learnerId.profileId',
247
+ error: 'Learner requires a linked user/profile and active tenant membership',
248
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: enrollmentId.curriculumId.learnerId.',
249
+ },
250
+ {
251
+ model: '@happyvertical/smrt-education:CourseUpgradeChoice',
252
+ kind: 'optional-field',
253
+ field: 'actorUserId',
254
+ error: 'Upgrade choice requires an actor',
255
+ reason: 'The stored actor is reauthorized for automatic upgrades (course-authoring-service.ts:3382-3430), so identity applies; a trial required declaration exposed requestKey and policyBasis guards. Keep the original finding until those guards are audited together; the model has not been shown to pass.',
256
+ },
257
+ {
258
+ model: '@happyvertical/smrt-education:EnrollmentAutoUpgradeSkip',
259
+ kind: 'needs-domain-value',
260
+ field: 'enrollmentId.curriculumId.learnerId.userId, enrollmentId.curriculumId.learnerId.profileId',
261
+ error: 'Learner requires a linked user/profile and active tenant membership',
262
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: enrollmentId.curriculumId.learnerId.',
263
+ },
264
+ {
265
+ model: '@happyvertical/smrt-education:EnrollmentAssignmentRecord',
266
+ kind: 'needs-domain-value',
267
+ field: 'enrollmentId.curriculumId.learnerId.userId, enrollmentId.curriculumId.learnerId.profileId',
268
+ error: 'Learner requires a linked user/profile and active tenant membership',
269
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: enrollmentId.curriculumId.learnerId.',
270
+ },
271
+ {
272
+ model: '@happyvertical/smrt-education:CurriculumCreationRecord',
273
+ kind: 'needs-domain-value',
274
+ field: 'curriculumId.learnerId.userId, curriculumId.learnerId.profileId',
275
+ error: 'Learner requires a linked user/profile and active tenant membership',
276
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: curriculumId.learnerId.',
277
+ },
278
+ {
279
+ model: '@happyvertical/smrt-education:CourseBundleImport',
280
+ kind: 'optional-field',
281
+ field: 'bundleIdentity',
282
+ error: 'Bundle requires an identity',
283
+ reason: 'bundleIdentity is the replay key (course-bundle-service.ts:963-966; course-bundle-models.ts:65), but a trial required declaration exposed the optional readerId guard. Keep pending a coordinated decision on the remaining import guards; the model has not been shown to pass.',
284
+ },
285
+ {
286
+ model: '@happyvertical/smrt-education:CourseBundleMember',
287
+ kind: 'optional-field',
288
+ field: 'importId.bundleIdentity',
289
+ error: 'Bundle requires an identity',
290
+ reason: 'Required-parent path importId.bundleIdentity reaches the import replay identity (course-bundle-models.ts:65); making it required exposes the parent readerId guard. Keep until the import guards are audited together; this child has not been shown to pass.',
291
+ },
292
+ {
293
+ model: '@happyvertical/smrt-education:CourseBundleRendering',
294
+ kind: 'optional-field',
295
+ field: 'importId.bundleIdentity',
296
+ error: 'Bundle requires an identity',
297
+ reason: 'Required-parent path importId.bundleIdentity reaches the import replay identity (course-bundle-models.ts:65); making it required exposes the parent readerId guard. Keep until the import guards are audited together; this child has not been shown to pass.',
298
+ },
299
+ {
300
+ model: '@happyvertical/smrt-education:CourseBundleAttachment',
301
+ kind: 'optional-field',
302
+ field: 'importId.bundleIdentity',
303
+ error: 'Bundle requires an identity',
304
+ reason: 'Required-parent path importId.bundleIdentity reaches the import replay identity (course-bundle-models.ts:65); making it required exposes the parent readerId guard. Keep until the import guards are audited together; this child has not been shown to pass.',
305
+ },
306
+ {
307
+ model: '@happyvertical/smrt-education:CourseBundleAudienceChoice',
308
+ kind: 'optional-field',
309
+ field: 'importId.bundleIdentity',
310
+ error: 'Bundle requires an identity',
311
+ reason: 'Required-parent path importId.bundleIdentity reaches the import replay identity (course-bundle-models.ts:65); making it required exposes the parent readerId guard. Keep until the import guards are audited together; this child has not been shown to pass.',
312
+ },
313
+ {
314
+ model: '@happyvertical/smrt-education:CourseBundlePlacement',
315
+ kind: 'optional-field',
316
+ field: 'key',
317
+ error: 'Placement requires a key',
318
+ reason: 'key identifies the placement conflict key (course-bundle-models.ts:458) and the part reconciliation lookup (course-bundle-service.ts:2083); a trial required declaration exposed the optional title guard. Keep until that guard is decided; the model has not been shown to pass.',
319
+ },
320
+ {
321
+ model: '@happyvertical/smrt-education:CourseBundleUnit',
322
+ kind: 'optional-field',
323
+ field: 'unitKey',
324
+ error: 'Unit requires a key',
325
+ reason: 'unitKey identifies the transaction lock row (course-bundle-service.ts:2357-2361), but a trial required declaration exposed the optional derived courseId guard. Keep until that guard is decided; the model has not been shown to pass.',
326
+ },
327
+ {
328
+ model: '@happyvertical/smrt-education:CourseBundleSupersession',
329
+ kind: 'optional-field',
330
+ field: 'importId.bundleIdentity',
331
+ error: 'Bundle requires an identity',
332
+ reason: 'Required-parent path importId.bundleIdentity reaches the import replay identity (course-bundle-models.ts:65); making it required exposes the parent readerId guard. Keep until the import guards are audited together; this child has not been shown to pass.',
333
+ },
334
+ {
335
+ model: '@happyvertical/smrt-education:CourseGenerationJob',
336
+ kind: 'optional-field',
337
+ field: 'baseRevisionId.authorUserId',
338
+ error: 'Revision requires an author',
339
+ reason: 'Required-parent path baseRevisionId.authorUserId reaches the empty author guard at packages/education/src/course-authoring-models.ts:117. That guard alone does not justify requiredFor; retain pending audit of the parent snapshot guards, outside this batch.',
340
+ },
341
+ {
342
+ model: '@happyvertical/smrt-education:CourseGenerationEvent',
343
+ kind: 'optional-field',
344
+ field: 'jobId.baseRevisionId.authorUserId',
345
+ error: 'Revision requires an author',
346
+ reason: 'Required-parent path jobId.baseRevisionId.authorUserId reaches the empty author guard at packages/education/src/course-authoring-models.ts:117. That guard alone does not justify requiredFor; retain pending audit of the parent snapshot guards, outside this batch.',
347
+ },
348
+ {
349
+ model: '@happyvertical/smrt-education:CourseProposal',
350
+ kind: 'optional-field',
351
+ field: 'jobId.baseRevisionId.authorUserId',
352
+ error: 'Revision requires an author',
353
+ reason: 'Required-parent path jobId.baseRevisionId.authorUserId reaches the empty author guard at packages/education/src/course-authoring-models.ts:117. That guard alone does not justify requiredFor; retain pending audit of the parent snapshot guards, outside this batch.',
354
+ },
355
+ {
356
+ model: '@happyvertical/smrt-education:CourseProposalDecision',
357
+ kind: 'optional-field',
358
+ field: 'proposalId.jobId.baseRevisionId.authorUserId',
359
+ error: 'Revision requires an author',
360
+ reason: 'Required-parent path proposalId.jobId.baseRevisionId.authorUserId reaches the empty author guard at packages/education/src/course-authoring-models.ts:117. That guard alone does not justify requiredFor; retain pending audit of the parent snapshot guards, outside this batch.',
361
+ },
362
+ {
363
+ model: '@happyvertical/smrt-education:CourseGenerationBriefRecord',
364
+ kind: 'optional-field',
365
+ field: 'jobId.baseRevisionId.authorUserId',
366
+ error: 'Revision requires an author',
367
+ reason: 'Required-parent path jobId.baseRevisionId.authorUserId reaches the empty author guard at packages/education/src/course-authoring-models.ts:117. That guard alone does not justify requiredFor; retain pending audit of the parent snapshot guards, outside this batch.',
368
+ },
369
+ {
370
+ model: '@happyvertical/smrt-education:CourseReview',
371
+ kind: 'optional-field',
372
+ field: 'revisionId.authorUserId',
373
+ error: 'Revision requires an author',
374
+ reason: 'Required-parent path revisionId.authorUserId reaches the empty author guard at packages/education/src/course-authoring-models.ts:117. That guard alone does not justify requiredFor; retain pending audit of the parent snapshot guards, outside this batch.',
375
+ },
376
+ {
377
+ model: '@happyvertical/smrt-education:CourseReviewFinding',
378
+ kind: 'optional-field',
379
+ field: 'reviewId.revisionId.authorUserId',
380
+ error: 'Revision requires an author',
381
+ reason: 'Required-parent path reviewId.revisionId.authorUserId reaches the empty author guard at packages/education/src/course-authoring-models.ts:117. That guard alone does not justify requiredFor; retain pending audit of the parent snapshot guards, outside this batch.',
382
+ },
383
+ {
384
+ model: '@happyvertical/smrt-education:CourseReviewOutdatedMarker',
385
+ kind: 'optional-field',
386
+ field: 'reviewId.revisionId.authorUserId',
387
+ error: 'Revision requires an author',
388
+ reason: 'Required-parent path reviewId.revisionId.authorUserId reaches the empty author guard at packages/education/src/course-authoring-models.ts:117. That guard alone does not justify requiredFor; retain pending audit of the parent snapshot guards, outside this batch.',
389
+ },
390
+ {
391
+ model: '@happyvertical/smrt-education:CourseFindingResolution',
392
+ kind: 'optional-field',
393
+ field: 'findingId.reviewId.revisionId.authorUserId',
394
+ error: 'Revision requires an author',
395
+ reason: 'Required-parent path findingId.reviewId.revisionId.authorUserId reaches the empty author guard at packages/education/src/course-authoring-models.ts:117. That guard alone does not justify requiredFor; retain pending audit of the parent snapshot guards, outside this batch.',
396
+ },
397
+ {
398
+ model: '@happyvertical/smrt-education:EnrollmentParentNote',
399
+ kind: 'needs-domain-value',
400
+ field: 'enrollmentId.curriculumId.learnerId.userId, enrollmentId.curriculumId.learnerId.profileId',
401
+ error: 'Learner requires a linked user/profile and active tenant membership',
402
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: enrollmentId.curriculumId.learnerId.',
403
+ },
404
+ {
405
+ model: '@happyvertical/smrt-education:FamilyIntakeAsset',
406
+ kind: 'optional-field',
407
+ field: 'assetId, intakeId.ownerProfileId',
408
+ error: 'Family original ownership mismatch',
409
+ reason: 'family-intake-models.ts save checks an existing private asset against the intake tenant and owner profile. A required flag alone cannot provide that cross-row ownership match; retain until minimal-row setup can represent the exact shared owner.',
410
+ },
411
+ {
412
+ model: '@happyvertical/smrt-education:GroupLearnerInvitation',
413
+ kind: 'optional-field',
414
+ field: 'groupId.name',
415
+ error: 'Group sharing requires exact identity',
416
+ reason: 'groupId.name reaches the empty-name guard at packages/education/src/group-sharing-models.ts:90; packages/education/src/group-sharing-service.ts:52 only displays the name. Retain conservatively until the parent guard and other optional inputs in this minimal-row graph can be audited together; the guard alone is not identity evidence.',
417
+ },
418
+ {
419
+ model: '@happyvertical/smrt-education:GroupLearnerMembership',
420
+ kind: 'optional-field',
421
+ field: 'groupId.name',
422
+ error: 'Group sharing requires exact identity',
423
+ reason: 'groupId.name reaches the empty-name guard at packages/education/src/group-sharing-models.ts:90; packages/education/src/group-sharing-service.ts:52 only displays the name. Retain conservatively until the parent guard and other optional inputs in this minimal-row graph can be audited together; the guard alone is not identity evidence.',
424
+ },
425
+ {
426
+ model: '@happyvertical/smrt-education:GroupSharingPolicy',
427
+ kind: 'optional-field',
428
+ field: 'membershipId.groupId.name',
429
+ error: 'Group sharing requires exact identity',
430
+ reason: 'membershipId.groupId.name reaches the empty-name guard at packages/education/src/group-sharing-models.ts:90; packages/education/src/group-sharing-service.ts:52 only displays the name. Retain conservatively until the parent guard and other optional inputs in this minimal-row graph can be audited together; the guard alone is not identity evidence.',
431
+ },
432
+ {
433
+ model: '@happyvertical/smrt-education:GroupRevisionComment',
434
+ kind: 'optional-field',
435
+ field: 'membershipId.groupId.name',
436
+ error: 'Group sharing requires exact identity',
437
+ reason: 'membershipId.groupId.name reaches the empty-name guard at packages/education/src/group-sharing-models.ts:90; packages/education/src/group-sharing-service.ts:52 only displays the name. Retain conservatively until the parent guard and other optional inputs in this minimal-row graph can be audited together; the guard alone is not identity evidence.',
438
+ },
439
+ {
440
+ model: '@happyvertical/smrt-education:GroupLearnerRosterEntry',
441
+ kind: 'optional-field',
442
+ field: 'groupId.name',
443
+ error: 'Group sharing requires exact identity',
444
+ reason: 'groupId.name reaches the empty-name guard at packages/education/src/group-sharing-models.ts:90; packages/education/src/group-sharing-service.ts:52 only displays the name. Retain conservatively until the parent guard and other optional inputs in this minimal-row graph can be audited together; the guard alone is not identity evidence.',
445
+ },
446
+ {
447
+ model: '@happyvertical/smrt-education:LessonProgressTransition',
448
+ kind: 'needs-domain-value',
449
+ field: 'progressId.enrollmentId.curriculumId.learnerId.userId, progressId.enrollmentId.curriculumId.learnerId.profileId',
450
+ error: 'Learner requires a linked user/profile and active tenant membership',
451
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: progressId.enrollmentId.curriculumId.learnerId.',
452
+ },
453
+ {
454
+ model: '@happyvertical/smrt-education:EnrollmentStatusChange',
455
+ kind: 'needs-domain-value',
456
+ field: 'enrollmentId.curriculumId.learnerId.userId, enrollmentId.curriculumId.learnerId.profileId',
457
+ error: 'Learner requires a linked user/profile and active tenant membership',
458
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: enrollmentId.curriculumId.learnerId.',
459
+ },
460
+ {
461
+ model: '@happyvertical/smrt-education:LessonCompletionRecord',
462
+ kind: 'needs-domain-value',
463
+ field: 'progressId.enrollmentId.curriculumId.learnerId.userId, progressId.enrollmentId.curriculumId.learnerId.profileId',
464
+ error: 'Learner requires a linked user/profile and active tenant membership',
465
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: progressId.enrollmentId.curriculumId.learnerId.',
466
+ },
467
+ {
468
+ model: '@happyvertical/smrt-education:EnrollmentPaceChange',
469
+ kind: 'needs-domain-value',
470
+ field: 'enrollmentId.curriculumId.learnerId.userId, enrollmentId.curriculumId.learnerId.profileId',
471
+ error: 'Learner requires a linked user/profile and active tenant membership',
472
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: enrollmentId.curriculumId.learnerId.',
473
+ },
474
+ {
475
+ model: '@happyvertical/smrt-education:LearnerInterestThemeChange',
476
+ kind: 'needs-domain-value',
477
+ field: 'learnerId.userId, learnerId.profileId',
478
+ error: 'Learner requires a linked user/profile and active tenant membership',
479
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
480
+ },
481
+ {
482
+ model: '@happyvertical/smrt-education:Learner',
483
+ kind: 'needs-domain-value',
484
+ field: 'userId, profileId',
485
+ error: 'Learner requires a linked user/profile and active tenant membership',
486
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge.',
487
+ },
488
+ {
489
+ model: '@happyvertical/smrt-education:Curriculum',
490
+ kind: 'needs-domain-value',
491
+ field: 'learnerId.userId, learnerId.profileId',
492
+ error: 'Learner requires a linked user/profile and active tenant membership',
493
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
494
+ },
495
+ {
496
+ model: '@happyvertical/smrt-education:Enrollment',
497
+ kind: 'needs-domain-value',
498
+ field: 'curriculumId.learnerId.userId, curriculumId.learnerId.profileId',
499
+ error: 'Learner requires a linked user/profile and active tenant membership',
500
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: curriculumId.learnerId.',
501
+ },
502
+ {
503
+ model: '@happyvertical/smrt-education:LessonProgress',
504
+ kind: 'needs-domain-value',
505
+ field: 'enrollmentId.curriculumId.learnerId.userId, enrollmentId.curriculumId.learnerId.profileId',
506
+ error: 'Learner requires a linked user/profile and active tenant membership',
507
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: enrollmentId.curriculumId.learnerId.',
508
+ },
509
+ {
510
+ model: '@happyvertical/smrt-education:LessonAsset',
511
+ kind: 'needs-domain-value',
512
+ field: 'relationship',
513
+ error: 'Unknown material role',
514
+ reason: 'Needs a supported material role such as attachment; required relationship is text without an enum.',
515
+ },
516
+ {
517
+ model: '@happyvertical/smrt-education:CourseAsset',
518
+ kind: 'needs-domain-value',
519
+ field: 'relationship',
520
+ error: 'Unknown material role',
521
+ reason: 'Needs a supported material role such as attachment; required relationship is text without an enum.',
522
+ },
523
+ {
524
+ model: '@happyvertical/smrt-education:LessonExternalVideo',
525
+ kind: 'optional-field',
526
+ field: 'provider, videoId, title',
527
+ error: 'Invalid external video reference',
528
+ reason: 'lesson-assets.ts save requires a supported provider, an 11-character YouTube id and a bounded nonempty title; submission-service.ts uses the provider/id for the embed URL. Generic required text does not supply this domain identity, and no allowed reason describes the title-content rule; retain pending a domain-value decision.',
529
+ },
530
+ {
531
+ model: '@happyvertical/smrt-education:WorkCompletionDecision',
532
+ kind: 'needs-domain-value',
533
+ field: 'learnerId.userId, learnerId.profileId',
534
+ error: 'Learner requires a linked user/profile and active tenant membership',
535
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
536
+ },
537
+ {
538
+ model: '@happyvertical/smrt-education:LessonActivity',
539
+ kind: 'needs-domain-value',
540
+ field: 'learnerId.userId, learnerId.profileId',
541
+ error: 'Learner requires a linked user/profile and active tenant membership',
542
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
543
+ },
544
+ {
545
+ model: '@happyvertical/smrt-education:LessonWorkFiling',
546
+ kind: 'needs-domain-value',
547
+ field: 'learnerId.userId, learnerId.profileId',
548
+ error: 'Learner requires a linked user/profile and active tenant membership',
549
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
550
+ },
551
+ {
552
+ model: '@happyvertical/smrt-education:WorkAttempt',
553
+ kind: 'needs-domain-value',
554
+ field: 'learnerId.userId, learnerId.profileId',
555
+ error: 'Learner requires a linked user/profile and active tenant membership',
556
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
557
+ },
558
+ {
559
+ model: '@happyvertical/smrt-education:WorkAssessmentRevision',
560
+ kind: 'needs-domain-value',
561
+ field: 'learnerId.userId, learnerId.profileId',
562
+ error: 'Learner requires a linked user/profile and active tenant membership',
563
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
564
+ },
565
+ {
566
+ model: '@happyvertical/smrt-education:WorkFeedbackRelease',
567
+ kind: 'needs-domain-value',
568
+ field: 'learnerId.userId, learnerId.profileId',
569
+ error: 'Learner requires a linked user/profile and active tenant membership',
570
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
571
+ },
572
+ {
573
+ model: '@happyvertical/smrt-education:WorkFeedbackDelivery',
574
+ kind: 'needs-domain-value',
575
+ field: 'learnerId.userId, learnerId.profileId',
576
+ error: 'Learner requires a linked user/profile and active tenant membership',
577
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
578
+ },
579
+ {
580
+ model: '@happyvertical/smrt-education:QuestionExtractionRecord',
581
+ kind: 'optional-field',
582
+ field: 'intakeItemId',
583
+ error: 'Extraction requires an intake item',
584
+ reason: 'packages/education/src/question-extraction-service.ts:230-234 keys preserve replays by tenant, intakeItemId and analysisAttemptId; question-extraction-models.ts:117-122 also demands attempt, source identity, digests and actor. Keep this first-failure entry until those optional prerequisites are audited together; promoting intakeItemId alone exposes a different unledgered failure.',
585
+ },
586
+ {
587
+ model: '@happyvertical/smrt-education:ExtractedQuestionLink',
588
+ kind: 'optional-field',
589
+ field: 'extractionId.intakeItemId',
590
+ error: 'Extraction requires an intake item',
591
+ reason: 'packages/education/src/question-extraction-service.ts:230-234 keys parent extraction replays by intakeItemId and attempt; question-extraction-models.ts:117-122 demands additional optional parent values. Keep the nested first-failure entry until the parent prerequisite chain is audited together.',
592
+ },
593
+ {
594
+ model: '@happyvertical/smrt-education:LearningObjective',
595
+ kind: 'optional-field',
596
+ field: 'externalKey',
597
+ error: 'Objective requires a key',
598
+ reason: 'packages/education/src/question-authoring-service.ts:778-781 resolves objective identity by tenant and externalKey; question-models.ts:96-97 also demands optional author and requestKey. Keep this first-failure entry pending coordinated audit of those remaining prerequisites; declaring externalKey alone does not make the minimal row pass.',
599
+ },
600
+ {
601
+ model: '@happyvertical/smrt-education:LearningObjectiveRevision',
602
+ kind: 'optional-field',
603
+ field: 'objectiveId.externalKey',
604
+ error: 'Objective requires a key',
605
+ reason: 'packages/education/src/question-authoring-service.ts:778-781 resolves the parent objective by externalKey; question-models.ts:96-97 demands further optional parent values. Keep the nested first-failure entry until the objective prerequisite chain is audited together.',
606
+ },
607
+ {
608
+ model: '@happyvertical/smrt-education:Question',
609
+ kind: 'optional-field',
610
+ field: 'createdByUserId',
611
+ error: 'Question requires an author',
612
+ reason: 'packages/education/src/question-models.ts:204 requires author attribution, but repository readers do not use createdByUserId for lookup, authorization or replay; :205 then demands optional requestKey. Keep the entry pending a decision on the author-attribution invariant and audit of the remaining guard; none of the five reasons clearly names attribution alone.',
613
+ },
614
+ {
615
+ model: '@happyvertical/smrt-education:QuestionRevision',
616
+ kind: 'optional-field',
617
+ field: 'questionId.createdByUserId',
618
+ error: 'Question requires an author',
619
+ reason: 'packages/education/src/question-models.ts:204 requires parent Question author attribution, with no downstream identity, authorization or replay use found; :205 also requires optional requestKey. Keep this nested entry pending the parent attribution decision and remaining-guard audit.',
620
+ },
621
+ {
622
+ model: '@happyvertical/smrt-education:QuestionResponse',
623
+ kind: 'needs-domain-value',
624
+ field: 'learnerId.userId, learnerId.profileId',
625
+ error: 'Learner requires a linked user/profile and active tenant membership',
626
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
627
+ },
628
+ {
629
+ model: '@happyvertical/smrt-education:GeneratedPrintable',
630
+ kind: 'optional-field',
631
+ field: 'lessonRevisionId',
632
+ error: 'Question record parent ownership mismatch',
633
+ reason: 'packages/education/src/question-models.ts:451 loads lessonRevisionId under the tenant as provenance, but this plain text field has no relationship metadata for the minimal-row parent builder. Keep the entry pending a decision on representing or supplying that exact revision; removing the ownership check would weaken provenance.',
634
+ },
635
+ {
636
+ model: '@happyvertical/smrt-education:Submission',
637
+ kind: 'needs-domain-value',
638
+ field: 'learnerId.userId, learnerId.profileId',
639
+ error: 'Learner requires a linked user/profile and active tenant membership',
640
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
641
+ },
642
+ {
643
+ model: '@happyvertical/smrt-education:SubmissionIntakeBinding',
644
+ kind: 'needs-domain-value',
645
+ field: 'submissionId.learnerId.userId, submissionId.learnerId.profileId',
646
+ error: 'Learner requires a linked user/profile and active tenant membership',
647
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: submissionId.learnerId.',
648
+ },
649
+ {
650
+ model: '@happyvertical/smrt-education:ScannedSubmission',
651
+ kind: 'needs-domain-value',
652
+ field: 'learnerId.userId, learnerId.profileId',
653
+ error: 'Learner requires a linked user/profile and active tenant membership',
654
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
655
+ },
656
+ {
657
+ model: '@happyvertical/smrt-education:ExternalCompletion',
658
+ kind: 'needs-domain-value',
659
+ field: 'learnerId.userId, learnerId.profileId',
660
+ error: 'Learner requires a linked user/profile and active tenant membership',
661
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
662
+ },
663
+ {
664
+ model: '@happyvertical/smrt-education:Attestation',
665
+ kind: 'needs-domain-value',
666
+ field: 'learnerId.userId, learnerId.profileId',
667
+ error: 'Learner requires a linked user/profile and active tenant membership',
668
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
669
+ },
670
+ {
671
+ model: '@happyvertical/smrt-education:LessonSelfAttestation',
672
+ kind: 'needs-domain-value',
673
+ field: 'submissionId.learnerId.userId, submissionId.learnerId.profileId',
674
+ error: 'Learner requires a linked user/profile and active tenant membership',
675
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: submissionId.learnerId.',
676
+ },
677
+ {
678
+ model: '@happyvertical/smrt-education:SubmissionAsset',
679
+ kind: 'needs-domain-value',
680
+ field: 'submissionId.learnerId.userId, submissionId.learnerId.profileId',
681
+ error: 'Learner requires a linked user/profile and active tenant membership',
682
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: submissionId.learnerId.',
683
+ },
684
+ {
685
+ model: '@happyvertical/smrt-education:Grade',
686
+ kind: 'needs-domain-value',
687
+ field: 'submissionId.learnerId.userId, submissionId.learnerId.profileId',
688
+ error: 'Learner requires a linked user/profile and active tenant membership',
689
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: submissionId.learnerId.',
690
+ },
691
+ {
692
+ model: '@happyvertical/smrt-education:TutorSession',
693
+ kind: 'needs-domain-value',
694
+ field: 'learnerId.userId, learnerId.profileId',
695
+ error: 'Learner requires a linked user/profile and active tenant membership',
696
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
697
+ },
698
+ {
699
+ model: '@happyvertical/smrt-education:TutorSessionClosure',
700
+ kind: 'needs-domain-value',
701
+ field: 'sessionId.learnerId.userId, sessionId.learnerId.profileId',
702
+ error: 'Learner requires a linked user/profile and active tenant membership',
703
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: sessionId.learnerId.',
704
+ },
705
+ {
706
+ model: '@happyvertical/smrt-education:TutorExchange',
707
+ kind: 'needs-domain-value',
708
+ field: 'sessionId.learnerId.userId, sessionId.learnerId.profileId',
709
+ error: 'Learner requires a linked user/profile and active tenant membership',
710
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: sessionId.learnerId.',
711
+ },
712
+ {
713
+ model: '@happyvertical/smrt-education:WorkbookPhotoIntake',
714
+ kind: 'needs-domain-value',
715
+ field: 'learnerId.userId, learnerId.profileId',
716
+ error: 'Learner requires a linked user/profile and active tenant membership',
717
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
718
+ },
719
+ {
720
+ model: '@happyvertical/smrt-education:WorkbookPhotoAsset',
721
+ kind: 'needs-domain-value',
722
+ field: 'learnerId.userId, learnerId.profileId',
723
+ error: 'Learner requires a linked user/profile and active tenant membership',
724
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
725
+ },
726
+ {
727
+ model: '@happyvertical/smrt-education:WorkbookPhotoDecision',
728
+ kind: 'needs-domain-value',
729
+ field: 'learnerId.userId, learnerId.profileId',
730
+ error: 'Learner requires a linked user/profile and active tenant membership',
731
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
732
+ },
733
+ {
734
+ model: '@happyvertical/smrt-education:BookContextRevision',
735
+ kind: 'needs-domain-value',
736
+ field: 'learnerId.userId, learnerId.profileId',
737
+ error: 'Learner requires a linked user/profile and active tenant membership',
738
+ reason: 'Needs a User linked to the same Person profile and an active Membership for the tenant. Registry relationships name Profile, not Person, and do not express the Membership edge. Required-parent path: learnerId.',
739
+ },
740
+ {
741
+ model: '@happyvertical/smrt-expenses:ExpenseAllocationRevision',
742
+ kind: 'optional-field',
743
+ field: 'sourceExpenseId.currency',
744
+ error: "currency must be a three-letter ISO 4217 code (for example 'USD'), got ''.",
745
+ reason: 'The Expense parent needs currency for per-currency totals and commitment/refund comparisons (ExpenseCollection.ts:346; Expense.ts:1198,1332); no requiredFor value describes a monetary unit. Required-parent path: sourceExpenseId.',
746
+ },
747
+ {
748
+ model: '@happyvertical/smrt-expenses:ExpenseAllocationPortion',
749
+ kind: 'optional-field',
750
+ field: 'sourceExpenseId.currency',
751
+ error: "currency must be a three-letter ISO 4217 code (for example 'USD'), got ''.",
752
+ reason: 'The Expense parent needs currency for per-currency totals and commitment/refund comparisons (ExpenseCollection.ts:346; Expense.ts:1198,1332); no requiredFor value describes a monetary unit. Required-parent path: sourceExpenseId.',
753
+ },
754
+ {
755
+ model: '@happyvertical/smrt-expenses:ExpenseAllocationBilling',
756
+ kind: 'optional-field',
757
+ field: 'sourceExpenseId.currency',
758
+ error: "currency must be a three-letter ISO 4217 code (for example 'USD'), got ''.",
759
+ reason: 'The Expense parent needs currency for per-currency totals and commitment/refund comparisons (ExpenseCollection.ts:346; Expense.ts:1198,1332); no requiredFor value describes a monetary unit. Required-parent path: sourceExpenseId.',
760
+ },
761
+ {
762
+ model: '@happyvertical/smrt-expenses:ExpenseReceipt',
763
+ kind: 'optional-field',
764
+ field: 'expenseId.currency',
765
+ error: "currency must be a three-letter ISO 4217 code (for example 'USD'), got ''.",
766
+ reason: 'The Expense parent needs currency for per-currency totals and commitment/refund comparisons (ExpenseCollection.ts:346; Expense.ts:1198,1332); no requiredFor value describes a monetary unit. Required-parent path: expenseId.',
767
+ },
768
+ {
769
+ model: '@happyvertical/smrt-fields:FieldPolicy',
770
+ kind: 'needs-domain-value',
771
+ field: 'objectRef',
772
+ error: "Permission denied for 'fields.policy.manage'.",
773
+ reason: 'Needs an authenticated tenant context with fields.policy.manage permission and a registered qualified objectRef.',
774
+ },
775
+ {
776
+ model: '@happyvertical/smrt-fields:FieldPolicySuggestion',
777
+ kind: 'needs-domain-value',
778
+ field: 'objectRef',
779
+ error: 'Field policy objectRef must be a qualified class name',
780
+ reason: 'Needs a registered qualified class name, not an arbitrary required string.',
781
+ },
782
+ {
783
+ model: '@happyvertical/smrt-fields:FieldUsageCounter',
784
+ kind: 'needs-domain-value',
785
+ field: 'period',
786
+ error: 'FieldUsageCounter.period must be a UTC day bucket',
787
+ reason: 'Needs a UTC YYYY-MM-DD day bucket; metadata only declares text.',
788
+ },
789
+ {
790
+ model: '@happyvertical/smrt-human-resources:Employment',
791
+ kind: 'service-only',
792
+ field: '(service-only write)',
793
+ error: 'Employment columns owned by the HR package are writable only through EmploymentService.',
794
+ reason: 'Employment writes are owned by EmploymentService; its owner must run once against a minimal row.',
795
+ },
796
+ {
797
+ model: '@happyvertical/smrt-human-resources:EmploymentTerm',
798
+ kind: 'service-only',
799
+ field: '(service-only write)',
800
+ error: 'HR records are writable only through EmploymentService and QualificationService.',
801
+ reason: 'EmploymentTerm writes are owned by EmploymentService and QualificationService; its owner must run once against a minimal row.',
802
+ },
803
+ {
804
+ model: '@happyvertical/smrt-human-resources:EmploymentChange',
805
+ kind: 'service-only',
806
+ field: '(service-only write)',
807
+ error: 'HR records are writable only through EmploymentService and QualificationService.',
808
+ reason: 'EmploymentChange writes are owned by EmploymentService and QualificationService; its owner must run once against a minimal row.',
809
+ },
810
+ {
811
+ model: '@happyvertical/smrt-human-resources:Qualification',
812
+ kind: 'service-only',
813
+ field: '(service-only write)',
814
+ error: 'HR records are writable only through EmploymentService and QualificationService.',
815
+ reason: 'Qualification writes are owned by EmploymentService and QualificationService; its owner must run once against a minimal row.',
816
+ },
817
+ {
818
+ model: '@happyvertical/smrt-human-resources:HeldQualification',
819
+ kind: 'service-only',
820
+ field: '(service-only write)',
821
+ error: 'HR records are writable only through EmploymentService and QualificationService.',
822
+ reason: 'HeldQualification writes are owned by EmploymentService and QualificationService; its owner must run once against a minimal row.',
823
+ },
824
+ {
825
+ model: '@happyvertical/smrt-human-resources:HeldQualificationChange',
826
+ kind: 'service-only',
827
+ field: '(service-only write)',
828
+ error: 'HR records are writable only through EmploymentService and QualificationService.',
829
+ reason: 'HeldQualificationChange writes are owned by EmploymentService and QualificationService; its owner must run once against a minimal row.',
830
+ },
831
+ {
832
+ model: '@happyvertical/smrt-inference:InferenceOverride',
833
+ kind: 'needs-domain-value',
834
+ field: 'binding',
835
+ error: 'unknown binding id',
836
+ reason: 'Needs an inference binding registered by the host.',
837
+ },
838
+ {
839
+ model: '@happyvertical/smrt-ledgers:JournalEntry',
840
+ kind: 'optional-field',
841
+ field: 'journalId',
842
+ error: 'Journal entry requires an accessible parent journal',
843
+ reason: 'JournalEntry.save loads and locks its parent journal before checking its account scope and nonzero debit/credit. Promoting journalId alone exposes the independent optional accountId failure; the combined parent/account/amount fixture contract remains undecided, with the original error retained.',
844
+ },
845
+ {
846
+ model: '@happyvertical/smrt-manufacturing:ProductionRunCompletion',
847
+ kind: 'optional-field',
848
+ field: 'runId.targetQty',
849
+ error: 'A production run needs a target quantity greater than zero.',
850
+ reason: 'The required runId parent cannot save with its real targetQty = 0 initializer (ProductionRun.validateBeforeSave); this is the parent planning-quantity exception, not a missing run identity. No reason value expresses that positive quantity.',
851
+ },
852
+ {
853
+ model: '@happyvertical/smrt-playbooks:PlaybookOverride',
854
+ kind: 'needs-domain-value',
855
+ field: 'key',
856
+ error: 'Unknown playbook key "minimal"',
857
+ reason: 'Needs a host-registered playbook key.',
858
+ },
859
+ {
860
+ model: '@happyvertical/smrt-preferences:UiPreferenceRecord',
861
+ kind: 'needs-domain-value',
862
+ field: 'tenantId',
863
+ error: 'User-interface preferences need an authenticated tenant context',
864
+ reason: 'Needs an authenticated active tenant context plus a registered preference kind.',
865
+ },
866
+ {
867
+ model: '@happyvertical/smrt-profiles:ProfileLink',
868
+ kind: 'needs-domain-value',
869
+ field: 'platform',
870
+ error: 'Unknown profile link platform: minimal',
871
+ reason: 'Needs a supported profile-link platform; the required string has no enum.',
872
+ },
873
+ {
874
+ model: '@happyvertical/smrt-projects:ProjectSpecification',
875
+ kind: 'optional-field',
876
+ field: 'actorType, actorId',
877
+ error: 'Project specification actor is required.',
878
+ reason: 'packages/projects/src/models/ProjectSpecification.ts:68-72 requires a valid actor type and nonempty actor id together, but stored actors are provenance only: project-specification-service.ts:74 authorizes the incoming actor.canManage, never these fields. No demonstrated stored-row dependency supports a reason; retain pending a decision on the runtime guard outside declaration-only scope.',
879
+ },
880
+ {
881
+ model: '@happyvertical/smrt-prompts:PromptOverride',
882
+ kind: 'needs-domain-value',
883
+ field: 'key',
884
+ error: 'Unknown prompt key "minimal"',
885
+ reason: 'Needs a host-registered prompt key.',
886
+ },
887
+ {
888
+ model: '@happyvertical/smrt-reactions:Poll',
889
+ kind: 'service-only',
890
+ field: '(service-only write)',
891
+ error: 'Participation records require service write authority.',
892
+ reason: 'Poll writes are owned by PollService (ParticipationRuntime.polls); its owner must run once against a minimal row.',
893
+ },
894
+ {
895
+ model: '@happyvertical/smrt-reactions:PollVote',
896
+ kind: 'service-only',
897
+ field: '(service-only write)',
898
+ error: 'Participation records require service write authority.',
899
+ reason: 'Poll writes are owned by PollService (ParticipationRuntime.polls); its owner must run once against a minimal row. Required-parent path: pollId.',
900
+ },
901
+ {
902
+ model: '@happyvertical/smrt-reactions:Reaction',
903
+ kind: 'service-only',
904
+ field: '(service-only write)',
905
+ error: 'Participation records require service write authority.',
906
+ reason: 'Reaction writes are owned by ReactionService (ParticipationRuntime.reactions); its owner must run once against a minimal row.',
907
+ },
908
+ {
909
+ model: '@happyvertical/smrt-reports:RuntimeReport',
910
+ kind: 'needs-domain-value',
911
+ field: 'spec',
912
+ error: 'spec is not valid JSON',
913
+ reason: 'Needs a valid serialized RuntimeReportSpec, not an arbitrary required string.',
914
+ },
915
+ {
916
+ model: '@happyvertical/smrt-sales:SalesGovernanceEvent',
917
+ kind: 'service-only',
918
+ field: '(service-only write)',
919
+ error: 'Sales governance state is service-owned',
920
+ reason: 'SalesGovernanceEvent writes are owned by SalesGovernanceService; its owner must run once against a minimal row.',
921
+ },
922
+ {
923
+ model: '@happyvertical/smrt-sales:SalesGovernanceState',
924
+ kind: 'service-only',
925
+ field: '(service-only write)',
926
+ error: 'Sales governance state is service-owned',
927
+ reason: 'SalesGovernanceState writes are owned by SalesGovernanceService; its owner must run once against a minimal row.',
928
+ },
929
+ {
930
+ model: '@happyvertical/smrt-subscriptions:TenantSubscription',
931
+ kind: 'optional-field',
932
+ field: 'planId',
933
+ error: 'Subscription plan is unavailable',
934
+ reason: 'Save dereferences planId for pricing and version pinning, so identity fits. Requiring planId exposes optional planVersionId being auto-populated (minimal-row contract); that unassigned field needs a coordinated fix before this model passes and the entry can be removed.',
935
+ },
936
+ {
937
+ model: '@happyvertical/smrt-subscriptions:CreditGrant',
938
+ kind: 'optional-field',
939
+ field: 'amount',
940
+ error: 'Credit grant amounts must be nonzero integer minor units (cents).',
941
+ reason: 'CreditGrant.validateBeforeSave requires a nonzero signed integer amount and a balance policy of the same tenant and currency; required alone accepts initializer 0 and cannot express this compound credit rule.',
942
+ },
943
+ {
944
+ model: '@happyvertical/smrt-timesheets:AttendanceCorrection',
945
+ kind: 'service-only',
946
+ field: '(service-only write)',
947
+ error: 'Attendance corrections are writable only through AttendanceCorrectionService.',
948
+ reason: 'AttendanceCorrection writes are owned by AttendanceCorrectionService; its owner must run once against a minimal row.',
949
+ },
950
+ {
951
+ model: '@happyvertical/smrt-timesheets:AttendanceSegment',
952
+ kind: 'optional-field',
953
+ field: 'punchId, workRefType, workRefId',
954
+ error: 'Invalid attendance work segment.',
955
+ reason: 'Segments require a tenant-owned punch, matching parent profileId, and paired work identity; continueSegment reuses stored references. A single-field promotion does not express the parent-derived profile or resume contract. Retain this coupled-field exception pending a complete minimal fixture contract.',
956
+ },
957
+ {
958
+ model: '@happyvertical/smrt-timesheets:AttendanceReplay',
959
+ kind: 'optional-field',
960
+ field: 'outcome',
961
+ error: 'Invalid stored attendance replay outcome.',
962
+ reason: 'AttendanceReplay.getOutcome fails closed on a receipt lacking a clientId and exactly one success punchId or refusal error. The real JSON initializer {} is outside this audit; no field-level required flag expresses that outcome shape.',
963
+ },
964
+ {
965
+ model: '@happyvertical/smrt-timesheets:PeriodTimecard',
966
+ kind: 'service-only',
967
+ field: '(service-only write)',
968
+ error: 'Timecards and adjustments are writable only through PeriodRollupService.',
969
+ reason: 'PeriodTimecard writes are owned by PeriodRollupService; its owner must run once against a minimal row.',
970
+ },
971
+ {
972
+ model: '@happyvertical/smrt-timesheets:TimecardAdjustment',
973
+ kind: 'service-only',
974
+ field: '(service-only write)',
975
+ error: 'Timecards and adjustments are writable only through PeriodRollupService.',
976
+ reason: 'TimecardAdjustment writes are owned by PeriodRollupService; its owner must run once against a minimal row.',
977
+ },
978
+ {
979
+ model: '@happyvertical/smrt-timesheets:TimecardReopening',
980
+ kind: 'service-only',
981
+ field: '(service-only write)',
982
+ error: 'Timecards and adjustments are writable only through PeriodRollupService.',
983
+ reason: 'TimecardReopening writes are owned by PeriodRollupService; its owner must run once against a minimal row.',
984
+ },
985
+ {
986
+ model: '@happyvertical/smrt-webhooks:WebhookSubscription',
987
+ kind: 'needs-domain-value',
988
+ field: 'url',
989
+ error: 'Webhook URL must be an absolute HTTPS URL.',
990
+ reason: 'Needs an absolute HTTPS URL; metadata only declares text.',
991
+ },
992
+ {
993
+ model: '@happyvertical/smrt-commerce:BillingAccount',
994
+ field: 'customerId',
995
+ reason: "Model validation rejects empty/default customerId: Billing accounts require a customerId. Smrt's code needs this value, but the column was optional in 0.60.17, so making it required needs a data step for old rows that hold NULL; that step is not written.",
996
+ error: 'Billing accounts require a customerId.',
997
+ },
998
+ {
999
+ model: '@happyvertical/smrt-timesheets:AttendancePunch',
1000
+ field: 'profileId',
1001
+ reason: "Model validation rejects empty/default profileId: Attendance requires tenantId and profileId. Smrt's code needs this value, but the column was optional in 0.60.17, so making it required needs a data step for old rows that hold NULL; that step is not written.",
1002
+ error: 'Attendance requires tenantId and profileId.',
1003
+ },
1004
+ {
1005
+ model: '@happyvertical/smrt-education:LessonPage',
1006
+ kind: 'optional-field',
1007
+ field: 'pageKey',
1008
+ error: 'Invalid lesson page',
1009
+ reason: "LessonPage code requires pageKey although registry metadata allows it empty/default; changing required/NOT NULL would change schema. Smrt's code needs this value, but the column was optional in 0.60.17, so making it required needs a data step for old rows that hold NULL; that step is not written.",
1010
+ },
1011
+ {
1012
+ model: '@happyvertical/smrt-timesheets:AttendanceBreak',
1013
+ kind: 'optional-field',
1014
+ field: 'punchId',
1015
+ error: 'Invalid attendance break.',
1016
+ reason: "AttendanceBreak code requires punchId although registry metadata allows it empty/default; changing required/NOT NULL would change schema. Smrt's code needs this value, but the column was optional in 0.60.17, so making it required needs a data step for old rows that hold NULL; that step is not written.",
1017
+ },
1018
+ {
1019
+ model: '@happyvertical/smrt-tenancy:BillingRelationship',
1020
+ kind: 'undeclared-parent',
1021
+ field: 'childTenantId',
1022
+ error: 'Required parent @happyvertical/smrt-users:Tenant',
1023
+ reason: 'childTenantId requires a Tenant from @happyvertical/smrt-users, a package that depends on @happyvertical/smrt-tenancy, so tenancy cannot declare it (a dependency cycle). The harness resolves parents only inside the declared packages, so this fails the same whether or not users is built; a minimal row needs a parent the declared packages can supply.',
1024
+ },
1025
+ {
1026
+ model: '@happyvertical/smrt-messages:PersonaMessageRoute',
1027
+ kind: 'undeclared-parent',
1028
+ field: 'personaId',
1029
+ error: 'Required parent @happyvertical/smrt-personas:AgentPersona',
1030
+ reason: 'personaId requires a AgentPersona from @happyvertical/smrt-personas, a package that depends on @happyvertical/smrt-messages, so messages cannot declare it (a dependency cycle). The harness resolves parents only inside the declared packages, so this fails the same whether or not personas is built; a minimal row needs a parent the declared packages can supply.',
1031
+ },
1032
+ {
1033
+ model: '@happyvertical/smrt-facts:FactContent',
1034
+ kind: 'undeclared-parent',
1035
+ field: 'contentId',
1036
+ error: 'Required parent @happyvertical/smrt-content:Content',
1037
+ reason: 'contentId requires a Content from @happyvertical/smrt-content, a package that depends on @happyvertical/smrt-facts, so facts cannot declare it (a dependency cycle). The harness resolves parents only inside the declared packages, so this fails the same whether or not content is built; a minimal row needs a parent the declared packages can supply.',
1038
+ },
1039
+ ];
1040
+ //# sourceMappingURL=minimal-row-expected-failures.js.map