You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bc0538a
Browse filesBrowse the repository at this point in the historyBrowse files
feat(spec)!: retire the datasource driver spelling mongo — refused naming mongodb, its D2 conversion leaves the load path (F1 of #23543) (#23600)
Part of #23543
Clause-②: yes
This PR lands family **F1** of ruling `6182001882` only. F5-jsx, F3, F2,
F4 and F5-http stay on #23543 and follow one PR each, in the ruled
order.
## What
Ruling F1 A: `'mongo'` retires as a `datasource.driver` value, refused
with the prescription naming `mongodb`; stored rows are rewritten by the
D3 chain; `datasource-driver-mongo-to-mongodb` sets
`retiredFromLoadPath`.
- **Authoring refusal.** `DriverType`
(`packages/spec/src/data/datasource.zod.ts`) refuses `mongo` by name,
case- and whitespace-insensitive. The message is the prescription:
"Datasource `driver: 'mongo'` was removed in @objectstack/spec 18
(ADR-0087 D2) … Use `driver: 'mongodb'`." It ends with the house `os
migrate meta --from 16` sentence. At `defineStack` this is
`STACK_SCHEMA_INVALID` / 422 with one issue at `datasources.0.driver`.
- **Where the spelling is declared.** A new `retiredAliases` column on
the driver vocabulary row
(`packages/spec/src/data/driver/config-registry.zod.ts`): `{ id:
'mongodb', aliases: ['mongodb'], retiredAliases: { mongo: PRESCRIPTION }
}`. The refusal is derived from that column (exported as
`RETIRED_DRIVER_ID_GUIDANCE`), so the table remains the one vocabulary.
- **Selection face.** `mongo` is no longer a boot selection. Both hosts
refuse `OS_DATABASE_DRIVER=mongo` alike, and their "Supported drivers"
list names `mongodb`. The cross-host parity pin is flipped to say so.
- **The D2 entry.** `datasource-driver-mongo-to-mongodb` gets
`retiredFromLoadPath: true` and `retiredAfter: '17.7.0'` (the newest
published stable release under the `18.0.0-next` label, the same stamp
PR #23523 used). It is already a member of step 17's `conversionIds`, so
`os migrate meta --from 16` and every `includeRetired` seam keep
replaying it.
- **The D3 entry.** `18.datasource-driver-mongo-alias-retired` is the
family's semantic entry, with `conversionIds:
['datasource-driver-mongo-to-mongodb']`. It names what the chain cannot
reach: `OS_DATABASE_DRIVER`, a standalone stack's `databaseDriver`, and
REST callers.
- **The verdict-list pin** in `conversions.test.ts` moves the entry from
the kept list to the retired list, and the entry's `describe` block is
rewritten for the new semantics. The entry also has a row in the
removal-version pin's `JOIN`.
## Mechanism assumptions, measured
1. **"Retire = delete the alias" is false as stated.** I deleted
`'mongo'` from the row outright, ran the suites, and probed. Measured on
`fa6a6085c`:
- **Credential leak (security).** The read-path credential redactor
judges a stored body as written (`redactStoredMetadataBody`). It keys
mongodb's passthrough-secret table by canonical id. With the alias gone,
a raw stored legacy `driver: 'mongo'` row served all ten passthrough
secrets in cleartext: `options.proxyPassword`, `options.key`,
`options.passphrase`, `options.tlsCertificateKeyFilePassword`,
`AWS_SESSION_TOKEN` and the five KMS secrets.
- **Four pins went red.** These were `stored.test.ts` (a stored mongo
row's `uri`/`user` were no longer renamed), the key-alias conversion's
"row whose driver id is itself being renamed" case,
`refusedPassthroughSecretPaths('mongo')`, and the "unconverted row keeps
its contract" case.
- **What I did instead.** The spelling leaves the selection face and the
authoring surface, and it stays on the CONTRACT face only
(`resolveDriverId('mongo')` still answers `mongodb`). This is the same
posture the retired in-memory engine's spellings have.
- **Why the D2 order is untouched.** The
`datasource-config-driver-key-aliases` conversion still reaches a stored
mongo row through the contract face, so the order of the step-17 list
does not change.
2. **There was no existing value-retirement mechanism for this field.**
`driver` is an open namespace (`z.string()`), so `enumWithRetiredValues`
cannot carry it. The refusal reuses that helper's prescription type
(`RetiredValueGuidance`) and its writing conventions. It is spelled as a
`pattern` (`^(?!\s*[Mm][Oo][Nn][Gg][Oo]\s*$)`), not a refinement. My
first spelling was a refinement, and the build's dropped-refinement gate
refused it. A `pattern` survives the JSON Schema projection, so a
document validated against the published `json-schema/**` is refused
too. `config-registry.test.ts` pins that projection.
3. **`packages/cli/src/utils/config.ts:621` and `:654`.** Both docblocks
used `driver: 'mongo'` as the example of "a conversion the load still
applies". They now say the defect was measured on that spelling, which
has since retired.
4. **`conversions.test.ts`.** Done as the assumption said. The verdict
list now keeps 7 entries, and the retired list asserts this one with
`retiredAfter: '17.7.0'`.
## Pin sweep (whole repo, `'mongo'` / `"mongo"` and the conversion id)
- **Flipped to the new semantics:**
- `config-registry.test.ts`: the selection face loses `mongo`. A new
describe covers the authoring refusal (code `invalid_format`, path
`driver`, message first sentence), the config gate still running behind
it, selection withdrawn, contract kept, no false refusals (`mongodb`,
`com.vendor.mongolike`, prototype words), the JSON Schema `pattern`, and
the retired spelling being no live spelling.
- `conversions.test.ts`, as above. Its new defineStack case asserts
`STACK_SCHEMA_INVALID` / 422, the path, and the prescription's first
sentence.
- `driver-vocabulary-parity.test.ts` (cli): both hosts refuse `mongo`,
each naming `mongodb`.
- **Re-pointed.** These suites need a spelling the load still converts,
which `mongo` no longer is:
- `stack-authored-input.test.ts` (spec);
- `migrate-meta-load-conversions.test.ts`,
`migrate-meta-composed-load-conversions.test.ts`, and the load-path case
of `migrate-meta-composed.test.ts` (cli).
- They now carry a flow-level `errorHandling.retryDelayMs`.
`retry-policy-converged` renames it at load, and it is a step-17 member,
so `--from 16` lists it.
- **Fixture spelling only:** two `datasource.test.ts` fixtures now write
`mongodb`. Their refusal assertions are unchanged.
- **Unchanged on purpose:**
- `migrate-meta-write.test.ts` and `migrate-meta-protocol-range.test.ts`
still write `driver: 'mongo'` as a refused spelling the chain rewrites,
which is still true.
- The redaction, credential-refusal, pool-support, factory and
admin-restore tests still pass `mongo` as a stored legacy row, which the
contract face keeps judging as mongodb.
- **Docs and comments that became false:**
- `content/docs/data-modeling/drivers.mdx`, plus a short paragraph on
the retirement;
- `packages/drivers/driver-mongodb/README.md`, which is published, hence
the `patch` changeset row;
- the `liveness/datasource.json` note;
- comments in `driver-catalog.ts`, `mongo.zod.ts` and `mongo.test.ts`.
## Changeset
`.changeset/23543-f1-retire-mongo-driver-alias.md`: `@objectstack/spec`
minor and `@objectstack/driver-mongodb` patch. It is BREAKING, carries
`Clause-②: yes (narrowing)` as ruling item 7 spells it, gives the FROM →
TO migration for all three places the spelling lives, and registers
`datasource-driver-mongo-alias-retired` as its ADR-0087 disposition.
`check-adr-0087-registration --base origin/main` exits 0 and reads it as
`BREAKING+bang+clause-②-narrowing`, `registered`.
## Verification (head `acf0e6c1f`, after merging `origin/main`
`32e03d2fd`)
- `@objectstack/spec`:
- `test`: 678 files / 20738 tests passed.
- `typecheck` (tsc, scripts, test layer): exit 0.
- `test:repo`: 61 / 1033 passed.
- `check:generated`: all 14 artifacts up to date;
`api-surface/data.json` and `export-origins/data.json` were regenerated
for the one new export.
- `@objectstack/cli` (unit tier), the six files the change touches or
pins: 6 / 113 passed. The full unit tier and typecheck readings are in
the report comment on the card.
- Readings for `@objectstack/runtime` and
`@objectstack/service-datasource` are in the report.
- No `packages/drivers/driver-*` source reads a `datasource.driver`
value (zero hits for the resolvers, `DatasourceSchema` or `DriverType`
in `src`), so no driver suite is owed beyond CI.
- Gate families: `dispatch-gates.mjs --commands` derived 117 commands,
run one by one with exit codes captured before any pipe and reconciled
with `--ran`. Verdicts are in the report.
## Acceptance notes
- **The `mongo` refusal at the boot hosts.** It is the hosts' existing
"Supported drivers" refusal, which lists `mongodb`. It is not a
dedicated prescription sentence like the retired in-memory engine's.
`RETIRED_DRIVER_ID_GUIDANCE` is exported if a host should name it later.
- **Load-path suites (for F3 and F2).** After this PR, the conversions
that are still on the load path and that `os migrate meta --from 16`
replays are `retry-policy-converged` and F3's two config lifts. Once F3
and F2 land, the three cli load-path suites and
`stack-authored-input.test.ts` have no real subject left. They will need
a synthetic probe, or the suites retired, in whichever of those PRs
lands last.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01LFqdRsuM5nkqoJdHd5ztVk)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
feat(spec)!: the datasource driver spelling `mongo` is retired — an authored `driver: 'mongo'` is refused with the prescription naming `mongodb`, `OS_DATABASE_DRIVER=mongo` is no longer a driver selection, and `datasource-driver-mongo-to-mongodb` leaves the load path
7
+
8
+
Clause-②: yes (narrowing)
9
+
10
+
**BREAKING (authoring):** `mongo` was a second accepted spelling of the MongoDB driver id `mongodb` through 17: the loader rewrote an authored `datasource.driver: 'mongo'` to `mongodb` with a notice, and both boot hosts accepted `OS_DATABASE_DRIVER=mongo`. At 18 it is retired. `DriverType` refuses it by name at every door that parses a datasource (`defineStack`, `os validate`, `os build`, `os lint`, the metadata and datasource APIs): "Datasource `driver: 'mongo'` was removed in @objectstack/spec 18 (ADR-0087 D2) … Use `driver: 'mongodb'`." The refusal is case- and whitespace-insensitive, and it is published in the JSON Schema too (a `pattern` on `driver`), so a document validated against `json-schema/**` is refused as well. Both boot hosts now refuse `OS_DATABASE_DRIVER=mongo` (and a standalone stack's `databaseDriver: 'mongo'`) with their "Supported drivers" list, which names `mongodb`. The ADR-0087 D2 conversion `datasource-driver-mongo-to-mongodb` is retired from the load path (`retiredAfter: '17.7.0'`), so the authoring funnel no longer rewrites the spelling.
11
+
12
+
Migration:
13
+
14
+
-`datasource.driver: 'mongo'` → `driver: 'mongodb'`. Change the value; the driver it builds and the `config` contract it is judged against are unchanged.
15
+
-`OS_DATABASE_DRIVER=mongo` → `OS_DATABASE_DRIVER=mongodb`, or unset it and let a `mongodb://` or `mongodb+srv://` database URL select the driver. The same for `databaseDriver: 'mongo'` passed to the standalone stack.
16
+
- A script or integration that creates or updates a datasource through the metadata or datasource REST API with `driver: 'mongo'` → send `driver: 'mongodb'`.
17
+
18
+
Run `os migrate meta --from 16` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. The D3 entry `datasource-driver-mongo-alias-retired` lists what the chain cannot reach: environment variables, launch scripts and API callers.
19
+
20
+
Stored metadata needs no edit. Every stored-row rehydration seam replays the retired conversion, so a `sys_metadata` datasource row written as `mongo` (the Setup → Datasources form wrote that until the canonical id was renamed to `mongodb`) keeps loading as `mongodb`. The spelling also stays on the spec's driver CONTRACT face (`resolveDriverId('mongo')` still answers `mongodb`): a reader that judges a stored body as written, such as the read-path credential redactor, keeps judging a legacy row as mongodb. Measured with the spelling deleted outright, that redactor served all ten mongodb passthrough secrets of such a row in cleartext.
21
+
22
+
`@objectstack/spec` also exports `RETIRED_DRIVER_ID_GUIDANCE` (retired spelling → its prescription), the table the refusal is derived from. `@objectstack/driver-mongodb`'s README no longer lists `mongo` as a recognised `OS_DATABASE_DRIVER` value.
Copy file name to clipboardExpand all lines: content/docs/data-modeling/drivers.mdx
+12-7Lines changed: 12 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,7 @@ libSQL data stayed untouched. Pass the token with `--database-auth-token`
77
77
|**MySQL**|`@objectstack/driver-sql` (peer: `mysql2`) |`SqlDriver`|`mysql`\|`mysql2` (supported, with three dialect caveats — see [below](#mysql-dialect-caveats)) |
0 commit comments