Skip to content

driver-memory census in undeclared-field-write-driver-split.integration.test.ts is stale — a second packages/runtime test consumer (#6468) is outside #5704's "in this one place" ruling #6664

Description

@os-zhuang

Observation-class finding, surfaced while migrating auth-contains-filter.test.ts off driver-memory (#5893). Nothing a user hits — this is a bookkeeping invariant of the driver-memory retirement programme that has silently expired. Filed unassigned for PM triage; not fixed in #5893's PR (out of its file surface, and the disposition needs a ruling rather than an edit).

What is stale

packages/runtime/src/sandbox/undeclared-field-write-driver-split.integration.test.ts opens with a load-bearing census sentence:

@objectstack/driver-memory is imported here ON PURPOSE, and this is the only PERMANENT test consumer of it in the repository.

and closes the same block with the mechanism that sentence exists to serve:

#5704/#5784 renamed them all to makeStubDriver, precisely so that grepping for the driver lands here, and only here.

That is the verification handle the retirement programme uses: grep the declarations, land on exactly one ruled file, and anything else is a new arrival to dispose of. The count is no longer true.

Evidence (on origin/main, e6025e9)

$ git grep -n "from '@objectstack/driver-memory'" -- '*.ts' | grep -v node_modules
packages/runtime/src/sandbox/undeclared-field-write-driver-split.integration.test.ts:107
packages/runtime/src/autonumber-seed-cross-side-parity.integration.test.ts:35
examples/embed-objectql/src/index.ts:17

The second line is the finding. packages/runtime/src/autonumber-seed-cross-side-parity.integration.test.ts arrived with #6468 (PR #6553, fix(objectql,driver-sql): 播种解析按声明的 suffix 定位计数器) — after #5704's survey and after #5830's follow-up — and it imports InMemoryDriver for a reason that reads exactly as permanent as the ruled file's:

The engine half runs on the REAL InMemoryDriver (supports = {}, so the engine's fallback owns the counter — the shape memory/mongo deployments run) and the driver half on a REAL SqlDriver over better-sqlite3, each holding the same fixture rows.

i.e. it is the same shape of justification #5704 Q2=B accepted for the driver-split file — a cross-family divergence/convergence pin that structurally needs a schemaless arm — but it has never been through that ruling, carries no ⚠️-block saying so, and is not named anywhere in the census it invalidates.

(examples/embed-objectql/src/index.ts is a published example demonstrating the driver, not a test consumer; packages/runtime, packages/cli, packages/services/service-datasource, packages/plugins/plugin-dev and examples/embed-objectql declare the dependency in package.json. Those are a separate axis and not what this finding is about.)

Why it matters even though it is "just a comment"

The census IS the enforcement. There is no gate counting driver-memory consumers — #5704's design deliberately made the grep authoritative by renaming every look-alike stub to makeStubDriver. So the comment is the only thing telling the next agent what a grep hit means. As written today it tells them "one hit, and it is ruled" while the tree has two, one of them unruled. Two concrete ways that misleads:

  1. An agent verifying "driver-memory retirement is complete" greps, sees two hits, reads the ruled file's "only here", and concludes the other hit is a migration leftover to delete — deleting the schemaless arm of 自增号格式带「序号槽之后的后缀」时,播种解析读错数字段:引擎读成年份(2026),driver-sql 读成拼接串(12026),两侧还互不一致 #6468's convergence assertion, which would leave the autonumber parity test asserting SQL against SQL.
  2. The opposite error: an agent takes the second file as implicitly covered by driver-memory 测试面替代:项目内测试后端迁到 sqlite :memory:(#5499 重启条件 · memory 半边,维护者 2026-08-06 立项) #5704 and stops looking, so a third arrival never gets disposed of either. [finding] #5704 收口后仓内新增一个 driver-memory 测试消费者:plugin-auth/auth-contains-filter.test.ts(#5710 pin 测试,与 #5704 程序不变量的张力,请分诊裁处置) #5830auth-contains-filter.test.ts 的见证后端迁 sqlite 排在 #5702 之后 —— #5830 裁决 C 的到期单 #5893 is the worked example of what the census is supposed to catch; it worked because the ruled file's comment was updated by hand each time, which is exactly the step that did not happen for 自增号格式带「序号槽之后的后缀」时,播种解析读错数字段:引擎读成年份(2026),driver-sql 读成拼接串(12026),两侧还互不一致 #6468.

#5893's PR corrects the ruled file's own sentence so it no longer claims a repository-wide count it cannot defend (it now claims a ruling about itself, and points here). That stops the comment lying; it does not decide the second file's status.

The decision this needs

For packages/runtime/src/autonumber-seed-cross-side-parity.integration.test.ts:

Recommendation, for whoever triages: A or B on the file (measure before choosing, per #5830's precedent), and C independently — the underlying defect here is not that someone forgot to edit a comment, it is that a programme-critical invariant was left in a comment where nothing can hold it to the tree.

Links

#5704 (the ruling + the makeStubDriver rename), #5499 (the driver-memory investment freeze), #5830 / PR #5880 (identity-lane migration, half), #5893 (the other half — where this was found), #6468 / PR #6553 (the unruled arrival).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions