Technical Architecture

Queue v3.1

Distributed AI Operating System

Created: March 18, 2026 Version: 3.1.0 Status: Production

Executive Summary

Queue v3.1 is not an "agent system" — it's a distributed AI operating system. The key difference: agents don't self-certify their work. An independent verifier checks every output before it counts as complete.

The Core Principle

Verifier = Source of Truth
Agents = Execution Only

What Changed from v2

v2 (Old Approach)

Agent receives task → Agent does work → Agent says "done" → System trusts it

Problems:

v3.1 (New Approach)

Agent receives task → Agent does work → Receipt with hash → 
INDEPENDENT VERIFIER checks → Only then: verified

Improvements:

7-Stage Workflow

The pipeline is STRICT — no skipping allowed.

┌─────────────────────────────────────────────────────────────────┐ │ 7-STAGE PIPELINE │ ├─────────────────────────────────────────────────────────────────┤ │ │ │ 1. research_synthesis → Gather data, analyze, synthesize │ │ ↓ │ │ 2. structural_review → Validate structure, check sections │ │ ↓ │ │ 3. brand_polish → Apply brand voice, polish content │ │ ↓ │ │ 4. ops_validation → Operational accuracy check │ │ ↓ │ │ 5. render_pdf → Generate final PDF artifact │ │ ↓ │ │ 6. verify_output → INDEPENDENT verification (3 layers) │ │ ↓ │ │ 7. deliver_telegram → Deliver with confirmation │ │ │ └─────────────────────────────────────────────────────────────────┘

Rule: If ANY stage is skipped → job = INVALID

Stage Assignment

StageAgentCapabilities Required
research_synthesisAliceresearch.web, research.analysis
structural_reviewBoltcontent.editing, verify.structure
brand_polishBoltcontent.writing, brand.voice
ops_validationBobbyops.validation
render_pdfRenderercontent.design, content.pdf_generation
verify_outputVerifierverify.content, verify.technical
deliver_telegramBobbycomms.telegram

3-Layer Verification System

Layer 1: Structural Validation

Checks receipt has all required fields, stage sequence is valid, artifacts are present.

Failure → RETRY

Layer 2: Integrity Validation

Verifies hash chain (input_hash = previous output_hash), all artifacts exist on disk, artifact hashes match, no corrupted files.

Failure → RETRY

Layer 3: Quality + Policy Validation

Confidence meets threshold (default: 0.80), quality score meets threshold (default: 70), no self-verification, required agents participated, acceptance criteria met.

Failure → ESCALATE (if high confidence) or RETRY (if low confidence)

Verification Decisions

DecisionConditionAction
passAll 3 layers passMark verified, proceed to next stage
retryLayer 1 or 2 fail, or low confidenceRoute back to agent with feedback
failPolicy violation, unrecoverableMark failed, notify human
escalateQuality issue with high confidenceNotify KJ for human review

Hash-Chained Receipts

Each receipt contains:

This creates an immutable chain proving data integrity through the pipeline.

Example Chain

Stage 0 (research_synthesis):
  input_hash:  null (first stage)
  output_hash: 978d2db1bda39957...

Stage 1 (structural_review):
  input_hash:  978d2db1bda39957...  ← Must match Stage 0 output
  output_hash: e47faacc674adc23...

Stage 2 (brand_polish):
  input_hash:  e47faacc674adc23...  ← Must match Stage 1 output
  output_hash: d9af6735f71a90c2...

...and so on through all 7 stages

Why It Matters

  1. Tamper evidence — If any stage's data changes, hash breaks
  2. Provenance — Can trace every output back to source
  3. Audit trail — Mathematical proof of what happened
  4. Trust — No agent can fake their output

Weighted Routing

When routing a stage to an agent, the system calculates a score:

Score = (Capability Match × 0.40) +
        (Success Rate × 0.30) +
        (Quality Score × 0.20) +
        (Load Balance × 0.10)

Factors

FactorWeightDescription
Capability Match40%Does agent have required capabilities? (0 or 1)
Success Rate30%Historical success % for this job type
Quality Score20%Average quality score on completed jobs
Load Balance10%Inverse of current load (prefer less loaded)

Concurrency Control

The Problem

Two agents try to claim the same job at the same time. Both think they got it. Double execution.

The Solution: Claim Locks

UPDATE jobs 
SET status = 'claimed', claimed_by = ?, claimed_at = ?
WHERE id = ? AND status = 'dispatched'

Only ONE agent wins this race. The others get 0 rows affected.

Completion Definition

A job is COMPLETE only when:

Nothing Else Counts

No shortcuts. No fake completions. No trust without verification.

Running Services

ServiceEndpointLaunchAgent
Queue APIhttp://localhost:3334com.ftws.queue-v3
Verifier APIhttp://localhost:3335com.ftws.verifier

Auth Token: q3-v3-axon-fleet-2026

API Reference

Key Endpoints

MethodEndpointPurpose
GET/healthService status
POST/jobsCreate new job
GET/jobsList jobs (with filters)
GET/jobs/:idGet job details + stages
PUT/jobs/:id/stateUpdate job state
POST/jobs/:id/claimClaim job (concurrency lock)
POST/receiptsCreate receipt (submit work)
GET/receipts/:idGet receipt details
POST/verificationsCreate verification
GET/agentsList agents
GET/audit/:job_idGet audit log

Example: Create Job

curl -X POST http://localhost:3334/jobs \
  -H "Authorization: Bearer q3-v3-axon-fleet-2026" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "report",
    "priority": 7,
    "from": "dispatcher",
    "subject": "Q1 Marketing Report",
    "body": "Generate Q1 marketing performance report",
    "acceptance_criteria": {
      "output_format": "pdf",
      "required_sections": ["executive_summary", "recommendations"],
      "min_confidence": 0.85,
      "min_quality_score": 75
    }
  }'

Summary

Queue v3.1 transforms the FTWS agent fleet from a loose collection of workers into a coordinated, verified, audited operating system.

This is the foundation for scaling to government contracts and enterprise clients.