Repository navigation
fix(verify)!: run a managed mongodb datasource on verify's in-memory stand-in, refuse a managed plugin-driver datasource - #36171
Conversation
…river datasource (wip) Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
…gin-driver refusal Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
…rify-memory-stand-in
📓 Docs Drift CheckThis PR changes 1 package(s): 8 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 8 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin b6948298a830370743585e0f3c1ebd456a5e1ce2 && git checkout b6948298a830370743585e0f3c1ebd456a5e1ce2
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4ab2c82335aae508686f2206a85442d2287d6d13 205d953c4e68400e3002f9b1693e20a0fc6d8a5f && git checkout -B drift-repro 4ab2c82335aae508686f2206a85442d2287d6d13 && git merge --no-ff 205d953c4e68400e3002f9b1693e20a0fc6d8a5f
node scripts/docs-audit/affected-docs.mjs --json 4ab2c82335aae508686f2206a85442d2287d6d13
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D Final green head for L1: |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd 席位核对 — ACCEPT · head 6c19659
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D Contract reviewServed-tier: PR #36171, card #35640, ruling 7065449898 (C+A). Inputs: the card body and its 10 comments, the PR body and file list (8 files), the net diff against merge base Gate verdicts (check-runs on the head): 55 runs, 40 success, 15 skipped, 0 failed, 0 pending. Success includes Test Core and its 10 shards, TypeScript Type Check, Lint & Repo Gates and every lint lane, Build Core, Check Changeset, Dogfood Regression Gate, Governed Surface Queue Guard, Spec property liveness, PR-body guards. Skipped are the UI lanes, the opt-in lanes, Temporal Conformance, the queue-verdict lanes and ① Derived judgments
② Semver level
Clause-②: no (narrowing) — matches. Nothing a metadata author can write is added, removed or refused by the spec, so ③ Boundary flags
④ Design judgmentThe narrowing against the published spec on Tried to break it:
Checked and found sound: the refusal precedes every side effect and releases the claim; No must-fix. One should-fix (S1), three nits (N1, N2, N3). Implemented-by: VERDICT: PASS |
…urce's name; reword the driver-id refusal (wip) Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D Final green head after rework round 1: |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd 席位核对 — ACCEPT (delta) · head a81e777Delta read only:
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D Contract reviewServed-tier: DELTA record, round 1. PR #36171, card #35640, ruling 7065449898 (C+A). It follows the round-0 record 7067086844 (PASS on Gate verdicts (check-runs on the head): 59 runs, 42 success, 17 skipped, 0 failed, 0 pending. Success includes Test Core and its 10 shards, TypeScript Type Check, Lint & Repo Gates and every lint lane, Build Core, Build Docs, Check Changeset, Check Documentation Links, Dogfood Regression Gate, Governed Surface Queue Guard, Spec property liveness, PR-body guards. Skipped are the UI lanes, the opt-in lanes, Temporal Conformance, the queue-verdict lanes and Dogfood Verify CLI. Nothing was re-run here. ① Derived judgments
② Semver level
Clause-②: no (narrowing) — matches. The second refusal is also a boot that ran and now refuses, with no spec, key or export change, so ③ Boundary flags
④ Design judgmentS1: closed. For the shape it named (a plugin registering N1: closed. The sentence no longer asserts a plugin as the cause, and a missing driver is printed as Tried to break the guard:
Checked and found sound: a plugin that registers in No must-fix. One should-fix (S2), two nits (N4, N5). S1: closed. N1: closed. N2, N3: untouched by the delta. Implemented-by: VERDICT: PASS |
…tasource and a drivers-ready registration Both pins are red on a81e777: the boot runs, and the recording driver receives connect, schema sync, the seed's bulkCreate and updateMany. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D
… at registerDriver The guard's start() now matches each driver.* service's own name as well as its key, and then wraps the engine's registerDriver so any driver registered later under a managed datasource's name that verify's factory did not build is refused before the engine holds it. The factory records each stand-in in a ledger the guard reads. bootStack rethrows the guard's own sentence instead of the kernel's rollback message. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D Final green head after rework round 2: |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd 席位核对 — ACCEPT (delta) · head 26abb3eDelta read only:
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D Contract reviewServed-tier: DELTA record, round 2. PR #36171, card #35640, ruling 7065449898 (C+A). It follows round 0 (7067086844, PASS on Gate verdicts (check-runs on the head): 59 runs, 42 success, 17 skipped, 0 failed, 0 pending. Success includes Test Core and its 10 shards, TypeScript Type Check, Lint & Repo Gates and every lint lane, Build Core, Build Docs, Check Changeset (both runs), Dogfood Regression Gate, Governed Surface Queue Guard, Spec property liveness, PR-body guards. Skipped are the UI lanes, the opt-in lanes, Temporal Conformance, the queue-verdict lanes and Dogfood Verify CLI. Nothing was re-run here. ① Derived judgments
② Semver level
Clause-②: no (narrowing) — matches. The delta refuses more boots and adds nothing a metadata author can write; ③ Boundary flags
④ Design judgmentS2: closed. Both halves it named are refused at this head: a N4: closed. The caller receives Is the wrap an acceptable shape. Yes, not a must-fix. Tried to break it:
Checked and found sound: No must-fix. One should-fix (S3), three nits (N6, N7, N8). S2: closed. N4: closed. N5: stands as stated in the jsdoc. N2, N3: untouched by the delta. Implemented-by: VERDICT: PASS |
…ht refusal Red on 26abb3e: a driver registered from an app plugin's start() or the onEnable bridge after the stand-in holds the name refuses the boot, a caught refusal lets the boot through, and a caught refusal followed by another start failure is reported as the guard's sentence. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D
… refuse a caught refusal The registerDriver wrap now refuses a driver under a managed name only while the engine does not hold verify's stand-in under it; once it does, the engine keeps the stand-in and discards the newcomer, so the boot runs on the stand-in. bootStack refuses a boot that returned with the guard's refusal set (a caller caught it), and rethrows the guard's sentence only when the boot failed on that refusal. The refusal sentence, the jsdoc, README and changeset are bounded to what is refused. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D Final green head after rework round 3: |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd 席位核对 — ACCEPT (delta) · head 205d953Delta read only:
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D Contract reviewServed-tier: DELTA record, round 3. PR #36171, card #35640, ruling 7065449898 (C+A). It follows round 0 (7067086844, PASS on Gate verdicts (check-runs on the head): 59 runs, 42 success, 17 skipped, 0 failed, 0 pending. Success includes Test Core and its 10 shards, TypeScript Type Check and the type-check lanes, Lint & Repo Gates and every lint lane, Build Core, Build Docs, Check Changeset (both runs), Dogfood Regression Gate, Governed Surface Queue Guard, Spec property liveness, PR-body guards. Skipped are the UI lanes, the opt-in lanes, Temporal Conformance, the queue-verdict lanes and Dogfood Verify CLI. Nothing was re-run here. ① Derived judgments
② Semver level
Clause-②: no (narrowing) — still matches. Against round 2 the delta refuses fewer boots (the late registration now runs on the stand-in) and one more (a caught refusal); both stay inside "verify writes only to stores it creates", and nothing a metadata author can write is added. ③ Boundary flags
④ Design judgmentS3: closed. The wrap forwards when the engine already holds verify's stand-in under the name, the engine keeps it and discards the newcomer, and both shapes round 2 named (an app plugin's Tried to make the forward leave a foreign driver in place:
N6: closed. A refusal the caller swallowed is read after a N7: closed. The jsdoc's "Not covered" list names the prototype call, deleting or overwriting the own property and the two-faced N8: closed. README and changeset now say no connect, schema sync or write reaches the driver, which holds on both refusal legs and on the forward. One residue of the same wording, no new id: "refused before the engine holds it" (README, changeset, jsdoc) is not true of a driver a plugin puts straight into the engine in
The refusal sentence: "a plugin registered a driver of its own under that datasource's name while verify's in-memory stand-in did not hold it … the boot would run on that driver" is now true of every path that throws it. The harness header and the Regression on rounds 0 to 2: none found. The start-time No must-fix, no should-fix. One nit (N9). S3: closed. N6: closed. N7: closed. N8: closed. N5: stands as stated in the jsdoc. N2, N3: untouched by the delta. Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv 席位核对Awaiting the maintainer's merge (narrowing) · 2026-11-21T22:00Z · head
|
Requested by Leehom · project thread
Fixes #35640
Ruling-ref: 7065449898
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no published skill teaches which datasources
os verifystands in or refuses; the rule ships in the@objectstack/verifyREADME (updated here), whichskills/objectstack-projectalready points readers to维护者速读
What changes
Ruled on the card (maintainer, 「C+A 能换内存库就换,否则拒绝」, decision record 7065449898): verify writes only to stores it creates, for every engine the platform ships; a managed datasource on a plugin's driver id refuses the boot; no switch.
packages/verify/src/managed-datasource-stand-in.ts:managedStandInEnginenow answers for every driver id the platform ships (resolveDriverIdfrom@objectstack/spec, the same table the default driver factory'ssupports()reads):memorygets a fresh memory store, every other shipped engine,mongodbincluded, gets the default store's engine. The "shipped engine with no faithful stand-in keeps its real driver" branch is gone, and so ishasManagedStandIn. NewunstandableManagedDatasources(config)lists every declared managed datasource (notdefault) on a driver id the platform does not ship, judged on the sameisManagedDatasourcereader the factory and derive use;unstandableManagedDatasourceRefusalis the sentence. The factory itself refuses such a spec instead of handing it to the real factory (unreachable from the connection service, whosesupports()gate already turns it away; defence for direct callers).packages/verify/src/harness.ts:bootStackrefuses before it composes anything (first statement of the boot, before any env change or kernel) while such a datasource is declared, naming each datasource and driver id and why.os verifyalready prints a boot error and exits 1 (packages/cli/src/commands/verify.tsrun-level catch), so no CLI change.packages/verify/src/derive.ts: the "managed, no stand-in, withheld" branch and its report sentence are removed; objects on a managedmongodbdatasource enter every derived family.packages/verify/src/managed-datasource-stand-in.ts+harness.ts(rework round 1, contract review 7067086844 S1): the connection service keeps any driver already registered under a datasource's NAME, whatever driver id it declares, so a plugin registeringdriver.NAMEunder a managed datasource that declares a shipped id (mongodb,postgres, …) bypassed both the stand-in and the refusal. NewcreateManagedDatasourceDriverGuard(config):bootClaimedmounts it as the FIRST plugin whenever a managed datasource other thandefaultis declared; itsstart()runs after every plugin'sinit(where plugin drivers register) and before any plugin'sstart(where ObjectQL adoptsdriver.*, syncs schemas, and the app connects and seeds), and refuses the boot when adriver.NAMEservice or an engine driver is held under a managed datasource's name, naming the datasource and its declared driver id. Rework round 2 (contract review 7068014028, S2 + N4): the guard now also matches eachdriver.*service by the driver instance's ownname(the key the engine registers it under), and after its start-time check it wrapsregisterDriveron the engine instance, the engine's only way to put a driver under a name, so a driver registered later (ObjectQL'sdriver.*adoption, anobjectql:drivers-readyhandler, a later plugin) under a managed datasource's name that verify's factory did not build for it is refused before the engine holds it; the identity check reads a per-name ledger the verify factory fills with the exact instance it returns.bootStackrethrows the guard's own sentence with the kernel error as cause (N4). Rework round 3 (contract review 7069009856, S3 + N6–N8): the wrap forwards to the engine's ownregisterDriverwhen the engine already holds verify's stand-in under that name (the engine keeps the stand-in and discards the newcomer without calling it), so a late registration from an app plugin'sstart()or theruntime.onEnablebridge boots on the stand-in instead of being refused; a refusal a plugin catches still refuses the boot afterbootstrap()returns, and a boot that failed for another reason keeps the kernel's own error (the guard's sentence only when the guard's own refusal is in the cause chain). Not covered, stated in the jsdoc: a plugin that replaces theobjectqlservice, takes the guard's plugin name, calls the prototype'sregisterDriver, deletes or overwrites the own property, or a driver whosenameanswers differently on each read. No key, flag, boot option or package export added. The driver-id refusal now says the datasource names no driver id the platform ships ("a plugin's driver, or a misspelling") and prints a missing driver as(no driver declared)(N1).harness.tsand stand-in headers,packages/verify/README.md(Posture), theos verifysection ofcontent/docs/deployment/cli.mdx, and one changeset.changeset/35640-verify-memory-stand-in.md(patch,!, BREAKING section with FROM/TO/fix for both refusals, ADR-0087 dispositionnot-required (no-migration-prescription)).Read first (by risk):
packages/verify/src/managed-datasource-stand-in.ts— themanagedStandInEnginebody andunstandableManagedDatasources: the "shipped" set and the managed reader both refusal and factory decide on.packages/verify/src/harness.ts— the two lines at the top ofbootClaimed: the refusal must precede every side effect; and the guard mounted beforeObjectQLPlugin.createManagedDatasourceDriverGuardin the stand-in file: itsstart()check sees everyinit-time registration, and itsregisterDriverwrap with the factory ledger must catch every later one before the first write (ObjectQLstart(): adoption,ql.init(),drivers-ready, then the first schema sync).packages/verify/src/verify.managed-datasource-stand-in.test.ts— the mongodb recording medium (a TCP listener counting connections) and the refusal pin with its control.Two-minute check:
pnpm --filter @objectstack/verify exec vitest run --maxWorkers=2 src/verify.managed-datasource-stand-in.test.ts→Tests 32 passed (32), includingnothing reached the real mongodb address: no connection was ever made to itandthe boot is refused, naming the datasource and the driver id, and the recording driver is never called.Tests
The card's Done-when, pinned in
verify.managed-datasource-stand-in.test.ts(the component's shared harness file, extended rather than a new file, one boot):mongodb: the fixture declares a managed secondarymongodbdatasource pointed at a local TCP listener that counts connections (the recording medium), seeds two rows on its object, and has an asyncafterInserthook on another object writing into it. After CRUD, reference shapes, delete behaviours, unique scopes and a REST create: 0 connections to the listener; the object's CRUD caseverified; both seed rows and the hook rows present in the stand-in (read back through REST); no hook error. CONTROL: the factoryos devuses (createDefaultDatasourceDriverFactory) connects to that listener for the same declaration.bootStackrejects with a sentence namingdatasource "vms_plug_ds" (driver "vms_plug_driver"), and the recording driver's plugin never initialised, so no call reached it. CONTROL: in the boot above, the same recording plugin behind an EXTERNAL datasource (not refused) initialises and takes the REST create.driver.vmd_docs_dsunder a managed datasource declaringmongodb, with a seed on its object:bootStackrejects namingdatasource "vmd_docs_ds" (driver "mongodb")and "registered a driver of its own"; the driver's recorded calls are exactly[plugin.init](no connect, no schema sync, no seed write). Unit pin: a missing driver readsdatasource "a" (no driver declared).driver.vmk_elsewherewhose instance is named after the managed datasource, and a driver registered on the engine from anobjectql:drivers-readyhandler for an object-bound managed datasource. Both booted on a81e777 (recorded calls ran through connect/syncSchema/seedbulkCreate/updateMany); at 26abb3e both are refused with the bareverify: refusing to boot:sentence and the driver's calls are[plugin.init]/[plugin.init, drivers-ready]. Ledger unit pin; the mongodb/SQL main boot is the no-false-refusal control.4 failed | 28 passed (32)): a late registration from an app plugin'sstart()and from theruntime.onEnablebridge now BOOT on the stand-in (GET returns the seed, a REST POST answers 201 and lands in the stand-in; the foreign driver's calls are[plugin.init, plugin.start]/[onEnable], no connect, sync or write); adrivers-readyhandler that catches the refusal is still refused with the bare sentence; a caught refusal followed by the plugin's own start failure reports that failure, not the guard's sentence.mongodb,tursoandpgas the default store's engine with nothing of the declared config,mongodbon amemorydefault store as a fresh memory store, and refuses a plugin driver id without asking the real factory; the refusal reader names managed plugin-driver datasources with or without a declaredschemaMode, reads a name-keyed map, and (control) refuses no shipped engine, no external or validate-only plugin datasource and notdefault;derive.test.tsnow pins that objects on managedpostgres,mongodband plugin-driver datasources (and a required reference to the mongodb one) are derived, not blocked.Reverse verification (each mutation landed and restored by
scripts/ablation-replace.mjsorgit restore --source, blob == HEAD andgit diff HEADempty after each; the tests import the changed files fromsrc/, nodist/in the path):Readings
3543b51dversions of the three source files, new tests): the boot reaches the real mongodb address and fails fast (datasource 'vms_docs_ds': connect failed — connection monitor to 127.0.0.1:32885 closed);Tests 8 failed | 7 passed | 8 skipped (23). The decision thread's probe re-run on base3543b51d:connectionsToRealMongoAddress: 10.mongodbmapped to no stand-in again: the refusal (same reader) refuses the mongodb fixture;Tests 3 failed | 12 passed | 8 skipped (23), VERDICT command-exit 1.bootClaimed:× the boot is refused, naming the datasource and the driver id, and the recording driver is never called—expected undefined to be an instance of Error(the boot succeeded on the plugin's driver);Tests 1 failed | 22 passed (23).× the boot is refused, naming the datasource and its declared driver id, and the plugin driver receives no call—expected undefined to be an instance of Error(the boot ran on the plugin's driver);Tests 1 failed | 24 passed (25); restored blob == HEAD.1 failed | 27 passed(the other-key pin is still refused, by the wrap, but not by the guard's start);registerDriverwrap removed ⇒ the drivers-ready pin boots,1 failed | 27 passed; N4 rethrow deleted ⇒3 failed | 25 passed. Each restored to the HEAD blob.2 failed | 30 passed; post-return refusal disabled ⇒ the caught-refusal pin boots,1 failed | 31 passed; identity check replaced by readingrefusalalone ⇒ the own-failure pin red,1 failed | 31 passed. Each restored to the HEAD blob.× exercises objects on managed datasources of every shipped engine, mongodb included—doc_task: expected 'withheld' to be falsy;Tests 1 failed | 32 passed (33).Package runs
pnpm --filter @objectstack/verify test:Test Files 55 passed (55),Tests 500 passed (500)(head 205d953).pnpm --filter @objectstack/verify typecheck:tsc --noEmitclean;check:test-typecheck: OK — 0 file(s) / 0 error(s).Acceptance notes
origin/main3543b51 before any code: a plugin driver is constructed by its plugin and registered as adriver.NAMEservice in the plugin'sinit(packages/drivers/driver-odata/src/plugin.ts:201);ObjectQLPluginadopts everydriver.*service (packages/objectql/src/plugin.ts:1524); the connection service then answersalready-registeredand never reaches the factory (packages/services/service-datasource/src/datasource-connection-service.ts:607-613), and for an unregistered plugin id itsfactory.supports()gate answersskipped-unsupported(:693);supports()isresolveDriverId(id) !== undefined(default-datasource-driver-factory.ts:1131). No single swap point exists: the instance is the plugin's (the connection service deliberately never evicts it).resolveDriverId/BUILTIN_DRIVER_IDSin@objectstack/spec(packages/spec/src/data/driver/config-registry.zod.ts), which that file states is exactly what the default factory builds. It includes the federation-onlyoracleandmssql, which a managed datasource cannot name at authoring; were one to reach verify anyway it would be stood in, never connected.main(.changeset/verify-managed-datasource-stand-in.md,.changeset/35640-verify-real-store-wording.md) still describemongodband plugin drivers keeping their real driver. They are outside this claim's file surface, so they are not edited; the new changeset says it supersedes them for this release.Verification
Local gates, the derived set (
dispatch-gates.mjs --commands), run one by one with each exit captured before any pipe; the readings are in the reports on the card (round 3: #35640 comment 7069764734, 105 derived, 102 exit 0, 3 prerequisite-not-met left to CI). Full dogfood battery on 205d953:Tests 4101 passed | 68 skipped (4169), no failures. CI owns the full farm.Session: session_01FEkQ5kt9AD1TPLy7Y9oa9D
🤖 Generated with Claude Code