Skip to content

Commit 97adce2

Browse files
claude[bot]claude
andauthored
docs(platform-objects): drop the false minted-id width from sys_import_job's bound derivation (#16953)
The comment justifying `created_by`'s `maxLength: 255` headroom claimed "a minted platform id is 26 characters". Re-measured on this tree by driving the real SqlDriver against SQLite: twelve create() calls supplying no id yield exactly one distinct width, 16, and a caller-supplied id is stored verbatim at whatever width the caller chose (10/17/18/26/40/200 all landed unaltered). The replacement states no new fixed width, because a fixed width is what expired: mint width is driver-owned, and driver-memory mints no fixed width at all. It points instead at driver-sql's [#15522] note beside DEFAULT_ID_LENGTH, where the claim is measured and maintained, and gives the reason 255 is safe without a floor — it is the width of the column this value is copied from. `maxLength: 255` and the derivation above it are unchanged; no accept set, schema arm, index or export moves. Refs #16410. Claude-Session: https://claude.ai/code/session_016N6xmWt5hYm94ffVEwGH8x Co-authored-by: Claude <noreply@anthropic.com>
1 parent b0ce3f7 commit 97adce2

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@objectstack/platform-objects': patch
3+
---
4+
5+
`sys_import_job.created_by`'s bound derivation no longer justifies its headroom with a false width. The comment claimed "a minted platform id is 26 characters"; measured on this tree by driving the real `SqlDriver` against SQLite, twelve `create()` calls supplying no id yield exactly one distinct width, **16** — and a caller-supplied id is stored verbatim at whatever width the caller chose (10, 17, 18, 26, 40 and 200 all landed and read back unaltered), so nothing on the write path bounds an id's width at all.
6+
7+
This is a published byte, not an internal note: `@objectstack/platform-objects` ships no `src/` in its `files[]`, but the comment survives bundling and appears verbatim in four shipped artefacts — `dist/index.js`, `dist/index.mjs`, `dist/audit/index.js` and `dist/audit/index.mjs`.
8+
9+
The correction does **not** restate a new number, because a number is what expires: a mint width is driver-owned (`driver-sql`, `driver-mongodb` and `driver-turso` each spell their own `DEFAULT_ID_LENGTH`, and `driver-memory` mints a variable-width shape that is not one at all), so the comment now points at `driver-sql`'s `[#15522]` note beside that constant — where the claim is measured and maintained — and states the reason `255` is safe without appealing to a floor: it is the width of the column this value is copied from, which is the referenced-column transitivity the block already derives.
10+
11+
`maxLength: 255` is unchanged, the derivation above it is unchanged, and no accept set, schema arm, index or export moves. `DEFAULT_ID_LENGTH` is untouched.

‎packages/platform-objects/src/audit/sys-import-job.object.ts‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,19 @@ export const SysImportJob = ObjectSchema.create({
106106
// - the landed text declarations for the same value class:
107107
// `sys_metadata_audit.actor`, `sys_metadata_commit.actor` and
108108
// `sys_view_definition.owner` all declare `maxLength: 255`.
109-
// The floor is cleared with room to spare: a minted platform id is 26
110-
// characters (measured on #11431, where honouring a bound below that made a
111-
// column structurally unable to hold any id at all).
109+
// [#16410] There is no fixed "floor" to clear, because an id has no fixed
110+
// width. `driver-sql` mints `nanoid(DEFAULT_ID_LENGTH)` — a per-driver
111+
// constant — and `driver-memory` mints no fixed width at all, while a
112+
// caller-SUPPLIED id is stored verbatim at whatever width the caller chose,
113+
// so nothing on the write path bounds one. 255 is safe not as headroom over
114+
// some id width but by the referenced-column transitivity derived above: it
115+
// is the width of the column this value is COPIED FROM. Read the width
116+
// claim where it is maintained — `driver-sql`'s `[#15522]` note beside
117+
// `DEFAULT_ID_LENGTH`, measured there against a live driver — never a number
118+
// restated here; a restated number is exactly how this sentence came to
119+
// assert 26. (#11431 is the same trap from the other side: honouring a
120+
// declared bound BELOW what a driver mints makes a column structurally
121+
// unable to hold any id at all.)
112122
// 255 is also <= the 768-character utf8mb4 key ceiling, so the
113123
// `(created_by, created_at)` index below is expressible on MySQL — which is
114124
// the whole point: unbounded, this column was emitted TEXT and MySQL refused

0 commit comments

Comments
 (0)