Skip to content

fix(formula): list-equality prescribes a rewrite that works at each site, and judges a flow condition only where the run binds the typed row - #36340

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-36167-list-equality-followup
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-36167-list-equality-followup

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #36167

This is the card's last item: the builder half (#36185) and the validator half (#36207) are merged, and the remaining follow-ups have their own cards (#36217 skills text, #36218 review follow-ups, #36219 the as-you-type editor).

Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up #36217

维护者速读

  • 作者把多值字段(多选、多人等)与单个值比较相等时,系统给出的改写建议现在在每个位置都能用:共享规则条件里也能用,且建议本身加了括号,不会被前面的条件拆开;由接口、定时或无触发方式启动的流程里,这种写法不再被误拒。
  • 属于「表达式校验与作者护栏」:上一个已合并的拉取请求开始拒绝这种写法,复审发现它给的改写在共享规则里无法生效、部分写法会报错,还会误拒正确的流程条件。
  • 若出错,作者看到的只是另一种改写建议,或某个流程条件不再被拦下;本改动可以整体撤回,不影响已存储的数据。
  • 无

What changes

Follow-up to #36207, which merged before its round-4 review findings were addressed. This PR covers four of them: r05 S1, r05 S2, r05 S4 / r06 N1, and r06 S1.

The prescribed rewrite is spelled for its site and parenthesised whole (listMembershipRewrite in packages/formula/src/validate.ts). Each spelling below was measured on the site's own evaluator or filter compiler:

site == rewrite != rewrite
a record. / previous. read evaluated as CEL (validation rule, field rule, formula, action visible / disabled / pressed, hook condition) (has(record.f) && record.f != null && "v" in record.f) (!has(record.f) || record.f == null || !("v" in record.f))
a bare name at a flow condition (the run binds every declared field, null when empty) (f != null && "v" in f) (f == null || !("v" in f))
a sharing rule condition, compiled to a query filter (new ExprSchemaHint.filterCompiled, filled by the publish lint) (record.f != null && record.f.contains("v")) (record.f == null || !record.f.contains("v"))

No single spelling works at every site, which is why the rewrite differs per site:

  • "v" in record.f does not lower to a filter. compileCelToFilter answers "in requires a field on the left (got literal)", so the sharing rule is dropped as sharing-rule-unlowerable-condition.
  • has() does not lower either ("unsupported operator call").
  • On the CEL evaluator, record.f.contains("v") faults on a list, because there is no list.contains overload.
  • record.f != null && "v" in record.f faults on a row that lacks the key ("No such key"), which a sparse action row does. It also faults on a null previous, as on a create.

The filter spelling lowers to $and[{f:{$null:false}}, {f:{$contains:"v"}}] and $or[{f:{$null:true}}, {$not:{f:{$contains:"v"}}}]. $contains on a JSON-stored (multi-value) column is membership in matchesFilterCondition and in driver-sql (sql-driver-17590-json-column-membership.test.ts). A number or boolean operand is passed as its text (contains("3")), since $contains compares text. The sharing-site message also says why == does not work there: the query filter refuses $eq against a list column.

A flattened (flow) site is judged only where the run binds a row of the typed object (r06 S1). checkListEquality now returns early at a 'flattened' site unless faultOutcome is 'run-fails'. That outcome is declared only on a record-triggered flow, or on a time-relative sweep of the typed object: the lint's faultOutcomeOf ledger, validate-expressions.ts around line 1632. On any other flow (API, schedule, no trigger), the ledger's own row says the run "holds what its entrance handed it". seedRunVariables flattens whatever record that is. So an API flow whose request body carries a string labels runs labels == 'frontend' correctly, and #36207 refused it. The MCP tool already passes this outcome for flow_condition (its default triggerKind is record_change). registerFlow's advisory pass now passes it on the same flows (runBindsTypedRow, which this PR moves above the hint). Side effect: on those flows, the pass's logged type-mismatch lines take the run-fails wording that os validate already prints. It still only logs and never throws.

