Skip to content

The 400 that four comments cite as the $searchFields half of the __search contract is asserted by no test #8080

Description

@os-zhuang

Observation-class finding, noticed while implementing #7876 (PR #8079). Nothing is broken today — filing it so the triage round can grade it rather than sitting on it.

What is unasserted

"A $searchFields override naming __search is refused with a 400 ("is hidden")" is now stated in four places in the tree:

No test asserts it. Re-check:

git grep -rln "searchFields" -- packages | grep test | xargs grep -l "__search"

returns three files, and in all three the two names never meet in an assertion — search-companion.test.ts:173 pins the engine-side half (resolveSearchFields will not admit the column even when requestedFields names it), which is a different fact from the ingress gate's refusal.

Why it is only observation-class

The 400 does follow from two facts that ARE pinned, composed:

  1. resolveSearchFields excludes hidden fields (packages/spec/src/data/search-fields.ts:112), pinned by search-companion.test.ts:173;
  2. assertSearchFieldsAreSearchable refuses a known-but-unsearchable name with 400 INVALID_FIELD (packages/metadata-protocol/src/protocol.ts), pinned by query-expression-conformance.test.ts:1390 — on estimate, not on __search.

So the behaviour is real and reachable; what is missing is a test that names this column and asserts the ADR-0112 envelope (code AND status) on it.

Why it may still be worth closing

#7876's ruling makes the 400 load-bearing as a contrast: the projection door's silence is now documented as correct precisely because the authoring door refuses. A future change that let hidden columns clear the searchability gate would leave all four comments false with every suite green, and the one suite whose stated job is "on ANY door" is the one whose docblock asserts it in prose only.

Suggested shape if taken: one case in search-companion-read-projection-conformance.test.ts's matrix asserting code: 'INVALID_FIELD' and status: 400 for a searchFields override naming the companion.

Related: #7876 (the ruling) · PR #8079 (the comments) · #7642 (the projection strip) · #4254 (the gate)

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions