Git-native issue tracker
README.md

tracker #

tk is an issue tracker whose issues are plain files on the main branch
of a dedicated Git repository.

Each write is a single commit on the store's main, made on the writer's
machine with no network. The writes of one machine take turns under the
store's write lock: two simultaneous claims on one issue cannot both
succeed, and the loser is told who holds it. The copies of a store on
several machines meet when the merge queue syncs them with the code's own
state. Kinds, fields and write rules are declared
beside the issues in schema.toml. tk hook consumes events from the merge
queue mq and moves
the issues a land names, in a tk store or a Beads tracker. tk prints issues as rows.

Contents #

Security #

Anyone allowed to write the store, or to push to a copy it syncs with, can
rewrite any issue. tk adds no
access control and keeps no user list. Authorship is whatever identity the
Git configuration of the code checkout carries. --as NAME records a
different holder or comment author and appends a Co-authored-by: NAME
trailer to the commit. Nothing authenticates NAME.

tk new --private marks an issue untriaged. Such an issue lives in the
store with all the others and is exactly as confidential as the store and
every copy it syncs with. --public hides it from listings and from tk serve. A store is synced only where the code's queue state goes, and
never to a public remote (Copies on several machines).

Background #

git-bug writes each bug as a chain of
commits under refs/bugs/<id> of the code repository and orders concurrent
edits with Lamport clocks. Radicle
applies the same design to issues under refs/cobs and signs every change.
Fossil replays
timestamped ticket-change artifacts into a TICKET table.
git-issue keeps a directory of
plain files per issue in a separate repository under .issues.
Beads, built for coding agents, uses a
Dolt database under .beads and synchronises it through Dolt remotes.

tk differs on exclusive transitions. A claim, release or close is never
merged on one machine: it is computed under the store's write lock from the
main it moves, and moves it by compare-and-swap, so the second claimer
finds the first holder. git-bug, Radicle and Fossil accept both concurrent
changes and order them afterwards, possibly after two people have started
the same work. Beads obtains exclusion inside one database. tk obtains it
among the writers of one machine, the one that runs the queue and its
lanes, with nothing but Git and a lock file; between machines the copies
merge as Git repositories do, and where two machines changed one claim the
agreed copy's stands and the other is kept on the row. Its state is a plain tree on one branch, reviewable with
git show as in git-issue. Unlike git-issue, issues carry typed acceptance
checks and typed edges.

Install #

From the opam overlay that publishes tracker:

$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam install tracker

This installs the tk and tk-serve executables and the tracker library.
To build from a checkout of this repository, with the overlay configured:

$ opam install . --deps-only --with-test
$ dune build
$ dune runtest

tracker requires OCaml 5.2 or later. Creating a store requires Git.

Usage #

A first session #

tk involves two repositories. The store is a bare Git repository on
the writer's machine; issues live on its main, and a write exists once
it has moved that main. The checkout is your code. Its root holds a
.tracker symbolic link to the store, and its Git configuration
identifies the writer. No tk command reaches the network: another
machine's copy of the store meets this one when mq syncs them
(Copies on several machines).

tk init only rebuilds the query projection. The first commit of a store is
therefore written by hand in draft, cloned bare into the store and linked
from app:

$ git init -q -b main draft
$ cat > draft/schema.toml <<'EOF'
> kinds = ["bug", "task"]
> check_kinds = ["case", "reading"]
> label_families = [{ name = "area", values = ["api", "docs"] }]
> EOF
$ cat > draft/tracker.toml <<EOF
> organisation = "demo"
> prefix = "demo"
> EOF
$ git -C draft add schema.toml tracker.toml
$ git -C draft commit -q -m 'issues: start'
$ git clone -q --bare draft issues
$ git init -q -b main app
$ ln -s ../issues app/.tracker
$ cd app

Filing reads the body from standard input. An issue closes on the land of
the branch that works it, every check the queue ran there passed;
--check case:ARM:NAME names a check whose success closes it instead.
Listing needs no network:

$ echo 'A 413 response makes the client resend the same body.' |
>   tk new --kind bug --title 'Upload retries forever after a 413' --label area:api --check case:test:upload_413
created demo-4b0e2f
$ tk list
TK / TRACKER
demo-4b0e2f  P2  open  Upload retries forever after a 413

tk new files at once, and names on standard error the live issues that
share its words, with the edge that says one of them already holds the
finding:

$ echo 'Retries never stop.' | tk new --kind bug --title 'Upload retries forever'
created demo-7c1d09
similar live rows; if one holds this finding: tk link demo-7c1d09 duplicates ID
demo-4b0e2f open - Upload retries forever after a 413
$ tk close demo-7c1d09
closed demo-7c1d09
$ echo 'Send bodies over 8 MiB in parts.' |
>   tk new --kind task --title 'Chunked uploads' --priority 1 --check case:test:chunked_upload
created demo-e81c5a

Search matches whole words. Linking the bug to the task leaves only the task
ready, unblocking one issue (+1):

$ tk search retries
demo-4b0e2f open - Upload retries forever after a 413
$ tk link demo-4b0e2f depends-on demo-e81c5a
demo-4b0e2f depends-on demo-e81c5a
$ tk ready
TK / TRACKER
demo-e81c5a  P1  +1  Chunked uploads

Alice claims the task. Bob is refused, with her name. Once she closes it the
bug becomes ready:

$ tk claim demo-e81c5a --as alice
claimed demo-e81c5a
$ tk claim demo-e81c5a --as bob
tk: row demo-e81c5a is held by alice
[1]
$ tk comment demo-e81c5a --as alice -b 'Parts of 4 MiB, retried one at a time.'
commented demo-e81c5a
$ tk close demo-e81c5a --as alice -r 'Chunked uploads shipped in 1.4.'
closed demo-e81c5a
$ tk show demo-e81c5a
TK / TRACKER
demo-e81c5a  closed  Chunked uploads
Send bodies over 8 MiB in parts.

comment c-9f6c8bb2f11b5874db9dbd3d (alice): Parts of 4 MiB, retried one at a time.

reason: Chunked uploads shipped in 1.4.
$ tk ready
TK / TRACKER
demo-4b0e2f  P2  +0  Upload retries forever after a 413

Claims never expire. A refused claimer takes another row from tk ready. An
abandoned claim is freed by tk release ID --holder alice, which
fails if the holder has changed meanwhile, and the claims whose holders
provably ended by tk release --dead. A holder frees its own claim with
tk release ID --as alice: the holder a release expects is its writer
unless --holder names another. -r REASON records why in the commit. A claim records where its
holder runs, and tk show and tk list say from it whether the holder still
runs and how long it has been idle (Claims).

The store now holds nine commits:

$ git -C ../issues log --format=%s
tk close demo-e81c5a
tk comment demo-e81c5a
tk claim demo-e81c5a
tk link demo-4b0e2f depends-on demo-e81c5a
tk new demo-e81c5a
tk close demo-7c1d09
tk new demo-7c1d09
tk new demo-4b0e2f
issues: start

