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

Open
opened 2026-11-07 16:32:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4501
Author: @coryjett
Created: 10/28/2026
Status: 🔄 Open

Base: main ← Head: fix-bench-command-quote


📝 Commits (1)

📊 Changes

2 files changed (+7 additions, -1 deletions)

View changed files

📝 strata_cli/cli.py (+4 -1)
📝 tests/terminal/test_bench_standard.py (+3 -0)

📄 Description

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.

#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 46c152a1 + 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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4501 **Author:** [@coryjett](https://github.com/coryjett) **Created:** 10/28/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-bench-command-quote` --- ### 📝 Commits (1) - [`114cff9`](https://github.com/Niko1221/Strata/commit/114cff98eef9e1bf2849357f87fe5b9fa94919ff) bench: run.command is shell-quoted (#4494) ### 📊 Changes **2 files changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `strata_cli/cli.py` (+4 -1) 📝 `tests/terminal/test_bench_standard.py` (+3 -0) </details> ### 📄 Description ## 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 46c152a1 + 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](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5071
No description provided.