Uh oh!
There was an error while loading. Please reload this page.
fix(spec): MONGODB_MULTI_TENANT_UNSUPPORTED leaves the error-code ledger — a boot refusal never reaches a wire envelope (#8035) - #8239
Conversation
…ger (#8035) The code was registered under @objectstack/driver-mongodb (#3724) but no response envelope can carry it: the CLI boot handler rethrows the tenancy refusal pre-HTTP and aborts, and the one request-reachable trigger (assertObjectsNotTenantScoped via syncObjectSchema inside the metadata protocol's ensureObjectStorage) is swallowed by a documented best-effort catch. Registered-but-unemittable is the class the ledger header names; precedent OVERLAY_PERSISTENCE_FAILED / #5783 — this instance is the sister shape (never had a wire path, rather than lost it), now documented in the header. The boot refusal stays untouched: MULTI_TENANT_UNSUPPORTED_CODE, the error class, its message, and the CLI's duck-typed literal match. A new driver-mongodb test pins the code literal (with the ledger row gone it is the only cross-package guard on the literal serve.ts matches); the ledger test now asserts the wire vocabulary refuses the retired string. Reference docs regenerated (ErrorCode enum 264 -> 263). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0123k4cam2jEAkPmbJeoaY3r
…egister-unemittable-code
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
📓 Docs Drift CheckThis PR changes 1 package(s): 106 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
⛔ 7 release-owned page(s) also reference the affected code. These are read-only:
|
…egister-unemittable-code
os-regen merge lap for landing: merge origin/main (committed first, per scripts/pm/os-regen-merge.sh), then wholesale regen of the os-regen'd references/api pages from the merged tree. Sibling assertions on the regenerated tree: #8230 retirement state (def names only in retirement prose + migration entry), #8232 currency fraction-digit guard, #8234's 13 comparand-door exports in api-surface/data.json, #8236's groupBy union row all survive; MONGODB_MULTI_TENANT_UNSUPPORTED stays absent from the ledger and the references ErrorCode union reads main-minus-one (+265 -> +264; the union grew by 2 on main since the previous lap). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0123k4cam2jEAkPmbJeoaY3r
Uh oh!
There was an error while loading. Please reload this page.
Fixes#8035
ERROR_CODE_LEDGER(ADR-0112 D3) registeredMONGODB_MULTI_TENANT_UNSUPPORTEDunder@objectstack/driver-mongodb(#3724). The finding-grading round on #8035 measured the code as registered-but-unemittable; this PR re-verified both readings on the merged tree before deleting, then unregisters the ledger row only.Premise re-verification (both readings, on this branch's tree)
packages/cli/src/commands/serve.ts:1279rethrows a driver-construction failure one?.code === 'MONGODB_MULTI_TENANT_UNSUPPORTED'intorun()'s fatal handler — the process prints and exits 1 before any HTTP server exists. No envelope.assertObjectsNotTenantScoped(thrown from the driver'ssyncSchema/syncSchemasBatch) reaches request scope only viaengine.syncObjectSchemainsideensureObjectStorage(packages/metadata-protocol/src/protocol.ts:9915-9922), whose catch is a documented "best-effort + non-fatal"console.warn. No envelope.ObjectQLEngine.syncSchemascatches per-object intologger.error([convention] best-effort 降级导致"看起来正常、实则不持久"时不应记 warn——把 #4460 的点状修复定成规则 #4632); the objectql plugin's boot sync catches intoreportSyncFailure;service-datasource's connect path catches intologger.warn; the lifecycle sweep'sarchiveObjectcold-store sync is caught by the per-object handler intoreport.errors+warn(a message string, never a wireerror.code);packages/verifyis CLI tooling. No wire path exists.Consumer check (per the ledger's "Retiring a code" section)
contract.mdx,error-code-ledger.mdx), the driver's guard constant + README +drivers.mdx(all describe the thrown error object, which is unchanged — every sentence stays true), the CLI's duck-typed boot match (a consumer of the thrown object, not of the wire vocabulary — stays), and historical changesets/CHANGELOGs. No wire producer, no wire consumer.objectuiatorigin/main: 0 hits (positive control onVALIDATION_FAILEDconfirms the grep saw the tree).cloud(GitHub org-wide code search): 0 hits outside this repo.ErrorCode/ApiErrorSchema.code).What changed
packages/spec/src/api/error-code-ledger.zod.ts: the@objectstack/driver-mongodbentry (whose only row was this code) is removed. The header's "Retiring a code" section now names the second shape of the class: a row that never had a wire path, as opposed to one that lost its producer (OVERLAY_PERSISTENCE_FAILED/ 删除 saveMetaItem legacy 写入分支后的三处残留:一个无生产者的 ledger 错误码 + 两处已过期的跨包注释 #5783, the precedent this PR mirrors).packages/spec/src/api/error-code-ledger.test.ts: the wire vocabulary's refusal is asserted —ErrorCode.parse('MONGODB_MULTI_TENANT_UNSUPPORTED')throws, the union does not contain the string, and the owner key is gone (a future driver-mongodb wire code re-registers deliberately, with an emit path, not by reverting this PR).packages/drivers/driver-mongodb/src/mongodb-tenancy-guard.test.ts: new pin —MULTI_TENANT_UNSUPPORTED_CODE === 'MONGODB_MULTI_TENANT_UNSUPPORTED'. With the ledger row gone this is the only cross-package guard on the literal the CLI matches duck-typed; a silent rename would un-arm the CLI's loud-fail path and boot the server with no driver (the exact failure driver-mongodb 完全没有行级租户隔离:读不加谓词、写不打戳,多租户下跨租户可读写 #3724 removed). The boot refusal itself — constant, error class, message, CLI match — is untouched, and its existing tests (message names the knobs, the escape route, and every offending object) all still pass.content/docs/references/api/*.mdx: regenerated — the code leaves the two reference pages, and theErrorCodeenum count drops 264 → 263 across the API pages.@objectstack/specpatch — wire impact none (no response ever carried the code; the narrowing is type-level, and there is no emit site to reject), mirroring the 删除 saveMetaItem legacy 写入分支后的三处残留:一个无生产者的 ledger 错误码 + 两处已过期的跨包注释 #5783 precedent's bump. Not a declared-breaking changeset, so no ADR-0087 disposition marker is owed (check-adr-0087-registration --base origin/main: "adds no declared-breaking changeset"); the ADR-0087 conversion registry governs authorable metadata shapes, not the response vocabulary.Verification (all post-merge of
main@fa4897335)@objectstack/spectest: 385 files / 10196 tests passed; typecheck green.@objectstack/driver-mongodbtest: 16 files passed, 5 skipped / 365 tests passed, 143 skipped (skips are the suites needing a live MongoDB binary — pre-existing).@objectstack/resttest: 104 files / 1744 tests passed.check:generated: all 13 artifacts up to date from the merged tree (api-surfaceunchanged — the export set is unchanged, only the union narrows).adr-anchors,changeset-gate-self-tests,cross-package-test-inputs,doc-formula-expressions,docs-audit-scope,i18n(9 bundles in sync),merge-driver,release-body,spec-parsed-alias,nul-bytes,error-code-casing— all pass.Reverse verification (direction predicted before running)
dist.d.ts—const retired: ErrorCode = 'MONGODB_MULTI_TENANT_UNSUPPORTED'fails with TS2322 while the'VALIDATION_FAILED'control compiles; a@ts-expect-errorvariant compiles clean (exactly one absorbed error). Proves the narrowing is in the built declarations, not a cached tree.error-code-ledger.test.ts— the retired string parses again) and nothing else; restoring the committed state returned the file to 9 passed.Generated by Claude Code
Generated by Claude Code