Skip to content

fix(rest): apply the object filter to the form list - #39597

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-39004-wip
Dec 4, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-39004-wip

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxRh6Sbfo2Xm49JPx6

Requested by Elon · project thread
Fixes #39004

Out-of-scope filed: #39612 (an empty or bracketed ?object= on the form list answers every form, while view refuses both; a narrowing, kept out of this Clause-②: no PR).

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:按对象读取表单列表的客户端(协议 19 之后),改动前拿到所有对象的表单,改动后只拿到所问对象的表单;不带对象条件的表单列表不变。
  • 为什么做:元数据读取接口的表单列表忽略了对象条件,这张卡把它补齐,和视图列表的对象条件一致。
  • 出错会怎样:最坏情况是某个客户端按对象读表单时列表变少或变空;改动只在一个列表步骤里,可以直接撤回。
  • 要你做什么:无。

What changes

GET /api/v1/meta/form?object=X applied no object filter: step 4 of the shared list chain (createMetaListAnswer in packages/rest/src/meta-item-read-gate.ts) narrowed view only, so the form list answered every form with 200. A new step 4a keeps the forms whose object (the ADR-0159 D2 binding of a form item) equals the filter, sorted by name; an object no form names answers the empty list, as the view list does. Both transports (RestServer and the runtime dispatcher's /meta domain) share this chain, so one edit covers both. No query parameter is added (object is already in the list's closed set), and nothing else in the chain moves.

Tests

New packages/rest/src/meta-form-object-filter-39004.test.ts, at the door over the real protocol (real ObjectQL, SQLite store, RestServer route handler), two objects each with forms and a list view:

  • another object's forms are absent from ?object=A (and ?object=B lists only B's);
  • an unknown object answers 200 with an empty list, for form and for view alike;
  • control: /meta/form with no filter lists every form;
  • control: ?object= on view is unchanged.
Red first, at the base (commit 06a2c8a, test only)
× answers only the named object's forms; another object's are absent
  expected [ 'mfo_alpha.contact', …(2) ] to deeply equal [ 'mfo_alpha.contact', …(1) ]
× an object no form names answers an empty list, as the view list does
✓ control: the form list with no filter still lists every form
✓ control: `?object=` on the view list is unchanged
Tests  2 failed | 2 passed (4)
Green, and the package (head 420b9c7)
meta-form-object-filter-39004.test.ts: Tests  4 passed (4)
pnpm --filter @objectstack/rest typecheck && pnpm --filter @objectstack/rest test
 Test Files  452 passed (452)
      Tests  9376 passed | 351 skipped (9727)
VERDICT command-exit 0

Acceptance notes

  • Empty ?object= on the form list still lists every form (200, measured at head 420b9c7), while the view list refuses it with 400 VALIDATION_ERROR. Refusing it on form adds a new refusal to the door, outside this card's declared change; reported to the seat as a finding rather than folded in.
  • The META_LIST_QUERY_PARAMS doc comment still calls object "the view switcher"; prose only, left as is.
  • ?object[]= on the form list was already refused (400, as a name the list does not read); unchanged.

Verification

Read first:

  1. packages/rest/src/meta-item-read-gate.ts, the new step 4a after step 4 in createMetaListAnswer (the only runtime hunk).
  2. packages/rest/src/meta-form-object-filter-39004.test.ts, the boot and the four pins.

Two-minute check: pnpm --filter @objectstack/rest exec vitest run src/meta-form-object-filter-39004.test.ts prints Tests 4 passed (4); revert step 4a and the first two pins go red with mfo_beta.contact in A's list.

Local gates (head 420b9c7)

dispatch-gates --commands derived 71 families for this change set; --ran reconciliation: 71 derived, 68 run (all exit 0), 3 NOT MEASURED, 0 unrun. NOT MEASURED, left to CI: pnpm check:dual-build-cjs-loads (PREREQUISITE NOT MET, needs a full pnpm build), pnpm check:query-options-erasure and pnpm check:type-check-debt (each over a 280 s foreground cap on the shared box). overlap-check: VERDICT clean exit 0, merges cleanly with origin/main, no open PR shares a file.

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6

