WIP: Rehearse complete D1 data preservation for Human sign-in #42

Draft
ClaudiuSchuster wants to merge 8 commits from oss-oo/native-d1-rehearsal-20261025 into oss-oo/native-human-backend-20261024
Owner

Human sign-in expands Commons from the existing 15-table baseline or 19-table identity schema to a 25-table schema. This adds opt-in native D1 rehearsals that prove complete preservation before that migration: every original column, row, storage class and multiplicity, plus account derivation, eligibility, credentials, binding tombstones and lineage.

The first rehearsal checks 36 typed values and REST transaction behavior. The graph rehearsal reuses the existing fixture builders and copyPreserved oracle, creates two fresh unbound synthetic databases per declared case, builds schema without replaying seeds, and performs one fixed copy batch. It verifies full source and target schemas, all values, foreign keys and ledger rows; the source must remain unchanged. Default execution is inert. There is no existing-database adoption, automatic write replay, HTTP DELETE, Worker binding or production route change.

Validation:

  • The actual 36-value native run passes all 14 gates, including late DDL/CHECK/UNIQUE/trigger/deferred-FK failures with complete primary before/after equality. Earlier UNKNOWN outcomes remain preserved separately. Its six test databases were independently checked and removed.
  • Both actual graph cases pass on this exact source: Baseline15→Human25 and Predecessor19→Human25. Each uses five once-only writes and four complete graph gates. Root separately re-read all 40 and 44 source/target tables through 88 and 96 additional primary queries.
  • Independent review checked 556 native primary receipts and decoded 6,661 raw cells against the sealed oracle without reusing the operator codec or SQLite. Complete schema/provider metadata, typed row multisets, ledger/identity derivation and unchanged sources passed. The first predecessor attempt refused an inconsistent provider inventory before data writes; it remains REFUSED, and the successful case used a fresh namespace.
  • The provider actually rejects 104/116 result columns. A compact type-plus-value projection retains each complete row in one SELECT, at most 58 fields; INTEGER uses decimal text, REAL remains native numeric data, TEXT/BLOB use hex and NULL remains NULL. No chunked row correlation or SQLite JSON float formatting is introduced.
  • Source checks pass: 21 tests normally and under -O, independent request/ownership/journal/wire countercases, both original oracle graphs under a real local 100-column limit, and exact packet reproduction. The prior 36-value profile and runtime contracts stay unchanged. Post-dispatch journal failures remain UNKNOWN with confirmed ownership retained, and malformed successful replies are checked before journaling.

All five retained graph-test databases, including the empty source from the refused attempt, were separately checked against 185 fresh admitted primary queries and removed once. Individual GET404 checks and the complete account inventory confirm their absence; production was untouched. CI runs offline contracts only. Actual Worker Binding and Human session/resource behavior, a consistent production snapshot/write fence, recovery and live cutover remain separate gates. This PR stays draft and stacked on #40.

Current source CI passed.

Source head: a9520d13a4009147d9be1db0a62d3f78cf2750d8
Tree: add14df11cc1705ead56bb48d3fdda6929d2610f

