Expand description
Ball: git-native task tracker for parallel agent workflows.
Tasks are JSON files committed to your repo. Worktrees provide isolation. Git provides sync, history, and collaboration. There is no database, no daemon, no external service.
§Library usage
use balls::{Store, Task};
use std::env;
let store = Store::discover(&env::current_dir().unwrap()).unwrap();
let tasks = store.all_tasks().unwrap();
for t in balls::ready::ready_queue(&tasks) {
println!("[P{}] {} {}", t.priority, t.id, t.title);
}Re-exports§
pub use config::Config;pub use error::BallError;pub use error::Result;pub use store::Store;pub use task::validate_id;pub use task::ArchivedChild;pub use task::Link;pub use task::LinkType;pub use task::NewTaskOpts;pub use task::Note;pub use task::Status;pub use task::Task;pub use task::TaskType;
Modules§
- archive_
recovery - Recover closed/archived tasks from the state branch’s git history.
- archived_
child ArchivedChild— the snapshot a parent task carries for each closed descendant. Lives in its own module to keeptask.rsunder the 300-line cap and to localize the forward-compat catch-all.- bare_
squash - Squash-merge a work branch into main even when
store.rootis a bare gitdir. Non-bare roots run the squash directly. Bare roots cannot host working-tree-required commands (git merge --squashrefuses with “this operation must be run in a work tree”), so we provision an ephemeral detached worktree at<root>/.balls/local/ squash-<pid>, do the squash there, and updaterefs/heads/<main>from the bare gitdir afterward. See bl-56f4: bare repos with linked.balls-worktrees/checkouts are a designed-for layout, but the direct-squash code path silently broke them. - claim_
push - State-branch push: remote resolution and outcome classification.
- claim_
sync - Git-remote
Protocolimpl for state-branch lifecycle pushes. - commit_
msg - Format a review-time commit message in the standard git 50/72
shape: a single title line with the delivery tag appended, a blank
line, then the optional body. Keeps
git log --onelinereadable. - commit_
policy - Apply-time composition for
CommitPolicyoutcomes. SPEC §10. - config
- delivery
- Delivery-link resolution (SPEC §6).
- display
- CLI display primitives: colors, glyphs, badges, tree prefixes.
- doctor
bl doctor: read-only drift diagnostics.- error
- git
- git_
merge - Merge and conflict helpers split out of
git.rs. These are the git operations that classify a merge’s outcome (clean / up-to-date / conflict) and inspect in-progress conflict state — a cohesive slice of the otherwise-flat git wrapper surface. Re-exported fromgitso call sites keep usinggit::git_mergeetc. - git_
state - Git plumbing for the state branch topology: orphan branch creation,
remote-tracking setup, and worktree attachment for an existing branch.
Separate from
git.rsso that module stays under the 300-line cap. - human_
gate - Human-gate participant: stages negotiation outcomes for operator review instead of applying them immediately. SPEC §9 gating policy materialized for the sync event (bl-a46d).
- link
- Typed relationships between tasks:
LinkandLinkType. - min_
version - Advisory
min_bl_versioncheck (SPEC §5 / §10). - negotiation
- Lifecycle-sync negotiation primitive.
- participant
- Lifecycle-sync participants. SPEC §3, §5–§7.
- participant_
config - SPEC §11 — per-event participant policy with layered config resolution.
- plugin
- policy
- Effective claim-policy resolution. Layers, lowest precedence first:
- progress
- Epic completion bar: 10-cell block with closed/total and percent.
- ready
- remaster
bl remasterreconcile/detach core (bl-2057).- render_
list - Grouped/nested/glyphed rendering for
bl list. - render_
ready - Single-status (always open) ready-queue rendering.
- render_
show - Rich rendering for
bl show. - render_
show_ relations - The relations block of
bl show: deps (with inline statuses), gates, other links, parent, children + completion, delivered, branch, repo, and external-remote rows. - render_
show_ text - Text helpers for
render_show: relative timestamps and paragraph word-wrap. Split out sorender_show.rsstays under the 300-line cap while keeping the helpers testable in isolation. - resolve
- review
- Review, close, and archive — the submit side of the task lifecycle.
Lives alongside
worktree.rs(claim/drop/orphans) but kept separate so neither file hits the 300-line cap. - review_
deferred - Deferred-mode
bl review(SPEC §7.2). - review_
safety - Safety rails around
bl review’s integration-branch mutation. - sanitize
- Neutralize terminal control sequences in externally-influenced text.
- status
- store
- sync_
resolve - Shared post-merge auto-resolution. Both
bl syncand the claim-time push-retry loop need to take a state-worktree mid-merge and resolve.balls/tasks/*.jsonconflicts via the field-level merge inresolve.rs. Notes sidecars are handled by git’s union merge driver everywhere except delete/modify, which surfaces here. - task
- task_id
- Unique task-id minting.
SHA1(title + timestamp)truncated to the repo’s configured id length, retried with a stepped timestamp on collision. The single home for id generation: bothbl createand deferred-modebl review’s auto-gate child mint ids through here, so there is no second copy of the retry loop to drift. - task_io
- Task file I/O. Separated from
task.rsto keep that file under the 300-line cap and to localize the on-disk format in one place. - task_
type TaskType— a free-form, identifier-safe label attached to each task. Types are pure labels: nothing in balls branches on the value except “is thisepic?” (which drives progress/display). Widening the vocabulary therefore lives here, not in call sites.- task_
validate - Task ID and priority validation. Split out of
task.rsfor the same reasontask_io.rsis — that file stays focused on type definitions while behavior lives in its own module — and to keep both under the 300-line cap. Re-exported fromtaskso call sites keep importingcrate::task::{validate_id, ...}unchanged. - tree
- Parent-edge tree rendering for
bl dep tree. - worktree
- Worktree scaffolding: claim, drop, and orphan cleanup. The submit
side (review, close, archive) lives in
review.rsto keep both files under the 300-line cap. - worktree_
teardown - Teardown paths split out of
worktree.rs: releasing a claim (drop_no_worktree/drop_worktree) and sweeping stale claim files + dangling worktrees (cleanup_orphans). The claim/create side stays inworktree.rs; both share only the lock and path helpers, re-exported here fromworktree.