Skip to content

fix(verify)!: run a managed mongodb datasource on verify's in-memory stand-in, refuse a managed plugin-driver datasource - #36171

Merged
os-zhuang merged 11 commits into
mainfrom
claude/issue-35640-verify-memory-stand-in
Nov 21, 2026
Merged

os-zhuang merged 11 commits into
mainfrom
claude/issue-35640-verify-memory-stand-in

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

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 verify stands in or refuses; the rule ships in the @objectstack/verify README (updated here), which skills/objectstack-project already points readers to

维护者速读

  • 开发者或 AI 跑应用自检时:文档型数据库的数据源以前会连真实库,现在换成内存库照常验证;插件驱动的托管数据源以前会改写真实库,现在自检直接拒绝启动并点名该数据源;插件用同名注册自己的驱动顶替托管数据源时,自检同样拒绝启动。
  • 属于"应用自检只碰自己建的库"这条规则的收尾,替声明了文档型数据库或插件驱动数据源的应用作者解决自检改写真实库、事后无法恢复的问题。
  • 只有声明了插件驱动托管数据源的应用会碰到:自检从能跑变为拒绝启动;目前仓库内与姊妹仓都没有这样的应用;本改动可以直接撤回。
  • 要你做什么:这次改动让一类原来能跑的自检改为拒绝启动(收紧),按规则需要你本人批准后才能合并。

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: managedStandInEngine now answers for every driver id the platform ships (resolveDriverId from @objectstack/spec, the same table the default driver factory's supports() reads): memory gets a fresh memory store, every other shipped engine, mongodb included, gets the default store's engine. The "shipped engine with no faithful stand-in keeps its real driver" branch is gone, and so is hasManagedStandIn. New unstandableManagedDatasources(config) lists every declared managed datasource (not default) on a driver id the platform does not ship, judged on the same isManagedDatasource reader the factory and derive use; unstandableManagedDatasourceRefusal is the sentence. The factory itself refuses such a spec instead of handing it to the real factory (unreachable from the connection service, whose supports() gate already turns it away; defence for direct callers).
  • packages/verify/src/harness.ts: bootStack refuses 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 verify already prints a boot error and exits 1 (packages/cli/src/commands/verify.ts run-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 managed mongodb datasource 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 registering driver.NAME under a managed datasource that declares a shipped id (mongodb, postgres, …) bypassed both the stand-in and the refusal. New createManagedDatasourceDriverGuard(config): bootClaimed mounts it as the FIRST plugin whenever a managed datasource other than default is declared; its start() runs after every plugin's init (where plugin drivers register) and before any plugin's start (where ObjectQL adopts driver.*, syncs schemas, and the app connects and seeds), and refuses the boot when a driver.NAME service 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 each driver.* service by the driver instance's own name (the key the engine registers it under), and after its start-time check it wraps registerDriver on the engine instance, the engine's only way to put a driver under a name, so a driver registered later (ObjectQL's driver.* adoption, an objectql:drivers-ready handler, 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. bootStack rethrows 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 own registerDriver when 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's start() or the runtime.onEnable bridge boots on the stand-in instead of being refused; a refusal a plugin catches still refuses the boot after bootstrap() 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 the objectql service, takes the guard's plugin name, calls the prototype's registerDriver, deletes or overwrites the own property, or a driver whose name answers 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).
  • Text: the harness.ts and stand-in headers, packages/verify/README.md (Posture), the os verify section of content/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 disposition not-required (no-migration-prescription)).

Read first (by risk):

  1. packages/verify/src/managed-datasource-stand-in.ts — the managedStandInEngine body and unstandableManagedDatasources: the "shipped" set and the managed reader both refusal and factory decide on.
  2. packages/verify/src/harness.ts — the two lines at the top of bootClaimed: the refusal must precede every side effect; and the guard mounted before ObjectQLPlugin.
    createManagedDatasourceDriverGuard in the stand-in file: its start() check sees every init-time registration, and its registerDriver wrap with the factory ledger must catch every later one before the first write (ObjectQL start(): adoption, ql.init(), drivers-ready, then the first schema sync).
  3. 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), including nothing reached the real mongodb address: no connection was ever made to it and the 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):

  • Boot pin, mongodb: the fixture declares a managed secondary mongodb datasource pointed at a local TCP listener that counts connections (the recording medium), seeds two rows on its object, and has an async afterInsert hook 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 case verified; both seed rows and the hook rows present in the stand-in (read back through REST); no hook error. CONTROL: the factory os dev uses (createDefaultDatasourceDriverFactory) connects to that listener for the same declaration.
  • Refusal pin, plugin driver id: a fixture declaring a managed datasource on a plugin's driver id, with a recording driver plugin and a seed: bootStack rejects with a sentence naming datasource "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.
  • Refusal pin, name-keyed (round 1): a recording driver plugin registers driver.vmd_docs_ds under a managed datasource declaring mongodb, with a seed on its object: bootStack rejects naming datasource "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 reads datasource "a" (no driver declared).
  • Refusal pins, round 2: a driver registered as driver.vmk_elsewhere whose instance is named after the managed datasource, and a driver registered on the engine from an objectql:drivers-ready handler for an object-bound managed datasource. Both booted on a81e777 (recorded calls ran through connect/syncSchema/seed bulkCreate/updateMany); at 26abb3e both are refused with the bare verify: 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.
  • Pins, round 3 (red on 26abb3e: 4 failed | 28 passed (32)): a late registration from an app plugin's start() and from the runtime.onEnable bridge 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); a drivers-ready handler 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.
  • Unit pins: the factory builds mongodb, turso and pg as the default store's engine with nothing of the declared config, mongodb on a memory default 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 declared schemaMode, reads a name-keyed map, and (control) refuses no shipped engine, no external or validate-only plugin datasource and not default; derive.test.ts now pins that objects on managed postgres, mongodb and 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.mjs or git restore --source, blob == HEAD and git diff HEAD empty after each; the tests import the changed files from src/, no dist/ in the path):

Readings
  • Base implementation (3543b51d versions 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 base 3543b51d: connectionsToRealMongoAddress: 10.
  • mongodb mapped 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.
  • Refusal line deleted from 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).
  • Name-keyed guard's throw deleted (round 1, head a81e777): × 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.
  • Round 2 (head 26abb3e): own-name leg dropped ⇒ 1 failed | 27 passed (the other-key pin is still refused, by the wrap, but not by the guard's start); registerDriver wrap removed ⇒ the drivers-ready pin boots, 1 failed | 27 passed; N4 rethrow deleted ⇒ 3 failed | 25 passed. Each restored to the HEAD blob.
  • Round 3 (head 205d953): S3 forward condition forced off ⇒ the two late-registration pins red, 2 failed | 30 passed; post-return refusal disabled ⇒ the caught-refusal pin boots, 1 failed | 31 passed; identity check replaced by reading refusal alone ⇒ the own-failure pin red, 1 failed | 31 passed. Each restored to the HEAD blob.
  • derive withholding mongodb objects again: × 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 --noEmit clean; check:test-typecheck: OK — 0 file(s) / 0 error(s).

Acceptance notes

  • Premise P2 of the ruling, checked on origin/main 3543b51 before any code: a plugin driver is constructed by its plugin and registered as a driver.NAME service in the plugin's init (packages/drivers/driver-odata/src/plugin.ts:201); ObjectQLPlugin adopts every driver.* service (packages/objectql/src/plugin.ts:1524); the connection service then answers already-registered and never reaches the factory (packages/services/service-datasource/src/datasource-connection-service.ts:607-613), and for an unregistered plugin id its factory.supports() gate answers skipped-unsupported (:693); supports() is resolveDriverId(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).
  • "Shipped" = resolveDriverId / BUILTIN_DRIVER_IDS in @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-only oracle and mssql, which a managed datasource cannot name at authoring; were one to reach verify anyway it would be stood in, never connected.
  • Two unreleased changesets on main (.changeset/verify-managed-datasource-stand-in.md, .changeset/35640-verify-real-store-wording.md) still describe mongodb and 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.
  • Not changed, as ruled: external datasources, a report line saying an object ran on a stand-in, and the mongodb driver's own disagreements with the stand-in.

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

@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 21, 2026
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/verify, touching 28 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/verify/README.md), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

