# robson

Rust async agent orchestrator that automates the full lifecycle from Jira task to code review:

```
Jira task → SQLite → branch → Claude Code → PR → Jira comment → Slack notification
```

## System Dependencies

The `git2` crate requires libgit2 and libssh2 C libraries at build time.

### Debian / Ubuntu

```bash
sudo apt-get install -y pkg-config libssl-dev cmake libssh2-1-dev libgit2-dev
```

### Alpine

```bash
apk add --no-cache pkgconf openssl-dev cmake libssh2-dev libgit2-dev musl-dev gcc
```

### Fedora / RHEL

```bash
sudo dnf install -y pkgconfig openssl-devel cmake libssh2-devel libgit2-devel
```

## Build

```bash
cargo build --release
```

## Usage

```bash
# Create a task
cargo robson task create --key PROJ-123 --summary "Fix bug" --description "Details" --repo-url "git://github.com/org/repo"

# Process pending tasks
cargo robson run

# Run a single task
cargo robson run-task PROJ-123

# Start webhook server
cargo robson server
```

## Configuration

```bash
cp robson.example.toml robson.toml
```

See `docs/spec.md` for the full specification.

## Tests

```bash
cargo test
```

## Publishing to crates.io

All workspace crates share a single version in `[workspace.package]` at the root `Cargo.toml`. Internal `robson-*` dependency versions are kept in sync via `make sync-workspace-versions` (also run automatically by `make bump-version` and before publish).

Install [cargo-workspaces](https://crates.io/crates/cargo-workspaces) (required for publish targets):

```bash
cargo install cargo-workspaces --locked --version 0.4.2
```

Set your API token (create one at https://crates.io/settings/tokens):

```bash
export CARGO_REGISTRY_TOKEN=...
```

Inspect publish order (dependency graph):

```bash
make publish-plan
```

Validate packaging without uploading (`cargo ws publish --dry-run` for all crates in dependency order):

```bash
make publish-dry-run
```

### Manual release (bump + publish)

```bash
make publish VERSION=0.2.0
```

### Tag-driven release

```bash
make bump-version VERSION=0.2.0
git commit -am "chore: release v0.2.0"
git tag v0.2.0
make publish-tag
```

`publish-tag` requires HEAD to be tagged and the tag version (without `v` prefix) to match the workspace version in `Cargo.toml`.

To publish the current workspace version without bumping (e.g. retry after a failed publish):

```bash
make publish
```

### Rate limits (first-time publish)

crates.io allows a **burst of 5 new crates**, then **1 new crate every 10 minutes**. Publishing all 17 crates the first time takes about **2 hours**.

If you hit `429 Too Many Requests`, **do not run `make publish` again** (it re-runs clippy/tests). Wait until the time in the error message, then:

```bash
make publish-resume
```

This skips crates already on crates.io and continues publishing the rest without re-running pre-flight checks.

For slow first-time publishes, you can increase the delay between crates:

```bash
make publish PUBLISH_INTERVAL=600
```
