@miller-tech/uap 1.8.1 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +285 -642
- package/config/chat_template.jinja +76 -0
- package/config/lora-finetune.yaml +82 -0
- package/config/model-profiles/claude-haiku-3.5.json +62 -0
- package/config/model-profiles/claude-opus-4.6.json +63 -0
- package/config/model-profiles/claude-sonnet-4.6.json +63 -0
- package/config/model-profiles/gemini-2.5-flash.json +62 -0
- package/config/model-profiles/gemini-2.5-pro.json +62 -0
- package/config/model-profiles/generic.json +54 -0
- package/config/model-profiles/glm-5.json +61 -0
- package/config/model-profiles/gpt-4.1.json +64 -0
- package/config/model-profiles/gpt-4o.json +64 -0
- package/config/model-profiles/gpt-o3.json +61 -0
- package/config/model-profiles/kimi-k2.5.json +70 -0
- package/config/model-profiles/llama.json +86 -0
- package/config/model-profiles/qwen35.json +218 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/bin/cli.js +78 -9
- package/dist/bin/cli.js.map +1 -1
- package/dist/bin/llama-server-optimize.js +0 -10
- package/dist/bin/llama-server-optimize.js.map +1 -1
- package/dist/bin/policy.js +11 -195
- package/dist/bin/policy.js.map +1 -1
- package/dist/cli/dashboard.d.ts.map +1 -1
- package/dist/cli/dashboard.js +14 -14
- package/dist/cli/dashboard.js.map +1 -1
- package/dist/cli/generate.d.ts +0 -7
- package/dist/cli/generate.d.ts.map +1 -1
- package/dist/cli/generate.js +10 -22
- package/dist/cli/generate.js.map +1 -1
- package/dist/cli/hooks.d.ts +1 -1
- package/dist/cli/hooks.d.ts.map +1 -1
- package/dist/cli/hooks.js +371 -0
- package/dist/cli/hooks.js.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +120 -3
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/memory.d.ts.map +1 -1
- package/dist/cli/memory.js +43 -109
- package/dist/cli/memory.js.map +1 -1
- package/dist/cli/model.d.ts.map +1 -1
- package/dist/cli/model.js +8 -25
- package/dist/cli/model.js.map +1 -1
- package/dist/cli/patterns.d.ts.map +1 -1
- package/dist/cli/patterns.js +11 -9
- package/dist/cli/patterns.js.map +1 -1
- package/dist/cli/policy.d.ts.map +1 -1
- package/dist/cli/policy.js +165 -1
- package/dist/cli/policy.js.map +1 -1
- package/dist/cli/rtk-validation.d.ts +0 -4
- package/dist/cli/rtk-validation.d.ts.map +1 -1
- package/dist/cli/rtk-validation.js +5 -23
- package/dist/cli/rtk-validation.js.map +1 -1
- package/dist/cli/schema-diff.d.ts.map +1 -1
- package/dist/cli/schema-diff.js +25 -16
- package/dist/cli/schema-diff.js.map +1 -1
- package/dist/cli/setup-wizard.d.ts.map +1 -1
- package/dist/cli/setup-wizard.js +13 -9
- package/dist/cli/setup-wizard.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +3 -4
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/visualize.d.ts +6 -13
- package/dist/cli/visualize.d.ts.map +1 -1
- package/dist/cli/visualize.js +35 -64
- package/dist/cli/visualize.js.map +1 -1
- package/dist/cli/worktree.d.ts.map +1 -1
- package/dist/cli/worktree.js +12 -13
- package/dist/cli/worktree.js.map +1 -1
- package/dist/coordination/adaptive-patterns.d.ts.map +1 -1
- package/dist/coordination/adaptive-patterns.js +7 -3
- package/dist/coordination/adaptive-patterns.js.map +1 -1
- package/dist/coordination/deploy-batcher.d.ts.map +1 -1
- package/dist/coordination/deploy-batcher.js +8 -8
- package/dist/coordination/deploy-batcher.js.map +1 -1
- package/dist/dashboard/data-service.d.ts.map +1 -1
- package/dist/dashboard/data-service.js +12 -13
- package/dist/dashboard/data-service.js.map +1 -1
- package/dist/dashboard/server.d.ts.map +1 -1
- package/dist/dashboard/server.js +23 -8
- package/dist/dashboard/server.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp-router/executor/client.d.ts +0 -6
- package/dist/mcp-router/executor/client.d.ts.map +1 -1
- package/dist/mcp-router/executor/client.js +1 -27
- package/dist/mcp-router/executor/client.js.map +1 -1
- package/dist/mcp-router/index.d.ts +1 -1
- package/dist/mcp-router/index.d.ts.map +1 -1
- package/dist/mcp-router/index.js.map +1 -1
- package/dist/mcp-router/output-compressor.js +114 -112
- package/dist/mcp-router/output-compressor.js.map +1 -1
- package/dist/mcp-router/types.d.ts +0 -5
- package/dist/mcp-router/types.d.ts.map +1 -1
- package/dist/memory/backends/github.d.ts.map +1 -1
- package/dist/memory/backends/github.js +21 -13
- package/dist/memory/backends/github.js.map +1 -1
- package/dist/memory/context-pruner.d.ts +2 -9
- package/dist/memory/context-pruner.d.ts.map +1 -1
- package/dist/memory/context-pruner.js +5 -22
- package/dist/memory/context-pruner.js.map +1 -1
- package/dist/memory/correction-propagator.d.ts.map +1 -1
- package/dist/memory/correction-propagator.js +19 -19
- package/dist/memory/correction-propagator.js.map +1 -1
- package/dist/memory/dynamic-retrieval.d.ts.map +1 -1
- package/dist/memory/dynamic-retrieval.js +263 -132
- package/dist/memory/dynamic-retrieval.js.map +1 -1
- package/dist/memory/embeddings.d.ts.map +1 -1
- package/dist/memory/embeddings.js +2 -15
- package/dist/memory/embeddings.js.map +1 -1
- package/dist/memory/hierarchical-memory.d.ts.map +1 -1
- package/dist/memory/hierarchical-memory.js +6 -0
- package/dist/memory/hierarchical-memory.js.map +1 -1
- package/dist/memory/knowledge-graph.d.ts.map +1 -1
- package/dist/memory/knowledge-graph.js +2 -1
- package/dist/memory/knowledge-graph.js.map +1 -1
- package/dist/memory/memory-consolidator.d.ts +1 -0
- package/dist/memory/memory-consolidator.d.ts.map +1 -1
- package/dist/memory/memory-consolidator.js +27 -3
- package/dist/memory/memory-consolidator.js.map +1 -1
- package/dist/memory/predictive-memory.d.ts +9 -1
- package/dist/memory/predictive-memory.d.ts.map +1 -1
- package/dist/memory/predictive-memory.js +77 -1
- package/dist/memory/predictive-memory.js.map +1 -1
- package/dist/memory/serverless-qdrant.d.ts +1 -0
- package/dist/memory/serverless-qdrant.d.ts.map +1 -1
- package/dist/memory/serverless-qdrant.js +3 -9
- package/dist/memory/serverless-qdrant.js.map +1 -1
- package/dist/memory/short-term/schema.d.ts.map +1 -1
- package/dist/memory/short-term/schema.js +44 -6
- package/dist/memory/short-term/schema.js.map +1 -1
- package/dist/memory/short-term/sqlite.d.ts +4 -3
- package/dist/memory/short-term/sqlite.d.ts.map +1 -1
- package/dist/memory/short-term/sqlite.js +3 -12
- package/dist/memory/short-term/sqlite.js.map +1 -1
- package/dist/memory/speculative-cache.js +2 -2
- package/dist/memory/speculative-cache.js.map +1 -1
- package/dist/models/executor.d.ts +21 -0
- package/dist/models/executor.d.ts.map +1 -1
- package/dist/models/executor.js +116 -4
- package/dist/models/executor.js.map +1 -1
- package/dist/models/planner.d.ts +1 -0
- package/dist/models/planner.d.ts.map +1 -1
- package/dist/models/planner.js +13 -1
- package/dist/models/planner.js.map +1 -1
- package/dist/policies/enforced-tool-router.d.ts +3 -1
- package/dist/policies/enforced-tool-router.d.ts.map +1 -1
- package/dist/policies/enforced-tool-router.js.map +1 -1
- package/dist/tasks/service.d.ts +1 -0
- package/dist/tasks/service.d.ts.map +1 -1
- package/dist/tasks/service.js +10 -6
- package/dist/tasks/service.js.map +1 -1
- package/dist/telemetry/session-telemetry.d.ts.map +1 -1
- package/dist/telemetry/session-telemetry.js +73 -17
- package/dist/telemetry/session-telemetry.js.map +1 -1
- package/dist/types/config.d.ts +377 -263
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +13 -67
- package/dist/types/config.js.map +1 -1
- package/dist/utils/config-loader.d.ts +34 -0
- package/dist/utils/config-loader.d.ts.map +1 -0
- package/dist/utils/config-loader.js +93 -0
- package/dist/utils/config-loader.js.map +1 -0
- package/dist/utils/lazy-imports.d.ts +18 -0
- package/dist/utils/lazy-imports.d.ts.map +1 -0
- package/dist/utils/lazy-imports.js +39 -0
- package/dist/utils/lazy-imports.js.map +1 -0
- package/dist/utils/stopwords.d.ts +12 -0
- package/dist/utils/stopwords.d.ts.map +1 -0
- package/dist/utils/stopwords.js +196 -0
- package/dist/utils/stopwords.js.map +1 -0
- package/dist/utils/string-similarity.d.ts +10 -3
- package/dist/utils/string-similarity.d.ts.map +1 -1
- package/dist/utils/string-similarity.js +49 -25
- package/dist/utils/string-similarity.js.map +1 -1
- package/docs/INDEX.md +35 -34
- package/package.json +13 -14
- package/scripts/maintenance/publish-npm.sh +82 -0
- package/scripts/maintenance/publish.sh +29 -0
- package/scripts/maintenance/update-droids.py +93 -0
- package/scripts/maintenance/update-skills.py +148 -0
- package/scripts/maintenance/update-uap-compliance.sh +45 -0
- package/scripts/maintenance/validate-skills.py +83 -0
- package/scripts/maintenance/verify-compliance.sh +117 -0
- package/scripts/setup/install-cloakbrowser.ts +14 -0
- package/scripts/setup/install-desktop.sh +105 -0
- package/scripts/setup/install-rtk.sh +184 -0
- package/scripts/setup/install-web.sh +73 -0
- package/scripts/setup/setup.sh +375 -0
- package/scripts/validate-build.sh +62 -0
- package/scripts/version-bump.sh +130 -0
- package/tools/agents/scripts/migrate_memory_to_qdrant.py +1 -1
- /package/docs/{BENCHMARK_GAPS_AND_PLAN.md → archive/BENCHMARK_GAPS_AND_PLAN.md} +0 -0
- /package/docs/{MODEL_ROUTING_IMPLEMENTATION_SUMMARY.md → archive/MODEL_ROUTING_IMPLEMENTATION_SUMMARY.md} +0 -0
- /package/docs/{MODEL_ROUTING_OPTIMIZATION_PLAN.md → archive/MODEL_ROUTING_OPTIMIZATION_PLAN.md} +0 -0
- /package/docs/{PARALLELISM_GAPS_AND_OPTIONS.md → archive/PARALLELISM_GAPS_AND_OPTIONS.md} +0 -0
- /package/docs/{POLICY_GATE_IMPLEMENTATION.md → archive/POLICY_GATE_IMPLEMENTATION.md} +0 -0
- /package/docs/{UAP_OPTIMIZATION_PLAN.md → archive/UAP_OPTIMIZATION_PLAN.md} +0 -0
- /package/docs/{opencode-integration-guide.md → archive/opencode-integration-guide.md} +0 -0
- /package/docs/{opencode-integration-quickref.md → archive/opencode-integration-quickref.md} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Universal Agent Protocol (UAP)
|
|
1
|
+
# Universal Agent Protocol (UAP)
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@miller-tech/uap)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
6
|
<div align="center">
|
|
@@ -9,16 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
**Every lesson, every pattern, every memory preserved across sessions.**
|
|
11
11
|
|
|
12
|
-
_Not just in one conversation -- but forever._
|
|
13
|
-
|
|
14
12
|
</div>
|
|
15
13
|
|
|
16
14
|
---
|
|
17
15
|
|
|
18
|
-
## Quick Start
|
|
16
|
+
## Quick Start
|
|
19
17
|
|
|
20
18
|
```bash
|
|
21
|
-
npm install -g
|
|
19
|
+
npm install -g @miller-tech/uap
|
|
22
20
|
cd your-project
|
|
23
21
|
uap init
|
|
24
22
|
uap setup -p all
|
|
@@ -29,57 +27,51 @@ uap setup -p all
|
|
|
29
27
|
## Table of Contents
|
|
30
28
|
|
|
31
29
|
- [Feature Overview](#feature-overview)
|
|
32
|
-
- [Memory System](#
|
|
33
|
-
- [Multi-Agent Coordination](#
|
|
34
|
-
- [Deploy Batching](#
|
|
35
|
-
- [Policy Enforcement](#
|
|
36
|
-
- [Browser Automation](#
|
|
37
|
-
- [MCP Router](#
|
|
38
|
-
- [Multi-Model Architecture](#
|
|
39
|
-
- [Pattern System](#
|
|
40
|
-
- [Droids and Skills](#
|
|
41
|
-
- [Task Management](#
|
|
42
|
-
- [Worktree System](#
|
|
43
|
-
- [Hooks System](#
|
|
44
|
-
- [CLI Reference](#
|
|
45
|
-
- [Benchmarking](#14-benchmarking-system)
|
|
46
|
-
- [Qwen3.5 / Local LLM](#15-qwen35--local-llm-optimization)
|
|
47
|
-
- [RTK Token Compression](#16-rtk-rust-token-killer)
|
|
48
|
-
- [Platform Integrations](#17-platform-integrations)
|
|
49
|
-
- [Harness Feature Matrix](#18-harness-feature-matrix)
|
|
50
|
-
- [Guardrails](#guardrails)
|
|
51
|
-
- [Scaling Guide](#scaling-more-devs-more-agents)
|
|
30
|
+
- [Memory System](#memory-system)
|
|
31
|
+
- [Multi-Agent Coordination](#multi-agent-coordination)
|
|
32
|
+
- [Deploy Batching](#deploy-batching)
|
|
33
|
+
- [Policy Enforcement](#policy-enforcement)
|
|
34
|
+
- [Browser Automation](#browser-automation)
|
|
35
|
+
- [MCP Router](#mcp-router)
|
|
36
|
+
- [Multi-Model Architecture](#multi-model-architecture)
|
|
37
|
+
- [Pattern System](#pattern-system)
|
|
38
|
+
- [Droids and Skills](#droids--skills)
|
|
39
|
+
- [Task Management](#task-management)
|
|
40
|
+
- [Worktree System](#worktree-system)
|
|
41
|
+
- [Hooks System](#hooks-system)
|
|
42
|
+
- [CLI Reference](#cli-reference)
|
|
52
43
|
- [Configuration](#configuration)
|
|
53
44
|
- [Testing](#testing--quality)
|
|
45
|
+
- [Requirements](#requirements)
|
|
54
46
|
|
|
55
47
|
---
|
|
56
48
|
|
|
57
49
|
## Feature Overview
|
|
58
50
|
|
|
59
|
-
| Category | Components
|
|
60
|
-
| ------------------ |
|
|
61
|
-
| Memory |
|
|
62
|
-
| Coordination |
|
|
63
|
-
| Deploy Batching | 1 module
|
|
64
|
-
| Policy Enforcement |
|
|
65
|
-
| Browser | 1 module
|
|
66
|
-
| MCP Router |
|
|
67
|
-
| Models |
|
|
68
|
-
| Patterns |
|
|
69
|
-
| Droids | 8
|
|
70
|
-
| Skills |
|
|
71
|
-
| Tasks |
|
|
72
|
-
| Worktrees | 1 module
|
|
73
|
-
| Hooks | 2 hooks
|
|
74
|
-
| CLI |
|
|
75
|
-
| Benchmarks |
|
|
76
|
-
| LLM Optimization | 5
|
|
77
|
-
| RTK | 1 module
|
|
78
|
-
| Platforms |
|
|
51
|
+
| Category | Components | Purpose |
|
|
52
|
+
| ------------------ | -------------- | -------------------------------------------------------------------------------- |
|
|
53
|
+
| Memory | 27 modules | 4-layer persistent memory with embeddings, knowledge graph, hierarchical tiering |
|
|
54
|
+
| Coordination | 8 modules | Multi-agent lifecycle, work claims, messaging, overlap detection |
|
|
55
|
+
| Deploy Batching | 1 module | Squash, merge, parallelize deploy actions across agents |
|
|
56
|
+
| Policy Enforcement | 8 modules | Store, evaluate, and enforce operational policies with audit trail |
|
|
57
|
+
| Browser | 1 module | Stealth web automation via CloakBrowser (Playwright drop-in) |
|
|
58
|
+
| MCP Router | 10 modules | 2-tool meta-router replacing N tool definitions (98% token savings) |
|
|
59
|
+
| Models | 10 modules | Multi-model routing, planning, execution, validation, 13 model profiles |
|
|
60
|
+
| Patterns | 23 patterns | Battle-tested workflows from Terminal-Bench 2.0 |
|
|
61
|
+
| Droids | 8 experts | Specialized agents for security, performance, docs, testing |
|
|
62
|
+
| Skills | 24 skills | Reusable domain expertise (chess, polyglot, compression, etc.) |
|
|
63
|
+
| Tasks | 7 modules | Full task lifecycle with dependencies, claims, JSONL sync |
|
|
64
|
+
| Worktrees | 1 module | Isolated git branches per agent, auto-numbered |
|
|
65
|
+
| Hooks | 2 hooks | Session start (memory injection) and pre-compact (preservation) |
|
|
66
|
+
| CLI | 25 commands | Full system management with rich dashboard visualization |
|
|
67
|
+
| Benchmarks | 9 modules | Terminal-Bench adapter, Harbor integration, A/B comparison |
|
|
68
|
+
| LLM Optimization | 5 tools | Qwen3.5 tool call fixes, llama.cpp optimizer, LoRA training |
|
|
69
|
+
| RTK | 1 module | 60-90% token savings on command outputs |
|
|
70
|
+
| Platforms | 9 integrations | Claude, Factory, OpenCode, ForgeCode, VSCode, Beads, Codex, Pipeline, OMP |
|
|
79
71
|
|
|
80
72
|
---
|
|
81
73
|
|
|
82
|
-
##
|
|
74
|
+
## Memory System
|
|
83
75
|
|
|
84
76
|
### Architecture: 4 Layers
|
|
85
77
|
|
|
@@ -94,97 +86,75 @@ uap setup -p all
|
|
|
94
86
|
|
|
95
87
|
### Hierarchical Tiers (Hot/Warm/Cold)
|
|
96
88
|
|
|
97
|
-
| Tier | Entries |
|
|
98
|
-
| ---- | ------- |
|
|
99
|
-
| Hot | 10 |
|
|
100
|
-
| Warm | 50 |
|
|
101
|
-
| Cold | 500 |
|
|
89
|
+
| Tier | Entries | Behavior |
|
|
90
|
+
| ---- | ------- | ------------------------------------ |
|
|
91
|
+
| Hot | 10 | Always in context, highest relevance |
|
|
92
|
+
| Warm | 50 | Promoted on frequent access |
|
|
93
|
+
| Cold | 500 | Semantic search only, compressed |
|
|
102
94
|
|
|
103
95
|
Time-decay formula: `effective_importance = importance * decayRate^daysSinceAccess`
|
|
104
96
|
|
|
105
|
-
###
|
|
106
|
-
|
|
107
|
-
| Component
|
|
108
|
-
|
|
|
109
|
-
| Short-Term (SQLite)
|
|
110
|
-
| Short-Term
|
|
111
|
-
| Hierarchical Memory
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
|
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
| Adaptive Context
|
|
129
|
-
| Task Classifier
|
|
130
|
-
| Model Router
|
|
131
|
-
|
|
|
97
|
+
### Components (27 modules)
|
|
98
|
+
|
|
99
|
+
| Component | File | Purpose |
|
|
100
|
+
| ------------------------ | ---------------------------------------- | ----------------------------------------------------------- |
|
|
101
|
+
| Short-Term (SQLite) | `src/memory/short-term/sqlite.ts` | FTS5 full-text search, WAL mode |
|
|
102
|
+
| Short-Term Schema | `src/memory/short-term/schema.ts` | FTS5 triggers, table definitions |
|
|
103
|
+
| Hierarchical Memory | `src/memory/hierarchical-memory.ts` | Hot/warm/cold tiering with auto-promotion/demotion |
|
|
104
|
+
| Dynamic Retrieval | `src/memory/dynamic-retrieval.ts` | Adaptive depth, hierarchical query, 6 memory sources |
|
|
105
|
+
| Embedding Service | `src/memory/embeddings.ts` | 5 providers: LlamaCpp, Ollama, OpenAI, Local, TF-IDF |
|
|
106
|
+
| GitHub Backend | `src/memory/backends/github.ts` | Store memories as JSON files in a GitHub repo |
|
|
107
|
+
| Qdrant Backend | `src/memory/backends/qdrant-cloud.ts` | Vector search with project-isolated collections |
|
|
108
|
+
| Backend Factory | `src/memory/backends/factory.ts` | Backend selection and initialization |
|
|
109
|
+
| Backend Base | `src/memory/backends/base.ts` | Interface definitions |
|
|
110
|
+
| Serverless Qdrant | `src/memory/serverless-qdrant.ts` | Auto-start/stop Docker, cloud fallback, idle shutdown |
|
|
111
|
+
| Write Gate | `src/memory/write-gate.ts` | Quality filter: 5 criteria, minimum score 0.3 |
|
|
112
|
+
| Daily Log | `src/memory/daily-log.ts` | Staging area -- all writes land here first |
|
|
113
|
+
| Correction Propagation | `src/memory/correction-propagator.ts` | Cross-tier updates, old claims marked [superseded] |
|
|
114
|
+
| Memory Maintenance | `src/memory/memory-maintenance.ts` | Prune, decay, archive, deduplicate |
|
|
115
|
+
| Memory Consolidation | `src/memory/memory-consolidator.ts` | Semantic dedup, quality scoring, background consolidation |
|
|
116
|
+
| Context Compression | `src/memory/context-compressor.ts` | 3 levels (light/medium/aggressive), dynamic budget-aware |
|
|
117
|
+
| Semantic Compression | `src/memory/semantic-compression.ts` | Atomic facts extraction, token reduction |
|
|
118
|
+
| Speculative Cache | `src/memory/speculative-cache.ts` | Pre-computes likely queries, LRU with TTL |
|
|
119
|
+
| Knowledge Graph | `src/memory/knowledge-graph.ts` | Entities + relationships in SQLite, recursive CTE traversal |
|
|
120
|
+
| Adaptive Context | `src/memory/adaptive-context.ts` | 21 optimizations, historical benefit tracking |
|
|
121
|
+
| Task Classifier | `src/memory/task-classifier.ts` | 9 categories, suggests droids |
|
|
122
|
+
| Model Router | `src/memory/model-router.ts` | Routes to optimal model by task type and cost |
|
|
123
|
+
| Predictive Memory | `src/memory/predictive-memory.ts` | Cross-session query prediction with SQLite persistence |
|
|
124
|
+
| Ambiguity Detector | `src/memory/ambiguity-detector.ts` | Detects ambiguous task descriptions |
|
|
125
|
+
| Context Pruner | `src/memory/context-pruner.ts` | Token-budget-aware memory pruning |
|
|
126
|
+
| Prepopulation | `src/memory/prepopulate.ts` | Import from docs (markdown) and git history |
|
|
127
|
+
| Terminal-Bench Knowledge | `src/memory/terminal-bench-knowledge.ts` | Domain knowledge from benchmark analysis |
|
|
132
128
|
|
|
133
129
|
---
|
|
134
130
|
|
|
135
|
-
##
|
|
131
|
+
## Multi-Agent Coordination
|
|
136
132
|
|
|
137
|
-
### How Agents Work Together
|
|
133
|
+
### How Agents Work Together
|
|
138
134
|
|
|
139
135
|
```
|
|
140
136
|
Agent A Agent B Agent C
|
|
141
137
|
| | |
|
|
142
|
-
|
|
143
|
-
[Register] [Register] [Register]
|
|
144
|
-
| | |
|
|
145
|
-
v v v
|
|
146
|
-
[Heartbeat 30s] [Heartbeat 30s] [Heartbeat 30s]
|
|
138
|
+
[Register] -> [Heartbeat 30s] -> [Announce: src/auth/]
|
|
147
139
|
| | |
|
|
148
|
-
|
|
149
|
-
[Announce: src/auth/] [Announce: src/api/] [Announce: src/ui/]
|
|
140
|
+
[Overlap Check] ---------> [Overlap Check] ---------> [Overlap Check]
|
|
150
141
|
| | |
|
|
151
|
-
v v v
|
|
152
|
-
[Overlap Check] [Overlap Check] [Overlap Check]
|
|
153
|
-
| | |
|
|
154
|
-
v v v
|
|
155
142
|
[Worktree: 001-auth] [Worktree: 002-api] [Worktree: 003-ui]
|
|
156
143
|
| | |
|
|
157
|
-
|
|
158
|
-
[Work in isolation] [Work in isolation] [Work in isolation]
|
|
159
|
-
| | |
|
|
160
|
-
v v v
|
|
161
|
-
[Queue deploy] [Queue deploy] [Queue deploy]
|
|
162
|
-
| | |
|
|
163
|
-
+----------+---------------+----------+---------------+
|
|
164
|
-
| |
|
|
165
|
-
v v
|
|
166
|
-
[Deploy Batcher] [Squash & Execute]
|
|
144
|
+
[Queue deploy] ----------> [Deploy Batcher] -------> [Squash & Execute]
|
|
167
145
|
```
|
|
168
146
|
|
|
169
|
-
###
|
|
170
|
-
|
|
171
|
-
| Component | File | Purpose |
|
|
172
|
-
| --------------------- | --------------------------------------- | ----------------------------------------------------------------- |
|
|
173
|
-
| Coordination Service | `src/coordination/service.ts` | Agent lifecycle, work claims, announcements, messaging |
|
|
174
|
-
| Coordination Database | `src/coordination/database.ts` | SQLite with WAL: agents, claims, announcements, messages, deploys |
|
|
175
|
-
| Capability Router | `src/coordination/capability-router.ts` | Routes tasks to droids by 18 capability types |
|
|
176
|
-
| Auto-Agent | `src/coordination/auto-agent.ts` | Automatic registration, heartbeat, graceful shutdown |
|
|
177
|
-
| Pattern Router | `src/coordination/pattern-router.ts` | Loads Terminal-Bench patterns, always includes critical ones |
|
|
178
|
-
|
|
179
|
-
### Overlap Detection
|
|
147
|
+
### Components (8 modules)
|
|
180
148
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
149
|
+
| Component | File | Purpose |
|
|
150
|
+
| --------------------- | --------------------------------------- | -------------------------------------------------------------- |
|
|
151
|
+
| Coordination Service | `src/coordination/service.ts` | Agent lifecycle, work claims, announcements, messaging |
|
|
152
|
+
| Coordination Database | `src/coordination/database.ts` | SQLite with WAL: agents, claims, announcements, messages |
|
|
153
|
+
| Capability Router | `src/coordination/capability-router.ts` | Routes tasks to droids by 18 capability types |
|
|
154
|
+
| Auto-Agent | `src/coordination/auto-agent.ts` | Automatic registration, heartbeat, graceful shutdown |
|
|
155
|
+
| Pattern Router | `src/coordination/pattern-router.ts` | Loads Terminal-Bench patterns, critical patterns always active |
|
|
156
|
+
| Deploy Batcher | `src/coordination/deploy-batcher.ts` | Squash, merge, parallelize deploy actions |
|
|
157
|
+
| Adaptive Patterns | `src/coordination/adaptive-patterns.ts` | Pattern success tracking with SQLite persistence |
|
|
188
158
|
|
|
189
159
|
### Messaging
|
|
190
160
|
|
|
@@ -196,169 +166,101 @@ Detection checks:
|
|
|
196
166
|
|
|
197
167
|
---
|
|
198
168
|
|
|
199
|
-
##
|
|
169
|
+
## Deploy Batching
|
|
200
170
|
|
|
201
171
|
Prevents deploy storms when multiple agents finish work simultaneously.
|
|
202
172
|
|
|
203
|
-
###
|
|
204
|
-
|
|
205
|
-
```
|
|
206
|
-
Agent A queues: commit -> push
|
|
207
|
-
Agent B queues: commit -> push
|
|
208
|
-
Agent C queues: commit -> push
|
|
209
|
-
|
|
|
210
|
-
v
|
|
211
|
-
[Deploy Batcher]
|
|
212
|
-
|
|
|
213
|
-
v
|
|
214
|
-
Squash 3 commits into 1
|
|
215
|
-
Single push to remote
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
### Batch Windows (per action type)
|
|
219
|
-
|
|
220
|
-
| Action | Default Window | Urgent Window |
|
|
221
|
-
| -------- | -------------- | ------------- |
|
|
222
|
-
| commit | 30s | 3s |
|
|
223
|
-
| push | 5s | 1s |
|
|
224
|
-
| merge | 10s | 2s |
|
|
225
|
-
| workflow | 5s | 1s |
|
|
226
|
-
| deploy | 60s | 5s |
|
|
173
|
+
### Batch Windows
|
|
227
174
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
- **Dry run** -- Preview mode before execution
|
|
236
|
-
- **Urgent mode** -- Reduces all windows to minimum
|
|
175
|
+
| Action | Default | Urgent |
|
|
176
|
+
| -------- | ------- | ------ |
|
|
177
|
+
| commit | 30s | 3s |
|
|
178
|
+
| push | 5s | 1s |
|
|
179
|
+
| merge | 10s | 2s |
|
|
180
|
+
| workflow | 5s | 1s |
|
|
181
|
+
| deploy | 60s | 5s |
|
|
237
182
|
|
|
238
183
|
### CLI
|
|
239
184
|
|
|
240
185
|
```bash
|
|
241
186
|
uap deploy queue --action commit --target main --message "feat: add auth"
|
|
242
|
-
uap deploy batch
|
|
243
|
-
uap deploy execute
|
|
244
|
-
uap deploy status
|
|
245
|
-
uap deploy flush
|
|
246
|
-
uap deploy config
|
|
247
|
-
uap deploy set-config
|
|
187
|
+
uap deploy batch # Group pending actions
|
|
188
|
+
uap deploy execute # Run the batch
|
|
189
|
+
uap deploy status # View queue
|
|
190
|
+
uap deploy flush # Force-execute all pending
|
|
191
|
+
uap deploy config # View batch config
|
|
192
|
+
uap deploy set-config # Update config
|
|
193
|
+
uap deploy urgent # Enable urgent mode
|
|
248
194
|
```
|
|
249
195
|
|
|
250
196
|
---
|
|
251
197
|
|
|
252
|
-
##
|
|
253
|
-
|
|
254
|
-
### Architecture (3 Layers)
|
|
198
|
+
## Policy Enforcement
|
|
255
199
|
|
|
256
|
-
|
|
257
|
-
Tool Call
|
|
258
|
-
|
|
|
259
|
-
v
|
|
260
|
-
[EnforcedToolRouter]
|
|
261
|
-
|
|
|
262
|
-
v
|
|
263
|
-
[PolicyGate]
|
|
264
|
-
/ | \
|
|
265
|
-
v v v
|
|
266
|
-
[Policy] [Policy] [Policy]
|
|
267
|
-
REQUIRED RECOMMENDED OPTIONAL
|
|
268
|
-
|
|
|
269
|
-
v
|
|
270
|
-
[Allow / Block]
|
|
271
|
-
|
|
|
272
|
-
v
|
|
273
|
-
[Audit Trail]
|
|
274
|
-
```
|
|
200
|
+
### Components (8 modules)
|
|
275
201
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
|
279
|
-
|
|
|
280
|
-
| Policy
|
|
281
|
-
|
|
|
282
|
-
| Policy
|
|
283
|
-
|
|
|
284
|
-
| Policy
|
|
285
|
-
| Enforced Tool Router | `src/policies/enforced-tool-router.ts` | Single entry point for all tool calls |
|
|
286
|
-
| Policy Converter | `src/policies/convert-policy-to-claude.ts` | Markdown to CLAUDE.md format |
|
|
202
|
+
| Component | File | Purpose |
|
|
203
|
+
| -------------------- | ------------------------------------------ | ------------------------------------------------ |
|
|
204
|
+
| Policy Schema | `src/policies/schemas/policy.ts` | Zod schemas for policies and executions |
|
|
205
|
+
| Database Manager | `src/policies/database-manager.ts` | SQLite with WAL, JSON serialization |
|
|
206
|
+
| Policy Memory | `src/policies/policy-memory.ts` | CRUD, relevance search, tag/category filtering |
|
|
207
|
+
| Policy Tools | `src/policies/policy-tools.ts` | Store/execute Python enforcement tools |
|
|
208
|
+
| Policy Gate | `src/policies/policy-gate.ts` | Middleware: blocks REQUIRED violations |
|
|
209
|
+
| Enforced Tool Router | `src/policies/enforced-tool-router.ts` | Single entry point for policy-checked tool calls |
|
|
210
|
+
| Policy Converter | `src/policies/convert-policy-to-claude.ts` | Markdown to CLAUDE.md format |
|
|
287
211
|
|
|
288
212
|
### Enforcement Levels
|
|
289
213
|
|
|
290
|
-
| Level | Behavior
|
|
291
|
-
| ----------- |
|
|
292
|
-
| REQUIRED | Blocks execution
|
|
293
|
-
| RECOMMENDED | Logged but does not block
|
|
294
|
-
| OPTIONAL | Informational only
|
|
295
|
-
|
|
296
|
-
### Audit Trail
|
|
297
|
-
|
|
298
|
-
Every policy check is logged to `policy_executions` table:
|
|
214
|
+
| Level | Behavior |
|
|
215
|
+
| ----------- | ----------------------------------------------- |
|
|
216
|
+
| REQUIRED | Blocks execution, throws `PolicyViolationError` |
|
|
217
|
+
| RECOMMENDED | Logged but does not block |
|
|
218
|
+
| OPTIONAL | Informational only |
|
|
299
219
|
|
|
300
|
-
|
|
301
|
-
- Allowed/blocked decision with reason
|
|
302
|
-
- Timestamp
|
|
303
|
-
|
|
304
|
-
### CLI
|
|
220
|
+
### CLI (15 subcommands)
|
|
305
221
|
|
|
306
222
|
```bash
|
|
307
|
-
uap
|
|
308
|
-
uap-policy
|
|
309
|
-
uap
|
|
310
|
-
uap
|
|
311
|
-
uap
|
|
312
|
-
uap
|
|
223
|
+
uap policy list # List all policies
|
|
224
|
+
uap policy install <name> # Install built-in policy
|
|
225
|
+
uap policy enable <id> # Enable a policy
|
|
226
|
+
uap policy disable <id> # Disable a policy
|
|
227
|
+
uap policy status # Enforcement status
|
|
228
|
+
uap policy add -f <file> # Add from markdown
|
|
229
|
+
uap policy convert -i <id> # Convert to CLAUDE.md format
|
|
230
|
+
uap policy get-relevant -t <task> # Find relevant policies
|
|
231
|
+
uap policy add-tool -p <id> -t <name> -c <file> # Add Python tool
|
|
232
|
+
uap policy check -o <operation> # Check if allowed
|
|
233
|
+
uap policy audit # View audit trail
|
|
234
|
+
uap policy toggle <id> # Toggle on/off
|
|
235
|
+
uap policy stage <id> -s <stage> # Set enforcement stage
|
|
236
|
+
uap policy level <id> -l <level> # Set enforcement level
|
|
313
237
|
```
|
|
314
238
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
## 5. Browser Automation (CloakBrowser)
|
|
318
|
-
|
|
319
|
-
Stealth web browser via CloakBrowser -- a Playwright drop-in with 33 source-level C++ patches.
|
|
239
|
+
Also available as standalone binary: `uap-policy`
|
|
320
240
|
|
|
321
|
-
|
|
241
|
+
---
|
|
322
242
|
|
|
323
|
-
|
|
324
|
-
| -------------------- | ------------------------------------- |
|
|
325
|
-
| Headless Chrome | Real Chrome UA (not "HeadlessChrome") |
|
|
326
|
-
| webdriver flag | `false` (undetectable) |
|
|
327
|
-
| Plugins | 5 detected (matches real browser) |
|
|
328
|
-
| window.chrome | Present |
|
|
329
|
-
| reCAPTCHA v3 | 0.9 score |
|
|
330
|
-
| Cloudflare Turnstile | Passes |
|
|
331
|
-
| FingerprintJS | Undetected |
|
|
332
|
-
| Persistent profiles | Cookie/localStorage persistence |
|
|
243
|
+
## Browser Automation
|
|
333
244
|
|
|
334
|
-
|
|
245
|
+
Stealth web browser via CloakBrowser -- a Playwright drop-in.
|
|
335
246
|
|
|
336
247
|
```typescript
|
|
337
|
-
import { createWebBrowser } from '
|
|
248
|
+
import { createWebBrowser } from '@miller-tech/uap/browser';
|
|
338
249
|
|
|
339
250
|
const browser = createWebBrowser();
|
|
340
251
|
await browser.launch({ headless: true, humanize: true });
|
|
341
252
|
await browser.goto('https://example.com');
|
|
342
253
|
const content = await browser.getContent();
|
|
343
|
-
await browser.evaluate(() => document.title);
|
|
344
254
|
await browser.close();
|
|
345
255
|
```
|
|
346
256
|
|
|
347
257
|
---
|
|
348
258
|
|
|
349
|
-
##
|
|
259
|
+
## MCP Router
|
|
350
260
|
|
|
351
|
-
Replaces N tool definitions with 2 meta-tools.
|
|
261
|
+
Replaces N tool definitions with 2 meta-tools for 98% token reduction.
|
|
352
262
|
|
|
353
|
-
###
|
|
354
|
-
|
|
355
|
-
```
|
|
356
|
-
Before: 47 tools exposed = ~12,000 tokens in system prompt
|
|
357
|
-
After: 2 tools exposed = ~200 tokens in system prompt
|
|
358
|
-
(98.3% reduction)
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
### Components
|
|
263
|
+
### Components (10 modules)
|
|
362
264
|
|
|
363
265
|
| Component | File | Purpose |
|
|
364
266
|
| ----------------- | ------------------------------------- | ------------------------------------------- |
|
|
@@ -366,89 +268,102 @@ After: 2 tools exposed = ~200 tokens in system prompt
|
|
|
366
268
|
| Config Parser | `src/mcp-router/config/parser.ts` | Loads MCP configs from standard paths |
|
|
367
269
|
| Fuzzy Search | `src/mcp-router/search/fuzzy.ts` | Tool discovery with fuzzy matching |
|
|
368
270
|
| Client Pool | `src/mcp-router/executor/client.ts` | Manages connections to MCP servers |
|
|
271
|
+
| Tool Execute | `src/mcp-router/tools/execute.ts` | Tool execution with policy gate |
|
|
272
|
+
| Tool Discover | `src/mcp-router/tools/discover.ts` | Tool discovery definitions |
|
|
369
273
|
| Output Compressor | `src/mcp-router/output-compressor.ts` | Compresses tool output |
|
|
370
274
|
| Session Stats | `src/mcp-router/session-stats.ts` | Per-tool token consumption tracking |
|
|
371
275
|
|
|
372
276
|
---
|
|
373
277
|
|
|
374
|
-
##
|
|
278
|
+
## Multi-Model Architecture
|
|
375
279
|
|
|
376
280
|
### 3-Tier Execution
|
|
377
281
|
|
|
378
282
|
```
|
|
379
283
|
Tier 1: TaskPlanner -- Decomposes task into subtasks
|
|
380
284
|
Tier 2: ModelRouter -- Assigns optimal model per subtask
|
|
381
|
-
Tier 3: TaskExecutor -- Executes with validation
|
|
285
|
+
Tier 3: TaskExecutor -- Executes with validation, dynamic temperature, rate limiting
|
|
382
286
|
```
|
|
383
287
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
|
387
|
-
|
|
|
388
|
-
|
|
|
389
|
-
|
|
|
288
|
+
### Components (10 modules)
|
|
289
|
+
|
|
290
|
+
| Component | File | Purpose |
|
|
291
|
+
| ------------------ | ---------------------------------- | -------------------------------------------- |
|
|
292
|
+
| Model Router | `src/models/router.ts` | Routes by complexity and cost |
|
|
293
|
+
| Task Planner | `src/models/planner.ts` | Decomposition, dependency analysis |
|
|
294
|
+
| Task Executor | `src/models/executor.ts` | Execution with model profiles, rate limiting |
|
|
295
|
+
| Plan Validator | `src/models/plan-validator.ts` | Cycle detection, coherence checks |
|
|
296
|
+
| Profile Loader | `src/models/profile-loader.ts` | Load model profiles from JSON |
|
|
297
|
+
| Execution Profiles | `src/models/execution-profiles.ts` | Runtime profile management |
|
|
298
|
+
| Unified Router | `src/models/unified-router.ts` | Combined routing logic |
|
|
299
|
+
| Analytics | `src/models/analytics.ts` | Model performance tracking |
|
|
300
|
+
|
|
301
|
+
### Model Profiles (13 profiles)
|
|
302
|
+
|
|
303
|
+
Pre-configured profiles in `config/model-profiles/`: claude-opus-4.6, claude-sonnet-4.6, claude-haiku-3.5, gpt-4.1, gpt-4o, gpt-o3, gemini-2.5-pro, gemini-2.5-flash, qwen35, glm-5, kimi-k2.5, llama, generic.
|
|
304
|
+
|
|
305
|
+
Each profile supports: `dynamic_temperature` (decay per retry), `tool_call_batching` (system prompt suffix), `rate_limits` (requests/tokens per minute).
|
|
390
306
|
|
|
391
307
|
---
|
|
392
308
|
|
|
393
|
-
##
|
|
394
|
-
|
|
395
|
-
Battle-tested patterns from Terminal-Bench 2.0
|
|
396
|
-
|
|
397
|
-
| Pattern | ID |
|
|
398
|
-
| --------------------- | --- |
|
|
399
|
-
| Output Existence | P12 |
|
|
400
|
-
|
|
|
401
|
-
|
|
|
402
|
-
| Task-First | P16 |
|
|
403
|
-
|
|
|
404
|
-
|
|
|
405
|
-
|
|
|
406
|
-
|
|
|
407
|
-
|
|
|
408
|
-
|
|
|
409
|
-
|
|
|
410
|
-
|
|
|
411
|
-
|
|
|
412
|
-
|
|
|
413
|
-
|
|
|
414
|
-
|
|
|
415
|
-
|
|
|
416
|
-
|
|
|
417
|
-
|
|
|
418
|
-
|
|
|
419
|
-
|
|
|
420
|
-
|
|
|
309
|
+
## Pattern System (23 Patterns)
|
|
310
|
+
|
|
311
|
+
Battle-tested patterns from Terminal-Bench 2.0, stored in `.factory/patterns/`.
|
|
312
|
+
|
|
313
|
+
| Pattern | ID | What It Prevents |
|
|
314
|
+
| --------------------- | --- | -------------------------------------- |
|
|
315
|
+
| Output Existence | P12 | Missing output files (37% of failures) |
|
|
316
|
+
| Iterative Refinement | P13 | First-attempt acceptance |
|
|
317
|
+
| Output Format | P14 | Wrong format/encoding |
|
|
318
|
+
| Task-First | P16 | Over-planning before doing |
|
|
319
|
+
| Constraint Extraction | P17 | Missing hidden requirements |
|
|
320
|
+
| Impossible Refusal | P19 | Attempting impossible tasks |
|
|
321
|
+
| Adversarial | P20 | Missing attack vectors |
|
|
322
|
+
| Chess Engine | P21 | Reinventing Stockfish |
|
|
323
|
+
| Git Recovery | P22 | Data loss during git ops |
|
|
324
|
+
| Compression Check | P23 | Lossy compression errors |
|
|
325
|
+
| Polyglot | P24 | Single-language thinking |
|
|
326
|
+
| Service Config | P25 | Misconfigured services |
|
|
327
|
+
| Near-Miss | P26 | Almost-correct solutions |
|
|
328
|
+
| Smoke Test | P28 | Untested changes |
|
|
329
|
+
| Performance Threshold | P30 | Missing perf targets |
|
|
330
|
+
| Round-Trip | P31 | Encode/decode mismatches |
|
|
331
|
+
| CLI Verify | P32 | Broken CLI commands |
|
|
332
|
+
| Numerical Stability | P33 | Floating point errors |
|
|
333
|
+
| Image Pipeline | P34 | Image processing errors |
|
|
334
|
+
| Decoder-First | P35 | Wrong problem decomposition |
|
|
335
|
+
| Competition Domain | P36 | Missing domain knowledge |
|
|
336
|
+
| Ambiguity Detection | P37 | Ambiguous task descriptions |
|
|
337
|
+
| IaC Parity | IaC | Config drift |
|
|
421
338
|
|
|
422
339
|
---
|
|
423
340
|
|
|
424
|
-
##
|
|
341
|
+
## Droids & Skills
|
|
425
342
|
|
|
426
|
-
### Expert Droids (8
|
|
343
|
+
### Expert Droids (8)
|
|
427
344
|
|
|
428
|
-
| Droid |
|
|
429
|
-
| ------------------------ |
|
|
430
|
-
| Code Quality Guardian |
|
|
431
|
-
| Debug Expert |
|
|
432
|
-
| Documentation Expert |
|
|
433
|
-
| ML Training Expert |
|
|
434
|
-
| Performance Optimizer |
|
|
435
|
-
| Security Auditor |
|
|
436
|
-
| Sysadmin Expert |
|
|
437
|
-
| Terminal-Bench Optimizer |
|
|
345
|
+
| Droid | Specialization |
|
|
346
|
+
| ------------------------ | -------------------------------- |
|
|
347
|
+
| Code Quality Guardian | Code review, quality enforcement |
|
|
348
|
+
| Debug Expert | Debugging specialist |
|
|
349
|
+
| Documentation Expert | Documentation |
|
|
350
|
+
| ML Training Expert | ML/training |
|
|
351
|
+
| Performance Optimizer | Performance |
|
|
352
|
+
| Security Auditor | Security review |
|
|
353
|
+
| Sysadmin Expert | System administration |
|
|
354
|
+
| Terminal-Bench Optimizer | Benchmark optimization |
|
|
438
355
|
|
|
439
|
-
### Skills (
|
|
356
|
+
### Skills (24)
|
|
440
357
|
|
|
441
358
|
**Project Skills** (5): codebase-navigator, memory-management, near-miss-iteration, terminal-bench, worktree-workflow
|
|
442
359
|
|
|
443
360
|
**Claude Skills** (5): hooks-session-start, hooks-pre-compact, scripts-tool-router, scripts-preload-memory, session-context-preservation-droid
|
|
444
361
|
|
|
445
|
-
**Factory Skills** (
|
|
362
|
+
**Factory Skills** (14): adversarial, balls-mode, batch-review, chess-engine, cli-design-expert, codebase-navigator, compression, git-forensics, near-miss, polyglot, service-config, terminal-bench-strategies, typescript-node-expert, unreal-engine-developer
|
|
446
363
|
|
|
447
364
|
---
|
|
448
365
|
|
|
449
|
-
##
|
|
450
|
-
|
|
451
|
-
Full task lifecycle with dependencies, claims, and JSONL sync for git versioning.
|
|
366
|
+
## Task Management
|
|
452
367
|
|
|
453
368
|
| Feature | Description |
|
|
454
369
|
| ------------ | -------------------------------------------- |
|
|
@@ -462,343 +377,96 @@ Full task lifecycle with dependencies, claims, and JSONL sync for git versioning
|
|
|
462
377
|
|
|
463
378
|
---
|
|
464
379
|
|
|
465
|
-
##
|
|
380
|
+
## Worktree System
|
|
466
381
|
|
|
467
382
|
Each agent works in an isolated git worktree to prevent conflicts.
|
|
468
383
|
|
|
469
384
|
```bash
|
|
470
|
-
uap worktree create my-feature
|
|
471
|
-
#
|
|
472
|
-
#
|
|
473
|
-
#
|
|
474
|
-
|
|
475
|
-
uap worktree list # Show all worktrees
|
|
476
|
-
uap worktree pr 001 # Create PR
|
|
477
|
-
uap worktree cleanup 001 # Remove worktree + branch
|
|
385
|
+
uap worktree create my-feature # Creates .worktrees/001-my-feature/
|
|
386
|
+
uap worktree list # Show all worktrees
|
|
387
|
+
uap worktree pr 001 # Create PR
|
|
388
|
+
uap worktree cleanup 001 # Remove worktree + branch
|
|
389
|
+
uap worktree ensure --strict # Verify inside worktree (CI gate)
|
|
478
390
|
```
|
|
479
391
|
|
|
480
|
-
Auto-numbered (NNN-slug) to prevent naming collisions between agents.
|
|
481
|
-
|
|
482
392
|
---
|
|
483
393
|
|
|
484
|
-
##
|
|
394
|
+
## Hooks System
|
|
485
395
|
|
|
486
396
|
### Session Start Hook
|
|
487
397
|
|
|
488
|
-
Runs at every session start:
|
|
489
|
-
|
|
490
398
|
1. Cleans stale agents (>24h no heartbeat)
|
|
491
|
-
2. Injects UAP compliance checklist
|
|
399
|
+
2. Injects UAP compliance checklist
|
|
492
400
|
3. Loads recent memories (last 24h)
|
|
493
401
|
4. Surfaces open loops from session memories
|
|
494
402
|
5. Warns about stale worktrees
|
|
495
403
|
|
|
496
404
|
### Pre-Compact Hook
|
|
497
405
|
|
|
498
|
-
Runs before context compaction:
|
|
499
|
-
|
|
500
406
|
1. Records compaction marker in memory
|
|
501
|
-
2. Checks if lessons were stored
|
|
407
|
+
2. Checks if lessons were stored
|
|
502
408
|
3. Outputs compliance reminder
|
|
503
409
|
4. Cleans up agents from current session
|
|
504
410
|
|
|
505
411
|
### Supported Platforms
|
|
506
412
|
|
|
507
413
|
```bash
|
|
508
|
-
uap hooks install claude
|
|
509
|
-
uap hooks install factory
|
|
510
|
-
uap hooks install cursor
|
|
511
|
-
uap hooks install vscode
|
|
512
|
-
uap hooks install opencode
|
|
513
|
-
uap hooks install forgecode
|
|
414
|
+
uap hooks install claude # Claude Code
|
|
415
|
+
uap hooks install factory # Factory.AI
|
|
416
|
+
uap hooks install cursor # Cursor
|
|
417
|
+
uap hooks install vscode # VSCode
|
|
418
|
+
uap hooks install opencode # OpenCode
|
|
419
|
+
uap hooks install forgecode # ForgeCode
|
|
420
|
+
uap hooks install codex # Codex CLI
|
|
421
|
+
uap hooks install omp # Oh-My-Pi
|
|
514
422
|
```
|
|
515
423
|
|
|
516
424
|
---
|
|
517
425
|
|
|
518
|
-
##
|
|
519
|
-
|
|
520
|
-
###
|
|
521
|
-
|
|
522
|
-
| Command
|
|
523
|
-
|
|
|
524
|
-
| `uap init`
|
|
525
|
-
| `uap setup -p all`
|
|
526
|
-
| `uap generate`
|
|
527
|
-
| `uap update`
|
|
528
|
-
| `uap analyze`
|
|
529
|
-
| `uap compliance check`
|
|
530
|
-
| `uap dashboard`
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
|
535
|
-
|
|
|
536
|
-
| `uap
|
|
537
|
-
| `uap
|
|
538
|
-
| `uap
|
|
539
|
-
| `uap
|
|
540
|
-
| `uap
|
|
541
|
-
| `uap
|
|
542
|
-
| `uap
|
|
543
|
-
| `uap
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
|
548
|
-
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
| `uap agent announce` | Announce work area |
|
|
552
|
-
| `uap agent overlaps` | Check for conflicts |
|
|
553
|
-
| `uap agent broadcast` | Message all agents |
|
|
554
|
-
| `uap coord status` | Coordination overview |
|
|
555
|
-
| `uap coord cleanup` | Clean stale agents |
|
|
556
|
-
|
|
557
|
-
### Deploy
|
|
558
|
-
|
|
559
|
-
| Command | Description |
|
|
560
|
-
| -------------------- | --------------------- |
|
|
561
|
-
| `uap deploy queue` | Queue a deploy action |
|
|
562
|
-
| `uap deploy batch` | Group pending actions |
|
|
563
|
-
| `uap deploy execute` | Run the batch |
|
|
564
|
-
| `uap deploy flush` | Force-execute all |
|
|
565
|
-
| `uap deploy status` | View queue |
|
|
426
|
+
## CLI Reference
|
|
427
|
+
|
|
428
|
+
### 25 Top-Level Commands
|
|
429
|
+
|
|
430
|
+
| Command | Description |
|
|
431
|
+
| ------------------------- | -------------------------------------------- |
|
|
432
|
+
| `uap init` | Initialize UAP in a project |
|
|
433
|
+
| `uap setup -p all` | Full setup (memory, Qdrant, hooks, patterns) |
|
|
434
|
+
| `uap generate` | Regenerate CLAUDE.md from templates |
|
|
435
|
+
| `uap update` | Update all components |
|
|
436
|
+
| `uap analyze` | Analyze project structure |
|
|
437
|
+
| `uap compliance check` | Verify UAP compliance |
|
|
438
|
+
| `uap dashboard` | Rich terminal dashboard (13 views) |
|
|
439
|
+
| `uap memory <action>` | Memory management (9 subcommands) |
|
|
440
|
+
| `uap patterns <action>` | Pattern RAG management (4 subcommands) |
|
|
441
|
+
| `uap worktree <action>` | Git worktree management (5 subcommands) |
|
|
442
|
+
| `uap agent <action>` | Agent lifecycle (10 subcommands) |
|
|
443
|
+
| `uap coord <action>` | Coordination status (3 subcommands) |
|
|
444
|
+
| `uap deploy <action>` | Deploy batching (8 subcommands) |
|
|
445
|
+
| `uap task <action>` | Task management (15 subcommands) |
|
|
446
|
+
| `uap droids <action>` | Droid management (3 subcommands) |
|
|
447
|
+
| `uap model <action>` | Multi-model management (8 subcommands) |
|
|
448
|
+
| `uap policy <action>` | Policy management (15 subcommands) |
|
|
449
|
+
| `uap mcp-router <action>` | MCP Router management (4 subcommands) |
|
|
450
|
+
| `uap hooks <action>` | Hook installation (2 subcommands) |
|
|
451
|
+
| `uap tool-calls <action>` | Qwen3.5 tool call fixes (4 subcommands) |
|
|
452
|
+
| `uap rtk <action>` | RTK token compression (3 subcommands) |
|
|
453
|
+
| `uap schema-diff` | Detect breaking schema changes |
|
|
454
|
+
| `uap mcp-setup` | Configure MCP Router for AI harnesses |
|
|
455
|
+
| `uap sync` | Sync configuration between platforms |
|
|
456
|
+
| `uap uap-omp <action>` | Oh-My-Pi integration (7 subcommands) |
|
|
457
|
+
|
|
458
|
+
**Total: 109 commands and subcommands.**
|
|
566
459
|
|
|
567
460
|
### Additional Binaries
|
|
568
461
|
|
|
569
|
-
| Binary
|
|
570
|
-
|
|
|
571
|
-
| `uap-policy`
|
|
572
|
-
| `
|
|
573
|
-
| `
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
## 14. Benchmarking System
|
|
578
|
-
|
|
579
|
-
Terminal-Bench adapter for A/B comparison of UAM-enabled vs naive agents.
|
|
580
|
-
|
|
581
|
-
| Component | File | Purpose |
|
|
582
|
-
| ------------------- | -------------------------------------- | ------------------------------------ |
|
|
583
|
-
| Benchmark Framework | `src/benchmarks/benchmark.ts` | Task schemas, verification functions |
|
|
584
|
-
| Benchmark Runner | `src/benchmarks/runner.ts` | Orchestrates execution |
|
|
585
|
-
| Naive Agent | `src/benchmarks/agents/naive-agent.ts` | Baseline without UAM |
|
|
586
|
-
| UAM Agent | `src/benchmarks/agents/uam-agent.ts` | UAM-enabled agent |
|
|
587
|
-
| SUPERGENIUS Agent | `src/uam_harbor/supergenius_agent.py` | Python agent targeting 80%+ |
|
|
588
|
-
| Harbor Datasets | `harbor-datasets/` | Docker-sandboxed benchmark tasks |
|
|
589
|
-
|
|
590
|
-
---
|
|
591
|
-
|
|
592
|
-
## 15. Qwen3.5 / Local LLM Optimization
|
|
593
|
-
|
|
594
|
-
| Component | File | Purpose |
|
|
595
|
-
| ----------------- | ----------------------------------------------------- | ----------------------------------------- |
|
|
596
|
-
| Tool Call Fixes | `tools/agents/scripts/qwen_tool_call_*.py` | Fix Qwen3.5 tool call reliability |
|
|
597
|
-
| Chat Template Fix | `tools/agents/scripts/fix_qwen_chat_template.py` | Template modifications |
|
|
598
|
-
| Llama Optimizer | `src/bin/llama-server-optimize.ts` | Optimal llama.cpp params for 16/24GB VRAM |
|
|
599
|
-
| LoRA Training | `tools/agents/scripts/generate_lora_training_data.py` | Fine-tuning data generation |
|
|
600
|
-
| Qwen Settings | `config/qwen35-settings.json` | Model-specific configuration |
|
|
601
|
-
|
|
602
|
-
---
|
|
603
|
-
|
|
604
|
-
## 16. RTK (Rust Token Killer)
|
|
605
|
-
|
|
606
|
-
60-90% token savings on command outputs.
|
|
607
|
-
|
|
608
|
-
```bash
|
|
609
|
-
uap rtk install # Install RTK
|
|
610
|
-
uap rtk status # Check installation
|
|
611
|
-
uap rtk help # Usage guide
|
|
612
|
-
```
|
|
613
|
-
|
|
614
|
-
---
|
|
615
|
-
|
|
616
|
-
## 17. Platform Integrations
|
|
617
|
-
|
|
618
|
-
| Platform | Directory | Features |
|
|
619
|
-
| ----------- | ------------ | ------------------------------------------------ |
|
|
620
|
-
| Claude Code | `.claude/` | Hooks, skills, settings, commands, agents |
|
|
621
|
-
| Factory.AI | `.factory/` | Droids, skills, hooks, patterns, config |
|
|
622
|
-
| OpenCode | `.opencode/` | Plugin system, config |
|
|
623
|
-
| ForgeCode | `.forge/` | ZSH plugin, hooks |
|
|
624
|
-
| VSCode | `.vscode/` | Workspace settings, extensions |
|
|
625
|
-
| Beads | `.beads/` | Git-native issue tracking with JSONL, daemon RPC |
|
|
626
|
-
|
|
627
|
-
---
|
|
628
|
-
|
|
629
|
-
## 18. Harness Feature Matrix
|
|
630
|
-
|
|
631
|
-
Every AI coding harness ships as a stateless editor with file and terminal access. UAP closes the gap between "tool that edits code" and "agent platform that learns, coordinates, and enforces policy." It works with **15 harnesses** across 4 integration tiers -- same features everywhere, deeper wiring on first-class platforms.
|
|
632
|
-
|
|
633
|
-
### What UAP Adds (and Why It Matters)
|
|
634
|
-
|
|
635
|
-
- **4-layer persistent memory** -- agents retain lessons, decisions, and corrections across sessions instead of starting from zero
|
|
636
|
-
- **Write gate** -- 5-criteria quality filter prevents memory pollution so only high-value knowledge is stored
|
|
637
|
-
- **22 battle-tested patterns** -- Terminal-Bench 2.0 workflows eliminate the 37% of failures caused by missing output files, wrong formats, and skipped verification
|
|
638
|
-
- **Pattern RAG** -- on-demand pattern retrieval saves ~12K tokens per session by injecting only relevant patterns
|
|
639
|
-
- **Worktree isolation** -- each agent works in its own git worktree so parallel agents never corrupt each other's state
|
|
640
|
-
- **Multi-agent coordination** -- heartbeats, overlap detection, and conflict risk assessment let 2-10+ agents collaborate without collisions
|
|
641
|
-
- **Deploy batching** -- squash commits and serialize pushes to prevent deploy storms when multiple agents finish simultaneously
|
|
642
|
-
- **Policy enforcement** -- required/recommended/optional rules with audit trail ensure agents follow project standards
|
|
643
|
-
- **Task management** -- dependency-aware DAG with cycle detection, claims, and JSONL sync for git-versionable task tracking
|
|
644
|
-
- **Model routing** -- routes subtasks to optimal models by complexity and cost across 6 presets
|
|
645
|
-
- **MCP Router** -- replaces N tool definitions with 2 meta-tools for 98% token reduction in system prompts
|
|
646
|
-
- **RTK** -- 60-90% token savings on command outputs via Rust-based compression
|
|
647
|
-
- **12-gate compliance** -- automated protocol verification catches drift before it ships
|
|
648
|
-
- **20+ CLI commands** -- full system management with rich dashboard visualization
|
|
649
|
-
|
|
650
|
-
> Full 15-harness matrix with per-harness integration details: **[docs/reference/HARNESS-MATRIX.md](docs/reference/HARNESS-MATRIX.md)**
|
|
651
|
-
|
|
652
|
-
### Baseline: What Harnesses Provide Natively
|
|
653
|
-
|
|
654
|
-
| Feature | Claude Code | Factory.AI | OpenCode | ForgeCode | Cursor | VSCode | Cline | Windsurf |
|
|
655
|
-
| ---------------------------- | :---------: | :--------: | :--------: | :-------: | :----------: | :-----: | :---------: | :------------: |
|
|
656
|
-
| File system + terminal | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
657
|
-
| Context file | CLAUDE.md | PROJECT.md | -- | -- | .cursorrules | -- | .clinerules | .windsurfrules |
|
|
658
|
-
| Native hooks | Yes | Yes | Plugin API | ZSH | hooks.json | -- | -- | -- |
|
|
659
|
-
| MCP support | Native | Native | Config | -- | Native | Via ext | Via ext | Via ext |
|
|
660
|
-
| Persistent sessions | Yes | Yes | Yes | ZSH env | Limited | Limited | Limited | Limited |
|
|
661
|
-
| Local LLM support | -- | -- | Native | Yes | Yes | Via ext | Yes | Yes |
|
|
662
|
-
| **Persistent memory** | -- | -- | -- | -- | -- | -- | -- | -- |
|
|
663
|
-
| **Pattern library** | -- | -- | -- | -- | -- | -- | -- | -- |
|
|
664
|
-
| **Multi-agent coordination** | -- | -- | -- | -- | -- | -- | -- | -- |
|
|
665
|
-
| **Policy enforcement** | -- | -- | -- | -- | -- | -- | -- | -- |
|
|
666
|
-
|
|
667
|
-
The bottom four rows are the gap. No harness provides them. UAP does.
|
|
668
|
-
|
|
669
|
-
### With UAP: Uniform Capabilities Across All Harnesses
|
|
670
|
-
|
|
671
|
-
| Capability | Benefit | All Harnesses |
|
|
672
|
-
| ------------------------ | ------------------------------------- | :-----------: |
|
|
673
|
-
| 4-layer memory (L1-L4) | Agents remember across sessions | Yes |
|
|
674
|
-
| Write gate + tiering | Only high-value knowledge stored | Yes |
|
|
675
|
-
| 22 patterns + RAG | Proven workflows, ~12K token savings | Yes |
|
|
676
|
-
| Worktree isolation | Parallel agents, zero conflicts | Yes |
|
|
677
|
-
| Multi-agent coordination | Heartbeats, overlap detection, claims | Yes |
|
|
678
|
-
| Deploy batching | No push races, squashed commits | Yes |
|
|
679
|
-
| Policy engine | Audit-trailed rule enforcement | Yes |
|
|
680
|
-
| Task DAG | Dependency-aware work tracking | Yes |
|
|
681
|
-
| Model router | Right model for each subtask | Yes |
|
|
682
|
-
| MCP Router | 98% system prompt token reduction | Yes |
|
|
683
|
-
| RTK compression | 60-90% output token savings | Yes |
|
|
684
|
-
| 12-gate compliance | Automated protocol verification | Yes |
|
|
685
|
-
| 20+ CLI commands | Full management + dashboard | Yes |
|
|
686
|
-
|
|
687
|
-
### Integration Tiers
|
|
688
|
-
|
|
689
|
-
| Tier | Harnesses | What You Get |
|
|
690
|
-
| ---------------------- | ------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
691
|
-
| **T1 -- First-Class** | Claude Code, Factory.AI, OpenCode, ForgeCode | Native hooks, dedicated config dir, `uap sync`, context file generation |
|
|
692
|
-
| **T2 -- IDE-Based** | Cursor, VSCode, Cline | Platform-specific hooks, MCP config paths |
|
|
693
|
-
| **T3 -- CLI/Terminal** | Windsurf, Codex CLI, Aider, Zed AI | Mapped to T1/T2 via CLAUDE.md or .cursorrules |
|
|
694
|
-
| **T4 -- Additional** | GitHub Copilot, JetBrains AI, SWE-agent, Continue | Piggybacks on T2 infrastructure |
|
|
695
|
-
|
|
696
|
-
All tiers receive identical UAP features. The difference is integration depth, not capability.
|
|
697
|
-
|
|
698
|
-
---
|
|
699
|
-
|
|
700
|
-
## Guardrails
|
|
701
|
-
|
|
702
|
-
### Completion Gates (Mandatory)
|
|
703
|
-
|
|
704
|
-
Every task must pass 3 gates before completion:
|
|
705
|
-
|
|
706
|
-
| Gate | Check | Prevents |
|
|
707
|
-
| --------------- | ------------------------- | ----------------------- |
|
|
708
|
-
| OUTPUT_EXISTS | All expected files exist | Phantom completions |
|
|
709
|
-
| CONSTRAINTS_MET | All requirements verified | Partial implementations |
|
|
710
|
-
| TESTS_PASS | `npm test` passes 100% | Broken code |
|
|
711
|
-
|
|
712
|
-
### Write Gate (Memory Quality)
|
|
713
|
-
|
|
714
|
-
Evaluates 5 criteria before storing a memory:
|
|
715
|
-
|
|
716
|
-
1. **Behavioral change** -- Does this change how we work?
|
|
717
|
-
2. **Commitment with consequences** -- Is there a real commitment?
|
|
718
|
-
3. **Decision with rationale** -- Was a decision made and why?
|
|
719
|
-
4. **Stable recurring fact** -- Is this a durable fact?
|
|
720
|
-
5. **Explicit user request** -- Did the user ask to remember this?
|
|
721
|
-
|
|
722
|
-
Minimum score: 0.3 (configurable). Noise patterns filter acknowledgments and transient requests.
|
|
723
|
-
|
|
724
|
-
### Policy Enforcement
|
|
725
|
-
|
|
726
|
-
REQUIRED policies block tool execution. Every check is logged to the audit trail. `PolicyViolationError` thrown with structured details.
|
|
727
|
-
|
|
728
|
-
### Pattern Router
|
|
729
|
-
|
|
730
|
-
Critical patterns (Output Existence, Decoder-First) are always active regardless of task classification.
|
|
731
|
-
|
|
732
|
-
### Correction Propagation
|
|
733
|
-
|
|
734
|
-
When a memory is corrected, old claims are marked `[superseded]` with date and reason across all tiers.
|
|
735
|
-
|
|
736
|
-
### Stale Agent Cleanup
|
|
737
|
-
|
|
738
|
-
Session hooks automatically clean agents with no heartbeat for >24 hours.
|
|
739
|
-
|
|
740
|
-
---
|
|
741
|
-
|
|
742
|
-
## Scaling: More Devs, More Agents
|
|
743
|
-
|
|
744
|
-
### How Multiple Agents Avoid Collisions
|
|
745
|
-
|
|
746
|
-
| Mechanism | How It Works |
|
|
747
|
-
| ----------------------------- | ----------------------------------------------------------------------------------------------- |
|
|
748
|
-
| **Worktree isolation** | Each agent gets its own git worktree (`.worktrees/NNN-slug/`). No shared working directory. |
|
|
749
|
-
| **Work announcements** | Agents announce which files/directories they're touching. Overlap detection warns of conflicts. |
|
|
750
|
-
| **Conflict risk levels** | `none` / `low` / `medium` / `high` / `critical` -- agents can decide whether to proceed. |
|
|
751
|
-
| **Collaboration suggestions** | System recommends merge order and sequential vs parallel work. |
|
|
752
|
-
| **Deploy batching** | Multiple agents' commits are squashed and pushed in a single batch, preventing push races. |
|
|
753
|
-
| **Agent-scoped memory** | Each agent has its own memory partition. Cross-agent sharing requires explicit promotion. |
|
|
754
|
-
| **Heartbeat liveness** | 30-second heartbeats detect crashed agents. Stale agents cleaned automatically. |
|
|
755
|
-
| **Exclusive claims** | Transaction-safe resource claiming with expiry prevents double-work. |
|
|
756
|
-
|
|
757
|
-
### Scaling from 1 to N Agents
|
|
758
|
-
|
|
759
|
-
```
|
|
760
|
-
1 agent: No coordination needed. Worktree optional.
|
|
761
|
-
2-3 agents: Worktrees + announcements. Deploy batching recommended.
|
|
762
|
-
4-10 agents: Full coordination. Capability routing. Deploy batching required.
|
|
763
|
-
10+ agents: All of the above + agent-scoped memory + messaging channels.
|
|
764
|
-
```
|
|
765
|
-
|
|
766
|
-
### Scaling from 1 to N Developers
|
|
767
|
-
|
|
768
|
-
| Concern | Solution |
|
|
769
|
-
| ------------------ | ------------------------------------------------------- |
|
|
770
|
-
| Config conflicts | `.uap.json` is project-scoped, not user-scoped |
|
|
771
|
-
| Memory conflicts | SQLite WAL mode supports concurrent reads |
|
|
772
|
-
| Worktree naming | Auto-numbered (001, 002, ...) prevents collisions |
|
|
773
|
-
| Deploy races | Batcher squashes and serializes state-dependent actions |
|
|
774
|
-
| Pattern drift | Patterns indexed in Qdrant, shared across all agents |
|
|
775
|
-
| Policy consistency | Policies stored in SQLite, enforced uniformly |
|
|
776
|
-
|
|
777
|
-
### Database Concurrency
|
|
778
|
-
|
|
779
|
-
All SQLite databases use WAL (Write-Ahead Logging) mode:
|
|
780
|
-
|
|
781
|
-
- Multiple concurrent readers
|
|
782
|
-
- Single writer with no reader blocking
|
|
783
|
-
- Busy timeout prevents lock contention errors
|
|
784
|
-
|
|
785
|
-
### Resource Isolation
|
|
786
|
-
|
|
787
|
-
```
|
|
788
|
-
agents/data/
|
|
789
|
-
memory/
|
|
790
|
-
short_term.db # Shared memory (WAL mode)
|
|
791
|
-
policies.db # Shared policies (WAL mode)
|
|
792
|
-
coordination/
|
|
793
|
-
coordination.db # Shared coordination (WAL mode)
|
|
794
|
-
.uap/tasks/
|
|
795
|
-
tasks.db # Shared tasks (WAL mode)
|
|
796
|
-
.uap/
|
|
797
|
-
worktree_registry.db # Shared worktree registry
|
|
798
|
-
.worktrees/
|
|
799
|
-
001-feature-a/ # Agent A's isolated checkout
|
|
800
|
-
002-feature-b/ # Agent B's isolated checkout
|
|
801
|
-
```
|
|
462
|
+
| Binary | Purpose |
|
|
463
|
+
| ----------------------- | ------------------------------------- |
|
|
464
|
+
| `uap-policy` | Standalone policy management |
|
|
465
|
+
| `llama-optimize` | llama.cpp startup parameter generator |
|
|
466
|
+
| `uap-tool-call-test` | Qwen3.5 tool call testing |
|
|
467
|
+
| `uap-tool-call-wrapper` | Qwen3.5 tool call wrapper |
|
|
468
|
+
| `uap-template-verify` | Chat template verification |
|
|
469
|
+
| `generate-lora-data` | LoRA training data generation |
|
|
802
470
|
|
|
803
471
|
---
|
|
804
472
|
|
|
@@ -808,81 +476,56 @@ agents/data/
|
|
|
808
476
|
|
|
809
477
|
```json
|
|
810
478
|
{
|
|
479
|
+
"version": "1.0.0",
|
|
811
480
|
"project": { "name": "my-project", "defaultBranch": "main" },
|
|
812
481
|
"memory": {
|
|
813
482
|
"shortTerm": { "enabled": true, "path": "./agents/data/memory/short_term.db" },
|
|
814
483
|
"longTerm": { "enabled": true, "provider": "qdrant" }
|
|
815
484
|
},
|
|
485
|
+
"multiModel": {
|
|
486
|
+
"enabled": true,
|
|
487
|
+
"models": ["opus-4.6", "qwen35"],
|
|
488
|
+
"roles": { "planner": "opus-4.6", "executor": "qwen35" },
|
|
489
|
+
"routingStrategy": "balanced"
|
|
490
|
+
},
|
|
816
491
|
"worktrees": { "enabled": true, "directory": ".worktrees" }
|
|
817
492
|
}
|
|
818
493
|
```
|
|
819
494
|
|
|
820
|
-
### opencode.json (Platform)
|
|
821
|
-
|
|
822
|
-
```json
|
|
823
|
-
{
|
|
824
|
-
"provider": {
|
|
825
|
-
"llama.cpp": {
|
|
826
|
-
"options": { "baseURL": "http://localhost:8080/v1" },
|
|
827
|
-
"models": {
|
|
828
|
-
"qwen35-a3b-iq4xs": {
|
|
829
|
-
"limit": { "context": 262144, "output": 81920 }
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
```
|
|
836
|
-
|
|
837
495
|
---
|
|
838
496
|
|
|
839
497
|
## Testing & Quality
|
|
840
498
|
|
|
841
499
|
```bash
|
|
842
|
-
npm test #
|
|
500
|
+
npm test # 693 tests across 45 test files
|
|
843
501
|
npm run build # TypeScript compilation
|
|
844
502
|
npm run lint # ESLint
|
|
845
503
|
npm run format # Prettier
|
|
504
|
+
npm run test:coverage # Coverage report (50% thresholds)
|
|
846
505
|
```
|
|
847
506
|
|
|
848
|
-
### Test Coverage
|
|
849
|
-
|
|
850
|
-
| Area | Tests |
|
|
851
|
-
| -------------- | ------------------------------------------------------- |
|
|
852
|
-
| Deploy Batcher | 16 tests |
|
|
853
|
-
| Coordination | Multi-agent lifecycle |
|
|
854
|
-
| Tasks | CRUD, dependencies, claims |
|
|
855
|
-
| Models | Router, planner, validator |
|
|
856
|
-
| Memory | Write gate, daily log, corrections, maintenance, scoped |
|
|
857
|
-
| MCP Router | Filter, output compressor |
|
|
858
|
-
| Browser | Navigation, evaluate, content extraction |
|
|
859
|
-
| Droids | Parallel execution |
|
|
860
|
-
|
|
861
507
|
---
|
|
862
508
|
|
|
863
509
|
## Requirements
|
|
864
510
|
|
|
865
|
-
| Dependency | Version | Required | Purpose
|
|
866
|
-
| ---------- | --------- | -------- |
|
|
867
|
-
| Node.js | >= 18.0.0 | Yes | Runtime
|
|
868
|
-
| git | Latest | Yes | Version control
|
|
869
|
-
| Docker | Latest | No | Local Qdrant
|
|
870
|
-
| Python 3 | Latest | No | Embeddings, Pattern RAG
|
|
511
|
+
| Dependency | Version | Required | Purpose |
|
|
512
|
+
| ---------- | --------- | -------- | -------------------------- |
|
|
513
|
+
| Node.js | >= 18.0.0 | Yes | Runtime |
|
|
514
|
+
| git | Latest | Yes | Version control, worktrees |
|
|
515
|
+
| Docker | Latest | No | Local Qdrant |
|
|
516
|
+
| Python 3 | Latest | No | Embeddings, Pattern RAG |
|
|
871
517
|
|
|
872
518
|
---
|
|
873
519
|
|
|
874
520
|
## Attribution
|
|
875
521
|
|
|
876
522
|
- Terminal-Bench patterns from [Terminal-Bench 2.0](https://github.com/aptx432/terminal-bench)
|
|
877
|
-
- Code Field prompts from [NeoVertex1/context-field](https://github.com/NeoVertex1/context-field)
|
|
878
523
|
- CloakBrowser from [CloakHQ/CloakBrowser](https://github.com/CloakHQ/CloakBrowser)
|
|
879
524
|
|
|
880
525
|
---
|
|
881
526
|
|
|
882
527
|
<div align="center">
|
|
883
528
|
|
|
884
|
-
**[Documentation](docs/
|
|
885
|
-
|
|
886
|
-
_Built for developers who want AI that learns._
|
|
529
|
+
**[Documentation](docs/INDEX.md)** | **[npm](https://www.npmjs.com/package/@miller-tech/uap)**
|
|
887
530
|
|
|
888
531
|
</div>
|