Commit Graph
25 Commits
Author SHA1 Message Date
Ansho ReiandClaude Opus 5 39ee86e308 (4c516e6) Preserve paragraph breaks in ticket descriptions, and bump to 0.4.1
The opencode add tool split the description on newlines and then dropped the
empty ones with filter(Boolean), so every multi paragraph description arrived as
a single paragraph, against the tool's own instruction to separate paragraphs
with newlines.

cmd_add needed no change for this. Joining the values with a single newline is
what makes an empty value a paragraph break, so the capability was already
there and only the wrapper was throwing it away. Verified by hand before
touching anything.

The wrapper now keeps interior blanks and trims only the ends, and only trims
trailing whitespace within a line, since leading whitespace is what makes a
nested list or an indented block survive. --acceptance and --plan keep dropping
blanks: each value there is one criterium or step, so an empty line is spacing.

trim_blank_ends in cmd_add makes the second criterion hold whoever calls it, not
just the wrapper: blank values at either end are dropped so a break never lands
against a section heading, and an all-blank description reads as none. Interior
runs are kept verbatim rather than collapsed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 00:29:22 +02:00
Ansho ReiandClaude Opus 5 5a7cfeb849 (b8aa66b) Evaluate ticket resolution in tiers, from four characters up, and bump to 0.4.0
resolve_ticket ORed the uuid prefix, title and filename predicates into one flat
list, so an exact prefix match was reported as ambiguous against any title that
merely mentioned that id. Reproduced: `show 641e3d5` on a board where another
ticket's title quoted it failed with "Multiple tickets found", and told the user
to use the displayed id, which was the id they had just used.

The three tiers are now evaluated in order and the first non-empty one wins
outright, which is what AGENTS.md always claimed.

The ticket also asked for prefix matching to require eight characters, and that
is not implemented. The guard it replaced read short_id.len() >= 8 where
short_id was always the full uuid, so it was always true and any length already
worked. Eight would have regressed that: ls prints seven characters, so the id
the tool displays would drop out of the uuid tier and lose to any title quoting
it, which is the very bug above. MIN_ID_SEARCH is four, so a short search is
still text and `show 641` remains a title search.

Docs corrected in four places that all stated the eight character rule: README,
AGENTS.md, the opencode tool descriptions and the kanban skill.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 23:38:29 +02:00
Ansho ReiandClaude Opus 5 e20396ce6b (322150c) Make mv crash-safe by writing before renaming, and bump to 0.3.3
cmd_mv renamed the ticket into its new directory and only then wrote the updated
content, so a write that failed left the ticket in the target directory still
claiming the old status. Reproduced with a read-only ticket file: the move
reported a bare "Permission denied" and left the file in committed/ carrying
"Status: backlog".

move_ticket_file now stages the content in a temp file, renames it over the
source, and only then renames the file into the target directory. Two atomic
steps, so a partial write is discarded and the original is untouched. The other
obvious order, writing to the target and deleting the source afterwards, was
rejected because it has the ticket in two directories at once.

The worst case left is a ticket still in its old directory with a Status one
move ahead, which the next mv corrects since the directory is what decides the
current status. Tested, including the retry.

The temp file is staged under .worklane/ rather than beside the ticket, so a
leftover from a hard kill is invisible to ticket lookup and to the listing
instead of appearing as a stray untitled ticket. IO errors now name the ticket
and the path rather than propagating bare.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 23:12:17 +02:00
Ansho ReiandClaude Opus 5 f5204f6d8b (866a4eb) Accept prose values that begin with a hyphen, and bump to 0.3.2
clap read any value starting with a hyphen as a flag, so a criterion quoting
--print was refused with "unexpected argument found" and no ticket was written
at all. Ticket text quotes flag names constantly, and the space form is what
both a person and the opencode wrapper produce, so the failure was routine.

allow_hyphen_values on the five arguments that carry prose: add --title,
--description, --acceptance, --plan, and the comment body. The trade is that a
genuinely mistyped flag there now lands as content instead of raising a usage
error, which is the right way round for prose and the wrong way round for
anything else, so due, priority, tags, owner and status are left alone and still
fail with exit 2. Written down in AGENTS.md.

The bare double hyphen is the one shape this does not reach: as an option value
it is stored as text, but in a positional it is clap's end-of-options marker and
is consumed before assignment. A comment body of exactly -- therefore needs its
own separator. Without it the body is reported missing and nothing is written,
so it is a clear failure rather than a silent drop. Tested, along with the
ordering that lets mv reach a hyphen-leading title.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 18:00:52 +02:00
Ansho ReiandClaude Opus 5 b28ddb9210 (eed7309) Die quietly on a truncated pipe, and bump to 0.3.1
Rust sets SIGPIPE to SIG_IGN at startup, so a write to a closed pipe returned
EPIPE and println panicked on it. `worklane ls | head -3` printed a panic and a
backtrace on stderr instead of three lines, which reads as a real fault and is
not what any other tool in a pipeline does.