Two lines are hidden. Each command prints tracker: /path/to/issues on
standard error, and identifiers are random. [1] marks an exit status.
test/cram/readme.t replays this session under dune runtest.

Joining a store #

A second machine clones a copy the tree's queue syncs with, COPY:

$ git clone -q --bare --no-local "$COPY" ~/issues
$ ln -s ~/issues .tracker
$ tk ready

tk reads .tracker only from --root, by default the current directory,
and never from a parent directory. Commit the link with a relative target and
every clone and worktree has it. Queries and writes read and write the local
store as it stands, and mq sync exchanges it with the other copies. Kinds, labels and fields are whatever the store's
schema.toml admits.

The data model #

Each row lives under rows/A/B/C/ID/, where ABC begins the SHA-256 of
ID. ID is the store prefix, - and a body of lower-case base-36 digits,
then any number of . each followed by decimal digits. tk new and a
finding take the last six base-36 digits of a SHA-256, of random bytes for
the one and of the finding's key for the other, and one digit more, up to
ten, while the shorter id is held. A row converted from Beads keeps its id,
its children dotted (demo-k3x9q2.4). A row directory whose name is no id
of the prefix tracker.toml names is refused: no read of the store loads
it, and tk check names it.

  • row.json carries the structured attributes: priority from 0 to 4, triage
    state, labels, packages, edges, checks, the claim (Claims),
    eventually the closure, and
    optionally the row's order (Order). Members are written in a
    fixed order with a final newline. Unknown members are refused.
  • body.md is the optional body.
  • comments/GGG/NNNNN-ID.md is one comment: a JSON header with author and
    time, a blank line, then text. NNNNN is its zero-based index in the row,
    the order it was written in, and GGG is that index divided by 128, so no
    directory holds more than 128 entries however many comments a row has.
    Identifiers derive from author and text, and retrying a comment writes
    nothing.
  • exploration/NAME.md is the exploration artifact NAME, one of those the
    row's exploration names.

Beside rows/, rewrites/ID.map records one rewrite of the tracked
repository's history, written by tk rewrite --map FILE --reason TEXT: a
JSON header with who wrote it, when and why, a blank line, then the pairs of
FILE, git filter-repo's commit-map (an optional old new header, then
one OLD NEW line per commit, a new id of zeros for a pruned one). ID is
r- and the first 24 hexadecimal digits of the SHA-256 of the file, so the
same rewrite recorded again writes nothing and two copies never collide. The
files are only ever added. A row cites commits by id in its closure reason,
its body and its comments, which stay as written; tk show, the web row page
and tk hook's reading of a record's commits resolve each id, full or a prefix
of at least seven digits, through the union of every rewrite, as git's replace
refs stand one object for another on read: old to mid to new along a chain,
unchanged for an id no rewrite replaced, a pruned commit, or a prefix that
names old ids with different successors. A rewrite that gives an old id a
second successor, or closes a cycle, is refused.

schema.toml enumerates admitted kinds, check kinds and label families. A
row's status is not among them: every store has the five below. Without
kinds, the five Beads defaults apply: bug, feature, task, epic and
chore. A label reads FAMILY:VALUE, and the value set
["*"] admits anything. [[fields]] entries declare typed per-kind fields,
supplied through tk new --fields-file. An optional [rules] table states
write invariants such as a maximum title length or a label requiring another.
An optional [findings] table names the kind, one the store admits and can
claim, and the priority of the row filed for a finding, a red the hook
files or tk operator finding's; a store without it files no finding. Every
write is validated against the schema of the tree it produces and
refused before main moves when it introduces a violation. tk check
reports existing violations. tracker.toml holds organisation and
prefix. Where the copies of a store live is each machine's Git
configuration of the store, never a file every copy shares.

Checks of kind case:ARM:NAME or count:COMMAND:NUMBER are satisfied by a
landing whose check NAME or COMMAND passed. land is satisfied by the
landing itself: a complete settlement into the entry or the rules branch,
every check the landing ran passed, for a row whose acceptance is that its
work lands. A row that names no check and is of any kind but epic has
that acceptance, derived from its kind and never stored, as a branch that
names the issue closes it on GitHub or Linear: a check is named only for
what it adds. reading:READER:SUBJECT is shown by no landing: its reader
closes the row, tk close ID --as READER --reading -r TEXT. An edge is depends-on, tracks, duplicates, supersedes or
discovered-from. Self edges and dangling targets are refused, as are
cycles of depends-on or tracks edges.

A row's prerequisites are the rows it depends on and, unless it is a
goal (Goals), the rows it tracks. Triage splits a row's work into
the rows it tracks, its children, and an epic gathers its work in its
children; the row's own close waits on them (Working with
mq
), so while a child is open the row is no ready work:
a lane that started it would find its work in the children. When the last
of them closes the row is ready again, for a lane to land what is left of
its work or to close it on what main holds; a queued row, whose land
settled with its close held on them, closes then. A goal orders the rows it
tracks (Order) and waits on none of them: it is what an
identity's work is for, not work of its own. tk show --json gives each
row its prerequisites member, the ids in order.

Status moves through open, claimed, queued, landed and closed, and
says what a row waits on: a lane to claim it, its holder, the queue, its
reader, nothing. Claims record holder, time and origin and never expire.
epic rows and queued rows are not claimable, and tk ready lists
neither: queued means the
row's land is in the queue, held by no one, until the queue gives it back
open (Working with mq). landed means the land settled
with every check shown but a reading the row names: held by no one, it is no
lane's work and closes when its reader closes it; a claim takes it back to
work, and a later land of its issue queues it again. A land the hook does
not read, from a branch that names no issue, is handed over by the row's
holder, tk land ID --as NAME -r COMMIT: the row must name a reading, and
leaves claimed for landed with one comment naming the commit and the
reading owed. An open row that
carried a mark of its land would offer that row to every lane as work and
leave each reader of a status to look for the mark too, so the status alone
says it. tk release ID --holder NAME succeeds only while NAME
still holds the claim. Closing a claimed row requires its holder's name, and
records the reason -r gives, if any; a reading's close gives what was read.
A row closed before its work was done is work again by
tk reopen ID --as NAME -r TEXT: it leaves closed for open, held by no
one, in one commit whose body is the reason. The closure leaves the row and
stays in the store's history, where tk history lists the close and then
the reopen. A queued row whose land no queue entry holds, which tk hook --audit calls stale, is given back the same way, leaving queued for
open as the queue's give-back does. A reopen of a row at any other status
is refused, naming it.

