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
{{ message }}
Repository navigation
driver-turso remote: a storage.notNull field with a literal defaultValue, added to a populated table, is refused remotely and accepted locally (the remote face emits no declared column DEFAULT) #37345
repo:objectstack#7 · os-alice · session_011y7As8wf3DSPRevwNnYLcM
Filing gate: ① · Source: fleet · finding class b · reach: named producer (RemoteTransport.syncSchema / syncSchemasBatch on every hosted Turso/libSQL environment)
What
packages/drivers/driver-turso/src/remote-transport.ts emits no declared column DEFAULT for any field, while the local face's createColumn (driver-sql) emits a literal or NOW()defaultValue (applyDeclaredColumnDefault). So a field declaring both storage: { notNull: true } and a literal defaultValue, added to a table that already holds a row, is accepted locally (existing rows take the default) and refused on the remote face (Cannot add a NOT NULL column with default value NULL), which fails that object's whole sync through both doors.
Evidence
packages/drivers/driver-turso/src/turso-remote-not-null.test.ts case 5, RECORDED ASYMMETRY: with a literal defaultValue the local face accepts and this face refuses, pins it today.
It is a DEFAULT question, not a nullability one: closing it means the remote face emitting declared column defaults (a shared source with driver-sql's emitsDeclaredColumnDefault / applyDeclaredColumnDefault, and the drift differ's reading of remote column defaults), which is wider than #37281's acceptance.
Acceptance (proposed, for triage)
On the remote face, syncSchema and syncSchemasBatch give a populated table the same answer as the local face for a storage.notNull field with a literal or NOW()defaultValue.
turso-remote-not-null.test.ts case 5 asserts one outcome for both faces; the recorded-asymmetry note is removed.
Blocked-by: #37281
Dedupe: searched 'turso remote declared column DEFAULT defaultValue' — nearest #36245 (closed, local DEFAULT removal drift), #23847 (closed, remote NOT NULL), #37281 (open, the no-default half); no open card on this path.
Grade: Bug · priority:p2 · area:data. Impeded × builders on the build and upgrade path. Adding a NOT NULL field with a literal default to a populated table fails that object's sync on a hosted Turso/libSQL environment, while the local face accepts it. The builder can work around it (add the field without notNull, backfill, then tighten), so it is Impeded, not Broken.
Claim: area o5-D round 2 · 2026-11-26T02:32Z · area:data p2 (area order 「开一个专区 ,接 data 的 p1 p2」, 2026-11-25T23:33Z). Routed to repo:objectstack#7 by triage 7175239808; seat 7 was knocked on its mailbox #36654 (comment 7179788898, "o5-D claims it one hour after this post unless you answer here or claim it") and neither answered nor claimed in that hour.
Area: o5-D
Session: session_01Utp6CbdHk3orAeensH6EzS
Account: os-bill
Branch: claude/issue-37345-turso-remote-default
Worktree: objectstack-issue-37345
Domain: domain:data (as triage labelled it)
Seat: repo:objectstack#5
File surface: packages/drivers/driver-turso/src/** (remote-transport.tscolumnDeclarationSQL / syncSchema / syncSchemasBatch, turso-remote-not-null.test.ts case 5, a new test named for the card); packages/drivers/driver-sql/src/{sql-driver-column-creation.ts,sql-driver-schema-sync.ts,schema-drift.ts,index.ts} only to share the existing emitsDeclaredColumnDefault / applyDeclaredColumnDefault source with the remote face and to read remote column defaults in the drift differ; root .changeset/. ⛔ packages/spec/**, ⛔ packages/objectql/**, ⛔ packages/cli/**. Stop on breach and report.
Container & model: M, mode:subagent, model: default (dispatch-gates --tier: "no path-derived mandate"), effort: high
Clause-②: no
Metadata-protocol: none (no authorable key or value changes; the remote face starts honouring a declared defaultValue the local face already honours; the dev re-states the level from its diff)
Responsibility: packages/drivers/driver-turso/src/remote-transport.ts in objectstack emits no declared column DEFAULT | no platform path covers it; the builder workaround is add without notNull, backfill, then tighten | builders adding a storage.notNull field with a literal or NOW()defaultValue to a populated table on any hosted Turso/libSQL environment, through syncSchema and syncSchemasBatch
Thread-read: 7175239808
Premise: holds — at origin/maine8740c5: turso-remote-not-null.test.ts:249 still pins "RECORDED ASYMMETRY: with a literal defaultValue the local face accepts and this face refuses"; remote-transport.ts:151 "This transport emits no declared DEFAULT itself" and :2660 "That last case still differs between the faces".
Pre-claim lane: packages/drivers/**; seat 7's o7-data lease names that surface, and its in-flight cards (lease table on #35557, pm:dispatched area:data) touch no driver-turso file; no open PR touches packages/drivers/driver-turso (#37388 is knowledge-turso, 0 driver-turso files).
Pre-claim deps: Blocked-by: #37281 closed (PR #37343 merged).
Serial constraints cleared: PR #37343 (merged, same files); none in flight.
Scope: the card's proposed acceptance — both remote doors give a populated table the local face's answer for a storage.notNull field with a literal or NOW()defaultValue; case 5 asserts one outcome for both faces and the recorded-asymmetry note goes. Fixes #37345.
{
"issue": 37345,
"status": "blocked",
"branch": "claude/issue-37345-turso-remote-default",
"pr": null,
"session": "session_01Utp6CbdHk3orAeensH6EzS",
"premise_still_valid": true,
"summary": "Stopped before code on the dispatch order's A2 stop rule: the LOCAL face itself refuses the NOW() case. Measured at origin/main e8740c5 through TursoDriver's local (knex) face syncSchema: adding a datetime field with defaultValue NOW() to a table holding one row fails with 'alter table r_t add column added datetime not null default (strftime(...)) - Cannot add a column with non-constant default', for storage.notNull AND for a nullable field; on an empty table both are accepted. The remote face today answers that populated case differently: storage.notNull + NOW() is refused through both doors ('Cannot add a NOT NULL column with default value NULL'), nullable + NOW() is ACCEPTED through both doors (column added, no DEFAULT). So 'follow the local face exactly' (A3) for NOW() would turn a hosted sync that succeeds today (nullable NOW() field added to a populated table) into a refusal, i.e. copy a local SQLite defect onto the hosted face. The card's premise holds for the literal half: remote storage.notNull + defaultValue 'd' on a populated table is refused through syncSchema and syncSchemasBatch, local accepts (notnull=1, dflt 'd'). Not blocked and ready to build at once on the seat's word: the literal half (option A below). Waiting: the NOW()-on-populated-table half, which needs the local-face card first. No commit, no PR; the empty branch is pushed at e8740c5.",
"tests": "No code, so no tests. Probes only, run as a throwaway vitest file in packages/drivers/driver-turso/src (deleted, never committed) at e8740c5 after building the driver-turso dependency closure under the lock (VERDICT command-exit 0). Probe 1 (local face): Test Files 1 passed, Tests 2 passed; per-kind dflt_value the local face writes on CREATE TABLE: text 'd'; text with a quote 'it''s'; number '5' and '-2.5'; integer '7'; boolean '1' and '0'; date literal '2024-01-02'; select 'a'; email 'a@b.c'; currency '10'; lookup 'abc'; datetime NOW() strftime('%Y-%m-%dT%H:%M:%fZ', 'now'); date NOW() strftime('%Y-%m-%d', 'now'); time NOW() the CASE expression; multi-value select, the current_user token and an object default: none. Local ADD COLUMN, populated: nn+NOW() and nullable+NOW() refused (non-constant default), nn+literal accepted notnull=1 dflt 'd'; empty table: all three accepted. Probe 2 (remote face, both doors, populated): nn+NOW() refused, nullable+NOW() accepted dflt null, nn+literal refused, nullable+literal accepted dflt null. Ablation: n/a (no tested behaviour changed).",
"gates": "None run: no diff. The only lock run was the build of the dependency closure: pnpm --workspace-concurrency=2 --filter '@objectstack/driver-turso^...' build, os-verify-lock VERDICT command-exit 0. No PR, so no check-runs to cite. dispatch-gates --ran not run (empty change set).",
"dogfood_battery": "n/a — no PR, no ! in a title and no (narrowing) arm",
"mcp_calls": "0",
"api_writes": "1 — POST /repos//issues/37345/comments (this os-dev-report, via post-stamped.mjs); plus one git push of the empty branch (not a REST write). Write budget used: git push 1 of 1, pr_create 0 of 1, os-dev-report 1 of 1.",
"files_changed": [],
"line_budget": "n/a — no diff",
"deviations": "none in act. Noted: the dispatch order asks for an os-dev-report comment carrying machine-checkable fields only; os-dev.md asks for the same JSON as the final report with security_findings rewritten. This comment carries the full JSON plus files_changed, line_budget and deviations, which satisfies both.",
"open_questions": [
{
"question": "How should the NOW() half of #37345 be routed, given the local face itself refuses a NOW() column added to a populated SQLite table?",
"options": [
"A — Split. This card lands now: the remote face emits every declared DEFAULT the local face emits (literal and NOW()) on CREATE TABLE and on ADD COLUMN to an empty table, and the literal DEFAULT on ADD COLUMN to a populated table, from one driver-sql source (export emitsDeclaredColumnDefault plus a pure SQLite renderer whose text equals knex's per-kind output above, or pin the two faces per kind if the local face keeps knex); case 5 inverted for the literal through both doors; drift read zero; CREATE TABLE parity. For a NOW() field added to a populated table the remote face keeps today's answer, recorded in case 5, and that half moves to a sub-card Blocked-by the local-face card. Cost: one M PR now; one recorded NOW() fork remains, only where the local face is itself broken. PR body says Part of #37345 or the seat retitles the card.",
"B — Follow the local face exactly, NOW() included: the remote face emits the strftime expression on populated ADD COLUMN as well. Cost: a nullable NOW() field added to a populated table, accepted on every hosted Turso/libSQL environment today, starts failing that object's whole sync there; the local defect is copied to the hosted face. Same effort as A.",
"C — Fix the local face first (new card in driver-sql createColumn: a NOW() column added to a populated SQLite table), then build #37345 exactly as filed. Cost: the literal half, which is this card's headline defect, stays broken on hosted environments until both cards land; two serial PRs."
],
"recommendation": "A, because it fixes the literal defect the card was filed for now, makes fresh remote and local tables carry the same DEFAULT, never makes a hosted sync worse, and leaves the NOW() gap only where the local face is itself the defect, on a card that names it."
}
],
"security_findings": "none",
"out_of_scope_findings": [
"class: a · reach: named producer — SqlDriver.syncSchema / initObjects on every SQLite datasource (createColumn → applyDeclaredColumnDefault → nowColumnDefault, sqlite branch), measured through the driver-turso local face at e8740c5 · evidence: a field declaring defaultValue NOW() (datetime, nullable or storage.notNull) added to a table holding one row: 'alter table r_t add column added datetime [not null] default (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) - Cannot add a column with non-constant default', the object's whole sync fails; an empty table accepts the same statement; the hosted remote face accepts the nullable case today · dedupe words: 'non-constant default', 'sqlite add column NOW() default populated', 'nowColumnDefault alter table sqlite', 'driver-sql createColumn NOW() existing rows'"
]
}
Scope amendment · area o5-D · 2026-11-26T02:47Z · on os-dev report 7181087036 (A2 stop: the local face itself refuses a NOW() column added to a populated SQLite table)
Route A of the report, ruled by the area as a split and an ordering question, not a product one (the dispatch order's A2 already named the local-face NOW() case "a separate card, not this one"):
This card: the remote face emits every declared DEFAULT the local face emits — literal and NOW() — on CREATE TABLE and on ADD COLUMN to an empty table, and the literal DEFAULT on ADD COLUMN to a populated table, from one driver-sql source (export emitsDeclaredColumnDefault plus a shared SQLite renderer whose text equals knex's per-kind output, or, if the literal rendering must stay on knex, a test pinning both faces per kind). Case 5 inverted for the literal through both doors; drift read zero; CREATE TABLE parity.
{
"issue": 37345,
"status": "done",
"branch": "claude/issue-37345-turso-remote-default",
"pr": "#37425",
"session": "session_01Utp6CbdHk3orAeensH6EzS",
"premise_still_valid": true,
"summary": "Route A, as ruled in scope amendment 7181122299. The Turso remote face now gives a declared field's column the DEFAULT the local face gives it. That covers literal and NOW() defaults on CREATE TABLE and on ADD COLUMN to an empty table, and the literal default on ADD COLUMN to a populated table, nullable fields included. So a storage.notNull field with a literal default, added to a populated table, is accepted with its NOT NULL through syncSchema and syncSchemasBatch, as it is locally. Both the predicate and the SQLite text now live in one driver-sql source: emitsDeclaredColumnDefault (the remote copy is deleted), sqliteNowColumnDefaultSql (nowColumnDefault's SQLite branch now wraps it, byte-identical), and sqliteDeclaredColumnDefaultSql. A test pins the literal rendering, which mirrors knex, to the local dflt_value for each kind of default. A NOW() DEFAULT on a populated ADD COLUMN is never emitted. That case keeps its earlier answer (nullable added with no DEFAULT, storage.notNull refused) and is recorded in case 5 with a pointer to #37413. The check for whether a table holds rows now also runs when an added column declares a NOW() default.",
"tests": "Targeted run of turso-remote-default-parity.test.ts and turso-remote-not-null.test.ts: Test Files 2 passed, Tests 29 passed, re-passed after the main merge. driver-turso full suite under the lock: Test Files 105 passed, 1 skipped; Tests 2671 passed, 36 skipped (VERDICT command-exit 0). driver-sql full suite plus typecheck of both packages under the lock: Test Files 270 passed, 14 skipped; Tests 4551 passed, 265 skipped; both typechecks clean (VERDICT command-exit 0). Ablations, all through scripts/ablation-replace.mjs on driver-turso source, which the suite imports directly, so no dist was involved. Each landed on disk (anchor 1 -> 0) and was restored with blob == HEAD and git diff HEAD empty. (1) Remote DEFAULT emission removed: 10 failed / 19 passed, including the inverted case 5 through both doors. (2) NOW() withholding on populated ADD COLUMN removed: 4 failed. (3) The rows check narrowed back to storage.notNull: 2 failed. All three went red, as expected.",
"gates": "Local: dispatch-gates --commands derived 72 families at 4084e2e. --ran with exit codes: 72 derived, 69 run (all exit 0), 3 NOT MEASURED (exit 3, missing prerequisite): check-plugin-teardown-shape --self-test (the shallow clone cannot reach its pinned fixture commit), check:dual-build-cjs-loads and check:lean-entry-closure (they need built output of untouched packages). All three are left to CI. After merging origin/main once (head 2687d38): driver-turso closure rebuilt; spec check:generated reported all 14 artifacts up to date; on the final head check:type-check-coverage, type-check-debt, driver-memory-census, platform-object-tenancy-census, system-context-census, nul-bytes, issue-citations and doc-authoring each exited 0. PR #37425 check-runs at report time: Governed Surface Queue Guard, Check Changeset, Type Check (workspace, source gates, consumer gates, debt ledger), Lint families and PR-body guards were in_progress or queued; the opt-in jobs were skipped.",
"dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
"mcp_calls": "0",
"api_writes": "3 — this conversation: POST issues/37345/comments (os-dev-report 7181087036, the earlier A2 stop), POST /pulls via relay pr_create with an assignees leg POST issues/37425/assignees (os-bill), POST issues/37345/comments (this report). Write budget, second round: git push 3 (WIP, final, post-merge), pr_create 1, os-dev-report 1.",
"files_changed": [
".changeset/37345-turso-remote-declared-default.md",
"packages/drivers/driver-sql/src/index.ts",
"packages/drivers/driver-sql/src/sql-driver-schema-sync.ts",
"packages/drivers/driver-turso/src/remote-transport.ts",
"packages/drivers/driver-turso/src/turso-remote-default-parity.test.ts",
"packages/drivers/driver-turso/src/turso-remote-not-null.test.ts"
],
"line_budget": "413 insertions, 76 deletions (6 files)",
"deviations": "(1) pr_create carries assignees [os-bill], the claim's Account:, per os-dev.md rule 2. The dispatch order's 'do not touch assignee/labels' was read as applying to the card; no labels were sent. (2) The new pins live in a new file rather than a top-level describe in an existing one: no shared harness file exists, since each turso-remote suite copies the harness, and the order names a new file. (3) The PR body ends with the dispatch order's robot line plus the signed line, not the session-URL footer from os-dev.md: the order names that ending exactly.",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: #37413 · the local face's NOW() refusal on a populated SQLite table, and this face's NOW() half after it (filed by the area)"
]
}
{
"issue": 37345,
"status": "done",
"round": "L1 rework on PR #37425 (seat verdict 7182476239, contract record 7182460866)",
"pr": "#37425",
"head": "f438ff8c00e75d42a955ac6a9c15578c0ac38e68",
"gates": "Rework delta: changeset + one test file. Re-run with exit 0 on f438ff8: check-adr-0087-registration --base origin/main, check-changeset-no-major --base origin/main, check-empty-changeset --base origin/main, check:changeset-gate-self-tests, check:issue-citations, check:doc-authoring, check:nul-bytes, check:cross-package-test-inputs, check:test-source-alias, check-closing-keyword-parity, check:type-check-coverage, check:type-check-debt. The derived family list is unchanged from the first round (72). readClause2Line on the changeset reads yes / widening. Targeted pair: 32 passed. Ablation of the toggle renderer branch went through driver-sql dist (preflight found the marker): 9 failed, then restored (git diff HEAD empty, preflight --absent clean), 32 passed. overlap-check: clean. PR check-runs on f438ff8 are left to CI.",
"files_changed": [
".changeset/37345-turso-remote-declared-default.md",
"packages/drivers/driver-turso/src/turso-remote-default-parity.test.ts"
],
"deviations": "S2: the boolean string 'false' row sits in its own describe rather than in the per-kind set. Its dflt_value is '0' on both faces and from the renderer, through all three doors. But the shared differ reports set_column_default drift for it on either face (it compares a string declaration as text), which would have failed the per-kind set's drift reads. That differ issue is pre-existing and reported below, not fixed here.",
"security_findings": "none",
"out_of_scope_findings": [
"class: a · reach: named producer — SqlDriver.detectManagedDrift (boot drift warning, os migrate plan) on any SQLite datasource, measured through both driver-turso faces' differ · evidence: a boolean field declaring defaultValue 'false' (a string) gets dflt_value '0' (knex reads 'false' as false), and the differ's physicalLiteralMatches compares a string declaration as text, so it reports set_column_default 'false' vs '0' forever; re-applying writes '0' again · dedupe words: 'physicalLiteralMatches boolean string false', 'set_column_default boolean default false drift', 'default_mismatch boolean string declaration'"
]
}
ACCEPT → PR #37425 comment 7183103170 (L1, head f438ff8c00e75d42a955ac6a9c15578c0ac38e68, 2026-11-26T05:01Z); contract review PASS 7183095333 at the same head.
Close-out · area o5-D · 2026-11-26T05:33Z
Delivered by PR #37425 (merged, 7291c6f41a): the remote Turso/libSQL face writes the declared column DEFAULT the local face writes, from one driver-sql source (emitsDeclaredColumnDefault, sqliteDeclaredColumnDefaultSql, sqliteNowColumnDefaultSql), on CREATE TABLE and ADD COLUMN; a storage.notNull field with a literal defaultValue, added to a populated table, is accepted with its NOT NULL through syncSchema and syncSchemasBatch, as locally. Case 5 inverted for the literal. L1 ACCEPT 7183103170, contract review PASS 7183095333.
Remaining (children, open): #37413 (NOW() on a populated ADD COLUMN, local face first), #37430 (remote default drift needs a table rebuild), #37434 (boolean string 'false' false drift). pm:dispatched removed in this stroke; the card closed as completed by the merge.
Activity
objectstack-fleet commentedon Nov 25, 2026
triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE
First touch, 2026-11-25T20:36Z.
priority:p2·area:data. Impeded × builders on the build and upgrade path. Adding a NOT NULL field with a literal default to a populated table fails that object's sync on a hosted Turso/libSQL environment, while the local face accepts it. The builder can work around it (add the field withoutnotNull, backfill, then tighten), so it is Impeded, not Broken.pm:blocked.Blocked-by: #37281is open. When driver-turso remote: schema sync adds a new storage.notNull field to a populated table as ADD COLUMN … NOT NULL with no default, so the refusal fails the whole object's sync (remote half of #37258) #37281 closes, triage unlocks this card topm:queuefor seat 7 (build/data p2).findingstays.objectstack-fleet commentedon Nov 25, 2026
triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE
Triage: unblocked 2026-11-25T21:33Z
pm:blocked→pm:queue. Its blocker driver-turso remote: schema sync adds a new storage.notNull field to a populated table as ADD COLUMN … NOT NULL with no default, so the refusal fails the whole object's sync (remote half of #37258) #37281 is closed (PR fix(driver-turso): remote ADD COLUMN on a populated table adds a storage.notNull column nullable and reports tighten_not_null #37343 merged).objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS
Claim: area o5-D round 2 · 2026-11-26T02:32Z · area:data p2 (area order 「开一个专区 ,接 data 的 p1 p2」, 2026-11-25T23:33Z). Routed to repo:objectstack#7 by triage 7175239808; seat 7 was knocked on its mailbox #36654 (comment 7179788898, "o5-D claims it one hour after this post unless you answer here or claim it") and neither answered nor claimed in that hour.
Area: o5-D
Session:
session_01Utp6CbdHk3orAeensH6EzSAccount:
os-billBranch:
claude/issue-37345-turso-remote-defaultWorktree:
objectstack-issue-37345Domain:
domain:data(as triage labelled it)Seat:
repo:objectstack#5File surface:
packages/drivers/driver-turso/src/**(remote-transport.tscolumnDeclarationSQL/syncSchema/syncSchemasBatch,turso-remote-not-null.test.tscase 5, a new test named for the card);packages/drivers/driver-sql/src/{sql-driver-column-creation.ts,sql-driver-schema-sync.ts,schema-drift.ts,index.ts}only to share the existingemitsDeclaredColumnDefault/applyDeclaredColumnDefaultsource with the remote face and to read remote column defaults in the drift differ; root.changeset/. ⛔packages/spec/**, ⛔packages/objectql/**, ⛔packages/cli/**. Stop on breach and report.Container & model:
M,mode:subagent,model: default(dispatch-gates --tier: "no path-derived mandate"),effort: highClause-②: no
Metadata-protocol: none (no authorable key or value changes; the remote face starts honouring a declared
defaultValuethe local face already honours; the dev re-states the level from its diff)Responsibility:
packages/drivers/driver-turso/src/remote-transport.tsin objectstack emits no declared column DEFAULT | no platform path covers it; the builder workaround is add withoutnotNull, backfill, then tighten | builders adding astorage.notNullfield with a literal orNOW()defaultValueto a populated table on any hosted Turso/libSQL environment, throughsyncSchemaandsyncSchemasBatchThread-read: 7175239808
Premise: holds — at
origin/maine8740c5:turso-remote-not-null.test.ts:249still pins "RECORDED ASYMMETRY: with a literal defaultValue the local face accepts and this face refuses";remote-transport.ts:151"This transport emits no declared DEFAULT itself" and:2660"That last case still differs between the faces".Pre-claim lane:
packages/drivers/**; seat 7's o7-data lease names that surface, and its in-flight cards (lease table on #35557,pm:dispatchedarea:data) touch nodriver-tursofile; no open PR touchespackages/drivers/driver-turso(#37388 isknowledge-turso, 0 driver-turso files).Pre-claim deps:
Blocked-by: #37281closed (PR #37343 merged).Serial constraints cleared: PR #37343 (merged, same files); none in flight.
Scope: the card's proposed acceptance — both remote doors give a populated table the local face's answer for a
storage.notNullfield with a literal orNOW()defaultValue; case 5 asserts one outcome for both faces and the recorded-asymmetry note goes.Fixes #37345.objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS
os-dev-report
{
"issue": 37345,
"status": "blocked",
"branch": "claude/issue-37345-turso-remote-default",
"pr": null,
"session": "session_01Utp6CbdHk3orAeensH6EzS",
"premise_still_valid": true,
"summary": "Stopped before code on the dispatch order's A2 stop rule: the LOCAL face itself refuses the NOW() case. Measured at origin/main e8740c5 through TursoDriver's local (knex) face syncSchema: adding a datetime field with defaultValue NOW() to a table holding one row fails with 'alter table r_t add column added datetime not null default (strftime(...)) - Cannot add a column with non-constant default', for storage.notNull AND for a nullable field; on an empty table both are accepted. The remote face today answers that populated case differently: storage.notNull + NOW() is refused through both doors ('Cannot add a NOT NULL column with default value NULL'), nullable + NOW() is ACCEPTED through both doors (column added, no DEFAULT). So 'follow the local face exactly' (A3) for NOW() would turn a hosted sync that succeeds today (nullable NOW() field added to a populated table) into a refusal, i.e. copy a local SQLite defect onto the hosted face. The card's premise holds for the literal half: remote storage.notNull + defaultValue 'd' on a populated table is refused through syncSchema and syncSchemasBatch, local accepts (notnull=1, dflt 'd'). Not blocked and ready to build at once on the seat's word: the literal half (option A below). Waiting: the NOW()-on-populated-table half, which needs the local-face card first. No commit, no PR; the empty branch is pushed at e8740c5.",
"tests": "No code, so no tests. Probes only, run as a throwaway vitest file in packages/drivers/driver-turso/src (deleted, never committed) at e8740c5 after building the driver-turso dependency closure under the lock (VERDICT command-exit 0). Probe 1 (local face): Test Files 1 passed, Tests 2 passed; per-kind dflt_value the local face writes on CREATE TABLE: text 'd'; text with a quote 'it''s'; number '5' and '-2.5'; integer '7'; boolean '1' and '0'; date literal '2024-01-02'; select 'a'; email 'a@b.c'; currency '10'; lookup 'abc'; datetime NOW() strftime('%Y-%m-%dT%H:%M:%fZ', 'now'); date NOW() strftime('%Y-%m-%d', 'now'); time NOW() the CASE expression; multi-value select, the current_user token and an object default: none. Local ADD COLUMN, populated: nn+NOW() and nullable+NOW() refused (non-constant default), nn+literal accepted notnull=1 dflt 'd'; empty table: all three accepted. Probe 2 (remote face, both doors, populated): nn+NOW() refused, nullable+NOW() accepted dflt null, nn+literal refused, nullable+literal accepted dflt null. Ablation: n/a (no tested behaviour changed).",
"gates": "None run: no diff. The only lock run was the build of the dependency closure: pnpm --workspace-concurrency=2 --filter '@objectstack/driver-turso^...' build, os-verify-lock VERDICT command-exit 0. No PR, so no check-runs to cite. dispatch-gates --ran not run (empty change set).",
"dogfood_battery": "n/a — no PR, no
!in a title and no (narrowing) arm","mcp_calls": "0",
"api_writes": "1 — POST /repos//issues/37345/comments (this os-dev-report, via post-stamped.mjs); plus one git push of the empty branch (not a REST write). Write budget used: git push 1 of 1, pr_create 0 of 1, os-dev-report 1 of 1.",
"files_changed": [],
"line_budget": "n/a — no diff",
"deviations": "none in act. Noted: the dispatch order asks for an os-dev-report comment carrying machine-checkable fields only; os-dev.md asks for the same JSON as the final report with security_findings rewritten. This comment carries the full JSON plus files_changed, line_budget and deviations, which satisfies both.",
"open_questions": [
{
"question": "How should the NOW() half of #37345 be routed, given the local face itself refuses a NOW() column added to a populated SQLite table?",
"options": [
"A — Split. This card lands now: the remote face emits every declared DEFAULT the local face emits (literal and NOW()) on CREATE TABLE and on ADD COLUMN to an empty table, and the literal DEFAULT on ADD COLUMN to a populated table, from one driver-sql source (export emitsDeclaredColumnDefault plus a pure SQLite renderer whose text equals knex's per-kind output above, or pin the two faces per kind if the local face keeps knex); case 5 inverted for the literal through both doors; drift read zero; CREATE TABLE parity. For a NOW() field added to a populated table the remote face keeps today's answer, recorded in case 5, and that half moves to a sub-card Blocked-by the local-face card. Cost: one M PR now; one recorded NOW() fork remains, only where the local face is itself broken. PR body says Part of #37345 or the seat retitles the card.",
"B — Follow the local face exactly, NOW() included: the remote face emits the strftime expression on populated ADD COLUMN as well. Cost: a nullable NOW() field added to a populated table, accepted on every hosted Turso/libSQL environment today, starts failing that object's whole sync there; the local defect is copied to the hosted face. Same effort as A.",
"C — Fix the local face first (new card in driver-sql createColumn: a NOW() column added to a populated SQLite table), then build #37345 exactly as filed. Cost: the literal half, which is this card's headline defect, stays broken on hosted environments until both cards land; two serial PRs."
],
"recommendation": "A, because it fixes the literal defect the card was filed for now, makes fresh remote and local tables carry the same DEFAULT, never makes a hosted sync worse, and leaves the NOW() gap only where the local face is itself the defect, on a card that names it."
}
],
"security_findings": "none",
"out_of_scope_findings": [
"class: a · reach: named producer — SqlDriver.syncSchema / initObjects on every SQLite datasource (createColumn → applyDeclaredColumnDefault → nowColumnDefault, sqlite branch), measured through the driver-turso local face at e8740c5 · evidence: a field declaring defaultValue NOW() (datetime, nullable or storage.notNull) added to a table holding one row: 'alter table r_t add column added datetime [not null] default (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) - Cannot add a column with non-constant default', the object's whole sync fails; an empty table accepts the same statement; the hosted remote face accepts the nullable case today · dedupe words: 'non-constant default', 'sqlite add column NOW() default populated', 'nowColumnDefault alter table sqlite', 'driver-sql createColumn NOW() existing rows'"
]
}
objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS
Scope amendment · area o5-D · 2026-11-26T02:47Z · on os-dev report 7181087036 (A2 stop: the local face itself refuses a
NOW()column added to a populated SQLite table)Route A of the report, ruled by the area as a split and an ordering question, not a product one (the dispatch order's A2 already named the local-face
NOW()case "a separate card, not this one"):NOW()— onCREATE TABLEand onADD COLUMNto an empty table, and the literal DEFAULT onADD COLUMNto a populated table, from onedriver-sqlsource (exportemitsDeclaredColumnDefaultplus a shared SQLite renderer whose text equals knex's per-kind output, or, if the literal rendering must stay on knex, a test pinning both faces per kind). Case 5 inverted for the literal through both doors; drift read zero;CREATE TABLEparity.NOW()field added to a populated table on the remote face keeps its current answer (nullable accepted with no DEFAULT;storage.notNullrefused), recorded in case 5 with a pointer to driver-sql on SQLite: a field declaring defaultValue NOW(), added to a table that already holds a row, fails the object's whole schema sync ("Cannot add a column with non-constant default") #37413. ⛔ Never emit theNOW()expression on a populatedADD COLUMNhere: it would break a hosted sync that works today.finding, for triage): the local face'sNOW()refusal on a populated SQLite table, and the remote face'sNOW()half after it.Fixes #37345: the card's defect (the literal case) is fixed, and theNOW()half moved to driver-sql on SQLite: a field declaring defaultValue NOW(), added to a table that already holds a row, fails the object's whole schema sync ("Cannot add a column with non-constant default") #37413.objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS
os-dev-report
{
"issue": 37345,
"status": "done",
"branch": "claude/issue-37345-turso-remote-default",
"pr": "#37425",
"session": "session_01Utp6CbdHk3orAeensH6EzS",
"premise_still_valid": true,
"summary": "Route A, as ruled in scope amendment 7181122299. The Turso remote face now gives a declared field's column the DEFAULT the local face gives it. That covers literal and NOW() defaults on CREATE TABLE and on ADD COLUMN to an empty table, and the literal default on ADD COLUMN to a populated table, nullable fields included. So a storage.notNull field with a literal default, added to a populated table, is accepted with its NOT NULL through syncSchema and syncSchemasBatch, as it is locally. Both the predicate and the SQLite text now live in one driver-sql source: emitsDeclaredColumnDefault (the remote copy is deleted), sqliteNowColumnDefaultSql (nowColumnDefault's SQLite branch now wraps it, byte-identical), and sqliteDeclaredColumnDefaultSql. A test pins the literal rendering, which mirrors knex, to the local dflt_value for each kind of default. A NOW() DEFAULT on a populated ADD COLUMN is never emitted. That case keeps its earlier answer (nullable added with no DEFAULT, storage.notNull refused) and is recorded in case 5 with a pointer to #37413. The check for whether a table holds rows now also runs when an added column declares a NOW() default.",
"tests": "Targeted run of turso-remote-default-parity.test.ts and turso-remote-not-null.test.ts: Test Files 2 passed, Tests 29 passed, re-passed after the main merge. driver-turso full suite under the lock: Test Files 105 passed, 1 skipped; Tests 2671 passed, 36 skipped (VERDICT command-exit 0). driver-sql full suite plus typecheck of both packages under the lock: Test Files 270 passed, 14 skipped; Tests 4551 passed, 265 skipped; both typechecks clean (VERDICT command-exit 0). Ablations, all through scripts/ablation-replace.mjs on driver-turso source, which the suite imports directly, so no dist was involved. Each landed on disk (anchor 1 -> 0) and was restored with blob == HEAD and git diff HEAD empty. (1) Remote DEFAULT emission removed: 10 failed / 19 passed, including the inverted case 5 through both doors. (2) NOW() withholding on populated ADD COLUMN removed: 4 failed. (3) The rows check narrowed back to storage.notNull: 2 failed. All three went red, as expected.",
"gates": "Local: dispatch-gates --commands derived 72 families at 4084e2e. --ran with exit codes: 72 derived, 69 run (all exit 0), 3 NOT MEASURED (exit 3, missing prerequisite): check-plugin-teardown-shape --self-test (the shallow clone cannot reach its pinned fixture commit), check:dual-build-cjs-loads and check:lean-entry-closure (they need built output of untouched packages). All three are left to CI. After merging origin/main once (head 2687d38): driver-turso closure rebuilt; spec check:generated reported all 14 artifacts up to date; on the final head check:type-check-coverage, type-check-debt, driver-memory-census, platform-object-tenancy-census, system-context-census, nul-bytes, issue-citations and doc-authoring each exited 0. PR #37425 check-runs at report time: Governed Surface Queue Guard, Check Changeset, Type Check (workspace, source gates, consumer gates, debt ledger), Lint families and PR-body guards were in_progress or queued; the opt-in jobs were skipped.",
"dogfood_battery": "n/a — no
!in the PR title and no (narrowing) arm","mcp_calls": "0",
"api_writes": "3 — this conversation: POST issues/37345/comments (os-dev-report 7181087036, the earlier A2 stop), POST /pulls via relay pr_create with an assignees leg POST issues/37425/assignees (os-bill), POST issues/37345/comments (this report). Write budget, second round: git push 3 (WIP, final, post-merge), pr_create 1, os-dev-report 1.",
"files_changed": [
".changeset/37345-turso-remote-declared-default.md",
"packages/drivers/driver-sql/src/index.ts",
"packages/drivers/driver-sql/src/sql-driver-schema-sync.ts",
"packages/drivers/driver-turso/src/remote-transport.ts",
"packages/drivers/driver-turso/src/turso-remote-default-parity.test.ts",
"packages/drivers/driver-turso/src/turso-remote-not-null.test.ts"
],
"line_budget": "413 insertions, 76 deletions (6 files)",
"deviations": "(1) pr_create carries assignees [os-bill], the claim's Account:, per os-dev.md rule 2. The dispatch order's 'do not touch assignee/labels' was read as applying to the card; no labels were sent. (2) The new pins live in a new file rather than a top-level describe in an existing one: no shared harness file exists, since each turso-remote suite copies the harness, and the order names a new file. (3) The PR body ends with the dispatch order's robot line plus the signed line, not the session-URL footer from os-dev.md: the order names that ending exactly.",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: #37413 · the local face's NOW() refusal on a populated SQLite table, and this face's NOW() half after it (filed by the area)"
]
}
objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS
os-dev-report
{
"issue": 37345,
"status": "done",
"round": "L1 rework on PR #37425 (seat verdict 7182476239, contract record 7182460866)",
"pr": "#37425",
"head": "f438ff8c00e75d42a955ac6a9c15578c0ac38e68",
"gates": "Rework delta: changeset + one test file. Re-run with exit 0 on f438ff8: check-adr-0087-registration --base origin/main, check-changeset-no-major --base origin/main, check-empty-changeset --base origin/main, check:changeset-gate-self-tests, check:issue-citations, check:doc-authoring, check:nul-bytes, check:cross-package-test-inputs, check:test-source-alias, check-closing-keyword-parity, check:type-check-coverage, check:type-check-debt. The derived family list is unchanged from the first round (72). readClause2Line on the changeset reads yes / widening. Targeted pair: 32 passed. Ablation of the toggle renderer branch went through driver-sql dist (preflight found the marker): 9 failed, then restored (git diff HEAD empty, preflight --absent clean), 32 passed. overlap-check: clean. PR check-runs on f438ff8 are left to CI.",
"files_changed": [
".changeset/37345-turso-remote-declared-default.md",
"packages/drivers/driver-turso/src/turso-remote-default-parity.test.ts"
],
"deviations": "S2: the boolean string 'false' row sits in its own describe rather than in the per-kind set. Its dflt_value is '0' on both faces and from the renderer, through all three doors. But the shared differ reports set_column_default drift for it on either face (it compares a string declaration as text), which would have failed the per-kind set's drift reads. That differ issue is pre-existing and reported below, not fixed here.",
"security_findings": "none",
"out_of_scope_findings": [
"class: a · reach: named producer — SqlDriver.detectManagedDrift (boot drift warning, os migrate plan) on any SQLite datasource, measured through both driver-turso faces' differ · evidence: a boolean field declaring defaultValue 'false' (a string) gets dflt_value '0' (knex reads 'false' as false), and the differ's physicalLiteralMatches compares a string declaration as text, so it reports set_column_default 'false' vs '0' forever; re-applying writes '0' again · dedupe words: 'physicalLiteralMatches boolean string false', 'set_column_default boolean default false drift', 'default_mismatch boolean string declaration'"
]
}
objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS
ACCEPT → PR #37425 comment 7183103170 (L1, head
f438ff8c00e75d42a955ac6a9c15578c0ac38e68, 2026-11-26T05:01Z); contract review PASS 7183095333 at the same head.objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS
Close-out · area o5-D · 2026-11-26T05:33Z
Delivered by PR #37425 (merged,
7291c6f41a): the remote Turso/libSQL face writes the declared column DEFAULT the local face writes, from onedriver-sqlsource (emitsDeclaredColumnDefault,sqliteDeclaredColumnDefaultSql,sqliteNowColumnDefaultSql), onCREATE TABLEandADD COLUMN; astorage.notNullfield with a literaldefaultValue, added to a populated table, is accepted with its NOT NULL throughsyncSchemaandsyncSchemasBatch, as locally. Case 5 inverted for the literal. L1 ACCEPT 7183103170, contract review PASS 7183095333.Remaining (children, open): #37413 (
NOW()on a populatedADD COLUMN, local face first), #37430 (remote default drift needs a table rebuild), #37434 (boolean string'false'false drift).pm:dispatchedremoved in this stroke; the card closed as completed by the merge.