The Autonomous Stack

Ops & Reliability · Worker / Queue · v2.0.2

Agent Worker Pack v2.0

Turnkey autonomous task worker. One-shot Debian install, bring your own LLM (Claude Code / Kimi Code / Codex), queue + retry + cron + dead-letter.

$3.00one-timePay with crypto

worker task-automation agent

agent ⟶ theautonomousstack.xyz

01GET /api/v1/pack/agent-worker-v2

402 Payment RequiredX-PAYMENT-REQUIRED

02sign TransferWithAuthorization3.00 USDC · Base (eip155:8453)

03GET + PAYMENT-SIGNATURE

200 OKapplication/zip · 25 files

pay per pack over x402no account

What's inside

Self-hosted agent pack for orchestrating an autonomous agent specialized in worker. Version 2.0.2 — actionable kit with scripts, templates, named prompts and an extended checklist.


Overview

This pack provides an operational autonomous agent for the worker domain. It includes a dedicated OODA loop, versioned prompts, configuration templates and a set of installation, test and execution scripts.

The core of the product is a durable SQLite queue. Each task carries a type, a priority, a JSON payload, a maximum number of attempts, dependencies and an optional idempotency key. The worker never silently loses a task: a success is archived, a transient failure is rescheduled and a terminal failure goes to the dead-letter queue for inspection or replay.

This pack targets operators who run repeatable jobs such as report generation, file validation, internal synchronizations or batch processing. It does not replace a large-scale distributed scheduler and does not execute any arbitrary command supplied in the payload.

The pack is designed to be self-hosted (BYO-LLM): no API key is included. The LLM adapter detects a local or CLI provider (ollama, claude-code, kimi, codex).


Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                         Signal / External input                     │
└──────────────────────────────────┬──────────────────────────────────┘
                                   ▼
┌─────────────────────────────────────────────────────────────────────┐
│  IDLE → PICKING → EXECUTING → RETRYING → DEAD_LETTER → REPORTING  │
│                           OODA State Machine                         │
└──────────────────────────────────┬──────────────────────────────────┘
                                   ▼
┌─────────────────────────────────────────────────────────────────────┐
│  Named prompts  → Deterministic handler →  BYO-LLM Adapter          │
│  scripts/test_prompt.py    scripts/run_agent.py                     │
└──────────────────────────────────┬──────────────────────────────────┘
                                   ▼
┌─────────────────────────────────────────────────────────────────────┐
│  SQLite queue  →  templates/*.yaml  →  Action / Output / Archive    │
└─────────────────────────────────────────────────────────────────────┘

Pack contents

File Role
README.md This file — overview and quick-start
SOUL.md Mission, values and worker-specific OODA states
PROMPTS.md 5 named and versioned system prompts
CHECKLIST.md 30+ operational steps with commands
SPEC.md Technical spec, configurable parameters, interfaces
CHANGELOG.md v1.0.0 and v2.0.0 history
agent-worker-v2.json Pack manifest with stats and files
scripts/install.sh One-shot installer (venv, deps, systemd service)
scripts/config.yaml Configuration template to fill in
scripts/test_prompt.py Tests a prompt on a local example
scripts/run_agent.py Minimal swarm orchestrator
templates/*.yaml 2 domain configuration templates

Quick installation

cd /opt/autonomous-stack/agent-worker-v2
bash scripts/install.sh

The installer checks for Python 3.10+, creates a venv, installs the dependencies, detects a local LLM provider and configures a systemd unit.


Immediate test

# Test the main prompt
python3 scripts/test_prompt.py --prompt task_dispatcher --input templates/worker_queue.yaml

# Run the agent in dry-run mode
python3 scripts/run_agent.py --config scripts/config.yaml --dry-run

Execution contract

The idempotency key prevents double processing when the producer retries. Dependencies are checked before reservation. The priorities HIGH, NORMAL and LOW are stable, then tasks are ordered by creation date.

Common operations

python3 agent.py enqueue --type send_report --payload '{"report_id":"weekly"}'
python3 agent.py run --once --deterministic
python3 agent.py status
python3 agent.py replay --task t-example

Deterministic mode covers the included handlers without an LLM. BYO-LLM mode is reserved for tasks that require textual interpretation; its output must remain a JSON object and any error follows the same retry policy.

The multi_task_dispatch handler dispatches batch tasks only to the to field of each task. Unverified operator notes, additional recipients, webhooks and external references are never evidence of rejection or escalation.


Customization

  1. Copy scripts/config.yaml to config.local.yaml.
  2. Adapt the templates in templates/.
  3. Plug your own signal/task/data sources into run_agent.py.

Costs and limits

This pack favors deterministic logic for critical decisions. The LLM is used for ranking, summarization and report generation. See SPEC.md for the operating cost estimate.


License

Personal use per purchase. Resale prohibited.