Skip to content

fix(sexpr): show field-equality example in filter parse error (REQ-142, #381)#383

Merged
avrabe merged 1 commit into
mainfrom
fix/sexpr-filter-error-example
Jun 2, 2026
Merged

fix(sexpr): show field-equality example in filter parse error (REQ-142, #381)#383
avrabe merged 1 commit into
mainfrom
fix/sexpr-filter-error-example

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Jun 2, 2026

Closes the discoverability friction I filed in #381.

The s-expression filter dialect (shared by query, list --filter, export --filter, modify --where) puts an operator in head position, but the most common first attempt is (status "draft") — field name in head — which failed with only a list of head forms and no example of the correct shape.

Before:

note: unknown head symbol; see docs/getting-started.md for the supported forms (!=/…/or/…)

After:

note: unknown head symbol — the head is an operator, not a field name. For field
      equality use `(= <field> "<value>")`, e.g. `(= status "draft")` or
      `(and (= type "requirement") (has-tag "safety"))`. See docs/getting-started.md
      for all supported forms (!=/…)

The note is generated once in sexpr_eval, so the improvement reaches every command that parses a filter — verified on both modify --where and list --filter. Also added an example to the export --filter help (it had none, unlike list/query).

Verification

Implements: REQ-142

🤖 Generated with Claude Code

#381)

The s-expression filter dialect (query / list --filter / export --filter
/ modify --where) puts an operator in head position, but the single most
common first attempt is `(status "draft")` — field name in head — which
fails with `unknown form 'status'`. The error listed every supported
head form but showed no example of the correct `(= field "value")`
shape, so every first-time author (human or agent) burned a round-trip
and a grep through the tests to discover it.

The `unknown head symbol` note now states the head is an operator (not a
field name) and shows the form inline: `(= status "draft")` /
`(and (= type "requirement") (has-tag "safety"))`. Generated once in
`sexpr_eval`, so it reaches every command that parses a filter. Verified
on `modify --where` and `list --filter`. Also added an example to the
`export --filter` help (it had none, unlike list/query). Test asserts
the example is present.

Implements: REQ-142
Refs: REQ-007

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

📐 Rivet artifact delta

Change Count
Added 1
Removed 0
Modified 0
Downstream impacted (depth ≤ 5) 0

Graph

graph LR
  REQ_142["REQ-142"]:::added
  classDef added fill:#d4edda,stroke:#28a745,color:#155724
  classDef removed fill:#f8d7da,stroke:#dc3545,color:#721c24
  classDef modified fill:#fff3cd,stroke:#ffc107,color:#856404
  classDef overflow fill:#e2e3e5,stroke:#6c757d,color:#495057,stroke-dasharray: 3 3
Loading
Added
  • REQ-142

📎 Full HTML dashboard attached as workflow artifact rivet-delta-pr-383download from the workflow run.

Posted by rivet-delta workflow. The graph shows only changed artifacts; open the HTML dashboard (above) for full context.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rivet Criterion Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: f74197b Previous: 1363ca7 Ratio
store_insert/10000 17961173 ns/iter (± 1906862) 13111470 ns/iter (± 466967) 1.37
link_graph_build/10000 42837872 ns/iter (± 6090357) 26585904 ns/iter (± 2402999) 1.61
validate/10000 23087438 ns/iter (± 2794722) 13014679 ns/iter (± 1149462) 1.77
diff/10000 10978597 ns/iter (± 1130411) 7521663 ns/iter (± 119826) 1.46

This comment was automatically generated by workflow using github-action-benchmark.

@avrabe avrabe merged commit 9444245 into main Jun 2, 2026
20 of 38 checks passed
@avrabe avrabe deleted the fix/sexpr-filter-error-example branch June 2, 2026 03:51
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant