Skip to content

s-expr filter discoverability: --where/--filter/query show no example of the common field-equality form #381

@avrabe

Description

@avrabe

Friction (dogfooding, hourly loop)

While implementing+using rivet modify --where '<s-expr>' (#380) I reached for the obvious-looking filter (status "draft") and got:

error: invalid --where filter: offset 0: unknown form 'status'
  note: unknown head symbol; see docs/getting-started.md for the supported forms
        (!=/</<=/=/>/>=/and/contains/count/excludes/exists/…/matches/not/or/…)

The error is honest and lists every head form — but for the single most common query an agent writes ("field X equals value Y") it doesn't show the shape. The correct form is (= status "draft") (head is =, not the field name). I only found that by grepping rivet-cli/tests/sexpr_filter_integration.rs.

What finally helped

grep -rE '\(= [^)]+\)' rivet-cli/tests/sexpr_filter_integration.rs → saw (= type "requirement") / (= status "passed") and corrected to (= status "draft").

Suggested fix (small, agent-UX)

  1. Add one concrete example to the parse error itself, e.g.:
    note: e.g. (= status "draft"), (and (= type "requirement") (has-tag "safety"))
  2. Mirror that example in the --help for the commands that take an s-expr (query, list --filter, export --filter, and now modify --where). The modify --where after_help already includes (and (type "requirement") (status "draft")) — note even that example I first wrote used the wrong (type …)/(status …) shorthand; canonicalizing on (= field "value") everywhere would prevent the same mistake.

This is pure discoverability — the engine itself is fine. It just costs every first-time (human or agent) author one failed round-trip + a grep through tests. Will track the product side as a REQ.

(Filed while landing #380, which adds modify --where.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions