feat(cli): collision-proof --run_id auto for rehearsals/stage demos (#116) - #160
Merged
Conversation
Add an `auto` mode to `--run_id` so repeated rehearsals/restarts never
collide with an existing `run_<id>` directory. `auto` scans the runs root
(honoring `--runs-dir` / `SIA_RUNS_DIR`) and picks `max(n)+1`, or 1 if none.
Numeric ids keep their historical behavior, including the existing-directory
error in setup_run_directory.
- src/cli.rs: --run_id now parses as a string ('auto' or positive integer);
--help documents both forms.
- src/run.rs: new pub `resolve_run_id(arg, runs_root) -> SiaResult<i64>` plus
`next_free_run_id`; run_orchestrator resolves the runs root first, then the
run id against that same root, and prints `Run directory: <path>` before any
expensive LLM work so the presenter sees where artifacts land.
- docs/HACKATHON_DEMO.md: rehearsal + live-run commands use `--run_id auto`.
- Tests: unit tests for resolve_run_id (numeric passthrough, invalid rejection,
auto next-free incl. gaps/non-run entries, auto under a custom root) and
integration tests for numeric collision error + auto-under-custom-runs-dir.
https://claude.ai/code/session_01WX3ZN9azxr1fyWuZAaRJ7Y
…-run-id # Conflicts: # docs/HACKATHON_DEMO.md
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.
Closes #116.
Fixed-run-id demo commands aborted on a second rehearsal (
setup_run_directoryerrors ifrun_<id>exists). Adds a collision-proof mode:src/cli.rs:--run_idnow parses as a string;--helpdocumentsautoor a positive integer.src/run.rs:resolve_run_id(arg, runs_root)—autoscans the resolved runs root (honors--runs-dir/SIA_RUNS_DIR) forrun_<n>and picksmax+1(or 1); numeric ids unchanged;0/negatives/garbage rejected up front.run_orchestratorprintsRun directory: <path>as the first line, before any LLM work. No deletion/overwrite by default.autopicks next free id under a custom--runs-dir; unit tests forresolve_run_id(ignores non-run_<n>entries, gaps ok).docs/HACKATHON_DEMO.md: rehearsal/live/checklist now use--run_id auto.Verified: with
run_1+run_4present,auto→run_5. Gate green: fmt/clippy/test (default +--features llm) + parity OK.https://claude.ai/code/session_01WX3ZN9azxr1fyWuZAaRJ7Y
Generated by Claude Code