Queries open a committed snapshot of the SQLite projection,
tk/index-<derivation>/index.sqlite inside the store's Git directory.
SQLite's write-ahead log lets readers use committed pages while a local refresh writes new pages.
The projection records its source Git tree and its format identity. Builds
that derive the same tables, metadata and values share a projection.
A change to those stored values, including a change to tokenization or
summary encoding, takes a new derivation and directory. One command at a
time can refresh a derivation under its index.lock. An ordinary refresh
updates only the rows identified by the Git tree diff.
A published rebuild reclaims idle sibling databases and their sidecars
when it takes both their refresh lock and their replacement lease without
waiting. Live snapshots and active refreshes keep their files. Lock files
remain as rendezvous points for a process reopening a derivation.
A reader with read-only access to a prepared store, a reader that finds
the refresh lock held, or one reading an older Git tree,
uses the same diff and updater in a private overlay. When a missing or
incompatible base prevents that overlay, readers share one durable build under
the refresh lock. A read-only caller needs a compatible base prepared by
tk init with write access. A reader waiting for this build names the lock holder.
A read that discovers damaged pages closes its snapshot, checks the projection
under the refresh lock and rebuilds it from Git before retrying the query.
Deleting the projection loses nothing. Beside it,
tk/write.lock is the store's write lock: the writes of one store take turns
under it, from the first ref a write reads to the last it moves. tk hook's
writes and the finding writes build and validate their commit first, and hold
it only to compare main with the tip they read and move it. A writer
that finds it held reports the holder while it waits for the current write to
finish or its process to exit. An explicit projection rebuild also names the
holder while it waits for the refresh lock.
A Git lock file on a ref the write moves makes the store busy, exit 2, and
refuses no row. Only a writer holding the write lock moves
refs/tk/validated, and the sync carries main alone, so a lock on that
record which holds nothing or a validation tag is a dead writer's: the next
writer removes it and records its own validation.

A write puts its objects into the store's Git directory before it moves
main: a commit, the trees on the path of each row it changes (the root,
rows/, the three shard directories and the row's own) and the files it
changes, eight objects for a change to one row.json. A write that loses its
race for main or that a rule refuses once written, and a tk merge that
does not become main, leave theirs unreferenced. tk packs and prunes
nothing: git -C STORE gc packs the store and removes the unreferenced
objects older than two weeks, which no write in flight still uses.

Claims #

A claim records its holder, the instant it was taken and, as its origin,
where the holder runs: the host name of the machine it was taken on, the
kernel's identifier of that machine's boot (kern.bootsessionuuid on macOS,
/proc/sys/kernel/random/boot_id on Linux), and the process the claimer
names as the holder's, given as tk claim ID --holder-pid PID or in
TK_HOLDER_PID, as its pid and the number the kernel gave it and gives no
other process until the machine boots again:

"claim": {"holder": "alice", "at": "2026-11-21T09:12:03Z",
  "origin": {"machine": "malibu", "boot": "6B1F0C2E-…",
    "process": {"pid": 4242, "id": 615931}}}

A value the kernel does not let the claimer read, such as a boot identifier
a sandbox refuses, is left out, and a claimer that names a pid no process
holds is refused. A sandbox also keeps its claimer from reading the number
of a process it did not start, such as the session it runs under, so the
process that starts that session hands the claimer the number with the pid,
as --holder-id ID or in TK_HOLDER_ID, and the claim records it; where
the kernel says the number, the one handed must be it, or the claim is
refused. A holder claiming its row again records where it runs now
and keeps the claim's instant, so a lane relaunched under the same name keeps
its claim.

Nothing in a claim expires, and nothing is written after it: a reader derives
the holder's liveness at each read, from the claim and from what its own
machine's kernel says now, and tk show and tk list print it after the
holder's name:

Liveness The claim
before this machine's last boot was taken on this machine under a boot before its current one, and before that boot started
process ended names a process that no process holds the pid of, or that the kernel numbered otherwise
alive names a process that runs
this boot was taken under this machine's current boot, and names no process this reader can read
on MACHINE was taken on another machine, whose processes this reader cannot see
liveness unknown records no origin, or one this reader cannot judge

The first two prove that the holder has ended; no other verdict says so. A
machine is its host name: two machines that share one read each other's
claims as their own.

A holder that still runs may have stopped working, waiting on a limit or
out of credit, so its liveness reads alive. Its last activity says it: the
newest of the claim's instant, the holder's comments on the row and the
commits of the holder's branches, refs/heads/HOLDER/*, in the repository of
the checkout that links the store. A command shares the branch reading
across a holder's rows in the same checkout. tk show and tk list print the
time since after the liveness, in its largest whole unit:

demo-e81c5a  P1  claimed  Chunked uploads  held by alice, alive, idle 2h

The SQLite projection stores the newest claim or holder comment instant
for each claimed row. A comment-only update refreshes that instant without
rebuilding the row's other indexes. A listing combines it with the branch
commits at read time. An edit records no author on the row, so it is no
activity.

tk release --dead releases, in one commit,
every claim of the checkout's store whose liveness proves its holder ended,
judged on the claims the write reads under the store's write lock. It
prints released ID with each such claim and kept ID with every other,
with its liveness and its last activity, and moves no other claim: a claim
whose holder may still run is left to a person, or to the lane that resumes
it under the same name and keeps it.

$ tk release --dead -r 'the laptop rebooted'
released demo-e81c5a  held by alice, before this machine's last boot
kept demo-4b0e2f  held by bob, on build-2, idle 3h

Order #

A row's parent is the row of its own store that tracks it, the one with
the least id when several do, so that no change of order changes a parent.
Its siblings are the rows with the same parent, or, for a row nothing
tracks, the other rows nothing tracks.

The order member ranks a row among its siblings. It is a key of digits and
lower-case letters, 0-9a-z, that does not end in 0, read as the digits
of a base-36 fraction after the point. Keys compare as byte strings, which
is the order of those fractions, and between any two keys lies another, so a
move writes the moved row alone and renumbers no other. This is fractional
indexing, as Figma
orders the children of a node; Jira's LexoRank adds buckets for a periodic
rebalance, which a key that never runs out of room does not need. An integer
rank would leave gaps and renumber rows nobody moved once a gap closed, each
renumbering a write racing every concurrent one. Inserting again and again
at one end of a list lengthens the key by one digit every five inserts. Two
writers who insert at one place may choose one key, and their rows then fall
to the tie-breaks below. tk edit ID --order KEY sets the member and tk edit ID --clear-order removes it; tk new --order KEY files a row with
it. tk new --first-in EPIC files a row first among the rows EPIC tracks,
in one commit: EPIC gains a tracks edge to it and its key comes before
every key of theirs, so that tk ready lists it before the rest of that
epic's work of its priority, the way an ask goes on top of its epic. The
member is a scalar: a concurrent change to it on one machine is a conflict,
and between two machines the agreed copy's stands (The distributed
model
, section 4). A row without it was never
written for it. The ordered list of the schema's [rules] table names
the kinds, such as ["epic"], whose rows carry the member while they are
not closed: a write that leaves such a row without one is refused, and tk check names each row that owes one.

