feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B) - #14404

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array
Sep 2, 2026
Merged

feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B)#14404
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#12039

Key 2 of the card, and the half that completes it (Key 1 landed via PR #12120): ComponentPropsMap['element:number'].filter converges onto the ViewFilterRule array form.

Ruling of record (implemented exactly; not re-decided)

  • ui#6206-B (maintainer batch adjudication 2026-08-25, acceptance verbatim 「同意」): one filter orthography platform-wide — the entry's filter becomes z.array(ViewFilterRuleSchema).optional(), the shape every other filter input in component.zod.ts already declares (record:related_list, its Add-affordance picker).
  • Option-A sequencing (issue comment 5409255480; maintainer 「第三批决策(5 张) 同意」): consumer first, then spec. The consumer half is done — objectui#6828 landed and the objectstack pin .objectui-sha on origin/main is d8ec8d6d4f011b11c8eb1e6dbd364ef206711391, which carries it (comments 5492894409, 5502817852).
  • The ruling's own caveat, binding: "re-run the recorded refusal measurement if the pin has moved by execution time" and "if the runtime genuinely cannot take the array form, that is a fork back to triage, not a silent flip". Step 0 below is that re-run, executed before any edit.

Step 0 — measurement at the pin (before any edit)

Premise re-verified on origin/main @ 8094834 at fetch time: packages/spec/src/ui/component.zod.ts:1802 read filter: FilterConditionSchema.optional().describe('Filter criteria') inside ElementNumberPropsSchema; siblings at lines 1089 / 1125 read z.array(ViewFilterRuleSchema).

At objectui pin d8ec8d6d… (cd ../objectui && git fetch origin d8ec8d6d…, read with git show PIN:PATH, nothing checked out in the shared tree):

  1. Adapter lowers on the aggregate pathgit show PIN:packages/data-objectstack/src/index.ts, aggregate() at lines 4841–4927: the analytics branch reads payload.where = Array.isArray(params.filter) ? translateFilterArray(params.filter) : params.filter (lines 4924–4926, the objectui#6828 change, with its header comment naming objectui#6302). The spec-shape branch (where) stays strict by the 2026-08-30 option-A ruling and is not the element's path. PASS.

  2. Pin test exists and covers rule-object arraysgit show PIN:packages/data-objectstack/src/aggregate-filter-lowering.test.ts succeeds; cases cited: "translates a single rule into an AST tuple" ([{ field: 'stage', operator: 'equals', value: 'won' }]['stage', '=', 'won']), "the lowered value passes the AST gate the raw one fails" (isFilterAST(rules) false → true after lowering), "maps operator aliases the way the find() path does", "joins several rules with and", "lowers rules SPREAD into a logical node", and the cross-path parity block "produces the SAME where as the AST-tuple equivalent". PASS.

  3. Renderer is an opaque pass-throughgit show PIN:packages/components/src/renderers/basic/elements.tsx: ElementNumberRenderer declares filter?: unknown (line 373) and calls adapter.aggregate(props.object, { field, function: props.aggregate, groupBy: '_all', filter: props.filter }) (lines 402–407); the fallback adapter.find(props.object, { $filter: props.filter }) (line 419) goes through the same translateFilterArray via convertQueryParams. Nothing between the authored array and the adapter rewrites it. PASS.

  4. objectstack analytics door, replayed from PR feat(spec): converge ComponentPropsMap['object-grid'].data onto ViewDataSchema (ui#6207 Option A); record the ui#6206-B measurement fork #12120's Key 2 section (tsx script over service-analytics src after building its dependency closure — pnpm --filter '@objectstack/service-analytics^...' build, VERDICT command-exit 0):

    • isFilterAST([{ field: 'stage', operator: 'equals', value: 'won' }])false
    • isFilterAST([['stage', '=', 'won']])true
    • lowerAnalyticsWhere({ where: [{ field: 'stage', operator: 'equals', value: 'won' }] })throws[analytics] received a 'where' array that is not a filter: …
    • lowerAnalyticsWhere({ where: [['stage', '=', 'won']] }){ "stage": "won" }

    Expected and acceptable: the door itself is unchanged by design (raw rule-object array refused, AST tuples accepted). What changed since the recorded fork is reading 1 — the adapter now lowers before the wire — so the end-to-end chain is authored array → adapter lowering → AST → accepted. The stop condition (readings 1 or 2 failing) did not trigger.

The change

  • packages/spec/src/ui/component.zod.ts — the element:number entry's filter only: z.array(ViewFilterRuleSchema).optional() with a describe that names the orthography and the migration id; ViewFilterRuleSchema was already imported. FilterConditionSchema stays imported because element:record_picker.filter (now line 2141) still uses it — observed, not changed, per the dispatch.
  • ADR-0122 fallout (the same shape Key 1 hit): ViewFilterRuleSchema normalizes operator on parse (input ≠ infer — ViewFilterRuleParsed already exists for that reason), so ElementNumberPropsSchema leaves the isomorphic pin family: ElementNumberPropsParsed declared, the Iso818 pin deleted with its receipt, the pin count 836 → 835 in the header, the test title and the assertion.
  • ADR-0087: accept-set change on a published props-map entry ⇒ BREAKING under the launch-window convention. D3 semantic entry packages/spec/src/migrations/entries/semantic/18.element-number-filter-rule-array.ts (surface / replacement / reason / acceptanceCriteria, following Key 1's 18.object-grid-data-view-data-converged.ts); registry.ts regenerated with gen:migration-registry (144 semantic entries; Key 1's object-grid-data-view-data-converged and feat(spec): refuse undeclared keys on address and location values — AddressSchema / LocationValueSchema strict (#13802) #14335's address-location-value-unknown-keys-refused both present). Changeset .changeset/element-number-filter-rule-array.md: @objectstack/spec minor, **BREAKING**, FROM → TO block, and the adr-0087: registered element-number-filter-rule-array marker.
  • Tests (packages/spec/src/ui/component.test.ts, new describe block): array form accepted and echoed (the card's acceptance criterion); the real ViewFilterRuleSchema is what is wired (eq normalizes to equals; a scalar in value is refused at filter.0.value); the record form refused at the filter path with code: 'invalid_type', expected: 'array' (both the plain record and the operator-object record); an orthography pin that element:number and record:related_list give the same verdicts on the same value; a multi-rule positive control with a real in rule.
  • Generated products regenerated by check:generated --fix after proving exactly three stale: api-surface/ui.json + export-origins/ui.json (the new ElementNumberPropsParsed export) and content/docs/references/ui/component.mdx (the array shape). authorable-surface was already green (the key set did not change). No hand-docs edit: the only prose mention of element:number under content/docs (ui/pages.mdx:187) lists element names and says nothing about the filter shape.
  • No consumer-side alias, no fallback arm accepting the record form.

Ruled migration check — the sweep

Commands (tracked files on this branch):

git grep -n -A12 "ElementNumberPropsSchema\.\(parse\|safeParse\)\|ComponentPropsMap\['element:number'\]\|type: 'element:number'\|type=\"element:number\"" -- . ':!content/docs/references' ':!packages/spec/CHANGELOG.md' ':!packages/spec/api-surface' ':!packages/spec/export-origins' ':!packages/spec/declaration-map' ':!packages/spec/authorable-surface*' ':!.changeset' ':!packages/spec/src/migrations' | grep -E "filter: \{|filter: \["
grep -rn "element:number" examples skills packages/create-objectstack content/docs packages/apps

Result: one in-repo author of the props-level record form — packages/spec/src/ui/component.test.ts "should accept full number props" (filter: { status: 'paid' }), rewritten in this PR to [{ field: 'status', operator: 'equals', value: 'paid' }] (fixture triage: it used the form this entry alone accepted; its assertions are about format/prefix/suffix and still hold, plus one on the parsed filter). The three page.test.ts hits author dataSource.filter (ElementDataSourceSchema, a different key and schema — not this entry). Zero authors in examples/, skills/, packages/create-objectstack/, content/docs/ (other than the name list), packages/apps/. Out-of-repo authors get the prescription via the ADR-0087 entry.

Verification

Union derived with node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (no paths; stderr stamped "derived from the tree of 'objectstack-ai/objectstack' at commit 8068a7f"): 74 commands, each run under scripts/pm/os-verify-lock.sh through a runner that redirects output to a per-command log and captures the exit code before any pipe. HEAD for every reading below: 8068a7f31 (git rev-parse --short HEAD after the last commit; the tree was clean throughout).

Named must-haves, each on 8068a7f31:

  • pnpm --filter @objectstack/spec run typechecktsc --noEmit clean, check:scripts-typecheck clean, "check:test-typecheck: OK — @objectstack/spec's test layer compiles under packages/spec/tsconfig.test.json; 54 file(s) / 262 error(s) / 146 pinned signature(s) held" (VERDICT command-exit 0; re-run after the last commit).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/ui/component.test.ts src/type-alias-convention.pin.test.ts — Test Files 2 passed (2), Tests 238 passed (238).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 (the full spec suite) — Test Files 450 passed | 1 skipped (451); Tests 12111 passed | 1 skipped (12112), Duration 325.86s, VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec check:generated — "✓ All 15 generated artifacts are up to date" (that run includes check:migration-registry ✓, check:spec-changes ✓, check:upgrade-guide ✓, check:docs ✓, check:authorable-surface ✓, check:test-typecheck ✓).
  • check:api-surface ✓ and check:export-origins ✓ (exit 0 on the rebuilt dist); check:authorable-surface ✓ ("🔒 authorable-defaults/ verified against upstream d62f990 — 1236 default(s) unchanged"; no anchor hand-edited, baseRev left to lag); scripts/check-adr-0087-registration.mjs — "✓ check-adr-0087-registration: 1 declared-breaking changeset(s), each carrying an ADR-0087 disposition … registered element-number-filter-rule-array (new here)"; check:doc-authoring — "✓ doc authoring guard: 14375 customer-facing string(s) across 705 spec sources clean — no internal issue-id references"; check:nul-bytes — "check-nul-bytes: OK (scanned 7843 text file(s) -- 7843 tracked, 0 untracked-not-ignored; skipped 7 binary; no raw ASCII control bytes).".

The rest of the 74-command union: 72 of 74 exit 0 on 8068a7f31, per-command exit codes captured from redirection. Readings that first printed PREREQUISITE NOT MET / "dist is OLDER than src" (their own words: nothing measured, not a finding) were re-run after the prerequisite was built — pnpm --filter '@objectstack/lint...' build, then turbo run build --filter='./packages/*' --filter='./packages/*/*' (70/70 tasks successful, VERDICT command-exit 0) — and are green: check:doc-formula-expressions, check:doc-security-posture, check:browser-reachable-entries, check:dual-source-exports, check:entry-nameability, check:exported-any, check:skill-examples ("✅ 259 prose examples type-check across 3 surface(s)"), check:dev-prereqs ("✓ 67 package build artifacts present"), check:dual-build-cjs-loads ("102 published require entry point(s) across 66 package(s) load"), check:type-check-coverage ("67/78 workspace packages type-checked"), check:type-check-debt ("27 ledger entr(ies) re-measured … none above its recorded number"). check:query-options-erasure ran alone under the lock after a first attempt was cut by the container's foreground cap: "✓ query-options-erasure ratchet holds: 67 unswept non-test site(s) in 17 file(s), none new". The ratchet families (check:slot-lookup, check:query-options-erasure, check:type-check-debt, check:spec-parsed-alias, check:where-matcher, check:engine-double-contract, check:test-source-alias) are all green on this head. The two remaining commands are the not-runnable-here pair below.

Type-level reverse verification against the rebuilt dist/*.d.ts (probe file in packages/lint, tsc --noEmit --ignoreConfig against @objectstack/spec/ui): the record form filter: { status: 'won' }red, TS2353 … 'status' does not exist in type '{ field: string; operator: unknown; value?: … }[]'; the array form → green (0 errors). The probe was deleted afterwards.

Not runnable here, by their own verdicts:check:react-declaration-parity (needs objectui's sdui.manifest.json, produced only by pnpm sdui:manifest on a pin bump — an on-demand gate by maintainer decision; this is the gate whose exemption element:number.filter:array becomes deletable downstream) and check-test-completeness (reads a saved turbo run test log; NOT MEASURED locally per its text). Repo-wide pnpm lint and the multi-package farm are CI's runs (declared narrowing — CI runs the farm on this PR).

H17 note

packages/spec/src/ui/view.zod.ts is not touchedViewFilterRuleSchema is imported from it in component.zod.ts only (on-hold #8346 declares it Restart-touch).

Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21

🤖 Generated with Claude Code

https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21


Generated by Claude Code

…the ViewFilterRule array form (ui#6206 Option B)
Accept-set change on one props-map entry: `filter` was `FilterConditionSchema`
(the MongoDB-style record), now `z.array(ViewFilterRuleSchema)` — the one
filter orthography every sibling `filter` input in the map already declares.
Sequenced consumer-first per the 2026-08-25 Option-A ordering ruling: the
objectui pin (d8ec8d6d) carries objectui#6828, re-measured before this move.
ADR-0087 semantic entry `element-number-filter-rule-array` carries the
prescription; `ElementNumberPropsParsed` declared and the Iso818 pin deleted
with its receipt (ADR-0122); orthography tests added.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
… fixture to the array orthography; regenerate api-surface, export-origins, docs
The ruled migration sweep found exactly one first-party author of the
record-form `filter` on `element:number` — `component.test.ts`'s "should
accept full number props" fixture — and zero in examples/, skills/,
create-objectstack, content/docs/, packages/apps/. The entry and changeset
now say so. `check:generated --fix` proved three artifacts stale and
regenerated them: api-surface and export-origins carry the new
`ElementNumberPropsParsed` export, the docs reference carries the array shape.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
@github-actionsgithub-actionsBot added size/m documentation Improvements or additions to documentation protocol:ui tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

4 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. ⚠️2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json) — pages documenting those are invisible to this run
  • 4 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 128 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 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6cpackageMentionDocs.

Which tree this was computed on

This run read content/docs from bc118cab41209b26b8cbf393c8c767de9df9edb1 — the merge of head 8068a7f317684f55c70fcc33e182ea0d67395cb7 into base 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c, 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 bc118cab41209b26b8cbf393c8c767de9df9edb1 && git checkout bc118cab41209b26b8cbf393c8c767de9df9edb1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c 8068a7f317684f55c70fcc33e182ea0d67395cb7 && git checkout -B drift-repro 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c && git merge --no-ff 8068a7f317684f55c70fcc33e182ea0d67395cb7
node scripts/docs-audit/affected-docs.mjs --json 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c

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

@os-zhuang
os-zhuang marked this pull request as ready for review September 2, 2026 04:44
@os-zhuang
os-zhuang added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 79b6a22Sep 2, 2026
43 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-12039-element-number-filter-array branch September 2, 2026 05:11
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationprotocol:uisize/mteststooling

Projects

None yet

2 participants

@os-zhuang@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B) - #14404

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array
Sep 2, 2026
Merged

feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B)#14404
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#12039

Key 2 of the card, and the half that completes it (Key 1 landed via PR #12120): ComponentPropsMap['element:number'].filter converges onto the ViewFilterRule array form.

Ruling of record (implemented exactly; not re-decided)

  • ui#6206-B (maintainer batch adjudication 2026-08-25, acceptance verbatim 「同意」): one filter orthography platform-wide — the entry's filter becomes z.array(ViewFilterRuleSchema).optional(), the shape every other filter input in component.zod.ts already declares (record:related_list, its Add-affordance picker).
  • Option-A sequencing (issue comment 5409255480; maintainer 「第三批决策(5 张) 同意」): consumer first, then spec. The consumer half is done — objectui#6828 landed and the objectstack pin .objectui-sha on origin/main is d8ec8d6d4f011b11c8eb1e6dbd364ef206711391, which carries it (comments 5492894409, 5502817852).
  • The ruling's own caveat, binding: "re-run the recorded refusal measurement if the pin has moved by execution time" and "if the runtime genuinely cannot take the array form, that is a fork back to triage, not a silent flip". Step 0 below is that re-run, executed before any edit.

Step 0 — measurement at the pin (before any edit)

Premise re-verified on origin/main @ 8094834 at fetch time: packages/spec/src/ui/component.zod.ts:1802 read filter: FilterConditionSchema.optional().describe('Filter criteria') inside ElementNumberPropsSchema; siblings at lines 1089 / 1125 read z.array(ViewFilterRuleSchema).

At objectui pin d8ec8d6d… (cd ../objectui && git fetch origin d8ec8d6d…, read with git show PIN:PATH, nothing checked out in the shared tree):

  1. Adapter lowers on the aggregate pathgit show PIN:packages/data-objectstack/src/index.ts, aggregate() at lines 4841–4927: the analytics branch reads payload.where = Array.isArray(params.filter) ? translateFilterArray(params.filter) : params.filter (lines 4924–4926, the objectui#6828 change, with its header comment naming objectui#6302). The spec-shape branch (where) stays strict by the 2026-08-30 option-A ruling and is not the element's path. PASS.

  2. Pin test exists and covers rule-object arraysgit show PIN:packages/data-objectstack/src/aggregate-filter-lowering.test.ts succeeds; cases cited: "translates a single rule into an AST tuple" ([{ field: 'stage', operator: 'equals', value: 'won' }]['stage', '=', 'won']), "the lowered value passes the AST gate the raw one fails" (isFilterAST(rules) false → true after lowering), "maps operator aliases the way the find() path does", "joins several rules with and", "lowers rules SPREAD into a logical node", and the cross-path parity block "produces the SAME where as the AST-tuple equivalent". PASS.

  3. Renderer is an opaque pass-throughgit show PIN:packages/components/src/renderers/basic/elements.tsx: ElementNumberRenderer declares filter?: unknown (line 373) and calls adapter.aggregate(props.object, { field, function: props.aggregate, groupBy: '_all', filter: props.filter }) (lines 402–407); the fallback adapter.find(props.object, { $filter: props.filter }) (line 419) goes through the same translateFilterArray via convertQueryParams. Nothing between the authored array and the adapter rewrites it. PASS.

  4. objectstack analytics door, replayed from PR feat(spec): converge ComponentPropsMap['object-grid'].data onto ViewDataSchema (ui#6207 Option A); record the ui#6206-B measurement fork #12120's Key 2 section (tsx script over service-analytics src after building its dependency closure — pnpm --filter '@objectstack/service-analytics^...' build, VERDICT command-exit 0):

    • isFilterAST([{ field: 'stage', operator: 'equals', value: 'won' }])false
    • isFilterAST([['stage', '=', 'won']])true
    • lowerAnalyticsWhere({ where: [{ field: 'stage', operator: 'equals', value: 'won' }] })throws[analytics] received a 'where' array that is not a filter: …
    • lowerAnalyticsWhere({ where: [['stage', '=', 'won']] }){ "stage": "won" }

    Expected and acceptable: the door itself is unchanged by design (raw rule-object array refused, AST tuples accepted). What changed since the recorded fork is reading 1 — the adapter now lowers before the wire — so the end-to-end chain is authored array → adapter lowering → AST → accepted. The stop condition (readings 1 or 2 failing) did not trigger.

The change

  • packages/spec/src/ui/component.zod.ts — the element:number entry's filter only: z.array(ViewFilterRuleSchema).optional() with a describe that names the orthography and the migration id; ViewFilterRuleSchema was already imported. FilterConditionSchema stays imported because element:record_picker.filter (now line 2141) still uses it — observed, not changed, per the dispatch.
  • ADR-0122 fallout (the same shape Key 1 hit): ViewFilterRuleSchema normalizes operator on parse (input ≠ infer — ViewFilterRuleParsed already exists for that reason), so ElementNumberPropsSchema leaves the isomorphic pin family: ElementNumberPropsParsed declared, the Iso818 pin deleted with its receipt, the pin count 836 → 835 in the header, the test title and the assertion.
  • ADR-0087: accept-set change on a published props-map entry ⇒ BREAKING under the launch-window convention. D3 semantic entry packages/spec/src/migrations/entries/semantic/18.element-number-filter-rule-array.ts (surface / replacement / reason / acceptanceCriteria, following Key 1's 18.object-grid-data-view-data-converged.ts); registry.ts regenerated with gen:migration-registry (144 semantic entries; Key 1's object-grid-data-view-data-converged and feat(spec): refuse undeclared keys on address and location values — AddressSchema / LocationValueSchema strict (#13802) #14335's address-location-value-unknown-keys-refused both present). Changeset .changeset/element-number-filter-rule-array.md: @objectstack/spec minor, **BREAKING**, FROM → TO block, and the adr-0087: registered element-number-filter-rule-array marker.
  • Tests (packages/spec/src/ui/component.test.ts, new describe block): array form accepted and echoed (the card's acceptance criterion); the real ViewFilterRuleSchema is what is wired (eq normalizes to equals; a scalar in value is refused at filter.0.value); the record form refused at the filter path with code: 'invalid_type', expected: 'array' (both the plain record and the operator-object record); an orthography pin that element:number and record:related_list give the same verdicts on the same value; a multi-rule positive control with a real in rule.
  • Generated products regenerated by check:generated --fix after proving exactly three stale: api-surface/ui.json + export-origins/ui.json (the new ElementNumberPropsParsed export) and content/docs/references/ui/component.mdx (the array shape). authorable-surface was already green (the key set did not change). No hand-docs edit: the only prose mention of element:number under content/docs (ui/pages.mdx:187) lists element names and says nothing about the filter shape.
  • No consumer-side alias, no fallback arm accepting the record form.

Ruled migration check — the sweep

Commands (tracked files on this branch):

git grep -n -A12 "ElementNumberPropsSchema\.\(parse\|safeParse\)\|ComponentPropsMap\['element:number'\]\|type: 'element:number'\|type=\"element:number\"" -- . ':!content/docs/references' ':!packages/spec/CHANGELOG.md' ':!packages/spec/api-surface' ':!packages/spec/export-origins' ':!packages/spec/declaration-map' ':!packages/spec/authorable-surface*' ':!.changeset' ':!packages/spec/src/migrations' | grep -E "filter: \{|filter: \["
grep -rn "element:number" examples skills packages/create-objectstack content/docs packages/apps

Result: one in-repo author of the props-level record form — packages/spec/src/ui/component.test.ts "should accept full number props" (filter: { status: 'paid' }), rewritten in this PR to [{ field: 'status', operator: 'equals', value: 'paid' }] (fixture triage: it used the form this entry alone accepted; its assertions are about format/prefix/suffix and still hold, plus one on the parsed filter). The three page.test.ts hits author dataSource.filter (ElementDataSourceSchema, a different key and schema — not this entry). Zero authors in examples/, skills/, packages/create-objectstack/, content/docs/ (other than the name list), packages/apps/. Out-of-repo authors get the prescription via the ADR-0087 entry.

Verification

Union derived with node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (no paths; stderr stamped "derived from the tree of 'objectstack-ai/objectstack' at commit 8068a7f"): 74 commands, each run under scripts/pm/os-verify-lock.sh through a runner that redirects output to a per-command log and captures the exit code before any pipe. HEAD for every reading below: 8068a7f31 (git rev-parse --short HEAD after the last commit; the tree was clean throughout).

Named must-haves, each on 8068a7f31:

  • pnpm --filter @objectstack/spec run typechecktsc --noEmit clean, check:scripts-typecheck clean, "check:test-typecheck: OK — @objectstack/spec's test layer compiles under packages/spec/tsconfig.test.json; 54 file(s) / 262 error(s) / 146 pinned signature(s) held" (VERDICT command-exit 0; re-run after the last commit).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/ui/component.test.ts src/type-alias-convention.pin.test.ts — Test Files 2 passed (2), Tests 238 passed (238).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 (the full spec suite) — Test Files 450 passed | 1 skipped (451); Tests 12111 passed | 1 skipped (12112), Duration 325.86s, VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec check:generated — "✓ All 15 generated artifacts are up to date" (that run includes check:migration-registry ✓, check:spec-changes ✓, check:upgrade-guide ✓, check:docs ✓, check:authorable-surface ✓, check:test-typecheck ✓).
  • check:api-surface ✓ and check:export-origins ✓ (exit 0 on the rebuilt dist); check:authorable-surface ✓ ("🔒 authorable-defaults/ verified against upstream d62f990 — 1236 default(s) unchanged"; no anchor hand-edited, baseRev left to lag); scripts/check-adr-0087-registration.mjs — "✓ check-adr-0087-registration: 1 declared-breaking changeset(s), each carrying an ADR-0087 disposition … registered element-number-filter-rule-array (new here)"; check:doc-authoring — "✓ doc authoring guard: 14375 customer-facing string(s) across 705 spec sources clean — no internal issue-id references"; check:nul-bytes — "check-nul-bytes: OK (scanned 7843 text file(s) -- 7843 tracked, 0 untracked-not-ignored; skipped 7 binary; no raw ASCII control bytes).".

The rest of the 74-command union: 72 of 74 exit 0 on 8068a7f31, per-command exit codes captured from redirection. Readings that first printed PREREQUISITE NOT MET / "dist is OLDER than src" (their own words: nothing measured, not a finding) were re-run after the prerequisite was built — pnpm --filter '@objectstack/lint...' build, then turbo run build --filter='./packages/*' --filter='./packages/*/*' (70/70 tasks successful, VERDICT command-exit 0) — and are green: check:doc-formula-expressions, check:doc-security-posture, check:browser-reachable-entries, check:dual-source-exports, check:entry-nameability, check:exported-any, check:skill-examples ("✅ 259 prose examples type-check across 3 surface(s)"), check:dev-prereqs ("✓ 67 package build artifacts present"), check:dual-build-cjs-loads ("102 published require entry point(s) across 66 package(s) load"), check:type-check-coverage ("67/78 workspace packages type-checked"), check:type-check-debt ("27 ledger entr(ies) re-measured … none above its recorded number"). check:query-options-erasure ran alone under the lock after a first attempt was cut by the container's foreground cap: "✓ query-options-erasure ratchet holds: 67 unswept non-test site(s) in 17 file(s), none new". The ratchet families (check:slot-lookup, check:query-options-erasure, check:type-check-debt, check:spec-parsed-alias, check:where-matcher, check:engine-double-contract, check:test-source-alias) are all green on this head. The two remaining commands are the not-runnable-here pair below.

Type-level reverse verification against the rebuilt dist/*.d.ts (probe file in packages/lint, tsc --noEmit --ignoreConfig against @objectstack/spec/ui): the record form filter: { status: 'won' }red, TS2353 … 'status' does not exist in type '{ field: string; operator: unknown; value?: … }[]'; the array form → green (0 errors). The probe was deleted afterwards.

Not runnable here, by their own verdicts:check:react-declaration-parity (needs objectui's sdui.manifest.json, produced only by pnpm sdui:manifest on a pin bump — an on-demand gate by maintainer decision; this is the gate whose exemption element:number.filter:array becomes deletable downstream) and check-test-completeness (reads a saved turbo run test log; NOT MEASURED locally per its text). Repo-wide pnpm lint and the multi-package farm are CI's runs (declared narrowing — CI runs the farm on this PR).

H17 note

packages/spec/src/ui/view.zod.ts is not touchedViewFilterRuleSchema is imported from it in component.zod.ts only (on-hold #8346 declares it Restart-touch).

Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21

🤖 Generated with Claude Code

https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21


Generated by Claude Code

…the ViewFilterRule array form (ui#6206 Option B)
Accept-set change on one props-map entry: `filter` was `FilterConditionSchema`
(the MongoDB-style record), now `z.array(ViewFilterRuleSchema)` — the one
filter orthography every sibling `filter` input in the map already declares.
Sequenced consumer-first per the 2026-08-25 Option-A ordering ruling: the
objectui pin (d8ec8d6d) carries objectui#6828, re-measured before this move.
ADR-0087 semantic entry `element-number-filter-rule-array` carries the
prescription; `ElementNumberPropsParsed` declared and the Iso818 pin deleted
with its receipt (ADR-0122); orthography tests added.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
… fixture to the array orthography; regenerate api-surface, export-origins, docs
The ruled migration sweep found exactly one first-party author of the
record-form `filter` on `element:number` — `component.test.ts`'s "should
accept full number props" fixture — and zero in examples/, skills/,
create-objectstack, content/docs/, packages/apps/. The entry and changeset
now say so. `check:generated --fix` proved three artifacts stale and
regenerated them: api-surface and export-origins carry the new
`ElementNumberPropsParsed` export, the docs reference carries the array shape.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
@github-actionsgithub-actionsBot added size/m documentation Improvements or additions to documentation protocol:ui tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

4 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. ⚠️2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json) — pages documenting those are invisible to this run
  • 4 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 128 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 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6cpackageMentionDocs.

Which tree this was computed on

This run read content/docs from bc118cab41209b26b8cbf393c8c767de9df9edb1 — the merge of head 8068a7f317684f55c70fcc33e182ea0d67395cb7 into base 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c, 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 bc118cab41209b26b8cbf393c8c767de9df9edb1 && git checkout bc118cab41209b26b8cbf393c8c767de9df9edb1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c 8068a7f317684f55c70fcc33e182ea0d67395cb7 && git checkout -B drift-repro 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c && git merge --no-ff 8068a7f317684f55c70fcc33e182ea0d67395cb7
node scripts/docs-audit/affected-docs.mjs --json 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c

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

@os-zhuang
os-zhuang marked this pull request as ready for review September 2, 2026 04:44
@os-zhuang
os-zhuang added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 79b6a22Sep 2, 2026
43 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-12039-element-number-filter-array branch September 2, 2026 05:11
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationprotocol:uisize/mteststooling

Projects

None yet

2 participants

@os-zhuang@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B) - #14404

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array
Sep 2, 2026
Merged

feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B)#14404
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#12039

Key 2 of the card, and the half that completes it (Key 1 landed via PR #12120): ComponentPropsMap['element:number'].filter converges onto the ViewFilterRule array form.

Ruling of record (implemented exactly; not re-decided)

  • ui#6206-B (maintainer batch adjudication 2026-08-25, acceptance verbatim 「同意」): one filter orthography platform-wide — the entry's filter becomes z.array(ViewFilterRuleSchema).optional(), the shape every other filter input in component.zod.ts already declares (record:related_list, its Add-affordance picker).
  • Option-A sequencing (issue comment 5409255480; maintainer 「第三批决策(5 张) 同意」): consumer first, then spec. The consumer half is done — objectui#6828 landed and the objectstack pin .objectui-sha on origin/main is d8ec8d6d4f011b11c8eb1e6dbd364ef206711391, which carries it (comments 5492894409, 5502817852).
  • The ruling's own caveat, binding: "re-run the recorded refusal measurement if the pin has moved by execution time" and "if the runtime genuinely cannot take the array form, that is a fork back to triage, not a silent flip". Step 0 below is that re-run, executed before any edit.

Step 0 — measurement at the pin (before any edit)

Premise re-verified on origin/main @ 8094834 at fetch time: packages/spec/src/ui/component.zod.ts:1802 read filter: FilterConditionSchema.optional().describe('Filter criteria') inside ElementNumberPropsSchema; siblings at lines 1089 / 1125 read z.array(ViewFilterRuleSchema).

At objectui pin d8ec8d6d… (cd ../objectui && git fetch origin d8ec8d6d…, read with git show PIN:PATH, nothing checked out in the shared tree):

  1. Adapter lowers on the aggregate pathgit show PIN:packages/data-objectstack/src/index.ts, aggregate() at lines 4841–4927: the analytics branch reads payload.where = Array.isArray(params.filter) ? translateFilterArray(params.filter) : params.filter (lines 4924–4926, the objectui#6828 change, with its header comment naming objectui#6302). The spec-shape branch (where) stays strict by the 2026-08-30 option-A ruling and is not the element's path. PASS.

  2. Pin test exists and covers rule-object arraysgit show PIN:packages/data-objectstack/src/aggregate-filter-lowering.test.ts succeeds; cases cited: "translates a single rule into an AST tuple" ([{ field: 'stage', operator: 'equals', value: 'won' }]['stage', '=', 'won']), "the lowered value passes the AST gate the raw one fails" (isFilterAST(rules) false → true after lowering), "maps operator aliases the way the find() path does", "joins several rules with and", "lowers rules SPREAD into a logical node", and the cross-path parity block "produces the SAME where as the AST-tuple equivalent". PASS.

  3. Renderer is an opaque pass-throughgit show PIN:packages/components/src/renderers/basic/elements.tsx: ElementNumberRenderer declares filter?: unknown (line 373) and calls adapter.aggregate(props.object, { field, function: props.aggregate, groupBy: '_all', filter: props.filter }) (lines 402–407); the fallback adapter.find(props.object, { $filter: props.filter }) (line 419) goes through the same translateFilterArray via convertQueryParams. Nothing between the authored array and the adapter rewrites it. PASS.

  4. objectstack analytics door, replayed from PR feat(spec): converge ComponentPropsMap['object-grid'].data onto ViewDataSchema (ui#6207 Option A); record the ui#6206-B measurement fork #12120's Key 2 section (tsx script over service-analytics src after building its dependency closure — pnpm --filter '@objectstack/service-analytics^...' build, VERDICT command-exit 0):

    • isFilterAST([{ field: 'stage', operator: 'equals', value: 'won' }])false
    • isFilterAST([['stage', '=', 'won']])true
    • lowerAnalyticsWhere({ where: [{ field: 'stage', operator: 'equals', value: 'won' }] })throws[analytics] received a 'where' array that is not a filter: …
    • lowerAnalyticsWhere({ where: [['stage', '=', 'won']] }){ "stage": "won" }

    Expected and acceptable: the door itself is unchanged by design (raw rule-object array refused, AST tuples accepted). What changed since the recorded fork is reading 1 — the adapter now lowers before the wire — so the end-to-end chain is authored array → adapter lowering → AST → accepted. The stop condition (readings 1 or 2 failing) did not trigger.

The change

  • packages/spec/src/ui/component.zod.ts — the element:number entry's filter only: z.array(ViewFilterRuleSchema).optional() with a describe that names the orthography and the migration id; ViewFilterRuleSchema was already imported. FilterConditionSchema stays imported because element:record_picker.filter (now line 2141) still uses it — observed, not changed, per the dispatch.
  • ADR-0122 fallout (the same shape Key 1 hit): ViewFilterRuleSchema normalizes operator on parse (input ≠ infer — ViewFilterRuleParsed already exists for that reason), so ElementNumberPropsSchema leaves the isomorphic pin family: ElementNumberPropsParsed declared, the Iso818 pin deleted with its receipt, the pin count 836 → 835 in the header, the test title and the assertion.
  • ADR-0087: accept-set change on a published props-map entry ⇒ BREAKING under the launch-window convention. D3 semantic entry packages/spec/src/migrations/entries/semantic/18.element-number-filter-rule-array.ts (surface / replacement / reason / acceptanceCriteria, following Key 1's 18.object-grid-data-view-data-converged.ts); registry.ts regenerated with gen:migration-registry (144 semantic entries; Key 1's object-grid-data-view-data-converged and feat(spec): refuse undeclared keys on address and location values — AddressSchema / LocationValueSchema strict (#13802) #14335's address-location-value-unknown-keys-refused both present). Changeset .changeset/element-number-filter-rule-array.md: @objectstack/spec minor, **BREAKING**, FROM → TO block, and the adr-0087: registered element-number-filter-rule-array marker.
  • Tests (packages/spec/src/ui/component.test.ts, new describe block): array form accepted and echoed (the card's acceptance criterion); the real ViewFilterRuleSchema is what is wired (eq normalizes to equals; a scalar in value is refused at filter.0.value); the record form refused at the filter path with code: 'invalid_type', expected: 'array' (both the plain record and the operator-object record); an orthography pin that element:number and record:related_list give the same verdicts on the same value; a multi-rule positive control with a real in rule.
  • Generated products regenerated by check:generated --fix after proving exactly three stale: api-surface/ui.json + export-origins/ui.json (the new ElementNumberPropsParsed export) and content/docs/references/ui/component.mdx (the array shape). authorable-surface was already green (the key set did not change). No hand-docs edit: the only prose mention of element:number under content/docs (ui/pages.mdx:187) lists element names and says nothing about the filter shape.
  • No consumer-side alias, no fallback arm accepting the record form.

Ruled migration check — the sweep

Commands (tracked files on this branch):

git grep -n -A12 "ElementNumberPropsSchema\.\(parse\|safeParse\)\|ComponentPropsMap\['element:number'\]\|type: 'element:number'\|type=\"element:number\"" -- . ':!content/docs/references' ':!packages/spec/CHANGELOG.md' ':!packages/spec/api-surface' ':!packages/spec/export-origins' ':!packages/spec/declaration-map' ':!packages/spec/authorable-surface*' ':!.changeset' ':!packages/spec/src/migrations' | grep -E "filter: \{|filter: \["
grep -rn "element:number" examples skills packages/create-objectstack content/docs packages/apps

Result: one in-repo author of the props-level record form — packages/spec/src/ui/component.test.ts "should accept full number props" (filter: { status: 'paid' }), rewritten in this PR to [{ field: 'status', operator: 'equals', value: 'paid' }] (fixture triage: it used the form this entry alone accepted; its assertions are about format/prefix/suffix and still hold, plus one on the parsed filter). The three page.test.ts hits author dataSource.filter (ElementDataSourceSchema, a different key and schema — not this entry). Zero authors in examples/, skills/, packages/create-objectstack/, content/docs/ (other than the name list), packages/apps/. Out-of-repo authors get the prescription via the ADR-0087 entry.

Verification

Union derived with node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (no paths; stderr stamped "derived from the tree of 'objectstack-ai/objectstack' at commit 8068a7f"): 74 commands, each run under scripts/pm/os-verify-lock.sh through a runner that redirects output to a per-command log and captures the exit code before any pipe. HEAD for every reading below: 8068a7f31 (git rev-parse --short HEAD after the last commit; the tree was clean throughout).

Named must-haves, each on 8068a7f31:

  • pnpm --filter @objectstack/spec run typechecktsc --noEmit clean, check:scripts-typecheck clean, "check:test-typecheck: OK — @objectstack/spec's test layer compiles under packages/spec/tsconfig.test.json; 54 file(s) / 262 error(s) / 146 pinned signature(s) held" (VERDICT command-exit 0; re-run after the last commit).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/ui/component.test.ts src/type-alias-convention.pin.test.ts — Test Files 2 passed (2), Tests 238 passed (238).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 (the full spec suite) — Test Files 450 passed | 1 skipped (451); Tests 12111 passed | 1 skipped (12112), Duration 325.86s, VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec check:generated — "✓ All 15 generated artifacts are up to date" (that run includes check:migration-registry ✓, check:spec-changes ✓, check:upgrade-guide ✓, check:docs ✓, check:authorable-surface ✓, check:test-typecheck ✓).
  • check:api-surface ✓ and check:export-origins ✓ (exit 0 on the rebuilt dist); check:authorable-surface ✓ ("🔒 authorable-defaults/ verified against upstream d62f990 — 1236 default(s) unchanged"; no anchor hand-edited, baseRev left to lag); scripts/check-adr-0087-registration.mjs — "✓ check-adr-0087-registration: 1 declared-breaking changeset(s), each carrying an ADR-0087 disposition … registered element-number-filter-rule-array (new here)"; check:doc-authoring — "✓ doc authoring guard: 14375 customer-facing string(s) across 705 spec sources clean — no internal issue-id references"; check:nul-bytes — "check-nul-bytes: OK (scanned 7843 text file(s) -- 7843 tracked, 0 untracked-not-ignored; skipped 7 binary; no raw ASCII control bytes).".

The rest of the 74-command union: 72 of 74 exit 0 on 8068a7f31, per-command exit codes captured from redirection. Readings that first printed PREREQUISITE NOT MET / "dist is OLDER than src" (their own words: nothing measured, not a finding) were re-run after the prerequisite was built — pnpm --filter '@objectstack/lint...' build, then turbo run build --filter='./packages/*' --filter='./packages/*/*' (70/70 tasks successful, VERDICT command-exit 0) — and are green: check:doc-formula-expressions, check:doc-security-posture, check:browser-reachable-entries, check:dual-source-exports, check:entry-nameability, check:exported-any, check:skill-examples ("✅ 259 prose examples type-check across 3 surface(s)"), check:dev-prereqs ("✓ 67 package build artifacts present"), check:dual-build-cjs-loads ("102 published require entry point(s) across 66 package(s) load"), check:type-check-coverage ("67/78 workspace packages type-checked"), check:type-check-debt ("27 ledger entr(ies) re-measured … none above its recorded number"). check:query-options-erasure ran alone under the lock after a first attempt was cut by the container's foreground cap: "✓ query-options-erasure ratchet holds: 67 unswept non-test site(s) in 17 file(s), none new". The ratchet families (check:slot-lookup, check:query-options-erasure, check:type-check-debt, check:spec-parsed-alias, check:where-matcher, check:engine-double-contract, check:test-source-alias) are all green on this head. The two remaining commands are the not-runnable-here pair below.

Type-level reverse verification against the rebuilt dist/*.d.ts (probe file in packages/lint, tsc --noEmit --ignoreConfig against @objectstack/spec/ui): the record form filter: { status: 'won' }red, TS2353 … 'status' does not exist in type '{ field: string; operator: unknown; value?: … }[]'; the array form → green (0 errors). The probe was deleted afterwards.

Not runnable here, by their own verdicts:check:react-declaration-parity (needs objectui's sdui.manifest.json, produced only by pnpm sdui:manifest on a pin bump — an on-demand gate by maintainer decision; this is the gate whose exemption element:number.filter:array becomes deletable downstream) and check-test-completeness (reads a saved turbo run test log; NOT MEASURED locally per its text). Repo-wide pnpm lint and the multi-package farm are CI's runs (declared narrowing — CI runs the farm on this PR).

H17 note

packages/spec/src/ui/view.zod.ts is not touchedViewFilterRuleSchema is imported from it in component.zod.ts only (on-hold #8346 declares it Restart-touch).

Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21

🤖 Generated with Claude Code

https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21


Generated by Claude Code

…the ViewFilterRule array form (ui#6206 Option B)
Accept-set change on one props-map entry: `filter` was `FilterConditionSchema`
(the MongoDB-style record), now `z.array(ViewFilterRuleSchema)` — the one
filter orthography every sibling `filter` input in the map already declares.
Sequenced consumer-first per the 2026-08-25 Option-A ordering ruling: the
objectui pin (d8ec8d6d) carries objectui#6828, re-measured before this move.
ADR-0087 semantic entry `element-number-filter-rule-array` carries the
prescription; `ElementNumberPropsParsed` declared and the Iso818 pin deleted
with its receipt (ADR-0122); orthography tests added.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
… fixture to the array orthography; regenerate api-surface, export-origins, docs
The ruled migration sweep found exactly one first-party author of the
record-form `filter` on `element:number` — `component.test.ts`'s "should
accept full number props" fixture — and zero in examples/, skills/,
create-objectstack, content/docs/, packages/apps/. The entry and changeset
now say so. `check:generated --fix` proved three artifacts stale and
regenerated them: api-surface and export-origins carry the new
`ElementNumberPropsParsed` export, the docs reference carries the array shape.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
@github-actionsgithub-actionsBot added size/m documentation Improvements or additions to documentation protocol:ui tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

4 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. ⚠️2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json) — pages documenting those are invisible to this run
  • 4 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 128 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 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6cpackageMentionDocs.

Which tree this was computed on

This run read content/docs from bc118cab41209b26b8cbf393c8c767de9df9edb1 — the merge of head 8068a7f317684f55c70fcc33e182ea0d67395cb7 into base 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c, 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 bc118cab41209b26b8cbf393c8c767de9df9edb1 && git checkout bc118cab41209b26b8cbf393c8c767de9df9edb1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c 8068a7f317684f55c70fcc33e182ea0d67395cb7 && git checkout -B drift-repro 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c && git merge --no-ff 8068a7f317684f55c70fcc33e182ea0d67395cb7
node scripts/docs-audit/affected-docs.mjs --json 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c

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

@os-zhuang
os-zhuang marked this pull request as ready for review September 2, 2026 04:44
@os-zhuang
os-zhuang added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 79b6a22Sep 2, 2026
43 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-12039-element-number-filter-array branch September 2, 2026 05:11
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationprotocol:uisize/mteststooling

Projects

None yet

2 participants

@os-zhuang@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B) - #14404

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array
Sep 2, 2026
Merged

feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B)#14404
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#12039

Key 2 of the card, and the half that completes it (Key 1 landed via PR #12120): ComponentPropsMap['element:number'].filter converges onto the ViewFilterRule array form.

Ruling of record (implemented exactly; not re-decided)

  • ui#6206-B (maintainer batch adjudication 2026-08-25, acceptance verbatim 「同意」): one filter orthography platform-wide — the entry's filter becomes z.array(ViewFilterRuleSchema).optional(), the shape every other filter input in component.zod.ts already declares (record:related_list, its Add-affordance picker).
  • Option-A sequencing (issue comment 5409255480; maintainer 「第三批决策(5 张) 同意」): consumer first, then spec. The consumer half is done — objectui#6828 landed and the objectstack pin .objectui-sha on origin/main is d8ec8d6d4f011b11c8eb1e6dbd364ef206711391, which carries it (comments 5492894409, 5502817852).
  • The ruling's own caveat, binding: "re-run the recorded refusal measurement if the pin has moved by execution time" and "if the runtime genuinely cannot take the array form, that is a fork back to triage, not a silent flip". Step 0 below is that re-run, executed before any edit.

Step 0 — measurement at the pin (before any edit)

Premise re-verified on origin/main @ 8094834 at fetch time: packages/spec/src/ui/component.zod.ts:1802 read filter: FilterConditionSchema.optional().describe('Filter criteria') inside ElementNumberPropsSchema; siblings at lines 1089 / 1125 read z.array(ViewFilterRuleSchema).

At objectui pin d8ec8d6d… (cd ../objectui && git fetch origin d8ec8d6d…, read with git show PIN:PATH, nothing checked out in the shared tree):

  1. Adapter lowers on the aggregate pathgit show PIN:packages/data-objectstack/src/index.ts, aggregate() at lines 4841–4927: the analytics branch reads payload.where = Array.isArray(params.filter) ? translateFilterArray(params.filter) : params.filter (lines 4924–4926, the objectui#6828 change, with its header comment naming objectui#6302). The spec-shape branch (where) stays strict by the 2026-08-30 option-A ruling and is not the element's path. PASS.

  2. Pin test exists and covers rule-object arraysgit show PIN:packages/data-objectstack/src/aggregate-filter-lowering.test.ts succeeds; cases cited: "translates a single rule into an AST tuple" ([{ field: 'stage', operator: 'equals', value: 'won' }]['stage', '=', 'won']), "the lowered value passes the AST gate the raw one fails" (isFilterAST(rules) false → true after lowering), "maps operator aliases the way the find() path does", "joins several rules with and", "lowers rules SPREAD into a logical node", and the cross-path parity block "produces the SAME where as the AST-tuple equivalent". PASS.

  3. Renderer is an opaque pass-throughgit show PIN:packages/components/src/renderers/basic/elements.tsx: ElementNumberRenderer declares filter?: unknown (line 373) and calls adapter.aggregate(props.object, { field, function: props.aggregate, groupBy: '_all', filter: props.filter }) (lines 402–407); the fallback adapter.find(props.object, { $filter: props.filter }) (line 419) goes through the same translateFilterArray via convertQueryParams. Nothing between the authored array and the adapter rewrites it. PASS.

  4. objectstack analytics door, replayed from PR feat(spec): converge ComponentPropsMap['object-grid'].data onto ViewDataSchema (ui#6207 Option A); record the ui#6206-B measurement fork #12120's Key 2 section (tsx script over service-analytics src after building its dependency closure — pnpm --filter '@objectstack/service-analytics^...' build, VERDICT command-exit 0):

    • isFilterAST([{ field: 'stage', operator: 'equals', value: 'won' }])false
    • isFilterAST([['stage', '=', 'won']])true
    • lowerAnalyticsWhere({ where: [{ field: 'stage', operator: 'equals', value: 'won' }] })throws[analytics] received a 'where' array that is not a filter: …
    • lowerAnalyticsWhere({ where: [['stage', '=', 'won']] }){ "stage": "won" }

    Expected and acceptable: the door itself is unchanged by design (raw rule-object array refused, AST tuples accepted). What changed since the recorded fork is reading 1 — the adapter now lowers before the wire — so the end-to-end chain is authored array → adapter lowering → AST → accepted. The stop condition (readings 1 or 2 failing) did not trigger.

The change

  • packages/spec/src/ui/component.zod.ts — the element:number entry's filter only: z.array(ViewFilterRuleSchema).optional() with a describe that names the orthography and the migration id; ViewFilterRuleSchema was already imported. FilterConditionSchema stays imported because element:record_picker.filter (now line 2141) still uses it — observed, not changed, per the dispatch.
  • ADR-0122 fallout (the same shape Key 1 hit): ViewFilterRuleSchema normalizes operator on parse (input ≠ infer — ViewFilterRuleParsed already exists for that reason), so ElementNumberPropsSchema leaves the isomorphic pin family: ElementNumberPropsParsed declared, the Iso818 pin deleted with its receipt, the pin count 836 → 835 in the header, the test title and the assertion.
  • ADR-0087: accept-set change on a published props-map entry ⇒ BREAKING under the launch-window convention. D3 semantic entry packages/spec/src/migrations/entries/semantic/18.element-number-filter-rule-array.ts (surface / replacement / reason / acceptanceCriteria, following Key 1's 18.object-grid-data-view-data-converged.ts); registry.ts regenerated with gen:migration-registry (144 semantic entries; Key 1's object-grid-data-view-data-converged and feat(spec): refuse undeclared keys on address and location values — AddressSchema / LocationValueSchema strict (#13802) #14335's address-location-value-unknown-keys-refused both present). Changeset .changeset/element-number-filter-rule-array.md: @objectstack/spec minor, **BREAKING**, FROM → TO block, and the adr-0087: registered element-number-filter-rule-array marker.
  • Tests (packages/spec/src/ui/component.test.ts, new describe block): array form accepted and echoed (the card's acceptance criterion); the real ViewFilterRuleSchema is what is wired (eq normalizes to equals; a scalar in value is refused at filter.0.value); the record form refused at the filter path with code: 'invalid_type', expected: 'array' (both the plain record and the operator-object record); an orthography pin that element:number and record:related_list give the same verdicts on the same value; a multi-rule positive control with a real in rule.
  • Generated products regenerated by check:generated --fix after proving exactly three stale: api-surface/ui.json + export-origins/ui.json (the new ElementNumberPropsParsed export) and content/docs/references/ui/component.mdx (the array shape). authorable-surface was already green (the key set did not change). No hand-docs edit: the only prose mention of element:number under content/docs (ui/pages.mdx:187) lists element names and says nothing about the filter shape.
  • No consumer-side alias, no fallback arm accepting the record form.

Ruled migration check — the sweep

Commands (tracked files on this branch):

git grep -n -A12 "ElementNumberPropsSchema\.\(parse\|safeParse\)\|ComponentPropsMap\['element:number'\]\|type: 'element:number'\|type=\"element:number\"" -- . ':!content/docs/references' ':!packages/spec/CHANGELOG.md' ':!packages/spec/api-surface' ':!packages/spec/export-origins' ':!packages/spec/declaration-map' ':!packages/spec/authorable-surface*' ':!.changeset' ':!packages/spec/src/migrations' | grep -E "filter: \{|filter: \["
grep -rn "element:number" examples skills packages/create-objectstack content/docs packages/apps

Result: one in-repo author of the props-level record form — packages/spec/src/ui/component.test.ts "should accept full number props" (filter: { status: 'paid' }), rewritten in this PR to [{ field: 'status', operator: 'equals', value: 'paid' }] (fixture triage: it used the form this entry alone accepted; its assertions are about format/prefix/suffix and still hold, plus one on the parsed filter). The three page.test.ts hits author dataSource.filter (ElementDataSourceSchema, a different key and schema — not this entry). Zero authors in examples/, skills/, packages/create-objectstack/, content/docs/ (other than the name list), packages/apps/. Out-of-repo authors get the prescription via the ADR-0087 entry.

Verification

Union derived with node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (no paths; stderr stamped "derived from the tree of 'objectstack-ai/objectstack' at commit 8068a7f"): 74 commands, each run under scripts/pm/os-verify-lock.sh through a runner that redirects output to a per-command log and captures the exit code before any pipe. HEAD for every reading below: 8068a7f31 (git rev-parse --short HEAD after the last commit; the tree was clean throughout).

Named must-haves, each on 8068a7f31:

  • pnpm --filter @objectstack/spec run typechecktsc --noEmit clean, check:scripts-typecheck clean, "check:test-typecheck: OK — @objectstack/spec's test layer compiles under packages/spec/tsconfig.test.json; 54 file(s) / 262 error(s) / 146 pinned signature(s) held" (VERDICT command-exit 0; re-run after the last commit).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/ui/component.test.ts src/type-alias-convention.pin.test.ts — Test Files 2 passed (2), Tests 238 passed (238).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 (the full spec suite) — Test Files 450 passed | 1 skipped (451); Tests 12111 passed | 1 skipped (12112), Duration 325.86s, VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec check:generated — "✓ All 15 generated artifacts are up to date" (that run includes check:migration-registry ✓, check:spec-changes ✓, check:upgrade-guide ✓, check:docs ✓, check:authorable-surface ✓, check:test-typecheck ✓).
  • check:api-surface ✓ and check:export-origins ✓ (exit 0 on the rebuilt dist); check:authorable-surface ✓ ("🔒 authorable-defaults/ verified against upstream d62f990 — 1236 default(s) unchanged"; no anchor hand-edited, baseRev left to lag); scripts/check-adr-0087-registration.mjs — "✓ check-adr-0087-registration: 1 declared-breaking changeset(s), each carrying an ADR-0087 disposition … registered element-number-filter-rule-array (new here)"; check:doc-authoring — "✓ doc authoring guard: 14375 customer-facing string(s) across 705 spec sources clean — no internal issue-id references"; check:nul-bytes — "check-nul-bytes: OK (scanned 7843 text file(s) -- 7843 tracked, 0 untracked-not-ignored; skipped 7 binary; no raw ASCII control bytes).".

The rest of the 74-command union: 72 of 74 exit 0 on 8068a7f31, per-command exit codes captured from redirection. Readings that first printed PREREQUISITE NOT MET / "dist is OLDER than src" (their own words: nothing measured, not a finding) were re-run after the prerequisite was built — pnpm --filter '@objectstack/lint...' build, then turbo run build --filter='./packages/*' --filter='./packages/*/*' (70/70 tasks successful, VERDICT command-exit 0) — and are green: check:doc-formula-expressions, check:doc-security-posture, check:browser-reachable-entries, check:dual-source-exports, check:entry-nameability, check:exported-any, check:skill-examples ("✅ 259 prose examples type-check across 3 surface(s)"), check:dev-prereqs ("✓ 67 package build artifacts present"), check:dual-build-cjs-loads ("102 published require entry point(s) across 66 package(s) load"), check:type-check-coverage ("67/78 workspace packages type-checked"), check:type-check-debt ("27 ledger entr(ies) re-measured … none above its recorded number"). check:query-options-erasure ran alone under the lock after a first attempt was cut by the container's foreground cap: "✓ query-options-erasure ratchet holds: 67 unswept non-test site(s) in 17 file(s), none new". The ratchet families (check:slot-lookup, check:query-options-erasure, check:type-check-debt, check:spec-parsed-alias, check:where-matcher, check:engine-double-contract, check:test-source-alias) are all green on this head. The two remaining commands are the not-runnable-here pair below.

Type-level reverse verification against the rebuilt dist/*.d.ts (probe file in packages/lint, tsc --noEmit --ignoreConfig against @objectstack/spec/ui): the record form filter: { status: 'won' }red, TS2353 … 'status' does not exist in type '{ field: string; operator: unknown; value?: … }[]'; the array form → green (0 errors). The probe was deleted afterwards.

Not runnable here, by their own verdicts:check:react-declaration-parity (needs objectui's sdui.manifest.json, produced only by pnpm sdui:manifest on a pin bump — an on-demand gate by maintainer decision; this is the gate whose exemption element:number.filter:array becomes deletable downstream) and check-test-completeness (reads a saved turbo run test log; NOT MEASURED locally per its text). Repo-wide pnpm lint and the multi-package farm are CI's runs (declared narrowing — CI runs the farm on this PR).

H17 note

packages/spec/src/ui/view.zod.ts is not touchedViewFilterRuleSchema is imported from it in component.zod.ts only (on-hold #8346 declares it Restart-touch).

Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21

🤖 Generated with Claude Code

https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21


Generated by Claude Code

…the ViewFilterRule array form (ui#6206 Option B)
Accept-set change on one props-map entry: `filter` was `FilterConditionSchema`
(the MongoDB-style record), now `z.array(ViewFilterRuleSchema)` — the one
filter orthography every sibling `filter` input in the map already declares.
Sequenced consumer-first per the 2026-08-25 Option-A ordering ruling: the
objectui pin (d8ec8d6d) carries objectui#6828, re-measured before this move.
ADR-0087 semantic entry `element-number-filter-rule-array` carries the
prescription; `ElementNumberPropsParsed` declared and the Iso818 pin deleted
with its receipt (ADR-0122); orthography tests added.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
… fixture to the array orthography; regenerate api-surface, export-origins, docs
The ruled migration sweep found exactly one first-party author of the
record-form `filter` on `element:number` — `component.test.ts`'s "should
accept full number props" fixture — and zero in examples/, skills/,
create-objectstack, content/docs/, packages/apps/. The entry and changeset
now say so. `check:generated --fix` proved three artifacts stale and
regenerated them: api-surface and export-origins carry the new
`ElementNumberPropsParsed` export, the docs reference carries the array shape.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
@github-actionsgithub-actionsBot added size/m documentation Improvements or additions to documentation protocol:ui tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

4 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. ⚠️2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json) — pages documenting those are invisible to this run
  • 4 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 128 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 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6cpackageMentionDocs.

Which tree this was computed on

This run read content/docs from bc118cab41209b26b8cbf393c8c767de9df9edb1 — the merge of head 8068a7f317684f55c70fcc33e182ea0d67395cb7 into base 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c, 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 bc118cab41209b26b8cbf393c8c767de9df9edb1 && git checkout bc118cab41209b26b8cbf393c8c767de9df9edb1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c 8068a7f317684f55c70fcc33e182ea0d67395cb7 && git checkout -B drift-repro 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c && git merge --no-ff 8068a7f317684f55c70fcc33e182ea0d67395cb7
node scripts/docs-audit/affected-docs.mjs --json 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c

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

@os-zhuang
os-zhuang marked this pull request as ready for review September 2, 2026 04:44
@os-zhuang
os-zhuang added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 79b6a22Sep 2, 2026
43 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-12039-element-number-filter-array branch September 2, 2026 05:11
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationprotocol:uisize/mteststooling

Projects

None yet

2 participants

@os-zhuang@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B) - #14404

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array
Sep 2, 2026
Merged

feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B)#14404
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#12039

Key 2 of the card, and the half that completes it (Key 1 landed via PR #12120): ComponentPropsMap['element:number'].filter converges onto the ViewFilterRule array form.

Ruling of record (implemented exactly; not re-decided)

  • ui#6206-B (maintainer batch adjudication 2026-08-25, acceptance verbatim 「同意」): one filter orthography platform-wide — the entry's filter becomes z.array(ViewFilterRuleSchema).optional(), the shape every other filter input in component.zod.ts already declares (record:related_list, its Add-affordance picker).
  • Option-A sequencing (issue comment 5409255480; maintainer 「第三批决策(5 张) 同意」): consumer first, then spec. The consumer half is done — objectui#6828 landed and the objectstack pin .objectui-sha on origin/main is d8ec8d6d4f011b11c8eb1e6dbd364ef206711391, which carries it (comments 5492894409, 5502817852).
  • The ruling's own caveat, binding: "re-run the recorded refusal measurement if the pin has moved by execution time" and "if the runtime genuinely cannot take the array form, that is a fork back to triage, not a silent flip". Step 0 below is that re-run, executed before any edit.

Step 0 — measurement at the pin (before any edit)

Premise re-verified on origin/main @ 8094834 at fetch time: packages/spec/src/ui/component.zod.ts:1802 read filter: FilterConditionSchema.optional().describe('Filter criteria') inside ElementNumberPropsSchema; siblings at lines 1089 / 1125 read z.array(ViewFilterRuleSchema).

At objectui pin d8ec8d6d… (cd ../objectui && git fetch origin d8ec8d6d…, read with git show PIN:PATH, nothing checked out in the shared tree):

  1. Adapter lowers on the aggregate pathgit show PIN:packages/data-objectstack/src/index.ts, aggregate() at lines 4841–4927: the analytics branch reads payload.where = Array.isArray(params.filter) ? translateFilterArray(params.filter) : params.filter (lines 4924–4926, the objectui#6828 change, with its header comment naming objectui#6302). The spec-shape branch (where) stays strict by the 2026-08-30 option-A ruling and is not the element's path. PASS.

  2. Pin test exists and covers rule-object arraysgit show PIN:packages/data-objectstack/src/aggregate-filter-lowering.test.ts succeeds; cases cited: "translates a single rule into an AST tuple" ([{ field: 'stage', operator: 'equals', value: 'won' }]['stage', '=', 'won']), "the lowered value passes the AST gate the raw one fails" (isFilterAST(rules) false → true after lowering), "maps operator aliases the way the find() path does", "joins several rules with and", "lowers rules SPREAD into a logical node", and the cross-path parity block "produces the SAME where as the AST-tuple equivalent". PASS.

  3. Renderer is an opaque pass-throughgit show PIN:packages/components/src/renderers/basic/elements.tsx: ElementNumberRenderer declares filter?: unknown (line 373) and calls adapter.aggregate(props.object, { field, function: props.aggregate, groupBy: '_all', filter: props.filter }) (lines 402–407); the fallback adapter.find(props.object, { $filter: props.filter }) (line 419) goes through the same translateFilterArray via convertQueryParams. Nothing between the authored array and the adapter rewrites it. PASS.

  4. objectstack analytics door, replayed from PR feat(spec): converge ComponentPropsMap['object-grid'].data onto ViewDataSchema (ui#6207 Option A); record the ui#6206-B measurement fork #12120's Key 2 section (tsx script over service-analytics src after building its dependency closure — pnpm --filter '@objectstack/service-analytics^...' build, VERDICT command-exit 0):

    • isFilterAST([{ field: 'stage', operator: 'equals', value: 'won' }])false
    • isFilterAST([['stage', '=', 'won']])true
    • lowerAnalyticsWhere({ where: [{ field: 'stage', operator: 'equals', value: 'won' }] })throws[analytics] received a 'where' array that is not a filter: …
    • lowerAnalyticsWhere({ where: [['stage', '=', 'won']] }){ "stage": "won" }

    Expected and acceptable: the door itself is unchanged by design (raw rule-object array refused, AST tuples accepted). What changed since the recorded fork is reading 1 — the adapter now lowers before the wire — so the end-to-end chain is authored array → adapter lowering → AST → accepted. The stop condition (readings 1 or 2 failing) did not trigger.

The change

  • packages/spec/src/ui/component.zod.ts — the element:number entry's filter only: z.array(ViewFilterRuleSchema).optional() with a describe that names the orthography and the migration id; ViewFilterRuleSchema was already imported. FilterConditionSchema stays imported because element:record_picker.filter (now line 2141) still uses it — observed, not changed, per the dispatch.
  • ADR-0122 fallout (the same shape Key 1 hit): ViewFilterRuleSchema normalizes operator on parse (input ≠ infer — ViewFilterRuleParsed already exists for that reason), so ElementNumberPropsSchema leaves the isomorphic pin family: ElementNumberPropsParsed declared, the Iso818 pin deleted with its receipt, the pin count 836 → 835 in the header, the test title and the assertion.
  • ADR-0087: accept-set change on a published props-map entry ⇒ BREAKING under the launch-window convention. D3 semantic entry packages/spec/src/migrations/entries/semantic/18.element-number-filter-rule-array.ts (surface / replacement / reason / acceptanceCriteria, following Key 1's 18.object-grid-data-view-data-converged.ts); registry.ts regenerated with gen:migration-registry (144 semantic entries; Key 1's object-grid-data-view-data-converged and feat(spec): refuse undeclared keys on address and location values — AddressSchema / LocationValueSchema strict (#13802) #14335's address-location-value-unknown-keys-refused both present). Changeset .changeset/element-number-filter-rule-array.md: @objectstack/spec minor, **BREAKING**, FROM → TO block, and the adr-0087: registered element-number-filter-rule-array marker.
  • Tests (packages/spec/src/ui/component.test.ts, new describe block): array form accepted and echoed (the card's acceptance criterion); the real ViewFilterRuleSchema is what is wired (eq normalizes to equals; a scalar in value is refused at filter.0.value); the record form refused at the filter path with code: 'invalid_type', expected: 'array' (both the plain record and the operator-object record); an orthography pin that element:number and record:related_list give the same verdicts on the same value; a multi-rule positive control with a real in rule.
  • Generated products regenerated by check:generated --fix after proving exactly three stale: api-surface/ui.json + export-origins/ui.json (the new ElementNumberPropsParsed export) and content/docs/references/ui/component.mdx (the array shape). authorable-surface was already green (the key set did not change). No hand-docs edit: the only prose mention of element:number under content/docs (ui/pages.mdx:187) lists element names and says nothing about the filter shape.
  • No consumer-side alias, no fallback arm accepting the record form.

Ruled migration check — the sweep

Commands (tracked files on this branch):

git grep -n -A12 "ElementNumberPropsSchema\.\(parse\|safeParse\)\|ComponentPropsMap\['element:number'\]\|type: 'element:number'\|type=\"element:number\"" -- . ':!content/docs/references' ':!packages/spec/CHANGELOG.md' ':!packages/spec/api-surface' ':!packages/spec/export-origins' ':!packages/spec/declaration-map' ':!packages/spec/authorable-surface*' ':!.changeset' ':!packages/spec/src/migrations' | grep -E "filter: \{|filter: \["
grep -rn "element:number" examples skills packages/create-objectstack content/docs packages/apps

Result: one in-repo author of the props-level record form — packages/spec/src/ui/component.test.ts "should accept full number props" (filter: { status: 'paid' }), rewritten in this PR to [{ field: 'status', operator: 'equals', value: 'paid' }] (fixture triage: it used the form this entry alone accepted; its assertions are about format/prefix/suffix and still hold, plus one on the parsed filter). The three page.test.ts hits author dataSource.filter (ElementDataSourceSchema, a different key and schema — not this entry). Zero authors in examples/, skills/, packages/create-objectstack/, content/docs/ (other than the name list), packages/apps/. Out-of-repo authors get the prescription via the ADR-0087 entry.

Verification

Union derived with node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (no paths; stderr stamped "derived from the tree of 'objectstack-ai/objectstack' at commit 8068a7f"): 74 commands, each run under scripts/pm/os-verify-lock.sh through a runner that redirects output to a per-command log and captures the exit code before any pipe. HEAD for every reading below: 8068a7f31 (git rev-parse --short HEAD after the last commit; the tree was clean throughout).

Named must-haves, each on 8068a7f31:

  • pnpm --filter @objectstack/spec run typechecktsc --noEmit clean, check:scripts-typecheck clean, "check:test-typecheck: OK — @objectstack/spec's test layer compiles under packages/spec/tsconfig.test.json; 54 file(s) / 262 error(s) / 146 pinned signature(s) held" (VERDICT command-exit 0; re-run after the last commit).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/ui/component.test.ts src/type-alias-convention.pin.test.ts — Test Files 2 passed (2), Tests 238 passed (238).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 (the full spec suite) — Test Files 450 passed | 1 skipped (451); Tests 12111 passed | 1 skipped (12112), Duration 325.86s, VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec check:generated — "✓ All 15 generated artifacts are up to date" (that run includes check:migration-registry ✓, check:spec-changes ✓, check:upgrade-guide ✓, check:docs ✓, check:authorable-surface ✓, check:test-typecheck ✓).
  • check:api-surface ✓ and check:export-origins ✓ (exit 0 on the rebuilt dist); check:authorable-surface ✓ ("🔒 authorable-defaults/ verified against upstream d62f990 — 1236 default(s) unchanged"; no anchor hand-edited, baseRev left to lag); scripts/check-adr-0087-registration.mjs — "✓ check-adr-0087-registration: 1 declared-breaking changeset(s), each carrying an ADR-0087 disposition … registered element-number-filter-rule-array (new here)"; check:doc-authoring — "✓ doc authoring guard: 14375 customer-facing string(s) across 705 spec sources clean — no internal issue-id references"; check:nul-bytes — "check-nul-bytes: OK (scanned 7843 text file(s) -- 7843 tracked, 0 untracked-not-ignored; skipped 7 binary; no raw ASCII control bytes).".

The rest of the 74-command union: 72 of 74 exit 0 on 8068a7f31, per-command exit codes captured from redirection. Readings that first printed PREREQUISITE NOT MET / "dist is OLDER than src" (their own words: nothing measured, not a finding) were re-run after the prerequisite was built — pnpm --filter '@objectstack/lint...' build, then turbo run build --filter='./packages/*' --filter='./packages/*/*' (70/70 tasks successful, VERDICT command-exit 0) — and are green: check:doc-formula-expressions, check:doc-security-posture, check:browser-reachable-entries, check:dual-source-exports, check:entry-nameability, check:exported-any, check:skill-examples ("✅ 259 prose examples type-check across 3 surface(s)"), check:dev-prereqs ("✓ 67 package build artifacts present"), check:dual-build-cjs-loads ("102 published require entry point(s) across 66 package(s) load"), check:type-check-coverage ("67/78 workspace packages type-checked"), check:type-check-debt ("27 ledger entr(ies) re-measured … none above its recorded number"). check:query-options-erasure ran alone under the lock after a first attempt was cut by the container's foreground cap: "✓ query-options-erasure ratchet holds: 67 unswept non-test site(s) in 17 file(s), none new". The ratchet families (check:slot-lookup, check:query-options-erasure, check:type-check-debt, check:spec-parsed-alias, check:where-matcher, check:engine-double-contract, check:test-source-alias) are all green on this head. The two remaining commands are the not-runnable-here pair below.

Type-level reverse verification against the rebuilt dist/*.d.ts (probe file in packages/lint, tsc --noEmit --ignoreConfig against @objectstack/spec/ui): the record form filter: { status: 'won' }red, TS2353 … 'status' does not exist in type '{ field: string; operator: unknown; value?: … }[]'; the array form → green (0 errors). The probe was deleted afterwards.

Not runnable here, by their own verdicts:check:react-declaration-parity (needs objectui's sdui.manifest.json, produced only by pnpm sdui:manifest on a pin bump — an on-demand gate by maintainer decision; this is the gate whose exemption element:number.filter:array becomes deletable downstream) and check-test-completeness (reads a saved turbo run test log; NOT MEASURED locally per its text). Repo-wide pnpm lint and the multi-package farm are CI's runs (declared narrowing — CI runs the farm on this PR).

H17 note

packages/spec/src/ui/view.zod.ts is not touchedViewFilterRuleSchema is imported from it in component.zod.ts only (on-hold #8346 declares it Restart-touch).

Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21

🤖 Generated with Claude Code

https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21


Generated by Claude Code

…the ViewFilterRule array form (ui#6206 Option B)
Accept-set change on one props-map entry: `filter` was `FilterConditionSchema`
(the MongoDB-style record), now `z.array(ViewFilterRuleSchema)` — the one
filter orthography every sibling `filter` input in the map already declares.
Sequenced consumer-first per the 2026-08-25 Option-A ordering ruling: the
objectui pin (d8ec8d6d) carries objectui#6828, re-measured before this move.
ADR-0087 semantic entry `element-number-filter-rule-array` carries the
prescription; `ElementNumberPropsParsed` declared and the Iso818 pin deleted
with its receipt (ADR-0122); orthography tests added.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
… fixture to the array orthography; regenerate api-surface, export-origins, docs
The ruled migration sweep found exactly one first-party author of the
record-form `filter` on `element:number` — `component.test.ts`'s "should
accept full number props" fixture — and zero in examples/, skills/,
create-objectstack, content/docs/, packages/apps/. The entry and changeset
now say so. `check:generated --fix` proved three artifacts stale and
regenerated them: api-surface and export-origins carry the new
`ElementNumberPropsParsed` export, the docs reference carries the array shape.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
@github-actionsgithub-actionsBot added size/m documentation Improvements or additions to documentation protocol:ui tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

4 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. ⚠️2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json) — pages documenting those are invisible to this run
  • 4 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 128 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 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6cpackageMentionDocs.

Which tree this was computed on

This run read content/docs from bc118cab41209b26b8cbf393c8c767de9df9edb1 — the merge of head 8068a7f317684f55c70fcc33e182ea0d67395cb7 into base 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c, 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 bc118cab41209b26b8cbf393c8c767de9df9edb1 && git checkout bc118cab41209b26b8cbf393c8c767de9df9edb1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c 8068a7f317684f55c70fcc33e182ea0d67395cb7 && git checkout -B drift-repro 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c && git merge --no-ff 8068a7f317684f55c70fcc33e182ea0d67395cb7
node scripts/docs-audit/affected-docs.mjs --json 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c

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

@os-zhuang
os-zhuang marked this pull request as ready for review September 2, 2026 04:44
@os-zhuang
os-zhuang added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 79b6a22Sep 2, 2026
43 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-12039-element-number-filter-array branch September 2, 2026 05:11
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationprotocol:uisize/mteststooling

Projects

None yet

2 participants

@os-zhuang@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B) - #14404

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array
Sep 2, 2026
Merged

feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B)#14404
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#12039

Key 2 of the card, and the half that completes it (Key 1 landed via PR #12120): ComponentPropsMap['element:number'].filter converges onto the ViewFilterRule array form.

Ruling of record (implemented exactly; not re-decided)

  • ui#6206-B (maintainer batch adjudication 2026-08-25, acceptance verbatim 「同意」): one filter orthography platform-wide — the entry's filter becomes z.array(ViewFilterRuleSchema).optional(), the shape every other filter input in component.zod.ts already declares (record:related_list, its Add-affordance picker).
  • Option-A sequencing (issue comment 5409255480; maintainer 「第三批决策(5 张) 同意」): consumer first, then spec. The consumer half is done — objectui#6828 landed and the objectstack pin .objectui-sha on origin/main is d8ec8d6d4f011b11c8eb1e6dbd364ef206711391, which carries it (comments 5492894409, 5502817852).
  • The ruling's own caveat, binding: "re-run the recorded refusal measurement if the pin has moved by execution time" and "if the runtime genuinely cannot take the array form, that is a fork back to triage, not a silent flip". Step 0 below is that re-run, executed before any edit.

Step 0 — measurement at the pin (before any edit)

Premise re-verified on origin/main @ 8094834 at fetch time: packages/spec/src/ui/component.zod.ts:1802 read filter: FilterConditionSchema.optional().describe('Filter criteria') inside ElementNumberPropsSchema; siblings at lines 1089 / 1125 read z.array(ViewFilterRuleSchema).

At objectui pin d8ec8d6d… (cd ../objectui && git fetch origin d8ec8d6d…, read with git show PIN:PATH, nothing checked out in the shared tree):

  1. Adapter lowers on the aggregate pathgit show PIN:packages/data-objectstack/src/index.ts, aggregate() at lines 4841–4927: the analytics branch reads payload.where = Array.isArray(params.filter) ? translateFilterArray(params.filter) : params.filter (lines 4924–4926, the objectui#6828 change, with its header comment naming objectui#6302). The spec-shape branch (where) stays strict by the 2026-08-30 option-A ruling and is not the element's path. PASS.

  2. Pin test exists and covers rule-object arraysgit show PIN:packages/data-objectstack/src/aggregate-filter-lowering.test.ts succeeds; cases cited: "translates a single rule into an AST tuple" ([{ field: 'stage', operator: 'equals', value: 'won' }]['stage', '=', 'won']), "the lowered value passes the AST gate the raw one fails" (isFilterAST(rules) false → true after lowering), "maps operator aliases the way the find() path does", "joins several rules with and", "lowers rules SPREAD into a logical node", and the cross-path parity block "produces the SAME where as the AST-tuple equivalent". PASS.

  3. Renderer is an opaque pass-throughgit show PIN:packages/components/src/renderers/basic/elements.tsx: ElementNumberRenderer declares filter?: unknown (line 373) and calls adapter.aggregate(props.object, { field, function: props.aggregate, groupBy: '_all', filter: props.filter }) (lines 402–407); the fallback adapter.find(props.object, { $filter: props.filter }) (line 419) goes through the same translateFilterArray via convertQueryParams. Nothing between the authored array and the adapter rewrites it. PASS.

  4. objectstack analytics door, replayed from PR feat(spec): converge ComponentPropsMap['object-grid'].data onto ViewDataSchema (ui#6207 Option A); record the ui#6206-B measurement fork #12120's Key 2 section (tsx script over service-analytics src after building its dependency closure — pnpm --filter '@objectstack/service-analytics^...' build, VERDICT command-exit 0):

    • isFilterAST([{ field: 'stage', operator: 'equals', value: 'won' }])false
    • isFilterAST([['stage', '=', 'won']])true
    • lowerAnalyticsWhere({ where: [{ field: 'stage', operator: 'equals', value: 'won' }] })throws[analytics] received a 'where' array that is not a filter: …
    • lowerAnalyticsWhere({ where: [['stage', '=', 'won']] }){ "stage": "won" }

    Expected and acceptable: the door itself is unchanged by design (raw rule-object array refused, AST tuples accepted). What changed since the recorded fork is reading 1 — the adapter now lowers before the wire — so the end-to-end chain is authored array → adapter lowering → AST → accepted. The stop condition (readings 1 or 2 failing) did not trigger.

The change

  • packages/spec/src/ui/component.zod.ts — the element:number entry's filter only: z.array(ViewFilterRuleSchema).optional() with a describe that names the orthography and the migration id; ViewFilterRuleSchema was already imported. FilterConditionSchema stays imported because element:record_picker.filter (now line 2141) still uses it — observed, not changed, per the dispatch.
  • ADR-0122 fallout (the same shape Key 1 hit): ViewFilterRuleSchema normalizes operator on parse (input ≠ infer — ViewFilterRuleParsed already exists for that reason), so ElementNumberPropsSchema leaves the isomorphic pin family: ElementNumberPropsParsed declared, the Iso818 pin deleted with its receipt, the pin count 836 → 835 in the header, the test title and the assertion.
  • ADR-0087: accept-set change on a published props-map entry ⇒ BREAKING under the launch-window convention. D3 semantic entry packages/spec/src/migrations/entries/semantic/18.element-number-filter-rule-array.ts (surface / replacement / reason / acceptanceCriteria, following Key 1's 18.object-grid-data-view-data-converged.ts); registry.ts regenerated with gen:migration-registry (144 semantic entries; Key 1's object-grid-data-view-data-converged and feat(spec): refuse undeclared keys on address and location values — AddressSchema / LocationValueSchema strict (#13802) #14335's address-location-value-unknown-keys-refused both present). Changeset .changeset/element-number-filter-rule-array.md: @objectstack/spec minor, **BREAKING**, FROM → TO block, and the adr-0087: registered element-number-filter-rule-array marker.
  • Tests (packages/spec/src/ui/component.test.ts, new describe block): array form accepted and echoed (the card's acceptance criterion); the real ViewFilterRuleSchema is what is wired (eq normalizes to equals; a scalar in value is refused at filter.0.value); the record form refused at the filter path with code: 'invalid_type', expected: 'array' (both the plain record and the operator-object record); an orthography pin that element:number and record:related_list give the same verdicts on the same value; a multi-rule positive control with a real in rule.
  • Generated products regenerated by check:generated --fix after proving exactly three stale: api-surface/ui.json + export-origins/ui.json (the new ElementNumberPropsParsed export) and content/docs/references/ui/component.mdx (the array shape). authorable-surface was already green (the key set did not change). No hand-docs edit: the only prose mention of element:number under content/docs (ui/pages.mdx:187) lists element names and says nothing about the filter shape.
  • No consumer-side alias, no fallback arm accepting the record form.

Ruled migration check — the sweep

Commands (tracked files on this branch):

git grep -n -A12 "ElementNumberPropsSchema\.\(parse\|safeParse\)\|ComponentPropsMap\['element:number'\]\|type: 'element:number'\|type=\"element:number\"" -- . ':!content/docs/references' ':!packages/spec/CHANGELOG.md' ':!packages/spec/api-surface' ':!packages/spec/export-origins' ':!packages/spec/declaration-map' ':!packages/spec/authorable-surface*' ':!.changeset' ':!packages/spec/src/migrations' | grep -E "filter: \{|filter: \["
grep -rn "element:number" examples skills packages/create-objectstack content/docs packages/apps

Result: one in-repo author of the props-level record form — packages/spec/src/ui/component.test.ts "should accept full number props" (filter: { status: 'paid' }), rewritten in this PR to [{ field: 'status', operator: 'equals', value: 'paid' }] (fixture triage: it used the form this entry alone accepted; its assertions are about format/prefix/suffix and still hold, plus one on the parsed filter). The three page.test.ts hits author dataSource.filter (ElementDataSourceSchema, a different key and schema — not this entry). Zero authors in examples/, skills/, packages/create-objectstack/, content/docs/ (other than the name list), packages/apps/. Out-of-repo authors get the prescription via the ADR-0087 entry.

Verification

Union derived with node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (no paths; stderr stamped "derived from the tree of 'objectstack-ai/objectstack' at commit 8068a7f"): 74 commands, each run under scripts/pm/os-verify-lock.sh through a runner that redirects output to a per-command log and captures the exit code before any pipe. HEAD for every reading below: 8068a7f31 (git rev-parse --short HEAD after the last commit; the tree was clean throughout).

Named must-haves, each on 8068a7f31:

  • pnpm --filter @objectstack/spec run typechecktsc --noEmit clean, check:scripts-typecheck clean, "check:test-typecheck: OK — @objectstack/spec's test layer compiles under packages/spec/tsconfig.test.json; 54 file(s) / 262 error(s) / 146 pinned signature(s) held" (VERDICT command-exit 0; re-run after the last commit).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/ui/component.test.ts src/type-alias-convention.pin.test.ts — Test Files 2 passed (2), Tests 238 passed (238).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 (the full spec suite) — Test Files 450 passed | 1 skipped (451); Tests 12111 passed | 1 skipped (12112), Duration 325.86s, VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec check:generated — "✓ All 15 generated artifacts are up to date" (that run includes check:migration-registry ✓, check:spec-changes ✓, check:upgrade-guide ✓, check:docs ✓, check:authorable-surface ✓, check:test-typecheck ✓).
  • check:api-surface ✓ and check:export-origins ✓ (exit 0 on the rebuilt dist); check:authorable-surface ✓ ("🔒 authorable-defaults/ verified against upstream d62f990 — 1236 default(s) unchanged"; no anchor hand-edited, baseRev left to lag); scripts/check-adr-0087-registration.mjs — "✓ check-adr-0087-registration: 1 declared-breaking changeset(s), each carrying an ADR-0087 disposition … registered element-number-filter-rule-array (new here)"; check:doc-authoring — "✓ doc authoring guard: 14375 customer-facing string(s) across 705 spec sources clean — no internal issue-id references"; check:nul-bytes — "check-nul-bytes: OK (scanned 7843 text file(s) -- 7843 tracked, 0 untracked-not-ignored; skipped 7 binary; no raw ASCII control bytes).".

The rest of the 74-command union: 72 of 74 exit 0 on 8068a7f31, per-command exit codes captured from redirection. Readings that first printed PREREQUISITE NOT MET / "dist is OLDER than src" (their own words: nothing measured, not a finding) were re-run after the prerequisite was built — pnpm --filter '@objectstack/lint...' build, then turbo run build --filter='./packages/*' --filter='./packages/*/*' (70/70 tasks successful, VERDICT command-exit 0) — and are green: check:doc-formula-expressions, check:doc-security-posture, check:browser-reachable-entries, check:dual-source-exports, check:entry-nameability, check:exported-any, check:skill-examples ("✅ 259 prose examples type-check across 3 surface(s)"), check:dev-prereqs ("✓ 67 package build artifacts present"), check:dual-build-cjs-loads ("102 published require entry point(s) across 66 package(s) load"), check:type-check-coverage ("67/78 workspace packages type-checked"), check:type-check-debt ("27 ledger entr(ies) re-measured … none above its recorded number"). check:query-options-erasure ran alone under the lock after a first attempt was cut by the container's foreground cap: "✓ query-options-erasure ratchet holds: 67 unswept non-test site(s) in 17 file(s), none new". The ratchet families (check:slot-lookup, check:query-options-erasure, check:type-check-debt, check:spec-parsed-alias, check:where-matcher, check:engine-double-contract, check:test-source-alias) are all green on this head. The two remaining commands are the not-runnable-here pair below.

Type-level reverse verification against the rebuilt dist/*.d.ts (probe file in packages/lint, tsc --noEmit --ignoreConfig against @objectstack/spec/ui): the record form filter: { status: 'won' }red, TS2353 … 'status' does not exist in type '{ field: string; operator: unknown; value?: … }[]'; the array form → green (0 errors). The probe was deleted afterwards.

Not runnable here, by their own verdicts:check:react-declaration-parity (needs objectui's sdui.manifest.json, produced only by pnpm sdui:manifest on a pin bump — an on-demand gate by maintainer decision; this is the gate whose exemption element:number.filter:array becomes deletable downstream) and check-test-completeness (reads a saved turbo run test log; NOT MEASURED locally per its text). Repo-wide pnpm lint and the multi-package farm are CI's runs (declared narrowing — CI runs the farm on this PR).

H17 note

packages/spec/src/ui/view.zod.ts is not touchedViewFilterRuleSchema is imported from it in component.zod.ts only (on-hold #8346 declares it Restart-touch).

Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21

🤖 Generated with Claude Code

https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21


Generated by Claude Code

…the ViewFilterRule array form (ui#6206 Option B)
Accept-set change on one props-map entry: `filter` was `FilterConditionSchema`
(the MongoDB-style record), now `z.array(ViewFilterRuleSchema)` — the one
filter orthography every sibling `filter` input in the map already declares.
Sequenced consumer-first per the 2026-08-25 Option-A ordering ruling: the
objectui pin (d8ec8d6d) carries objectui#6828, re-measured before this move.
ADR-0087 semantic entry `element-number-filter-rule-array` carries the
prescription; `ElementNumberPropsParsed` declared and the Iso818 pin deleted
with its receipt (ADR-0122); orthography tests added.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
… fixture to the array orthography; regenerate api-surface, export-origins, docs
The ruled migration sweep found exactly one first-party author of the
record-form `filter` on `element:number` — `component.test.ts`'s "should
accept full number props" fixture — and zero in examples/, skills/,
create-objectstack, content/docs/, packages/apps/. The entry and changeset
now say so. `check:generated --fix` proved three artifacts stale and
regenerated them: api-surface and export-origins carry the new
`ElementNumberPropsParsed` export, the docs reference carries the array shape.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
@github-actionsgithub-actionsBot added size/m documentation Improvements or additions to documentation protocol:ui tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

4 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. ⚠️2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json) — pages documenting those are invisible to this run
  • 4 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 128 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 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6cpackageMentionDocs.

Which tree this was computed on

This run read content/docs from bc118cab41209b26b8cbf393c8c767de9df9edb1 — the merge of head 8068a7f317684f55c70fcc33e182ea0d67395cb7 into base 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c, 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 bc118cab41209b26b8cbf393c8c767de9df9edb1 && git checkout bc118cab41209b26b8cbf393c8c767de9df9edb1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c 8068a7f317684f55c70fcc33e182ea0d67395cb7 && git checkout -B drift-repro 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c && git merge --no-ff 8068a7f317684f55c70fcc33e182ea0d67395cb7
node scripts/docs-audit/affected-docs.mjs --json 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c

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

@os-zhuang
os-zhuang marked this pull request as ready for review September 2, 2026 04:44
@os-zhuang
os-zhuang added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 79b6a22Sep 2, 2026
43 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-12039-element-number-filter-array branch September 2, 2026 05:11
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationprotocol:uisize/mteststooling

Projects

None yet

2 participants

@os-zhuang@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B) - #14404

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array
Sep 2, 2026
Merged

feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B)#14404
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#12039

Key 2 of the card, and the half that completes it (Key 1 landed via PR #12120): ComponentPropsMap['element:number'].filter converges onto the ViewFilterRule array form.

Ruling of record (implemented exactly; not re-decided)

  • ui#6206-B (maintainer batch adjudication 2026-08-25, acceptance verbatim 「同意」): one filter orthography platform-wide — the entry's filter becomes z.array(ViewFilterRuleSchema).optional(), the shape every other filter input in component.zod.ts already declares (record:related_list, its Add-affordance picker).
  • Option-A sequencing (issue comment 5409255480; maintainer 「第三批决策(5 张) 同意」): consumer first, then spec. The consumer half is done — objectui#6828 landed and the objectstack pin .objectui-sha on origin/main is d8ec8d6d4f011b11c8eb1e6dbd364ef206711391, which carries it (comments 5492894409, 5502817852).
  • The ruling's own caveat, binding: "re-run the recorded refusal measurement if the pin has moved by execution time" and "if the runtime genuinely cannot take the array form, that is a fork back to triage, not a silent flip". Step 0 below is that re-run, executed before any edit.

Step 0 — measurement at the pin (before any edit)

Premise re-verified on origin/main @ 8094834 at fetch time: packages/spec/src/ui/component.zod.ts:1802 read filter: FilterConditionSchema.optional().describe('Filter criteria') inside ElementNumberPropsSchema; siblings at lines 1089 / 1125 read z.array(ViewFilterRuleSchema).

At objectui pin d8ec8d6d… (cd ../objectui && git fetch origin d8ec8d6d…, read with git show PIN:PATH, nothing checked out in the shared tree):

  1. Adapter lowers on the aggregate pathgit show PIN:packages/data-objectstack/src/index.ts, aggregate() at lines 4841–4927: the analytics branch reads payload.where = Array.isArray(params.filter) ? translateFilterArray(params.filter) : params.filter (lines 4924–4926, the objectui#6828 change, with its header comment naming objectui#6302). The spec-shape branch (where) stays strict by the 2026-08-30 option-A ruling and is not the element's path. PASS.

  2. Pin test exists and covers rule-object arraysgit show PIN:packages/data-objectstack/src/aggregate-filter-lowering.test.ts succeeds; cases cited: "translates a single rule into an AST tuple" ([{ field: 'stage', operator: 'equals', value: 'won' }]['stage', '=', 'won']), "the lowered value passes the AST gate the raw one fails" (isFilterAST(rules) false → true after lowering), "maps operator aliases the way the find() path does", "joins several rules with and", "lowers rules SPREAD into a logical node", and the cross-path parity block "produces the SAME where as the AST-tuple equivalent". PASS.

  3. Renderer is an opaque pass-throughgit show PIN:packages/components/src/renderers/basic/elements.tsx: ElementNumberRenderer declares filter?: unknown (line 373) and calls adapter.aggregate(props.object, { field, function: props.aggregate, groupBy: '_all', filter: props.filter }) (lines 402–407); the fallback adapter.find(props.object, { $filter: props.filter }) (line 419) goes through the same translateFilterArray via convertQueryParams. Nothing between the authored array and the adapter rewrites it. PASS.

  4. objectstack analytics door, replayed from PR feat(spec): converge ComponentPropsMap['object-grid'].data onto ViewDataSchema (ui#6207 Option A); record the ui#6206-B measurement fork #12120's Key 2 section (tsx script over service-analytics src after building its dependency closure — pnpm --filter '@objectstack/service-analytics^...' build, VERDICT command-exit 0):

    • isFilterAST([{ field: 'stage', operator: 'equals', value: 'won' }])false
    • isFilterAST([['stage', '=', 'won']])true
    • lowerAnalyticsWhere({ where: [{ field: 'stage', operator: 'equals', value: 'won' }] })throws[analytics] received a 'where' array that is not a filter: …
    • lowerAnalyticsWhere({ where: [['stage', '=', 'won']] }){ "stage": "won" }

    Expected and acceptable: the door itself is unchanged by design (raw rule-object array refused, AST tuples accepted). What changed since the recorded fork is reading 1 — the adapter now lowers before the wire — so the end-to-end chain is authored array → adapter lowering → AST → accepted. The stop condition (readings 1 or 2 failing) did not trigger.

The change

  • packages/spec/src/ui/component.zod.ts — the element:number entry's filter only: z.array(ViewFilterRuleSchema).optional() with a describe that names the orthography and the migration id; ViewFilterRuleSchema was already imported. FilterConditionSchema stays imported because element:record_picker.filter (now line 2141) still uses it — observed, not changed, per the dispatch.
  • ADR-0122 fallout (the same shape Key 1 hit): ViewFilterRuleSchema normalizes operator on parse (input ≠ infer — ViewFilterRuleParsed already exists for that reason), so ElementNumberPropsSchema leaves the isomorphic pin family: ElementNumberPropsParsed declared, the Iso818 pin deleted with its receipt, the pin count 836 → 835 in the header, the test title and the assertion.
  • ADR-0087: accept-set change on a published props-map entry ⇒ BREAKING under the launch-window convention. D3 semantic entry packages/spec/src/migrations/entries/semantic/18.element-number-filter-rule-array.ts (surface / replacement / reason / acceptanceCriteria, following Key 1's 18.object-grid-data-view-data-converged.ts); registry.ts regenerated with gen:migration-registry (144 semantic entries; Key 1's object-grid-data-view-data-converged and feat(spec): refuse undeclared keys on address and location values — AddressSchema / LocationValueSchema strict (#13802) #14335's address-location-value-unknown-keys-refused both present). Changeset .changeset/element-number-filter-rule-array.md: @objectstack/spec minor, **BREAKING**, FROM → TO block, and the adr-0087: registered element-number-filter-rule-array marker.
  • Tests (packages/spec/src/ui/component.test.ts, new describe block): array form accepted and echoed (the card's acceptance criterion); the real ViewFilterRuleSchema is what is wired (eq normalizes to equals; a scalar in value is refused at filter.0.value); the record form refused at the filter path with code: 'invalid_type', expected: 'array' (both the plain record and the operator-object record); an orthography pin that element:number and record:related_list give the same verdicts on the same value; a multi-rule positive control with a real in rule.
  • Generated products regenerated by check:generated --fix after proving exactly three stale: api-surface/ui.json + export-origins/ui.json (the new ElementNumberPropsParsed export) and content/docs/references/ui/component.mdx (the array shape). authorable-surface was already green (the key set did not change). No hand-docs edit: the only prose mention of element:number under content/docs (ui/pages.mdx:187) lists element names and says nothing about the filter shape.
  • No consumer-side alias, no fallback arm accepting the record form.

Ruled migration check — the sweep

Commands (tracked files on this branch):

git grep -n -A12 "ElementNumberPropsSchema\.\(parse\|safeParse\)\|ComponentPropsMap\['element:number'\]\|type: 'element:number'\|type=\"element:number\"" -- . ':!content/docs/references' ':!packages/spec/CHANGELOG.md' ':!packages/spec/api-surface' ':!packages/spec/export-origins' ':!packages/spec/declaration-map' ':!packages/spec/authorable-surface*' ':!.changeset' ':!packages/spec/src/migrations' | grep -E "filter: \{|filter: \["
grep -rn "element:number" examples skills packages/create-objectstack content/docs packages/apps

Result: one in-repo author of the props-level record form — packages/spec/src/ui/component.test.ts "should accept full number props" (filter: { status: 'paid' }), rewritten in this PR to [{ field: 'status', operator: 'equals', value: 'paid' }] (fixture triage: it used the form this entry alone accepted; its assertions are about format/prefix/suffix and still hold, plus one on the parsed filter). The three page.test.ts hits author dataSource.filter (ElementDataSourceSchema, a different key and schema — not this entry). Zero authors in examples/, skills/, packages/create-objectstack/, content/docs/ (other than the name list), packages/apps/. Out-of-repo authors get the prescription via the ADR-0087 entry.

Verification

Union derived with node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (no paths; stderr stamped "derived from the tree of 'objectstack-ai/objectstack' at commit 8068a7f"): 74 commands, each run under scripts/pm/os-verify-lock.sh through a runner that redirects output to a per-command log and captures the exit code before any pipe. HEAD for every reading below: 8068a7f31 (git rev-parse --short HEAD after the last commit; the tree was clean throughout).

Named must-haves, each on 8068a7f31:

  • pnpm --filter @objectstack/spec run typechecktsc --noEmit clean, check:scripts-typecheck clean, "check:test-typecheck: OK — @objectstack/spec's test layer compiles under packages/spec/tsconfig.test.json; 54 file(s) / 262 error(s) / 146 pinned signature(s) held" (VERDICT command-exit 0; re-run after the last commit).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/ui/component.test.ts src/type-alias-convention.pin.test.ts — Test Files 2 passed (2), Tests 238 passed (238).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 (the full spec suite) — Test Files 450 passed | 1 skipped (451); Tests 12111 passed | 1 skipped (12112), Duration 325.86s, VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec check:generated — "✓ All 15 generated artifacts are up to date" (that run includes check:migration-registry ✓, check:spec-changes ✓, check:upgrade-guide ✓, check:docs ✓, check:authorable-surface ✓, check:test-typecheck ✓).
  • check:api-surface ✓ and check:export-origins ✓ (exit 0 on the rebuilt dist); check:authorable-surface ✓ ("🔒 authorable-defaults/ verified against upstream d62f990 — 1236 default(s) unchanged"; no anchor hand-edited, baseRev left to lag); scripts/check-adr-0087-registration.mjs — "✓ check-adr-0087-registration: 1 declared-breaking changeset(s), each carrying an ADR-0087 disposition … registered element-number-filter-rule-array (new here)"; check:doc-authoring — "✓ doc authoring guard: 14375 customer-facing string(s) across 705 spec sources clean — no internal issue-id references"; check:nul-bytes — "check-nul-bytes: OK (scanned 7843 text file(s) -- 7843 tracked, 0 untracked-not-ignored; skipped 7 binary; no raw ASCII control bytes).".

The rest of the 74-command union: 72 of 74 exit 0 on 8068a7f31, per-command exit codes captured from redirection. Readings that first printed PREREQUISITE NOT MET / "dist is OLDER than src" (their own words: nothing measured, not a finding) were re-run after the prerequisite was built — pnpm --filter '@objectstack/lint...' build, then turbo run build --filter='./packages/*' --filter='./packages/*/*' (70/70 tasks successful, VERDICT command-exit 0) — and are green: check:doc-formula-expressions, check:doc-security-posture, check:browser-reachable-entries, check:dual-source-exports, check:entry-nameability, check:exported-any, check:skill-examples ("✅ 259 prose examples type-check across 3 surface(s)"), check:dev-prereqs ("✓ 67 package build artifacts present"), check:dual-build-cjs-loads ("102 published require entry point(s) across 66 package(s) load"), check:type-check-coverage ("67/78 workspace packages type-checked"), check:type-check-debt ("27 ledger entr(ies) re-measured … none above its recorded number"). check:query-options-erasure ran alone under the lock after a first attempt was cut by the container's foreground cap: "✓ query-options-erasure ratchet holds: 67 unswept non-test site(s) in 17 file(s), none new". The ratchet families (check:slot-lookup, check:query-options-erasure, check:type-check-debt, check:spec-parsed-alias, check:where-matcher, check:engine-double-contract, check:test-source-alias) are all green on this head. The two remaining commands are the not-runnable-here pair below.

Type-level reverse verification against the rebuilt dist/*.d.ts (probe file in packages/lint, tsc --noEmit --ignoreConfig against @objectstack/spec/ui): the record form filter: { status: 'won' }red, TS2353 … 'status' does not exist in type '{ field: string; operator: unknown; value?: … }[]'; the array form → green (0 errors). The probe was deleted afterwards.

Not runnable here, by their own verdicts:check:react-declaration-parity (needs objectui's sdui.manifest.json, produced only by pnpm sdui:manifest on a pin bump — an on-demand gate by maintainer decision; this is the gate whose exemption element:number.filter:array becomes deletable downstream) and check-test-completeness (reads a saved turbo run test log; NOT MEASURED locally per its text). Repo-wide pnpm lint and the multi-package farm are CI's runs (declared narrowing — CI runs the farm on this PR).

H17 note

packages/spec/src/ui/view.zod.ts is not touchedViewFilterRuleSchema is imported from it in component.zod.ts only (on-hold #8346 declares it Restart-touch).

Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21

🤖 Generated with Claude Code

https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21


Generated by Claude Code

…the ViewFilterRule array form (ui#6206 Option B)
Accept-set change on one props-map entry: `filter` was `FilterConditionSchema`
(the MongoDB-style record), now `z.array(ViewFilterRuleSchema)` — the one
filter orthography every sibling `filter` input in the map already declares.
Sequenced consumer-first per the 2026-08-25 Option-A ordering ruling: the
objectui pin (d8ec8d6d) carries objectui#6828, re-measured before this move.
ADR-0087 semantic entry `element-number-filter-rule-array` carries the
prescription; `ElementNumberPropsParsed` declared and the Iso818 pin deleted
with its receipt (ADR-0122); orthography tests added.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
… fixture to the array orthography; regenerate api-surface, export-origins, docs
The ruled migration sweep found exactly one first-party author of the
record-form `filter` on `element:number` — `component.test.ts`'s "should
accept full number props" fixture — and zero in examples/, skills/,
create-objectstack, content/docs/, packages/apps/. The entry and changeset
now say so. `check:generated --fix` proved three artifacts stale and
regenerated them: api-surface and export-origins carry the new
`ElementNumberPropsParsed` export, the docs reference carries the array shape.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
@github-actionsgithub-actionsBot added size/m documentation Improvements or additions to documentation protocol:ui tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

4 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. ⚠️2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json) — pages documenting those are invisible to this run
  • 4 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 128 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 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6cpackageMentionDocs.

Which tree this was computed on

This run read content/docs from bc118cab41209b26b8cbf393c8c767de9df9edb1 — the merge of head 8068a7f317684f55c70fcc33e182ea0d67395cb7 into base 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c, 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 bc118cab41209b26b8cbf393c8c767de9df9edb1 && git checkout bc118cab41209b26b8cbf393c8c767de9df9edb1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c 8068a7f317684f55c70fcc33e182ea0d67395cb7 && git checkout -B drift-repro 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c && git merge --no-ff 8068a7f317684f55c70fcc33e182ea0d67395cb7
node scripts/docs-audit/affected-docs.mjs --json 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c

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

@os-zhuang
os-zhuang marked this pull request as ready for review September 2, 2026 04:44
@os-zhuang
os-zhuang added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 79b6a22Sep 2, 2026
43 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-12039-element-number-filter-array branch September 2, 2026 05:11
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationprotocol:uisize/mteststooling

Projects

None yet

2 participants

@os-zhuang@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B) - #14404

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array
Sep 2, 2026
Merged

feat(spec): converge ComponentPropsMap['element:number'].filter onto the ViewFilterRule array form (#12039, ui#6206 Option B)#14404
os-zhuang merged 2 commits into
mainfrom
claude/issue-12039-element-number-filter-array

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#12039

Key 2 of the card, and the half that completes it (Key 1 landed via PR #12120): ComponentPropsMap['element:number'].filter converges onto the ViewFilterRule array form.

Ruling of record (implemented exactly; not re-decided)

  • ui#6206-B (maintainer batch adjudication 2026-08-25, acceptance verbatim 「同意」): one filter orthography platform-wide — the entry's filter becomes z.array(ViewFilterRuleSchema).optional(), the shape every other filter input in component.zod.ts already declares (record:related_list, its Add-affordance picker).
  • Option-A sequencing (issue comment 5409255480; maintainer 「第三批决策(5 张) 同意」): consumer first, then spec. The consumer half is done — objectui#6828 landed and the objectstack pin .objectui-sha on origin/main is d8ec8d6d4f011b11c8eb1e6dbd364ef206711391, which carries it (comments 5492894409, 5502817852).
  • The ruling's own caveat, binding: "re-run the recorded refusal measurement if the pin has moved by execution time" and "if the runtime genuinely cannot take the array form, that is a fork back to triage, not a silent flip". Step 0 below is that re-run, executed before any edit.

Step 0 — measurement at the pin (before any edit)

Premise re-verified on origin/main @ 8094834 at fetch time: packages/spec/src/ui/component.zod.ts:1802 read filter: FilterConditionSchema.optional().describe('Filter criteria') inside ElementNumberPropsSchema; siblings at lines 1089 / 1125 read z.array(ViewFilterRuleSchema).

At objectui pin d8ec8d6d… (cd ../objectui && git fetch origin d8ec8d6d…, read with git show PIN:PATH, nothing checked out in the shared tree):

  1. Adapter lowers on the aggregate pathgit show PIN:packages/data-objectstack/src/index.ts, aggregate() at lines 4841–4927: the analytics branch reads payload.where = Array.isArray(params.filter) ? translateFilterArray(params.filter) : params.filter (lines 4924–4926, the objectui#6828 change, with its header comment naming objectui#6302). The spec-shape branch (where) stays strict by the 2026-08-30 option-A ruling and is not the element's path. PASS.

  2. Pin test exists and covers rule-object arraysgit show PIN:packages/data-objectstack/src/aggregate-filter-lowering.test.ts succeeds; cases cited: "translates a single rule into an AST tuple" ([{ field: 'stage', operator: 'equals', value: 'won' }]['stage', '=', 'won']), "the lowered value passes the AST gate the raw one fails" (isFilterAST(rules) false → true after lowering), "maps operator aliases the way the find() path does", "joins several rules with and", "lowers rules SPREAD into a logical node", and the cross-path parity block "produces the SAME where as the AST-tuple equivalent". PASS.

  3. Renderer is an opaque pass-throughgit show PIN:packages/components/src/renderers/basic/elements.tsx: ElementNumberRenderer declares filter?: unknown (line 373) and calls adapter.aggregate(props.object, { field, function: props.aggregate, groupBy: '_all', filter: props.filter }) (lines 402–407); the fallback adapter.find(props.object, { $filter: props.filter }) (line 419) goes through the same translateFilterArray via convertQueryParams. Nothing between the authored array and the adapter rewrites it. PASS.

  4. objectstack analytics door, replayed from PR feat(spec): converge ComponentPropsMap['object-grid'].data onto ViewDataSchema (ui#6207 Option A); record the ui#6206-B measurement fork #12120's Key 2 section (tsx script over service-analytics src after building its dependency closure — pnpm --filter '@objectstack/service-analytics^...' build, VERDICT command-exit 0):

    • isFilterAST([{ field: 'stage', operator: 'equals', value: 'won' }])false
    • isFilterAST([['stage', '=', 'won']])true
    • lowerAnalyticsWhere({ where: [{ field: 'stage', operator: 'equals', value: 'won' }] })throws[analytics] received a 'where' array that is not a filter: …
    • lowerAnalyticsWhere({ where: [['stage', '=', 'won']] }){ "stage": "won" }

    Expected and acceptable: the door itself is unchanged by design (raw rule-object array refused, AST tuples accepted). What changed since the recorded fork is reading 1 — the adapter now lowers before the wire — so the end-to-end chain is authored array → adapter lowering → AST → accepted. The stop condition (readings 1 or 2 failing) did not trigger.

The change

  • packages/spec/src/ui/component.zod.ts — the element:number entry's filter only: z.array(ViewFilterRuleSchema).optional() with a describe that names the orthography and the migration id; ViewFilterRuleSchema was already imported. FilterConditionSchema stays imported because element:record_picker.filter (now line 2141) still uses it — observed, not changed, per the dispatch.
  • ADR-0122 fallout (the same shape Key 1 hit): ViewFilterRuleSchema normalizes operator on parse (input ≠ infer — ViewFilterRuleParsed already exists for that reason), so ElementNumberPropsSchema leaves the isomorphic pin family: ElementNumberPropsParsed declared, the Iso818 pin deleted with its receipt, the pin count 836 → 835 in the header, the test title and the assertion.
  • ADR-0087: accept-set change on a published props-map entry ⇒ BREAKING under the launch-window convention. D3 semantic entry packages/spec/src/migrations/entries/semantic/18.element-number-filter-rule-array.ts (surface / replacement / reason / acceptanceCriteria, following Key 1's 18.object-grid-data-view-data-converged.ts); registry.ts regenerated with gen:migration-registry (144 semantic entries; Key 1's object-grid-data-view-data-converged and feat(spec): refuse undeclared keys on address and location values — AddressSchema / LocationValueSchema strict (#13802) #14335's address-location-value-unknown-keys-refused both present). Changeset .changeset/element-number-filter-rule-array.md: @objectstack/spec minor, **BREAKING**, FROM → TO block, and the adr-0087: registered element-number-filter-rule-array marker.
  • Tests (packages/spec/src/ui/component.test.ts, new describe block): array form accepted and echoed (the card's acceptance criterion); the real ViewFilterRuleSchema is what is wired (eq normalizes to equals; a scalar in value is refused at filter.0.value); the record form refused at the filter path with code: 'invalid_type', expected: 'array' (both the plain record and the operator-object record); an orthography pin that element:number and record:related_list give the same verdicts on the same value; a multi-rule positive control with a real in rule.
  • Generated products regenerated by check:generated --fix after proving exactly three stale: api-surface/ui.json + export-origins/ui.json (the new ElementNumberPropsParsed export) and content/docs/references/ui/component.mdx (the array shape). authorable-surface was already green (the key set did not change). No hand-docs edit: the only prose mention of element:number under content/docs (ui/pages.mdx:187) lists element names and says nothing about the filter shape.
  • No consumer-side alias, no fallback arm accepting the record form.

Ruled migration check — the sweep

Commands (tracked files on this branch):

git grep -n -A12 "ElementNumberPropsSchema\.\(parse\|safeParse\)\|ComponentPropsMap\['element:number'\]\|type: 'element:number'\|type=\"element:number\"" -- . ':!content/docs/references' ':!packages/spec/CHANGELOG.md' ':!packages/spec/api-surface' ':!packages/spec/export-origins' ':!packages/spec/declaration-map' ':!packages/spec/authorable-surface*' ':!.changeset' ':!packages/spec/src/migrations' | grep -E "filter: \{|filter: \["
grep -rn "element:number" examples skills packages/create-objectstack content/docs packages/apps

Result: one in-repo author of the props-level record form — packages/spec/src/ui/component.test.ts "should accept full number props" (filter: { status: 'paid' }), rewritten in this PR to [{ field: 'status', operator: 'equals', value: 'paid' }] (fixture triage: it used the form this entry alone accepted; its assertions are about format/prefix/suffix and still hold, plus one on the parsed filter). The three page.test.ts hits author dataSource.filter (ElementDataSourceSchema, a different key and schema — not this entry). Zero authors in examples/, skills/, packages/create-objectstack/, content/docs/ (other than the name list), packages/apps/. Out-of-repo authors get the prescription via the ADR-0087 entry.

Verification

Union derived with node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (no paths; stderr stamped "derived from the tree of 'objectstack-ai/objectstack' at commit 8068a7f"): 74 commands, each run under scripts/pm/os-verify-lock.sh through a runner that redirects output to a per-command log and captures the exit code before any pipe. HEAD for every reading below: 8068a7f31 (git rev-parse --short HEAD after the last commit; the tree was clean throughout).

Named must-haves, each on 8068a7f31:

  • pnpm --filter @objectstack/spec run typechecktsc --noEmit clean, check:scripts-typecheck clean, "check:test-typecheck: OK — @objectstack/spec's test layer compiles under packages/spec/tsconfig.test.json; 54 file(s) / 262 error(s) / 146 pinned signature(s) held" (VERDICT command-exit 0; re-run after the last commit).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/ui/component.test.ts src/type-alias-convention.pin.test.ts — Test Files 2 passed (2), Tests 238 passed (238).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 (the full spec suite) — Test Files 450 passed | 1 skipped (451); Tests 12111 passed | 1 skipped (12112), Duration 325.86s, VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec check:generated — "✓ All 15 generated artifacts are up to date" (that run includes check:migration-registry ✓, check:spec-changes ✓, check:upgrade-guide ✓, check:docs ✓, check:authorable-surface ✓, check:test-typecheck ✓).
  • check:api-surface ✓ and check:export-origins ✓ (exit 0 on the rebuilt dist); check:authorable-surface ✓ ("🔒 authorable-defaults/ verified against upstream d62f990 — 1236 default(s) unchanged"; no anchor hand-edited, baseRev left to lag); scripts/check-adr-0087-registration.mjs — "✓ check-adr-0087-registration: 1 declared-breaking changeset(s), each carrying an ADR-0087 disposition … registered element-number-filter-rule-array (new here)"; check:doc-authoring — "✓ doc authoring guard: 14375 customer-facing string(s) across 705 spec sources clean — no internal issue-id references"; check:nul-bytes — "check-nul-bytes: OK (scanned 7843 text file(s) -- 7843 tracked, 0 untracked-not-ignored; skipped 7 binary; no raw ASCII control bytes).".

The rest of the 74-command union: 72 of 74 exit 0 on 8068a7f31, per-command exit codes captured from redirection. Readings that first printed PREREQUISITE NOT MET / "dist is OLDER than src" (their own words: nothing measured, not a finding) were re-run after the prerequisite was built — pnpm --filter '@objectstack/lint...' build, then turbo run build --filter='./packages/*' --filter='./packages/*/*' (70/70 tasks successful, VERDICT command-exit 0) — and are green: check:doc-formula-expressions, check:doc-security-posture, check:browser-reachable-entries, check:dual-source-exports, check:entry-nameability, check:exported-any, check:skill-examples ("✅ 259 prose examples type-check across 3 surface(s)"), check:dev-prereqs ("✓ 67 package build artifacts present"), check:dual-build-cjs-loads ("102 published require entry point(s) across 66 package(s) load"), check:type-check-coverage ("67/78 workspace packages type-checked"), check:type-check-debt ("27 ledger entr(ies) re-measured … none above its recorded number"). check:query-options-erasure ran alone under the lock after a first attempt was cut by the container's foreground cap: "✓ query-options-erasure ratchet holds: 67 unswept non-test site(s) in 17 file(s), none new". The ratchet families (check:slot-lookup, check:query-options-erasure, check:type-check-debt, check:spec-parsed-alias, check:where-matcher, check:engine-double-contract, check:test-source-alias) are all green on this head. The two remaining commands are the not-runnable-here pair below.

Type-level reverse verification against the rebuilt dist/*.d.ts (probe file in packages/lint, tsc --noEmit --ignoreConfig against @objectstack/spec/ui): the record form filter: { status: 'won' }red, TS2353 … 'status' does not exist in type '{ field: string; operator: unknown; value?: … }[]'; the array form → green (0 errors). The probe was deleted afterwards.

Not runnable here, by their own verdicts:check:react-declaration-parity (needs objectui's sdui.manifest.json, produced only by pnpm sdui:manifest on a pin bump — an on-demand gate by maintainer decision; this is the gate whose exemption element:number.filter:array becomes deletable downstream) and check-test-completeness (reads a saved turbo run test log; NOT MEASURED locally per its text). Repo-wide pnpm lint and the multi-package farm are CI's runs (declared narrowing — CI runs the farm on this PR).

H17 note

packages/spec/src/ui/view.zod.ts is not touchedViewFilterRuleSchema is imported from it in component.zod.ts only (on-hold #8346 declares it Restart-touch).

Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21

🤖 Generated with Claude Code

https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21


Generated by Claude Code

…the ViewFilterRule array form (ui#6206 Option B)
Accept-set change on one props-map entry: `filter` was `FilterConditionSchema`
(the MongoDB-style record), now `z.array(ViewFilterRuleSchema)` — the one
filter orthography every sibling `filter` input in the map already declares.
Sequenced consumer-first per the 2026-08-25 Option-A ordering ruling: the
objectui pin (d8ec8d6d) carries objectui#6828, re-measured before this move.
ADR-0087 semantic entry `element-number-filter-rule-array` carries the
prescription; `ElementNumberPropsParsed` declared and the Iso818 pin deleted
with its receipt (ADR-0122); orthography tests added.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
… fixture to the array orthography; regenerate api-surface, export-origins, docs
The ruled migration sweep found exactly one first-party author of the
record-form `filter` on `element:number` — `component.test.ts`'s "should
accept full number props" fixture — and zero in examples/, skills/,
create-objectstack, content/docs/, packages/apps/. The entry and changeset
now say so. `check:generated --fix` proved three artifacts stale and
regenerated them: api-surface and export-origins carry the new
`ElementNumberPropsParsed` export, the docs reference carries the array shape.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
@github-actionsgithub-actionsBot added size/m documentation Improvements or additions to documentation protocol:ui tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

4 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. ⚠️2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json) — pages documenting those are invisible to this run
  • 4 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 128 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 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6cpackageMentionDocs.

Which tree this was computed on

This run read content/docs from bc118cab41209b26b8cbf393c8c767de9df9edb1 — the merge of head 8068a7f317684f55c70fcc33e182ea0d67395cb7 into base 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c, 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 bc118cab41209b26b8cbf393c8c767de9df9edb1 && git checkout bc118cab41209b26b8cbf393c8c767de9df9edb1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c 8068a7f317684f55c70fcc33e182ea0d67395cb7 && git checkout -B drift-repro 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c && git merge --no-ff 8068a7f317684f55c70fcc33e182ea0d67395cb7
node scripts/docs-audit/affected-docs.mjs --json 5ec4f6fa4c60e0e0a40986ee6a5d3a4b4b380c6c

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

@os-zhuang
os-zhuang marked this pull request as ready for review September 2, 2026 04:44
@os-zhuang
os-zhuang added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 79b6a22Sep 2, 2026
43 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-12039-element-number-filter-array branch September 2, 2026 05:11
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationprotocol:uisize/mteststooling

Projects

None yet

2 participants

@os-zhuang@claude