Docblocks (r05 S4 / r06 N1).

  • ExprSchemaHint.multiValueFields now names the forms actually judged:
    • record.f / previous.f and the bracket spelling;
    • the optional spellings, which are refused as invalid-cel first;
    • the bare name, only at a flattened site with run-fails, excluding flowVariables and bareNamesUnproven;
    • comprehension-bound names, which are never the field.
  • ExpressionRefusalParams['list-equality'] now documents reference (the bracket spelling renders record.f; a bare name is the bare name) and the per-site rewrite.

Semantic entry cel-list-equality-refused now has the per-site replacement text and the narrowed surface. The surface adds the sharing rule condition and limits flows to the proven-row ones.

Tests

  • packages/formula/src/validate-list-equality-36167.test.ts
    • New describe, "the prescribed rewrite tests membership where it is read". For each site class it takes the rewrite out of the refusal itself, pins its text, and runs it:
      • CEL member read: evaluated on rows [a,b] / [b] / [] / null / absent, and with previous = null. Each is also checked inside record.name == 'x' && …, record.name == 'y' && … and false || …, which pins the parenthesisation.
      • Bare name: evaluated with the row bound as top-level names.
      • Filter: lowered with compileCelToFilter and matched with matchesFilterCondition (with the column declared tags), including inside &&.
      • Each rewrite validates clean at its own site.
      • The CEL in form is shown not to lower.
    • New describe, "a flattened site with no proven row binding gets no verdict": bare and record. reads, fail-closed / fail-open, plus a proven-site control.
  • packages/formula/src/expression-refusal-codes.test.ts: the two list-equality PINS carry the new rewrites. Two new pins cover the bare name at a proven flattened site and the filterCompiled site, with params and the whole message.
  • packages/lint/src/validate-expressions.list-equality-36167.test.ts:
    • action visible rewrites pinned, and each validates clean;
    • a flow condition's bare != rewrite pinned in the parenthesised form and accepted inside stage == 'qa' && …;
    • CONTROLS: an API, a trigger-less autolaunched and a scheduled flow get no list-equality, bare or record.;
    • new describe, the sharing rule condition: refused with the contains rewrite, and that rewrite draws no finding from the expression lint or from validateSharingRuleEnforceability (it lowers);
    • CONTROL: the CEL in forms draw sharing-rule-unlowerable-condition there.
  • packages/services/service-automation/src/list-equality-advisory-36167.test.ts:
    • makeFlow now states its trigger (record-after-update);
    • parenthesised bare rewrite pinned and not reported itself;
    • CONTROLS: API, scheduled and trigger-less flows report nothing;
    • premise: the bare rewrites answer per row on evaluateCondition, including false && (…).
  • Two fixtures fixed at 254d40cb (they had never run; each stopped before the behaviour it pins):
    • the sharing-rule describe in the lint pin built its rule with a recipient type the spec does not have (role) and no rule type, so all three cases failed at the spec-validity guard. It now uses type: 'criteria' and a team recipient, as the other spec-valid sharing fixtures do;
    • the API-flow CONTROL in the service-automation pin carried no hook secret, so registerFlow refused the flow before the advisory pass ran. It now names a secretRef (ADR-0041).
  • packages/mcp/src/mcp-validate-expression.list-equality-36167.test.ts: the flow_condition rewrite is pinned and validates clean. CONTROL: triggerKind api / schedule / none get no list-equality.

Acceptance notes

Verification

Final head 254d40cb (handover head 5a29954a + origin/main merged at 2b570445 + the two fixture fixes). Every reading below is at that head.

Package suites and pins
  • Build closure --filter '@objectstack/lint^...' --filter '@objectstack/mcp^...' --filter '@objectstack/service-automation^...' --filter '@objectstack/scenarios^...' build: lock VERDICT command-exit 0. Later a full pnpm build --concurrency=2: 120/120 tasks, VERDICT command-exit 0.
  • Pins: formula validate-list-equality-36167 + expression-refusal-codes 250/250 (the 8 bare-name failures of the handover run are gone); lint validate-expressions.list-equality-36167 27/27 (3 failed before the fixture fix); mcp mcp-validate-expression.list-equality-36167 15/15; service-automation list-equality-advisory-36167 22/22 (1 failed before the fixture fix).
  • Full suites, one locked run, VERDICT command-exit 0: formula build + test 70 files / 2107 tests + typecheck exit 0; lint 225 files / 9434 tests + typecheck exit 0; mcp 83 files / 1467 tests + typecheck exit 0; service-automation 290 files / 4220 tests + typecheck exit 0; spec src/migrations 5 files / 198 tests.
