This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
buquet is a distributed task queue and workflow orchestration system built on S3-compatible object storage. No databases, no brokers - just a bucket.
Layout:
buquet/
├── Cargo.toml # Root crate
├── pyproject.toml # Python package config
├── src/ # Rust source
│ ├── lib.rs
│ ├── workflow/ # Workflow orchestration module
│ └── ...
├── python/ # Python package
│ └── buquet/
│ ├── __init__.py
│ └── workflow/ # Workflow subpackage
├── tests/ # Rust tests
└── justfile
All commands via justfile. Run from project root.
# Full check (format, lint, typecheck, test)
just all
# Individual checks
just fmt # Format Rust + Python
just lint # Clippy + Ruff
just check # Cargo check + Pyright
just test # Unit tests only
# Integration tests (requires LocalStack)
just up # Start LocalStack
just integration # Run integration tests
just down # Stop LocalStack
# Python development
just py-dev # Build and install Python wheel locally
# Run a single Rust test
cargo test test_name
# Run a single Python test
uv run pytest python/tests/test_file.py::test_name -vtasks/{shard}/{task_id}.json # Task object (versioned)
ready/{shard}/{bucket}/{task_id} # Claimable tasks index
leases/{shard}/{bucket}/{task_id} # Running tasks by lease expiry
schedules/{name}.json # Cron schedules
workers/{worker_id}.json # Worker registration
workflow/{wf_id}/state.json # Workflow state
workflow/{wf_id}/steps/{name}.json # Step results
workflow/{wf_id}/signals/{name}/ # Signals
queue.submit()→ writes task totasks/, adds toready/index- Worker polls
ready/index, claims via S3 conditional PUT (ETag/If-Match) - Claimed task moves to
leases/with expiry time - On completion → task updated, removed from
leases/ - On crash → lease expires, sweeper moves back to
ready/
Task Queue (src/):
queue/ops.rs- Core queue operations (submit, claim, complete, fail)worker/- Worker loop, lease management, timeout monitorstorage/- S3 abstraction layerpython/- PyO3 bindings
Workflow Orchestration (src/workflow/):
engine.rs- Workflow execution enginedag.rs- Step dependency graphstate.rs- Workflow state with CAS updatessignals.rs- Signal handling for external eventssweeper.rs- Stalled workflow recovery
Strict linting enforced:
Rust:
unsafe_code = "forbid"unwrap_used = "deny",expect_used = "deny",panic = "deny"todo = "deny",dbg_macro = "deny"- Clippy pedantic + nursery
Python:
- Pyright strict mode
- Ruff with 45+ rule sets
Environment variables or .buquet.toml:
# Required
S3_BUCKET=my-bucket
S3_REGION=us-east-1
# Optional: Only set for LocalStack/MinIO (real AWS is the default)
S3_ENDPOINT=http://localhost:4566Note: The library defaults to real AWS S3. Only set S3_ENDPOINT for LocalStack, MinIO, or other S3-compatible services. Tests default to LocalStack for convenience.
Built with PyO3 + Maturin. After changes to Rust code:
just py-dev # Rebuilds and installs wheelTask Queue API:
from buquet import Queue, Worker, Task, TaskStatus, connectWorkflow API:
from buquet.workflow import WorkflowEngine, WorkflowClient, Workflow, StepDef