Commit 90ed65f
committed
test(objectql): pin the case that defines a
`checkPredicate` evaluates a `script` / `cross_field` condition against
`ctx.merged` on every write, with no exemption for a violation that was
already stored. A row that already violates is therefore refused on any
edit until a repairing write lands — frozen, not bricked — and that is
exactly what separates a `validations[]` invariant from a
`Field.requiredWhen` transition gate, whose ADR-0113 exemption is pinned
at `rule-validator.test.ts:65` ("legacy rows rest: a pre-existing
violation does not block an unrelated write").
The `script / cross_field predicates` block pinned only the write that
carries the offending value, the write that makes the predicate false,
and the un-evaluable predicate. The distinguishing case — an
unrelated-field write against an already-violating row — had no pin, so
the two mechanisms' boundary had asymmetric coverage.
Two `it` cases, no behaviour change:
- unrelated-field write over a violating prior row is refused, asserted
on the envelope (`VALIDATION_FAILED`, `_record` / `rule_violation`,
authored message) rather than a bare `toThrow`;
- the repairing write passes — frozen, not bricked.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68script rule as an invariant1 parent 84b8190 commit 90ed65f
1 file changed
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1850 | 1850 | | |
1851 | 1851 | | |
1852 | 1852 | | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
1853 | 1903 | | |
1854 | 1904 | | |
1855 | 1905 | | |
| |||
0 commit comments