8 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/kernel/architecture.mdx (via getService (symbol, a method of interface ManagedDriverGuardContext))
  • content/docs/kernel/cluster.mdx (via getService (symbol, a method of interface ManagedDriverGuardContext), getServices (symbol, a method of interface ManagedDriverGuardContext))
  • content/docs/kernel/contracts/data-engine.mdx (via getDriverByName (symbol, a field of interface GuardedEngine))
  • content/docs/kernel/runtime-services/audit-service.mdx (via getService (symbol, a method of interface ManagedDriverGuardContext))
  • content/docs/kernel/services-checklist.mdx (via getService (symbol, a method of interface ManagedDriverGuardContext))
  • content/docs/plugins/anatomy.mdx (via getService (symbol, a method of interface ManagedDriverGuardContext), getServices (symbol, a method of interface ManagedDriverGuardContext))
  • content/docs/plugins/development.mdx (via getService (symbol, a method of interface ManagedDriverGuardContext))
  • content/docs/protocol/kernel/index.mdx (via getService (symbol, a method of interface ManagedDriverGuardContext))
What this run could not see
  • 1 changed file(s) yielded no anchor (packages/verify/README.md) — pages documenting those are invisible to this run
  • 4 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 8 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 4ab2c82335aae508686f2206a85442d2287d6d13 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from b6948298a830370743585e0f3c1ebd456a5e1ce2 — the merge of head 205d953c4e68400e3002f9b1693e20a0fc6d8a5f into base 4ab2c82335aae508686f2206a85442d2287d6d13, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 4ab2c82335aae508686f2206a85442d2287d6d13 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D

Final green head for L1: 6c1965975d6a908872465ef704e2a7dfe1e05b34. Check-runs on it: 55, 40 success (Dogfood Regression Gate among them), 15 skipped, 0 failed or pending; mergeable state clean. Report: #35640 comment 7066896452, full dogfood battery on this head in its dogfood_battery. Narrowing (Clause-②: no (narrowing)): after L1 a contract review at the ceiling tier is owed, then the seat hands it to approvers (Tier H). Sent to L1-b.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd
L1-b · 2026-11-21T18:05Z

席位核对 — ACCEPT · head 6c19659

  • Shape: l1-face.mjs --pr 36171 at 6c19659: open, draft, base main; first line Fixes #35640, which delivers the ruling's single PR (ruling item 4); no closing keyword on any other card; the changeset covers @objectstack/verify, the one published package touched; Clause-②: no (narrowing) · Metadata-protocol: none; Skills-docs: none … is true (no skills/** teaches verify's stand-in rule, and the verify README is updated).
    • Its one flag, dogfood owed for ! plus the narrowing arm, is met. The dev report 7066896452 records dogfood_battery = "6c1965975 · os-verify-lock: VERDICT command-exit 0 … Test Files 483 passed | 3 skipped (486) · Tests 4101 passed | 68 skipped (4169) · no failures": the full battery, pinned to this head.
  • The ruling (7065449898), item by item, checked in the diff:
    1. Every shipped engine is stood in, mongodb included. managedStandInEngine now returns memory for memory and the default store's engine for every other id resolveDriverId knows. That is the spec's driver vocabulary, the same table the default factory's supports() reads. It replaces the old SQL_ENGINES set that left mongodb out.
      • The federation-only ids (oracle, mssql) and the retired mongo are refused managed at parse in datasource.zod.ts, so the wider table admits no pairing a real boot would take.
      • derive's "managed, no stand-in" withheld branch and its sentence are removed, and hasManagedStandIn goes. It was not exported from the package root, so no public API changed.
    2. A plugin driver id refuses the boot. bootClaimed calls unstandableManagedDatasources(config) and throws before composing. The check reads the same isManagedDatasource as the factory and derive, skips default, and handles both the array and the name-keyed map.
      • The sentence names each datasource and its driver id (JSON.stringify) and says why. The dev measured os verify on the built CLI exiting 1 with it.
      • The verify factory also refuses rather than handing such a managed spec to the real factory. External specs still go to opts.real.create unchanged.
    3. No switch: the diff adds no CLI flag, boot option, metadata key or exported member. Only three src files change, plus text.
    4. One PR.
  • Premise P2 was checked first: the dev's read in 7066896452 names the plugin's own registration, ObjectQL's adoption of the driver and the already-registered branch. It agrees with the ruling's P2. I did not re-read those files: the ruling marks P2 as read, not measured, and the refusal pin is the behavioural proof.
  • Pins and controls (verify.managed-datasource-stand-in.test.ts, 23 tests):
    • A mongodb datasource behind a TCP listener that counts connections: 0 connections, CRUD verified, seed and hook rows read back in memory. CONTROL: the factory os dev uses does connect.
    • A plugin driver id: boot rejected with the datasource and driver named, and the recording driver never called. CONTROL: the same plugin behind an EXTERNAL datasource initialises and serves a REST create, so external is unchanged.
    • The dev reported four reverse legs: base source 8 ✗, mongodb mapped to undefined 3 ✗, the refusal line deleted 1 ✗, a mongodb withhold re-added in derive 1 ✗, each restored to the HEAD blob. I did not re-run them.
  • Changeset and docs, read sentence by sentence:
    • The changeset's two bullets, the FROM/TO/fix lines and the "external … not affected" line match the diff.
    • Its adr-0087: not-required reason holds: no key, value or export moves.
    • The supersede sentence is the right route for the two unreleased changesets on main, which this PR may not edit.
    • The cli.mdx os verify paragraph and the README Posture paragraph say the same as the harness.ts and stand-in headers.
  • Gates: 40 success, 15 expected skip, 0 unexpected skip, 0 failed, 0 pending at 6c19659. Lint & Repo Gates and TypeScript Type Check are both success. The local NOT MEASURED families (check:skill-examples and check:dual-build-cjs-loads exit 3, two repo-wide scans timed out at 300 s) are covered by green CI.
  • Accepted, recorded:
    • The os validate observation: author-time rules pass a managed plugin-driver datasource. No defect class is claimed, so it is not filed.
    • The verify report does not say an object ran on a stand-in, which the ruling leaves out of scope.
  • Landing: ! plus (narrowing), so a contract review at CONTRACT_REVIEW_TIER is owed on this head. The area runs it, and then the PR goes to the seat for approvers (Tier H); the area does not land it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6c1965975d6a908872465ef704e2a7dfe1e05b34
Local-runs: none
Scope: packages/verify/src/managed-datasource-stand-in.ts, packages/verify/src/harness.ts, packages/verify/src/derive.ts, packages/verify/src/derive.test.ts, packages/verify/src/verify.managed-datasource-stand-in.test.ts + read in the cited code, not reviewed: packages/spec/src/data/driver/config-registry.zod.ts, packages/spec/src/data/datasource.zod.ts, packages/services/service-datasource/src/datasource-connection-service.ts, packages/services/service-datasource/src/default-datasource-driver-factory.ts, packages/objectql/src/plugin.ts, packages/runtime/src/driver-plugin.ts, packages/runtime/src/app-plugin.ts, packages/drivers/driver-odata/src/plugin.ts, packages/verify/src/artifact-collections.ts, packages/verify/src/index.ts, docs/adr/0062-external-datasource-runtime.md, content/docs/data-modeling/external-datasources.mdx

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 411fe24b4394, the tree at the head, and the 55 check-runs on the head. PR comments were not read.

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 Dogfood Verify CLI (run 136927714278); none of them is a failure, and none was re-run here.

① Derived judgments

  • managedStandInEngine accept-set: every id resolveDriverId answers now gets a stand-in (memory → memory, every other one → the default store's engine). That adds mongodb, the federation-only oracle and mssql, and every alias face of the table. Right: it is ruling item 1, and resolveDriverId is the same reader the default factory's supports() uses (default-datasource-driver-factory.ts, resolveKind), so "shipped" has one definition.
  • unstandableManagedDatasources refuse-set: a declared datasource, not named default, that isManagedDatasource reads as managed (declared or defaulted) and whose driver id does not resolve. Reads the top level, else packages[], and a name-keyed map. Right against ruling item 2 as written. It is keyed on the driver id; see S1 for what that key does not cover.
  • bootClaimed: the refusal is the first statement, before NODE_ENV is set and before the kernel exists; bootStack's catch releases the configuration claim. bootClaimed is the only place this package builds a kernel, and bootStackOnce goes through bootStack. Right.
  • createVerifyDatasourceDriverFactory.create: a managed spec on an unshipped id now throws instead of reaching the real factory. Right (fail, not fall back). Not reachable from the connection service, whose supports() gate comes first.
  • deriveCrudCases: the "managed, no stand-in" withheld branch is gone, so objects on managed mongodb and on managed plugin-driver datasources are derived. Right for mongodb. For a plugin driver id it is right only behind the boot refusal: deriveCrudCases is a public export (index.ts), and called on its own it no longer withholds those objects. No caller in the tree does that.
  • Public surface: hasManagedStandIn is removed and three functions are added, all in a module index.ts does not re-export. No published export moves. Right.
  • No spec schema, no metadata key, no CLI flag, no boot option changes. Right (ruling item 3).

② Semver level

.changeset/35640-verify-memory-stand-in.md: @objectstack/verify patch, title with !, a BREAKING entry with FROM, TO and the fix, one ADR-0087 marker (not-required (no-migration-prescription)), both declaration lines. Check Changeset is success on the head.

Clause-②: no (narrowing) — matches. Nothing a metadata author can write is added, removed or refused by the spec, so Metadata-protocol: none is right, and a non-protocol breaking change ships patch with its banner (AGENTS.md, changeset rule). The narrowing arm is right: a boot that ran now refuses. The PR body and the changeset carry the same two lines.

③ Boundary flags

  • open_questions: empty in the dev report (7066896452). Nothing to answer.
  • Dev flag 1, two unreleased changesets on main still say mongodb and plugin drivers keep their real driver: answered as N3 below. Prose, not a blocker.
  • Dev flag 2, os validate passes a managed datasource on an unshipped driver id: answered as N2 below. Confirmed in datasource.zod.ts: the spec refuses managed only for a federation-only driver and for external.connector; an unknown id on managed parses.
  • Ruling premise P2: read and it holds. The connection service returns already-registered when the engine already holds a driver under the datasource's name, before it looks at the factory; ObjectQLPlugin adopts every driver.* service. The premise is what S1 is built on.
  • SQL push-down: the diff adds no query, no id materialisation and no in-app join. No finding.

④ Design judgment

The narrowing against the published spec on main: the spec does not refuse a managed datasource on a plugin's driver id. driver is an open namespace (config-registry.zod.ts, "Where the boundary is"), and the runtime delivers such a datasource under os dev and os serve through the plugin's own driver. So this is not the spec's own refusal made real. It is also not a declared capability taken away at a consumer in the sense the rule forbids: the capability stays whole in the runtime, and what is refused is running os verify over it, because verify cannot keep its "writes only to stores it creates" rule there. The maintainer ruled exactly this refusal, with no switch, and declined the two ways of delivering instead (a mongodb-compatible store, a plugin contract for an ephemeral store). The narrowing is the ruled one, and the mongodb half removes a withheld state rather than adding one. I accept the design on that basis.

Tried to break it:

  • S1 (should-fix) — The refusal is keyed on the declared driver id, and the bypass it guards against is keyed on the datasource name. attemptConnect (datasource-connection-service.ts, the engine.getDriverByName(name) guard) answers already-registered for any datasource whose name a driver is already registered under, and never reads record.driver on that path. A plugin in the app's plugins that registers driver.NAME (the shape packages/runtime/src/driver-plugin.ts and driver-odata use, and the shape this PR's own recording plugin uses) for a managed datasource that declares a shipped id, for example { name: 'docs', driver: 'mongodb' }, is therefore neither refused nor stood in: unstandableManagedDatasources passes it because mongodb resolves, verify's factory is never asked, and the plugin's real driver takes the seed, the hooks and the flows. With this PR derive no longer withholds a mongodb object, so verify's own CRUD, delete-behaviour and unique-scope writes go there too, where before they were withheld. The SQL ids have had the same gap since PR fix(verify): run a declared managed datasource on an ephemeral stand-in, never its real database #35635; this PR extends it to mongodb and at the same time states the rule without exception ("never connected to the database it names, on any engine the platform ships", README, both headers, cli.mdx, the changeset). Reach is narrow: it needs a driver registered under the datasource's own name, and the shipped drivers carry fixed names, so it takes a custom or renamed driver. The onEnable escape hatch does not open it, since connectDeclared runs before onEnable and the first registration wins. Nothing in the test file pins this case; the refusal pin and its control both use an unshipped id. Fix, either: refuse (or fail the boot) when a declared managed datasource other than default ends up on a driver verify's factory did not build, so the check follows the mechanism P2 describes; or have the seat record on the card that this case is accepted, and bound the sentences that say "never". The first moves the head and needs a delta review.
  • N1 (nit) — unstandableManagedDatasourceRefusal states as fact that the datasource is "supplied by a plugin". An unresolvable id can also be a misspelt shipped id (postgress), and a datasource with no driver prints driver undefined. The boot is rightly refused in both cases; only the stated cause is a guess. Wording, in a code file, so a fix moves the head: leave as an accepted deviation or fold into the S1 delta.
  • N2 (nit) — The first place an author learns that a managed plugin-driver datasource cannot be verified is os verify itself; os validate passes it and the spec says nothing. The ruling forbids a new key or flag and expects no spec change, so this is not this PR's to fix. A follow-up card for triage, if the seat wants the author told earlier.
  • N3 (nit) — .changeset/verify-managed-datasource-stand-in.md and .changeset/35640-verify-real-store-wording.md on main will ship in the same release notes and say the opposite of this one. The new changeset says it supersedes them, which is enough to read correctly. Editing or dropping the two older sentences is a prose-face change for whoever compiles the release.

Checked and found sound: the refusal precedes every side effect and releases the claim; default is excluded consistently in the refusal and in derive; external and validate-only datasources are untouched, as ruled on #35255; the refusal fires for a managed plugin-driver datasource even when no object binds it, which is the ruling's "while one is declared"; the test file's mongodb pin has a real control (the default factory connects to the same listener), and the refusal pin asserts the plugin never initialised.

No must-fix. One should-fix (S1), three nits (N1, N2, N3).

Implemented-by: claude/issue-35640-verify-memory-stand-in
Reviewed-by: session_01FEkQ5kt9AD1TPLy7Y9oa9D

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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D