tk ready lists rows by the priority that ranks them, then as the tree of
their parents. A row ranks at the most urgent of its own priority and those
of the rows that are not closed and have it among their prerequisites
(The data model), directly or through other such rows.
A P0 that depends on an open P1 row, or was split into one, or is an epic
that tracks one, is no ready work until that row closes, so the P1 row
ranks as a P0 and is started as one, ahead of the rest of the P1 work: this is priority inheritance, the
remedy schedulers apply to priority inversion, where a low-priority holder
of what an urgent task waits on runs only in its own turn. Raising the
prerequisite's own priority by hand would leave it urgent once the P0
closed or dropped the edge; the inherited rank follows the edges as they
stand. The row's own priority is unchanged and shown beside the one that
ranks it, with the row it inherits from: the nearest row of that priority
along the edges, the least id among rows equally near.

demo-77aa0c  P1, ranked P0 for demo-e81c5a  +1  Upload retries forever after a 413

tk ready --json gives such a row a ranked member,
{"priority": 0, "for": "demo-e81c5a"}, and a row ranked at its own
priority none. Two rows of one priority compare at the first ancestors where
their chains of parents part, and a row comes before the rows under it.
Siblings compare by order, a row with one before a row without, then by
the open rows whose prerequisites they are, most first, then by id. An
epic row is never claimable and is not listed, but it orders the rows it
tracks, and lends them its priority unless it is a goal, which lends them
none.

An order key ranks a row among its siblings alone, so an epic deep in the
tree cannot move its rows ahead of another root's. The label rank:first
does: the rows under a row carrying it, in the tree of parents, and the row
itself, come before every other row of the priority that ranks them, in the
order of the tree among themselves, and each other row follows in its own.
It leaves the priorities as they are: a P0 comes before every P1 row, first
or not, and the fleet reads P0 alone as urgent. The store's schema admits
the label with the family rank and the value first, and tk edit ID --add-label rank:first and --remove-label rank:first set and clear it.

[[label_families]]
name = "rank"
values = ["first"]

A goal does not change this order:
tk ready --goal keeps the list to a goal's rows, each where the whole
list ranks it (Goals).

The ready view #

tk view renders tk ready's list as a Markdown file, and tk view apply FILE reads an edited copy back, so the file and the tracker are one model
(the distributed model, section 4). A view
takes tk ready's --all, --public and --label.

<!-- tk view --all at demo@4c1d07e2… blacksun@9a3be0f1… -->

# Ready

## P1

- demo-1a2b3c Uploads
  > Large files upload in parts, each retried alone.
  - [ ] demo-e81c5a Chunked uploads
  - [ ] demo-4b0e2f Resume an interrupted upload

## P2

- [ ] demo-77aa0c Upload retries forever after a 413

The first line names the options and the full commit of every store the
view read, the stores that judge a prerequisite among them. A heading ## PN opens each priority that lists a row, each row under the priority that
ranks it. Under it, each row is one line,
- ID TITLE, indented two spaces for each parent above it and preceded by
its parents' lines, in tk ready's order. [ ] marks a ready row of the
heading's priority; a line without it is a parent shown for the rows under
it, followed by its body, each line quoted with > at its children's
indentation, so that each epic's reason reads above its rows. --public
leaves out untriaged rows and the rows under an untriaged parent.

tk view apply FILE renders the view again from the rows at the revisions
the first line names, as it was read, and compares each list of siblings
under one parent and one heading with the file. Where the file lists
siblings in another order, the read-back gives new keys to the fewest of
them: the longest run that already sorts in the file's order keeps its keys,
trailing siblings without an order that already sort keep none, and each
other sibling takes a key between its neighbours. It then renders the view
from the rows with those keys. When that differs from the file, it refuses,
naming the first line that differs and what the view holds there. A line
moved under another parent or another priority, a line added, removed or
reworded, and an edited body are refused this way. An unedited file maps to
no edit and publishes nothing.

Each store whose rows moved takes one commit, tk view apply, written as
tk edit writes a row: the moved row is merged with the store's current
row, so an edit another writer made since the named revision to another
member is kept, and a concurrent change to the same row's order refuses,
naming the row. Rendering again after an apply prints the edited file, with
the first line naming the new commits.

Goals #

A goal is the epic an identity's work is for: the row carrying the label
goal:NAME while it is not closed is the goal of NAME, the name a write
is made under (--as, else TK_AS, else the Git author). Several sessions
work one store, each under its own name and towards its own goal, and a
session that takes over another's name takes over its goal. The mark is a
label of the row rather than a member of the store's tracker.toml: a
label is merged with the row (The distributed
model
, section 4) and read by tk list --label,
while a store member would record a row's role beside the row, and a change
to it rebuilds the projection. The store's schema admits goals with the
family goal and every value:

[[label_families]]
name = "goal"
values = ["*"]
$ export TK_AS=alice
$ tk goal set 'We want uploads that resume' --body-file why.md
goal demo-5d1c0a
$ tk goal add demo-4b0e2f
demo-5d1c0a tracks demo-4b0e2f
$ echo 'Resume from the last part.' | tk new --kind task --title 'Resume' --goal
created demo-0b7e44
$ tk goal
TK / TRACKER
goal of alice  demo-5d1c0a  We want uploads that resume
Uploads stop at the first lost connection.

0/2 closed: open 2 · claimed 0 · queued 0 · landed 0
demo-0b7e44  P2  +0  Resume
demo-4b0e2f  P2  +0  Upload retries forever after a 413

tk goal set TITLE files an epic labelled goal:NAME for the writer, its
body from --body-file, and closes each goal the writer held, with the reason
superseded by ID and a supersedes edge from the new goal, in one commit.
A closed goal keeps its label, so tk list --closed --label goal:NAME is the
record of an identity's goals. tk edit ID --add-label goal:NAME makes an
existing epic a goal. When two copies of a store each set a goal for one
name, the newest filed is the goal, and the next tk goal set closes both.

A goal's rows are those it tracks, directly or through the epics it tracks,
each counted once, as the web overview counts an epic's.
tk goal [--as NAME] prints the goal, its body, its rows by status and the
first ten rows of tk ready among them; tk goal --json prints the same as
one object, {"owner":…,"id":…,"progress":{"open":2,…},"ready":[…]}, and
{"owner":"bob","goal":null} for a name that holds none, which exits 0.
tk goal add ID… and tk goal drop ID… add and remove the goal's tracks
edges, and tk new --goal files a row first among them, as --first-in
does for an epic (Order). tk ready --goal keeps the ready list to
the writer's goal's rows, and --goal=NAME to another identity's. tk goal list lists every identity's goal with its closed and total rows.

The projection keeps the goals of the rows that are not closed in one
metadata cell, rewritten from each changed row as the priority counts are
(Urgent work and requests), and walks a goal's
rows through its tracks table by key.

Listing #

tk list lists the live rows, those not closed, as tk search finds them,
and --closed adds the closed ones. Each option keeps fewer:

Option Keeps the rows
--status STATUS of the status, the closed rows too if it names them; repeat for several
--kind KIND of the kind; repeat for several
--label FAMILY:VALUE carrying the label; repeat to require several
--package PACKAGE naming the package; repeat to require several
--blocked with a prerequisite that is not closed