main now restores the default disposition before any output, the same six lines
frig carries for the same reason. The cost is that a truncated pipe kills the
process with signal 13, so a shell reports 141 rather than 101. That is what
head and sort do, and it is now in the README next to the other exit codes.

The tests drop the read end rather than racing head for it, over a listing large
enough to exceed the 64 KiB a pipe holds, since a smaller one lands entirely in
the buffer and proves nothing. A shell pipeline into head is covered too, and
the exit codes for a real error and a usage mistake are pinned so the reset
cannot quietly change them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 17:34:45 +02:00
Ansho ReiandClaude Opus 5 f557437f62 (277a527) Render the metadata section as an aligned table, and bump to 0.3.0
show printed the Metadata block as the markdown list the file stores, so with
seven fields the values did not line up and the block read as file contents
rather than as a summary. It now renders as two aligned columns: field names
left, values right. The file is untouched, this is display only.

content_trim_colored streamed one line at a time, so nothing ever saw the whole
section. The Metadata lines are now taken as a block, since the field column
cannot be sized until every name has been seen.

Column width is measured on the raw names, in characters, and padding is applied
before anything is styled. Measuring a coloured name counts its escape sequences
towards its width, which tilts the table with colour on and not with it off.
paint() is color_text() with the decision passed in, which is what lets a test
render both ways in one process and compare.

colorize_metadata is folded into the renderer, its only caller. A line in the
section that is not a field is carried through rather than dropped, so a hand
written note survives, and an unrecognised field still gets a row.

Plain columns, no border characters: nothing to degrade on a font that lacks
them, and the section rules already carry the only box drawing here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 17:12:57 +02:00
Ansho ReiandClaude Opus 5 75fb2b3a6d (4b1e7e8) Print the ticket title once in show
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>
2026-08-20 17:12:22 +02:00
Ansho ReiandClaude Opus 5 2503f9aee9 (3b7edd7) Show priority as a glyph, and bump to 0.2.0
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>
2026-08-20 15:50:09 +02:00
Ansho ReiandClaude Opus 5 ddbd45e332 (dca0b61) Add priority as a ticket field
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>
2026-08-20 15:36:19 +02:00
Ansho ReiandClaude Opus 5 8563218ab5 (06f15bf) Stop comments overwriting each other, and bump to 0.1.1
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>
2026-08-20 15:00:23 +02:00
Ansho ReiandClaude Opus 5 32a43b5201 (c28bc04) Report the version and the commit it was built from
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>
2026-08-20 14:48:37 +02:00
Ansho ReiandClaude Opus 5 a434f82928 (665719e) Report an ambiguous search as an error, not a print and exit
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>
2026-08-20 14:10:02 +02:00
Ansho ReiandClaude Opus 5 c675da1d2a (7ac39e3) Fix byte-slice panics in id shortening and date formatting
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>
2026-08-20 13:56:10 +02:00
Ansho ReiandClaude Opus 5 8ff64614fc (c230d2c) Fix mv corrupting the Status metadata field
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>
2026-08-20 13:33:44 +02:00
Anshorei 73e5aee2a2 (415e1c3) Fix worklane.ts tool when passed multi-line args 2026-05-15 20:59:29 +02:00
Anshorei 75e9ea2309 (1240895) Add colour to disambiguation 2026-05-15 17:21:43 +02:00
Anshorei dd5692d0a3 (724dc03) Add -o <owner> flag to comment subcommand 2026-05-15 16:32:03 +02:00
Anshorei bc3ee0c53b (339c65a) Add comment command 2026-05-15 11:11:40 +02:00
Anshorei aef8002d23 (101c2444) Add colours to ls command 2026-05-15 02:18:04 +02:00
Anshorei d668a24a3d (0b1a129) Add the mv command 2026-05-15 01:52:59 +02:00
Anshorei 26807621ae (3a68c7) Add created at timestamp 2026-05-14 23:10:04 +02:00
Anshorei 94da69a1b2 Make ls status non-flag argument 2026-05-14 22:32:17 +02:00
Anshorei 7d40159959 (e97d55) Add show command 2026-05-14 22:28:00 +02:00
Anshorei fd216b056c (177665) Add ls command 2026-05-14 21:37:11 +02:00
Anshorei 17a02b906e Initial commit 2026-05-14 20:41:40 +02:00