feat: add exact line shell expectations - #43
Open
759132989-crypto wants to merge 4 commits into
Open
Conversation
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.
What does this PR do?
Adds
expect_exact_linestokind: shellchecks. It compares ordered stdout lines while ignoring trailing whitespace on each line and blank trailing lines. README and CHANGELOG are updated.Why?
Existing shell expectations could match a flat exact string, regex, or minimum number, but could not express a readable ordered list of exact output lines.
How is it tested?
Added
scripts/eval/tests/shell_exact_lines.shwith positive, reordered-line negative, and empty-output cases.Targeted validation on macOS:
bash scripts/eval/tests/shell_exact_lines.sh— PASSbash scripts/eval/tests/shell_no_expectation.sh— PASSbash scripts/eval/tests/shell_safety.sh— PASSbash -n scripts/eval/lib/score.sh scripts/eval/tests/shell_exact_lines.sh— PASSgit diff --check— PASSBefore / after evidence
Before: a YAML list under
expect_exact_lineswas not recognized as an expectation.After: the new regression suite prints:
PASS: shell expect_exact_lines compares ordered lines and ignores trailing whitespace/blank linesChecklist
for t in scripts/eval/tests/*.sh; do bash "$t"; doneand all suites passedCHANGELOG.mdunder## Unreleasedscore.shorattribute.sh) I checked the change works under BSD grep on macOSThe full suite was attempted under Bash 5.2 on macOS. Unrelated environment-dependent suites failed because their
opencodestub/path resolution returned exit 127, and one LangGraph test used GNU-onlysedsyntax. I am not claiming a fully green suite.Prepared with AI assistance in a human-supervised workspace; the human account owner remains accountable for this submission and review responses.
Closes #31.