|
| 1 | +--- |
| 2 | +"@objectstack/runtime": minor |
| 3 | +"@objectstack/service-datasource": minor |
| 4 | +"@objectstack/verify": patch |
| 5 | +--- |
| 6 | + |
| 7 | +feat(runtime,datasource): the default-datasource connect seam accepts a host driver factory — adopt pre-built instances without forking the verdict (#3826) |
| 8 | + |
| 9 | +ADR-0062 D1's open-core convergence (#3869/#3886) left one structural question |
| 10 | +open: a host whose `default` needs a driver the shared factory cannot build — |
| 11 | +the cloud distribution's `turso`, or an instance pooled BEYOND one kernel (the |
| 12 | +cloud control-plane driver doubles as the proxy base of every environment |
| 13 | +kernel; per-environment drivers are cached across kernel rebuilds) — had only |
| 14 | +two options, both bad: stay on the legacy pre-built `DriverPlugin` path, whose |
| 15 | +connect verdict lives in `ObjectQLEngine.init()` (the second implementation |
| 16 | +#3826 exists to retire), or fork the connect orchestration. Either re-opens the |
| 17 | +#3741 → #3758 drift this whole line of work is about. |
| 18 | + |
| 19 | +Two additive pieces close it: |
| 20 | + |
| 21 | +- **`DefaultDatasourcePlugin` accepts an injected `IDatasourceDriverFactory`** |
| 22 | + (defaults to the shared open-core factory, byte-for-byte unchanged when |
| 23 | + omitted). The factory only changes what `create()` returns — the policy-free |
| 24 | + init connect, `bootCritical` fail-fast, `OS_ALLOW_DRIVER_CONNECT_FAILURE` |
| 25 | + escape hatch, and the start() replay into retained admin state are identical |
| 26 | + either way, and the new tests pin that (an adopted instance that cannot |
| 27 | + connect takes the exact same verdict). |
| 28 | +- **`createPrebuiltDriverFactory(driver, { driverId?, fallback? })`** in |
| 29 | + `@objectstack/service-datasource` — the "adopt an existing driver" seam the |
| 30 | + first #3826 pass found missing, landed AS a factory so it composes into the |
| 31 | + one connect path instead of becoming a second entry point. `create()` returns |
| 32 | + the SAME instance every call: construction, pooling, and reuse stay host |
| 33 | + concerns; only the verdict converges. Not for the common case — a `default` |
| 34 | + expressible as `{ driver, config }` should stay a plain definition. |
| 35 | + |
| 36 | +The `@objectstack/verify` dogfood harness now boots through |
| 37 | +`DefaultDatasourcePlugin` (declared `sqlite-wasm` definition) instead of a |
| 38 | +pre-built `DriverPlugin` — so the dogfood gate exercises the same declared |
| 39 | +-default connect path `objectstack dev`/`serve` use, which is the §Risk |
| 40 | +mitigation ADR-0062 promised ("behind the dogfood gate") and did not yet have. |
| 41 | +The degraded-boot parity guard stays: `ObjectQLEngine.init()`'s verdict is |
| 42 | +still live for the boot re-verification, `DriverPlugin` escape-hatch drivers, |
| 43 | +and the cloud compositions until they converge onto this seam. |
0 commit comments