feat: improve bash compatibility for LLM-generated scripts#164
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
The sales.csv test data computes to 10*5 + 25*3 + 7*12 + 15*8 = 329, not 289. All 3 eval models (Haiku, Opus, GPT-5.2) computed correctly but failed the check due to wrong expected value. https://claude.ai/code/session_016qdr23RD5qxcazYc8f4PX9
Major AWK compatibility improvement for LLM-generated scripts. Parser additions: - C-style for loops: for(i=1;i<=n;i++) - for-in loops: for(key in arr) - while and do-while loops - break and continue statements - delete statement for arrays - Ternary operator: cond ? a : b - Pre/post increment/decrement: i++, ++i, i--, --i - Array assignment: arr[key] = value, arr[key] += value - Field assignment: $2 = "new" - -v flag for variable pre-assignment - in operator: key in arr Interpreter additions: - AwkFlow enum replacing bool return for proper break/continue/next/exit - Loop iteration limit (100K) preventing infinite loops - Array operations via variable naming convention arr[key] - Field assignment with $0 rebuild Un-skipped 19 spec tests that now pass. https://claude.ai/code/session_016qdr23RD5qxcazYc8f4PX9
Supports GNU date -d compatible expressions: - Relative: "30 days ago", "+2 weeks", "-1 month" - Keywords: "now", "yesterday", "tomorrow", "next week", "last month" - Epoch: "@1234567890" - ISO: "2024-01-15", "2024-01-15 14:30:00" - Long form: --date=yesterday, --date="30 days ago" This directly addresses the sysinfo_date_calc eval task where Opus exhausted command limits trying workarounds for missing -d. https://claude.ai/code/session_016qdr23RD5qxcazYc8f4PX9
- Add hold space commands: h (copy), H (append), g (get), G (get-append), x (exchange) - Add change command (c\text) for line replacement - Add regex range addressing (/start/,/end/) with stateful tracking - Add numeric-regex range addressing (N,/pattern/) - Un-skip sed_exchange_x and sed_change spec tests - 6 new unit tests, all 52 non-skipped spec tests pass https://claude.ai/code/session_016qdr23RD5qxcazYc8f4PX9
- Update AWK: 74/89 tests pass (was 55), document new features - Update SED: 52/65 tests pass (was 50), document new features - Update date: add -d/--date flag to compatibility table - Add LLM Compatibility Gaps TODO section with prioritized items - Update total: 731/847 passing (was 710) https://claude.ai/code/session_016qdr23RD5qxcazYc8f4PX9
10317fb to
465bc82
Compare
Upstream pydantic/monty bumped to 0.0.4, breaking --all-features builds. https://claude.ai/code/session_016qdr23RD5qxcazYc8f4PX9
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
text_awk_reportexpected value (289 → 329, math error)in,for-in,delete),-vflag, ternary operator, field assignment,nextstatement. AWK tests: 55 → 74 passing (19 un-skipped)h/H/g/G/xcommands,c\textchange command, regex range addressing (/start/,/end/). SED tests: 50 → 52 passing (2 un-skipped)Total spec tests passing: 710 → 731 (+21)
Test plan
cargo test -p bashkit --lib --tests— 71 unit tests passcargo test -p bashkit --test spec_tests— all spec test suites pass (bash, awk, sed, grep, jq, comparison)cargo fmt --check— cleancargo clippy -- -D warnings— cleanhttps://claude.ai/code/session_016qdr23RD5qxcazYc8f4PX9