Repository navigation
Ambiguous project basenames: list -p and project verbs refuse, --group project labels apart (T458) - #293
Merged
Conversation
…oup project labels them apart (T458) tsk list -p and tsk project archive|unarchive refused nothing for a basename two projects share: list printed nothing, archive said no project has tasks. The permissive resolver now refuses an ambiguous name with add's message; an unknown name keeps the literal fallback. --group project relabels colliding basenames by their shortest unique path suffix, reusing the --all scope label helper. Refs #249
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
…ath (T458 review) An exact stored scope matching the -p token wins before the ambiguity check, so a legacy bare 'atlas' beside '/…/atlas' stays reachable. Tests cover that, the absolute-only ambiguous message, and equivalent spellings sharing one --group project label.
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.
Summary
Two projects that share a basename (
~/sites/site-a/wordpress/wp-content,~/sites/site-b/wordpress/wp-content) were handled inconsistently.tsk add -p wp-contentrefused as ambiguous, but:tsk list -p wp-contentsilently printed nothing ([]with--json), exit 0.tsk project archive|unarchive wp-contentsaidno project named wp-content has tasks, although both projects have tasks.tsk list --all --group projectpainted both projects under onewp-contentheading, and JSONgroupwaswp-contentfor both.Changes:
resolve_permissive_project_path(src/scope.rs) now returnsResult: 2+ distinct, non-equivalent basename matches giveProjectResolveError::Ambiguous, with the sameproject <name> is ambiguous: <paths>text asadd. 0 matches keep the literal fallback (legacy relative scopes, removed directories), and path tokens stay literal.tsk list -p: newListError::UnknownProjectprintstsk list: unknown-project: <message>, exit 1, text and--jsonalike.tsk project archive|unarchive: refuses through the existingArchiveCliError::UnknownProject(codeunknown-project). Output stays message-only (tsk project: <message>, exit 1), because cli.md documentsprojectrefusals as message-only. Adding a code prefix there would change that contract.--group project: groups whose basenames collide are relabelled by their shortest unique path suffix, in text and JSONgroup. This reuses the existing--allscope-label widener (scope_labels/ScopeLabelinpresenter.rs, now exposed asdistinct_scope_labels), so there is still one disambiguation helper. Equivalent spellings of one project (/tmp/x,/private/tmp/x) collapse to one representative first, so one group keeps one label.tsk list --helpgains anunknown-projectrefusal;tsk project --helpnames the ambiguous refusal.projectrefusals, refusal-code table gains alistrow,--grouplabel note), CHANGELOG Unreleased > Fixed (two lines, credit Suggestion: Add a description field to projects, add a title field to projects #249). Thetsk-cliskill line aboutlist -pis updated; version stays 1.7.0 (already unreleased), hash pin refreshed.llms.txtdid not state the old behaviour.Board TUI and project titles are out of scope.
Seed script
Run with each binary. It uses an isolated
TSK_STATE_DIRunder/tmp/tsk-249-*and never touches~/.tsk. The.gitmarker is enough for tsk to treat each directory as a repository.Before (origin/main
fa36b9e2, release build)After (this branch, release build)
Tests
New regression tests use real temp directories. Each one fails with its fix hunk reverted by hand (verified: list -p exits 0 instead of 1; archive prints
no project named wp-content has tasks; group labels readwp-contenttwice).cli_list::list_project_refuses_a_basename_shared_by_two_projects: text and--json, case-insensitive name; a full path still lists one project; an unknown name still lists nothing.cli_list::list_group_project_labels_colliding_basenames_by_their_shortest_unique_suffix: JSONgroupand text headings.cli_archive::project_archive_refuses_a_basename_shared_by_two_projects: archive and unarchive refuse with nothing archived; a full path still archives.Green bar on the rebased head:
cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo testpassed. Sitenpm testwas not run locally; CI covers it.Live Herdr smoke was not run: this is a headless CLI change with no board, host, or pane code.
Fixes part of #249 (ambiguous basenames); titles tracked separately.