Commit 053c8bb
feat(objectql): opt-in sys_metadata hydration for isolated project kernels
Boot Phase-2 hydration (restoreMetadataFromDb → loadMetaFromDb, which
registers objects WITH their fields into the SchemaRegistry) is gated on
`environmentId === undefined`. That gate assumes every project kernel sources
metadata from a remote artifact / control-plane proxy and has no local
sys_metadata. It's untrue for an isolated, proxy-free project kernel that
persists its OWN sys_metadata locally (the cloud single-env tenant runtime on
Turso): objects CREATED AT RUNTIME there — absent from the boot artifact
manifest — never re-enter the registry after a restart, so
`registry.getObject(name)` returns nothing for them and every registry
consumer silently degrades (notably the engine.find unknown-$select guard,
which then lets an unknown projected column zero the result set).
Add an explicit `hydrateMetadataFromDb` plugin option (default false, so the
control-plane/proxy path is untouched). When set, hydration runs even with
`environmentId` defined. Safe because each engine owns its registry instance
(no cross-kernel leakage — the historical process-wide singleton is gone, see
engine.ts:274) and loadMetaFromDb already tolerates a missing table. The cloud
artifact-kernel-factory — proxy-free, local sys_metadata, isolated registry —
opts in.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent c1dfe34 commit 053c8bb
2 files changed
Lines changed: 117 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
939 | 939 | | |
940 | 940 | | |
941 | 941 | | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
942 | 1022 | | |
943 | 1023 | | |
944 | 1024 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
78 | 100 | | |
79 | 101 | | |
80 | 102 | | |
| |||
92 | 114 | | |
93 | 115 | | |
94 | 116 | | |
| 117 | + | |
95 | 118 | | |
96 | 119 | | |
97 | 120 | | |
| |||
116 | 139 | | |
117 | 140 | | |
118 | 141 | | |
| 142 | + | |
119 | 143 | | |
120 | 144 | | |
121 | 145 | | |
| |||
313 | 337 | | |
314 | 338 | | |
315 | 339 | | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
321 | 353 | | |
322 | 354 | | |
323 | 355 | | |
| |||
0 commit comments