tk list --json prints each row's id, title, kind, status, priority, triage,
disclosure, filing time, holder, labels and packages. A claimed row also has
its claim, as row.json records it with its origin (Claims),
and its liveness as this machine reads it then, one word per verdict:
dead-boot (before this machine's last boot), ended, alive,
this-boot, elsewhere or unknown. Only dead-boot and ended prove
the holder ended:

{"id": "demo-e81c5a", "status": "claimed", "holder": "alice", …,
 "claim": {"holder": "alice", "at": "2026-11-21T09:12:03Z",
   "origin": {"machine": "malibu", "boot": "6B1F0C2E-…",
     "process": {"pid": 4242, "id": 615931}}},
 "liveness": "alive"}

A prerequisite is
judged in the store its prefix names, as tk ready judges it (Several
stores
).

tk ready takes --label and --package as tk list does, and
--exclude-label FAMILY:VALUE, repeatable, leaves out the rows carrying it.
--goal[=NAME] keeps the rows of a goal (Goals).

Commands #

Every command accepts --root DIR, the checkout containing .tracker,
defaulting to the current directory. Queries other than tk search emit
JSON under --json. A write is made under --as NAME, by default the
environment's TK_AS, else the checkout's Git author name; a session sets
TK_AS once, and every command it runs, the band's among them, writes and
reads under that name.

Row writes exit 1 when the store refuses them (held row, rule violation) and
2 when the store cannot be read or written. Repeating a refused write
unchanged gets the same refusal. tk schema change, tk hook and the
queries exit 2 on every failure. Command-line errors exit 124.

Command What it does
tk new File a row in one commit, and name the live rows that may hold the same finding.
tk list [QUERY] List the live rows, or those whose id or title contains QUERY, narrowed by the listing options.
tk search PHRASE Find live rows by id, or by whole words of the title or body.
tk show [REV:]ID… Print rows with their body, comments and prerequisites, from main or from revision REV.
tk ready List the open, unclaimed rows whose prerequisites are all closed, by the priority that ranks them, inherited from the rows that wait on them, then in order, narrowed by the listing options on labels and packages.
tk goal [--as NAME] Print an identity's goal, its rows by status and its ready rows (Goals).
tk goal set TITLE File the writer's goal, superseding the one it held, in one commit.
tk goal add ID…, tk goal drop ID… Add or remove the writer's goal's tracks edges, in one commit.
tk goal list List every identity's goal.
tk view, tk view apply FILE Render the ready list as a Markdown file, or read an edited one back as order edits (The ready view).
tk status Count rows by status.
tk count Read cached priority and request counts across linked trackers.
tk claude install Install the urgency band into a Claude Code account.
tk claim ID Claim a row in one compare-and-swap on the store's main, recording where its holder runs (Claims).
tk release ID [--holder NAME] [-r REASON] Release a claim only if NAME, by default the writer, still holds it.
tk release --dead [-r REASON] Release every claim whose holder provably ended, in one commit (Claims).
tk comment ID Add a comment in one commit.
tk edit ID Change one or several fields of a row in one commit.
tk link Add a typed edge in one commit.
tk unlink Remove a typed edge in one commit.
tk close ID [-r REASON] Close a row, with its reason when one is given.
tk reopen ID -r REASON Reopen a closed row whose work is not done, or a queued row whose land no queue entry holds, in one commit recording the reason.
tk land ID -r COMMIT Hand a claimed row whose land the entry branch holds to the reading it names, in one commit.
tk merge COMMIT Merge COMMIT, a copy's main fetched into the store, into main by the row rules (Copies on several machines).
tk rewrite --map FILE --reason TEXT Record a rewrite of the tracked history, git filter-repo's commit map, in one commit (The data model).
tk schema, tk schema change Print the schema, or publish a new one with the rows it rewrites.
tk check Check every row against the schema, and the definition anchors against the checkout.
tk export --jsonl Write one snapshot of the store as JSON lines.
tk stats Report flow measures (ages, time to claim, time to close) over a window.
tk history --json --since TIME --until TIME Print the claims, releases, closes and reopens Git history witnesses in a window, with each writer and whether coverage is complete.
tk hook Apply one mq event read on standard input.
tk init Rebuild the SQLite database from Git. It does not create a store.
tk operator File or look up a finding by its external key, for a scheduler (Findings).
tk serve Serve the rows as web pages, on the loopback address by default.
tk serve dispatches to tk-serve. Unknown subcommands run the executable
tk-NAME found next to tk or on PATH, as Git does for git-NAME. Each
command documents its options under --help.

Web overview #

tk serve --epic demo-roadmap --epic demo-next serves the selected epics
at /overview. Repeating --epic selects membership; priority and the
tracker's parent and sibling order rank the epics. With no selection the
page shows all unclosed epics. The navigation links it from the issue list.

Each epic counts its distinct visible tracked descendants, including nested
epics, by state. A shared child counts once. Missing links say unavailable;
private issues contribute no public title or count. The fraction closed is
an issue count, not an estimate of effort. The page works without scripts
and wraps its titles and counts on a phone.

The viewer reads a validated projection without writing it. It advances
stale rows in memory using the same Git diff and updater as a tracker
write. If the projection is missing or its schema differs, run tk list --all --json from the same build to prepare it and reload the page. A read
failure never becomes an empty progress count.

Findings #

tk operator finding --external-ref KEY files the row a scheduler's finding
keys, once: a second call with the same key joins the row it filed, and so
does a call with another key under the same --family-prefix while that row
is not closed. --check names a check as tk new reads it,
--package the packages that own the finding, if any, and --body-file its
body. The row takes the kind and priority of the store's [findings] table
(The data model), or --kind and --priority, a priority
optionally with why as --priority-reason. A report under it is optional, given as --comment-file,
--comment-id and --comment-at together and written once per id.
tk operator lookup and tk operator lookup-prefix find a finding by its
key or by a prefix of keys. A filing resolves its key and family through the
projection and reads only the row that carries the key and the rows of the
ids a new row may take; the projection also answers whether another row
holds a new external reference, so no filing reads the rest of the store.
Finding lookups, and the validation of the commit they lead to, run outside
the Git write lock. The write checks the
observed tip under the lock before it publishes. A moved tip requires another
lookup.

Several stores #

A checkout may also see a second store, through the link
vendor/mono/.tracker below its root. When vendor/mono holds no such
link but is a linked worktree of a repository, as a merge queue's
generation of a dependency is, the second store is the one the .tracker
of that repository's main checkout links. --all merges its rows into
listings. Only tk view apply writes
the second store, when the view it reads names rows of that store that
moved.

Prerequisites are resolved in the store whose prefix starts their
identifier, and a dependency on a closed row of the second store counts as
met. tk link, tk new --link and tk edit --duplicate-of find an edge's
target the same way, so a row of one store can wait on a row of the other. An unknown prefix or a dangling second link makes tk ready, tk stats
and tk hook refuse, naming what was unreadable, without partial output.

Working with mq #

mq lands a branch
once the checks listed in its rules pass, and journals each step as a
CloudEvents record. Its rules, mq.toml on the
mq/config branch, name one hook, which is delivered the records and judges
each queued land and worktree hand-out. tk hook is that hook for a tracker, and the only one: one
table moves the issues of a tk store and of a
Beads tracker alike.

[hook]
command = "tk hook"
deliver = ["queued", "settled", "outcome.needs_work",
  "outcome.removed_from_queue", "outcome.interrupted", "report.dequeued",
  "report.dropped", "unrepaired", "cost-step", "blocked"]
judges = ["queued", "handed-out"]

mq runs the hook from the repository's main checkout with one event on
standard input, and MQ_HOOK says which call it is: verdict on a queued
land or a worktree hand-out, delivery for a journal record, and audit for
the queue snapshot. The checkout selects the tracker: .tracker a
tk store, .beads a Beads tracker, written through bd. The hook reads
each line with mq's own codec, the merge-queue library's
Merge_queue.Event.of_cloudevent, so a tk built with the version of the
mq that runs it reads each record as that mq writes it, and refuses one
that mq would not read. A line of another mqschema is refused before
anything else is read from it. An identifier
with another tracker's prefix is named on standard output and skipped.

The issues a land names are the ids in the Bug or Issue field of the
branch description the queue captured (mq new NAME --field Bug=ID), else
the branch name's last segment when the tracker holds that id, written
whole or less the store's prefix (lane/demo-4b0e2f or lane/4b0e2f), and the ids
of the Bug: trailers of the commits the land took, read as
git-interpret-trailers(1) reads them. A queued record lists its newest
commits and names the rest by its range since..tip; a landing names its
commits by its range was..landed alone. The hook reads their messages from
Git for the issue names and the closing note. A record of a land given back, an
outcome.needs_work, outcome.removed_from_queue or outcome.interrupted,
or a report.dequeued or report.dropped, carries the submission of the
entry it ends, its newest commits, and the hook names the land's issues from
that record alone; one that ends no entry carries none, and names the
branch's last segment. A settlement as it stands moved nothing, its
was..landed empty, and its landing names the commits its queueing captured
by the range since..queued, which the hook reads from Git; a record written
before landings named since takes none. They come from the event and the
commits' objects, never from a live branch or the queue's history.

Record What it does to each issue the land names
queued, no keep_branch open, claimed or landed becomes queued, with no holder
queued with keep_branch nothing: one step of the lane's work, and the lane keeps its claim
queued or settled, every commit's subject ending (red) as a land that does not complete its branch: a red test lands alone before its fix, so the lane keeps its claim and nothing closes
outcome.needs_work of a serve into a branch that only reports (its judged member set) files one issue per red check and package, of the store's [findings] kind and priority and with no acceptance check, listing the red tests and the check's log; a package is a directory at the checkout's root holding an opam file that starts a red test's path, and tests under none, or a check that names no test, file under no package; its External reference is mq:reported:TARGET:CHECK:PACKAGE:EVENT, . for no package; a redelivery finds the issue, and a later red files none while an issue of the same target, check and package is not closed
any other outcome.needs_work, outcome.removed_from_queue, outcome.interrupted, report.dequeued, report.dropped queued becomes open; one comment on each issue not closed: the record's word, the branch, the reason and the red check's log
settled into the entry branch or the rules branch, complete, with commits of its own and every check passed a queued or open issue closes after its other outstanding submissions settle or leave the queue permanently, or becomes landed while a reading it names is owed; its reason lists the commits' subjects and the passing checks, points at mq events BRANCH --json, and gives each nonempty commit body in oldest-first order; the tk store records the reason in the close commit's body; a claimed issue gets one comment, a landed one nothing
settled as it stands (was is landed), complete, naming the checks its tree passed as a complete settlement: its note names the commits of its since..queued
settled, not complete or with no commit of its own and none of its tree's checks (a lane landed again as it stands) queued becomes open, with one comment listing the settlement's clauses
settled with a check not passed, or with commits of its own and no check (a hand move adopted) nothing, acknowledged: a legal record closes nothing
settled a serve carries to a branch that reports nothing
cost-step files one finding with the recorded check, keyed by mq:cost-step:TARGET:CHECK:SCOPE:LANDED, SCOPE:test=NAME in place of the scope for a test's CPU; redelivery, including another platform and a closed finding, finds the same issue
unrepaired files one issue in this tracker, of the store's [findings] kind and priority, with the package merge-queue and proved by the red checks the record names, its External reference mq:unrepaired:BRANCH:EVENT; a redelivery finds it, and a later red of the branch while it is not closed comments on it once instead of filing a second
blocked of a target-stopped finding files one finding with the package merge-queue and no acceptance checks, so the land of the branch that works it closes it, titled by the target and what the finding says, keyed by mq:stopped:TARGET:SINCE, so the record journaled again for the same stop finds the same issue and a later stop files its own; a blocked record of any other finding is acknowledged and changes nothing
settled into the entry branch or the rules branch with a check run and none failed, or report.dropped also closes each issue not closed that a red of its branch filed, found by its External reference; in a tk store a landing proves its red checks, as a close does, and a drop closes it obsolete

An issue a red filed is the record of a branch mq could not repair, and its
reader is the branch's own ending: the settlement that lands the branch, or
its drop, closes it, so no red issue outlives its branch's land.

An issue a red of a branch that only reports filed is work for a lane: no
land waits on that branch, so the land of the fix that names the issue closes
it, and the next red of the same check and package files its own.

A settlement closes an open issue as well as a queued one: mq's reader
of endings may give a needs_work back after the lane queued its branch
again, so that record reaches the hook after the later queued one and
reopens the issue the later land then settles.

An outstanding submission is a queued entry. If another outstanding
submission names the same issue, the hook records one comment naming those
branches and leaves the issue for that entry's settlement. The last
settlement can close it using its own checks. Work mq returned to its
branch with its submission retained settles only when a lane queues it
again: if such work alone names the issue, the settlement gives a queued
issue back to open, and comments on an open one, naming those branches,
so a lane claims it and lands that work or closes the issue on what main
holds. A closed row stays closed.

A close waits on the issue's open children and open depends-on (Beads:
blocks) prerequisites: the delivery is refused with a wait ID line for
each in the answer file, and each close answers changed ID, so mq puts the
landing again when the last of them closes and at no run between. A close
no delivery made, tk close by hand or a reader's, answers nothing; the
audit below names it changed. In a tk
store the landing proves each check the row names: a case or a count by
its check of that name, passed, and land by the landing itself, whose
closure then names every check it ran. A reading no landing shows: a
landing that shows every other check sets the row landed with one comment
naming the reading owed and the landing's reason with the commit bodies,
says landed ID: WHAT,
and closes nothing that waits on it; the reader's close ends it. If the
tracker refuses the final close, it records one comment naming what is owed
and returns a queued issue to open. The delivery is acknowledged. A tk
row may name no check or require proof the landing does not carry. A Beads
row may have a reading_owed mark, which refuses the close.

