Skip to content

test(objectql): pin the $searchFields=__search 400 that four docblocks cite - #8191

Merged
os-zhuang merged 1 commit into
mainfrom
claude/issue-8080-searchfields-hidden-400-pin
Aug 12, 2026
Merged

test(objectql): pin the $searchFields=__search 400 that four docblocks cite#8191
os-zhuang merged 1 commit into
mainfrom
claude/issue-8080-searchfields-hidden-400-pin

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Fixes #8080

Four docblocks in this tree state that a $searchFields override naming the hidden __search companion is refused with a 400 ("is hidden"). No test asserted it. This adds the pin — one case, test-only.

The gap this closes

The behaviour was real and reachable, but only by composing two separately-pinned facts:

  1. resolveSearchFields excludes hidden fields (packages/spec/src/data/search-fields.ts), pinned by search-companion.test.ts;
  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 — on estimate, not on __search.

A composition is not a pin. Since #7876 (ruled 2026-08-12, direction C) this 400 is load-bearing as a contrast: the projection door's silence is documented as correct precisely because the authoring door refuses. A change letting hidden columns clear the searchability gate would have left all four docblocks false with every suite green.

Does the assertion reach the real gate? Measured, not assumed

The card's own warning was that a pin passing for the wrong reason is worse than no pin. Two independent regression directions were driven, each predicted red before running, each observed red:

Neuter applied Result What it proves
hidden: false on the provisioned companion column (search-companion.ts) new case RED, other 24 in the file green the pin is enforcing the hidden flag itself — the card's exact feared regression
hidden names allowed to clear the gate inside assertSearchFieldsAreSearchable, metadata-protocol rebuilt new case RED the assertion reaches the ingress gate in the other package's built dist, not some nearer refusal

The second run is the sharper one. Under it query-expression-conformance.test.ts stayed 130/130 green — its estimate and id gate pins cannot see a hidden-column regression. The new case was the only thing in the repo that went red, which is the blind spot #8080 describes, demonstrated.

The first run also shows the contrast directly: with the gate failing open, the returned record body still had no __search key. The projection door stayed silent while the authoring door let the override through — exactly the pair #7876 ruled on.

Inside the test the same guarantee is carried by a control: the same door, the same parameter, a legitimate field name, asserted to resolve. A rejection assertion alone would pass just as happily against a call that never reached the gate.

Placement

The card pointed at search-companion-read-projection-conformance.test.ts, and that is where it landed — but as a sibling describe, not a row inside the existing describe.each matrix. Two reasons, both in the test's docblock:

  • The matrix drives engine.find directly; this refusal lives at the REST ingress and needs a protocol in front of the engine. Adding one to the matrix's beforeEach would rebuild every door row's harness for one case sharing none of their assertions.
  • The matrix runs both provisioning states and they do not give the same answer. With OS_SEARCH_PINYIN_ENABLED=false the column is not in the registry field map, so the gate refuses it as unknown — still a 400, but on the typo tier, not the "is hidden" reason the four docblocks quote. Pinning the cited prose means pinning the declared state.

The surrounding matrix is otherwise untouched.

Verification

  • pnpm --filter @objectstack/objectql test — 191 files, 3391 tests, all pass
  • pnpm --filter @objectstack/objectql typecheck — clean
  • pnpm check:query-options-erasure — ratchet holds, no files added
  • pnpm check:type-check-debt --re-measure — 33 entries re-measured, none above its recorded number (no baseline raised, --lower not run)
  • pnpm check:nul-bytes, pnpm check:durability-log-level, pnpm check:engine-double-contract, scripts/check-engine-split-ratio.mjs — all pass

Test-only, releases nothing ⇒ skip-changeset, not an empty-frontmatter changeset.


Generated by Claude Code

…cks cite

Four docblocks state that a `$searchFields` override naming the hidden
`__search` companion is refused with a 400 ("is hidden") — this suite's own
header, `stripSearchCompanion`'s, and `stripSearchCompanionFromRead`'s twice
(the pre-existing sentence and the #7876 ruling block). No test asserted it.

The behaviour was only reachable by COMPOSING two separately-pinned facts:
`resolveSearchFields` excludes hidden fields, and the ingress gate refuses a
known-but-unsearchable name with 400 INVALID_FIELD (pinned on `estimate`, not
on `__search`). A composition is not a pin.

Since #7876 (ruled 2026-08-12, direction C) the 400 is load-bearing AS A
CONTRAST: the projection door's silence is documented as correct precisely
because the authoring door refuses. Measured both regression directions —
flipping `hidden` off on the provisioned column, and letting hidden names
clear the gate itself — the new case is the ONLY test in the repo that goes
red; the 130 neighbouring gate pins stay green.

Refs #8080

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014C8pAprWdmtecFsEprZax4
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Aug 12, 2026 7:24pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

No hand-written docs reference the 0 changed package(s). ✅

@os-zhuang os-zhuang added skip-changeset PR has no user-facing published change; bypasses the changeset gate and removed size/s labels Aug 12, 2026 — with Claude
@github-actions github-actions Bot added the tests label Aug 12, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review August 12, 2026 19:37
@os-zhuang
os-zhuang added this pull request to the merge queue Aug 12, 2026
Merged via the queue into main with commit 6b70248 Aug 12, 2026
32 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-8080-searchfields-hidden-400-pin branch August 12, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants