fix(testkit): make 03_update Log calls alignment-safe#7
Merged
Conversation
The second log line in `Token Count Is Stable After Whitespace Edit`
visually aligned `after:` with `before: ` by inserting two spaces
between `after:` and the embedded variable. Robot Framework treats
two-or-more spaces as an argument separator, so the extra
whitespace flipped the statement from
Log "after: ${after}[stdout]" # single message
into
Log "after:" "${after}[stdout]" # message + level
and the embedded stdout (a rich count-tokens table) was handed to
the `level` slot, which only accepts TRACE/DEBUG/INFO/... That
blew up the whole suite for any agent whose corpus is non-trivial
enough for `count-tokens` to produce a multi-line report —
effectively every production agent.
Switch both log lines to `Log Many`, which takes N positional
arguments and is immune to how the caller lines them up. Verified
locally against ecg-expert (797k-token corpus): suite 03_update
now reports 2/2 passed.
No other test in the packaged kit has this alignment pattern.
Made-with: Cursor
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.
Summary
The second log line in `Token Count Is Stable After Whitespace Edit`
visually aligned `after:` with `before: ` by inserting two spaces
between `after:` and the embedded variable. Robot Framework treats
two-or-more spaces as an argument separator, so the extra whitespace
flipped the statement from a single-message `Log` into a two-argument
call, handing the `count-tokens` stdout to the `level` slot (which
only accepts `TRACE/DEBUG/INFO/...`). That blew up the whole suite
for any agent whose corpus is large enough to produce a multi-line
report from `count-tokens` — i.e. every non-toy production agent.
Fix
Switch both log lines to `Log Many`, which takes N positional
arguments and is immune to alignment.
Test plan
a real 797k-token corpus (ecg-expert): 1 test failing with
`ValueError: Argument 'level' got value '…' that cannot be
converted to 'TRACE', 'DEBUG', 'INFO', 'CONSOLE', 'HTML',
'WARN' or 'ERROR'`.
(grep `^\s*Log\s+.+\s{2,}\${` across `cli/expert/testkit/suites/`
returned zero hits after the change).
Made with Cursor