feat: add output dir short alias#132
Conversation
alphacrack
left a comment
There was a problem hiding this comment.
Thanks — the -o alias itself is exactly what #13 asked for, the change is conflict-free against main, and the full suite passes locally at your head merged with main. But CI is legitimately red on all four Python jobs, and it's the new test, not the feature.
test_run_help_includes_output_dir_short_alias asserts that one raw help line contains the contiguous substring --output-dir. On GitHub Actions, Rich detects GITHUB_ACTIONS=true and force-enables ANSI, so the option renders as \x1b[1;36m-\x1b[0m\x1b[1;36m-output\x1b[0m\x1b[1;36m-dir\x1b[0m — the substring never appears contiguously and the assert fails in CI while passing on any local terminal. Reproducible locally with env -u TERM GITHUB_ACTIONS=true CI=true python -m pytest tests/test_cli.py::test_run_help_includes_output_dir_short_alias. A rebase won't help; it fails the same way merged with current main.
Two robust replacements (either is fine):
- Introspect the click params instead of rendered text:
import typer.main
def test_run_output_dir_has_short_alias():
cmd = typer.main.get_command(app)
opts = {o for p in cmd.commands["run"].params for o in p.opts + p.secondary_opts}
assert "-o" in opts and "--output-dir" in opts- Or strip ANSI before asserting:
plain = re.sub(r"\x1b\[[0-9;]*m", "", result.output).
Side note: as written the "-o" in line conjunct is vacuous — --output-dir already contains -o as a substring — so option 1 also makes the test actually check the alias. Once CI is green this is good to merge.
test_run_help_includes_output_dir_short_alias asserted on rendered --help output, but Rich force-enables ANSI in CI (GITHUB_ACTIONS=true), breaking the contiguous --output-dir string match. Replace with typer.main.get_command to introspect click params directly: no rendering dependency, and the alias assertion is no longer vacuous.
|
@alphacrack Fixed the ANSI rendering issue from the review. Replaced the help-text parse with |
What this changes
Adds
-oas a short alias forreadme2demo run --output-dirand covers it in the run command help output. Closes #13.The grounding invariant
tutorial.md,step_by_step.md,commands.sh, or the demo tape — or it adds acode-level check (not just a prompt rule) that keeps that true.
sandbox.pyare unchanged (or the change isexplicitly discussed in the PR body).
Tests
python -m pytest tests/ -qpasses locally.N/A — CLI enhancement.
parse_transcript/normalize.pychanges stayed pure anddeterministic (no LLM calls; testable against fixtures). N/A — untouched.
Prompt changes (if any)
prompts/*.md.Housekeeping
architecture/README.mdandCLAUDE.mdare updated to match. N/A — no stage or boundary changes.
Validation
PYENV_VERSION=3.13.11 python -m ruff check src/ tests//home/ulisesjcf/.pyenv/versions/3.13.11/bin/python -m pytest tests/ -q— 282 passed