fix(sexpr): show field-equality example in filter parse error (REQ-142, #381)#383
Merged
Conversation
#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>
📐 Rivet artifact delta
Graphgraph 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
Added
Posted by |
There was a problem hiding this comment.
⚠️ 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.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
After:
The note is generated once in
sexpr_eval, so the improvement reaches every command that parses a filter — verified on bothmodify --whereandlist --filter. Also added an example to theexport --filterhelp (it had none, unlikelist/query).Verification
(status "draft")) and confirmed the note now shows(= status "draft").sexpr_eval::tests::parse_error_unknown_head_surfaces_noteextended to assert the example is present; passes. clippy--all-targets+ fmt clean;rivet validatePASS.Implements: REQ-142
🤖 Generated with Claude Code