t-minus
T-minus event coordination for multi-agent systems.
A Rust library + CLI for scheduling countdown events where agents confirm readiness before an event fires. Think of it as mission control for AI agent teams — coordinating meetings, reviews, deployments, and multi-step campaigns with quorum requirements.
The T-minus Concept
In aerospace, "T-minus 5 minutes" means an event happens 5 minutes from now. In agent coordination, T-minus means:
- An event is scheduled at a future time
- The system counts down to the "fire time" (scheduled time minus the T-minus duration)
- Agents subscribe and respond: confirm (ready), defer (need more time), or missed (no response)
- When quorum is reached (enough confirmations), the event fires
- If fire time passes without quorum, the event is missed
This is essential for multi-agent systems where you need:
- Rolling deployments — confirm all agents are healthy before switching traffic
- Code reviews — wait for N reviewers to approve before merging
- Coordinated campaigns — sequential events where B depends on A completing
- Meeting coordination — gather quorum before starting
Installation
CLI Usage
Schedule an event
# Schedule a code review in 5 minutes, needs 2 confirmations
# Schedule a deployment at a specific time
Agent responses
# Agent confirms readiness
# Agent requests a delay
Check status
# Show all pending events with live countdowns
Output:
T-4m32s meeting [a1b2c3d4-...] quorum:2/3 attendees:3
alice confirmed
bob confirmed
carol pending
Process events
# Fire events that reached quorum, mark missed events
Output:
🚀 Event a1b2c3d4-... fired! (quorum reached)
❌ Event e5f6g7h8-... missed (quorum not reached)
Campaigns (multi-step coordination)
A campaign is a sequence of events with dependencies — event B starts only after event A confirms.
# Create a deployment pipeline campaign
# Add events to the campaign
# Link dependencies: checkpoint → review → deploy
# View execution order (topological sort)
# List all campaigns
Library Usage
use ;
use ;
Core Types
| Type | Description |
|---|---|
TMinusEvent |
A countdown event with attendees, quorum, and payload |
EventKind |
Meeting, Checkpoint, Review, Deploy, or Custom(String) |
ResponseStatus |
Pending, Confirmed, Deferred(Duration), or Missed |
Campaign |
A sequence of events with dependency edges |
AgentId |
Unique agent identifier (newtype wrapper) |
TickResult |
Lists of fired and missed event IDs from processing |
Event Lifecycle
Schedule → Pending → [Confirmed | Deferred | Missed]
↓ ↓
Quorum met? Defer → extend T-minus
↓ ↓ ↓
Fire! Missed Re-pend
Campaign Execution Order
Campaigns use topological sorting to determine execution order. Events with no dependencies run first. Cycles are detected and rejected.
A ──→ B ──→ D
│ ↑
└─→ C ──────┘
Order: A → B, C (parallel) → D
Storage
Events are persisted in SQLite via rusqlite. All state survives restarts — schedule events, restart your system, and they'll still be there when you run t-minus status.
Development
# Build
# Run all 28 tests
# Run CLI locally
Architecture
src/
├── lib.rs # Re-exports
├── types.rs # Core types (TMinusEvent, Campaign, enums)
├── db.rs # SQLite persistence layer
├── engine.rs # Business logic (schedule, confirm, defer, tick)
└── main.rs # CLI with clap subcommands
tests/
└── integration.rs # 28 integration tests
License
MIT