GET /meta/form?object=X answered every form: the list chain applied
?object= to view alone. A form item is bound to one object by object
(ADR-0159 D2), so the filter now keeps that object's forms, and an object
no form names answers the empty list, as the view list does.

Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • the SDK route bridge reached 71 of 255 client-bound route-ledger rows — the other 184 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 184: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 60 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 19 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 8feef82252c79fa424fc2cfbc7ab183158790cfb → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 5bfcffcb9e83872dffbb437d413fc5e7a158d446 — the merge of head 420b9c7bc9a05191137b5f28c02132b8cfdef10f into base 8feef82252c79fa424fc2cfbc7ab183158790cfb, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 5bfcffcb9e83872dffbb437d413fc5e7a158d446 && git checkout 5bfcffcb9e83872dffbb437d413fc5e7a158d446
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8feef82252c79fa424fc2cfbc7ab183158790cfb 420b9c7bc9a05191137b5f28c02132b8cfdef10f && git checkout -B drift-repro 8feef82252c79fa424fc2cfbc7ab183158790cfb && git merge --no-ff 420b9c7bc9a05191137b5f28c02132b8cfdef10f

node scripts/docs-audit/affected-docs.mjs --json 8feef82252c79fa424fc2cfbc7ab183158790cfb

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR

2026-12-04T10:04Z · L1-a verdict: ACCEPT at head 420b9c7bc9 (zone em-upgrade, Fixes #39004)

席位核对

Change. A new step 4a in createMetaListAnswer (packages/rest/src/meta-item-read-gate.ts) is shared by both transports. On form with a non-empty ?object=, it keeps the items whose object equals the filter (ADR-0159 D2: a form item is bound by object, named OBJECT.KEY) and sorts them by name. It reuses listItemsOf / withItems exactly as step 4 does for view, so an unknown object answers the empty list. Step 4 itself, and the unfiltered form list, are unchanged.

Tests. meta-form-object-filter-39004.test.ts has four cases on the real request path:

  • only the named object's forms come back, and another object's are absent;
  • an unknown object answers an empty list;
  • control: no filter lists every form;
  • control: ?object= on view is unchanged.

They are red first at 06a2c8aa8. This matches the card's "Done when" item by item. Fixes #39004 is right.

Changeset. @objectstack/rest patch. The headline comes first, then Clause-②: no and Metadata-protocol: none, which are right: a filter the door already accepted now takes effect, and no key, code or status is added. I read it sentence by sentence and each sentence agrees with the code. The name sort is not mentioned, which is harmless.

Gates. 39 success, 18 expected skip, 0 failed, 0 pending on 420b9c7bc9. l1-face is clean. mergeable_state was still unknown on first read; re-read it before landing.

Noted, owed as one filing line on the PR body.

  • An empty ?object= on form answers 200 with every form, while view refuses it (refuseEmptyListFilter). Adding that refusal would be a new 400, so it is out of this Clause-②: no PR. The zone files it as its own card.
  • Put the bracketed spelling (?object[…]=) in the same card. view refuses it (refuseBracketedListFilter), but form now reads it through String(query.object).

Ordinary PR, no L2 owed (no spec or rules path, Clause-②: no). It lands in its zone once the filing line is in.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxRh6Sbfo2Xm49JPx6

Landing at head 420b9c7bc9. L1-a ACCEPT is 7408219215, and no L2 is owed. CI shows 39 success, 18 expected skip and 0 failed. The filing line is in the body: #39612 covers the empty and bracketed ?object=. check-governed-merges reports NOT governed, 185 lines. Marking ready and arming auto-merge (zone em-upgrade).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metadata read: GET /api/v1/meta/form?object=X ignores the object filter and answers every form

2 participants