cmd_show printed the resolved title with its rule, then content_trim_colored
printed the "# " heading again out of the file content, so every show output
carried the title twice.
The body now skips the heading, along with the blank line the template puts
under it so nothing is left where it was. cmd_show keeps the surviving copy and
colours it green, which is where the colour guideline puts a title.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Section rules repeated the character for the byte length of the whole heading
line, so every rule ran three past its heading for the "## " prefix. The title
rule in cmd_show used byte length, which over-draws for a non-ASCII title.
Both now count characters of the text as displayed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
parse_ticket_field searched every line of the file with contains, and
set_status_field rewrote the first line starting with the Status marker
wherever it sat. Tickets in this repo quote field markers in their
descriptions, so a description list shaped like metadata was read in place
of the real value and rewritten by mv, leaving the metadata stale.
Both now scan only the lines under the Metadata heading and match on a line
prefix rather than a substring. A file with no Metadata heading has no
fields, so mv reports the missing Status field instead of editing prose.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A bare digit in a listing is easy to skip over. Levels render as a
two-segment meter that empties as the level rises: ●● 1, ●◐ 2, ●○ 3,
◐○ 4, ○○ 5, with ·· for unset and ?? for a value outside the range.
Only ●, ◐, ○ and · are used, because they are what frig draws for its
status indicators and so are known to be in the terminal font. The first
cut of this used the quadrant circles ◕ and ◔, which are in a quarter as
many fonts, so terminals substituted them from a fallback that drew them
oversized and the column came out ragged. Two cells of a three-level ramp
gives five steps of ink, 2, 1.5, 1, 0.5, 0, without leaving that safe set.
Tests pin the safe set, the equal width and the monotonic emptying.
The mark carries the level on its own, because colour cannot. Output is
colourless whenever it is piped, which is how the opencode tools and every
script read it, and NO_COLOR turns it off in a terminal too. Colour only
accentuates: brightred, red, orange, cyan, grey, skipping green because
green means title.
The number counts up while the meter empties, since 1 is the most urgent.
That is the convention, but it reads as a bug unless written down, so it
is in AGENTS.md and in the legend.
Both the ramp and the legend come from priority_mark, and `ls --help`
prints the legend, since nothing in a listing explains a mark. brightred
is indexed like grey, for the same reason: it is the spelling that
renders.
Minor bump: two new flags, a new metadata field and a changed ls row,
covering dca0b61 and this ticket.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Priority lived in tags, as p1 to p3, which ls could neither sort nor
filter on, nothing validated, and a typo like P1 passed silently. ls
sorted by title only, so a backlog of any size gave no ordering signal.
Levels are 1 to 5 with 1 most urgent, matching what the tags meant.
Omitting the flag leaves the field _Not set_, like Due and Owner: there is
no implicit middle level, because a priority nobody chose is worse than
none. clap rejects anything outside the range before a ticket is written.
Priority parses to three states rather than two. A stored value outside
the range is Invalid, kept distinct from Unset, so a typo cannot read as
"no priority": it shows as ? and sorts just ahead of the unset tail.
ls sorts on priority and falls back to the old title sort, and --priority
filters, composing with the status filter in both the grouped and the
filtered listing. TicketItem becomes a struct, since a sixth tuple field
was past reading.
Migrated the 31 tickets already carrying p1 to p3 tags: the level moves to
the field and the tag is dropped.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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>
Records the rule in the Version Bumps section: a bump carries a matching
annotated v<version> tag on the bump commit, kept local unless a push is
asked for. Tagged v0.1.1 on 8563218 retroactively, which was bumped
before the rule existed.
Docs only, so no bump and no tag for this one.
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>
Records the rule in the Git Workflow section: decide whether a change
warrants a bump, ask before making one, no bump for docs, tests or
fixups, and bump once on the final commit when work spans several.
Docs only, so no bump for this one.
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>
None of the five tools could report why a command failed. mv and comment
spawned without stderr set, and Bun defaults it to inherit, so the text
went to the plugin host and never to the model. show, ls and init used
Bun.$, whose ShellError message is only "Failed with exit code 1", and
each of them interpolated just that message. The CLI explained itself
every time and nothing carried the explanation.
Replace all four spawn and Bun.$ blocks with one run() helper that pipes
both streams and throws with stderr, and strip anyhow's "Error: " prefix
so a relayed message does not read "Error adding comment: Error: ...".
Verified against the real binary with a Bun.spawn shim over node's
child_process, since bun is not installed here: an ambiguous show, mv and
comment now each return the candidate list to the caller. The file is
twenty lines shorter than the duplication it replaces.
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>