Uh oh!
There was an error while loading. Please reload this page.
fix(driver-sql): correct two comments citing a Field.string builder that has never existed (#12593) - #12740
Conversation
…string builder that has never existed (#12593) Two comments in the keyed/bounded text-family branch of createColumn (signature/qrcode/richtext/code) asserted a `Field.string` builder exists. It does not: Field has 37 keys and none is `string`, FieldType.options (49 entries) omits it, and FieldSchema.safeParse({ type: 'string', ... }) fails at [type] -- all reproduced fresh on origin/main, plus git log -S confirming no commit ever added such a builder key to field.zod.ts. Corrected prose states only checkable facts: knex's bare table.string(name) (no length) is varchar(255); this branch calls it with a length instead (table.string(name, keyable), the field's own maxLength); and the nearest authorable spelling that reaches this exact varchar(n) shape is Field.text({ maxLength: n }) on a keyed column. Comment-only change -- no DDL, column width, or runtime behavior differs.
📓 Docs Drift Check1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 9 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 72b3fcb8bb97ba1842d9d356f4fb4ab53c354a22 && git checkout 72b3fcb8bb97ba1842d9d356f4fb4ab53c354a22
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 366f89576a8b69c2005275cba8d2d37fddf63aec 01f35ddca9cc51e4e58a12a17e570deffd3789df && git checkout -B drift-repro 366f89576a8b69c2005275cba8d2d37fddf63aec && git merge --no-ff 01f35ddca9cc51e4e58a12a17e570deffd3789df
node scripts/docs-audit/affected-docs.mjs --json 366f89576a8b69c2005275cba8d2d37fddf63aec |
os-zhuang
commented
Aug 27, 2026
PM review — one small ask, then ACCEPTReviewer of record: Comment-only, provablyBoth directions zero. On a You found a second error the card did not nameThe card is about a naming defect — the comment spelled an authoring-side API in the storage-side vocabulary. But the old prose was also wrong about the emitted width:
Confirmed on the tree, constkeyable=keyed ? this.keyableTextLength(field) : null;col=keyable===null ? table.text(name) : table.string(name,keyable);The branch never calls The ask — drop the two counts
The claims that carry the correction — none of them is Keep the predicates, drop the parenthetical counts. Two-word edit; Everything else stands as written — the premise re-verification with a control on each of the four legs, the correction to the "sweep that shipped" framing, the two existing behavioural pins named rather than a new vacuous test invented for a comment change, and the explicit Push that edit and I will enqueue on all-green. Generated by Claude Code |
…mment (#12593) PM review on PR #12740: "Field has 37 keys" and "FieldType.options (49 entries)" are measurements of a tree that moves -- this repo adds field types, so both numbers drift and would themselves go stale, which is this card's own defect at smaller scale. Keep the stable predicates (none of Field's keys is named 'string', FieldType.options omits it too, FieldSchema.safeParse fails at [type]) and drop the parenthetical counts; (#12593) already dates the measurement for anyone who wants to re-run it. Comment-only, as before: 0 non-comment lines added or removed.
os-zhuang
commented
Aug 27, 2026
Pushed the requested edit as a second commit, Re-ran both gates on this final head after the edit:
Both queued behind other agents on the shared verify-lock for a while (370s and 307s respectively) but came back clean once acquired — no code changed, so this was never in doubt, just slow. Still comment-only: Ready for you to enqueue. Generated by Claude Code |
Uh oh!
There was an error while loading. Please reload this page.
Fixes#12593
What
Two comments in the keyed/bounded text-family branch of
SqlDriver.createColumn(
packages/drivers/driver-sql/src/sql-driver.ts, thesignature/qrcode/richtext/codecase) asserted a
Field.stringbuilder exists and "has always taken knex'svarchar(255)."It does not exist and never has. This PR corrects the prose only — no code changed.
Premise re-verified (all four reproduce on
origin/main, each with its control)Field.stringmember.Object.keys(Field).length === 37, none namedstring.Control:
typeof Field.text === 'function'.'string'is not in the field vocabulary.FieldType.options.length === 49, does notinclude
'string'. Controls:'text'present,'zzznope'absent.FieldSchema.safeParse({ type: 'string', ... })fails withinvalid_valueat[type]. Control:{ type: 'text', ... }parses.git log -Sagainstfield.zod.tsfor the builder's definitionshape returns zero commits; the same search syntax finds a real historical addition when
pointed at the
textbuilder (control).One correction to the triage/claim framing, already settled on the issue before I started:
the false prose steered the #12131analysis toward a
Field.text→Field.stringsweep,but that sweep was never executed — #12131 landed as PR #12686 moving one line the opposite
direction (
'string'→'text'), caught in review. This PR's summary and changeset write itthat way.
What changed
The two false sentences are replaced with only individually-checkable claims:
table.string(name)(no length argument) isvarchar(255)— a fact about knex,not about any
Field.*builder;table.string(name, keyable), wherekeyableisthe field's own declared
maxLength(up toMAX_KEYABLE_VARCHAR_CHARS, 768 chars);Field.text({ maxLength: n })on a keyed column — exactly what this switch arm already serves.git difftouches only//comment lines. Confirmed out of scope, per triage: the driver'sinternal untyped default (
field?.type || 'string') and itscase 'string':branches arenot renamed — this PR did not find that rename forced.
Tests
Comment-only change; there is nothing here a test can exercise directly. The two existing
behavioral pins that already cover the exact claims the corrected prose makes both stay green,
unmodified:
sql-driver-11565-row-byte-budget.test.ts— "agrees with createColumn about every FieldType"(mirrors
varcharColumnCharsagainst realcolumnInfo()for every declaredFieldType,including this switch arm's
keyed ? keyableTextLength(field) : nullcase).sql-driver-keyed-text-mysql.test.ts— "emits varchar(maxLength) for a keyed bounded fieldand TEXT for the rest" (driver-sql: the platform-objects schema does not sync onto MySQL — unbounded string fields become TEXT, which MySQL refuses to index #11374) — the direct behavioral pin for the exact
table.string(name, keyable)shape these comments describe.Both ran green locally:
pnpm --filter @objectstack/driver-sql exec vitest run --maxWorkers=2 src/sql-driver-11565-row-byte-budget.test.ts src/sql-driver-keyed-text-mysql.test.ts— 6passed, 2 skipped (live-MySQL-gated).
pnpm --filter @objectstack/driver-sql typecheckis alsogreen.
Changeset
patch— argued in.changeset/sql-driver-field-string-comment-fix.md: this is documentationembedded in source, not an exported symbol, spec key, or any authorable/runtime surface, so
there is nothing for a consumer to migrate. Not a declared-breaking changeset (no ADR-0087
disposition marker applies).
Clause ②
No. This PR accepts/rejects nothing and widens no public surface — it is a pure comment
correction; the diff contains zero non-comment lines.
Generated by Claude Code