Development
For development: cargo build, cargo test --workspace --locked, and cargo lint.
cargo lint runs cargo clippy --workspace --all-targets -- -D warnings, rejecting
compiler and Clippy warnings in every workspace target, including tests and examples.
Keep build outputs local to each issue worktree; do not point CARGO_TARGET_DIR
or --target-dir at the primary checkout. Seed-dependent tests materialize the
installer’s embedded defaults in temporary directories, so their binaries also
work after the checkout they were compiled in has been removed.
GitHub Actions runs the workspace tests, lint, and Herdr mod tests on
ubuntu-latest and macos-latest for pushes and pull requests. CI reads the Rust
toolchain version from workspace.package.rust-version in Cargo.toml and uses
Node.js 24 for node --experimental-vm-modules --test herdr/mods/trk/main.test.mjs.
Releasing 0.1.0
The first public release is 0.1.0 (beta). A human performs the release after
the release changes have landed on main; agents must not create or push the tag.
-
In the release checkout, ensure
mainis up to date and the working tree is clean. Confirmworkspace.package.versioninCargo.tomlis0.1.0. -
Review CHANGELOG.md, replace the pending release date with the actual release date, and commit and land that change before tagging.
-
Run
cargo test --workspace --locked,cargo lint, andnode --experimental-vm-modules --test herdr/mods/trk/main.test.mjson the release commit. Resolve failures before proceeding. -
Finish any active trk sessions before running
./install.sh, thentrk --version. A Git checkout build printstrk 0.1.0 (<commit>), where<commit>is the build’s abbreviated Git commit (requested at 10 characters, longer if needed for uniqueness). Check that it matches the release commit. Without Git metadata, it printstrk 0.1.0. The version comes from Cargo plus the build commit, not the tag name. -
Human only: create an annotated tag on that tested commit and push it:
git tag -a v0.1.0 -m "trk 0.1.0" git push origin v0.1.0
Before installing the release, users should finish active sessions and follow the upgrade procedure.
Layout
| Crate | Role |
|---|---|
trk-core | The state machine, claims and leases, the waiting queue, query language, Store (the only writer) |
trk-agent | Agent definitions, the eight trk tools and their executor, prompt rendering, harness profiles, launch spec |
trk-mcp | The per-issue MCP server (rmcp, single-threaded Tokio) |
trk-cli | The trk binary, rendering, trk check, trk run and the launcher templates |
seed/ holds the default configuration, embedded into the binary for trk install.
herdr/ holds the Herdr mod and layout, embedded the same way.
Notes on the implementation
- Harness names: the Claude Code profile is
claude-code, matchingagent:claude-code:<id>. A harness is registered the first time one of its sessions acts. - omp (verified live): reads
<worktree>/.omp/mcp.jsonand shows MCP server instructions to the model, so no folding is needed. Its--toolsflag hides MCP tools that are not listed, so profiles use a MiniJinja loop overtrk_toolsto prefix each tool name withmcp__trk_. It keepswriteavailable even with a restricted--toolslist, sobuiltin_tools = "read-only"is not fully enforced there. - Claude Code (verified live on 2026-11-24, version 2.1.331,
--model sonnet, resolved to Sonnet 5.5): tested in throwaway Git repositories throughtrk installandtrk run, with Herdr/hcterminals. The original profile stopped at workspace trust; after approval its default auto mode did not prompt for MCP or Bash. The explicit-permission profile started in a fresh repository without manual input, received MCP server instructions, calledget_task/add_note/wait, created and edited a file, committed in its issue worktree, and landed throughtrk checkusing the seed merge recipe. Failed-check wake andtrk sendacknowledgements were verified.read-onlyandnonewere also exercised live. - Unverified harness profiles: the Codex, OpenCode and pi profiles were not run live.
- Session liveness comes from the local claim’s terminal via its pinned launcher’s
existsoperation or Herdr driver. MCP pid, host and exit metadata inactor.metareport MCP status separately, not session death. trk checklock: a row holding the pid and host of the running pass. A holder whose process is gone on this machine is replaced; a holder on another host is never replaced automatically.TRK_NOWfixes the clock, for tests.
Building the manual
The manual is built with
mdBook. Install the version pinned in
.github/workflows/pages.yml, then build or preview from the repository root:
cargo install mdbook --version 0.5.4 --locked
mdbook build
mdbook serve --open
book.toml uses docs/ as its source and docs/SUMMARY.md as its navigation.
Add new chapters to the summary; generated HTML goes in the ignored book/
directory. Use relative links between chapters and absolute GitHub URLs for
repository files outside docs/, so links work both in source and on Pages.
The Manual workflow builds pull requests, pushes to main, and manual runs.
Only builds on main deploy, using the github-pages environment. A repository
administrator must enable Settings → Pages → Build and deployment → Source:
GitHub Actions before the first deployment. No deployment branch or token
secret is required; the deploy job uses the workflow’s Pages and OIDC permissions.