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
data: normalise boolean fields already stored as the text 'true'/'false' (SQL driver), so equality filters find rows written before #34965 #34973
domain:serverDomain lane — seat card indexed by label:pm:seatfindingRecorded observation — held, not dispatchable until the findings triage round grades itpriority:p1High: required for production / M2
Filed by triage at the request of repo:objectstack#3: a follow-up of p1 #34916 (PR #34965), ruled out of that PR's scope (seat ruling 6957305509; L1-d 6959775843).
What happens
Before #34965, inline grid edit on the SQL driver stored boolean fields as the text 'true' / 'false'. #34965 fixes the write, and the read of a stored 'false' / '0'.
Rows already written that way still hold text. An equality filter such as won = false (and requiredWhen over such rows in queries) keeps missing them until each row is re-saved.
Done when
A one-off normalisation (migration or upgrade step) rewrites text-stored booleans to the driver's boolean form, idempotently and per object.
Or, if the dev finds a read-side fix that makes filters match both forms cheaply, that instead, with the reason recorded.
A pin: a row seeded with 'false' text is found by = false after the step.
Grade: p1 · domain:server. The theme is install, upgrade and uninstall reliability (an upgrade step), plus epic #34571's console data. The named effect is the same one #34916 was graded p1 for, filters silently miss rows, and it stays live for existing data until this lands.
Blocked-by: #34916 (land PR #34965 first, so new writes stop adding text rows)
Unlock (21:4xZ): both blockers are closed: #34916, and PR #34965, which stops new text-stored booleans. Moved pm:blocked → pm:queue. The grade is unchanged (p1 · server): rows written before #34965 still miss equality filters until this lands.
Claim: PM loop round 1 · area o3-A · 2026-11-17T22:42Z
Session: session_01WGufzg2evNa1V3zxrQq3KX
Account: os-support-ai
Branch: claude/issue-34973-boolean-text-backfill
Worktree: objectstack-issue-34973
Domain: domain:server
Seat: repo:objectstack#3
File surface: set by the premise measurement, before any code. The os-dev first measures on origin/main (after #34965, 3a78b898) and stops before design. The area then restates this claim with the measured surface and the serial-constraint scan. The two routes the card allows:
(a) a one-off normalisation step: the repo's existing upgrade or migration mechanism for the SQL driver (packages/drivers/driver-sql/src/** and whatever runner owns upgrade steps). It rewrites text-stored booleans ('true'/'false', and '1'/'0' if measured) to the driver's boolean form, per object and per boolean field, idempotently;
(b) a read-side fix: equality filters on a boolean field match both the stored boolean and its text forms, if the measurement shows that is cheap and index-safe.
Pins go beside the edited files (a row seeded with the text 'false' is found by = false after the step or with the read fix), plus a root .changeset/.
Reversibility and dry run (route a, stated before any build at the seat's order):
Reversibility. The rewrite maps each canonical text reading to exactly one boolean ('true'→true, 'false'→false) and leaves every other value untouched. The forward map is lossless in meaning but forgets which rows were text. The step therefore records, per object and field, the ids it rewrote and the original text, in its report or log, so an operator can restore them. A down step is offered only if the repo's migration mechanism has one. A non-canonical text value (anything outside the measured readings) is never rewritten; it is counted and reported.
Dry run. The step has a read-only mode that counts candidate rows per object and field and writes nothing. The real run is the same query plus the update, in one transaction per object where the driver allows it. A second run rewrites 0 rows (idempotent), and the pin proves it.
Where it runs. Not at boot by default unless the repo's upgrade convention says so. The premise names the mechanism and how an operator invokes it.
Container & model: M, mode:subagent, model: TIER_DEFAULT (re-derived at the restated claim), effort: high (seat order)
Clause-②: no (provisional, restated with the surface): route (a) rewrites stored values to the form new writes already take since fix(objectql,driver-sql): a boolean field given 'true' / 'false' stores the boolean, and a stored text 'false' reads as false #34965, and no accepted input or answer narrows. Route (b) widens what a boolean equality filter matches; it is restated as yes (widening …) and sent to seat L2 if chosen.
Metadata-protocol: none (provisional; restated if the step needs a manifest or upgrade-protocol entry)
Responsibility: boolean fields on the SQL driver (objectstack): rows written by the inline grid before #34965 still hold the text 'true'/'false', so equality filters (won = false) and requiredWhen over queries miss them until each row is re-saved | #34965 fixed new writes and the read of a stored 'false'/'0', not the stored data | every app on the SQL driver that edited booleans in a master-detail inline grid before 18.5.x-next
Thread-read: 6961931895
Premise: to be measured on origin/main first: (1) which text readings exist in stored rows and how the filter compiles them; (2) the repo's upgrade or migration mechanism and its dry-run and down conventions; (3) the cost of a read-side match (index use, the SQLite and Postgres dialects).
Serial constraints cleared: deferred to the restated claim (the surface is not known yet); the dev runs overlap-check on its probe push
Pre-claim lane: domain:server
Pre-claim deps: Inline grid edit stores a boolean field as the text 'true' (SQL driver) — equality filters miss it and requiredWhen reads it as false #34916 / PR fix(objectql,driver-sql): a boolean field given 'true' / 'false' stores the boolean, and a stored text 'false' reads as false #34965 merged (3a78b898), unlocked by triage 6961931895
Prior rulings read: seat ruling 6957305509 (backfill ruled out of fix(objectql,driver-sql): a boolean field given 'true' / 'false' stores the boolean, and a stored text 'false' reads as false #34965), L1-d 6959775843 → read; migration / upgrade-step rulings → read at the restated claim
Lease o3-A (seat post #34584); repo p1 under seat 3 (seat order 2026-11-17 22:41Z). L1: L1-d.
{
"issue": 34973,
"status": "reading",
"branch": "claude/issue-34973-boolean-text-backfill",
"pr": null,
"session": "session_01WGufzg2evNa1V3zxrQq3KX",
"premise_still_valid": true,
"summary": "Premise holds and is wider than filed, all measured on objectstack origin/main 4443014630c (contains 3a78b898, merge-base --is-ancestor exit 0) through SqlDriver on SQLite at the driver, the engine and the REST door. Legacy text 'true'/'false' rows are missed by =, and also answered wrongly by !=, $in, $nin, ORDER BY and aggregate groupBy (a text 'false' groups and presents as true). Only SQLite can hold such rows (NUMERIC affinity keeps 'true'/'false' as TEXT and turns '1'/'0' into integers), and only those two spellings exist. The engine cannot see or address the text rows: the row read presents them as booleans (presentStoredBoolean) and the boolean comparand door narrows 'false' to false. So route (a) must be raw SQL in the driver. The repo already has that mechanism for SQLite storage forms: the schema-sync storage convergence (datetime, time, JSON backfills) that runs at every boot, with an os migrate plan preview. Recommendation: route (a) as a fourth convergence, backfillCanonicalBooleans. Route (b) is a permanent multi-operator tax. No code was written, nothing was committed or pushed, and the probe was deleted.",
"measurements": {
"1_stored_forms": {
"ddl_per_dialect": "createColumn case 'boolean'/'toggle' -> knex table.boolean (packages/drivers/driver-sql/src/sql-driver-column-creation.ts:982-984). Declared types: SQLite 'boolean' (probe: pragma table_info type=boolean, NUMERIC affinity); Postgres 'boolean' (knex pg-columncompiler bool); MySQL BOOLEAN = tinyint(1); MSSQL 'bit'; Oracle number(1,0) CHECK IN (0,1).",
"probe_sqlite_typeof": "raw seeds -> stored: 'true'->'true' text, 'false'->'false' text, '1'->1 integer, '0'->0 integer, 1/0/true/false->integer, null->null. So SQLite holds only the two text spellings 'true'/'false'. The validator admits only 0,1,'0','1','true','false', so nothing else could be written by the write door.",
"other_dialects_code_reading": "Postgres: a real boolean column parses the input text 'true'/'false', so no text rows can exist. MSSQL bit converts 'true'/'false' implicitly. MySQL tinyint(1) and Oracle number(1) reject the text (MySQL strict mode is the server default; the driver sets no sql_mode), so the old write failed instead of storing text. Not measured live: no Postgres/MySQL rig in this container (OS_TEST_POSTGRES_URL and OS_TEST_MYSQL_URL unset).",
"probe_filters_driver_and_engine_and_REST": "Rows: text_true, text_false, text_one, text_zero, int_one, int_zero, js_true, js_false, null. won=false -> [int_zero, js_false, text_zero] (text_false MISSED). won=true -> [int_one, js_true, text_one] (text_true MISSED). Identical at driver.find, engine.find and REST POST /data/:object/query; REST GET ?won=false is the same. $ne false -> includes text_false (WRONG). $ne true -> includes text_true (WRONG). $in [true,false] -> misses both text rows. $nin [true] -> includes text_true (WRONG). $null true -> [null] (correct). engine.count won=false = 3 (true answer 4). ORDER BY won asc -> null, the 0s, the 1s, then text_false:false, text_true:true (the text rows sort after every integer)."
},
"2_read_side_today": {
"row_read": "presentStoredBoolean (sql-driver-sqlite-serialisation.ts:57, applied at :558) presents text 'false'->false and 'true'->true. Probe: engine read and REST GET text_false -> won:false. Correct.",
"distinct_aggregate": "presentReadValue case 'boolean' still returns Boolean(value) (sql-driver-filter-helpers.ts:333-334). Probe: driver/engine aggregate groupBy won count -> [{null:1},{false:3},{true:3},{true:1},{true:1}]: the text 'false' group is presented as TRUE and three true groups come back. sum(won)=3 with count=8: text 'true' adds 0. distinct -> [true,false,null], which is right here only because the dedup hides the miscounted 'false'. Same family as this card: route (a) removes the input; route (b) would have to fix it separately.",
"requiredWhen": "Not affected beyond the filter miss. It is evaluated in JS over rows the driver presents, and since #34965 a text row presents as its boolean. Probe (isSystem context): updating another field on legacy text_true and on canonical int_one, both with no delivery_date, gave the same verdict (admitted) on both rows. The remaining effect is the filter miss: a bulk update by predicate (where won = true) selects its prior rows and its UPDATE through that same filter, so it skips legacy text rows."
},
"3_route_a_mechanism": {
"found": "Three mechanisms exist. (i) MATCHING PRECEDENT: the driver-sql schema-sync storage convergence. initObjects (sql-driver-rotation.ts:402) calls backfillCanonicalDatetimes / backfillCanonicalTimes / backfillCanonicalJsonEncoding per managed table (sql-driver-rotation.ts:661-666; bodies at sql-driver-schema-sync.ts:1822, :1981, :1899). Each is SQLite-only, idempotent, and runs one raw UPDATE per column guarded by a WHERE that selects only non-canonical values. A table created in this process is certified clean without reading it, and a value that cannot be decided is withheld and warned about (the julian-day guard). It runs at EVERY boot unless OS_SKIP_SCHEMA_SYNC=1 (objectql plugin.ts:633). Under deferred DDL (os migrate plan/apply) it is previewed read-only by previewDeferredSchemaWork -> previewDatetimeConvergence (sql-driver-schema-sync.ts:2371, :2462), which counts rows into a PendingSchemaWork entry of kind normalize_datetime_storage (schema-drift.ts:418 union, :433 isInPlaceSchemaWork). os migrate plan renders in-place work generically as N row update(s) (packages/cli/src/utils/schema-migrate.ts:1937-1983), and os migrate apply runs it after the confirmation prompt. No down step, no id journal; the audit is a logger.info line with rowsConverted. (ii) os migrate data-repair commands, e.g. text-scalars, the numeric twin of #34965 (packages/cli/src/commands/migrate/text-scalars.ts): dry run by default, --apply --yes, report with capped sample ids, idempotent, no undo, and walked through engine.find/update. (iii) The ADR-0119 D2 journal runner runMigrationJournal (packages/core/src/utils/migration-journal.ts:615): chunk transactions, preflight, compensate and resume via os migrate resume. Its only CLI user is os migrate recorded-by (recorded-by.ts:196).",
"why_not_the_engine": "Mechanisms (ii) and (iii) read through the engine, which cannot address these rows. engine.find(won='false') is narrowed to false and returns the integer rows (probe), and every read presents the text as a boolean. A candidate count or row address is only possible in raw SQL: typeof(col)='text' AND col IN ('true','false'). driver.find with a string comparand, which the engine never sends, does reach the rows: ['text_false'].",
"probe_shape": "Dry run: select id, won where typeof(won)='text' and won in ('true','false') -> [text_false 'false', text_true 'true']; non-canonical text -> []. Apply in one transaction: update set won = case won when 'true' then 1 when 'false' then 0 end where typeof(won)='text' and won in ('true','false') -> changes 2. Second run -> changes 0 (idempotent). After the run: engine won=false -> [int_zero, js_false, text_false, text_zero] and won=true -> [int_one, js_true, text_one, text_true]. An undo from the recorded id + text restored both text rows (typeof text)."
},
"4_route_b_read_side": "Compile a SQLite boolean comparand to both spellings. Probe: won IN (0,'false') -> [int_zero, js_false, text_false, text_zero]. EXPLAIN QUERY PLAN with an index on won: = 0 and IN (0,'false') are both SEARCH USING INDEX (won=?). The index survives for equality. groupBy over a CASE fold -> SCAN USING COVERING INDEX + USE TEMP B-TREE FOR GROUP BY. Cost: every operator arm must change (sql-driver-filter-helpers.ts $eq :928, $ne :931 null-safe NOT IN, $in :967 expanding a list, $nin :972, the applyNormalizedComparison path at :926, and predicate-emitters.ts:650-666 for expression columns). So must ORDER BY (CASE fold, which loses index order), aggregate group keys and sum/avg (sql-driver-aggregation.ts), distinct, and presentReadValue (:333). It is SQLite-only, but it is paid on every query forever. The precedent design (needsLegacyDatetimeRepair, filter-helpers.ts:229) keeps such a repair only until a backfill certifies the column (canonicalDatetimeFields), so route (b) alone still implies route (a) to ever retire it. It widens what a filter matches."
},
"routes": {
"a": "File surface: packages/drivers/driver-sql/src/sql-driver-schema-sync.ts (backfillCanonicalBooleans plus previewBooleanConvergence, one line in previewDeferredSchemaWork), sql-driver-rotation.ts (one call beside :661-666 plus the host Pick), sql-driver.ts (host stubs, and a canonical-boolean set if certification is wanted), schema-drift.ts (new PendingSchemaWorkKind normalize_boolean_storage, in place by the existing isInPlaceSchemaWork rule), a new pin test beside them (a text 'false' row is found by = false after initObjects; a second sync converts 0; os migrate plan counts it under deferral; non-canonical text is withheld), and a root .changeset (patch, driver-sql). No CLI file is needed: the renderer is generic. Reversibility: semantically lossless; since #34965 a text row and its integer read identically, so an undo would only restore the defective form. This mechanism has no down convention. The record is the info log (count plus a capped list of ids per table/field) and the os migrate plan row count. The claim's per-row id+text record is an open question below. Dry run: os migrate plan (deferred DDL boots read-only) shows normalize_boolean_storage with rows; os migrate apply runs it after confirmation; an ordinary boot runs it automatically, like the datetime convergence. Atomicity: one UPDATE statement per column, atomic on SQLite. Clause-2: no (stored values move to the form new writes take; no accepted input or answer contract changes). Metadata-protocol: none. Cost: S, about 5 files, mirroring backfillCanonicalTimes. It also clears the groupBy/sort/!= misreads, because their input disappears.",
"b": "File surface: sql-driver-filter-helpers.ts, sql-driver-predicate-emitters.ts, sql-driver-aggregation.ts, sql-driver-distinct.ts, the sort compile, plus pins per operator. Reversibility: code only, revert the PR. Dry run: none needed (no data change). Clause-2: yes (widening): an equality filter on a boolean matches more stored values, so it goes to seat L2. Metadata-protocol: none. Cost: M-L. Every operator, sort, groupBy, sum and distinct must change, on every SQLite query, permanently, unless route (a) also lands, which makes (b) redundant."
},
"recommendation": "Route (a) in the existing driver storage-convergence form (backfillCanonicalBooleans beside the datetime/time/JSON backfills, previewed by os migrate plan as normalize_boolean_storage). It is the repo's own convention for exactly this class (a SQLite legacy storage form -> canonical, idempotent, at boot and under os migrate apply). It fixes every deployment without operator action, which matters because the effect is silent. It is SQLite-only because only SQLite can hold the text. Not a CLI command: an engine walk cannot see the rows, and an opt-in command leaves most apps wrong. Not route (b): a permanent multi-operator tax with a widening L2.",
"serial_constraints": "Change-set is empty (nothing committed), so overlap-check would answer 0 by construction. Instead, the open-PR files were read via gh api: 51 open PRs, and none touches packages/drivers/driver-sql/ at all, nor packages/cli/src/utils/schema-migrate.ts or packages/cli/src/commands/migrate/. Control leg: the first PR's files read back 5 entries, so the reads work. Both routes are clear today; re-run overlap-check on the first push.",
"tests": "Probe: packages/rest/src/zz-probe-34973.test.ts (scratch, deleted, never committed), built closure first: pnpm --filter '@objectstack/rest...' build under os-verify-lock -> VERDICT command-exit 0. Run: pnpm --filter @objectstack/rest exec vitest run --project local --maxWorkers=2 src/zz-probe-34973.test.ts -> VERDICT command-exit 0, Tests 8 passed (8). The PROBE lines quoted above are verbatim from that run on 4443014630c. No ablation: no behaviour changed. Postgres/MySQL: code reading only (no rig).",
"gates": "n/a: premise round; no diff, no commit, no PR. git status --porcelain empty after the probe was deleted; the branch is not pushed (ls-remote 0 heads).",
"dogfood_battery": "n/a: no PR",
"mcp_calls": "0",
"api_writes": "1: POST issues/34973/comments via post-stamped.mjs (this report)",
"open_questions": [
{
"question": "The claim asks route (a) to record every rewritten id and its original text. The repo's storage-convergence mechanism records only a count in the log (no down step). Which record does the seat require?",
"options": [
"A: Count plus a capped id sample per table/field in the info log, as backfillCanonicalDatetimes does. Cost: none extra. The rewrite is meaning-preserving, so the undo would restore the defective form.",
"B: Log every id and its text at info level (unbounded log line on a large table), or write them to a side table (new storage, a heavier surface).",
"C: Run it as an os migrate CLI command with a full JSON report and a runMigrationJournal compensate in raw SQL. Cost: M plus a new CLI command; the rows are fixed only where an operator runs it."
],
"recommendation": "A, because it matches the convention the claim defers to ('a down step only if the mechanism has one'), the os migrate plan preview gives the dry-run count, and an undo of a meaning-preserving rewrite has no reader."
},
{
"question": "Should route (a) also certify converted columns (a canonicalBooleanFields set, like canonicalDatetimeFields) so that later work can rely on 'no text rows'?",
"options": [
"A: No: there is no read-side repair to drop, so nothing reads the certificate.",
"B: Yes: it is worth adding only if route (b) is also wanted as an interim repair."
],
"recommendation": "A, because no reader needs it."
}
],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: this card (#34973) · noted, not filed. Same family, folded here: aggregate groupBy / distinct present a legacy text 'false' as true (presentReadValue case 'boolean' returns Boolean(value), sql-driver-filter-helpers.ts:333-334; probe: engine.aggregate groupBy won -> three true groups, false count 3 of 4), and ORDER BY sorts text rows after every integer. Route (a) removes their input; under route (b) they need their own arms.",
"class: none (read-only inference, not reproduced) · carrier: none · noted, not filed: driver-memory with persistence would have kept the raw strings 'true'/'false' written before #34965. It is outside this SQL-driver card and was not measured.",
"carrier: none · noted, not filed: on MySQL with a non-strict sql_mode, a pre-#34965 'true' into tinyint(1) would have stored 0 (data loss, not text). The driver sets no sql_mode and the server default is strict. Code reading only."
],
"Dev-effort": "high",
"Rounds": "1 (premise)"
}
Claim amendment: area o3-A · 2026-11-17T22:57Z · restates claim 6963136422 after the premise report 6963386869 and the seat's ruling (relayed to the area at 22:57Z). It supersedes the provisional lines.
Premise (measured on origin/main 4443014630c, wider than filed)
Only SQLite can hold text booleans, and only as 'true' / 'false' (NUMERIC affinity). Postgres, MSSQL, MySQL and Oracle coerce or refuse the text (code reading; no rig).
The engine cannot address these rows: a read presents them as booleans, and a 'false' comparand narrows to false. So the fix is raw SQL in the driver.
Seat ruling (22:57Z), quoted
route (a) is approved. backfillCanonicalBooleans becomes the fourth driver storage convergence, beside the datetime, time and JSON backfills: one guarded idempotent UPDATE per column, normalize_boolean_storage previewed under deferred DDL, non-canonical text withheld and warned. (1) Record: follow the convention, a count plus a capped id sample with no down step. Your reason holds, since an undo would only restore the broken form.
Route (a): file surface
packages/drivers/driver-sql/src/sql-driver-schema-sync.ts: backfillCanonicalBooleans, and previewBooleanConvergence called from previewDeferredSchemaWork.
packages/drivers/driver-sql/src/sql-driver-rotation.ts: one call beside the datetime, time and JSON backfills (~:661-666), plus the host Pick.
packages/drivers/driver-sql/src/sql-driver.ts: host stubs, if the rotation host needs them.
packages/drivers/driver-sql/src/schema-drift.ts: a new PendingSchemaWorkKind value, normalize_boolean_storage. It counts as in place under the existing isInPlaceSchemaWork rule, and the CLI renderer is generic, so no CLI file changes.
New pins beside these files, and a root .changeset/ (driver-sql).
If the docs page content/docs/deployment/cli.mdx, which lists normalize_datetime_storage, needs the new kind, one line there.
Record and reversibility (amended to the ruling)
The claim promised per-row ids and the original text. It now follows the convergence convention: an info log line per table and field with the rows converted and a capped sample of ids. There is no down step. The rewrite keeps meaning (since #34965 a text row reads the same as its integer), so an undo would only restore the defective form. The dry run is os migrate plan under deferred DDL, which counts the rows as normalize_boolean_storage. os migrate apply runs it after confirmation. An ordinary boot runs it automatically, unless OS_SKIP_SCHEMA_SYNC=1. Non-canonical text is never rewritten; it is counted and warned about. Each column is one atomic UPDATE.
Pins the seat will look for
A second boot changes 0 rows. =, $in, != and $nin, ORDER BY and groupBy over a mixed column, before and after. The OS_SKIP_SCHEMA_SYNC skip. The non-canonical warn path. The deferred-DDL preview count.
Clause-②: yes (widening: @objectstack/driver-sql exports PendingSchemaWorkKind from its index, and the CLI consumes it, so the union gains one published value, normalize_boolean_storage; boolean filters, sorts and groupBy on SQLite now answer legacy text rows as their boolean)
Metadata-protocol: none (no spec file is touched)
Container & model: S/M, mode:subagent, model: TIER_DEFAULT, effort: high. Review: L1-d, then seat L2 (writes stored rows at every boot; fable on the driver contract per the Clause-② line).
Serial constraints cleared: at the premise, no open PR touched packages/drivers/driver-sql/ or the CLI migrate files; the dev re-runs overlap-check on the first push.
{
"issue": 34973,
"status": "done",
"branch": "claude/issue-34973-boolean-text-backfill",
"pr": "https://github.com/objectstack-ai/objectstack/pull/35076",
"head_sha": "30bcd609ea0010df60de3c1353bee7104d00bc69",
"session": "session_01WGufzg2evNa1V3zxrQq3KX",
"premise_still_valid": true,
"summary": "Resume round after a container restart. I checked the two pushed commits (9189b7d6581, f002832c89e) against the claim amendment 6963450544 and merged origin/main 367e324eeb4. Three commits followed: (1) f5c21a7602d makes backfillCanonicalBooleans run one counting scan per column that classifies the text cells as legacy 'true'/'false' or other text; the id sample and the guarded UPDATE run only when it finds legacy text, so a converged column costs a boot one read. The pins also measure $in/$ne/$nin before the step and count the UPDATEs a second boot sends. (2) 383a794b4fd makes the idempotence pin require that the first boot converted, so it is no longer vacuously green under the ablation. (3) 30bcd609ea0 adds module-top imports to the edited cli pending-render test, the remedy check:test-source-alias prints. Route (a) as the seat ruled: it is the fourth driver-sql storage convergence; normalize_boolean_storage is previewed in place under deferred DDL with a count and writes nothing; other text is withheld and warned; the record is an info line with rowsConverted plus at most 5 sampleIds, with no down step. Draft PR #35076 is open, NOT governed, 511 changed lines.",
"pins": {
"file": "packages/drivers/driver-sql/src/sql-driver-34916-boolean-text-read.test.ts (three [#34973] describes, 12 cases) + packages/cli/src/utils/schema-migrate.pending-render.test.ts",
"list": [
"before the step: = false misses text_false, = true misses text_true",
"after initObjects: = false finds [int_zero, text_false], = true finds [int_one, text_true], and the toggle column converges too",
"$in/$ne/$nin: wrong before, right after",
"ORDER BY: before [nul,int_zero,int_one,text_false,text_true], after [nul,int_zero,text_false,int_one,text_true]",
"aggregate groupBy: before 5 groups with text 'false' presented as true, after [[false,2],[null,1],[true,2]]",
"info record per field: {table, field, rowsConverted, sampleIds}",
"second boot: the first boot converted 2 fields, the second sends no converting UPDATE, logs nothing, and leaves the stored types unchanged",
"skipSchemaSync (registerObjectMetadata, the door registerSchemasWithoutDdl uses for OS_SKIP_SCHEMA_SYNC=1) leaves the text rows untouched",
"'TRUE' and 'yes' are never rewritten, 'false' is converted, and one warn carries rowsWithheld: 2",
"the plan counts only the convertible rows (rows: 1, not 3)",
"deferred DDL previews [{table, kind: normalize_boolean_storage, columns: [flag, live], rows: 3}], isInPlaceSchemaWork is true, and the text cells stay text",
"apply (flush) converges the rows, and a re-plan is []",
"CLI renders 'deal [normalize_boolean_storage: won — 3 row update(s)]' in place; the summary reads '6 column(s) to converge in place' with no 'temporal'"
]
},
"ablations": {
"method": "scripts/ablation-replace.mjs in WRAP mode plus an outer EXIT/INT/TERM trap that restores and checks git diff HEAD. The tests import src/ directly (no dist resolution), so no rebuild leg. Run at 383a794b4fd.",
"A_backfill_call_removed": "sql-driver-rotation.ts, anchor 1 -> 0, blob 73fd7d438313 -> d791326b4a93: Tests 8 failed | 13 passed (21). Red: after-initObjects =, $in/$ne/$nin, ORDER BY, groupBy, info record, idempotence, withheld-and-warned, apply flush. Green as designed: before, skip, both preview pins. Restored: blob == HEAD (73fd7d438313), git diff HEAD empty. A first run at f5c21a7602d left the idempotence pin green, so 383a794b4fd tightened it and A was re-run.",
"B_preview_wiring_removed": "sql-driver-schema-sync.ts, the previewBooleanConvergence push in previewDeferredSchemaWork, anchor 1 -> 0, blob d320ed4deab3 -> 4b98e620a0c0: Tests 2 failed | 19 passed (21). Red: plan previews normalize_boolean_storage, and the plan counts only convertible rows. Restored: blob == HEAD (d320ed4deab3), git diff HEAD empty.",
"C_cli_summary_wording": "schema-migrate.ts 'column(s)' -> 'temporal column(s)', blob 4a7a238ffc0d -> 90cfcf1b699a: Tests 1 failed | 12 passed (13) (Expected: \"6 column(s) to converge in place\"). Restored: blob == HEAD (4a7a238ffc0d)."
},
"tests": "Built the cli closure after the merge: turbo run build --filter='@objectstack/cli^...' --filter=@objectstack/cli, Tasks 64 successful, VERDICT command-exit 0. At 383a794b4fd: driver-sql pin file Tests 21 passed (21); pnpm --filter @objectstack/driver-sql typecheck && vitest run gave Test Files 260 passed | 13 skipped (273), Tests 4366 passed | 251 skipped (4617), VERDICT command-exit 0; pnpm --filter @objectstack/cli typecheck && vitest run --project unit gave Test Files 426 passed (426), Tests 6057 passed (6057), VERDICT command-exit 0. At 30bcd609ea0 (cli test imports only): cli typecheck exit 0 (check:test-typecheck OK), and the pending-render + lazy-driver-import + vitest-tiers-partition files gave Tests 38 passed (38). The cli integration layer is declared to CI (no integration or spawn file touched). The previous round's 2 published-subpath cli failures were an unbuilt packages/cli/dist and are gone after the build.",
"gates": "dispatch-gates --commands --repo objectstack-ai/objectstack derived 109 families for 9 paths (objectstack @ 30bcd609ea0, merge base 367e324ee). I ran all 109 at 30bcd609ea0 with each exit captured before any pipe: 108 exit 0. check:type-check-debt is NOT MEASURED: os-verify-lock queue-timeout exit 99 twice; the holder was pid 16613, issue-34901-m1 suites.sh, held 2430s. It was exit 0 at 383a794b4fd. --ran reconciliation: 109 derived, 108 run, 1 UNRUN (check:type-check-debt). check:test-source-alias was red at 383a794b4fd (7 guarded imports reached from the edited cli test) and is green at 30bcd609ea0. check-governed-merges --branch: NOT governed, 0 of 9 paths, 511 changed lines (+502/-9) at most 3000. overlap-check: VERDICT clean exit 0 (origin/main, #35060, #34791 and #34717 share cli.mdx and merge cleanly). PR check-runs at 30bcd609ea0: Lint, Type Check, Check Changeset and Governed Surface Queue Guard were in_progress when this was written; Test Core and Build Core were not yet listed. in_progress is the honest value.",
"governed_verdict": "NOT governed (0/9 paths), 511 lines",
"overlap_check": "VERDICT clean exit 0",
"dogfood_battery": "n/a: no '!' in the PR title, and the Clause-② arm is (widening), not (narrowing)",
"mcp_calls": "0",
"api_writes": "2: the relay pr_create (POST /repos/objectstack-ai/objectstack/pulls draft + POST /issues/35076/assignees os-support-ai, read back as identical, 12107 bytes) and this os-dev-report comment via post-stamped.mjs (POST /repos/objectstack-ai/objectstack/issues/34973/comments). Plus git push x3 (not REST).",
"deviations": [
"Restart: the previous os-dev died mid-build. Its pushed head f002832c89e was verified equal to origin's before resuming, and every pin, suite and gate was re-run in this round; no earlier reading is reused.",
"cli schema-migrate.ts is outside the amendment's surface (it expected no CLI change). The renderer is generic, but summarizePendingSchemaWork printed 'N temporal column(s) to converge in place', so a boolean column would have been counted as temporal on the line an operator reads before confirming apply. The word was dropped ('N column(s) …'), pinned, and ablated (C). The changeset and the PR body say so.",
"The cli pending-render test gained 7 module-top side-effect imports, because check:test-source-alias judges edited test files. Bare imports are no value imports to packages/cli/vitest-tiers.ts, so the file stays in the unit tier (partition pin green).",
"check:type-check-debt not measured on the final head (lock queue-timeout); declared, CI carries it.",
"The PR body carries two HTML comments, the attribution line and the signed trailer, both mandated by the seat's standard order (os-dev.md otherwise bans dev-written HTML comments). The body ends with the AGENTS.md session-URL footer instead of the harness's emoji footer, and the signed line comes last as ordered.",
"Closing keyword 'Closes #34973' as ordered (os-dev.md template says 'Fixes').",
"The merge commit 9a2a7f5f15b uses git's default message and carries no trailers; the pre-push hook accepted it."
],
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [],
"Dev-effort": "high",
"Rounds": "1 premise + 1 build"
}
Claim amendment: area o3-A · 2026-11-18T01:49Z · amends 6963450544 with the built surface of draft PR #35076 (head 30bcd609ea0, report 6966532536).
Files outside the amended surface
packages/cli/src/utils/schema-migrate.ts: one word. The amendment expected no CLI change, because the renderer is generic, and it is. But summarizePendingSchemaWork printed "N temporal column(s) to converge in place". With a boolean kind, that line would call a boolean column temporal on the summary an operator reads before confirming os migrate apply. The word is dropped ("N column(s) …"), pinned, and ablated (ablation C).
packages/cli/src/utils/schema-migrate.pending-render.test.ts: renders normalize_boolean_storage in place and pins the summary wording. It gained 7 module-top side-effect imports, the remedy check:test-source-alias prints for an edited test. The unit-tier partition pin stays green.
The pins live in the existing shared harness packages/drivers/driver-sql/src/sql-driver-34916-boolean-text-read.test.ts, as three [#34973] describes, per the AGENTS.md shared-harness rule.
Unchanged
Everything else is as amended: the fourth storage convergence in driver-sql, an in-place deferred-DDL preview, other text withheld and warned, and the record as an info line with rowsConverted plus at most 5 sampleIds, with no down step.
Clause-②: yes (widening: @objectstack/driver-sql exports PendingSchemaWorkKind from its index, and the CLI consumes it, so the union gains one published value, normalize_boolean_storage; boolean filters, sorts and groupBy on SQLite now answer legacy text rows as their boolean)
Metadata-protocol: none
Governed: NOT governed (0 of 9 paths), 511 changed lines.
Review: L1-d, then seat L2.
Delivered · 2026-11-18T03:11Z · PR #35076 merged (23c42c4); its Closes line closed this card.
The premise was wider than filed. The card named a boolean column holding the text 'true' / 'false'. Measured (premise 6963386869), on SQLite those rows were wrong for =, !=, $in, $nin, ORDER BY and an aggregate groupBy, and the engine could not address them, not only for the read the card described. On Postgres, MySQL, MSSQL and Oracle the native boolean column cannot hold the text.
What shipped (route a, seat ruling 6963450544).
backfillCanonicalBooleans is the fourth driver-sql storage convergence. It is SQLite only. One guarded UPDATE per column rewrites exactly 'true' / 'false' to 1 / 0, and it is idempotent.
Any other text is never rewritten: it is left as stored and warned once with a count. The canonical '1' / '0' in a TEXT-affinity column is not counted.
The record is one info line per column, with rowsConverted and up to five ids. There is no down step.
os migrate plan previews it as normalize_boolean_storage, in place, under deferred DDL. OS_SKIP_SCHEMA_SYNC=1 skips it.
Clause-② yes (widening: PendingSchemaWorkKind gains a value). driver-sql and cli at patch.
Pins cover before and after for every operator above, plus the record, idempotence, the skip door, withheld text, plan and apply. Each was ablated.
The seat routed two older driver readings from the delta L2 to triage: a TEXT-affinity '0' groups as true, and the datetime and time backfills drop their info record on clients that report no changes.
Reviews: L1-d 6966622908 and 6966877056; seat L2 PASS 6966769750, carried forward by 6967050006. pm:dispatched removed.
domain:serverDomain lane — seat card indexed by label:pm:seatfindingRecorded observation — held, not dispatchable until the findings triage round grades itpriority:p1High: required for production / M2
Activity
objectstack-fleet commentedon Nov 17, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Unlock (21:4xZ): both blockers are closed: #34916, and PR #34965, which stops new text-stored booleans. Moved
pm:blocked→pm:queue. The grade is unchanged (p1 · server): rows written before #34965 still miss equality filters until this lands.objectstack-fleet commentedon Nov 17, 2026
repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX
Claim: PM loop round 1 · area o3-A · 2026-11-17T22:42Z
Session:
session_01WGufzg2evNa1V3zxrQq3KXAccount:
os-support-aiBranch:
claude/issue-34973-boolean-text-backfillWorktree:
objectstack-issue-34973Domain:
domain:serverSeat:
repo:objectstack#3File surface: set by the premise measurement, before any code. The os-dev first measures on origin/main (after #34965,
3a78b898) and stops before design. The area then restates this claim with the measured surface and the serial-constraint scan. The two routes the card allows:packages/drivers/driver-sql/src/**and whatever runner owns upgrade steps). It rewrites text-stored booleans ('true'/'false', and'1'/'0'if measured) to the driver's boolean form, per object and per boolean field, idempotently;Pins go beside the edited files (a row seeded with the text
'false'is found by= falseafter the step or with the read fix), plus a root.changeset/.Reversibility and dry run (route a, stated before any build at the seat's order):
'true'→true,'false'→false) and leaves every other value untouched. The forward map is lossless in meaning but forgets which rows were text. The step therefore records, per object and field, the ids it rewrote and the original text, in its report or log, so an operator can restore them. A down step is offered only if the repo's migration mechanism has one. A non-canonical text value (anything outside the measured readings) is never rewritten; it is counted and reported.Container & model:
M,mode:subagent,model: TIER_DEFAULT (re-derived at the restated claim),effort: high(seat order)Clause-②: no (provisional, restated with the surface): route (a) rewrites stored values to the form new writes already take since fix(objectql,driver-sql): a boolean field given 'true' / 'false' stores the boolean, and a stored text 'false' reads as false #34965, and no accepted input or answer narrows. Route (b) widens what a boolean equality filter matches; it is restated as
yes (widening …)and sent to seat L2 if chosen.Metadata-protocol: none (provisional; restated if the step needs a manifest or upgrade-protocol entry)
Responsibility:
boolean fields on the SQL driver (objectstack): rows written by the inline grid before #34965 still hold the text 'true'/'false', so equality filters (won = false) and requiredWhen over queries miss them until each row is re-saved | #34965 fixed new writes and the read of a stored 'false'/'0', not the stored data | every app on the SQL driver that edited booleans in a master-detail inline grid before 18.5.x-nextThread-read: 6961931895
Premise: to be measured on origin/main first: (1) which text readings exist in stored rows and how the filter compiles them; (2) the repo's upgrade or migration mechanism and its dry-run and down conventions; (3) the cost of a read-side match (index use, the SQLite and Postgres dialects).
Serial constraints cleared:
deferred to the restated claim (the surface is not known yet); the dev runs overlap-check on its probe pushPre-claim lane:
domain:serverPre-claim deps: Inline grid edit stores a boolean field as the text 'true' (SQL driver) — equality filters miss it and requiredWhen reads it as false #34916 / PR fix(objectql,driver-sql): a boolean field given 'true' / 'false' stores the boolean, and a stored text 'false' reads as false #34965 merged (
3a78b898), unlocked by triage 6961931895Prior rulings read: seat ruling 6957305509 (backfill ruled out of fix(objectql,driver-sql): a boolean field given 'true' / 'false' stores the boolean, and a stored text 'false' reads as false #34965), L1-d 6959775843 → read; migration / upgrade-step rulings → read at the restated claim
Lease
o3-A(seat post #34584); repo p1 under seat 3 (seat order 2026-11-17 22:41Z). L1: L1-d.objectstack-fleet commentedon Nov 17, 2026
repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX
os-dev-report
{ "issue": 34973, "status": "reading", "branch": "claude/issue-34973-boolean-text-backfill", "pr": null, "session": "session_01WGufzg2evNa1V3zxrQq3KX", "premise_still_valid": true, "summary": "Premise holds and is wider than filed, all measured on objectstack origin/main 4443014630c (contains 3a78b898, merge-base --is-ancestor exit 0) through SqlDriver on SQLite at the driver, the engine and the REST door. Legacy text 'true'/'false' rows are missed by =, and also answered wrongly by !=, $in, $nin, ORDER BY and aggregate groupBy (a text 'false' groups and presents as true). Only SQLite can hold such rows (NUMERIC affinity keeps 'true'/'false' as TEXT and turns '1'/'0' into integers), and only those two spellings exist. The engine cannot see or address the text rows: the row read presents them as booleans (presentStoredBoolean) and the boolean comparand door narrows 'false' to false. So route (a) must be raw SQL in the driver. The repo already has that mechanism for SQLite storage forms: the schema-sync storage convergence (datetime, time, JSON backfills) that runs at every boot, with an os migrate plan preview. Recommendation: route (a) as a fourth convergence, backfillCanonicalBooleans. Route (b) is a permanent multi-operator tax. No code was written, nothing was committed or pushed, and the probe was deleted.", "measurements": { "1_stored_forms": { "ddl_per_dialect": "createColumn case 'boolean'/'toggle' -> knex table.boolean (packages/drivers/driver-sql/src/sql-driver-column-creation.ts:982-984). Declared types: SQLite 'boolean' (probe: pragma table_info type=boolean, NUMERIC affinity); Postgres 'boolean' (knex pg-columncompiler bool); MySQL BOOLEAN = tinyint(1); MSSQL 'bit'; Oracle number(1,0) CHECK IN (0,1).", "probe_sqlite_typeof": "raw seeds -> stored: 'true'->'true' text, 'false'->'false' text, '1'->1 integer, '0'->0 integer, 1/0/true/false->integer, null->null. So SQLite holds only the two text spellings 'true'/'false'. The validator admits only 0,1,'0','1','true','false', so nothing else could be written by the write door.", "other_dialects_code_reading": "Postgres: a real boolean column parses the input text 'true'/'false', so no text rows can exist. MSSQL bit converts 'true'/'false' implicitly. MySQL tinyint(1) and Oracle number(1) reject the text (MySQL strict mode is the server default; the driver sets no sql_mode), so the old write failed instead of storing text. Not measured live: no Postgres/MySQL rig in this container (OS_TEST_POSTGRES_URL and OS_TEST_MYSQL_URL unset).", "probe_filters_driver_and_engine_and_REST": "Rows: text_true, text_false, text_one, text_zero, int_one, int_zero, js_true, js_false, null. won=false -> [int_zero, js_false, text_zero] (text_false MISSED). won=true -> [int_one, js_true, text_one] (text_true MISSED). Identical at driver.find, engine.find and REST POST /data/:object/query; REST GET ?won=false is the same. $ne false -> includes text_false (WRONG). $ne true -> includes text_true (WRONG). $in [true,false] -> misses both text rows. $nin [true] -> includes text_true (WRONG). $null true -> [null] (correct). engine.count won=false = 3 (true answer 4). ORDER BY won asc -> null, the 0s, the 1s, then text_false:false, text_true:true (the text rows sort after every integer)." }, "2_read_side_today": { "row_read": "presentStoredBoolean (sql-driver-sqlite-serialisation.ts:57, applied at :558) presents text 'false'->false and 'true'->true. Probe: engine read and REST GET text_false -> won:false. Correct.", "distinct_aggregate": "presentReadValue case 'boolean' still returns Boolean(value) (sql-driver-filter-helpers.ts:333-334). Probe: driver/engine aggregate groupBy won count -> [{null:1},{false:3},{true:3},{true:1},{true:1}]: the text 'false' group is presented as TRUE and three true groups come back. sum(won)=3 with count=8: text 'true' adds 0. distinct -> [true,false,null], which is right here only because the dedup hides the miscounted 'false'. Same family as this card: route (a) removes the input; route (b) would have to fix it separately.", "requiredWhen": "Not affected beyond the filter miss. It is evaluated in JS over rows the driver presents, and since #34965 a text row presents as its boolean. Probe (isSystem context): updating another field on legacy text_true and on canonical int_one, both with no delivery_date, gave the same verdict (admitted) on both rows. The remaining effect is the filter miss: a bulk update by predicate (where won = true) selects its prior rows and its UPDATE through that same filter, so it skips legacy text rows." }, "3_route_a_mechanism": { "found": "Three mechanisms exist. (i) MATCHING PRECEDENT: the driver-sql schema-sync storage convergence. initObjects (sql-driver-rotation.ts:402) calls backfillCanonicalDatetimes / backfillCanonicalTimes / backfillCanonicalJsonEncoding per managed table (sql-driver-rotation.ts:661-666; bodies at sql-driver-schema-sync.ts:1822, :1981, :1899). Each is SQLite-only, idempotent, and runs one raw UPDATE per column guarded by a WHERE that selects only non-canonical values. A table created in this process is certified clean without reading it, and a value that cannot be decided is withheld and warned about (the julian-day guard). It runs at EVERY boot unless OS_SKIP_SCHEMA_SYNC=1 (objectql plugin.ts:633). Under deferred DDL (os migrate plan/apply) it is previewed read-only by previewDeferredSchemaWork -> previewDatetimeConvergence (sql-driver-schema-sync.ts:2371, :2462), which counts rows into a PendingSchemaWork entry of kind normalize_datetime_storage (schema-drift.ts:418 union, :433 isInPlaceSchemaWork). os migrate plan renders in-place work generically as N row update(s) (packages/cli/src/utils/schema-migrate.ts:1937-1983), and os migrate apply runs it after the confirmation prompt. No down step, no id journal; the audit is a logger.info line with rowsConverted. (ii) os migrate data-repair commands, e.g. text-scalars, the numeric twin of #34965 (packages/cli/src/commands/migrate/text-scalars.ts): dry run by default, --apply --yes, report with capped sample ids, idempotent, no undo, and walked through engine.find/update. (iii) The ADR-0119 D2 journal runner runMigrationJournal (packages/core/src/utils/migration-journal.ts:615): chunk transactions, preflight, compensate and resume via os migrate resume. Its only CLI user is os migrate recorded-by (recorded-by.ts:196).", "why_not_the_engine": "Mechanisms (ii) and (iii) read through the engine, which cannot address these rows. engine.find(won='false') is narrowed to false and returns the integer rows (probe), and every read presents the text as a boolean. A candidate count or row address is only possible in raw SQL: typeof(col)='text' AND col IN ('true','false'). driver.find with a string comparand, which the engine never sends, does reach the rows: ['text_false'].", "probe_shape": "Dry run: select id, won where typeof(won)='text' and won in ('true','false') -> [text_false 'false', text_true 'true']; non-canonical text -> []. Apply in one transaction: update set won = case won when 'true' then 1 when 'false' then 0 end where typeof(won)='text' and won in ('true','false') -> changes 2. Second run -> changes 0 (idempotent). After the run: engine won=false -> [int_zero, js_false, text_false, text_zero] and won=true -> [int_one, js_true, text_one, text_true]. An undo from the recorded id + text restored both text rows (typeof text)." }, "4_route_b_read_side": "Compile a SQLite boolean comparand to both spellings. Probe: won IN (0,'false') -> [int_zero, js_false, text_false, text_zero]. EXPLAIN QUERY PLAN with an index on won: = 0 and IN (0,'false') are both SEARCH USING INDEX (won=?). The index survives for equality. groupBy over a CASE fold -> SCAN USING COVERING INDEX + USE TEMP B-TREE FOR GROUP BY. Cost: every operator arm must change (sql-driver-filter-helpers.ts $eq :928, $ne :931 null-safe NOT IN, $in :967 expanding a list, $nin :972, the applyNormalizedComparison path at :926, and predicate-emitters.ts:650-666 for expression columns). So must ORDER BY (CASE fold, which loses index order), aggregate group keys and sum/avg (sql-driver-aggregation.ts), distinct, and presentReadValue (:333). It is SQLite-only, but it is paid on every query forever. The precedent design (needsLegacyDatetimeRepair, filter-helpers.ts:229) keeps such a repair only until a backfill certifies the column (canonicalDatetimeFields), so route (b) alone still implies route (a) to ever retire it. It widens what a filter matches." }, "routes": { "a": "File surface: packages/drivers/driver-sql/src/sql-driver-schema-sync.ts (backfillCanonicalBooleans plus previewBooleanConvergence, one line in previewDeferredSchemaWork), sql-driver-rotation.ts (one call beside :661-666 plus the host Pick), sql-driver.ts (host stubs, and a canonical-boolean set if certification is wanted), schema-drift.ts (new PendingSchemaWorkKind normalize_boolean_storage, in place by the existing isInPlaceSchemaWork rule), a new pin test beside them (a text 'false' row is found by = false after initObjects; a second sync converts 0; os migrate plan counts it under deferral; non-canonical text is withheld), and a root .changeset (patch, driver-sql). No CLI file is needed: the renderer is generic. Reversibility: semantically lossless; since #34965 a text row and its integer read identically, so an undo would only restore the defective form. This mechanism has no down convention. The record is the info log (count plus a capped list of ids per table/field) and the os migrate plan row count. The claim's per-row id+text record is an open question below. Dry run: os migrate plan (deferred DDL boots read-only) shows normalize_boolean_storage with rows; os migrate apply runs it after confirmation; an ordinary boot runs it automatically, like the datetime convergence. Atomicity: one UPDATE statement per column, atomic on SQLite. Clause-2: no (stored values move to the form new writes take; no accepted input or answer contract changes). Metadata-protocol: none. Cost: S, about 5 files, mirroring backfillCanonicalTimes. It also clears the groupBy/sort/!= misreads, because their input disappears.", "b": "File surface: sql-driver-filter-helpers.ts, sql-driver-predicate-emitters.ts, sql-driver-aggregation.ts, sql-driver-distinct.ts, the sort compile, plus pins per operator. Reversibility: code only, revert the PR. Dry run: none needed (no data change). Clause-2: yes (widening): an equality filter on a boolean matches more stored values, so it goes to seat L2. Metadata-protocol: none. Cost: M-L. Every operator, sort, groupBy, sum and distinct must change, on every SQLite query, permanently, unless route (a) also lands, which makes (b) redundant." }, "recommendation": "Route (a) in the existing driver storage-convergence form (backfillCanonicalBooleans beside the datetime/time/JSON backfills, previewed by os migrate plan as normalize_boolean_storage). It is the repo's own convention for exactly this class (a SQLite legacy storage form -> canonical, idempotent, at boot and under os migrate apply). It fixes every deployment without operator action, which matters because the effect is silent. It is SQLite-only because only SQLite can hold the text. Not a CLI command: an engine walk cannot see the rows, and an opt-in command leaves most apps wrong. Not route (b): a permanent multi-operator tax with a widening L2.", "serial_constraints": "Change-set is empty (nothing committed), so overlap-check would answer 0 by construction. Instead, the open-PR files were read via gh api: 51 open PRs, and none touches packages/drivers/driver-sql/ at all, nor packages/cli/src/utils/schema-migrate.ts or packages/cli/src/commands/migrate/. Control leg: the first PR's files read back 5 entries, so the reads work. Both routes are clear today; re-run overlap-check on the first push.", "tests": "Probe: packages/rest/src/zz-probe-34973.test.ts (scratch, deleted, never committed), built closure first: pnpm --filter '@objectstack/rest...' build under os-verify-lock -> VERDICT command-exit 0. Run: pnpm --filter @objectstack/rest exec vitest run --project local --maxWorkers=2 src/zz-probe-34973.test.ts -> VERDICT command-exit 0, Tests 8 passed (8). The PROBE lines quoted above are verbatim from that run on 4443014630c. No ablation: no behaviour changed. Postgres/MySQL: code reading only (no rig).", "gates": "n/a: premise round; no diff, no commit, no PR. git status --porcelain empty after the probe was deleted; the branch is not pushed (ls-remote 0 heads).", "dogfood_battery": "n/a: no PR", "mcp_calls": "0", "api_writes": "1: POST issues/34973/comments via post-stamped.mjs (this report)", "open_questions": [ { "question": "The claim asks route (a) to record every rewritten id and its original text. The repo's storage-convergence mechanism records only a count in the log (no down step). Which record does the seat require?", "options": [ "A: Count plus a capped id sample per table/field in the info log, as backfillCanonicalDatetimes does. Cost: none extra. The rewrite is meaning-preserving, so the undo would restore the defective form.", "B: Log every id and its text at info level (unbounded log line on a large table), or write them to a side table (new storage, a heavier surface).", "C: Run it as an os migrate CLI command with a full JSON report and a runMigrationJournal compensate in raw SQL. Cost: M plus a new CLI command; the rows are fixed only where an operator runs it." ], "recommendation": "A, because it matches the convention the claim defers to ('a down step only if the mechanism has one'), the os migrate plan preview gives the dry-run count, and an undo of a meaning-preserving rewrite has no reader." }, { "question": "Should route (a) also certify converted columns (a canonicalBooleanFields set, like canonicalDatetimeFields) so that later work can rely on 'no text rows'?", "options": [ "A: No: there is no read-side repair to drop, so nothing reads the certificate.", "B: Yes: it is worth adding only if route (b) is also wanted as an interim repair." ], "recommendation": "A, because no reader needs it." } ], "security_findings": "none", "out_of_scope_findings": [ "carrier: this card (#34973) · noted, not filed. Same family, folded here: aggregate groupBy / distinct present a legacy text 'false' as true (presentReadValue case 'boolean' returns Boolean(value), sql-driver-filter-helpers.ts:333-334; probe: engine.aggregate groupBy won -> three true groups, false count 3 of 4), and ORDER BY sorts text rows after every integer. Route (a) removes their input; under route (b) they need their own arms.", "class: none (read-only inference, not reproduced) · carrier: none · noted, not filed: driver-memory with persistence would have kept the raw strings 'true'/'false' written before #34965. It is outside this SQL-driver card and was not measured.", "carrier: none · noted, not filed: on MySQL with a non-strict sql_mode, a pre-#34965 'true' into tinyint(1) would have stored 0 (data loss, not text). The driver sets no sql_mode and the server default is strict. Code reading only." ], "Dev-effort": "high", "Rounds": "1 (premise)" }objectstack-fleet commentedon Nov 17, 2026
repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX
Claim amendment: area o3-A · 2026-11-17T22:57Z · restates claim 6963136422 after the premise report 6963386869 and the seat's ruling (relayed to the area at 22:57Z). It supersedes the provisional lines.
Premise (measured on origin/main
4443014630c, wider than filed)'true'/'false'(NUMERIC affinity). Postgres, MSSQL, MySQL and Oracle coerce or refuse the text (code reading; no rig).=,$in,!=and$ninall answer wrongly, at the driver, the engine and the REST door. ORDER BY sorts them after every integer. Aggregate groupBy presents a text'false'as true (presentReadValue,sql-driver-filter-helpers.ts:333).requiredWhenis unaffected since fix(objectql,driver-sql): a boolean field given 'true' / 'false' stores the boolean, and a stored text 'false' reads as false #34965.'false'comparand narrows to false. So the fix is raw SQL in the driver.Seat ruling (22:57Z), quoted
Route (a): file surface
packages/drivers/driver-sql/src/sql-driver-schema-sync.ts:backfillCanonicalBooleans, andpreviewBooleanConvergencecalled frompreviewDeferredSchemaWork.packages/drivers/driver-sql/src/sql-driver-rotation.ts: one call beside the datetime, time and JSON backfills (~:661-666), plus the hostPick.packages/drivers/driver-sql/src/sql-driver.ts: host stubs, if the rotation host needs them.packages/drivers/driver-sql/src/schema-drift.ts: a newPendingSchemaWorkKindvalue,normalize_boolean_storage. It counts as in place under the existingisInPlaceSchemaWorkrule, and the CLI renderer is generic, so no CLI file changes..changeset/(driver-sql).content/docs/deployment/cli.mdx, which listsnormalize_datetime_storage, needs the new kind, one line there.Record and reversibility (amended to the ruling)
The claim promised per-row ids and the original text. It now follows the convergence convention: an info log line per table and field with the rows converted and a capped sample of ids. There is no down step. The rewrite keeps meaning (since #34965 a text row reads the same as its integer), so an undo would only restore the defective form. The dry run is
os migrate planunder deferred DDL, which counts the rows asnormalize_boolean_storage.os migrate applyruns it after confirmation. An ordinary boot runs it automatically, unlessOS_SKIP_SCHEMA_SYNC=1. Non-canonical text is never rewritten; it is counted and warned about. Each column is one atomic UPDATE.Pins the seat will look for
A second boot changes 0 rows.
=,$in,!=and$nin, ORDER BY and groupBy over a mixed column, before and after. TheOS_SKIP_SCHEMA_SYNCskip. The non-canonical warn path. The deferred-DDL preview count.Clause-②: yes (widening:
@objectstack/driver-sqlexportsPendingSchemaWorkKindfrom its index, and the CLI consumes it, so the union gains one published value,normalize_boolean_storage; boolean filters, sorts and groupBy on SQLite now answer legacy text rows as their boolean)Metadata-protocol: none (no spec file is touched)
Container & model:
S/M,mode:subagent,model: TIER_DEFAULT,effort: high. Review: L1-d, then seat L2 (writes stored rows at every boot; fable on the driver contract per the Clause-② line).Serial constraints cleared: at the premise, no open PR touched
packages/drivers/driver-sql/or the CLI migrate files; the dev re-runs overlap-check on the first push.objectstack-fleet commentedon Nov 18, 2026
repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX
os-dev-report
{ "issue": 34973, "status": "done", "branch": "claude/issue-34973-boolean-text-backfill", "pr": "https://github.com/objectstack-ai/objectstack/pull/35076", "head_sha": "30bcd609ea0010df60de3c1353bee7104d00bc69", "session": "session_01WGufzg2evNa1V3zxrQq3KX", "premise_still_valid": true, "summary": "Resume round after a container restart. I checked the two pushed commits (9189b7d6581, f002832c89e) against the claim amendment 6963450544 and merged origin/main 367e324eeb4. Three commits followed: (1) f5c21a7602d makes backfillCanonicalBooleans run one counting scan per column that classifies the text cells as legacy 'true'/'false' or other text; the id sample and the guarded UPDATE run only when it finds legacy text, so a converged column costs a boot one read. The pins also measure $in/$ne/$nin before the step and count the UPDATEs a second boot sends. (2) 383a794b4fd makes the idempotence pin require that the first boot converted, so it is no longer vacuously green under the ablation. (3) 30bcd609ea0 adds module-top imports to the edited cli pending-render test, the remedy check:test-source-alias prints. Route (a) as the seat ruled: it is the fourth driver-sql storage convergence; normalize_boolean_storage is previewed in place under deferred DDL with a count and writes nothing; other text is withheld and warned; the record is an info line with rowsConverted plus at most 5 sampleIds, with no down step. Draft PR #35076 is open, NOT governed, 511 changed lines.", "pins": { "file": "packages/drivers/driver-sql/src/sql-driver-34916-boolean-text-read.test.ts (three [#34973] describes, 12 cases) + packages/cli/src/utils/schema-migrate.pending-render.test.ts", "list": [ "before the step: = false misses text_false, = true misses text_true", "after initObjects: = false finds [int_zero, text_false], = true finds [int_one, text_true], and the toggle column converges too", "$in/$ne/$nin: wrong before, right after", "ORDER BY: before [nul,int_zero,int_one,text_false,text_true], after [nul,int_zero,text_false,int_one,text_true]", "aggregate groupBy: before 5 groups with text 'false' presented as true, after [[false,2],[null,1],[true,2]]", "info record per field: {table, field, rowsConverted, sampleIds}", "second boot: the first boot converted 2 fields, the second sends no converting UPDATE, logs nothing, and leaves the stored types unchanged", "skipSchemaSync (registerObjectMetadata, the door registerSchemasWithoutDdl uses for OS_SKIP_SCHEMA_SYNC=1) leaves the text rows untouched", "'TRUE' and 'yes' are never rewritten, 'false' is converted, and one warn carries rowsWithheld: 2", "the plan counts only the convertible rows (rows: 1, not 3)", "deferred DDL previews [{table, kind: normalize_boolean_storage, columns: [flag, live], rows: 3}], isInPlaceSchemaWork is true, and the text cells stay text", "apply (flush) converges the rows, and a re-plan is []", "CLI renders 'deal [normalize_boolean_storage: won — 3 row update(s)]' in place; the summary reads '6 column(s) to converge in place' with no 'temporal'" ] }, "ablations": { "method": "scripts/ablation-replace.mjs in WRAP mode plus an outer EXIT/INT/TERM trap that restores and checks git diff HEAD. The tests import src/ directly (no dist resolution), so no rebuild leg. Run at 383a794b4fd.", "A_backfill_call_removed": "sql-driver-rotation.ts, anchor 1 -> 0, blob 73fd7d438313 -> d791326b4a93: Tests 8 failed | 13 passed (21). Red: after-initObjects =, $in/$ne/$nin, ORDER BY, groupBy, info record, idempotence, withheld-and-warned, apply flush. Green as designed: before, skip, both preview pins. Restored: blob == HEAD (73fd7d438313), git diff HEAD empty. A first run at f5c21a7602d left the idempotence pin green, so 383a794b4fd tightened it and A was re-run.", "B_preview_wiring_removed": "sql-driver-schema-sync.ts, the previewBooleanConvergence push in previewDeferredSchemaWork, anchor 1 -> 0, blob d320ed4deab3 -> 4b98e620a0c0: Tests 2 failed | 19 passed (21). Red: plan previews normalize_boolean_storage, and the plan counts only convertible rows. Restored: blob == HEAD (d320ed4deab3), git diff HEAD empty.", "C_cli_summary_wording": "schema-migrate.ts 'column(s)' -> 'temporal column(s)', blob 4a7a238ffc0d -> 90cfcf1b699a: Tests 1 failed | 12 passed (13) (Expected: \"6 column(s) to converge in place\"). Restored: blob == HEAD (4a7a238ffc0d)." }, "tests": "Built the cli closure after the merge: turbo run build --filter='@objectstack/cli^...' --filter=@objectstack/cli, Tasks 64 successful, VERDICT command-exit 0. At 383a794b4fd: driver-sql pin file Tests 21 passed (21); pnpm --filter @objectstack/driver-sql typecheck && vitest run gave Test Files 260 passed | 13 skipped (273), Tests 4366 passed | 251 skipped (4617), VERDICT command-exit 0; pnpm --filter @objectstack/cli typecheck && vitest run --project unit gave Test Files 426 passed (426), Tests 6057 passed (6057), VERDICT command-exit 0. At 30bcd609ea0 (cli test imports only): cli typecheck exit 0 (check:test-typecheck OK), and the pending-render + lazy-driver-import + vitest-tiers-partition files gave Tests 38 passed (38). The cli integration layer is declared to CI (no integration or spawn file touched). The previous round's 2 published-subpath cli failures were an unbuilt packages/cli/dist and are gone after the build.", "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack derived 109 families for 9 paths (objectstack @ 30bcd609ea0, merge base 367e324ee). I ran all 109 at 30bcd609ea0 with each exit captured before any pipe: 108 exit 0. check:type-check-debt is NOT MEASURED: os-verify-lock queue-timeout exit 99 twice; the holder was pid 16613, issue-34901-m1 suites.sh, held 2430s. It was exit 0 at 383a794b4fd. --ran reconciliation: 109 derived, 108 run, 1 UNRUN (check:type-check-debt). check:test-source-alias was red at 383a794b4fd (7 guarded imports reached from the edited cli test) and is green at 30bcd609ea0. check-governed-merges --branch: NOT governed, 0 of 9 paths, 511 changed lines (+502/-9) at most 3000. overlap-check: VERDICT clean exit 0 (origin/main, #35060, #34791 and #34717 share cli.mdx and merge cleanly). PR check-runs at 30bcd609ea0: Lint, Type Check, Check Changeset and Governed Surface Queue Guard were in_progress when this was written; Test Core and Build Core were not yet listed. in_progress is the honest value.", "governed_verdict": "NOT governed (0/9 paths), 511 lines", "overlap_check": "VERDICT clean exit 0", "dogfood_battery": "n/a: no '!' in the PR title, and the Clause-② arm is (widening), not (narrowing)", "mcp_calls": "0", "api_writes": "2: the relay pr_create (POST /repos/objectstack-ai/objectstack/pulls draft + POST /issues/35076/assignees os-support-ai, read back as identical, 12107 bytes) and this os-dev-report comment via post-stamped.mjs (POST /repos/objectstack-ai/objectstack/issues/34973/comments). Plus git push x3 (not REST).", "deviations": [ "Restart: the previous os-dev died mid-build. Its pushed head f002832c89e was verified equal to origin's before resuming, and every pin, suite and gate was re-run in this round; no earlier reading is reused.", "cli schema-migrate.ts is outside the amendment's surface (it expected no CLI change). The renderer is generic, but summarizePendingSchemaWork printed 'N temporal column(s) to converge in place', so a boolean column would have been counted as temporal on the line an operator reads before confirming apply. The word was dropped ('N column(s) …'), pinned, and ablated (C). The changeset and the PR body say so.", "The cli pending-render test gained 7 module-top side-effect imports, because check:test-source-alias judges edited test files. Bare imports are no value imports to packages/cli/vitest-tiers.ts, so the file stays in the unit tier (partition pin green).", "check:type-check-debt not measured on the final head (lock queue-timeout); declared, CI carries it.", "The PR body carries two HTML comments, the attribution line and the signed trailer, both mandated by the seat's standard order (os-dev.md otherwise bans dev-written HTML comments). The body ends with the AGENTS.md session-URL footer instead of the harness's emoji footer, and the signed line comes last as ordered.", "Closing keyword 'Closes #34973' as ordered (os-dev.md template says 'Fixes').", "The merge commit 9a2a7f5f15b uses git's default message and carries no trailers; the pre-push hook accepted it." ], "open_questions": [], "security_findings": "none", "out_of_scope_findings": [], "Dev-effort": "high", "Rounds": "1 premise + 1 build" }objectstack-fleet commentedon Nov 18, 2026
repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX
Claim amendment: area o3-A · 2026-11-18T01:49Z · amends 6963450544 with the built surface of draft PR #35076 (head
30bcd609ea0, report 6966532536).Files outside the amended surface
packages/cli/src/utils/schema-migrate.ts: one word. The amendment expected no CLI change, because the renderer is generic, and it is. ButsummarizePendingSchemaWorkprinted "N temporal column(s) to converge in place". With a boolean kind, that line would call a boolean column temporal on the summary an operator reads before confirmingos migrate apply. The word is dropped ("N column(s) …"), pinned, and ablated (ablation C).packages/cli/src/utils/schema-migrate.pending-render.test.ts: rendersnormalize_boolean_storagein place and pins the summary wording. It gained 7 module-top side-effect imports, the remedycheck:test-source-aliasprints for an edited test. The unit-tier partition pin stays green.packages/drivers/driver-sql/src/sql-driver-34916-boolean-text-read.test.ts, as three[#34973]describes, per the AGENTS.md shared-harness rule.Unchanged
Everything else is as amended: the fourth storage convergence in driver-sql, an in-place deferred-DDL preview, other text withheld and warned, and the record as an info line with
rowsConvertedplus at most 5sampleIds, with no down step.Clause-②: yes (widening:
@objectstack/driver-sqlexportsPendingSchemaWorkKindfrom its index, and the CLI consumes it, so the union gains one published value,normalize_boolean_storage; boolean filters, sorts and groupBy on SQLite now answer legacy text rows as their boolean)Metadata-protocol: none
Governed: NOT governed (0 of 9 paths), 511 changed lines.
Review: L1-d, then seat L2.
objectstack-fleet commentedon Nov 18, 2026
repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX
Delivered · 2026-11-18T03:11Z · PR #35076 merged (23c42c4); its
Closesline closed this card.The premise was wider than filed. The card named a boolean column holding the text
'true'/'false'. Measured (premise 6963386869), on SQLite those rows were wrong for=,!=,$in,$nin, ORDER BY and an aggregate groupBy, and the engine could not address them, not only for the read the card described. On Postgres, MySQL, MSSQL and Oracle the native boolean column cannot hold the text.What shipped (route a, seat ruling 6963450544).
backfillCanonicalBooleansis the fourth driver-sql storage convergence. It is SQLite only. One guardedUPDATEper column rewrites exactly'true'/'false'to1/0, and it is idempotent.'1'/'0'in a TEXT-affinity column is not counted.infoline per column, withrowsConvertedand up to five ids. There is no down step.os migrate planpreviews it asnormalize_boolean_storage, in place, under deferred DDL.OS_SKIP_SCHEMA_SYNC=1skips it.PendingSchemaWorkKindgains a value). driver-sql and cli at patch.Follow-ups (with triage, not this card):
'0'groups astrue, and the datetime and time backfills drop theirinforecord on clients that report nochanges.Reviews: L1-d 6966622908 and 6966877056; seat L2 PASS 6966769750, carried forward by 6967050006.
pm:dispatchedremoved.test(driver-sql): the #34973 groupBy pin's before-half reads the text…