Name planning sessions by project name instead of id - #118
Merged
Conversation
A planning session launched as `voro-plan-<project-id>`, so the bare number sat exactly where a dispatch (`voro-<task-id>`) puts a task id and misread as one. `Launch::Plan` now carries the project's name rather than its id, and composes `voro-plan-mote` with the file stem `plan-mote`. The composed name is substituted into a shell command line and its slug becomes a filename, so `session_name`/`slug` reduce the project name first: every character outside `[A-Za-z0-9._-]` becomes `-`, case preserved. The sanitizer sits beside `Launch` in voro-core so the invariant travels with the type rather than with each construction site. Carrying a `String` drops `Copy` from `Launch` and `LaunchSpec`; the one call site that partially moved out of its `Expansion` clones instead. Project names are `UNIQUE NOT NULL`, so name-keyed sessions cannot collide. Session names already recorded on past launches stay as recorded.
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.
Planning sessions are now named for their project rather than its id:
voro-plan-motewith prompt/log stemplan-mote, instead ofvoro-plan-2/plan-2. The bare number in a Voro-composed session name is now always a task id.What changed
Launch::Plan(crates/voro-core/src/agent.rs) carriesproject: Stringinstead ofproject_id: i64;session_name()andslug()render the name. Its construction site,plan_session'sPlanTarget::Createarm in crates/voro/src/dispatch.rs, already loads the project row, so it just passesproject.name.sanitize_for_namein voro-core, next toLaunch, replacing every character outside[A-Za-z0-9._-]with-and preserving case (voro-plan-ODM). The name is substituted into a shell command line and the slug becomes a filename, so it lives with the type rather than at each construction site. Project names areUNIQUE NOT NULL, so name-keyed sessions cannot collide; two names that reduce to the same string is a deliberate non-case.StringdropsCopyfromLaunchandLaunchSpec; the one site that partially moved out of itsExpansion(spawn_expansion) clones instead. Dispatch and refine naming (voro-<id>,voro-<id>-refine) is untouched. No migration: session names already recorded stay as recorded.voro-plan-<project>with the sanitizing rule; the naming-invariant paragraph in docs/DESIGN.md §8, which already saidvoro-plan-<project>, is now literally true and says why the id was wrong there.Verification
a_planning_session_sanitizes_its_project_nameunit test covers spaces, quotes, shell metacharacters, a slash, capitals, and the characters that pass through untouched.Launchtests in agent.rs and the plan-session tests in dispatch.rs updated;plan_session_assembles_the_launch_and_writes_the_promptnow asserts the prompt file is stemmedplan-proj-, so the project's name reaching the launch is checked end to end.cargo test --workspace(614 tests) andcargo clippy --workspace --all-targets -- -D warningsboth pass;cargo fmt --allclean.