Skip to content

[Benchmark] run.command is shell-quoted - #4501

Open
coryjett wants to merge 1 commit into
Niko1221:mainfrom
coryjett:fix-bench-command-quote
Open

coryjett wants to merge 1 commit into
Niko1221:mainfrom
coryjett:fix-bench-command-quote

Conversation

@coryjett

Copy link
Copy Markdown

Problem and result

Fixes #4494. run.command in results.json was the arguments joined with spaces, so a report from
--track-notes "Strata 0.2.7 official Linux release, engine 0.1.52. Tuned: ..." reads
--track-notes Strata 0.2.7 official Linux release, ... --background headless server; ... (the run in #4468): a
reader cannot tell where an argument ends, and the line cannot be run again.

After: the arguments are quoted as a shell takes them back, shlex.join on POSIX and subprocess.list2cmdline
on Windows, before the existing redaction.

Related discussion

#4494

Approach

Two lines in strata_cli/cli.py (bench run) and an import shlex. Redaction still runs on the joined
string, so a quoted home path is replaced as before.

Validation

Passed:

  • python3.12 -m unittest tests.terminal.test_bench_standard tests.terminal.test_bench: Ran 93 tests in 65.229s, OK (1 skipped).
    Strata Control 0.1.52's bundled Python 3.12.15, Ubuntu 26.10, this branch (main 46c152a + this commit).
  • The extended CommandLineTests.test_the_options_reach_the_report (asserts --track-notes '0.2.0 release, setup choices' in run.command) against main's cli.py (production file stashed, test kept): Ran 1 test in 0.892s FAILED (failures=1)

Failed:

  • None observed.

Not run:

  • Windows (list2cmdline branch; the test expects double quotes there).

Limits

  • A command recorded by an older runner is not re-quoted by bench report.

🤖 Generated with Claude Code

The arguments were joined with spaces, so a --track-notes or --background with spaces could not be told
apart from the next option and the line could not be run again. shlex.join, list2cmdline on Windows.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Benchmark] run.command is not shell-quoted

1 participant