Skip to content

v0.0.18

Pre-release
Pre-release

Choose a tag to compare

@rsdoiel rsdoiel released this 09 Oct 13:40
· 115 commits to main since this release

Accepting a record is now the author's act, and the tool enforces it. The decisions are DR-0060 (set-status reviews the record, then asks), DR-0061 (accepting needs a terminal) and DR-0063 (cancelled covers explored work), all from the review-then-decide design. Everything was written and tested red first, including the built binary on a pseudo-terminal and with redirected streams.

kb record set-status follows a table of allowed moves. A record that is proposed may become accepted, rejected, cancelled or superseded; accepted may become cancelled or superseded; rejected and cancelled may go back to proposed; superseded is final, and needs superseded_by already set (use kb record supersede). A move outside the table, or setting the status a record already has, exits 1 and names the moves it may make; nothing is written. A record whose status is outside the vocabulary can only become proposed. cancelled now means pursued or explored and then abandoned, and need not have been accepted; rejected means considered and not pursued.

kb record set-status REF accepted exits 2 unless standard input and standard output are both a terminal, with a message that a person must accept it. No flag or environment variable turns that off, and every other move works without a terminal, so a script can propose, reject, cancel and supersede but not accept. The test asks the terminal driver, so < /dev/null does not count. It guards the accidental path, not a determined one: a process can allocate a pseudo-terminal, and a record file can be edited by hand.

kb record set-status REF with no status is a review for a person at a terminal. It shows the record through $KB_PAGER (else bat -l markdown, else less -R, else prints it), prompts with the current status and the moves allowed (harvey/DR-0004 is proposed -> [a]ccepted [r]ejected [c]ancelled [q]uit), and asks [y/N] before it writes. q, an empty or negative answer, or end of input leaves the record unchanged and exits 1. KB_PAGER is new. The library exports AllowedTransitions and CanTransition, so harvey and the TUI read the same table.

Upgrading: a script that ran set-status ... accepted must hand that step to the author, and one that relied on arbitrary moves (for example accepted to rejected; use cancelled) now gets exit 1. Skills that tell a model to promote a record need updating; the ones in the Laboratory do not any longer. github.com/charmbracelet/x/term and golang.org/x/sys are direct requirements, both already built into kb through bubbletea. The generated kb-*.1.md pages are now checked against their help text, so an edit made only to a page fails the tests.

Full Changelog: v0.0.17...v0.0.18