Final green head after rework round 1: a81e77767266735a04481fffb7c7d26bb050abf8. Check-runs on it: 55, 40 success (Dogfood Regression Gate among them), 15 skipped, 0 failed or pending; mergeable state clean. Round 1 answers contract review 7067086844 (S1: name-keyed driver bypass, closed by a guard mounted first on verify's kernel; N1: refusal wording). Report: #35640 comment 7067886738, full dogfood battery on this head in its dogfood_battery. PR body brought to this head. Owed next: L1 delta read, then a ceiling-tier contract delta review; Tier H hand-off after both.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd
L1-b · 2026-11-21T19:21Z

席位核对 — ACCEPT (delta) · head a81e777

Delta read only: 6c1965975d..a81e777672, 6 files, +195/−27. It answers contract review 7067086844 (S1 and N1). The ACCEPT 7067006119 on 6c19659 stands for everything outside this delta.

  • Shape: l1-face.mjs --pr 36171 at a81e777 is clean except its dogfood flag. The flag is met: report 7067886738 gives dogfood_battery = "a81e77767 · os-verify-lock: VERDICT command-exit 0 · Tests 4101 passed | 68 skipped (4169) · no failures", the full battery on this head. The first line, declarations, changeset coverage and Skills-docs: are unchanged and still true.
  • S1, checked in the diff: createManagedDatasourceDriverGuard refuses when a driver.NAME service or an engine driver (getDriverByName) is held under the name of any managed datasource other than default, whatever driver id the datasource declares. bootClaimed mounts it with kernel.use before ObjectQLPlugin, and nothing is mounted on that kernel before it.
    • Why its start() comes before any write:
      • resolvePluginOrder (packages/core/src/plugin-order.ts) keeps insertion order for plugins with no edges, and the guard declares no dependencies, so it is first in the ordered list.
      • The kernel runs Phase 1 (init) for every plugin before Phase 2 (start) for any plugin (kernel.ts), so the guard's start() sees every init-time driver.* registration and runs before ObjectQL adopts drivers or AppPlugin connects and seeds.
      • The pre-compose refusal for an unshipped driver id stays in place (harness.ts:1003).
    • No key, flag, boot option or package export is added. The guard is a module-level export of src, not of the package root.
  • Pin and control:
    • The new pin uses a recording plugin that registers driver.vmd_docs_ds under a managed datasource declaring mongodb, with a seed. The boot rejects with a message naming datasource "vmd_docs_ds" (driver "mongodb") and "registered a driver of its own". The recorded calls are exactly [plugin.init]: no connect, no schema sync and no seed write.
    • The control is the existing boot, where the same plugin sits behind an EXTERNAL datasource. It initialises and takes the REST create, still green, so the guard does not catch external datasources. The managed mongodb stand-in boot in the same suite also still passes, so the guard does not fire on the platform's own registrations.
    • Ablation, from the dev's reading (I did not re-run it): with the throw line deleted, the boot succeeds on the plugin's driver and the run is Tests 1 failed | 24 passed (25). The file was restored to the HEAD blob.
    • The boot refusal is a thrown boot error, not an ADR-0112 HTTP envelope, so a message assert is the right pin, as in round 0.
  • N1: the refusal now reads "names no driver id the platform ships (a plugin's driver, or a misspelling)", and a missing driver prints (no driver declared). A unit pin covers the second.
  • Text, read sentence by sentence:
    • The changeset's second BREAKING bullet (FROM/TO/fix) matches the guard. The "external … not affected" line moved under it and is still true.
    • The cli.mdx os verify paragraph and the README Posture paragraph say the same as the guard: it refuses before any plugin starts, whatever driver id is declared, and there is no switch.
    • The PR body has been brought to this head: a round-1 bullet, the third pin, the ablation reading and the report pointer.
  • Gates: 42 success, 17 expected skip, 0 unexpected skip, 0 failed and 0 pending at a81e777. Lint & Repo Gates and TypeScript Type Check are both success. The 3 local NOT MEASURED families are covered by green CI.
  • Recorded, unchanged from round 0: the report's two "noted, not filed" items:
    • os validate passing an unshipped managed driver id was accepted in round 0, since no defect class is claimed.
    • The two older unreleased changesets are superseded by this one's last paragraph.
    • Neither one is a residual this PR leaves open.
  • Landing: unchanged. ! plus (narrowing) makes this Tier H. The Fable delta contract review on this head is owed by the area, and then the PR goes to the seat. The area does not land it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: a81e77767266735a04481fffb7c7d26bb050abf8
Local-runs: none
Scope: packages/verify/src/managed-datasource-stand-in.ts, packages/verify/src/harness.ts, packages/verify/src/verify.managed-datasource-stand-in.test.ts, .changeset/35640-verify-memory-stand-in.md, packages/verify/README.md, content/docs/deployment/cli.mdx + read in the cited code, not reviewed: packages/core/src/kernel.ts, packages/core/src/plugin-order.ts, packages/objectql/src/plugin.ts, packages/objectql/src/engine-registration.ts, packages/objectql/src/engine.ts, packages/services/service-datasource/src/datasource-connection-service.ts, packages/services/service-datasource/src/datasource-admin-plugin.ts, packages/runtime/src/default-datasource-plugin.ts, packages/runtime/src/app-plugin.ts, packages/runtime/src/driver-plugin.ts, packages/drivers/driver-odata/src/plugin.ts, packages/drivers/driver-sqlite-wasm/src/sqlite-wasm-driver.ts, packages/drivers/driver-memory/src/memory-driver.ts, packages/verify/src/artifact-collections.ts, packages/verify/src/index.ts, packages/verify/package.json

DELTA record, round 1. PR #36171, card #35640, ruling 7065449898 (C+A). It follows the round-0 record 7067086844 (PASS on 6c1965975d6a, S1 and N1 to N3). Inputs: the card body and its 11 comments, the PR body, file list (8 files) and its 5 comments, the net diff against merge base 411fe24b4394 (8 files, +674/-116), the round delta 6c1965975d6a..a81e77767266 (6 files, +195/-27), the tree at the head, and the check-runs on the head.

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

  • createManagedDatasourceDriverGuard(config): returns a plugin when the app declares a managed datasource other than default, else nothing. Its start() refuses when a driver.NAME service exists for a managed datasource's name, or the engine already holds a driver under that name. Right for the shape S1 named, and for a driver put on the engine directly during init(). Not complete; see S2.
  • Mount point: bootClaimed mounts it before ObjectQLPlugin, as the first kernel.use. Read in kernel.ts and plugin-order.ts: bootstrap inits every plugin, then starts them in resolved order; the order visits the plugin map in insertion order and only hoists dependencies; the guard declares none and is the first key, so no dependency, app-contributed plugin or extraPlugins entry starts before it. kernel.use refuses after bootstrap begins, so nothing mounts later. A failing start() rejects bootstrap() because rollbackOnFailure defaults to true and verify's kernel does not turn it off. Right.
  • No false refusal on the legitimate paths, read: verify's stand-ins are registered in AppPlugin.start or in its objectql:drivers-ready handler, both after the guard's start; DatasourceAdminServicePlugin.init connects nothing; DefaultDatasourcePlugin.init registers the default driver under its natural name (com.objectstack.driver.sqlite-wasm, com.objectstack.driver.memory), which no datasource name collides with in practice; default is excluded; an external datasource on a plugin driver is not in the guard's list. The mongodb boot pin and the external control in the same test file are green in CI, which is the measured half.
  • Array and name-keyed map: the guard reads managedDeclaredDatasources, the same reader the driver-id refusal uses, so both declaration shapes are covered alike. Right.
  • unstandableManagedDatasources is now a filter over that shared reader; its result is unchanged from round 0. describeDatasources prints (no driver declared) for an undefined, null or empty driver. Right.
  • Public surface: createManagedDatasourceDriverGuard and ManagedDriverGuardContext are exported from the module only. index.ts does not re-export the module and package.json exports only .. No published export moves; no key, flag or boot option is added. Right (ruling item 3).
  • Round-0 behaviour: the driver-id refusal is still the first statement of bootClaimed; the factory and derive are untouched by the delta. No regression found.

② Semver level

.changeset/35640-verify-memory-stand-in.md: @objectstack/verify patch, ! title, now two BREAKING bullets, each with FROM, TO and the fix; one ADR-0087 marker; both declaration lines. Check Changeset is success on the head.

Clause-②: no (narrowing) — matches. The second refusal is also a boot that ran and now refuses, with no spec, key or export change, so Metadata-protocol: none and patch with the banner still hold. The second bullet's FROM is accurate against main: on a SQL id verify's own writes reached the plugin's driver, on mongodb only the app's did. The first bullet's fix line now covers a misspelt id, and the "external is not affected" sentence moved to the second bullet unchanged in meaning.

③ Boundary flags

  • open_questions: empty in the round-1 dev report (7067886738). Nothing to answer.
  • Dev flag, the PR body described the round-0 head: the body read here names the guard and the round-1 readings, so it is current.
  • Dev flag, os validate passes a managed datasource on an unshipped driver id, and two older changesets on main contradict this one: N2 and N3 of round 0. The delta did not touch them; not re-judged.
  • SQL push-down: the delta adds no query, no id materialisation and no in-app join. No finding.

④ Design judgment

S1: closed. For the shape it named (a plugin registering driver.NAME in init(), as DriverPlugin and driver-odata do) the boot is refused before any plugin starts, and the new pin shows the plugin's driver recording plugin.init and nothing else. The dev's ablation of the throw turns that pin red.

N1: closed. The sentence no longer asserts a plugin as the cause, and a missing driver is printed as (no driver declared), pinned.

Tried to break the guard:

  • S2 (should-fix) — The guard does not cover every way a driver comes to hold a managed datasource's name before verify's stand-in does, and its jsdoc says it does.
    • Key mismatch. The guard looks up the service key driver.NAME. ObjectQLPlugin.start adopts every driver.* service with registerDriver(service), and the engine keys the driver on the instance's own name (engine-registration.ts), not on the service key. A plugin that registers driver.anything holding a driver whose name is the managed datasource's name passes both guard checks (no such service key; the engine holds nothing yet), is adopted under the datasource's name one start later, and the connection service then answers already-registered. The jsdoc sentence "at the first start() every such registration is visible" is not true for it.
    • Window after the guard. The stand-in is registered at AppPlugin.start (or in AppPlugin's own objectql:drivers-ready handler, for mapping-routed datasources only), not at the guard's start. Between the two, ObjectQLPlugin.start fires the exported objectql:drivers-ready hook with the engine. A plugin that subscribes in init() and calls engine.registerDriver there takes the name of an object-bound managed datasource first. The jsdoc sentence "A driver registered later cannot take the name: the connection service has registered verify's stand-in by then" is false for that window; it holds only after AppPlugin.start.
    • Both need a hand-written plugin, so reach is narrower than S1's was; neither shipped driver shape does this. Read from the code, not measured.
    • Fix, either: compare each driver.* service's own name (not only its key) against the managed names, and re-check the engine for those names where the stand-in is about to be built or at objectql:drivers-ready; or correct the two jsdoc sentences to what the guard covers and have the seat accept the rest on the card. The first moves the head and needs a delta review. The prose faces (README, cli.mdx, changeset) describe the refusal, not completeness, and need no change for the second route.
  • N4 (nit) — The guard's refusal reaches the caller wrapped by the kernel: Plugin com.objectstack.verify.managed-datasource-driver-guard failed to start - rollback complete: verify: refusing to boot: …, and the kernel also prints the stack to stderr. The driver-id refusal is thrown bare. The sentence is intact and the pin asserts on its content, so this is presentation only.
  • N5 (nit) — The guard is an ordinary named plugin, and kernel.use lets a later plugin with the same name supersede an earlier one. An app plugin that takes the guard's name removes it. That is deliberate sabotage of one's own verify run, not an accident an author can fall into; noted, no action asked.

Checked and found sound: a plugin that registers in start() is too late to be adopted as a driver.* service (adoption runs once, in ObjectQLPlugin.start), and app plugins start after AppPlugin, where registerDriver keeps the stand-in already registered; a driver put on the engine directly in init() is caught by the getDriverByName leg; default and external datasources are left alone; a managed datasource nothing routes to is refused too when a plugin holds its name, which matches the ruling's "while one is declared"; the guard degrades to the service-key check, not to silence, when the objectql service is absent. One limit carried from round 0, outside this delta: both refusals and the guard read the datasources of the configuration handed to bootStack, not ones a plugin entry might declare on its own.

No must-fix. One should-fix (S2), two nits (N4, N5). S1: closed. N1: closed. N2, N3: untouched by the delta.

Implemented-by: claude/issue-35640-verify-memory-stand-in
Reviewed-by: session_01FEkQ5kt9AD1TPLy7Y9oa9D

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
@github-actions github-actions Bot added size/xl and removed size/l labels Nov 21, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D

Final green head after rework round 2: 26abb3e92ac6425918f7300086f126544594c421. Check-runs on it: 55, 40 success (Dogfood Regression Gate among them), 15 skipped, 0 failed or pending. Round 2 answers contract review 7068014028 (S2: a driver taking a managed datasource's name by its instance name or from an objectql:drivers-ready handler, closed by an own-name check and a registerDriver wrap backed by the verify factory's ledger; N4: the guard's sentence reaches the caller bare). Report: #35640 comment 7068908625, full dogfood battery on this head in its dogfood_battery. PR body brought to this head. Owed next: L1 delta read and a ceiling-tier contract delta review; Tier H hand-off after both.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd
L1-b · 2026-11-21T20:43Z

席位核对 — ACCEPT (delta) · head 26abb3e

Delta read only: a81e77767..26abb3e92, 3 commits (pins first, then the fix, then docs), 5 files, +289/−82. It answers the Fable delta record 7068014028 (S2 and N4). My ACCEPTs 7067006119 and 7067971194 stand for everything outside this delta.

  • Shape: l1-face.mjs --pr 36171 at 26abb3e is clean except its dogfood flag. The flag is met: report 7068908625 gives dogfood_battery = "26abb3e92 · os-verify-lock: VERDICT command-exit 0 · Tests 4101 passed | 68 skipped (4169) · no failures", the full battery on this head.
  • S2, checked in the diff and against the engine:
    • Own-name match. The guard's start() now matches every driver.* service by its key and by the driver's own name. That name is the key the engine registers by: RegistrationFacet.registerDriver reads this.drivers.get(driver.name).
    • The registerDriver wrap. It is installed on the engine instance at the end of start() and refuses a driver whose own name is a managed datasource's, unless the ledger holds that exact instance for that name.
      • The ledger is a Map<name, WeakSet> filled by verify's factory. It records handle.driver ?? handle, which is the very object the connection service passes to engine.registerDriver, at datasource-connection-service.ts:839/859.
      • The connection service stamps name before the call, so the wrap reads the datasource name.
      • Verify's default store and the platform's drivers keep their reverse-DNS natural names (e.g. com.objectstack.driver.memory). They never match a managed datasource name, and default is excluded, so the main mongodb/SQL boot passes the wrap. That boot is the no-false-refusal control, and it is green.
    • The start() engine check now spares a driver the ledger knows. A refusal inside a later plugin's start() reaches the caller as the guard's own sentence, rethrown in bootStack with the kernel's error as cause (N4).
    • The stated limits are a datasource absent from the configuration, a plugin that replaces the objectql service, and one that takes the guard's plugin name. They are written in the TSDoc.
  • Pins: two new boot pins cover a driver named after the datasource under another service key, and a registration from an objectql:drivers-ready handler. Both were red on a81e777, where the boot ran and the recorded calls reached connect, syncSchema, the seed bulkCreate and updateMany.
    • At this head all three shapes refuse with the bare verify: refusing to boot: sentence, and the driver's calls are only plugin.init (plus drivers-ready).
    • A ledger unit pin covers stand-in versus real driver, other name and external.
    • The suite reports Tests 28 passed. The package gives Test Files 55 and Tests 496 passed, and typecheck is clean.
    • Three ablations come from the dev's report, and I did not re-run them. Each file was restored to its HEAD blob:
      • With own-name dropped, 1 ✗. The other-key case is then caught later by the wrap, and the pin asserts that the guard's start() refused.
      • With the wrap removed, 1 ✗: the drivers-ready boot ran.
      • With the N4 rethrow deleted, 3 ✗.
  • Text, read sentence by sentence: the changeset's second BREAKING bullet now names both points, the driver.* key and own name before any plugin starts, and registerDriver for anything later. It says the driver receives no call either way. The README Posture paragraph and the harness.ts and stand-in headers say the same. The FROM/TO/fix lines are unchanged and still true.
  • Gates: 42 success, 17 expected skip, 0 unexpected skip, 0 failed and 0 pending at 26abb3e, and mergeable_state is clean.
  • Observation for the contract reviewer, not blocking: the wrap's refusal is a throw at the caller. If a plugin calls registerDriver inside its own try/catch and goes on, the foreign driver is still never registered and the stand-in takes the name, so "writes only to stores it creates" holds. But the boot is not refused, and managedDriverGuard.refusal stays set with nobody reading it. bootStack could check that field after a bootstrap() that returned normally, if the record wants "refuses the boot" to be unconditional.
  • Landing: unchanged. ! plus (narrowing) makes this Tier H. The Fable delta contract review on this head, which is asked about the method wrap's shape, comes first, and then the PR goes to the seat. The area does not land it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 26abb3e92ac6425918f7300086f126544594c421
Local-runs: none
Scope: packages/verify/src/managed-datasource-stand-in.ts, packages/verify/src/harness.ts, packages/verify/src/verify.managed-datasource-stand-in.test.ts, .changeset/35640-verify-memory-stand-in.md, packages/verify/README.md, content/docs/deployment/cli.mdx + read in the cited code, not reviewed: packages/objectql/src/engine.ts, packages/objectql/src/engine-registration.ts, packages/objectql/src/engine-compatibility-section.ts, packages/objectql/src/external-driver-floor.ts, packages/objectql/src/plugin.ts, packages/services/service-datasource/src/datasource-connection-service.ts, packages/services/service-datasource/src/datasource-admin-plugin.ts, packages/runtime/src/default-datasource-plugin.ts, packages/runtime/src/app-plugin.ts, packages/drivers/driver-memory/src/memory-driver.ts, packages/cli/src/utils/schema-migrate.ts, packages/spec/src/contracts/objectql-engine.ts, packages/verify/src/index.ts, packages/verify/package.json

DELTA record, round 2. PR #36171, card #35640, ruling 7065449898 (C+A). It follows round 0 (7067086844, PASS on 6c1965975d6a) and round 1 (7068014028, PASS on a81e77767266, S2, N4, N5). Inputs: the card body and its 12 comments, the PR body, file list (8 files) and its comments (both earlier records and the L1-b delta ACCEPT 7068961827 among them), the net diff against merge base 411fe24b4394, the round delta a81e77767266..26abb3e92ac6 (5 files, +289/-82), the tree at the head, and the check-runs on the head. The kernel ordering files (kernel.ts, plugin-order.ts) were read in round 1 and are not touched by this delta; their reading is carried, not repeated.

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

  • Own-name leg in the guard's start(): every driver.* service is matched by its key and by the instance's own name. Right: RegistrationFacet.registerDriver keys on driver.name, and ObjectQL's adoption loop hands it the service as is.
  • The registerDriver wrap, set on the engine instance after the start-time checks. Right as the funnel: drivers.set has three sites in packages/objectql/src; one is registerDriver, the other two are applyExternalDriverFloor, which only replaces an entry already held with its own floored or unfloored form. Every caller reaches the method through the instance at call time (ObjectQL's adoption this.ql.registerDriver, the connection service's engine.registerDriver, AppPlugin's onEnable bridge, the memory driver's self-install), so the own property is what they call. objectql and data are the same object (plugin.ts, the two registerService calls), and verify builds its plugin with no ql of its own.
  • Ledger identity. Right: the factory records handle?.driver ?? handle; attemptConnect computes handle.driver ?? handle, stamps the datasource name on it and passes that same object to registerDriver. toSpec always carries record.name, so the per-name key is the stamped name. The floor never wraps a managed datasource (needsExternalDriverFloor answers false for managed or no schemaMode), so reconnect's restoreOldPool hands back the ledgered instance, not a wrapper.
  • Order. Right: the guard is still the first kernel.use; ObjectQLPlugin.start runs adoption, then ql.init(), then objectql:drivers-ready, then installRegisteredSchemas. All four come after the wrap is in place. In the init phase only DefaultDatasourcePlugin connects anything, and only the default driver under its natural name. Nothing writes to a managed datasource before the wrap exists.
  • No false refusal on the paths read: the default driver and its driver.* republication carry a reverse-DNS natural name and default is excluded; verify's stand-ins for mongodb, the SQL ids and memory are the ledgered instances; re-registering the same instance passes the wrap and is the engine's quiet no-op. The main mongodb/SQL boot in the test file runs with the guard and the wrap mounted and is green in CI, which is the measured half. One over-refusal: S3.
  • N4 rethrow in bootClaimed: when bootstrap() rejects and the guard has refused, the guard's sentence is thrown with the kernel error as cause. Right for the three pinned shapes. Its edges: N6.
  • Public surface: createManagedStandInLedger, ManagedStandInLedger, ManagedDatasourceDriverGuard and the standIns option are module exports only. index.ts does not re-export the module and package.json exports only .. No key, flag, boot option or published export is added. Right (ruling item 3).
  • Tests: three boot pins (the driver.NAME key, another key with the driver named after the datasource, a drivers-ready handler), each asserting the bare sentence and the recorded calls, plus a ledger unit pin. The two new shapes were red on the round-1 head by the dev report; Test Core is success on this head.

② Semver level

.changeset/35640-verify-memory-stand-in.md: @objectstack/verify patch, ! title, two BREAKING bullets with FROM, TO and the fix, one ADR-0087 marker, both declaration lines. Check Changeset is success on the head.

Clause-②: no (narrowing) — matches. The delta refuses more boots and adds nothing a metadata author can write; Metadata-protocol: none and patch with the banner hold. The second bullet now says where each shape is refused, which is what the code does. Its FROM line does not describe one subset of what the wrap refuses (S3), and its closing "receives no call" is slightly wide for one shape (N8).

③ Boundary flags

  • open_questions: empty in the round-2 dev report (7068908625).
  • Dev flag, the PR body described the round-1 head: the body read here is at this head per the seat's note 7068931775; judged on the tree in any case.
  • Dev flag, the wrap lives on the engine instance, so a plugin that replaces the objectql service or takes the guard's name steps around it: agreed, sabotage class, stated in the jsdoc. Three more of the same class in N7.
  • Dev flag, N2 and N3 of round 0: untouched by the delta, not re-judged.
  • L1-b's observation (7068961827), a caught refusal leaves the boot running: read from the code and graded as N6.
  • SQL push-down: the delta adds no query, no id materialisation and no in-app join. No finding.

④ Design judgment

S2: closed. Both halves it named are refused at this head: a driver.* service under another key whose instance is named after the datasource is caught at the guard's start(), and a registration from an objectql:drivers-ready handler is caught at the wrap before the engine holds the driver. Both are pinned, and the dev's ablations of each leg turn a pin red.

N4: closed. The caller receives verify: refusing to boot: … bare, with the kernel's wrapped error as cause; the three pins assert the prefix.

Is the wrap an acceptable shape. Yes, not a must-fix. registerDriver is a declared member of the engine contract (packages/spec/src/contracts/objectql-engine.ts) and the engine's own text calls it the one funnel; the wrap adds a refusal in front of it and forwards unchanged, on an engine verify built and discards with its kernel. It does not paper over a broken contract, so it is not the workaround AGENTS.md forbids. The repo already ships the same shape: os migrate's dry run shadows registerDriver on the engine instance (packages/cli/src/utils/schema-migrate.ts, shadowEngine). The cleaner shape would be an admission seam the engine owns (a registration check passed to ObjectQLPlugin or the ObjectQL constructor). That is a new public member of @objectstack/objectql, outside packages/verify and against the ruling's "adds no key, flag or contract". Inside packages/verify the only alternative is handing ObjectQLPlugin a subclassed engine through its existing ql option; it would cover registration from construction on, but verify would then build the engine itself and lose the plugin's own construction path (the kernel logger hand-off), for the same refusal. Not asked.

Tried to break it:

  • S3 (should-fix) — The wrap refuses a registration that could not have taken the name. It throws for any foreign driver named after a managed datasource, whether or not the engine already holds verify's stand-in under that name. When it does, the engine's own rule keeps the stand-in and discards the newcomer with a warning, and nothing reaches the foreign driver. Round 1 read exactly that path as sound. Two shapes reach it: an app's runtime.onEnable bridge calling drivers.register (AppPlugin runs connectDeclared before onEnable, and onEnable is awaited outside any catch, so the throw fails the boot; verify does not pass skipOnEnable), and an app plugin registering in its own start(), which runs after AppPlugin's. Those boots ran on the stand-in at round 1 and satisfied ruling item 1; at this head they are refused. The ruling is "swap when possible, otherwise refuse", and here the swap had already happened. The refusal sentence ("the boot would run on that driver instead of verify's in-memory stand-in") and the changeset's FROM line ("booted on the plugin's driver") are false for this subset. It fails closed, the changeset's "or anywhere else" does declare it, and it needs a hand-written bridge under a managed datasource's own name, so it is not a must-fix. Fix, either: let the wrap forward when the engine already holds a ledgered stand-in under that name (standIns.isStandIn(name, engine.getDriverByName(name))), so only a registration that would take the name is refused, with a pin for the late registration; or the seat records on the card that the stricter refusal is accepted, and the sentence and FROM line are bounded to say so. The first moves the head and needs a delta review.
  • N6 (nit) — refusal is read only when bootstrap() rejects. If the caller of registerDriver catches the throw and carries on, the foreign driver is still never registered and the stand-in takes the name, so "verify writes only to stores it creates" holds, but the boot is not refused although the README, cli.mdx and the changeset say it is. The reverse also holds: a refusal that was swallowed followed by an unrelated boot failure is reported as the guard's sentence, with the real error only in cause. No in-repo caller swallows it (the adoption loop and the hook trigger both propagate, as the pins show), so it takes a plugin that wraps its own call. Checking refusal after a bootstrap() that returned normally closes the first half in two lines; fold it in if the head moves for S3.
  • N7 (nit) — The jsdoc's "Not covered" list is short by three, all the same sabotage class as N5: calling ObjectQL.prototype.registerDriver on the engine, deleting or overwriting the own property (it is assigned plain, writable and configurable), and a driver whose name is a getter that answers differently on the wrap's read and the engine's. "Its driver map is private" is true of the TypeScript type only. No action asked beyond the wording.
  • N8 (nit) — README: "the driver is refused before the engine holds it, so it receives no call"; changeset: "Either way the plugin's driver receives no call". For a driver a plugin puts straight into the engine in init(), the engine does hold it until the guard's start(), and registerDriver offers it the two resolver setters. No connect, schema sync, seed or write reaches it, which is what the sentence means and what the jsdoc says correctly. Prose faces only.

Checked and found sound: unregisterDriver followed by a re-register of a foreign driver is refused at the wrap, and an eviction alone leaves the name with no driver, never a real one; the floor rewrap cannot introduce a driver, only re-wrap one already admitted; reconnect rebuilds through verify's factory and its restore path passes the wrap; DefaultDatasourcePlugin's own local connection service connects the default driver only; when datasources are declared only under packages[] the admin plugin is not mounted, so nothing connects them, while the guard (which reads both shapes) still refuses a foreign driver; a second ObjectQL a plugin builds for itself is not the engine any declared object routes through. cli.mdx is unchanged and says no more than ships: both refusals, no flag. One limit carried from rounds 0 and 1: everything reads the configuration handed to bootStack, and the jsdoc now says so.

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: claude/issue-35640-verify-memory-stand-in
Reviewed-by: session_01FEkQ5kt9AD1TPLy7Y9oa9D

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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D

Final green head after rework round 3: 205d953c4e68400e3002f9b1693e20a0fc6d8a5f. Check-runs on it: 55, 40 success (Dogfood Regression Gate among them), 15 skipped, 0 failed or pending. Round 3 answers contract review 7069009856 (S3: a late registration while verify's stand-in already holds the name is now discarded and the boot runs on the stand-in, not refused; N6: a caught refusal still refuses, an unrelated failure keeps its own error; N7, N8: prose bounds). Report: #35640 comment 7069764734, full dogfood battery on this head in its dogfood_battery. PR body brought to this head. Owed next: L1 delta read and a ceiling-tier contract delta review; Tier H hand-off after both.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd
L1-b · 2026-11-21T21:54Z

席位核对 — ACCEPT (delta) · head 205d953

Delta read only: 26abb3e92..205d953c4, 2 commits (pins first, then the fix), 5 files, +256/−50. It answers the Fable delta record 7069009856 (S3, N6, N7 and N8). My ACCEPTs 7067006119, 7067971194 and 7068961827 stand for everything outside this delta.

  • Shape: l1-face.mjs --pr 36171 at 205d953 flags only dogfood, and that is met. Report 7069764734 gives dogfood_battery = "205d953c4 · os-verify-lock: VERDICT command-exit 0 · Tests 4101 passed | 68 skipped (4169) · no failures", the full battery on this head.
  • S3, checked against the engine: the wrap now refuses only while the engine does not hold verify's stand-in under the name (!standIns.isStandIn(ds.name, guarded.getDriverByName(ds.name))). Otherwise it forwards to the engine.
    • RegistrationFacet.registerDriver (packages/objectql/src/engine-registration.ts), on a name it already holds, only reads name / version for its collision warning and returns. It does not set, resolve, floor or call the newcomer, so the stand-in is kept and the foreign driver gets no call.
    • This matches the ruling, "writes only to stores it creates", and refuses only where verify cannot stand in.
    • A plugin that evicts the stand-in first (unregisterDriver) is refused again, because the engine no longer holds it.
  • N6, your round-2 reading of my observation:
    • After a bootstrap() that returned, bootStack refuses whenever refusal is set. It closes the http server, shuts the kernel down, restores the tenancy posture, then throws the bare sentence.
    • In the catch, refusalIn(e) walks e's cause chain for an error the guard itself threw (a WeakSet of its own errors), so a boot that failed for another reason keeps its own error. The cycle guard is a seen set.
  • N7 and N8, prose: the refusal sentence now adds "while verify's in-memory stand-in did not hold it". The TSDoc "Not covered" list names the deliberate bypasses: the prototype method, overwriting the wrap, and a name getter that answers differently.
  • Pins: 4 new ones, all red on 26abb3e (4 failed | 28 passed) and green here (32 passed). The package gives 55 files and 500 tests passed, and typecheck is clean.
    • vml (app plugin start()) and vmo (runtime.onEnable bridge) now boot on the stand-in. GET returns [SEED], a POST returns 201, and the foreign driver's calls are exactly [plugin.init, plugin.start] / [onEnable].
    • vmw (a drivers-ready handler that catches the refusal) is refused with the bare sentence.
    • vmf, the CONTROL, is a caught refusal followed by the plugin's own start failure. It reports that failure, not the guard's sentence.
    • Three ablations come from the dev's report, and I did not re-run them. Each file was restored to its HEAD blob:
      • Forward condition set to true: vml and vmo red.
      • Post-return refusal disabled: vmw red.
      • Identity check replaced by refusal alone: vmf red.
  • Text, read sentence by sentence:
    • The changeset's second BREAKING bullet now scopes the refusal to "before verify's stand-in holds the name". It says a later driver is discarded and that boot runs on the stand-in. Its FROM/TO lines say so too, and TO adds "even when the plugin catches the refusal and carries on".
    • The README Posture paragraph and the harness.ts and stand-in headers say the same.
  • Gates at 205d953: 42 success, 17 expected skip, 0 unexpected skip, 0 failed and 0 pending. Check Changeset finished success after I first read it.
  • Landing: unchanged. ! plus (narrowing) makes this Tier H. The Fable delta review round 3 on this head comes first, and then the PR goes to the seat. The area does not land it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 205d953c4e68400e3002f9b1693e20a0fc6d8a5f
Local-runs: none
Scope: packages/verify/src/managed-datasource-stand-in.ts, packages/verify/src/harness.ts, packages/verify/src/verify.managed-datasource-stand-in.test.ts, .changeset/35640-verify-memory-stand-in.md, packages/verify/README.md, content/docs/deployment/cli.mdx + read in the cited code, not reviewed: packages/objectql/src/engine.ts, packages/objectql/src/engine-registration.ts, packages/objectql/src/engine-compatibility-section.ts, packages/objectql/src/external-driver-floor.ts, packages/objectql/src/plugin.ts, packages/services/service-datasource/src/datasource-connection-service.ts, packages/runtime/src/app-plugin.ts, packages/core/src/kernel.ts, packages/verify/src/index.ts, packages/verify/package.json

DELTA record, round 3. PR #36171, card #35640, ruling 7065449898 (C+A). It follows round 0 (7067086844, PASS on 6c1965975d6a), round 1 (7068014028, PASS on a81e77767266) and round 2 (7069009856, PASS on 26abb3e92ac6, S3, N6, N7, N8). Inputs: the card body and its 13 comments (dev report 7069764734 among them), the PR body, file list (8 files) and its comments (the three earlier records, L1-b's delta ACCEPTs 7067971194 and 7068961827, the seat's head note 7069790496), the net diff against merge base 411fe24b4394, the round delta 26abb3e92ac6..205d953c4e68 (5 files, +256/-50), the tree at the head, and the check-runs on the head. No L1-b ACCEPT for this delta is on the PR yet. derive.ts, derive.test.ts, packages/runtime/src/default-datasource-plugin.ts and plugin-order.ts are not touched by this delta and nothing in it changes what they are asked; their earlier reading is carried.

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

  • The forward condition in the wrap: refuse only when the driver is named after a managed datasource, is not a ledgered stand-in for that name, and the engine's current holder of that name is not a ledgered stand-in for that name either. Right. getDriverByName returns the engine's map entry as is; ManagedStandInLedger.isStandIn tests that exact object against the per-name WeakSet the factory fills. It is an identity test on the held instance, not a test on the name. An engine with no getDriverByName, or no holder, answers undefined, which is not a stand-in, so the registration is refused.
  • What the forward reaches. Right. RegistrationFacet.registerDriver reads this.drivers.get(driver.name); with a holder present it logs and returns on all three branches (other instance, same instance as default, same instance). drivers.set, both resolver setters, applyExternalDriverFloor and the default-driver assignment all sit after that return. The discarded driver has its name and version read and one WeakMap lookup made on it; no method of it is called. isDefault: true on the forward changes nothing, the early return precedes the default assignment.
  • Who else could call the discarded driver. Nothing in the boot: ql.init() and schema sync walk the engine's map, the connection service connects only what its factory built, and ObjectQL's driver.* adoption loop ran in its own start(), before any later plugin could publish a service. AppPlugin's onEnable bridge calls ql.registerDriver(driver) and nothing more.
  • refusalIn. Right. The kernel rejects a failed start() with a new error whose cause is the original (kernel.ts, the rollback branch), and rejects a boot-phase hook failure with the handler's own error; the walk finds the guard's error in both. Identity is by a WeakSet of the Error objects the guard itself threw, so a foreign error that copies the sentence is not taken for one. The walk is cycle-safe and stops at a non-object.
  • The post-return refusal in bootClaimed. Right. It runs the same three steps as stop() (close http-server, kernel.shutdown(), restoreTenancyPosture()), each close best-effort; restoreRegistryLogLevel has already run in the finally; the configuration claim is released by bootStack's catch. Nothing the boot acquired is left held.
  • Public surface. refusalIn is a member of ManagedDatasourceDriverGuard, a module export only. index.ts and package.json are untouched by the delta; package.json exports only .. No key, flag, boot option or published export is added. Right.
  • Tests. Four new pins: vml (late registration from an app plugin's start()) and vmo (the runtime.onEnable bridge) assert a boot that succeeds, the seed row and a REST-created row read back, and recorded calls of exactly the registration itself; vmw asserts a swallowed refusal still refuses with the bare sentence; vmf is the control that an unrelated start failure keeps its own message. By the dev report all four were red on the round-2 head and each of three ablations turns its pin red; Test Core is success on this head.

② Semver level

.changeset/35640-verify-memory-stand-in.md: @objectstack/verify patch, ! title, two BREAKING bullets each with FROM, TO and the fix, one ADR-0087 marker, both declaration lines. Check Changeset is success on the head.

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. Metadata-protocol: none and patch with the banner hold. The second bullet is now bounded to a registration made before the stand-in holds the name, its FROM line opens with that condition, and its TO line carries the caught refusal. All three are what the code does.

③ Boundary flags

  • open_questions: empty in the round-3 dev report (7069764734).
  • Dev flag, the PR body described the round-2 head: the seat's note 7069790496 says it was brought to this head; judged on the tree in any case. The body carries Clause-②: no (narrowing) and Metadata-protocol: none.
  • Dev flag, N2 and N3 of round 0 (os validate and the two older changesets): untouched by the delta, not re-judged.
  • Dev statement "cli.mdx is unchanged: it says no more than ships": not quite, see N9.
  • SQL push-down: the delta adds no query, no id materialisation and no in-app join. No finding.

④ Design judgment

S3: 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 start(), the onEnable bridge) boot on the stand-in and are pinned with their writes read back from it. This is the first of the two fixes round 2 offered, and it restores ruling item 1 for those boots: swap when possible, refuse otherwise.

Tried to make the forward leave a foreign driver in place:

  • unregisterDriver then a foreign re-register: the holder is gone, so the wrap refuses. Sound.
  • reconnect: it evicts, then awaits connect. In that window the name has no holder and a foreign registration is refused. The rebuilt driver comes from verify's factory and is ledgered before it is registered; restoreOldPool hands back the ledgered old instance. Sound.
  • A stand-in held only transiently (attemptConnect's rollback evicts what it registered): no await sits between registerDriver and the def registration, and after an eviction the name has no holder, so a later foreign driver is refused. Sound.
  • The external-driver floor: needsExternalDriverFloor is false for managed or no schemaMode, so a stand-in is never wrapped. If a def ever did floor it, the holder would be the wrapper, which is not ledgered, and the wrap would refuse. It fails closed.
  • A managed datasource nothing routes to is never connected (AppPlugin's D2 gate), so no stand-in holds its name and a late registration under it is refused, as the bounded text says.
  • Handler order on objectql:drivers-ready for a mapped datasource: a foreign handler that runs before AppPlugin's is refused, one that runs after is discarded. Either way the foreign driver never holds the name.
  • A driver whose name answers differently on the wrap's read and the engine's is the one way through the forward. It is the sabotage class and is now named in the jsdoc.

N6: closed. A refusal the caller swallowed is read after a bootstrap() that returned, and the boot is refused after the shutdown described in ①. A boot that failed for another reason keeps the kernel's error, because the sentence is taken only from an error the guard threw that is in the failure's cause chain. Both halves are pinned. Two things seen and not graded: the post-return throw names the last refusal only, when a plugin swallowed more than one; and the rejected-bootstrap() path does not call restoreTenancyPosture, which is the same on main for every failed boot and is not this delta's.

N7: closed. The jsdoc's "Not covered" list names the prototype call, deleting or overwriting the own property and the two-faced name, and "private" now reads "private in the TypeScript type only". Each matches the code.

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 init(); the engine holds it until the guard's start() refuses the boot. No connect, sync or write reaches it there either.

  • N9 (nit) — content/docs/deployment/cli.mdx still says os verify "refuses the same way when a plugin registers a driver of its own under a managed datasource's name, whatever driver id the datasource declares", with no bound. At this head a registration made once the stand-in holds the name is discarded and the boot runs. The README and the changeset were bounded this round; this sentence was not. It overstates a refusal in the safe direction (that boot writes only to the stand-in). Adding "before verify's stand-in holds it" to the sentence makes the three faces agree; fold it in if the head moves.

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 bootClaimed comment are bounded the same way and match.

Regression on rounds 0 to 2: none found. The start-time driver.* scan, the start-time engine check, the ledger and the factory are unchanged; the wrap refuses a subset of what it refused at round 2 and still refuses every registration that could take the name; the three round-2 refusal pins are in the green suite.

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: claude/issue-35640-verify-memory-stand-in
Reviewed-by: session_01FEkQ5kt9AD1TPLy7Y9oa9D

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv

席位核对

Awaiting the maintainer's merge (narrowing) · 2026-11-21T22:00Z · head 205d953c4e68400e3002f9b1693e20a0fc6d8a5f

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 21, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 21, 2026 22:03
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 9a3a500 Nov 21, 2026
68 of 69 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-35640-verify-memory-stand-in branch November 21, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

os verify still lets the app's own seed and hooks write into a managed mongodb or plugin-driver datasource

3 participants