cd7c99fe3928ae5f41248ad86425fc31fc254f5e
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b63b60eefc |
(4dea61c) Load the completion script into fish and ask it what it offers, and bump to 0.32.19
Every check over the completions read the script as text. A `contains` cannot tell a rule that fires from one whose condition stopped matching, and that is how a completion actually breaks: the clap definition moves, a list or a `__worklane_command_is` scope stops naming anything, and the rule sits in the file offering nothing while every assertion passes. So the generated script is sourced into a throwaway fish standing in a real board, with this build's directory on the front of PATH, and `complete -C` is compared against the ticket and the tag that board was given. Four deliberate breakages were used to size it: renaming the `ls` status scope, dropping `append` from `TAG_FLAGS`, renaming a flag in `TICKET_FLAGS` and dropping `show` from `TICKET_COMMANDS`. All four now fail, each naming the list at fault. **Assert the values, not the flag names.** clap emits every option's name on its own, so `--tags` and `--blocked-by` are offered with the whole dynamic half deleted; the first draft asserted those names and caught only one of the four. What the hand-written rules add is the candidates after the flag, and that is what a board under the shell makes checkable. Two traps, both paid for once. `complete -C` autoloads `~/.config/fish/completions/worklane.fish`, so the first draft passed against a deliberately broken scope because the copy installed in August still had the working rule: `set fish_complete_path` with no value is what makes the sourced script the only source, and without that line the test cannot fail. And the script is written beside the board rather than in it, since a rule that fires nothing falls back to listing the directory and the script would read as an answer. `fish --no-execute` comes with it as the floor: it catches a script that does not parse. Narrower than it sounds, and measured rather than assumed, so the limit is written on the test. An apostrophe in a `-d` description partway down re-balances against the next quote and parses, corrupting every rule in between; the same apostrophe in the last rule reaches the end unbalanced and is caught. `every_listed_command_is_a_real_subcommand` widens to every list that names a command, `CAMPAIGN_COMMANDS`, `TAG_FLAGS` and the two nested lists, so a stale entry fails by name instead of through a rule count. The counts themselves stay hardcoded and now say why: the walkers go clap → list and never see an extra entry, so the count is what catches one, and deriving it from the lists it checks would grow with the bogus entry and pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
5bf0fd1bfe |
(451fb83) Add a discarded status for work that will not be done, and bump to 0.31.0
The flow ended at done, so a ticket that turned out to be a duplicate or obsolete had nowhere to go: it sat in the backlog or was deleted by hand, which destroyed the record and left every relation to it dangling. Discarded is a fifth status with its own directory, keeping the invariant that the filename, the Status field and the directory agree, and keeping done meaning the work landed. Entering it is allowed from any status without -f, because discarding is not a stage of work. Discarded sits last in Status::ALL, which is what makes the rest fall out rather than needing cases: nothing follows it, so a discard clears no stamp and a ticket abandoned from reviewing keeps the journey it made, and every move out is a backward move, so un-discarding needs -f. The two dependency guards now look opposite ways. check_blockers asks what a ticket waits on and gates work moves; check_dependents asks who waits on it and gates the discard, because those plans depended on work about to be declared never-happening. Both skip targets that are themselves terminal. Status::FLOW is the four stages the board draws, so a discarded column on screen stays a136d13's ticket and done stays the last drawn column. Every tree walker keeps using Status::ALL, or a discarded ticket would be unaddressable. util::is_open replaces three spellings of "not done and not discarded", across mv, ls and the campaign standing. The board's blocked mark goes through it as well: that path was only accidentally correct, since a discarded blocker is absent from the FLOW columns, and drawing the column later would have diverged it from what mv allows. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
73ffcad733 |
Reformat with cargo fmt, and nothing else
Layout only, no behaviour and no wording. 161 hunks across 22 files, 98 of them rustfmt joining a call or a message onto the one line it fits on. The config it formats to, and how its four numbers were arrived at, is the commit before this one. Separate so that it is reviewable by not being read: nothing here is a decision, and every decision is next door. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
373ba519b3 |
Add a worklane completions command, and bump to 0.17.0
Every argument worklane takes names a ticket, a status, a shell or a skill, and the shell offered a directory listing for all of them. `completions <shell>` prints a script for fish, bash, zsh, elvish and powershell, following what frig does, which is where the shape of this comes from. Two halves, because neither alone is enough. `clap_complete` generates the structure from the clap definition, so a flag added to `command.rs` is completed without anyone touching `completions.rs`, and fish gets a hand-written block appended for what only the board knows. That block runs `worklane ls --ids` in a command substitution, one run per keypress, 2.5ms in release on a board of seventy-five tickets. A status is a `util::Status` value enum now rather than a string, which was the plan's third step and pays for itself three ways. clap refuses an unknown one at parse time naming the four, so `cmd_mv`'s `valid_statuses` and the status half of `cmd_ls`'s error are gone and exit 2 is what an unreal status gets, the bargain `--due` and `--priority` already take. `status_dirs()` and `DONE` are derived from `Status::ALL`, so the flow is written once. And clap emits the four for `mv --status` itself. Only half free: the fish generator emits nothing for the possible values of a *positional*, so `ls <status>` and `completions <shell>` are listed in the appended half after all, read off the enums with `possible_values` rather than by hand. `ls --ids` is the machine-readable listing, and prints the short id, a tab and the title rather than the id alone. Both readers want both fields: fish takes what follows a tab as the description, which is what makes `worklane show <TAB>` a list of titles instead of hex, and a script takes the id back with `cut -f1`. It includes done, where the decorated listing leaves done out, because a completion has to be able to name a finished ticket and `show` is most often pointed at one. It skips a missing status directory rather than refusing, since an error printed over a shell prompt is worse than no candidates, and the listing still refuses one so a person can act on it. The filters all still apply, and an unknown `--campaign` is still refused ahead of everything. Adding the mode tipped `cmd_ls` over the boundary AGENTS.md names, so it takes an `LsArgs`, the way `add` took `AddArgs`. More than the criteria asked, since the cost of each was a name in a list: tickets are completed for `set`, `append`, `relate`, `check`, `uncheck`, the second argument of `chown` and `assign`, and `relate`'s three target flags, plus the skill names read off `install::SKILLS`. The three lists are kept honest by tests that walk the clap definition and fail on a ticket-taking subcommand missing from them, or listed at the wrong position. Nested subcommands are not walked: `campaign` is the only one, none of its three takes a ticket, and the token counting could not tell them apart if one did. Position is counted rather than inferred. `__worklane_first_arg_of` reads `$tokens[2]` and the token count instead of `__fish_seen_subcommand_from`, because `campaign ls` and `campaign show` are also an `ls` and a `show` that fish has seen, and matching against the ticket list to find the position would run worklane again inside the condition. Files are turned off for the command and back on for `tui`, which is the one argument that really is a path. The ticket said worklane takes no file arguments; it takes those. Campaigns and tags are completed nowhere, which needs a listing they do not have: 55ee6e3. And since fish runs whatever is on PATH, the completions are only as current as the installed binary, an older one without `--ids` completing nothing. That is in the README beside the install line. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |