[ARCHIVE] SYSTEM DOCUMENTATION

ArkTower Docs

Technical references, architecture guides, and API specifications

[DOCUMENTATION v0.1.0]

[ARCHITECTURE]

Multi-layer architecture with unified task service facade, event bus, and pluggable storage.

[EXTERNAL CONSUMERS]
Cursor (MCP) OpenClaw REST API Dashboard CLI
MCP Server
(stdio)
REST API
(FastAPI)
CLI
(Typer)
NiceGUI
Dashboard
Task Service ◄ EventBus (pub/sub)
State Machine 15 triggers × 10 states
SQLite (WAL mode) FTS5 · JSON1 · Indexes

arktower/core/

Domain models (Task, TaskStatus, Trigger), StateMachine (15 triggers × 10 states), EventBus, TaskService facade, TaskNormalizer.

DOMAIN

arktower/store/

TaskRepository protocol, SqliteTaskRepository (CRUD, FTS5, atomic claim), migration runner with 3 migrations.

PERSISTENCE

arktower/api/

FastAPI app factory, REST routes at /api/v1/*, WebSocket manager for real-time events.

HTTP

arktower/mcp/

MCP server with 12 tools, 1 resource, 2 prompts. Stdio transport for Cursor and Claude.

AI_INTEGRATION

arktower/cli/

Typer CLI with Rich output: task, pool, server, eval subcommands. JSON output mode.

TERMINAL

arktower/web/

NiceGUI dashboard with YoRHa theme, i18n (EN/ZH), dark/light toggle, pool overview, task board, analytics.

DASHBOARD
VIEW FULL ARCHITECTURE →

[API REFERENCE]

REST API endpoints, MCP tools, and WebSocket events.

Method Path Description
GET/api/v1/healthHealth check -- returns system status
POST/api/v1/tasksCreate a new task
GET/api/v1/tasksList tasks with optional filters (status, priority, tags, search)
GET/api/v1/tasks/{id}Get full details of a specific task
PATCH/api/v1/tasks/{id}Update task fields (title, description, priority, tags, etc.)
DELETE/api/v1/tasks/{id}Delete a task from the pool
POST/api/v1/tasks/{id}/advanceAdvance task via state machine trigger
POST/api/v1/tasks/{id}/claimAtomically claim a queued task for an agent
POST/api/v1/tasks/{id}/completeMark task as completed with optional output
GET/api/v1/tasks/{id}/historyGet task event history (audit trail)
GET/api/v1/pool/statsPool statistics -- counts by status, priority, queue age
GET/api/v1/pool/nextGet highest-priority queued task (capability matching)
POST/api/v1/templatesCreate a task template
GET/api/v1/templatesList all task templates
POST/api/v1/archives/{id}Archive a terminal task to JSON snapshot
WS/wsWebSocket -- real-time task lifecycle events
Tool Name Description Key Parameters
create_taskCreate a new task in the pooltitle, description, priority, tags
list_tasksList tasks with optional filtersstatus, priority, tags, limit, offset
get_taskGet full details of a tasktask_id
claim_taskClaim a queued task for an agenttask_id, agent_id
complete_taskMark a task as completedtask_id, output
search_tasksFull-text search across tasksquery, limit
get_pool_statsGet pool statistics(none)
get_next_taskGet highest-priority queued task(none)
advance_taskAdvance via state machine triggertask_id, trigger, actor, notes
fail_taskMark a task as failedtask_id, error
archive_taskArchive a terminal tasktask_id, format
create_from_templateCreate task from a templatetemplate_name, overrides

task.transition

Fired on every state machine transition. Payload includes task_id, trigger, from_status, to_status, actor.

LIFECYCLE

task.created

Fired when a new task is created. Payload includes the full task object.

CRUD

task.updated

Fired on task field updates. Payload includes task_id and changed fields.

CRUD

task.deleted

Fired when a task is removed from the pool. Payload includes task_id.

CRUD

[EVALUATION SYSTEM]

8-dimension self-benchmarking framework with weighted scoring and quality gates.

lifecycle_correctness
1.00
search_effectiveness
1.00
analysis_accuracy
1.00
archive_integrity
1.00
concurrency_safety
1.00
api_completeness
0.95
task_format_quality
0.87
dispatch_reliability
0.71
Composite Score
GATE: STANDARD (≥ 0.85) -- PASSED
0.9179
WEIGHTED AVERAGE / 8 DIMENSIONS
Dimension Weight Description
lifecycle_correctness20%State machine transitions, terminal state enforcement, audit trail
dispatch_reliability20%Lifecycle flows, atomic claims, capability matching, dependency gates
task_format_quality15%Task model completeness, agent fields, .task.md parser, normalizer
search_effectiveness10%FTS5 retrieval, tag filtering, combined filter accuracy
api_completeness10%REST endpoints, MCP tools, health check, authentication
analysis_accuracy10%Complexity scoring calibration, tag extraction recall
archive_integrity10%Snapshot roundtrip, export format correctness (JSON/NDJSON/CSV/MD)
concurrency_safety5%SQLite pragmas, atomic operations, FK enforcement
Gate Composite ≥ Coverage ≥
Relaxed0.7060%
Standard0.8580%
Strict0.9090%

[CLI REFERENCE]

All CLI commands via the arktower entry point. Powered by Typer + Rich.

arktower task
# Create a new task
arktower task create "Task title" \
  --priority high \
  --tags "python,api" \
  --description "Detailed description"

# List tasks with filters
arktower task list --status queued --priority high --json

# Show task details
arktower task show <task-id>

# Advance via trigger
arktower task advance <task-id> enqueue

# Claim a task
arktower task claim <task-id> agent-1

# Complete a task
arktower task complete <task-id> --output "Done in PR #42"

# Search tasks (FTS5)
arktower task search "authentication api"

# Delete a task
arktower task delete <task-id>
arktower pool
# View pool statistics
arktower pool stats

# Get next task for claiming
arktower pool next

# Pool stats in JSON format
arktower pool stats --json
arktower server
# Run database migrations
arktower server migrate

# Start dashboard (NiceGUI + API)
arktower server start

# API-only mode (no dashboard)
arktower server start --mode api

# MCP server for Cursor/Claude
arktower server mcp
arktower eval
# Run full evaluation
arktower eval run

# Evaluate specific dimension
arktower eval run --dimension lifecycle_correctness

# JSON output for CI/CD
arktower eval run --json

# View latest report
arktower eval report

# Validate golden tasks
arktower eval golden

[CONFIGURATION]

Integration configuration files for Cursor, NineS, and DevolaFlow.

.cursor/mcp.json
{
  "mcpServers": {
    "arktower": {
      "command": "python",
      "args": ["-m", "arktower.mcp.server"]
    }
  }
}
nines.toml
# NineS self-evaluation configuration
[project]
name = "arktower"
description = "Agent-oriented task pool system"

[eval]
command = "arktower eval run --json"
dimensions = [
  "lifecycle_correctness",
  "task_format_quality",
  "dispatch_reliability",
  "search_effectiveness",
  "api_completeness",
  "analysis_accuracy",
  "archive_integrity",
  "concurrency_safety"
]

[gates]
standard = { composite = 0.85, coverage = 80 }
strict   = { composite = 0.90, coverage = 90 }
.workflow/config.yaml
# DevolaFlow configuration
project:
  name: arktower
  type: python

quality_gates:
  relaxed:
    composite_score: 0.70
    test_coverage: 60
  standard:
    composite_score: 0.85
    test_coverage: 80
  strict:
    composite_score: 0.90
    test_coverage: 90

hooks:
  pre_commit:
    - "python -m pytest tests/ -x -q"
  post_iteration:
    - "arktower eval run"

[CHANGELOG]

v0.1.0 -- Initial Release

2026-04-14

Core System

  • • Pydantic v2 task model with 24 fields including agent capability fields
  • • 10-state lifecycle with 15 named triggers and full transition table
  • • EventBus pub/sub for lifecycle events
  • • TaskService facade with capability matching dispatch
  • • TaskNormalizer for field standardization

Storage

  • • SQLite with WAL mode, FTS5 full-text search, JSON1 extension
  • • Atomic claim operation for concurrent agent access
  • • Migration runner with 3 migration files

Interfaces

  • • FastAPI REST API with 15+ endpoints
  • • MCP server with 12 tools, 1 resource, 2 prompts
  • • Typer CLI with Rich terminal output
  • • NiceGUI dashboard with YoRHa Tower theme, i18n, dark/light mode
  • • WebSocket real-time event broadcasting

Quality

  • • 293 tests, 71%+ coverage
  • • 8-dimension self-evaluation framework (score: 0.9179)
  • • 12 golden tasks for format validation
  • • GitHub Pages site with NieR:Automata Tower aesthetic
INITIAL_RELEASE