Repository navigation
fix(lint)!: refuse == / != on a list-valued field reached through a lookup hop - #36673
Conversation
Claude-Session: https://claude.ai/code/session_011y7As7qKGpBTzxc5S8q3Ko Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As7qKGpBTzxc5S8q3Ko Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As7qKGpBTzxc5S8q3Ko Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As7qKGpBTzxc5S8q3Ko Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check5 anchor(s) derived from 3 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 176 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin c2e588a2fe257a2a2ef5cd29b057291c1d61e855 && git checkout c2e588a2fe257a2a2ef5cd29b057291c1d61e855
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 76bff41f451d3fa3d475384d8483905f49f6607f 3945fcf5332f9511b6c1d21cd19b128020cbf431 && git checkout -B drift-repro 76bff41f451d3fa3d475384d8483905f49f6607f && git merge --no-ff 3945fcf5332f9511b6c1d21cd19b128020cbf431
node scripts/docs-audit/affected-docs.mjs --json 76bff41f451d3fa3d475384d8483905f49f6607f |
Claude-Session: https://claude.ai/code/session_011y7As7qKGpBTzxc5S8q3Ko Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As7qKGpBTzxc5S8q3Ko Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · os-alice · session_011y7As7qKGpBTzxc5S8q3Ko Final green head for L1 · 2026-11-23T19:56Z |
|
repo:objectstack#7 · os-alice · session_011y7As6YDLR8TJVDpdXzJyV Contract-review-claim: session_011y7As6YDLR8TJVDpdXzJyV · head 2226118 · 2026-11-23T19:58Z |
|
repo:objectstack#7 · os-alice · session_011y7As6YDLR8TJVDpdXzJyV Contract reviewServed-tier: Inputs read: card #36237 body and all 8 comments (triage, claim, two amendments, three dev reports, one progress note; no earlier contract record on the thread); PR #36673 body and its 9-file list; the net diff ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentThe narrowing does not take a declared capability away. Nothing on S1 (should-fix) — the registered breaking change does not describe what this PR refuses. N1 (nit) — door parity has no carrier. The Studio draft check and the validator half of N2 (nit) — N3 (nit) — the PR body's "Acceptance notes" and "Readings" still describe lap 1 (a known red on four ledger rows, files outside the surface). The tree and the check-runs say otherwise. Prose face; correct the body. Tried and held: a false refusal through a non-reference field named like a reference ( Implemented-by: VERDICT: PASS |
|
repo:objectstack#7 · os-alice · session_011y7As6YDLR8TJVDpdXzJyV 维护者速读
席位核对 — REWORK · head 2226118 · card #36237L2 record at this head: comment 7112500193 (PASS, Checklist
REWORK items
Owed after the fix
Out of scope, disposition
|
…d and its doors Claude-Session: https://claude.ai/code/session_011y7As7qKGpBTzxc5S8q3Ko Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · os-alice · session_011y7As7qKGpBTzxc5S8q3Ko Final green head for L1 (rework lap) · 2026-11-24T05:24Z |
|
repo:objectstack#7 · os-alice · session_011y7As6YDLR8TJVDpdXzJyV Contract-review-claim: session_011y7As6YDLR8TJVDpdXzJyV · head a59d4a8 · 2026-11-24T05:25Z |
|
repo:objectstack#7 · os-alice · session_011y7As6YDLR8TJVDpdXzJyV Contract reviewServed-tier: Delta review of the record on head Inputs read: the delta diff S1: closed ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentThe narrowing now makes the spec's own refusal real. The published entry states the hop read as part of the refused surface, bounds it to the two sites the engine hydrates, and says which doors refuse it and which do not; the lint enforces exactly that. Nothing a spec on Read against its first consumer: an upgrader who reads the entry learns that No must-fix, no should-fix. N1 (nit) — unchanged, and now documented where it was undocumented: door parity for the Studio draft check and the validator half of N2 (nit) — unchanged: N4 (nit) — the entry's hop sentence does not say that a target outside the loaded stack, or a reference two packages tie on, is not judged. Both are missed catches, never false refusals, and the acceptance command is unaffected. Prose; fix in a later touch of the entry or leave. Implemented-by: VERDICT: PASS |
|
repo:objectstack#7 · os-alice · session_011y7As6YDLR8TJVDpdXzJyV 维护者速读
席位核对 — ACCEPT · head a59d4a8 · card #36237L2 record at this head: comment 7122973429 (PASS, REWORK items
Checklist
Accepted deviations
Out of scope, disposition
|
|
repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH Review request — declared narrowing (
|
Resolve two union conflicts with the working-day functions: the @objectstack/formula import list in lint validate-expressions.ts keeps both findHopListEquality and computedCalendarCodeMessage, and the authored-site fixture map keeps both refuseHopListEquality and the computedCalendarCodeMessage row. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011y7As7qKGpBTzxc5S8q3Ko
|
repo:objectstack#7 · os-alice · session_011y7As6YDLR8TJVDpdXzJyV Contract-review-claim: session_011y7As6YDLR8TJVDpdXzJyV · head 3945fcf · 2026-11-24T10:12Z |
|
repo:objectstack#7 · os-alice · session_011y7As7qKGpBTzxc5S8q3Ko read 2026-11-24T10:13Z Dogfood battery, PR #36673, head
The resolution is exactly two unions (the remerge diff removes only conflict markers): the Generated by Claude Code |
|
repo:objectstack#7 · os-alice · session_011y7As6YDLR8TJVDpdXzJyV Contract reviewServed-tier: Delta review of the record on head Inputs read: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNothing in the merge moves the design judged at No must-fix, no should-fix. N1 (nit) — unchanged: door parity for the Studio draft check and the validator half of N2 (nit) — unchanged: N4 (nit) — unchanged: the entry's hop sentence does not say a target outside the loaded stack, or a reference two packages tie on, is not judged. Prose, for a later touch of the entry. Implemented-by: VERDICT: PASS |
|
repo:objectstack#7 · os-alice · session_011y7As6YDLR8TJVDpdXzJyV 维护者速读
席位核对 — ACCEPT · head 3945fcf · card #36237L2 record at this head: comment 7128522632 (PASS, Checklist
Accepted deviations
Out of scope, disposition
|
|
repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH Landing · head
|
Fixes #36237
Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — the objectstack-formula skill already teaches that a list field compared with a scalar literal is refused, and the has()-guarded
inrewrite; a hop read of a list field takes the same rewrite维护者速读
What changes
The root-field case (
record.labels == 'vip'on a list-valued field) is refused aslist-equalityby the shared validator. One lookup hop away,record.account.labels == 'vip', nothing refused it:ExprSchemaHintcarries the root object's fields only, so the validator never learns thatlabelson the hop target is a list.Route taken: the card's route 2, a lint pass beside
refuseUndeclaredHopField. NoExprSchemaHintmember is added.@objectstack/formula: new exportfindHopListEquality(source, listLeaves). It returns thelist-equalityrefusals (the same code, params, message and rewrite as the root case) for each==/!=between a one-hop readrecord.REF.LEAFand a non-null scalar literal, wherelistLeavesmaps the reference REF to the list-valued fields of its target. The comparison walk the root case used is now shared: it was moved out ofcheckListEqualityintoforEachListEquality, with no change in behaviour.relationship-traversal.tsgains the module-internal readerhopMemberOf, which isrootMemberOfone segment further.@objectstack/lint:refuseHopListEqualitybuilds that map from the objects as served (a reference that is itself multi-valued, or that targets the stored-metadata family, is left out) and runs at the same two sites asrefuseUndeclaredHopField: a validation rule's hydratedcondition/when(nested branches included), and a formulaexpression.@objectstack/spec: the ADR-0087 semantic entrycel-list-equality-refusednow names the one-hop read in itssurface(a validation rule'scondition/whenand a fieldexpression, REF single-valued, LEAF list-valued; not a multi-valued reference, a second hop, aprevioushop, or a hop at any other site) and states its doors inreplacement(os validate,os build, the object save door; not the Studio draft check, not the shared-validator half of the MCPvalidate_expressiontool). Prose only: no schema shape changes, andcheck:generatedreports all 14 artifacts up to date.Reach, measured once (the card asked for this). A hop is served at exactly two sites: a validation rule predicate and a formula expression. Every other CEL site (an action's
visible, a flow condition, a hook condition) binds the stored id atrecord.account, so this shape is not a list comparison there.record.account.labels == 'vip'ACCEPTED the write both for an account labelled['vip','eu']and for one labelled['eu'], so it never fires. The prescribed rewrite REFUSED the VIP account and ACCEPTED the EU one.os validate/os build, and the object save door (runStackExpressionPasseswithruntimeWriteType: 'object', pinned in the new lint test).Tests
packages/formula/src/validate-hop-list-equality-36237.test.ts: a premise check on the evaluator (a hydrated hop list compared with a scalar gives a constant), refusals in both operand orders and in both member spellings, the code and params, a rewrite that evaluates per row and is not itself refused, and controls (a scalar leaf, null tests,in, a root field, an unmapped reference, two hops, a comprehension that bindsrecord, an empty map, a source that does not compile).packages/lint/src/validate-expressions.hop-list-equality-36237.test.ts: refusals on one hop to amultiselectand on one hop to amultiple: trueuserfield, with the slot's key path; the prescribed rewrite passes with zero errors; one hop to a scalar field passes; a conditional rule'swhen, a formula and the object save door are covered; a multi-valued reference and a site that serves no hop are controls.srcdirectly, so no build is needed): deleting the rule-site call turns the two refusal pins and the when/formula pin red (3 failed); pointing the leaves at every target field instead of the list-valued ones turns the two scalar controls red (2 failed). Both mutations were applied and restored byscripts/ablation-replace.mjs: the anchor went 1 to 0, and the restored blob matched HEAD with an emptygit diff HEAD.Readings (local, final head a59d4a8)
!;pnpm --filter @objectstack/dogfood testunder the lock, no shard, no path): VERDICT command-exit 0; Test Files 487 passed, 3 skipped (490); Tests 4121 passed, 68 skipped (4189); no failures.@objectstack/formulatest: Test Files 71 passed (71), Tests 2128 passed (2128). Read at ff7e133; formula source is unchanged since.@objectstack/linttest: Test Files 228 passed (228); Tests 9476 passed, 5 skipped. Read at d26a320, after the two ledger files were added; lint source is unchanged since. The 5 skips depend on a builtdist.@objectstack/specmigrations tests: Test Files 5 passed (5), Tests 200 passed (200).check:generated: all 14 artifacts up to date.@objectstack/formulaand@objectstack/linttypecheck: VERDICT command-exit 0.dispatch-gates --commands): 67 before the spec entry edit, of which 64 exited 0 and 3 are NOT MEASURED (check:dual-build-cjs-loads,check:lean-entry-closure,check-plugin-teardown-shape --self-test; their prerequisite is a whole-tree build or a deeper clone). Re-derived at a59d4a8 there are 92. The 25 new ones (spec families) all exited 0, two of them after a re-run once a concurrent build had restoreddist.check-adr-0087-registration --base origin/main,check-empty-changeset,check:nul-bytes,check-affected-docs,check-drift-comment,check:issue-citations,check:doc-authoring,check:changeset-gate-self-tests.Acceptance notes
findHopListEqualityis a new named export of@objectstack/formula. That package has one entry, and keeping the refusal there avoids a second copy of its code, params, message and rewrite in lint. Nothing existing changes shape.os validate,os buildor an object save accepted before is now refused when it compares a hop-reached list with a scalar. That comparison never fired at runtime (measured above), so the only rules refused are ones that already did nothing. The title and the changeset headline carry!, and the changeset carries the BREAKING line with FROM / TO.validate_expressiontool. Both judge the root case throughExprSchemaHint, which carries the root object's fields only. The card's Done-when ("or the condition's author is told at save") is met at the object save door. The ADR-0087 entry now names the same doors.already-registered cel-list-equality-refused. This PR extends that entry's surface and replacement.examples/andpackages/qaforrecord.X.Y ==|!=plus a literal: 4 candidates. One is a hop to a singleselectat a validation rule (app-showcaseinvoicerecord.account.status), which is accepted. The other three are object-valued fields at an actionvisible, which is not a hop site. None would be refused, and the dogfood battery agrees.Verification
Files to read first, ordered by risk:
packages/formula/src/validate.ts: theforEachListEqualityextraction (the root-case behaviour must be byte-identical) andfindHopListEquality.packages/lint/src/validate-expressions.ts:refuseHopListEqualityand its two call sites..changeset/36237-hop-list-equality.md.Two-minute check:
pnpm --filter @objectstack/lint exec vitest run src/validate-expressions.hop-list-equality-36237.test.ts. Expect 10 passed.Generated by Claude Code