Skip to content

3 objectql tests fail on clean main: the analytics slot is populated where plugin.step2 / protocol-discovery pin it empty (#3891 expectations) #4013

Description

@os-zhuang

Hit while validating #4011 — reproduced on a clean checkout of main (d6bfb3d) with no local changes, so it is not that PR's doing. Filing per the drive-to-green convention so it doesn't get attributed to whoever touches @objectstack/objectql next.

Repro

pnpm --filter @objectstack/objectql exec vitest run src/plugin.step2.test.ts src/protocol-discovery.test.ts
# Test Files  2 failed (2) · Tests  3 failed | 21 passed (24)

The three failures

All the same shape — the tests pin the ADR-0076/#3891 ruling that the analytics service slot stays empty until service-analytics fills it, and something now fills (or fakes) it:

  1. plugin.step2.test.tsregisterProtocol:false + MetadataProtocolPlugin reproduces the built-in service surfaceexpect(() => kernel.getService('analytics')).toThrow() → did not throw.
  2. plugin.step2.test.tsdefault assembly registers protocol but leaves the analytics slot empty (降级 analytics shim 把 ExecutionContext 丢在门口 —— /analytics/query 在没装 service-analytics 的装配里不注入 RLS/租户谓词,契约字段 where 也被静默忽略 #3891) — same assertion, same non-throw.
  3. protocol-discovery.test.tsshould report analytics unavailable with no advertised route when not registereddiscovery.services.analytics.enabledtrue, expected false.

Reading

The test comments state the intent explicitly: "the slot stays EMPTY until service-analytics fills it … /analytics 404s honestly instead of answering with wrong numbers". Either a recent change legitimately made analytics self-register (in which case these three pins — and the honest-404 story they encode — need a deliberate revision, not a drive-by green-up), or something started stuffing the slot as a side effect and the tests are correctly catching it. Both readings need an owner who knows the #3891 intent; mechanically flipping the assertions would erase the ruling they exist to protect.

Likely candidates are whichever of the recent protocol/spec merges touched service assembly (the failures exist at d6bfb3d; I did not bisect further).

Not v17-blocking if the behaviour change was intentional — but worth deciding before the release, since "analytics answers with wrong numbers instead of 404ing honestly" was the exact bug #3891 fixed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions