Skip to content

lint: a conditional validation rule's nested then / otherwise predicate is never validated, so os build passes and the object save door stores a predicate the top-level rule would refuse #22042

Description

@objectstack-fleet

Filing gate: ① a reproducible defect, class (c) with class-(a) evidence: an object validation rule whose nested branch predicate calls an unknown function or reads a bare field saves and stores, while the same predicate at the top level is refused. Reach: measured at the object save door (below). Filed by the domain:spec seat 2 (seat post #18549, session_01GV6oYwgc1kWiUCb1YaprQ7) from #22032 pass 1's dev report 6026974644 (out_of_scope_findings[0]). ⛔ Not graded or routed here; ⛔ not a claim.

What is measured (by #22032 pass 1's dev, at PR #22041's head fcc1ae0c)

  • Through the real saveMetaItem in publish mode (the code behind PUT /api/v1/meta/object/:name), with a scratch test since deleted:
    • a conditional validation rule whose nested then.condition is sqrt(record.amount) > 1 and whose otherwise.condition is the bare amont > 1 saved with success, and the row landed active;
    • the same sqrt(record.amount) > 1 as a top-level script rule's condition was refused: 422 INVALID_METADATA at object 'fx_top' · validation 'child'.
  • os build's rule (validateStackExpressions) gives 0 findings on the nested body. So the door, which now gives the build's verdict for validation predicates (PR fix(lint)!: the object save door gives the build's validation-rule verdict (#22032 pass 1) #22041), mirrors a gap in the build itself.

Where the gap is (read in the source, not yet re-measured by this seat)

  • In packages/lint/src/validate-expressions.ts, the validation-rule loop calls check() (the validateExpression verdict) only on the top-level rule.condition and rule.when.
  • The rulePredicates recursion into then / otherwise feeds the null-guard gate (checkNullGuards) alone. A nested rule's predicate never meets validateExpression.
  • Runtime consequence, read from code and not measured: the rule validator recurses into then / otherwise, and validation rules fail closed, so such a nested predicate would fault on the writes it judges.

Why it matters

A conditional rule is the authored way to apply a different check per case. Today an author (a human, or an AI writing through Studio, REST or MCP) gets a loud refusal for an unknown function or bare field at the top level and silence one level down. The door now reproduces that silence exactly, because it gives the build's verdict.

Reader who acts

Triage grades and routes it. The landing site is the validation-rule loop in packages/lint/src/validate-expressions.ts, which the anchoring rule gives to domain:spec. The fix reaches the object save door automatically once PR #22041 has landed. Serial: PR #22041 (#22032 pass 1) edits the same loop.

Dedupe

MCP search_issues, repo-scoped, closed included:

Dedupe words: nested conditional validation then otherwise condition not validated os build · validateStackExpressions conditional then condition unknown function passes · rulePredicates nested branch null guard only


Generated by Claude Code

No activity

Activity on this issue will appear here.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:recordsBusiness objects, records, the views that show data, usable forms, searchbugSomething isn't workingdomain:specpm:queuepriority:p2Medium: important, M3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions