diff --git a/.changeset/platform-objects-import-job-minted-id-width.md b/.changeset/platform-objects-import-job-minted-id-width.md new file mode 100644 index 0000000000..ea18c3b870 --- /dev/null +++ b/.changeset/platform-objects-import-job-minted-id-width.md @@ -0,0 +1,11 @@ +--- +'@objectstack/platform-objects': patch +--- + +`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. + +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`. + +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. + +`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. diff --git a/packages/platform-objects/src/audit/sys-import-job.object.ts b/packages/platform-objects/src/audit/sys-import-job.object.ts index 75930e4af2..73a1e1b43a 100644 --- a/packages/platform-objects/src/audit/sys-import-job.object.ts +++ b/packages/platform-objects/src/audit/sys-import-job.object.ts @@ -106,9 +106,19 @@ export const SysImportJob = ObjectSchema.create({ // - the landed text declarations for the same value class: // `sys_metadata_audit.actor`, `sys_metadata_commit.actor` and // `sys_view_definition.owner` all declare `maxLength: 255`. - // The floor is cleared with room to spare: a minted platform id is 26 - // characters (measured on #11431, where honouring a bound below that made a - // column structurally unable to hold any id at all). + // [#16410] There is no fixed "floor" to clear, because an id has no fixed + // width. `driver-sql` mints `nanoid(DEFAULT_ID_LENGTH)` — a per-driver + // constant — and `driver-memory` mints no fixed width at all, while a + // caller-SUPPLIED id is stored verbatim at whatever width the caller chose, + // so nothing on the write path bounds one. 255 is safe not as headroom over + // some id width but by the referenced-column transitivity derived above: it + // is the width of the column this value is COPIED FROM. Read the width + // claim where it is maintained — `driver-sql`'s `[#15522]` note beside + // `DEFAULT_ID_LENGTH`, measured there against a live driver — never a number + // restated here; a restated number is exactly how this sentence came to + // assert 26. (#11431 is the same trap from the other side: honouring a + // declared bound BELOW what a driver mints makes a column structurally + // unable to hold any id at all.) // 255 is also <= the 768-character utf8mb4 key ceiling, so the // `(created_by, created_at)` index below is expressible on MySQL — which is // the whole point: unbounded, this column was emitted TEXT and MySQL refused