Ablations (seven, each through ablation-replace WRAP mode under the lock)

Each mutation was proven on disk (anchor 1 to 0, blob changed) and restored (blob equal to the HEAD blob, empty git diff HEAD). Every mutated module is read from source by its suite, so there is no dist leg.

ablation file pin result
delete the flattened proven-row early return formula validate.ts 5 failed / 245 passed (250)
never take the filterCompiled spelling formula validate.ts 13 failed / 237
drop the outer parentheses of the != member-read rewrite formula validate.ts 6 failed / 244
drop has() from the == member-read rewrite formula validate.ts 4 failed / 246
lint passes no filterCompiled at the sharing rule lint validate-expressions.ts 2 failed / 25 (27)
service-automation always declares run-fails flow-registration-checks.ts 3 failed / 19 (22): the API, scheduled and trigger-less CONTROLS
service-automation never declares run-fails flow-registration-checks.ts 5 failed / 17 (22)
Derived gates
  • dispatch-gates --commands at 254d40cb: 96 families. dispatch-gates --ran with recorded exit codes: 96 derived, 96 run, 0 NOT-MEASURED (a derived zero), every family exit 0.
  • Three needed a prerequisite first and were re-run: check-plugin-teardown-shape --self-test (exit 3 on the shallow clone until its pinned fixture commit was fetched, then exit 0); the cli migrate-meta-engine-guidance vitest (exit 1, MODULE_NOT_FOUND on an unbuilt @objectstack/mcp dist, then 3/3 after the full build); check:dual-build-cjs-loads (exit 3 PREREQUISITE NOT MET, then exit 0 after the full build: 124 require entry points across 72 packages load).
  • check:type-check-debt exit 0. check:nul-bytes OK. overlap-check VERDICT clean exit 0 against origin/main 2b570445 and fix(formula)!: a flow condition's record. / previous. date arithmetic is refused as its bare name is #36333 (shares validate.ts, merges cleanly).
  • CI at 254d40cb: all 69 check-runs completed, every one success or skipped (Check Changeset, PR-body guards, Governed Surface Queue Guard, every Lint and Type Check lane, Test Core 10/10 shards, Test UI 16/16, Build Core, Dogfood Regression Gate).
  • test:repo was not run locally (the diff touches no repo-project test); CI's Test Core ran it.

Dogfood battery: n/a (no ! in the title, and Clause-②: yes (widening) has no (narrowing) arm).

Two-minute check: pnpm --filter @objectstack/formula exec vitest run src/validate-list-equality-36167.test.ts. Expected: every test passes, including the "prescribed rewrite" and "no proven row" describes.

Read first, by risk:

  1. packages/formula/src/validate.ts: listMembershipRewrite and the early return in checkListEquality.
  2. packages/services/service-automation/src/flow-registration-checks.ts: faultOutcome on the advisory hint.
  3. packages/lint/src/validate-expressions.ts: the sharing-rule check(…, true).

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jVXKcrF3rr7ShYFZ9E

…is read; flattened sites judged only on a proven row

The `list-equality` refusal now spells its membership rewrite for
the site and parenthesises it whole:

- a `record.` / `previous.` read evaluated as CEL: has()-guarded `in`, which
  answers on a sparse row and a null `previous` instead of faulting;
- a bare name at a flow condition: `!= null`-guarded `in`;
- a sharing rule condition (new `ExprSchemaHint.filterCompiled`, filled by the
  publish lint): `.contains(...)`, which lowers to `$contains`; the CEL `in`
  form does not lower there (`in` needs a field on its left).

At a flattened site the verdict needs `faultOutcome: 'run-fails'` (a
record-triggered flow or a time-relative sweep of the typed object): an API,
scheduled or trigger-less flow holds what its entrance handed it, where
`labels == 'frontend'` can be correct code. registerFlow's advisory pass now
declares that outcome on the same flows os validate does.

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

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 4 package(s): @objectstack/formula, @objectstack/lint, @objectstack/service-automation, @objectstack/spec, touching 11 documentable anchor(s).

