Commit ccafecd
committed
fix(objectql,platform-objects): attest a fresh datastore on this boot's own data, not on the emptiness it remembers (#4769)
A store created from empty recorded both ADR-0104 migrations as verified at
`kernel:ready`, while the same boot was still seeding rows whose values
contradict them. The certificate was true when written and false a second
later: the first boot ran warn-first and kept the data, every later boot read
the certificate, enforced it, and rejected the rows its predecessor had
written. Same data, same code, one restart.
Three changes, one invariant — a boot may not prove a contract it violates in
that same boot:
- The attestation waits for `app:seeded` (the inline seed's settle point,
background continuation included), with `kernel:ready` as the backstop for
kernels that never seed. Both enter the same idempotent call.
- `attestFreshDatastore` consults the engine's tally of ADMITTED value-shape
violations first and declines any migration id this boot has already
contradicted, naming the object.field and the command that closes the gate.
The two ids are judged independently — a bad `cover` does not sink the
`location` gate. The engine records those admissions from the warn-first
path with the exact predicate strict mode uses, so certifying still needs a
scan while refuting needs the one counterexample the write already computed.
- A certificate contradicted AFTER it was issued is revoked from the write
path that contradicted it, scoped to creation attestations on a store this
boot created; evidence produced by a real migration run is never rewritten.
Also fixes the memoized flag read, the other half of why the first boot looked
green: "the ledger says no" is now distinguished from "the ledger could not be
asked" (sys_migration not registered yet, or the query threw). Both keep the
gate closed, only the former is remembered, so one unlucky early write no
longer freezes a whole boot's posture. The `kernel:bootstrapped` advisory
reads the ledger directly for the same reason.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Br2xsJsczFsTR9bvbh2Ny1 parent 9f601e8 commit ccafecd
9 files changed
Lines changed: 1005 additions & 37 deletions
File tree
- .changeset
- packages
- objectql/src
- validation
- platform-objects/src
- system
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
0 commit comments