Human sign-in expands Commons from the existing 15-table baseline or 19-table identity schema to a 25-table schema. This adds opt-in native D1 rehearsals that prove complete preservation before that migration: every original column, row, storage class and multiplicity, plus account derivation, eligibility, credentials, binding tombstones and lineage. The first rehearsal checks 36 typed values and REST transaction behavior. The graph rehearsal reuses the existing fixture builders and copyPreserved oracle, creates two fresh unbound synthetic databases per declared case, builds schema without replaying seeds, and performs one fixed copy batch. It verifies full source and target schemas, all values, foreign keys and ledger rows; the source must remain unchanged. Default execution is inert. There is no existing-database adoption, automatic write replay, HTTP DELETE, Worker binding or production route change. Validation: - The actual 36-value native run passes all 14 gates, including late DDL/CHECK/UNIQUE/trigger/deferred-FK failures with complete primary before/after equality. Earlier UNKNOWN outcomes remain preserved separately. Its six test databases were independently checked and removed. - Both actual graph cases pass on this exact source: Baseline15→Human25 and Predecessor19→Human25. Each uses five once-only writes and four complete graph gates. Root separately re-read all 40 and 44 source/target tables through 88 and 96 additional primary queries. - Independent review checked 556 native primary receipts and decoded 6,661 raw cells against the sealed oracle without reusing the operator codec or SQLite. Complete schema/provider metadata, typed row multisets, ledger/identity derivation and unchanged sources passed. The first predecessor attempt refused an inconsistent provider inventory before data writes; it remains REFUSED, and the successful case used a fresh namespace. - The provider actually rejects 104/116 result columns. A compact type-plus-value projection retains each complete row in one SELECT, at most 58 fields; INTEGER uses decimal text, REAL remains native numeric data, TEXT/BLOB use hex and NULL remains NULL. No chunked row correlation or SQLite JSON float formatting is introduced. - Source checks pass: 21 tests normally and under -O, independent request/ownership/journal/wire countercases, both original oracle graphs under a real local 100-column limit, and exact packet reproduction. The prior 36-value profile and runtime contracts stay unchanged. Post-dispatch journal failures remain UNKNOWN with confirmed ownership retained, and malformed successful replies are checked before journaling. All five retained graph-test databases, including the empty source from the refused attempt, were separately checked against 185 fresh admitted primary queries and removed once. Individual GET404 checks and the complete account inventory confirm their absence; production was untouched. CI runs offline contracts only. Actual Worker Binding and Human session/resource behavior, a consistent production snapshot/write fence, recovery and live cutover remain separate gates. This PR stays draft and stacked on #40. [Current source CI](https://oss-oo.io/OSS-Singularity/website/actions/runs/128) passed. Source head: `a9520d13a4009147d9be1db0a62d3f78cf2750d8` Tree: `add14df11cc1705ead56bb48d3fdda6929d2610f`
fix(commons): bind D1 rehearsal HTTP rejection evidence
All checks were successful
Repository checks / repository-baseline (pull_request) Successful in 9m41s
fa70de0dd6
fix(commons): bind native SQL offsets and safe diagnostics
Some checks failed
Repository checks / repository-baseline (pull_request) Failing after 1m30s
bd78ed346d
Admit exact synthetic D1 constraint error envelopes
All checks were successful
Repository checks / repository-baseline (pull_request) Successful in 9m49s
9e247705c7
ClaudiuSchuster changed title from WIP: Rehearse D1 typed copy and REST transaction behavior to WIP: Rehearse complete D1 data preservation for Human sign-in 2026-10-25 17:01:55 +00:00
All checks were successful
Repository checks / repository-baseline (pull_request) Successful in 28m59s
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin oss-oo/native-d1-rehearsal-20261025:oss-oo/native-d1-rehearsal-20261025
git switch oss-oo/native-d1-rehearsal-20261025

Merge

Merge the changes and update on Forgejo.
git switch oss-oo/native-human-backend-20261024
git merge --no-ff oss-oo/native-d1-rehearsal-20261025
git switch oss-oo/native-d1-rehearsal-20261025
git rebase oss-oo/native-human-backend-20261024
git switch oss-oo/native-human-backend-20261024
git merge --ff-only oss-oo/native-d1-rehearsal-20261025
git switch oss-oo/native-d1-rehearsal-20261025
git rebase oss-oo/native-human-backend-20261024
git switch oss-oo/native-human-backend-20261024
git merge --no-ff oss-oo/native-d1-rehearsal-20261025
git switch oss-oo/native-human-backend-20261024
git merge --squash oss-oo/native-d1-rehearsal-20261025
git switch oss-oo/native-human-backend-20261024
git merge --ff-only oss-oo/native-d1-rehearsal-20261025
git switch oss-oo/native-human-backend-20261024
git merge oss-oo/native-d1-rehearsal-20261025
git push origin oss-oo/native-human-backend-20261024
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
OSS-Singularity/website!42
No description provided.