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
fix(objectql): align SysMetadataRepository with existing sys_metadata schema (ADR-0008 PR-10d.2)
Discovery from the PR-10d.2 audit: the production sys_metadata table
(packages/platform-objects/src/metadata/sys-metadata.object.ts) already
has a `checksum: text(64)` column — exactly the right shape for sha256
hex — and a `version: number` column for monotonic increments. The
draft SysMetadataRepository was writing a non-existent `_hash` column,
which would silently drop or error against real drivers.
Changes:
- SysMetadataRepository now reads/writes `checksum` instead of `_hash`
- documented schema mapping in the file header:
body → metadata · hash → checksum · version int → version
- updated the in-memory test fakes (both sys-metadata-repository.test.ts
and layered-overlay-integration.test.ts) to mirror the new column name
- extended the dry-run probe (PR-10d.1) with two new checks:
* checksum_missing — warning, eligible for lazy backfill
* checksum_drift — error, stored checksum disagrees with hashSpec(body)
- 3 new probe tests + report fields (needsBackfill, checksumDrift)
Result: zero DDL needed for PR-10d.3 cutover. Legacy rows with NULL
checksum will be backfilled on first put(). Objectql suite: 325/325 green.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments