Commit 5dee191
`generate.ts` carried three hand-authored field-type vocabularies — the
`FIELD_TYPE_MAP` that `os generate types` reads, the `FIELD_TYPE_SQL_MAP` that
`os generate migration --format sql` reads, and the `switch (fType)` in the
typescript migration generator — none of which had ever been checked against the
`FieldType` enum they claim to describe. Between them they named six types the
platform has never had: `slug`, `ip_address`, `encrypted`, `integer`, `uuid`,
and `geo_point`.
Measured, not assumed. `git log -S` over the whole reachable history of
`packages/spec/src/data/field.zod.ts` returns zero commits for every one of those
tokens, so they are not leftovers of retired types — they were invented here (the
maps first, the migration codegen mirroring them six hours later) and propagated
table to table inside this one file.
Both doors into the generator were driven:
- Through every supported authoring path the arms are dead. `os init` scaffolds
`export default defineStack({ … })`, `define*` is a strict `Schema.parse`,
and a field typed `slug` is refused during config-module evaluation, inside
`bundleRequire`, before the generator runs a line.
- Through a config that parses nothing (a plain-object default export, or
`defineStack(x, { strict: false })`) any string reaches `fType` and the ghost
arms fire — `slug` emitted `table.string`, `integer` emitted `table.integer`.
So the labels never served a valid input, and on the one input class that could
reach them they advertised an acceptance surface no runtime can honour.
Every ghost is deleted rather than re-spelled, per member: `number` already had
its own entry and arm so `integer` had nothing to correct to; `address` is a
structured postal address, not an IP; and the concepts that later arrived under
other names (`secret`, `location`) have no entry in these tables at all, which is
a coverage question rather than a spelling one and is filed separately.
Behaviour is unchanged for every config the platform accepts. For a config that
bypasses validation, one of the six now falls to the same default any unknown
type gets — `table.text` / `TEXT` / `unknown`.
The pin reads all three vocabularies out of the source and fails on any key or
case label that is not a `FieldType` member, with a non-vacuity control on each
extraction and a structural assertion that a fourth vocabulary cannot arrive
unmeasured. It is forward-only: real members with no entry still fall to the
deliberate default, which it does not prejudge.
Claude-Session: https://claude.ai/code/session_016yfqQh2dBgPAymYd7xipza
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3c1bbd2 commit 5dee191
3 files changed
Lines changed: 224 additions & 16 deletions
File tree
- .changeset
- packages/cli/src/commands
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
Lines changed: 150 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
455 | 471 | | |
456 | 472 | | |
457 | 473 | | |
458 | 474 | | |
459 | 475 | | |
460 | 476 | | |
461 | 477 | | |
462 | | - | |
463 | 478 | | |
464 | 479 | | |
465 | 480 | | |
| |||
479 | 494 | | |
480 | 495 | | |
481 | 496 | | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | 497 | | |
486 | 498 | | |
487 | | - | |
488 | 499 | | |
489 | | - | |
490 | 500 | | |
491 | 501 | | |
492 | 502 | | |
| |||
860 | 870 | | |
861 | 871 | | |
862 | 872 | | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
863 | 880 | | |
864 | 881 | | |
865 | 882 | | |
866 | 883 | | |
867 | 884 | | |
868 | 885 | | |
869 | 886 | | |
870 | | - | |
871 | 887 | | |
872 | 888 | | |
873 | 889 | | |
| |||
887 | 903 | | |
888 | 904 | | |
889 | 905 | | |
890 | | - | |
891 | | - | |
892 | | - | |
893 | 906 | | |
894 | 907 | | |
895 | | - | |
896 | 908 | | |
897 | | - | |
898 | 909 | | |
899 | 910 | | |
900 | 911 | | |
| |||
991 | 1002 | | |
992 | 1003 | | |
993 | 1004 | | |
994 | | - | |
| 1005 | + | |
995 | 1006 | | |
996 | 1007 | | |
997 | 1008 | | |
998 | | - | |
| 1009 | + | |
999 | 1010 | | |
1000 | 1011 | | |
1001 | 1012 | | |
1002 | 1013 | | |
1003 | 1014 | | |
1004 | | - | |
| 1015 | + | |
1005 | 1016 | | |
1006 | 1017 | | |
1007 | 1018 | | |
| |||
1019 | 1030 | | |
1020 | 1031 | | |
1021 | 1032 | | |
1022 | | - | |
| 1033 | + | |
1023 | 1034 | | |
1024 | 1035 | | |
1025 | 1036 | | |
| |||
0 commit comments