(9688d34) Add tags set, and bump to 0.26.0

A tag declared with the wrong annotation was stuck with it, which is 32e98ab's
hole arriving before the writer rather than after. The campaigns entry on this
board was already in that state: it reserved the singular for the campaign
command, and stopped being true the moment that tag was rolled in.

`worklane tags set <tag> --annotation` replaces the whole annotation.
`--annotation` is required, so a bare call is a usage error rather than a
silent no-op, and an empty one writes the placeholder, which is why there is
no `--clear`. `add` and `set` refuse what the other is for, each naming the
other, so which one wrote a line is never a question of which was typed.

No `--force`: a codename is guarded because a campaign is addressed by it,
where an annotation is prose written to be revised. No rename: the tag is the
key, so changing it means rewriting the Tags field of every ticket carrying
it.

`report` grew `report_in`, which takes the colour. `report` paints its subject
green and green means title, so a tag could not reuse it: a tag is drawn in a
`TAG_COLORS` slot or it is drawn wrong. Same wording, decision passed in,
which is the trade `paint` makes with `color_text`.

The no-op compares the rendered file rather than the annotation, the way
`apply` compares content for a ticket field.

`tags set` takes a tag the board already has, so it joins the new
`TAG_NESTED_COMMANDS` and gets a fish rule offering `worklane tags`; `tags
add` stays ruleless in `TAG_NEW_COMMANDS`. The guard now names both lists, so
the next tag positional has to pick one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ansho Rei
2026-08-23 16:09:03 +02:00
co-authored by Claude Opus 5
parent f515d69930
commit 239d951b8c
7 changed files with 252 additions and 13 deletions
+38 -2
View File
@@ -490,13 +490,14 @@ pub struct CampaignAddArgs {
/// break a script for the sake of symmetry. So the bare form stays the listing, and `tags
/// ls` is the same thing spelled the way `campaign ls` is.
///
/// No `set`: changing an annotation is 9688d34, and a half of `add`/`set` that only ever
/// declares is the honest half to ship first.
#[derive(clap::Subcommand)]
pub enum TagCommand {
/// Declare a tag, and what it means
Add(TagAddArgs),
/// Replace what a declared tag means
Set(TagSetArgs),
/// List the tags the board carries, and how many tickets carry each
Ls,
}
@@ -518,6 +519,41 @@ pub struct TagAddArgs {
pub annotation: Vec<String>,
}
/// What can be replaced on a tag that is already declared: what it means, and nothing else.
///
/// No `--force`, unlike [`CampaignSetArgs`]. A codename is guarded because once a campaign
/// has one it is how the campaign is addressed, on every card and at every command line, so
/// replacing it silently breaks the way it is referred to. An annotation is prose written to
/// be revised and nothing addresses anything by it, so a guard would stand in front of the
/// command's whole purpose.
///
/// No rename. The tag *is* the key, so changing it means rewriting the Tags field of every
/// ticket carrying it. That is a migration, not a flag on `set`.
///
/// No `--clear`. An annotation is emptied with `--annotation ""`, which writes the same
/// placeholder a tag declared without one gets, so a second spelling would add nothing.
/// [`Clearable`] is a ticket's fields anyway, per [`SetArgs`].
///
/// `--annotation` is required, so a bare `worklane tags set <tag>` is a usage error rather
/// than a silent no-op, exactly as the group on [`CampaignSetArgs`] makes it for a campaign.
#[derive(clap::Args)]
pub struct TagSetArgs {
/// The tag to change, spelled the way it is declared
#[arg(value_parser = tag_value)]
pub tag: String,
/// What the tag means and when it is appropriate, replacing whatever it said before. Use
/// multiple flags for multiline annotations
#[arg(
short,
long,
required = true,
allow_hyphen_values = PROSE,
value_parser = annotation_line
)]
pub annotation: Vec<String>,
}
/// `ls` holds four filters, an output mode and nothing else, which is the boundary the
/// Rust Style rule in AGENTS.md names: two of the filters are adjacent `Option<String>`
/// values that a caller can swap silently, so the mode that joined them came as a