Skip to content

SQLite schema drift: a boolean field declaring defaultValue 'false' (a string) is reported as set_column_default drift on every read, and re-applying it changes nothing #37434

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

Filing gate: ① · Source: fleet (os-dev measurement on PR #37425 for #37345, report comment 7182686626) · finding class a · reach: named producer (SqlDriver.detectManagedDrift: the boot drift warning and os migrate plan, on any SQLite datasource).

Grading: area:data · Bug · measured at PR #37425 head f438ff8c through both driver-turso faces; not introduced by that PR (the local face has written '0' since before it) · evidence: measured.
Suggested-grade: p3 · a permanent false drift entry; no data is wrong, but the drift report never goes clean for such a field and a re-apply loops.

What

A boolean field declaring defaultValue: 'false' (a string) gets column DEFAULT '0' (knex's boolean formatter on the local face; the shared renderer on the remote face after PR #37425). packages/drivers/driver-sql/src/schema-drift.ts physicalLiteralMatches compares a string declaration as text, so it reports default_mismatch / set_column_default (expected DEFAULT 'false', actual DEFAULT '0') on every read, and applying the entry writes '0' again.

Acceptance (proposed, for triage)

  • The differ normalises a boolean declaration the way the writer renders it ('false' / false → 0, a truthy value → 1, for boolean and toggle columns), so a freshly synced column reads zero drift on both faces.
  • turso-remote-default-parity.test.ts's separate 'false' describe joins the per-kind zero-drift set; the docblock note pointing here goes.

Related: #37345 (PR #37425), #36245 (local DEFAULT drift).
Dedupe: searched 'physicalLiteralMatches', 'set_column_default boolean', 'default_mismatch boolean' — no open card.

Activity

  1. added
    finding
    on Nov 26, 2026
  2. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Correction · area o5-D · 2026-11-26T05:00Z (contract record 7183095333 on PR #37425, nit N3)
    "Not introduced by that PR" holds for the local face only. On the remote Turso/libSQL face this false drift becomes reachable with PR #37425 (no DEFAULT was written there before), and there the entry is one the remote apply door cannot act on either (needs-table-rebuild, #37430). Reach is unchanged: a boolean field declaring the string 'false'; the outcome equals the local face's report.

  3. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: lands in area:data · domain:data · Bug · priority:p3 · pm:queue · size S; rationale: a boolean field that declares defaultValue: 'false' as a string shows a permanent set_column_default drift on any SQLite datasource, and re-applying it loops. No stored data is wrong, so p3, as suggested.

    It sits with the drift-differ family (#37430, #37345). finding stays.

  4. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

    Picked by card-pick.mjs --order area:data --seat repo:objectstack#8 at 2026-11-28T10:25Z: p3 close-out (a SQLite drift report that never goes clean for a boolean declaring a string default). The maintainer in this seat's session, verbatim: 「开一个 objectstack 全仓座位」 with intake area:data; 「batch 调到 5,可以用云卡」; then on more concurrency through cloud cards, batch 「8 (Recommended)」; 「现在并发多少,还能加速吗」.

    Claim: PM loop round 1
    Session: session_017xRBcSAaBEfQpU2yJexSJ8
    Account: sunhaolin
    Branch: claude/issue-37434-sqlite-boolean-default-drift
    Worktree: objectstack-issue-37434
    Domain: domain:data
    Seat: repo:objectstack#8
    File surface: packages/drivers/driver-sql/src/schema-drift.ts (physicalLiteralMatches and its boolean arm), co-located tests, one changeset 37434-<slug>.md; ⛔ not sql-driver-schema-sync.ts (PR #38225) nor sql-driver-bulk-operations.ts (#38236) (stop on breach; explain in the report)
    Container & model: S, mode:cloud, model: opus (dispatch-gates --tier: no path-derived mandate; default tier), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack — SqlDriver drift reading of a boolean literal DEFAULT
    Thread-read: none
    Premise: measured first by the cloud dev on current main (the card's reproduction), before any edit; a premise that no longer holds is reported, not built.
    Serial constraints cleared: check-handover.mjs --inflight --paths=packages/drivers/driver-sql/src/schema-drift.ts reads no overlap; the two claims naming no path (#38150, #37903, seat 3) were read by hand: Studio packaging and console metadata readers, no meeting surface; textual overlap re-checked with overlap-check.mjs before every push.
    Scope this dispatch: the whole card. Fixes #37434.

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 28, 2026
  6. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#8 · sunhaolin · session_017xRBcW5vEyUAgUNBDvbuKo
    os-dev-report
    {
    "issue": 37434,
    "status": "done",
    "branch": "claude/issue-37434-sqlite-boolean-default-drift",
    "pr": null,
    "session": "session_017xRBcW5vEyUAgUNBDvbuKo",
    "premise_still_valid": true,
    "summary": "Reproduced on main 9f5562f (SQLite): a boolean field declaring defaultValue 'false' / 'true' gets DEFAULT '0' / '1', detectManagedDrift reports default_mismatch / set_column_default for each, applyMigrationEntries applies 2 and the next read reports both again. Fixed in schema-drift.ts physicalLiteralMatches: on a boolean or toggle column the exact strings 'true' / 'false' are read as booleans before the comparison; a real mismatch is still reported and one apply empties the plan. The branch is pushed at 5cb5903; the draft PR was NOT opened: the relay pr_create was refused by the permission classifier, so the seat sends it with the title and body handed over in the final message. The claim's Account sunhaolin rides pr_create as assignee; the card's assignee was not written.",
    "tests": "Repro at 9f5562f (scratch test, not committed): DEFAULTS off_text '0', on_text '1'; DRIFT1 both default_mismatch/set_column_default/safe; APPLIED 2 SKIPPED 0; DRIFT2 both again. At 5cb5903: driver-sql pins src/sql-driver-37434-boolean-string-default-drift.test.ts 16 passed; driver-sql full suite Test Files 272 passed | 14 skipped, Tests 4585 passed | 265 skipped; driver-turso full suite Test Files 105 passed | 1 skipped, Tests 2686 passed | 36 skipped (parity file 9/9); typecheck both packages tsc --noEmit clean, both test files in the program (--listFiles 1 hit each); os-verify-lock VERDICT command-exit 0. Ablation via scripts/ablation-replace.mjs (deleted the normalisation line; mutation landed, blob fab3a56f -> 15956a6f; driver-sql rebuilt; ablation-dist-preflight --absent passed): driver-sql pins Tests 7 failed | 9 passed (16), the real-mismatch rows stay green; turso parity Tests 8 failed | 1 passed (9). Restore proven (blob == HEAD, git diff HEAD empty); restore leg rebuilt, preflight marker present in 2 built files, tree clean.",
    "gates": "dispatch-gates --commands at 5cb5903 (objectstack-ai/objectstack, merge base 9f5562f, 4 paths): 67 families. 62 exit 0. Exit 3 (prerequisite not met, NOT MEASURED): node scripts/check-plugin-teardown-shape.mjs --self-test (shallow clone), pnpm check:dual-build-cjs-loads and pnpm check:lean-entry-closure (no full build). Local 240s cap fired before a verdict (exit 124, declared NOT MEASURED, CI Lint & Repo Gates runs them): pnpm check:query-options-erasure, pnpm check:type-check-debt. dispatch-gates --ran with exit codes: 67 accounted, 62 run, 5 NOT-MEASURED, 0 UNRUN, exit 0. overlap-check.mjs before push: VERDICT clean exit 0 (against origin/main and 0 PR heads). PR check-runs: none, no PR is open yet.",
    "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
    "mcp_calls": "2 — mcp__github__issue_read (get), mcp__github__issue_read (get_comments); reads only, no MCP write",
    "api_writes": "0 — the relay pr_create (fleet-write/dispatch.mjs, POST /repos/objectstack-ai/objectstack/dispatches) was refused by the permission classifier before sending; one git push (not a REST write)",
    "open_questions": [
    { "question": "File surface: the card's acceptance names driver-turso's turso-remote-default-parity.test.ts, outside driver-sql. It was edited as a co-located test of the change (test-only). Is that inside the declared surface?", "options": ["A accept as co-located test", "B split the parity edit into its own PR"], "recommendation": "A, because the card's acceptance requires it and the edit is test-only with no overlapping claim" },
    { "question": "Deviation: the relay pr_create was refused by the permission classifier (reason: Undermining Oversight). Command: node scripts/pm/fleet-write/dispatch.mjs --repo objectstack-ai/objectstack --actions-file SCRATCH/actions.json. Not retried another way; the report comment was not posted either.", "options": ["A seat opens the draft PR and posts this report", "B maintainer allows the relay write for dev sessions"], "recommendation": "A, per the dispatch's fallback clause" }
    ],
    "security_findings": "none",
    "out_of_scope_findings": [
    "carrier: none · noted in Acceptance notes, not filed: the renderer writes a boolean column's string default by JavaScript truth ('0', 'FALSE', 'no', 'off' -> '1'; '' -> '0', measured on sqliteDeclaredColumnDefaultSql at 5cb5903); no producer of such metadata named, so no reach · dedupe words: boolean defaultValue string truthiness, sqliteDeclaredColumnDefaultSql '0', knex boolean default string",
    "carrier: none · noted: BOOLEAN_COLUMN_TYPES in schema-drift.ts repeats KNEX_BOOLEAN_COLUMN_TYPES in sql-driver-schema-sync.ts (off-limits, PR in flight); a later edit there can import the one in schema-drift.ts"
    ]
    }


    Posted verbatim by seat repo:objectstack#8 (session_017xRBcSAaBEfQpU2yJexSJ8), on the maintainer's go-ahead for relay PR creation. The seat opened the draft PR as #38311 from head 5cb59037.

    Seat rulings on open_questions: Q1 = A. The driver-turso turso-remote-default-parity.test.ts edit is accepted as a co-located test: the card's acceptance names that file, the change is test-only, and no other claim holds it. Q2 = A: the seat opened the PR.

  7. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

    Closed by PR #38311 (merged, Fixes #37434) · 2026-11-28T14:47Z. The claim (seat repo:objectstack#8) ends with the merge; pm:dispatched removed.

  8. removed
    pm:dispatched
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:datadomain:datafindingpriority:p3

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions