Repository navigation
docs(skills): objectstack-formula says == / != on a list-valued field is refused and teaches the null-guarded membership test - #36354
Conversation
…nd the null-guarded membership test Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY 席位核对L1 verdict: ACCEPT at head
Contract-review-handoff: l2-review — CONTRACT_REVIEW_TIER unavailable (maintainer quota order 2026-11-15T21:53Z; no L2 seat seated, 2026-11-22T08:17Z) · head d319685 |
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract-review-claim: session_01ADHkmT4eA4YqtxfiPyLPih · head d319685 · 2026-11-22T15:15Z |
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract reviewServed-tier: Read: card #36217 (body and all four comments), PR #36354 (body, file list, net diff against merge-base Why ① Derived judgments
② Semver level
Clause-②: no — correct: the diff refuses no input and narrows no declared capability; it documents a refusal ③ Boundary flags
④ Design judgment
M1 (must-fix) — the note marks N1 (nit) — the list of list-valued fields is not the full set. The rest of the note holds against the code: the code
S1 (should-fix) — case 13's reference answer fails case 13's own assertions. The prompt itself is a fair scenario for the card: a hook Open on this head: M1, S1. N1 may be folded into the M1 fix or left. Implemented-by: VERDICT: FAIL |
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
…ach site takes The note under the CEL cheat-sheet now shows the three spellings the validator's refusal prescribes: the has()-guarded `in` test where the expression is evaluated as CEL, the bare-name form at a flow condition, and `.contains()` at a sharing rule's condition, which compiles to a query filter where `in` with the literal first does not lower. Each rewrite is parenthesised whole, for == and for !=. The list of list-valued fields names every type that takes `multiple`. Paid for by six more same-file cuts of restatement; ceiling unchanged. Eval case 13's reference answer now passes its own assertions, and case 14 exercises the sharing-rule spelling. Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract-review-claim: session_01ADHkmT4eA4YqtxfiPyLPih · head 5dfda71 · 2026-11-22T16:15Z |
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract reviewServed-tier: Delta round on the record at Read: card #36217 (body and all five comments), PR #36354 (body, file list, net diff against merge-base Why ① Derived judgments
② Semver level
Clause-②: no — correct: the diff refuses no input and narrows no declared capability; it documents a refusal ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. M1: closed — the note teaches per site what S1: closed — case 13 forbids the wrong literal as a wrong answer writes it (the N1: closed — the note names
N2 (nit) — case 14 can fail two answers that are not wrong. Its Open on this head: none. Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY 维护者速读(席位记录 · head
|
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY 席位核对 — ACCEPTACCEPT at head |
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY Hand-off for approval: L1 ACCEPT and the CONTRACT_REVIEW_TIER PASS (7081992501) are both on head |
Requested by Steve · project thread
Fixes #36217
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
skills/objectstack-formula/SKILL.md, the published formula skill, gains a note directly under the CEL cheat-sheet's operator table. It says that==/!=between a list-valued field and a scalar literal is refused, names the refusal as the validator emits it, names which fields are list-valued, and shows the refused form beside the rewrite the refusal prescribes at each site, for==and for!=:The six rewrites are what
listMembershipRewrite(packages/formula/src/validate.ts) returns at each site, read onorigin/mainat 9abc732 after merging it into this branch; the file is unchanged up to dda5e74. The skill writes the literal single-quoted where the validator prints it double-quoted; nothing else differs, and a probe compares the two mechanically (see Tests). The three sites:record./previous.read): theintest, guarded byhas()and!= null.has()is what keeps the test from faulting on an action's sparse row and on apreviousthat isnull.intest behind!= nullalone, becausehas()takes no bare name.condition:.contains(). That condition is never evaluated as CEL. It is compiled to a query filter, whereinlowers only with a field on its left andhas()does not lower at all, so the CEL spelling there is refused at build and the rule grants nothing. This is the one site lint marks as filter-compiled (packages/lint/src/validate-expressions.ts, the sharing-rulecheckcall).Every rewrite is parenthesised whole, as the validator writes it, so it can stand where the comparison stood (
A && (…)).The list of list-valued fields is now the full set:
multiselect/checkboxes/tags(MULTI_OPTION_TYPES), andselect/radio/lookup/user/file/imagewithmultiple: true(MULTI_CAPABLE_TYPES,packages/spec/src/data/field-value.zod.ts).The note no longer offers
.exists(). The validator prescribesinand.contains(), and the eval case grades theinspelling.Paid for by deletion, ceiling unchanged
The file had 32 tokens of headroom under its ratchet ceiling (6008), and the note costs more. No ceiling was raised. Twelve restatements were cut from the same file, each keeping another home. The first six were in the head reviewed before; the last six pay for the per-site spellings.
has()section's opening sentence ("true whenever the key exists")Key existence (NOT null-safety), the section heading, and the paragraph that followsos builderrors with a located message, and the flow engine throws"Verify your worksectionprevioustable directly under it, and the cheat-sheet rowPrevious record (update hooks, validation rules)previoustable'safter*row, which names the record-change flow triggerString literal("CEL parses the double-quoted form too")src/to read in an installed app"distonly"daysBetween(a, b)for whole days, twodatetime(…)for hours (row below)" in the date-arithmetic noteInclusive span,Tenure in yearsandHours betweenSub-day offsetrow's "the calendar helpers land on UTC midnight"today(),daysFromNow(n)anddaysAgo(n), each "at UTC midnight"previous.status, wherepreviousisnull" in the unevaluable-condition warningprevioustable's insert row:null, and "a column read off it (previous.x) has no value and faults"previous.status != 'done' && record.status == 'done')previous.status != 'escalated' && record.status == 'escalated'); the sentence it illustrated staysOLD.xandISCHANGED(x)both land onprevious.x, which isnullon an insert event")OLD.xandISCHANGED(x)rows directly above it, and theprevioustable's insert row; the warning keeps "previous.xfails the write on an insert unless guarded byprevious != null &&"Skill size readings (lines are the measure; tokens as the ratchet counts them):
origin/main9abc732)skills/objectstack-formula/SKILL.md, linesskills/*/SKILL.md, lines.changeset/36217-formula-skill-list-equality.md: apatchfor@objectstack/skills, which ships theskills/**tree through itsdist. Its text follows the note: the three spellings, the twelve cuts, the two eval cases.Two eval cases exercise the note, in
skills/objectstack-formula/evals/cel-predicates-formulas.json:conditionover atagsfield (evaluated as CEL): must containrecord.labels != null,in record.labelsand thePtag. It now forbids the wrong literal as a wrong answer writes it, thePtag followed byrecord.labels == 'urgent', and no longer the bare comparison, which a correct answer names as the thing refused. Its reference answer is the validator's spelling.conditionover the same field: must containrecord.labels != nullandrecord.labels.contains(, and forbids the wrong literal and ahas(record.labels) &&guard, which does not lower.Eval fixtures are measured by the token ratchet, not ratcheted.
Tests
Nothing here changes tested behaviour, so there is no ablation. Two throwaway probes, both at 5dfda71.
The six rewrites against the validator, the evaluator and the filter compiler
A probe read the six rewrite lines out of the skill file and ran
validateExpression,celEngine.evaluate,compileCelToFilterandmatchesFilterConditionfrompackages/formula/srcover them (run withtsx,@objectstack/specresolved to its source). Last line:PROBE OK: 0 unexpected.params.rewriteof thelist-equalityrefusal at its site (quote character aside): CEL site==and!=, flow site==and!=, sharing rule==and!=null/ key absent==:true/false/false/false/false;!=: the negation; no faultprevious = null==false,!=true, no fault==:true/false/false/false;!=: the negationcompileCelToFilterand matched against the same five rows!=: the others)record.tags != null && 'vip' in record.tags, handed tocompileCelToFilternot lowered: unsupported, all threemultiselect,checkboxes,tags;select,radio,lookup,user,file,imagewith the field named multi-valuedlist-equalityThe eval file's reference answers under its own grader
gradeAnswer(packages/qa/scenarios/src/skill-evals/grade.ts) over each case'sexpected_output, cases parsed by the runner's ownparseEvalFile:forbidden=["record.labels == 'urgent'"]Named answers at 5dfda71, each graded as expected: case 13 passes the note's CEL spelling and the plain null-guarded
inspelling, and fails the refused form and the.contains()spelling; case 14 passes the note's.contains()spelling (single- or double-quoted, with or without thePtag), and fails the CEL spelling, ahas()-guarded.contains()and the refused form.Acceptance notes
.contains()as its text (record.f == 3becomesrecord.f.contains("3")); and at a flow condition the refusal fires only where the run is proven to bind a row of the typed object. Neither changes what an author should write for a text value; the refusal's own message carries the exact rewrite in both cases.'x' in record.tags,record.tags.exists(t, t == 'x')) are accepted by the validator and fault on anulllist. The skill teaches the validator's guarded forms and does not offer.exists(). Noted here and not filed.SharingRulecondition"aborts the write". The lint rule for sharing rules (packages/lint/src/validate-sharing-rule-enforceability.ts) describes a different outcome for a condition that does not lower: a build error, and at runtime a rule that is skipped and grants nothing, with one WARN line. That sentence is outside this card and was left as it is. Noted here and not filed.mainmoved from 9abc732 to dda5e74 after the merge. The seven commits touch no file underskills/,packages/formula/, the sharing-rule call in lint, the eval grader or the token ratchet, so the branch was not merged again.Verification
Read first: the new note under the cheat-sheet table in
skills/objectstack-formula/SKILL.mdbesidelistMembershipRewriteinpackages/formula/src/validate.ts, then the twelve deletions in the same diff, then cases 13 and 14 in the eval file.Two-minute check:
node scripts/check-skills-token-ratchet.mjs— expect the formula row to read6007 / 6008and every file within its ceiling.Local gates at 5dfda71
The derived set (
node scripts/pm/dispatch-gates.mjs --commands, 49 commands) was run in full;--ranreconciliation: "49 derived famil(ies) accounted for — 44 run, 5 NOT-MEASURED (5 DERIVED from a recorded exit 3)". 44 exited 0, among themnode scripts/check-skills-token-ratchet.mjs("6007 tokens (ceiling 6008; headroom 1)"),pnpm --filter @objectstack/spec run check:skill-docs("Skill docs in sync"),pnpm check:skill-links,pnpm check:skill-identifier-liveness,pnpm check:skill-compatibility,pnpm check:skill-frame-sync,pnpm check:doc-authoring,pnpm check:nul-bytes,pnpm check:published-files,node scripts/check-empty-changeset.mjs --base origin/main,node scripts/check-changeset-no-major.mjs --base origin/main.NOT MEASURED locally (exit 3, prerequisite not met: each reads built package output):
pnpm --filter @objectstack/lint run check:doc-formula-expressions,pnpm check:dts-closure,pnpm check:dual-build-cjs-loads,pnpm check:lean-entry-closure,pnpm check:sourcemap-no-sources-content. The build they need never got the container's shared verify lock: three waits of 5, 540 and 540 seconds, allqueue-timeout, behind one dogfood run that held the lock for more than 80 minutes. CI ran them on this head: all 29 completed check-runs on 5dfda71 aresuccess(16 more are skipped), among them Lint & Repo Gates, Lint · docs & code guards, Lint · repo & tooling gates, Lint · PM dispatch-gates, TypeScript Type Check, Type Check · source gates, Build Core, Test Core, Check Changeset and Governed Surface Queue Guard.Outside the derived set:
pnpm --filter @objectstack/spec run check:skill-refsexit 0 ("10 generated files in sync").🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY