You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(spec,objectql,metadata-protocol): validate-only data operation — DataProtocol.validateData (#6474)
* feat(spec,objectql,metadata-protocol): validate-only data operation (#6037)
#4633 ruling D: import's dry run stops PREDICTING the write's verdict with a
hand-copied mirror of the engine's rules and starts ASKING for it.
`DataProtocol.validateData` reports the write path's verdict on candidate rows
and persists nothing. Declaration and execution land together — a ruling clause,
not a style note: `BatchOptions.validateOnly` was retired in #4052 as a dry-run
flag that promised a preview while the batch surfaces persisted regardless. The
new operation avoids that spelling and leaves the tombstone standing.
`engine.validate()` calls the same validateRecord / evaluateValidationRules
that insert() calls, so preview == write is guaranteed by construction; a test
asserts it by running both against one engine under both ADR-0104 postures.
The response carries the posture it was reached under — a bad value shape is an
error on a self-certified deployment and an admitted warning on a warn-first
one, which is why option B (unconditional strict) was rejected.
Two documented boundaries: no hooks run (firing user hooks in a preview would
be the #4052 defect respelled), and warn-first admissions are not recorded as
#4769 certification evidence (a preview writes nothing, so it must not block a
later migration).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3U9PJm1hEJitS9LtZz8TC
* spec: regenerate strictness-ledger counts after merging main (#6037)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3U9PJm1hEJitS9LtZz8TC
* test(spec): pin ValidateData* aliases as isomorphic (ADR-0122)
The three new protocol aliases carry no defaults/transforms, so z.input
and z.infer coincide — per ADR-0122 the complement is pinned in the
registry rather than given a permanent-synonym XParsed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011M7UwH25Unfi73UHim7ajY
* test(spec): pin-count receipt 751 -> 754 for the ValidateData* pins
The registry's own count case documents every movement; record the
three-pin rise with its cause per the file's idiom.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011M7UwH25Unfi73UHim7ajY
---------
Co-authored-by: Claude <noreply@anthropic.com>
|**message**|`string`| ✅ | Human-readable message — a validation rule's author-written text where one exists. |
1626
+
1627
+
1628
+
---
1629
+
1630
+
## ValidateDataRequest
1631
+
1632
+
### Properties
1633
+
1634
+
| Property | Type | Required | Description |
1635
+
| :--- | :--- | :--- | :--- |
1636
+
|**object**|`string`| ✅ | The object name. |
1637
+
|**data**|`Record<string, any> \| Record<string, any>[]`| ✅ | A candidate record, or an array of them. Nothing is persisted. |
1638
+
|**mode**|`Enum<'insert' \| 'update'>`| optional | Which write the verdict should predict. `insert` (default) walks every declared field, so a missing required field is a finding; `update` judges only the supplied keys, matching a PATCH. |
1639
+
1640
+
1641
+
---
1642
+
1643
+
## ValidateDataResponse
1644
+
1645
+
### Properties
1646
+
1647
+
| Property | Type | Required | Description |
1648
+
| :--- | :--- | :--- | :--- |
1649
+
|**object**|`string`| ✅ | The object name. |
1650
+
|**mode**|`Enum<'insert' \| 'update'>`| ✅ | The write mode the verdict was reached for. |
1651
+
|**valid**|`boolean`| ✅ | True when EVERY row is valid — the whole-set answer. |
|**posture**|`{ valueShapeStrict: boolean; mediaValueShapeStrict: boolean }`| ✅ | The ADR-0104 posture the verdict was reached under — reported because it is the difference between "this row is fine" and "this row is fine HERE". The same row can be an error on a self-certified deployment and an admitted warning on an un-migrated one, and a caller explaining a verdict needs to know which it got. An unconditionally-strict preview was considered and rejected (#4633 option B): it would fail rows on every un-migrated deployment that the write would have accepted. |
0 commit comments