(f39b651) Add chown for the ticket owner, and bump to 0.10.0

The Owner field had no writer after `add`. It was folded into `set` in da03690
and comes out here as its own command, so no field is writable from two places,
the same reasoning that keeps status in `mv` alone.

`worklane chown alice 641e3d5`, user first, after Unix `chown`. That reverses
the ticket-first order `mv`, `comment` and `show` use, deliberately: the name
borrows the Unix association, so the argument order borrows it too.

The swap is left to resolution rather than checked for. Given `chown 641e3d5
alice` the second argument has to resolve as a ticket, and a bare username does
not, so the call fails on its own; a check on the first argument would only fire
where resolution already refuses and would stay silent on the one case it cannot
catch, a ticket whose title is the username. `cmd_chown` is therefore
`set_metadata_field` plus `save_ticket`, with the whole-file no-op comparison
`set` uses and the same `report()` line, so an owner set to the value it already
holds is reported unchanged and nothing is written.

Nothing new writes a file: the update goes through `write_then_replace`, scoped
to the lines under `## Metadata`, so a description quoting `**Owner**:` is left
as prose and a failure leaves the ticket whole. Tested for the change, the
no-op, all three resolution tiers, a swapped call, an empty user, a ticket with
no Owner field, and that the tick, the handwritten section and the filename all
survive.

The skill and the opencode tool carry it too, the tool with the argument order
in its description, since that is the one place a model can get it wrong
without failing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ansho Rei
2026-08-21 18:35:26 +02:00
co-authored by Claude Opus 5
parent e6fe51e31e
commit b56b31d2d9
11 changed files with 394 additions and 8 deletions
+20
View File
@@ -109,6 +109,26 @@ pub enum Command {
/// Add to a section of an existing ticket
Append(AppendArgs),
/// Change the owner of a ticket
///
/// User first, ticket second, after Unix `chown`. That reverses the ticket-first
/// order `mv`, `comment` and `show` use, deliberately: the name borrows the Unix
/// association, so the argument order borrows it too.
///
/// A swap is caught by resolution rather than by a check of its own. Given
/// `chown 641e3d5 alice` the second argument has to resolve as a ticket, and a bare
/// username usually will not, so the call fails on its own. It is silently wrong
/// only when both arguments resolve, which needs a ticket whose title matches the
/// username.
Chown {
/// New owner. Free text, like `add --owner`, checked against nothing
#[arg(value_parser = non_empty)]
user: String,
/// Ticket UUID or title
ticket: String,
},
/// Open the board view
Tui {
/// Projects to monitor, each resolved to the first `.worklane` at or above it.