In a tk store, the handed-out verdict claims the issues in the branch's
Bug or Issue fields, or the issue named by its last segment when the
fields name none. One store transaction claims all matching rows under the
full branch name, with the event's time and the origin in data.holder.
A repeated hand-out to that branch keeps its claim time and records the
origin of the new hand-out. A different branch can take a held row once
the recorded holder provably ended. A conflicting claim, a closed row, or
any other refusal from tk claim refuses the whole hand-out. The first
line on standard error gives the reason. A hand-out naming no local issue
is admitted. Beads trackers admit hand-outs, and both trackers admit queued
lands.

A delivery writes the local
store and needs no network; a store it cannot write refuses it with exit 2,
moving nothing, and mq puts it again.

Each move is guarded on the status it read, and each comment carries the
event's id, so a redelivery moves nothing twice and comments once. A
delivery reads the named issues in one call and writes once per move; mq
ends a call at its exit, and the hook sets no deadline of its own. A
command the hook asks, mq or bd, that exits otherwise than 0 refuses
the delivery, which moves nothing, naming the command, its exit status and
the last line of its error output, where it says why it ended: a notice it
wrote before, such as the line mq events writes on what a fold keeps, is
not the reason.
After a delivery round, MQ_HOOK=audit reads the supplied queue snapshot:
one entry per JSON line, using mq's entry codec. It starts no mq command.
An entry names the issues its queued record's delivery moves, read from
its branch and the submission its land captured as above. A queued issue
no entry names is waiting when its close waits on an open child or
prerequisite: that is where a landing that names it leaves it, held until
they close, and moving it would be refused the same way. Any other is
stale: nothing outstanding moves it. The children and prerequisites of a
stale issue are all closed, and a hand that closed one answered no
changed, so a landing held on it waits for good: the audit names them
changed, and mq puts that landing again, whose delivery moves the issue as
the table says. The audit writes
{"stale": ["ID"], "changed": ["ID"], "next": "tk hook --audit"} to
MQ_HOOK_ANSWER, changed absent when it names none, exits 1 for stale
rows and 0 for none. The queue records the answer and shows each stale row
as a hook-stale health finding. A stale issue that no landing waits on,
its settlement lost, is given back by hand, tk reopen ID --as NAME -r TEXT, or closed on what main holds.

