Skip to content

Spec docblock: FilterCondition form 4 says the nested-relation form is served "the same on every driver" by reading related ids, but drivers without readableIdsLeaf refuse it and SQL pushes it down as a subquery #35592

Closed

Description

@objectstack-fleet

repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb

Filing gate ①, Source: fleet. Found by the CONTRACT_REVIEW_TIER review of PR #35574 (card #35494), record 7015837933 (§③, the dev's out-of-scope flag); on lines that PR does not change. Dedupe: "same on every driver" (0 open issues), readableIdsLeaf docblock (3 hits: #35494 open, the hop-limit sentence only; #34797 and #33876 closed, refusal message and engine refusal, not this docblock).

What is false

packages/spec/src/data/filter.zod.ts, the form 4 paragraph of the FilterCondition docblock (about lines 2214–2229 at b65488a8), ships verbatim in @objectstack/spec (files[] carries src/**/*.zod.ts) and says three things the engine does not do:

  1. "The query engine SERVES it in where, the same on every driver". On a driver that does not declare readableIdsLeaf (MongoDB, OData), a single-valued relation condition on a read verb is refused up front with INVALID_FILTER / 400: packages/spec/src/data/driver.zod.ts:454–462 and relationReadDriverRefusal in packages/objectql/src/relation-filter-lowering.ts (about :370). The hand-written page content/docs/kernel/contracts/data-engine.mdx already says "the same on every driver that serves it" (about :192) and states the refusal (about :225), so two published texts disagree.
  2. "reads the related object with the condition AS THE CALLER … and matches the relation field against the ids it returns". On a SQL driver a read verb pushes the condition down as one subquery (PR fix(core): drill a relationship path as one nested-relation condition, pushed down by the server #35423's verification: one statement, no related-id read), not an id read.
  3. "A condition matching more related records than the engine's cap is refused rather than truncated". It holds only where ids are read; the subquery path caps nothing (relation-filter-lowering.ts module header, about :34–44).

reach: shipped text an author or agent reads (the docblock reaches the generated schema descriptions); measured by reading the cited code at b65488a8, not run.

Done when

The paragraph states, per verb and driver capability, how the form is served (subquery push-down where the driver can, the bounded id read where it cannot prove the subquery, refusal on a driver without readableIdsLeaf), the cap sentence is scoped to the id-read path, and it agrees with data-engine.mdx. Text only, no behaviour change; a patch changeset on @objectstack/spec (the file ships).

Business rationale

Builders and AI agents write filters from the spec's own docs. Told "same on every driver", an agent writing a MongoDB-backed app writes a nested-relation filter that the engine refuses at query time. Reader: the area:data lane seat that holds the filter docblock (d7-C today), one docs-only PR.

Grade: p2 · area:data · Bug · builders, often · evidence read (same class and reach as #35494, which triage graded p2: "a wrong sentence in shipped text is a Bug at that reach").

Activity

  1. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:spec · pm:queue; rationale: area:data · Bug (the shipped FilterCondition form 4 docblock says the nested-relation form is served "the same on every driver"; drivers without readableIdsLeaf refuse it with 400) · builders, often (the docblock ships in @objectstack/spec and feeds the schema descriptions agents read) → p2 as set under the shipped-text rule. Same paragraph as #35494 (the hop-limit sentence): one PR can carry both.

  2. added
    domain:spec
    pm:queue
    on Nov 19, 2026
  3. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb

    Claim: PM loop round 3
    Session: session_01L9qibvVRcFWKrfWeG5jzPb
    Account: os-tesla
    Branch: claude/issue-35592-form4-driver-docblock
    Worktree: objectstack-issue-35592
    Domain: domain:spec
    Seat: repo:objectstack#7
    Area: d7-C
    File surface: packages/spec/src/data/filter.zod.ts (the FilterCondition form 4 docblock prose only), content/docs/kernel/contracts/data-engine.mdx only if the two must be reconciled there, generated reference docs that copy the sentences (regenerated, never hand-edited), one .changeset/35592-*.md (@objectstack/spec patch) (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: opus (default tier; text-only docblock, no accept-set change; the contract-tier review runs before the queue), effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: packages/spec FilterCondition docblock in objectstack | the form 4 paragraph says "the same on every driver" and describes an id read; drivers without readableIdsLeaf refuse and SQL pushes down a subquery | builders and agents writing nested-relation filters, often
    Thread-read: 7015926451
    Premise: holds (origin/main cceb5c6: PR #35574 changed only the hop-limit sentences of form 4; the "same on every driver" / related-id-read / cap sentences still stand)
    Serial constraints cleared: open-PR file probe over both files at origin/main cceb5c6: 0 of 47 open PRs touch them; predecessor PR #35574 (#35494, same paragraph) merged 2026-11-20 05:14Z
    Pre-claim lane: packages/spec/src/** docblock prose (domain:spec), area:data; stays with seat 7 d7-C per the seat's area map (filter grammar docs).
    Pre-claim deps: no Blocked-by:; #35494 closed (PR #35574 merged).
    Prior rulings read: spec,docblock,filtercondition,form,says,nested-relation,served,driver,reading,related,drivers,readableidsleaf (+3 more) → 199 hits; ADR-0139 D3, ADR-0155 D1, ADR-0144 D8, ADR-0145 D2, ADR-0014 Decision §2, ADR-0027 Decision §12, ADR-0035 Decision §3; thread: none; repo: objectstack-ai/objectstack. ADR-0139 D3 ("Driver obligations: compile it, or refuse loudly") is the ruling the corrected sentence states.

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 20, 2026
  5. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
    os-dev-report

    {
      "issue": 35592,
      "status": "done",
      "branch": "claude/issue-35592-form4-driver-docblock",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/35777",
      "session": "session_01L9qibvVRcFWKrfWeG5jzPb",
      "premise_still_valid": true,
      "summary": "Rewrote the FilterCondition form 4 docblock prose in packages/spec/src/data/filter.zod.ts to the measured engine paths at origin/main cceb5c62: a read verb (find/findOne/count/aggregate) on a single-valued relation is one subquery where provably the same read; a multi-valued relation, update, delete and an unprovable read take the related-id read; a driver without DriverCapabilities.readableIdsLeaf (MongoDB, OData) refuses a single-valued condition on a read verb up front, INVALID_FILTER / 400 (ADR-0139 D3 as amended); the cap sentence is scoped to the id-read path and names RELATION_FILTER_ID_CAP. content/docs/kernel/contracts/data-engine.mdx was measured correct and agrees, so it is untouched; no generated reference copies the sentence. One patch changeset on @objectstack/spec. Text only, no schema/type/behaviour change.",
      "files_changed": [
        "packages/spec/src/data/filter.zod.ts",
        ".changeset/35592-form4-driver-docblock.md"
      ],
      "line_budget": "changed lines 36 (+27 / -9, 2 files), under the 3000 human-merge threshold",
      "tests": "Text only: no tests added, no ablation (no tested behaviour changed). pnpm --filter @objectstack/spec build under os-verify-lock at 981517ac: VERDICT command-exit 0. Spec unit tests and typecheck not run locally (comment-only diff), declared to CI.",
      "gates": "Head 981517ac. Re-derived (dispatch list included data-engine.mdx, untouched): dispatch-gates --commands --repo objectstack-ai/objectstack = 83 commands; each run with exit captured before any pipe; --ran reconciliation: 83 derived, 79 run, 4 NOT-MEASURED, 0 UNRUN. 79 exit 0 (incl. spec check:docs, check:api-surface, check:authorable-surface, check:spec-docblock-symbol-anchors, check:doc-authoring, check:nul-bytes, check:issue-citations, check:adr-anchors, check-adr-0087-registration, check-empty-changeset, check-changeset-no-major). NOT MEASURED exit 3 (prerequisite): check:dual-build-cjs-loads, check:lean-entry-closure (whole-repo build), lint check:doc-formula-expressions (formula+lint unbuilt), check-plugin-teardown-shape --self-test (shallow clone). overlap-check: VERDICT clean exit 0. PR check-runs at report time: all in_progress (Check Changeset, Lint & repo gate jobs, Type Check jobs, Governed Surface Queue Guard, Spec property liveness); none concluded.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "3 — git push (2 pushes of the branch: empty-branch probe, then commit 981517ac); relay pr_create (objectstack-ai/objectstack, POST pulls + assignees os-tesla, run 44689284402, read-back identical 4562 bytes); relay os-dev-report comment on #35592 via post-stamped.mjs",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [],
      "deviations": "Container restart cut the background gate loop after 77 of 83 commands; the remaining 6 were re-run in the foreground, all exit 0. Commit trailer is the AGENTS.md model-free pair, not the harness's model-named Co-Authored-By. ADR-0155 D1 read: it governs the share-grant leaf, not this author-written form, so nothing from it is quoted. L2 owed: one CONTRACT_REVIEW_TIER review (diff touches packages/spec/src/**), not requested."
    }
  6. removed
    pm:dispatched
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:datadomain:specpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions