display_ticket_items printed both fields raw, so a ticket with no due date
showed _Not set_ in the default foreground. show already honoured the
guideline through colorize_metadata, leaving the listing as the one place
that ignored it. Reuses is_unknown_value rather than matching the markers
a second time.
Grey is indexed colour 8 in the 256-colour form. Two SGR spellings were
tried against a real terminal and both read as white: 90 leans on the
palette's bright-black slot, and 37 can sit right on top of the default
foreground. \x1b[38;5;8m is byte for byte what crossterm emits for
ratatui's Color::DarkGray, which is the grey frig and pantop already use
for dimmed rows, so this is the spelling known to render here. Pinned by a
test and written down in AGENTS.md, since only an eye in a real terminal
would catch it drifting back.
Patch bump covering the three colour tickets, 9991698, 934bf1a and this
one, as one body of work: nothing new, three places where output did not
do what the guideline said.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
colorize_line asked color_text for magenta, which get_color never
defined, so it returned an empty prefix: in a terminal the bold text got
a reset with no colour, and piped it lost the ** markers with nothing put
in their place. Every piped show and everything the opencode tools read
saw plain text where the ticket had emphasis.
Define magenta as the bold escape the guideline names, and leave the line
untouched when colour is off, because there the markers are the emphasis.
The scan is rewritten to hand back an unterminated run verbatim rather
than walking off the end, which used to drop the final character.
The scan now takes the enabled flag instead of asking for it, so both
paths are tested rather than only the one a test process happens to get.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
should_use_colors only asked whether stdout was a terminal, so there was
no way to turn colour off in one, and it was re-evaluated on every
color_text call.
Honour NO_COLOR by the no-color.org rule, set and non-empty disables
whatever the value, with an empty value treated as unset so an inherited
one can be cleared. Treat TERM=dumb and an empty TERM as no colour.
Decide once in a OnceLock, since none of the three inputs change mid-run.
The decision itself is a pure function of its three inputs, so it is
tested without a pty. Verified under a real one as well: colour on by
default, absent with NO_COLOR=1, absent with TERM=dumb, present again
with NO_COLOR set to empty.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment filenames were stamped to the second, so two comments added in
the same second produced the same name and fs::write truncated the first.
Agents post in bursts, so this was routine data loss: five comments added
back to back left one file.
Stamp microseconds instead, and create the file with create_new rather
than fs::write, so a name that already exists is taken as a collision and
the next zero-padded suffix is used instead of overwriting. The suffix
sorts after the bare stem, so read_comments still orders comments the way
they were written.
The collision branch cannot be reached from the CLI, since two processes
will not share a microsecond, so it has a unit test of its own.
Patch bump: existing second-resolution comment files still read and still
sort ahead of new ones written in the same second, so no migration.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
worklane --version exited 2: the Cli derive set name and about but never
version, so clap generated no flag. Nothing could say what a given binary
was, which matters here because the opencode tools shell out to whatever
worklane is on PATH, so an agent can be driving a stale build with no way
to notice.
The crate version alone would not have answered it. Cargo.toml is pinned
at 0.1.0 and nobody bumps it per install, so a stale install and a fresh
build both claim the same thing. A build script stamps the short sha
alongside it, giving "worklane 0.1.0 (df97b06)", and falls back to
"unknown" where there is no git directory, as when installing from a
published crate.
propagate_version lets subcommands answer too. This overrides the ticket's
own plan step, which said to skip the sha if it needed a build script.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
resolve_ticket printed the candidate list to stdout and called
process::exit(1) from inside a helper. That combination is the one thing
the opencode wrapper cannot relay: it throws on the non-zero exit and
keeps stderr, so the list was thrown away and the agent saw a bare exit
code with nothing to choose from.
Return an error carrying the rendered list instead. It reaches stderr the
way every other error does, the exit code stays non-zero so `show x && ...`
still fails, and no process::exit remains in util.rs.
The wrapper half, which was dropping stderr on the floor regardless,
follows in 3e8b6fa.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Three places sliced strings by byte offset on values that come from a
filename or a file field, neither of which is validated.
The disambiguation list took &short_id[..7], so two tickets whose names
were shorter than that aborted the process while printing the options.
collect_ticket_items guarded on length but still cut at byte 7, so a
multibyte character straddling the cut panicked. format_created_at read
four fixed offsets after a length check that a multibyte value passes.
Add short_id, which counts characters, and use it in both display paths.
Parse the timestamp with chrono instead of slicing, dropping the column
when the value will not parse. The format string it writes and the one it
reads are now the same constant, so they cannot drift.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
cmd_mv spliced the metadata line by byte offset and wrote the field name
as **-Status**, because the format string re-added the "- " prefix that
the preceding slice already carried. parse_ticket_field could never read
Status back, and the next move failed to find "- **Status**" so it
silently skipped the rewrite, leaving the ticket in one status directory
while its metadata claimed another.
Replace the splicing with set_status_field, a line based rewrite that
keeps every other line verbatim, inserts no stray newline, and errors
when the Metadata section has no Status field. It also accepts the
**-Status** spelling so tickets damaged by the old code are repaired as
they move.
The content is now computed before the rename, so a ticket without a
Status field is never half-moved.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>