13 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/api/declarative-endpoints.mdx (via record_change (literal, a string literal in validateFlowExpressions))
  • content/docs/api/plugin-endpoints.mdx (via record_change (literal, a string literal in validateFlowExpressions))
  • content/docs/automation/approvals.mdx (via record_change (literal, a string literal in validateFlowExpressions))
  • content/docs/automation/flows.mdx (via record_change (literal, a string literal in validateFlowExpressions), time_relative (literal, a string literal in validateFlowExpressions))
  • content/docs/automation/hooks.mdx (via record_change (literal, a string literal in validateFlowExpressions))
  • content/docs/automation/workflows.mdx (via record_change (literal, a string literal in validateFlowExpressions))
  • content/docs/concepts/architecture.mdx (via record_change (literal, a string literal in validateFlowExpressions))
  • content/docs/getting-started/common-patterns.mdx (via record_change (literal, a string literal in validateFlowExpressions))
  • content/docs/kernel/services-checklist.mdx (via record_change (literal, a string literal in validateFlowExpressions))
  • content/docs/permissions/capabilities.mdx (via record_change (literal, a string literal in validateFlowExpressions), time_relative (literal, a string literal in validateFlowExpressions))
  • content/docs/permissions/system-context.mdx (via record_change (literal, a string literal in validateFlowExpressions))
  • content/docs/protocol/objectql/schema.mdx (via record_change (literal, a string literal in validateFlowExpressions))
  • content/docs/ui/actions.mdx (via record_change (literal, a string literal in validateFlowExpressions))

⛔ 4 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v12.mdx (via record_change (literal, a string literal in validateFlowExpressions))
  • content/docs/releases/v16.mdx (via time_relative (literal, a string literal in validateFlowExpressions))
  • content/docs/releases/v17/17-0.mdx (via record_change (literal, a string literal in validateFlowExpressions))
  • content/docs/releases/v17/17-5.mdx (via time_relative (literal, a string literal in validateFlowExpressions))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

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

Coarse fallback — 175 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 482afcc4df4774843b3ba863a8f7ad3eaffbd973 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from b2ee3a5ae6fd526a113566c414de6564f7ea2d12 — the merge of head 254d40cb40233500bc47152a1e91da62a451a324 into base 482afcc4df4774843b3ba863a8f7ad3eaffbd973, 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 b2ee3a5ae6fd526a113566c414de6564f7ea2d12 && git checkout b2ee3a5ae6fd526a113566c414de6564f7ea2d12
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 482afcc4df4774843b3ba863a8f7ad3eaffbd973 254d40cb40233500bc47152a1e91da62a451a324 && git checkout -B drift-repro 482afcc4df4774843b3ba863a8f7ad3eaffbd973 && git merge --no-ff 254d40cb40233500bc47152a1e91da62a451a324

node scripts/docs-audit/affected-docs.mjs --json 482afcc4df4774843b3ba863a8f7ad3eaffbd973

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 482afcc4df4774843b3ba863a8f7ad3eaffbd973 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…uality pins build fixtures that register

The sharing-rule fixture named a recipient type the spec does not have and
no rule type, so the three sharing-site cases stopped at the spec-validity
guard. The API-flow control carried no hook secret, so registerFlow refused
it before the advisory pass ran.

Claude-Session: https://claude.ai/code/session_01QsR2jVXKcrF3rr7ShYFZ9E
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract-review-claim: session_01QsR2jTeURPvEm465RcoYEC · head 254d40c · 2026-11-22T08:26Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 ACCEPT · head 254d40cb40233500bc47152a1e91da62a451a324 · 2026-11-22T08:28Z

维护者速读

席位核对

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 254d40cb40233500bc47152a1e91da62a451a324
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/18.cel-list-equality-refused.ts + packages/formula/src/validate.ts, packages/formula/src/expression-refusal.ts, packages/lint/src/validate-expressions.ts, packages/services/service-automation/src/flow-registration-checks.ts

Inputs read: card #36167 (body and all 14 comments), PR #36340 (body, both comments, 11-file list), the net diff against main (merge-base 2b570445), and the 73 check-runs on this head: every one success or skipped, none failed or pending. The rest of the diff (four test files, the changeset body as prose) is the lane seat's ACCEPT at TIER_DEFAULT.

① Derived judgments

  • Public surface, added: optional key ExprSchemaHint.filterCompiled on the published @objectstack/formula type. Additive; absent means the CEL spelling, so every existing caller is unchanged. Right.
  • Accept set, widened: checkListEquality returns before any verdict at an explicit scope: 'flattened' site unless faultOutcome is 'run-fails'. Flow conditions on API, scheduled, trigger-less flows and on a sweep of another object are accepted again, bare and record.; so is a non-gate node config.condition in the lint, which is handed no outcome. Right: the lint ledger (faultOutcomeOf) declares run-fails only where a row of the typed object is bound.
  • Accept set, narrowed: nothing. The sharing rule condition was already judged through the lint check with multiValueFields; only the message and params.rewrite change there. The previously prescribed spelling stays accepted at every site. Right.
  • Refusal payload: ExpressionRefusalParams['list-equality'].rewrite changes text (parenthesised, per-site). Same key set, same code. A consumer pinning the old string sees new text; not a shape change. Right.
  • registerFlow advisory pass: now hands faultOutcome: 'run-fails' on the flows runBindsTypedRow names. Read in validateFlowExpressions: the hinted pass feeds logger.warn only, and valueEnvelopeFieldTypes reads schemaHint.fieldTypes alone, so nothing thrown or stored moves. Right.
  • Semantic entry cel-list-equality-refused: surface and replacement prose updated, same id. Right.

② Semver level

