feat(grammar): a count could be asserted but never used - #328
Merged
AminChirazi merged 1 commit intoAug 1, 2026
Merged
Conversation
`the "css:.row" appears 5 times` has always worked, and it is the right step
when you know the answer. When the app decides the answer — a table built
from whatever the backend returned — there was nothing to write. The number
existed, the grammar could compare it to a literal, and no literal was
available.
`Remember how many "<target>" appear as <name>` reads it into the same
flow-scoped name a text capture uses, so everything captures already do
keeps working, including `shows ${captured.rows} + 1`. The computed
comparison's numeric normalisation is reused as it stands rather than
re-parsed, which is what lets the two compose without either knowing about
the other.
Counting rides the ordinal every adapter already implements, so it means on
each adapter what `the 2nd "Row"` means there; no adapter changed to gain
it. The number is read at execution time on record and on every replay, so
only the reference enters the trace.
Zero fails. A selector typo matches nothing and so does an empty table, and
`0` is a confident, plausible number to type into an application. The step
refuses and names the one that means zero.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
AminChirazi
force-pushed
the
relanded/1-capture-interpolation
branch
from
August 1, 2026 09:59
c30a790 to
3985e33
Compare
AminChirazi
force-pushed
the
relanded/2-count-capture
branch
from
August 1, 2026 10:00
545335d to
6b1ca15
Compare
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.
appears 5 timesworks when you know the answer; when the app decides it, there was nothing to write.A new param key on
capture, not a new action. The computed comparison's numeric normalisation is reused rather than re-parsed. No adapter changed — counting rides the ordinal each already implements.Zero fails, naming
appears 0 times: a selector typo matches nothing and so does an empty table, and0is a plausible number to type into an app.Red path:
a_count_of_zero_fails_instead_of_remembering_zero. Proved in a browser by mutating the page from 4 rows to 6 and replaying the same trace — the capture re-read 6, only the literal assertion failed.The one question: still a recording — a count is a reading, taken at execution time.
🤖 Generated with Claude Code