Commit 20a6d6a
fix(metadata): provision sys_metadata_commit for env kernels (ADR-0067)
Per-project (cloud) env kernels boot MetadataPlugin with
registerSystemObjects:true, registering `queryableMetadataObjects` so
ObjectQL boot-sync provisions their physical tables. The ADR-0067 commit
log `sys_metadata_commit` was missing from that list — it lived only in
ObjectQLPlugin's standalone `environmentId === undefined` path — so env
DBs never got the table. Every AI build/apply calls publishPackageDrafts,
which writes a commit row (op='apply'), hitting a hard
`SqliteError: no such table: sys_metadata_commit` on the first build. The
write is best-effort so the build still landed, but the error spammed
logs and the commit timeline silently recorded nothing.
Add SysMetadataCommitObject next to its sys_metadata_history sibling in
queryableMetadataObjects so env kernels provision it at boot. Same class
as the audit/messaging lazy-table provisioning fix.
Verified before/after on a kernel booted with the env-kernel plugin
triple (DriverPlugin('cloud') + ObjectQLPlugin(skipSchemaSync:false) +
MetadataPlugin(registerSystemObjects:true)) over real SQLite: boot-sync
goes 4 -> 5 objects and the writer's insert succeeds; without the change
the exact reported error reproduces. Unit test in plugin.test.ts fails
without the fix, passes with it.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent a6f0b7f commit 20a6d6a
2 files changed
Lines changed: 70 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
31 | 42 | | |
32 | 43 | | |
33 | 44 | | |
| 45 | + | |
| 46 | + | |
34 | 47 | | |
35 | 48 | | |
36 | 49 | | |
| |||
0 commit comments