Clause-②: yes (widening) holds on the tree: one optional public key added, one refusal withdrawn, no refusal added. The changeset carries the same three declaration lines as the PR body and the amended claim 7076040422. minor on @objectstack/formula (new public key) and @objectstack/lint (accept set widened, prescription changed) matches what is published. minor on @objectstack/service-automation (log wording and the advisory's reach) and @objectstack/spec (entry prose) is at or above what the diff publishes; over-declaring is not an error. @objectstack/mcp is rightly absent: only a test file moves there. Check Changeset (both runs) and Governed Surface Queue Guard concluded success.

③ Boundary flags

  • Dev report 7076502400: open_questions is empty. The earlier open question (7075362046: keep filterCompiled as a public key, A, or rewrite the prescription locally in the lint, B) is answered A on the merits, not only by the claim: the refusal's params.rewrite and its message are built in the validator, so B would leave the params carrying a spelling that does not lower while the lint sentence said another.
  • Deviation, claim declared no (narrowing) / narrowed, PR declares yes (widening) / added: the tree agrees with the PR (①), and the seat's amended claim agrees.
  • Deviation, two fixtures repaired at this head (lint sharing rule fixture, service-automation API flow control): test files, outside ④; Test Core 10/10 concluded success on this head.
  • Flag, driver-sql leg cited not run: read JSON_COLUMN_INCOMPATIBLE_OPERATORS (packages/core): $eq / $ne / $in are refused on a multi-value column and $contains / $notContains are deliberately absent, documented there as the only membership spelling. The citation holds.
  • Flag, a decision or other non-gate node config.condition gets no verdict in the lint: consistent with the ledger row (inert, flow-inert-node-condition). Accepted.
  • SQL push-down: no id materialisation and no in-app join is added. The sharing-site prescription moves from a form the filter compiler refuses to one that lowers to $contains, which is push-down gained.
  • Out-of-scope note in the report (docs-drift lists 13 pages by trigger-kind literals): none of those anchors is the list-equality text; skills text is carried by skills/objectstack-formula: say that == / != on a list-valued field (multiselect, tags, a multiple: true field) is refused, and teach in / exists instead #36217.

④ Design judgment

Hits file, 18.cel-list-equality-refused.ts, against the code it describes and its first consumer (the validator's refusal):

  • Surface: the added "sharing rule condition" and "flow whose run binds a row of that object: a record-triggered flow, or a time-relative sweep of it" match check(..., true) at the sharing site and the early return in checkListEquality. The "Not the shape" list matches the three exits (comprehension binding, flowVariables, no proven row).
  • Replacement: the three spellings match listMembershipRewrite arm for arm. Tried to break each: the has() conjunction is the repo's own stated guard for a sparse binding (validate-null-guards.ts ledger, action visible / disabled row) and is harmless on a total one; the bare form has no has() because the macro takes no bare name; the filter form uses the one operator the JSON-column gate leaves open. No other filter-compiled site reaches this validator with a typed object (RLS predicates are judged by their own gates; the MCP site map has no sharing site), so no site is left with a prescription that fails where it is read.

Implementing files, sentence by sentence:

  • validate.ts, listMembershipRewrite / listEqualityRefusal: agrees with the docblocks and the entry. filterCompiled with a bare read falls through to the bare arm, which cannot occur at a record site. Number and boolean operands are quoted as text; read storedArrayHasMember, which matches a stored JSON number by its text.
  • expression-refusal.ts: the list-equality params docblock matches what listEqualityRefusal emits.
  • validate-expressions.ts: the new trailing check parameter is spread only when true; the one caller is the sharing rule. Agrees.
  • flow-registration-checks.ts: runBindsTypedRow is the existing expression moved above the hint, unedited; the hint takes run-fails on exactly those flows.

S1 (should-fix) — packages/formula/src/validate.ts, the new early return tests schema?.scope === 'flattened', while the published scope docblock names 'flattened' the default and the type pass in the same function reads an absent scope as flattened (the else of schema?.scope === 'record'). A hint that omits scope therefore still has record.f == 'a' refused with no run-fails proof, on any flow, which is the false refusal this PR removes, and the new multiValueFields sentence "At a flattened site with no proven row, nothing is judged" is untrue for that hint. Measured reach in this repo: none; every producer (lint check, MCP site map, registerFlow, the scenario scorer, Studio lintCelPredicate) passes scope explicitly, so only an outside caller of the published validator meets it. Non-blocking, and it can be carried on a follow-up card (#36218 already holds this PR family's review follow-ups): test scope !== 'record' there and at bareSubjects, with one pin for the absent-scope hint.

Nits (no effect on correctness or the contract; left as follow-up, not fixed on this head):

  • N1 — checkListEquality docblock still opens with "The prescription is membership, in the null-guarded spelling the Studio condition builder writes: S != null && V in S", which the paragraph added below it and listMembershipRewrite now contradict for a record. read.
  • N2 — the changeset says registerFlow's logged type-mismatch lines "now use the wording os validate prints". Not on a time-relative sweep (the pass hands no timeRelativeSweep, so the logged line names a firing write the sweep does not have) nor where a flow variable or an open binder shadows the name (no flowVariables / bareNamesUnproven, already review follow-ups of PR #36207 #36218). Log text only.
  • N3 — the entry's surface lists an action's visible / disabled and omits pressed, which the lint judges; its "Not the shape" list omits the bareNamesUnproven exit and the sweep of another object; the text operand rule (contains("3")) is in the changeset but not the entry.
  • N4 — a uint literal (3u) would be quoted as "3u" at the filter site and match nothing; a field name that is not a CEL identifier (record['a-b']) renders has(record.a-b). Both need a list field compared with an unusual literal or name; the second predates this PR.

Escalations for the seat (outside this diff, not graded here):

Implemented-by: claude/issue-36167-list-equality-followup
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Landing (seat 7, 2026-11-22T08:59Z): head 254d40cb40233500bc47152a1e91da62a451a324 · L1 ACCEPT 7076539630 (L1-d) · L2 PASS 7076594662 (CONTRACT_REVIEW_TIER; no must-fix) · check-governed-merges --pr 36340: NOT governed, 600 changed lines ≤ 3000 · CI on the head: all success or skipped · claim 7076040422 (amended) covers the surface. → pr_ready + automerge_enable (merge queue).
Accepted deviations: L2 S1 (checkListEquality gates on scope === 'flattened' where it should gate on scope !== 'record'), carried by #36218 (7076821148); nits N1–N4 accepted. Escalations filed by the seat: #36381 (the Studio builder's membership spelling vs the validator's per-site prescription) and #36382 (a list field read through a relationship is judged at no door). Fixes #36167 closes the card with #36217, #36218, #36219, #36381 and #36382 carrying the rest.

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

studio: the CEL ConditionBuilder offers == / != on a list subject, and validateExpression accepts a condition that answers a constant

2 participants