@miller-tech/uap 1.93.0 → 1.94.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 +46 -44
- package/docs/INDEX.md +28 -7
- package/docs/architecture/OVERVIEW.md +106 -17
- package/docs/architecture/PROTOCOL.md +31 -13
- package/docs/design/SELF_HARNESS.md +8 -0
- package/docs/design/UAP_REACTOR.md +17 -2
- package/docs/getting-started/CONFIGURATION.md +16 -7
- package/docs/getting-started/INSTALLATION.md +37 -18
- package/docs/getting-started/QUICKSTART.md +20 -14
- package/docs/guides/AUTOMATIC.md +9 -1
- package/docs/guides/AUTOMATIC_FEATURES.md +7 -1
- package/docs/guides/COORDINATION.md +5 -2
- package/docs/guides/DELIVER.md +3 -1
- package/docs/guides/DELIVERY_PIPELINE.md +122 -0
- package/docs/guides/DEPLOY_BATCHING.md +13 -4
- package/docs/guides/DROIDS_AND_SKILLS.md +13 -3
- package/docs/guides/LOCAL_MODELS.md +22 -7
- package/docs/guides/MCP_ROUTER.md +3 -1
- package/docs/guides/MEMORY.md +9 -4
- package/docs/guides/MULTI_MODEL.md +19 -3
- package/docs/guides/POLICIES.md +4 -2
- package/docs/guides/QWEN36_LLAMACPP.md +12 -3
- package/docs/guides/WORKTREE_WORKFLOW.md +6 -2
- package/docs/integrations/MCP_ROUTER.md +12 -3
- package/docs/integrations/RTK.md +15 -4
- package/docs/reference/API.md +9 -2
- package/docs/reference/CLI.md +13 -7
- package/docs/reference/CONFIGURATION.md +9 -3
- package/docs/reference/DATABASE_SCHEMA.md +13 -6
- package/docs/reference/FEATURES.md +135 -38
- package/docs/reference/PATTERNS.md +28 -12
- package/docs/reference/PLATFORMS.md +12 -5
- package/package.json +1 -1
- package/src/policies/enforcers/__pycache__/_common.cpython-312.pyc +0 -0
- package/tools/agents/scripts/__pycache__/toolcall_path_normalizer.cpython-312.pyc +0 -0
- package/tools/agents/scripts/anthropic_proxy.py +106 -17
- package/tools/agents/tests/test_anthropic_proxy_streaming.py +8 -3
- package/tools/agents/tests/test_overflow_truncate_count_tokens.py +112 -0
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
# Multi-Model Routing
|
|
2
2
|
|
|
3
|
-
> Applies to UAP **v1.
|
|
3
|
+
> Applies to UAP **v1.93.1**
|
|
4
|
+
|
|
5
|
+
> **🏭 Where this fits:** PREP/ROUTING — this is the station where a normal
|
|
6
|
+
> agentic workflow sends *everything* to one model: paying premium-model rates
|
|
7
|
+
> for routine edits, or trusting a cheap model with reasoning it can't handle.
|
|
8
|
+
> **What it delivers:** the right job goes to the right station — a strong
|
|
9
|
+
> planner for hard reasoning, a cheap/local executor for the bulk of the work —
|
|
10
|
+
> so you pay for expensive thinking only when the work actually needs it.
|
|
4
11
|
|
|
5
12
|
UAP runs agentic work across multiple LLMs instead of one. A high-capability
|
|
6
13
|
model plans, a cheaper or local model executes, and a reviewer model checks the
|
|
7
14
|
result. Routing decisions are made per task (and per subtask) so you pay for
|
|
8
|
-
expensive reasoning only when the work actually needs it
|
|
15
|
+
expensive reasoning only when the work actually needs it — one of the early
|
|
16
|
+
stations on your [delivery pipeline](./DELIVERY_PIPELINE.md), before a single
|
|
17
|
+
line of code is written.
|
|
9
18
|
|
|
10
19
|
## Why multi-model
|
|
11
20
|
|
|
12
21
|
A single frontier model is the simplest setup, but most of the tokens an agent
|
|
13
22
|
spends are on routine execution — applying an edit, running a tool, writing a
|
|
14
23
|
test — not on hard reasoning. Sending all of that to a premium model is
|
|
15
|
-
expensive and slow.
|
|
24
|
+
expensive and slow. Sending the *hard* reasoning to a cheap model is the
|
|
25
|
+
opposite failure. Routing fixes both.
|
|
16
26
|
|
|
17
27
|
Multi-model routing lets you:
|
|
18
28
|
|
|
@@ -130,6 +140,12 @@ The matched role is resolved to a concrete model via your role assignments.
|
|
|
130
140
|
- `balanced` — balance cost and performance (default)
|
|
131
141
|
- `adaptive` — learn from task results over time
|
|
132
142
|
|
|
143
|
+
> **One nuance worth internalizing:** when an executor stalls and the work
|
|
144
|
+
> escalates, escalate to a **stronger, distinct** model — not the same model in
|
|
145
|
+
> a different seat. A same-model judge (a local model grading its own output)
|
|
146
|
+
> was measured to add no lift. The value of routing comes from the *difference*
|
|
147
|
+
> in capability between the station that got stuck and the one you hand off to.
|
|
148
|
+
|
|
133
149
|
## The `uap model` CLI
|
|
134
150
|
|
|
135
151
|
All subcommands are defined in `src/cli/model.ts`.
|
package/docs/guides/POLICIES.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Policies
|
|
2
2
|
|
|
3
|
-
> Applies to UAP v1.
|
|
3
|
+
> Applies to UAP v1.93.1
|
|
4
|
+
|
|
5
|
+
> **🏭 Where this fits:** CROSS-CUTTING — the executable rules bolted to every station of the [delivery pipeline](./DELIVERY_PIPELINE.md). In a normal agentic workflow the "rules" live in a prose prompt the model is free to ignore; that's how work escapes isolation, skips tests, or ships without review. **What it delivers:** each rule is a Python enforcer that actually inspects an operation and can *block* it before it runs — worktree isolation, test deltas, expert review, schema diffs, artifact hygiene, and more — so the guardrails hold instead of merely being suggested.
|
|
4
6
|
|
|
5
7
|
UAP policies are **executable gates, not prose**. Each policy can carry a Python
|
|
6
8
|
enforcer that inspects an operation and decides whether it may proceed. A
|
|
@@ -51,7 +53,7 @@ on the rails — not as a containment mechanism against untrusted code.
|
|
|
51
53
|
|
|
52
54
|
## The enforcers
|
|
53
55
|
|
|
54
|
-
The enforcers in
|
|
56
|
+
Each enforcer guards a specific station of the pipeline. The enforcers in
|
|
55
57
|
[`src/policies/enforcers/`](../../src/policies/enforcers/) group as follows.
|
|
56
58
|
`_common.py` is shared helper code, not an enforcer.
|
|
57
59
|
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
# Qwen3.6 35B-A3B on llama.cpp, by VRAM tier — with UAP
|
|
2
2
|
|
|
3
|
+
> **🏭 Where this fits:** BUILD — this is the station where a one-shot local
|
|
4
|
+
> model breaks: it flails on a non-trivial change, emits plausible-but-wrong
|
|
5
|
+
> code, or stalls. **What it delivers:** a copy-paste local stack (8–32 GB GPU)
|
|
6
|
+
> where `uap deliver` drives the model against your real gates until the change
|
|
7
|
+
> is *verified* — a cheap, on-your-own-hardware model that punches above its
|
|
8
|
+
> weight.
|
|
9
|
+
|
|
3
10
|
This is the recommended local stack for UAP: **Qwen3.6 35B-A3B** (a Mixture-of-
|
|
4
11
|
Experts model with only **~3B active parameters** per token) served by
|
|
5
12
|
**llama.cpp**, driven by **UAP's automatic features** — above all `uap deliver`,
|
|
6
13
|
which iterates the model against your real build/test gates until the change is
|
|
7
|
-
*verified*. That convergence loop is
|
|
8
|
-
**punch well above its weight**: one-shot
|
|
9
|
-
delivers.
|
|
14
|
+
*verified*. That convergence loop is the station that keeps a small, cheap,
|
|
15
|
+
local model on the rails and lets it **punch well above its weight**: one-shot
|
|
16
|
+
it would flail; driven to green it delivers. (This is the BUILD stage of your
|
|
17
|
+
[delivery pipeline](./DELIVERY_PIPELINE.md) — the point where naive agentic
|
|
18
|
+
workflows ship stubs.)
|
|
10
19
|
|
|
11
20
|
Because the active footprint is ~3B, this model runs usefully even on modest
|
|
12
21
|
GPUs by **offloading the (sparse, mostly-idle) expert tensors to system RAM**
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
# Worktree Workflow
|
|
2
2
|
|
|
3
|
-
> Applies to UAP v1.
|
|
3
|
+
> Applies to UAP v1.93.1
|
|
4
|
+
|
|
5
|
+
> **🏭 Where this fits:** ISOLATION — the station where a normal agentic workflow smears half-finished edits across `main`, clobbers files, and lets parallel agents collide into corrupt merge state. **What it delivers:** every agent works on its own branch in its own checkout, so the project root stays clean, each unit of work has a tidy PR boundary, and any number of agents can run at once without stepping on each other.
|
|
4
6
|
|
|
5
7
|
UAP runs agents — often many of them at once — against a single repository. The
|
|
6
8
|
worktree workflow exists to keep every edit an agent makes isolated on its own
|
|
7
9
|
branch and its own checkout, so that agent work never touches the project root
|
|
8
|
-
and parallel agents never collide.
|
|
10
|
+
and parallel agents never collide. Think of it as giving each agent its own
|
|
11
|
+
workstation on the [delivery pipeline](./DELIVERY_PIPELINE.md) instead of
|
|
12
|
+
crowding them around one bench. This guide explains why that matters, walks
|
|
9
13
|
through the full lifecycle, and documents every `uap worktree` subcommand.
|
|
10
14
|
|
|
11
15
|
The implementation lives in [`src/cli/worktree.ts`](../../src/cli/worktree.ts).
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# MCP Router
|
|
2
2
|
|
|
3
|
-
`v1.
|
|
3
|
+
`v1.93.1` · `src/mcp-router/`
|
|
4
|
+
|
|
5
|
+
> **🏭 Where this fits:** Cross-cutting (keeps the belt from jamming) — every
|
|
6
|
+
> station downstream stalls when your agent's context window is choked with
|
|
7
|
+
> hundreds of tool schemas and raw tool dumps, so it loses the thread and burns
|
|
8
|
+
> budget before doing any work. **What it delivers:** up to 98% fewer
|
|
9
|
+
> tool-definition tokens and relevance-ranked tool output, so context stays lean
|
|
10
|
+
> and work keeps moving down the [delivery pipeline](../guides/DELIVERY_PIPELINE.md).
|
|
4
11
|
|
|
5
12
|
The MCP Router is a hierarchical Model Context Protocol server that sits in
|
|
6
13
|
front of all of your downstream MCP servers and dramatically reduces the tokens
|
|
@@ -18,7 +25,8 @@ A normal MCP setup exposes every tool from every server directly to the model.
|
|
|
18
25
|
With a dozen servers that is easily 150+ tool schemas at roughly ~500 tokens
|
|
19
26
|
each — tens of thousands of tokens of context burned before the agent does any
|
|
20
27
|
work. On top of that, tools like file readers and shell wrappers return large
|
|
21
|
-
outputs that flood the context window.
|
|
28
|
+
outputs that flood the context window. Either way, the belt jams: your agent is
|
|
29
|
+
reasoning around clutter instead of the task.
|
|
22
30
|
|
|
23
31
|
The router fixes both:
|
|
24
32
|
|
|
@@ -144,4 +152,5 @@ router's view, not deleted) and re-run `uap mcp-setup`.
|
|
|
144
152
|
per-output FTS5 savings are computed live for each call and reported by
|
|
145
153
|
`uap mcp-router stats`.
|
|
146
154
|
- Pair the router with **RTK** for CLI-output savings — see
|
|
147
|
-
[RTK.md](RTK.md). The two are complementary (tool definitions + CLI output)
|
|
155
|
+
[RTK.md](RTK.md). The two are complementary (tool definitions + CLI output),
|
|
156
|
+
and together they keep the whole belt clear of context clutter.
|
package/docs/integrations/RTK.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# RTK — Rust Token Killer
|
|
2
2
|
|
|
3
|
-
`v1.
|
|
3
|
+
`v1.93.1` · `src/cli/rtk.ts`
|
|
4
|
+
|
|
5
|
+
> **🏭 Where this fits:** Cross-cutting (keeps the belt from jamming) — every
|
|
6
|
+
> `git status`, test run, and file dump your agent echoes floods the context
|
|
7
|
+
> window, so it loses focus and burns budget on terminal noise. **What it
|
|
8
|
+
> delivers:** 60–90% fewer tokens on CLI-command output, transparently, so
|
|
9
|
+
> context stays lean at every station of the
|
|
10
|
+
> [delivery pipeline](../guides/DELIVERY_PIPELINE.md).
|
|
4
11
|
|
|
5
12
|
RTK (Rust Token Killer) is a fast CLI proxy that compresses and filters the
|
|
6
13
|
output of command-line tools — `git status`, test runs, file reads, and similar
|
|
@@ -15,7 +22,9 @@ it; `uap rtk` manages installation and wiring.
|
|
|
15
22
|
|
|
16
23
|
## Why RTK + the MCP Router
|
|
17
24
|
|
|
18
|
-
The two integrations
|
|
25
|
+
The two integrations guard the same cross-cutting concern — keeping context lean
|
|
26
|
+
so no station downstream jams — but target different sources of token waste, and
|
|
27
|
+
they stack:
|
|
19
28
|
|
|
20
29
|
| Layer | Tool | Saves on |
|
|
21
30
|
|-------|------|----------|
|
|
@@ -76,7 +85,8 @@ Reports whether the `rtk` binary is installed, whether the rewrite hook
|
|
|
76
85
|
Once the rewrite hook is installed, heavy CLI commands are transparently routed
|
|
77
86
|
through RTK (e.g. `git status` is rewritten to `rtk git status`) with zero
|
|
78
87
|
extra tokens of overhead — the agent issues normal commands and RTK compresses
|
|
79
|
-
the output before it reaches the model.
|
|
88
|
+
the output before it reaches the model. Your agent never knows the belt is being
|
|
89
|
+
kept clear underneath it.
|
|
80
90
|
|
|
81
91
|
UAP can nudge agents to route heavy CLIs through RTK via the `rtk_wrap.py`
|
|
82
92
|
policy enforcer (`src/policies/enforcers/rtk_wrap.py`).
|
|
@@ -99,4 +109,5 @@ rtk --version # verify the install
|
|
|
99
109
|
reduction from both layers at once.
|
|
100
110
|
|
|
101
111
|
See also: [MCP_ROUTER.md](MCP_ROUTER.md) ·
|
|
102
|
-
[../architecture/OVERVIEW.md](../architecture/OVERVIEW.md)
|
|
112
|
+
[../architecture/OVERVIEW.md](../architecture/OVERVIEW.md) ·
|
|
113
|
+
[../guides/DELIVERY_PIPELINE.md](../guides/DELIVERY_PIPELINE.md)
|
package/docs/reference/API.md
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
# UAP Programmatic API Reference
|
|
2
2
|
|
|
3
|
-
> Public API of the `@miller-tech/uap` package. Version v1.
|
|
3
|
+
> Public API of the `@miller-tech/uap` package. Version v1.93.1.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> **🏭 Where this fits:** Cross-cutting — the machine parts behind the line.
|
|
6
|
+
> **What it delivers:** when the `uap` CLI isn't the right shape for your job,
|
|
7
|
+
> these exports let you wire UAP's memory, routing, coordination, and MCP
|
|
8
|
+
> stations straight into your own tools and drive the [delivery pipeline](../guides/DELIVERY_PIPELINE.md)
|
|
9
|
+
> from your own code.
|
|
10
|
+
|
|
11
|
+
If the CLI is the control panel, this is the parts bin — the same subsystems,
|
|
12
|
+
exposed so you can bolt them into your own harness. Install and import:
|
|
6
13
|
|
|
7
14
|
```bash
|
|
8
15
|
npm install @miller-tech/uap
|
package/docs/reference/CLI.md
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
# UAP CLI Reference
|
|
2
2
|
|
|
3
3
|
> Complete command reference for the Universal Agent Protocol command-line interface (`uap`).
|
|
4
|
-
> Version v1.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
> Version v1.93.1.
|
|
5
|
+
|
|
6
|
+
> **🏭 Where this fits:** Every station — this is the control panel for the whole
|
|
7
|
+
> line. **What it delivers:** one binary that drives each stage of your
|
|
8
|
+
> [delivery pipeline](../guides/DELIVERY_PIPELINE.md), from understanding the work
|
|
9
|
+
> to shipping it safely, so you operate the factory from a single door.
|
|
10
|
+
|
|
11
|
+
The `uap` binary is the single entry point for every UAP capability — the
|
|
12
|
+
control panel for the whole line. From here you run project initialization, the
|
|
13
|
+
tiered memory system (Intake/Feedback), the git worktree workflow (Isolation),
|
|
14
|
+
multi-agent coordination (Line coordination), task management, the multi-model
|
|
15
|
+
architecture (Prep/Routing), the MCP router, policy enforcement (cross-cutting),
|
|
16
|
+
the delivery convergence loop (Build → QC/Verify), and platform hook management.
|
|
11
17
|
|
|
12
18
|
```bash
|
|
13
19
|
uap --help # top-level command list
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
# Configuration Reference
|
|
2
2
|
|
|
3
|
-
> Universal Agent Protocol (UAP) v1.
|
|
3
|
+
> Universal Agent Protocol (UAP) v1.93.1
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
> **🏭 Where this fits:** Cross-cutting — the settings that tune every station.
|
|
6
|
+
> **What it delivers:** the dials that decide how your [delivery pipeline](../guides/DELIVERY_PIPELINE.md)
|
|
7
|
+
> runs — where memory lives, which model builds, how strict the gates are — so
|
|
8
|
+
> the line behaves the way your project needs.
|
|
9
|
+
|
|
10
|
+
Think of this as the machine's control settings: the values that tune each
|
|
11
|
+
station on the line. All configuration surfaces below are verified against
|
|
12
|
+
source. Only options that exist in code are documented here.
|
|
7
13
|
|
|
8
14
|
## Config files
|
|
9
15
|
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
# Database Schema Reference
|
|
2
2
|
|
|
3
|
-
> Universal Agent Protocol (UAP) v1.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
> Universal Agent Protocol (UAP) v1.93.1
|
|
4
|
+
|
|
5
|
+
> **🏭 Where this fits:** Cross-cutting — the shop's records and shift log.
|
|
6
|
+
> **What it delivers:** the durable memory of your [delivery pipeline](../guides/DELIVERY_PIPELINE.md)
|
|
7
|
+
> — tasks, coordination, policies, and what the floor has learned — so nothing a
|
|
8
|
+
> station knows is lost when the session ends.
|
|
9
|
+
|
|
10
|
+
These databases are the factory's paperwork: the job tickets, the coordination
|
|
11
|
+
board, the enforced rulebook, and the long-term memory that lets tomorrow's
|
|
12
|
+
session pick up where today's left off. UAP persists state in a set of SQLite
|
|
13
|
+
databases (via `better-sqlite3`, WAL mode) plus a Qdrant vector store for
|
|
14
|
+
semantic search. All schemas below are grounded in source. Paths are resolved
|
|
15
|
+
relative to the project working directory unless noted otherwise.
|
|
9
16
|
|
|
10
17
|
## SQLite databases
|
|
11
18
|
|
|
@@ -1,14 +1,65 @@
|
|
|
1
1
|
# Feature Catalog
|
|
2
2
|
|
|
3
|
-
> Universal Agent Protocol (UAP) v1.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
> Universal Agent Protocol (UAP) v1.93.1
|
|
4
|
+
|
|
5
|
+
> **🏭 Where this fits:** Every station on the line — this catalog is the parts list for the whole factory. **What it delivers:** each feature below is mapped to the stage of your [delivery pipeline](../guides/DELIVERY_PIPELINE.md) it protects, so you can see exactly where your agent's work stops being plausible-looking and starts being genuinely shippable.
|
|
6
|
+
|
|
7
|
+
Think of getting software out of an agent as a line in a factory. Raw intent
|
|
8
|
+
comes in one end; a working, shipped change comes out the other. Between those
|
|
9
|
+
two points sit eight stations, and typical agentic workflows break at
|
|
10
|
+
predictable ones — the agent forgets what it learned last session, edits the
|
|
11
|
+
wrong file, or (the big one) declares "done" on code that never ran.
|
|
12
|
+
|
|
13
|
+
UAP is the machinery bolted to that line: memory, coordination, and enforcement
|
|
14
|
+
that keep the work moving from station to station without silently shipping a
|
|
15
|
+
defect. The features below are grouped by source subsystem under `src/`, and
|
|
16
|
+
each entry names the pipeline stage it guards so you can see what it does *for
|
|
17
|
+
you*, not just what it is.
|
|
18
|
+
|
|
19
|
+
## The line at a glance
|
|
20
|
+
|
|
21
|
+
Every feature in this catalog serves one of eight stations. When your agent
|
|
22
|
+
"goes wrong," it is almost always because one of these stations had no guard:
|
|
23
|
+
|
|
24
|
+
1. **Intake** — understand the work. Agents forget past sessions and hallucinate
|
|
25
|
+
scope; 4-tier memory, reactor per-prompt injection, and DESIGN.md keep intent
|
|
26
|
+
grounded.
|
|
27
|
+
2. **Prep / Routing** — send the right job to the right station. Pattern router,
|
|
28
|
+
query-complexity scoring, and multi-model routing stop over- and
|
|
29
|
+
under-thinking.
|
|
30
|
+
3. **Isolation** — give each job its own bench. Worktree-per-feature, always-on
|
|
31
|
+
file coordination, and the delivery gate keep agents off `main` and out of
|
|
32
|
+
each other's files.
|
|
33
|
+
4. **Build** — make the thing. The deliver convergence loop, serving-layer
|
|
34
|
+
recipes, and proxy/local-model guardrails turn plausible-but-wrong output
|
|
35
|
+
into real files.
|
|
36
|
+
5. **QC / Verify** — prove it runs. **The station everyone skips.** Completion
|
|
37
|
+
gates, execution/runtime verification, the acceptance judge, and a
|
|
38
|
+
generator≠evaluator split mean "done" is checked by something other than the
|
|
39
|
+
model that wrote the code.
|
|
40
|
+
6. **Line coordination** — many workers, one floor. The coordination DB, the
|
|
41
|
+
collaboration board with challenge mode, model-slot concurrency, and deploy
|
|
42
|
+
batching keep parallel agents from colliding or deadlocking.
|
|
43
|
+
7. **Shipping** — out the door safely. The worktree→PR flow, version/completion
|
|
44
|
+
gates, the CI feedback watcher, and git-safety stop regressions and force-push
|
|
45
|
+
disasters.
|
|
46
|
+
8. **Feedback** — the floor learns. Memory promotion, pattern reinforcement, and
|
|
47
|
+
session analysis make sure the same mistake doesn't recur every session.
|
|
48
|
+
|
|
49
|
+
Two things run *across* every station: **policy gates** turn your rules into
|
|
50
|
+
executable checks enforced at each bench (not prose in a README), and the **MCP
|
|
51
|
+
router** keeps the context window lean so the line stays fast. It all works
|
|
52
|
+
across 9 agent harnesses.
|
|
53
|
+
|
|
54
|
+
## Memory (`src/memory/`) — Intake & Feedback
|
|
55
|
+
|
|
56
|
+
> **Stage: Intake / Feedback.** Your agent walks onto the floor every session
|
|
57
|
+
> with amnesia. This subsystem is its long-term memory of what the shop already
|
|
58
|
+
> learned, so it stops re-discovering the same facts and re-making the same
|
|
59
|
+
> mistakes.
|
|
60
|
+
|
|
61
|
+
Hierarchical, tiered memory with semantic recall — the largest subsystem, and
|
|
62
|
+
the reason a UAP agent picks up where the last one left off.
|
|
12
63
|
|
|
13
64
|
| Feature | Description |
|
|
14
65
|
|---------|-------------|
|
|
@@ -23,7 +74,7 @@ Hierarchical, tiered memory with semantic recall — the largest subsystem.
|
|
|
23
74
|
| Speculative cache (`speculative-cache.ts`) | Pre-fetches likely-needed memory. |
|
|
24
75
|
| Consolidator / maintenance (`memory-consolidator.ts`, `memory-maintenance.ts`) | Consolidate and garbage-collect memory over time. |
|
|
25
76
|
| Write gate (`write-gate.ts`) | Quality filter for what gets written to memory. |
|
|
26
|
-
| Daily log (`daily-log.ts`) | Staging log with promotion (`gate_score`) to long-term memory. |
|
|
77
|
+
| Daily log (`daily-log.ts`) | Staging log with promotion (`gate_score`) to long-term memory — the Feedback path where a session's lessons graduate to permanent knowledge. |
|
|
27
78
|
| Correction propagation (`correction-propagator.ts`) | Supersedes stale entries when corrections are made. |
|
|
28
79
|
| Predictive memory (`predictive-memory.ts`) | Learns query patterns to predict needed context. |
|
|
29
80
|
| Knowledge graph (`knowledge-graph.ts`) | L4 entity/relationship graph. |
|
|
@@ -33,7 +84,12 @@ Hierarchical, tiered memory with semantic recall — the largest subsystem.
|
|
|
33
84
|
| Prepopulate (`prepopulate.ts`) | Seeds memory and discovers skills for CLAUDE.md generation. |
|
|
34
85
|
| Terminal-bench knowledge (`terminal-bench-knowledge.ts`) | Curated benchmark knowledge. |
|
|
35
86
|
|
|
36
|
-
## Models (`src/models/`)
|
|
87
|
+
## Models (`src/models/`) — Prep / Routing
|
|
88
|
+
|
|
89
|
+
> **Stage: Prep / Routing.** The wrong worker on the wrong job wastes the whole
|
|
90
|
+
> shift. This subsystem sizes up each task and routes it to the right model and
|
|
91
|
+
> the right amount of thinking — no more over-planning a one-liner or
|
|
92
|
+
> under-powering a refactor.
|
|
37
93
|
|
|
38
94
|
Multi-model, two-tier (planner/executor) architecture.
|
|
39
95
|
|
|
@@ -47,7 +103,12 @@ Multi-model, two-tier (planner/executor) architecture.
|
|
|
47
103
|
| Analytics (`analytics.ts`) | Per-task token/cost/outcome metrics (`model_analytics.db`). |
|
|
48
104
|
| OpenAI-compat client (`openai-compat-client.ts`) | OpenAI `/v1`-compatible client (default endpoint `http://localhost:4000/v1`). |
|
|
49
105
|
|
|
50
|
-
## Coordination (`src/coordination/`)
|
|
106
|
+
## Coordination (`src/coordination/`) — Line coordination & Prep
|
|
107
|
+
|
|
108
|
+
> **Stage: Line coordination.** Put many agents on one floor and they collide,
|
|
109
|
+
> duplicate work, or deadlock. This layer is the shop foreman: it tracks who is
|
|
110
|
+
> doing what, routes work by capability, and batches shipping actions so nobody
|
|
111
|
+
> trips over anybody.
|
|
51
112
|
|
|
52
113
|
Multi-agent coordination layer.
|
|
53
114
|
|
|
@@ -58,10 +119,14 @@ Multi-agent coordination layer.
|
|
|
58
119
|
| Capability router (`capability-router.ts`) | Routes tasks to droids by capability. |
|
|
59
120
|
| Auto-agent (`auto-agent.ts`) | Auto-agent driver. |
|
|
60
121
|
| Pattern router (`pattern-router.ts`) | Matches tasks to execution patterns; always includes P12/P35. |
|
|
61
|
-
| Adaptive patterns (`adaptive-patterns.ts`) | Tracks pattern success outcomes to adapt selection. |
|
|
122
|
+
| Adaptive patterns (`adaptive-patterns.ts`) | Tracks pattern success outcomes to adapt selection — Feedback that makes routing smarter over time. |
|
|
62
123
|
| Expert orchestrator (`expert-orchestrator.ts`) | Orchestrates parallel expert/droid review. |
|
|
63
124
|
|
|
64
|
-
## Tasks (`src/tasks/`)
|
|
125
|
+
## Tasks (`src/tasks/`) — Intake & Line coordination
|
|
126
|
+
|
|
127
|
+
> **Stage: Intake / Line coordination.** Work that isn't written down gets
|
|
128
|
+
> dropped or done twice. This is the job ticket system — what needs doing, what
|
|
129
|
+
> blocks what, and who has claimed the bench.
|
|
65
130
|
|
|
66
131
|
Task management system (positioned as an alternative to Beads).
|
|
67
132
|
|
|
@@ -73,7 +138,11 @@ Task management system (positioned as an alternative to Beads).
|
|
|
73
138
|
| Decoder gate (`decoder-gate.ts`) | Full decoder-first (P35) validator. |
|
|
74
139
|
| Event bus (`event-bus.ts`) | `TaskEventBus` for task lifecycle events. |
|
|
75
140
|
|
|
76
|
-
## Policies (`src/policies/`)
|
|
141
|
+
## Policies (`src/policies/`) — Cross-cutting enforcement
|
|
142
|
+
|
|
143
|
+
> **Stage: Every station.** Rules written in a README are suggestions your agent
|
|
144
|
+
> ignores. This engine turns them into executable checks fired at each bench, so
|
|
145
|
+
> a policy actually *blocks* the wrong move instead of politely hoping.
|
|
77
146
|
|
|
78
147
|
DB-driven policy enforcement engine.
|
|
79
148
|
|
|
@@ -86,10 +155,16 @@ DB-driven policy enforcement engine.
|
|
|
86
155
|
| CLAUDE.md conversion (`convert-policy-to-claude.ts`) | Renders policies into CLAUDE.md. |
|
|
87
156
|
| Enforcers (`enforcers/`) | ~20 Python enforcers (worktree_required, test_gate, schema_diff_gate, memory_before_plan, coord_overlap, mcp_router_first, rtk_wrap, iac_parity, expert_review_required, etc.). |
|
|
88
157
|
|
|
89
|
-
## Delivery (`src/delivery/`)
|
|
158
|
+
## Delivery (`src/delivery/`) — Build & QC / Verify
|
|
90
159
|
|
|
91
|
-
|
|
92
|
-
|
|
160
|
+
> **Stage: Build → QC / Verify.** This is where the sausage actually gets made,
|
|
161
|
+
> and where the biggest agentic failure lives: declaring "done" on code that
|
|
162
|
+
> doesn't compile or run. The convergence loop drives a model through
|
|
163
|
+
> execute → apply → verify → feedback against your real completion gates until it
|
|
164
|
+
> is genuinely *delivered* — not just claimed.
|
|
165
|
+
|
|
166
|
+
A loop that keeps building and re-checking until the work passes the same gates
|
|
167
|
+
you'd run by hand.
|
|
93
168
|
|
|
94
169
|
| Feature | Description |
|
|
95
170
|
|---------|-------------|
|
|
@@ -97,15 +172,19 @@ against real completion gates until "delivered".
|
|
|
97
172
|
| Run coordinator (`run-coordinator.ts`) | Coordinates a delivery run. |
|
|
98
173
|
| Explorer (`explorer.ts`) | Best-of-N candidate generation. |
|
|
99
174
|
| Applier (`applier.ts`) | Applies file changes. |
|
|
100
|
-
| Verifier ladder (`verifier-ladder.ts`) | Build/typecheck/test/lint gate ladder. |
|
|
101
|
-
| Judge / critic (`judge.ts`, `critic.ts`) | Evaluate and critique turns. |
|
|
175
|
+
| Verifier ladder (`verifier-ladder.ts`) | Build/typecheck/test/lint gate ladder — the QC checks that prove it runs. |
|
|
176
|
+
| Judge / critic (`judge.ts`, `critic.ts`) | Evaluate and critique turns with a grader distinct from the builder (generator≠evaluator). |
|
|
102
177
|
| Escalation (`escalation.ts`) | Stagnation escalation ladder. |
|
|
103
178
|
| Auto-optimizer (`auto-optimizer.ts`) | Dynamically enables aids. |
|
|
104
179
|
| Ideation / practice / spec-imports | Divergent strategy seeds, best-practice cards, curated project seeds. |
|
|
105
180
|
| HALO trace (`halo-trace.ts`) | Emits HALO spans. |
|
|
106
|
-
| Integrity (`integrity.ts`) | Test-protection / integrity guard. |
|
|
181
|
+
| Integrity (`integrity.ts`) | Test-protection / integrity guard — stops the model from gutting the tests to "pass." |
|
|
182
|
+
|
|
183
|
+
## MCP Router (`src/mcp-router/`) — Cross-cutting (lean context)
|
|
107
184
|
|
|
108
|
-
|
|
185
|
+
> **Stage: Every station.** A stuffed context window slows and confuses the whole
|
|
186
|
+
> line. This router keeps it lean so every station runs on the signal that
|
|
187
|
+
> matters.
|
|
109
188
|
|
|
110
189
|
Hierarchical MCP router that collapses 150+ MCP tools to 2
|
|
111
190
|
(`discover_tools`, `execute_tool`) for ~98% token reduction.
|
|
@@ -121,7 +200,10 @@ Hierarchical MCP router that collapses 150+ MCP tools to 2
|
|
|
121
200
|
| Experts (`experts/registry.ts`) | Expert-consult registry. |
|
|
122
201
|
| Tools (`tools/`) | `discover`, `execute`, `deliver` handlers. |
|
|
123
202
|
|
|
124
|
-
## Dashboard (`src/dashboard/`)
|
|
203
|
+
## Dashboard (`src/dashboard/`) — Observability
|
|
204
|
+
|
|
205
|
+
> **Stage: Watching the floor.** You can't fix a line you can't see. The
|
|
206
|
+
> dashboard is the control-room view of tasks, agents, memory, and models.
|
|
125
207
|
|
|
126
208
|
| Feature | Description |
|
|
127
209
|
|---------|-------------|
|
|
@@ -130,28 +212,42 @@ Hierarchical MCP router that collapses 150+ MCP tools to 2
|
|
|
130
212
|
| Server (`server.ts`) | Web dashboard server (default port 3847). |
|
|
131
213
|
| Data seeder (`data-seeder.ts`) | Seeds demo/initial dashboard data. |
|
|
132
214
|
|
|
133
|
-
## Analyzers & Generators
|
|
215
|
+
## Analyzers & Generators — Intake
|
|
216
|
+
|
|
217
|
+
> **Stage: Intake.** Before the line can run, it has to understand the shop it's
|
|
218
|
+
> working in. These build a picture of your project and generate the agent
|
|
219
|
+
> context files from it.
|
|
134
220
|
|
|
135
221
|
| Subsystem | Description |
|
|
136
222
|
|-----------|-------------|
|
|
137
223
|
| Analyzers (`analyzers/`) | `analyzeProject(cwd)` builds a `ProjectAnalysis` (languages, frameworks, dirs) from `.uap.json`, git, package files. |
|
|
138
224
|
| Generators (`generators/claude-md.ts`) | Handlebars-based CLAUDE.md / web AGENT.md generation from analysis + discovered skills. |
|
|
139
225
|
|
|
140
|
-
## Observability & Telemetry
|
|
226
|
+
## Observability & Telemetry — Feedback
|
|
227
|
+
|
|
228
|
+
> **Stage: Feedback.** Traces are how the floor learns *why* it stalled. Opt-in
|
|
229
|
+
> spans feed the HALO engine so systemic failures surface instead of repeating.
|
|
141
230
|
|
|
142
231
|
| Subsystem | Description |
|
|
143
232
|
|-----------|-------------|
|
|
144
233
|
| Observability (`observability/halo-exporter.ts`) | Emits agent/LLM/tool spans as OTLP/OpenInference JSONL for the HALO engine. Opt-in via `UAP_HALO_TRACE`; zero-overhead when off. |
|
|
145
234
|
| Telemetry (`telemetry/session-telemetry.ts`) | Session-level telemetry capture. |
|
|
146
235
|
|
|
147
|
-
## Browser & Benchmarks
|
|
236
|
+
## Browser & Benchmarks — QC / Verify
|
|
237
|
+
|
|
238
|
+
> **Stage: QC / Verify.** Real proof beats a confident claim. The browser wrapper
|
|
239
|
+
> lets an agent actually drive a page, and the benchmark harness measures a plain
|
|
240
|
+
> agent against a UAP-augmented one.
|
|
148
241
|
|
|
149
242
|
| Subsystem | Description |
|
|
150
243
|
|-----------|-------------|
|
|
151
244
|
| Browser (`browser/web-browser.ts`) | `WebBrowser` automation wrapper for agents. |
|
|
152
245
|
| Benchmarks (`benchmarks/`) | Benchmark harness comparing a naive agent vs UAP-augmented agent; multi-turn loops, token throughput, speculative autotune. |
|
|
153
246
|
|
|
154
|
-
## Droids
|
|
247
|
+
## Droids — Line coordination
|
|
248
|
+
|
|
249
|
+
> **Stage: Line coordination.** Specialist reviewers on call. The expert-droid
|
|
250
|
+
> roster gives the orchestrator a bench of named experts to run in parallel.
|
|
155
251
|
|
|
156
252
|
The expert-droid roster lives as markdown-with-JSON-frontmatter files under
|
|
157
253
|
`.factory/droids/*.md`, discovered at runtime by `discoverDroids()` in
|
|
@@ -159,18 +255,19 @@ The expert-droid roster lives as markdown-with-JSON-frontmatter files under
|
|
|
159
255
|
schema and exposes `uap_droid_list` / `uap_droid_invoke`, plus the
|
|
160
256
|
decoder-first (P35) and worktree gates. See `docs/reference/EXPERT_DROIDS.md`.
|
|
161
257
|
|
|
162
|
-
## Utilities (`src/utils/`)
|
|
258
|
+
## Utilities (`src/utils/`) — Cross-cutting
|
|
163
259
|
|
|
164
|
-
Shared helpers: adaptive cache,
|
|
165
|
-
config loader, lazy imports,
|
|
166
|
-
|
|
167
|
-
|
|
260
|
+
Shared helpers that keep the rest of the line reliable: adaptive cache,
|
|
261
|
+
concurrency pools (retry/timeout/fallback), config loader, lazy imports,
|
|
262
|
+
structured logger, CLAUDE.md merge, performance monitor, query-complexity
|
|
263
|
+
scoring (the Prep-stage signal that sizes a task), rate limiter, string
|
|
264
|
+
similarity, and system resource detection.
|
|
168
265
|
|
|
169
266
|
## CLI surface (`src/bin/cli.ts`)
|
|
170
267
|
|
|
171
|
-
The `uap` CLI
|
|
172
|
-
`
|
|
173
|
-
`deliver`, `harness` (HALO), `ideate`,
|
|
174
|
-
`
|
|
175
|
-
`
|
|
176
|
-
`policy`, `uap-omp`.
|
|
268
|
+
The `uap` CLI is the single door into the whole factory (top-level commands):
|
|
269
|
+
`init`, `setup`, `analyze`, `generate`, `memory`, `patterns`, `worktree`,
|
|
270
|
+
`sync`, `droids`, `expert-route`, `deliver`, `harness` (HALO), `ideate`,
|
|
271
|
+
`coord`, `agent`, `deploy`, `task`, `compliance`, `coordination`, `skill`,
|
|
272
|
+
`update`, `dashboard` (alias `dash`), `model`, `mcp-router`, `hooks`,
|
|
273
|
+
`tool-calls`, `rtk`, `mcp-setup`, `schema-diff`, `policy`, `uap-omp`.
|
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
# Pattern Library Reference
|
|
2
2
|
|
|
3
|
-
> Universal Agent Protocol (UAP) v1.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
> Universal Agent Protocol (UAP) v1.93.1
|
|
4
|
+
|
|
5
|
+
> **🏭 Where this fits:** Prep / Routing — before your agent starts cutting, it
|
|
6
|
+
> should pick the right technique for the job. **What it delivers:** the right
|
|
7
|
+
> proven playbook is matched to the task and handed to your agent, so it stops
|
|
8
|
+
> improvising an approach that quietly breaks the [delivery pipeline](../guides/DELIVERY_PIPELINE.md)
|
|
9
|
+
> two stations later.
|
|
10
|
+
|
|
11
|
+
Left to itself, an agent invents a fresh (and often wrong) approach for every
|
|
12
|
+
task. UAP's execution-pattern library is a rack of proven playbooks — reusable
|
|
13
|
+
problem-solving strategies — that get matched to what you're actually doing and
|
|
14
|
+
handed to the agent before it acts. That's the Prep/Routing station: right job,
|
|
15
|
+
right technique, right bench.
|
|
16
|
+
|
|
17
|
+
Several of these patterns are quietly the guardrails on the QC station too —
|
|
18
|
+
they exist because agents love to skip verification. Patterns are defined as
|
|
19
|
+
markdown files under `.factory/patterns/`, catalogued in
|
|
20
|
+
`.factory/patterns/index.json`, and retrieved on demand via a Qdrant-backed
|
|
9
21
|
RAG flow (`uap patterns query`).
|
|
10
22
|
|
|
11
23
|
## The 23 Patterns
|
|
12
24
|
|
|
13
25
|
The canonical roster lives in `.factory/patterns/index.json`. Each pattern has
|
|
14
26
|
a numeric (or string) id, a markdown body file, a title, an abbreviation, a
|
|
15
|
-
category, and a keyword set used for retrieval.
|
|
27
|
+
category, and a keyword set used for retrieval. The `Verification` category is
|
|
28
|
+
the QC/Verify station in playbook form — the checks that turn "looks done" into
|
|
29
|
+
"proven done."
|
|
16
30
|
|
|
17
31
|
| ID | Title | Abbreviation | Category | What it does |
|
|
18
32
|
|----|-------|--------------|----------|--------------|
|
|
@@ -42,20 +56,22 @@ category, and a keyword set used for retrieval.
|
|
|
42
56
|
|
|
43
57
|
### Always-on patterns
|
|
44
58
|
|
|
45
|
-
Two patterns are
|
|
46
|
-
in
|
|
59
|
+
Two patterns are the non-negotiable QC guards on the line — bolted on
|
|
60
|
+
unconditionally regardless of the matched task, set in
|
|
61
|
+
`src/coordination/pattern-router.ts`:
|
|
47
62
|
|
|
48
63
|
```js
|
|
49
64
|
const alwaysIncludeIds = ['P12', 'P35']; // Output Existence, Decoder-First
|
|
50
65
|
```
|
|
51
66
|
|
|
52
|
-
- **P12 (Output Existence Verification)** —
|
|
53
|
-
|
|
67
|
+
- **P12 (Output Existence Verification)** — the anti-"claiming done" guard:
|
|
68
|
+
no artifact, no done.
|
|
54
69
|
- **P35 (Decoder-First Analysis)** — anchors format/reverse-engineering work.
|
|
55
70
|
|
|
56
71
|
## How pattern RAG works
|
|
57
72
|
|
|
58
|
-
Pattern retrieval is semantic, not keyword-based
|
|
73
|
+
Pattern retrieval is semantic, not keyword-based — the router matches on what
|
|
74
|
+
the task *means*, not just the words in it. The flow:
|
|
59
75
|
|
|
60
76
|
1. **Indexing** (`uap patterns index`) runs a generated Python indexer
|
|
61
77
|
(`agents/scripts/index_patterns_to_qdrant.py`). It scans multiple sources —
|