tk hook --audit reads no event: it reads each entry and the submission its
land captured as mq status --json lists them, prints each stale issue
(ID: queued, and no entry names it) and each waiting one with the issues
its close waits on (ID: queued, and its close waits on ID, still open),
and exits 1 when one is stale.

The rules run the installed tk, so a hook fix is one install from the
tree that carries it and never waits on the branch the hook judges.

GitHub closes an issue that a closing keyword (Fixes #N) names in a pull
request or a commit message when the change merges into the default branch:
the Bug field and trailers are the keywords here, and the entry branch is
the default. Gerrit keeps tracker integration out of the review server:
its-base
reads the server's event stream, finds ids by a pattern, and applies one
rule file (actions.config, an event to an action such as a comment or a
status change) through a backend per tracker (its-jira, its-bugzilla). Zuul attaches
reporters to
a pipeline's results (enqueue, start, success, failure, dequeue), each a
driver. mq, like Gerrit and Zuul, has no word for a tracker, so the table
lives with the tracker; it is its-base's one rule file, so a Beads checkout
and a tk store move the same way, and the Beads backend goes once the last
tracker is a tk store.

A wake on ready work #

A program that starts work when there is some needs an event, and a store
that tells no one leaves it to poll. A store's own Git configuration may name
a command:

git --git-dir STORE config tk.wake 'touch /path/to/wake'

tk runs it with /bin/sh -c, once, after a write that may give the ready
list a row or move its rows: a row filed, released or reopened, a row
closed, which frees the rows that waited on it, and a priority, an order
or a depends-on or tracks edge changed. A landing or a branch given back
reaches the store through tk hook, and a sync through tk merge; each is
such a write. A comment, a claim, which only takes a row out, and a write
that changes nothing run nothing. The rule reads the rows the write
changed and no prerequisite, so it also holds for some writes that leave
the list as it was, such as the close of a row nothing waits on: the
command starts a reader of the list and decides nothing itself.

The command runs once main has moved and the store's write lock is let
go, with no input and its output dropped. tk waits for it, as Git waits
for a post-commit hook, and a command that fails is named on standard
error while the write stands. tk knows nothing of what the command
starts. The variable is the machine's, in the store's configuration and
never in a file every copy shares, so a copy pushed from elsewhere names no
command here. A store with no tk.wake writes as it did.

Copies on several machines #

Each machine that runs a tree's queue keeps its own store, as it keeps its
own copy of each branch, and writes it with no network. mq syncs the store
as it syncs the tree's branches and notes: the rules' [sync] names it,

[sync]
repositories = [{ name = "issues", path = ".tracker", merge = "tk merge" }]

and each sync, typed or scheduled, pulls and pushes the store's main
with the tree's state, under the same sync lock, to the remotes of the same
names the tree's entry branch pulls from and is pushed to. The store's own
Git configuration gives each of those remotes its URL, a copy beside the
tree's own on that remote, and a remote it does not name is skipped: the
store goes only where its own configuration sends it, among the remotes
the tree's state goes to, so a public remote the code is pushed to never
receives it unless the store names it (mq's configuration.md, "Repositories
beside the tree").
A write moves the store's main, and that move makes a sync due as a
landing does.

The pull fetches the remote's main. A store the copy contains
fast-forwards to it, and one that contains the copy waits for the push.
Otherwise mq runs tk merge COMMIT in the checkout, which takes the
store's write lock and writes one commit with both parents: the three-way
merge at their base, by the rules of the distributed
model
, section 4. Comments join by id; labels,
edges and checks merge as sets; a body merges by lines. Where both sides
changed one row's claim, status or other scalar, the copy's value stands,
since the copy the pull reads is never rewritten (mq's "Offline first"),
and the store's own value is kept on the row as a comment naming both,
whose id derives from the two commits, so a merge made again writes
nothing new. A merge never refuses on two writers, so a sync never stops
on them; it fails, moving nothing, only when an object cannot be read.
The push then sends main with a lease on the value fetched, and a remote
that moved meanwhile is pulled again at the next sync.

A machine's claims are therefore exclusive among its own writers. The lanes
claim on the machine that runs the queue; another machine's writes, such as
its own queue's hook moving the issues of the lands it settles, meet them
at the next sync, where a claim both took of one row keeps the agreed
copy's holder and records the other.

Urgent work and requests #

tk count reports P0 through P4 and the maintainer's asks. Open and claimed
rows contribute to every priority, and queued rows also to P0 and P1. The
asks are the rows tk ready --all --label blocked-on:thomas lists: an ask
that is claimed, queued or waiting on an open prerequisite is not counted
until it is ready. Every tracker the checkout links contributes once,
including the vendored checkout's tracker. An unreadable linked store
refuses the reading.

tk count --json prints {"p0":7,"p1":42,"p2":81,"p3":12,"p4":5,"asks":3}
with the current values.
The projection caches the priority counts in metadata. A rebuild totals each
row's contribution; an update applies the changed rows' old and new
contributions in the same transaction. A warm count reads five metadata cells
per store, without reading issue rows or bodies. The asks come from the ready
rows the projection keeps, read by their label, with only their
prerequisites in another store looked up there.

Claude Code band #

tk claude install writes the bundled tk-status plugin into
$CLAUDE_CONFIG_DIR/skills, or $HOME/.claude/skills when no account is
selected. The shared Claude.Plugin installer refuses foreign folders and
links, writes changed files and records the account under the XDG state
folder for tk. tk claude install --recorded refreshes every recorded
account that still holds the plugin.

Above the prompt, the plugin shows one truncated line:

tk      goal: We want uploads that resume 3/12 · P0 7 · P1 42 · P2 81 · P3 12 · P4 5 · asks 3

The line begins with the goal of the identity the session runs as, TK_AS
or the checkout's Git author (Goals): its title, cut to 40
characters, and its closed and total rows. An identity with no goal shows
no goal.

P0 is red when positive. Asks are yellow when positive. P1 through P4 are
plain. While claims of the linked trackers prove their holder ended
(Claims), the line ends with their count, · dead 3, in red:
tk release --dead releases them. The plugin reads
tk count --band --json, using the cached counts, the ready asks and the
claimed rows across linked trackers, and the goals the checkout's store
keeps with a walk of the goal's rows by key.
It refreshes at session and turn starts and while rendering, at most once
every 30 seconds. Outside a repository it shows no band. A failed reading
shows tk unread · tk count. tk count --band --color never prints
the same line in a terminal.

Performance #

--bench makes a query report its elapsed time, SQLite pages, rows scanned
and Git objects read on standard error. A writer that accepts --bench
reports the Git object requests made by the write. A single-row writer
reads its row; a hook reads each named prerequisite and uses the projection
to discover findings, and a finding filing reads the rows its key resolves
to. On a Linux x86_64 host and a
generated store of 10,000 rows, a third of them open, a warm tk list --json --bench >/dev/null prints the live rows in 13 to 21 ms, reading 627
pages and one Git object, and the process takes 41 to 77 ms. At 1,000 rows
the figures are 7 to 10 ms and 63 pages, with 36 to 48 ms of process time
dominated by start-up. tk show ID reads 14 Git objects at both sizes.

A filtered text list keeps the rows that pass its predicates on the scan
that selects them. It returns those rows directly. In a JSON list, a status
selection other than the live or full list reads the matching summaries
through the status index.

tk status groups lifecycle counts in each store's SQLite snapshot and
sums the groups across linked stores when --all is given.

After a write, the next read updates the projection from the rows the write
changed. bench/bench_projection.exe ROWS DIR measures it on a generated
store shaped as a converted Beads tracker (a body per row, two labels, a third
of the rows depending on earlier ones, 57% closed), on a Linux x86_64 host.
At 13,000 rows a rebuild from nothing takes 4.6 to 6.3 s of CPU and 121,201
Git objects; the read after a comment takes 7 ms and 15 objects, after a
claim 13 ms and 21, after closing a row five open rows wait on 121 ms and 56,
and after filing a row 40 ms and 17. At 130,000 rows the rebuild takes 65 to
74 s and 1,174,373 objects, and the same reads 11 ms, 10 ms, 94 ms and 40 ms,
for 15, 21, 63 and 17 objects. Most of a rebuild is the discovery
projection: tokenising every title and body, and the postings. The filing
check that follows a close, a reopen or a new or rewritten row recomputes
every live row's filing mass from the postings: 0.45 s at 13,000 rows, 4.2 s
at 130,000.

Status #

Unreleased. Commands, library and store layout may change before 0.1.0.
Three limitations matter day to day:

  • the first filing after a close, a reopen or a new or rewritten row
    recomputes every live row's filing mass, half a second at 13,000 rows
    (Performance);
  • the second store is found only through vendor/mono
    (Several stores);
  • no command creates a store, so its first commit is made with Git
    (A first session).

The distributed model describes the
coordination contract. This version writes each machine's store locally
and merges the copies at mq's sync, without the per-writer histories
proposed there.

API #

The tracker library is the state model underneath tk: pure, it links no
Eio, no Unix and no Git I/O. Every module in lib/ is public. Start from
these:

  • Core: rows, checks, edges and closures, and the pure
    claim, release and close transitions;
  • Claim and Liveness: what a claim
    records of where its holder runs, and the liveness a reader derives from it;
  • Machine, Held and
    Release: one reading of this machine, and what a
    command decides on it: a claim's liveness and origin, the line printed
    beside a claimed row, and the claims tk release --dead releases;
  • Row_json and Schema_toml:
    the row.json and schema.toml codecs;
  • Layout: the path of each file of a store, and the
    file each path names;
  • Store_tree: the walk and decode of a store's tree,
    pure over the object reads it is handed;
  • Row_view: a row with its prose and comments;
  • Projection: the choices made over the SQLite
    projection, and the rows it answers with;
  • Hook_event and
    Hook_transition: mq's events and what they do
    to rows.

The library tracker.eio performs every effect the core asks for:

  • Tracker_eio.Shell: processes, the checkout's
    commits, the store's reads and its compare-and-swap write;
  • Store_git: the compare-and-swap writes;
  • Store_ops: a claim as the edits one transaction
    applies;
  • Sqlite_index: the SQLite projection;
  • Row_history and
    Landing: a row's commits in the store, and the
    commits that reached a branch.

Transitions are pure, taking a row and returning a new row or a refusal. tk claim runs Core.claim via Store_ops.claim_edits inside a Store_git
transaction. Below, a competing claim and a foreign release are both
refused:

# open Tracker.Core
# let row =
    Row.v ~id:"demo-e81c5a" ~title:"Chunked uploads" ~kind:"task"
      ~checks:[ Check.Case { arm = "test"; name = "chunked_upload" } ]
      ~priority:1 ~triage:Row.Ready ~filed:"2026-10-04T09:00:00Z" ()
val row : Row.t = <abstr>
# let said r = Result.map_error (error_message ~row:(Row.id row)) r
val said : ('a, error) result -> ('a, string) result = <fun>
# let held =
    match claim ~holder:"alice" ~at:"2026-10-04T09:05:00Z" row |> said with
    | Ok held -> held
    | Error message -> failwith message
val held : Row.t = <abstr>
# let holder row = Option.map Tracker.Claim.holder (Row.claim row)
val holder : Row.t -> string option = <fun>
# holder held
- : string option = Some "alice"
# claim ~holder:"bob" ~at:"2026-10-04T09:06:00Z" held
  |> said |> Result.map holder
- : (string option, string) result = Error "row demo-e81c5a is held by alice"
# release ~holder:"bob" held |> said |> Result.map holder
- : (string option, string) result = Error "row demo-e81c5a is held by alice"

Errors carry no row, hence error_message ~row. Instants are RFC 3339
strings that claim never validates.

License #

ISC. See LICENSE.md.