@miller-tech/uap 1.221.0 → 2.0.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.
Files changed (238) hide show
  1. package/README.md +19 -9
  2. package/config/exl3-profiles/qwen38-27b-exl3.env +68 -0
  3. package/config/llama-profiles/qwen38-27b-dflash2.env +6 -1
  4. package/dist/.tsbuildinfo +1 -1
  5. package/dist/benchmarks/paired/adapter.d.ts +15 -0
  6. package/dist/benchmarks/paired/adapter.d.ts.map +1 -1
  7. package/dist/benchmarks/paired/adapter.js +22 -1
  8. package/dist/benchmarks/paired/adapter.js.map +1 -1
  9. package/dist/bin/cli.js +20 -24
  10. package/dist/bin/cli.js.map +1 -1
  11. package/dist/cli/deliver.d.ts +34 -0
  12. package/dist/cli/deliver.d.ts.map +1 -1
  13. package/dist/cli/deliver.js +147 -20
  14. package/dist/cli/deliver.js.map +1 -1
  15. package/dist/cli/guided-setup.d.ts.map +1 -1
  16. package/dist/cli/guided-setup.js +15 -0
  17. package/dist/cli/guided-setup.js.map +1 -1
  18. package/dist/cli/init.d.ts.map +1 -1
  19. package/dist/cli/init.js +3 -0
  20. package/dist/cli/init.js.map +1 -1
  21. package/dist/cli/plan.d.ts.map +1 -1
  22. package/dist/cli/plan.js +8 -2
  23. package/dist/cli/plan.js.map +1 -1
  24. package/dist/cli/policy.d.ts.map +1 -1
  25. package/dist/cli/policy.js +104 -2
  26. package/dist/cli/policy.js.map +1 -1
  27. package/dist/cli/quality.d.ts +11 -0
  28. package/dist/cli/quality.d.ts.map +1 -0
  29. package/dist/cli/quality.js +213 -0
  30. package/dist/cli/quality.js.map +1 -0
  31. package/dist/cli/wizard-config.d.ts.map +1 -1
  32. package/dist/cli/wizard-config.js +19 -9
  33. package/dist/cli/wizard-config.js.map +1 -1
  34. package/dist/cli/worktree.d.ts.map +1 -1
  35. package/dist/cli/worktree.js +8 -1
  36. package/dist/cli/worktree.js.map +1 -1
  37. package/dist/dashboard/savings.d.ts +1 -4
  38. package/dist/dashboard/savings.d.ts.map +1 -1
  39. package/dist/dashboard/savings.js +2 -52
  40. package/dist/dashboard/savings.js.map +1 -1
  41. package/dist/delivery/acceptance-judge.d.ts +10 -0
  42. package/dist/delivery/acceptance-judge.d.ts.map +1 -1
  43. package/dist/delivery/acceptance-judge.js +45 -3
  44. package/dist/delivery/acceptance-judge.js.map +1 -1
  45. package/dist/delivery/agentic-executor.d.ts +12 -1
  46. package/dist/delivery/agentic-executor.d.ts.map +1 -1
  47. package/dist/delivery/agentic-executor.js +25 -5
  48. package/dist/delivery/agentic-executor.js.map +1 -1
  49. package/dist/delivery/bash-sweep.d.ts +12 -0
  50. package/dist/delivery/bash-sweep.d.ts.map +1 -1
  51. package/dist/delivery/bash-sweep.js +8 -1
  52. package/dist/delivery/bash-sweep.js.map +1 -1
  53. package/dist/delivery/convergence-loop.d.ts.map +1 -1
  54. package/dist/delivery/convergence-loop.js +6 -4
  55. package/dist/delivery/convergence-loop.js.map +1 -1
  56. package/dist/delivery/execution-gate.d.ts +1 -1
  57. package/dist/delivery/execution-gate.d.ts.map +1 -1
  58. package/dist/delivery/execution-gate.js +248 -5
  59. package/dist/delivery/execution-gate.js.map +1 -1
  60. package/dist/delivery/snapshot.d.ts +16 -0
  61. package/dist/delivery/snapshot.d.ts.map +1 -1
  62. package/dist/delivery/snapshot.js +113 -2
  63. package/dist/delivery/snapshot.js.map +1 -1
  64. package/dist/delivery/user-validation.d.ts.map +1 -1
  65. package/dist/delivery/user-validation.js +55 -10
  66. package/dist/delivery/user-validation.js.map +1 -1
  67. package/dist/delivery/verifier-ladder.d.ts +24 -0
  68. package/dist/delivery/verifier-ladder.d.ts.map +1 -1
  69. package/dist/delivery/verifier-ladder.js +119 -2
  70. package/dist/delivery/verifier-ladder.js.map +1 -1
  71. package/dist/delivery/visual-gate.d.ts +24 -0
  72. package/dist/delivery/visual-gate.d.ts.map +1 -1
  73. package/dist/delivery/visual-gate.js +70 -9
  74. package/dist/delivery/visual-gate.js.map +1 -1
  75. package/dist/generators/claude-md.js +17 -4
  76. package/dist/generators/claude-md.js.map +1 -1
  77. package/dist/policies/liveness.d.ts +105 -0
  78. package/dist/policies/liveness.d.ts.map +1 -0
  79. package/dist/policies/liveness.js +251 -0
  80. package/dist/policies/liveness.js.map +1 -0
  81. package/dist/policies/policy-memory.d.ts.map +1 -1
  82. package/dist/policies/policy-memory.js +3 -4
  83. package/dist/policies/policy-memory.js.map +1 -1
  84. package/dist/quality/baseline.d.ts +29 -0
  85. package/dist/quality/baseline.d.ts.map +1 -0
  86. package/dist/quality/baseline.js +79 -0
  87. package/dist/quality/baseline.js.map +1 -0
  88. package/dist/quality/complexity.d.ts +38 -0
  89. package/dist/quality/complexity.d.ts.map +1 -0
  90. package/dist/quality/complexity.js +239 -0
  91. package/dist/quality/complexity.js.map +1 -0
  92. package/dist/quality/config.d.ts +40 -0
  93. package/dist/quality/config.d.ts.map +1 -0
  94. package/dist/quality/config.js +77 -0
  95. package/dist/quality/config.js.map +1 -0
  96. package/dist/quality/crap.d.ts +11 -0
  97. package/dist/quality/crap.d.ts.map +1 -0
  98. package/dist/quality/crap.js +54 -0
  99. package/dist/quality/crap.js.map +1 -0
  100. package/dist/quality/languages.d.ts +25 -0
  101. package/dist/quality/languages.d.ts.map +1 -0
  102. package/dist/quality/languages.js +150 -0
  103. package/dist/quality/languages.js.map +1 -0
  104. package/dist/quality/report.d.ts +38 -0
  105. package/dist/quality/report.d.ts.map +1 -0
  106. package/dist/quality/report.js +251 -0
  107. package/dist/quality/report.js.map +1 -0
  108. package/dist/quality/scanner.d.ts +32 -0
  109. package/dist/quality/scanner.d.ts.map +1 -0
  110. package/dist/quality/scanner.js +127 -0
  111. package/dist/quality/scanner.js.map +1 -0
  112. package/dist/quality/tools.d.ts +28 -0
  113. package/dist/quality/tools.d.ts.map +1 -0
  114. package/dist/quality/tools.js +189 -0
  115. package/dist/quality/tools.js.map +1 -0
  116. package/dist/types/config.d.ts +148 -0
  117. package/dist/types/config.d.ts.map +1 -1
  118. package/dist/types/config.js +35 -0
  119. package/dist/types/config.js.map +1 -1
  120. package/docs/ATTRIBUTION.md +0 -1
  121. package/docs/INDEX.md +38 -4
  122. package/docs/analysis/MARKET_POSITION.md +179 -0
  123. package/docs/architecture/OVERVIEW.md +82 -18
  124. package/docs/architecture/PROTOCOL.md +1 -1
  125. package/docs/benchmarks/PAIRED_FINDINGS.md +106 -0
  126. package/docs/benchmarks/PAIRED_HARNESS.md +16 -0
  127. package/docs/benchmarks/README.md +59 -0
  128. package/docs/design/UAP_REACTOR.md +0 -1
  129. package/docs/getting-started/INSTALLATION.md +1 -1
  130. package/docs/guides/AUTOMATIC.md +0 -14
  131. package/docs/guides/AUTOMATIC_FEATURES.md +1 -9
  132. package/docs/guides/COORDINATION.md +1 -1
  133. package/docs/guides/DELIVERY_PIPELINE.md +5 -0
  134. package/docs/guides/DEPLOY_BATCHING.md +1 -1
  135. package/docs/guides/DROIDS_AND_SKILLS.md +1 -1
  136. package/docs/guides/LOCAL_MODELS.md +6 -1
  137. package/docs/guides/MCP_ROUTER.md +1 -1
  138. package/docs/guides/MEMORY.md +1 -1
  139. package/docs/guides/MULTI_MODEL.md +1 -1
  140. package/docs/guides/ORCHESTRATOR.md +1 -1
  141. package/docs/guides/POLICIES.md +19 -3
  142. package/docs/guides/QWEN38_EXL3.md +114 -0
  143. package/docs/guides/WORKTREE_WORKFLOW.md +45 -1
  144. package/docs/integrations/MCP_ROUTER.md +1 -4
  145. package/docs/plans/deliver-hardening-plan-2026-07-13.md +173 -0
  146. package/docs/plans/deliver-hardening-review-response-2026-07-13.md +180 -0
  147. package/docs/plans/k3-uap-uplift-validation.md +216 -0
  148. package/docs/plans/qwen38-uap-retest-plan.md +196 -0
  149. package/docs/reference/API.md +1 -1
  150. package/docs/reference/CLI.md +49 -14
  151. package/docs/reference/COMPARISON.md +248 -0
  152. package/docs/reference/CONFIGURATION.md +1 -3
  153. package/docs/reference/DATABASE_SCHEMA.md +1 -1
  154. package/docs/reference/FEATURES.md +3 -3
  155. package/docs/reference/PATTERNS.md +1 -1
  156. package/docs/reference/PLATFORMS.md +1 -1
  157. package/package.json +2 -2
  158. package/scripts/maintenance/update-skills.py +0 -22
  159. package/scripts/maintenance/verify-compliance.sh +3 -3
  160. package/src/policies/enforcers/__pycache__/_common.cpython-312.pyc +0 -0
  161. package/src/policies/enforcers/__pycache__/quality_metrics_gate.cpython-312.pyc +0 -0
  162. package/src/policies/enforcers/adr_guard.py +0 -0
  163. package/src/policies/enforcers/bearer_lockdown.py +0 -0
  164. package/src/policies/enforcers/branch_freshness.py +0 -0
  165. package/src/policies/enforcers/design_token_gate.py +0 -0
  166. package/src/policies/enforcers/enforcement_self_protect.py +70 -0
  167. package/src/policies/enforcers/expert_review_required.py +22 -0
  168. package/src/policies/enforcers/iac_plan_destruction_check.py +0 -0
  169. package/src/policies/enforcers/quality_metrics_gate.py +447 -0
  170. package/src/policies/enforcers/ship_loop_gate.py +0 -0
  171. package/src/policies/enforcers/validate_plan_on_change.py +0 -0
  172. package/src/policies/enforcers/visual_verification.py +0 -0
  173. package/src/policies/enforcers/workdir_scope.py +0 -0
  174. package/src/policies/schemas/policies/expert-review-required.md +9 -1
  175. package/src/policies/schemas/policies/quality-metrics-gate.md +74 -0
  176. package/templates/CLAUDE.template.md +1 -1
  177. package/templates/hooks/__pycache__/deliver_autoroute.cpython-312.pyc +0 -0
  178. package/templates/hooks/pre-tool-use-bash.sh +50 -3
  179. package/templates/hooks/pre-tool-use-edit-write.sh +31 -0
  180. package/templates/hooks/session-start.sh +15 -0
  181. package/templates/hooks/uap-policy-gate.sh +187 -5
  182. package/templates/stryker.config.json +14 -0
  183. package/tools/agents/scripts/__pycache__/toolcall_path_normalizer.cpython-312.pyc +0 -0
  184. package/tools/agents/scripts/anthropic_proxy.py +254 -28
  185. package/tools/agents/tests/run_acceptance.py +0 -0
  186. package/tools/agents/tests/test_client_disconnect.py +0 -0
  187. package/tools/agents/tests/test_cycle_break_exploration.py +0 -0
  188. package/tools/agents/tests/test_deferral_break.py +0 -0
  189. package/tools/agents/tests/test_delivery_enforcement_all_langs.py +0 -0
  190. package/tools/agents/tests/test_delivery_enforcement_exemptions.py +0 -0
  191. package/tools/agents/tests/test_delivery_enforcement_filepath.py +0 -0
  192. package/tools/agents/tests/test_delivery_enforcement_web_and_bash.py +0 -0
  193. package/tools/agents/tests/test_delivery_enforcement_worktree.py +0 -0
  194. package/tools/agents/tests/test_delivery_enforcement_write_complexity.py +0 -0
  195. package/tools/agents/tests/test_disconnect_watcher.py +0 -0
  196. package/tools/agents/tests/test_doubling_break.py +0 -0
  197. package/tools/agents/tests/test_empty_maxtokens_recovery.py +0 -0
  198. package/tools/agents/tests/test_empty_tool_loop_break.py +0 -0
  199. package/tools/agents/tests/test_enforcement_self_protect.py +90 -0
  200. package/tools/agents/tests/test_enforcer_escape_hatches.py +0 -0
  201. package/tools/agents/tests/test_error_loop_break.py +0 -0
  202. package/tools/agents/tests/test_expert_review_pr_scope.py +13 -5
  203. package/tools/agents/tests/test_fastpath_config.py +0 -0
  204. package/tools/agents/tests/test_finalize_suppression.py +0 -0
  205. package/tools/agents/tests/test_gate_evidence.py +0 -0
  206. package/tools/agents/tests/test_gate_failclosed_indirection.py +0 -0
  207. package/tools/agents/tests/test_gate_integrity.py +0 -0
  208. package/tools/agents/tests/test_live_deliver_kill.py +0 -0
  209. package/tools/agents/tests/test_malformed_unclosed_think.py +0 -0
  210. package/tools/agents/tests/test_mandate_beats_recon.py +0 -0
  211. package/tools/agents/tests/test_mandate_deliver.py +0 -0
  212. package/tools/agents/tests/test_non_stream_resp_log.py +0 -0
  213. package/tools/agents/tests/test_output_token_ceilings.py +0 -0
  214. package/tools/agents/tests/test_overflow_truncate_count_tokens.py +0 -0
  215. package/tools/agents/tests/test_path_containment.py +0 -0
  216. package/tools/agents/tests/test_path_normalizer_hardened.py +0 -0
  217. package/tools/agents/tests/test_repeat_call_guard.py +0 -0
  218. package/tools/agents/tests/test_repeat_guard.py +0 -0
  219. package/tools/agents/tests/test_session_admission.py +0 -0
  220. package/tools/agents/tests/test_stream_heartbeat.py +0 -0
  221. package/tools/agents/tests/test_stream_thinking_deltas.py +405 -0
  222. package/tools/agents/tests/test_stuck_break_hard.py +0 -0
  223. package/tools/agents/tests/test_stuck_break_reattach.py +0 -0
  224. package/tools/agents/tests/test_turn_count_breaker_periodic.py +0 -0
  225. package/tools/agents/tests/test_upstream_chokepoint.py +0 -0
  226. package/tools/agents/tests/test_upstream_model_aliases.py +0 -0
  227. package/tools/agents/tests/test_validate_plan_gate.py +0 -0
  228. package/tools/agents/tests/test_vision_passthrough.py +0 -0
  229. package/tools/agents/tests/test_workdir_scope_enforcer.py +0 -0
  230. package/dist/cli/rtk.d.ts +0 -34
  231. package/dist/cli/rtk.d.ts.map +0 -1
  232. package/dist/cli/rtk.js +0 -401
  233. package/dist/cli/rtk.js.map +0 -1
  234. package/docs/integrations/RTK.md +0 -113
  235. package/scripts/setup/install-rtk.sh +0 -184
  236. package/src/policies/enforcers/rtk_wrap.py +0 -205
  237. package/src/policies/schemas/policies/rtk-wrap.md +0 -50
  238. package/tools/agents/tests/test_rtk_wrap.py +0 -151
@@ -30,7 +30,6 @@ because UAP embeds, vendors, or builds core workflows around them:
30
30
  - **Qwen** (Alibaba) — the local models UAP's local-first delivery pipeline is tuned for and benchmarked with.
31
31
  - **[Qdrant](https://qdrant.tech/)** + **nomic-embed-text** — the semantic long-term memory store and its embeddings.
32
32
  - **[uPlot](https://github.com/leeoniya/uPlot)** (MIT) — vendored (with license) in `web/vendor/` for the dashboard's charts.
33
- - **[RTK — Rust Token Killer](https://github.com/rtk-rs)** — the token-optimized CLI proxy the hook layer routes shell commands through.
34
33
  - **commander**, **@clack/prompts**, **vitest**, **better-sqlite3**, **zod** — the CLI, wizard, test, storage, and schema backbones.
35
34
 
36
35
  ## Conventions
package/docs/INDEX.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # UAP Documentation
2
2
 
3
- The complete documentation for the **Universal Agent Protocol** (`@miller-tech/uap` v1.163) — the discipline layer that turns a talented-but-unreliable AI coding agent into a dependable member of your software delivery line.
3
+ The complete documentation for the **Universal Agent Protocol** (`@miller-tech/uap` v1.224.0) — the discipline layer that turns a talented-but-unreliable AI coding agent into a dependable member of your software delivery line. 367 TypeScript modules across 26 subsystems, 459 vitest suites plus a ~1,200-test Python enforcer/proxy suite, 60 CLI command registrations, 32 executable policy enforcers, 9 supported agent harnesses.
4
4
 
5
5
  > **Reviewing the system?** The reverse-engineered, code-verified reference set lives in
6
6
  > [`documentation/`](../documentation/architecture.md): architecture, flows, permissions
@@ -21,7 +21,7 @@ UAP is organized like a delivery line. If you know which part of the pipeline yo
21
21
  | **Prep / routing** — right job, right station | Wrong approach or wrong-sized model | [Multi-Model Routing](guides/MULTI_MODEL.md) · [Patterns](reference/PATTERNS.md) · [Droids & Skills](guides/DROIDS_AND_SKILLS.md) |
22
22
  | **Isolation** — a bench per job | Editing `main`, clobbering files | [Worktree Workflow](guides/WORKTREE_WORKFLOW.md) |
23
23
  | **Build** — make the thing | Plausible-but-wrong code, stubs, empty output | [`uap deliver`](guides/DELIVER.md) · [Local Models](guides/LOCAL_MODELS.md) · [Inference Proxy](guides/PROXY.md) |
24
- | **QC / verify** — prove it runs | "Done" on code that never ran | [`uap deliver`](guides/DELIVER.md) · [Policies](guides/POLICIES.md) |
24
+ | **QC / verify** — prove it runs | "Done" on code that never ran | [`uap deliver`](guides/DELIVER.md) · [Policies](guides/POLICIES.md) · [Quality gate](../CLAUDE.md) (`uap quality check`) |
25
25
  | **Coordination** — many workers, one floor | Parallel agents colliding, stale branches overwriting landed work | [Parallel Agents](guides/PARALLEL_AGENTS.md) · [Coordination](guides/COORDINATION.md) · [Deploy Batching](guides/DEPLOY_BATCHING.md) |
26
26
  | **Shipping** — out the door safely | Regressions, red CI, skipped bumps | [Worktree Workflow](guides/WORKTREE_WORKFLOW.md) · [Policies](guides/POLICIES.md) |
27
27
  | **Feedback** — the floor learns | The same mistake every session | [Memory](guides/MEMORY.md) · [Self-Harness](design/SELF_HARNESS.md) · [Self-Tuning](guides/SELF_TUNING.md) |
@@ -45,6 +45,7 @@ Full map: **[The UAP Delivery Pipeline](guides/DELIVERY_PIPELINE.md)**.
45
45
  |---|---|
46
46
  | [**The Delivery Pipeline**](guides/DELIVERY_PIPELINE.md) | The station-by-station tour — the big-picture map of the whole floor ⭐ |
47
47
  | [**What UAP Does Automatically**](guides/AUTOMATIC_FEATURES.md) | Every feature in benefit / when-it-kicks-in terms — install once, it all self-applies ⭐ |
48
+ | [What UAP Does Automatically (compact)](guides/AUTOMATIC.md) | A shorter, trigger-by-trigger telling of the same ground as AUTOMATIC_FEATURES |
48
49
  | [**`uap deliver`**](guides/DELIVER.md) | The Build+QC harness — convergence loop to verified completion, tiered gates, CI/deploy feedback loop ⭐ |
49
50
  | [**Orchestrator & Hands-Free**](guides/ORCHESTRATOR.md) | The long-task autonomy layer — blackboard orchestrator, epic controller, completion ledger, auto-seed/resume; any model runs a huge build to 100% hands-free ⭐ |
50
51
  | [**UAP Across Two Agents & Uplift**](guides/TWO_AGENTS_AND_UPLIFT.md) | The whole line applied seam-by-seam to opencode+Qwen3.6 (local) and Claude Code+Opus 4.8 (cloud), plus the benchmark that measures UAP uplift — diagrams + `benchmarks/suites/swe-bench-pro/` config |
@@ -56,13 +57,14 @@ Full map: **[The UAP Delivery Pipeline](guides/DELIVERY_PIPELINE.md)**.
56
57
  | [**Policy Selection & Recommendations**](guides/POLICY_SELECTION.md) | Which policies to enable for your workflow — a recommended core + tailored sets by scenario; `uap policy recommend` ⭐ |
57
58
  | [Pay2U Policy Pack](guides/POLICY_PACK_PAY2U.md) | The pay2u-tailored policy bundle |
58
59
  | [Multi-Model Routing](guides/MULTI_MODEL.md) | Plan → route → execute across 7 model profiles |
59
- | [Droids & Skills](guides/DROIDS_AND_SKILLS.md) | 38 expert droids, 36 skills, the expert router |
60
+ | [Droids & Skills](guides/DROIDS_AND_SKILLS.md) | 38 expert droids, 6 bundled skills (plus per-harness skill surfaces), the expert router |
60
61
  | [Deploy Batching](guides/DEPLOY_BATCHING.md) | Conflict-free batched git/deploy actions |
61
62
  | [Coordination](guides/COORDINATION.md) | Multi-agent overlap detection |
62
63
  | [**Parallel Agents**](guides/PARALLEL_AGENTS.md) | Many agents, one codebase: fresh bases, drift blocking, `uap worktree sync`, the merge queue, ownership lanes ⭐ |
63
64
  | [Local Models](guides/LOCAL_MODELS.md) | Running agents against local llama.cpp / Qwen models |
64
65
  | [Inference Proxy](guides/PROXY.md) | The Anthropic↔local gateway: `uap proxy` lifecycle, reliability guardrails, security, serving recipes |
65
66
  | [Qwen3.6 on llama.cpp by VRAM](guides/QWEN36_LLAMACPP.md) | Tiered 8/12/16/24/32 GB setup; how `uap deliver` uplifts small local models |
67
+ | [Qwen3.8-27B on exllamav3 (EXL3)](guides/QWEN38_EXL3.md) | The production serving stack since 2026-09-04: EXL3 3.5bpw + DFlash2 draft on a 3090, the sm_86 adaptations, local kit patches, rollback to llama.cpp |
66
68
  | [**LLM Self-Tuning**](guides/SELF_TUNING.md) | `uap tune` — raise a small model toward Opus by tuning UAP's flag surface with a benchmark-validated LLM/GP-BO loop; quality scoring, model profiles, auto-on real-time adaptation ⭐ |
67
69
 
68
70
  ## Architecture
@@ -81,6 +83,7 @@ Full map: **[The UAP Delivery Pipeline](guides/DELIVERY_PIPELINE.md)**.
81
83
  | Doc | What it covers |
82
84
  |---|---|
83
85
  | [CLI](reference/CLI.md) | Every `uap` command and flag |
86
+ | [Comparison](reference/COMPARISON.md) | UAP vs other agent harnesses and adjacent tooling (memory, orchestration, spec-driven, review/policy) — positioning, honest trade-offs, sources |
84
87
  | [API](reference/API.md) | Programmatic API surface |
85
88
  | [Features](reference/FEATURES.md) | Full feature catalog, mapped to the pipeline stages |
86
89
  | [Patterns](reference/PATTERNS.md) | The 23 Terminal-Bench patterns |
@@ -94,18 +97,49 @@ Full map: **[The UAP Delivery Pipeline](guides/DELIVERY_PIPELINE.md)**.
94
97
  | Doc | What it covers |
95
98
  |---|---|
96
99
  | [MCP Router](integrations/MCP_ROUTER.md) | Setting up the MCP router across harnesses |
97
- | [RTK](integrations/RTK.md) | Rust Token Killer integration |
98
100
 
99
101
  ## Benchmarks
100
102
 
101
103
  | Doc | What it covers |
102
104
  |---|---|
105
+ | [Benchmarks overview](benchmarks/README.md) | The headline numbers, what to trust, and where the raw runs and task suites live |
103
106
  | [**Paired Findings**](benchmarks/PAIRED_FINDINGS.md) | Controlled A/B results: UAP gate value is +20pp vs a non-agentic baseline [CI +8,+32], ~0pp vs an agentic one — with confidence intervals ⭐ |
104
107
  | [Paired Harness](benchmarks/PAIRED_HARNESS.md) | The `uap bench paired` controlled-A/B harness: design, adapters (mock/opencode/claude/raw), authoring tasks |
105
108
  | [TBench Investigation](benchmarks/TBENCH_INVESTIGATION.md) | Earlier finding: no measurable UAP-context lift (every uncontrolled gain was a confound), methodology lessons |
106
109
  | [Validation Results](benchmarks/VALIDATION_RESULTS.md) | Terminal-Bench 2.0 results (−49.7% tokens, +33pp success) |
107
110
  | [Token Optimization](benchmarks/TOKEN_OPTIMIZATION.md) | Where the token savings come from |
108
111
  | [Accuracy Analysis](benchmarks/ACCURACY_ANALYSIS.md) | Success-rate and error analysis |
112
+ | [Comprehensive Benchmarks](benchmarks/COMPREHENSIVE_BENCHMARKS.md) | Extended measurements |
113
+
114
+ ## Analysis
115
+
116
+ Dated, strategy-level reads of the market UAP operates in. For the evergreen
117
+ feature-level comparison, see [Comparison](reference/COMPARISON.md).
118
+
119
+ | Doc | What it covers |
120
+ |---|---|
121
+ | [Market Position & Competitive Analysis (2026-09)](analysis/MARKET_POSITION.md) | The 2026 agentic-delivery market, UAP's category (agent discipline layer), competitive dynamics per adjacent category, moats, honest weaknesses, and strategic options |
122
+
123
+ ## Plans & post-mortems
124
+
125
+ Working documents that explain *why* the code looks the way it does — kept as
126
+ the decision record.
127
+
128
+ | Doc | What it covers |
129
+ |---|---|
130
+ | [Deliver hardening plan](plans/deliver-hardening-plan-2026-07-13.md) | The 14-defect audit (batches A–D) that became v1.224.0: scoped rollback, declared gates, polyglot execution, config routing, liveness, operator overrides |
131
+ | [Deliver hardening review response](plans/deliver-hardening-review-response-2026-07-13.md) | Parallel-review findings and their dispositions — the rationale behind the root-owned trust model |
132
+ | [Harness engineering uplift](plans/harness-engineering-uplift-2026-07-31.md) | Three-paper analysis of harness variance and what UAP does about it |
133
+ | [K3 UAP uplift validation](plans/k3-uap-uplift-validation.md) | Plan to measure UAP's paired uplift on Kimi K3 by re-running Terminal-Bench 2.1 with Factory Droid as the harness, UAP on vs off |
134
+ | [Qwen3.8 UAP re-test plan](plans/qwen38-uap-retest-plan.md) | Plan to re-run the paired benchmark matrix on the current local Qwen3.8-27B stack with UAP v1.224.x, replicating the +20pp gate-loop finding and checking the hardened deliver pipeline |
135
+
136
+ ## Specs & performance
137
+
138
+ | Doc | What it covers |
139
+ |---|---|
140
+ | [P0 anti-vacuous spec](specs/p0-anti-vacuous.md) | The verbatim-operations spec behind deliver's anti-stub hardening |
141
+ | [Dashboard uplift spec](DASHBOARD_UPLIFT_SPEC.md) | Replacing the monolithic dashboard with the modular token-locked console |
142
+ | [Performance baseline](performance/baseline-2026-03-27.json) | Machine-recorded perf baseline (heap, query latency) |
109
143
 
110
144
  ## Contributing
111
145
 
@@ -0,0 +1,179 @@
1
+ # UAP Market Position & Competitive Analysis (2026-09)
2
+
3
+ **Date:** 2026-09-06 · **Subject:** Universal Agent Protocol v1.224.8 (`@miller-tech/uap`)
4
+ **Scope:** market-level position and competitive dynamics. For the evergreen
5
+ feature-level comparison and honest trade-offs, see
6
+ [reference/COMPARISON.md](../reference/COMPARISON.md) — this document is the dated,
7
+ strategy-level companion: what the market looks like, where UAP sits in it, what protects
8
+ the position, and what to do next.
9
+
10
+ ---
11
+
12
+ ## 1. Executive summary
13
+
14
+ UAP is **not** a coding agent, an agent framework, or a communication protocol. It is a
15
+ **process-governance layer for AI-driven software delivery** — a discipline substrate that
16
+ installs *underneath* any agent harness (9 supported) and enforces the stations of a
17
+ delivery line: memory, routing, isolation, build, verification, coordination, shipping,
18
+ and feedback.
19
+
20
+ That category — the **agent discipline layer** — is sparsely occupied. The 2026 market has
21
+ consolidated around protocols (MCP, A2A), commoditized agent frameworks, and a crowded,
22
+ churny field of coding-agent harnesses, while memory and guardrails have each become their
23
+ own product category. What none of those categories sell is *verified delivery process*:
24
+ the guarantee that an agent's output survived real gates, that parallel agents didn't
25
+ clobber each other, and that "done" was graded by something other than the model that
26
+ wrote the code. UAP's thesis: reliability in agentic development is a **process problem,
27
+ not a model problem** — and UAP productizes the process.
28
+
29
+ **Positioning statement:** *For teams running AI coding agents on real codebases, UAP is
30
+ the discipline layer that turns a talented-but-unreliable agent into a dependable line
31
+ worker — harness-agnostic, model-agnostic (frontier cloud to fully local), enforced by
32
+ executable gates rather than prompt prose.*
33
+
34
+ ---
35
+
36
+ ## 2. Market context (2026)
37
+
38
+ Five structural facts define the market UAP sells into:
39
+
40
+ 1. **Coding agents are mainstream and multi-vendor.** Terminal-Bench 2.1 leaders sit at
41
+ ~89% (Codex CLI/GPT-5.6 Sol 89.5%, Claude Code/Opus 5 89.1%); OpenCode (MIT) is the
42
+ most-starred open-source agent (~199k stars). Buyers run *several* harnesses and switch
43
+ frequently — harness churn is a market feature. (Sources 5–8.)
44
+ 2. **Protocols have consolidated; they are complements, not competitors.** MCP (~97M
45
+ downloads) owns agent↔tool; A2A (150+ orgs, in enterprise production 18 months after
46
+ launch) owns agent↔agent; AG-UI owns agent↔UI; ACP/ANP and payment protocols (AP2,
47
+ x402) fill niches. The protocol war is effectively over — value moved up the stack to
48
+ what you *do* with connected agents. (Sources 1–4.)
49
+ 3. **Memory is a recognized product category with benchmarked leaders.** Zep/Graphiti,
50
+ mem0, Letta, and Cognee compete on LoCoMo/LongMemEval/BEAM scores (e.g., Zep 63.8% vs
51
+ mem0 49.0% on LongMemEval) and on enterprise gates (SOC 2). General-purpose,
52
+ conversation-scoped memory is commoditizing. (Sources 9–12.)
53
+ 4. **Guardrails spend is rising but aims at content safety and compliance, not delivery
54
+ process.** The 2026 guardrails market (Galileo lists 8 serious vendors; "NeMo
55
+ Guardrails alternatives" is a genre) is built around hallucination detection, PII, IAM
56
+ boundaries, and EU AI Act checklists. "Did the agent run the tests before claiming
57
+ done" is not in their feature matrix. (Sources 13–15.)
58
+ 5. **Spec-driven development and AGENTS.md prove demand for process scaffolding** — but
59
+ they are *authored intent* (60,000+ repos read AGENTS.md; ETH Zurich has studied
60
+ context-file quality). Prose and specs describe process; they cannot enforce it at
61
+ runtime. The gap between "written guidelines" and "enforced process" is exactly UAP's
62
+ seam. (Sources 16–18.)
63
+
64
+ ---
65
+
66
+ ## 3. Category map
67
+
68
+ ```
69
+ Protocols MCP · A2A · AG-UI · ACP · AP2/x402 plumbing (settled)
70
+ Harnesses Claude Code · Codex · Cursor · Factory · the workers
71
+ OpenCode · Devin · Antigravity · Junie (crowded, churny)
72
+ Frameworks LangGraph · CrewAI · AutoGen · OAI Agents agent construction
73
+ Memory Zep · mem0 · Letta · Cognee · Supermemory recall (per-agent)
74
+ Guardrails Guardrails AI · NeMo · Galileo-class vendors content/compliance
75
+ SDD/context spec-kit · Kiro · AGENTS.md convention intent, authored
76
+
77
+ ▶ UAP: none of the above — the layer *between* harness and codebase that owns
78
+ process enforcement: SDLC-scoped memory, model routing, worktree isolation,
79
+ convergence-to-gates delivery, executable policy, multi-agent coordination,
80
+ and a measured-uplift benchmark program. Harness- and model-agnostic.
81
+ ```
82
+
83
+ UAP's deliberate stance: **it does not compete with harnesses; it makes every harness
84
+ better.** Harness churn (fact #1) is therefore a tailwind — each new harness release is a
85
+ new distribution surface, not a threat.
86
+
87
+ ---
88
+
89
+ ## 4. Competitive dynamics by category
90
+
91
+ Feature-by-feature tables live in [reference/COMPARISON.md](../reference/COMPARISON.md);
92
+ this section is about *dynamics* — who can move into UAP's space and why they haven't.
93
+
94
+ | Category | Relation | Why they don't absorb UAP's function |
95
+ |---|---|---|
96
+ | **Protocols** (MCP, A2A) | Complement — MCP Router consumes MCP, adds tool-hiding + ~98% output compression | Protocol vendors are structurally neutral; opinionated per-repo SDLC process is off-mission. An A2A bridge for inter-org coordination is an opportunity, not overlap |
97
+ | **Harnesses** (Claude Code, Codex, Cursor, Factory, OpenCode, Devin) | Distribution, not competition | Their blind spot is structural: the harness grades its own homework, and harness-owned enforcement dies at the harness boundary. Roadmaps optimize session UX and autonomy depth, not cross-harness process governance |
98
+ | **Frameworks** (LangGraph, CrewAI, AutoGen) | Different buyer moment | Frameworks answer "how do I *build* an agent system"; UAP answers "how do the agents I already run *deliver reliably*." Both coexist in one org |
99
+ | **Memory vendors** (Zep, mem0, Letta, Cognee) | Nearest single-feature competitors | They win general memory bake-offs; UAP wins where memory is wired to process (evidence-gated writes, patterns that become executable gates, task-outcome feedback). UAP memory is local-first files+SQLite — no vendor schema lock-in. Backend pluggability would convert them into integrations |
100
+ | **Guardrails vendors** (Guardrails AI, NeMo, Galileo-class) | Adjacent, non-overlapping | Their unit of enforcement is the *model response* (PII, injection, compliance); UAP's is the *tool call and the delivery claim*. Regulated enterprises plausibly buy both |
101
+ | **SDD / context files** (spec-kit, Kiro, AGENTS.md) | Philosophical complement | Declarative intent relies on model cooperation; UAP's premise (measured, repeatedly) is that prose gets ignored, so process must execute. "spec-kit authors the spec; UAP enforces delivery against it" |
102
+ | **CI/CD & code quality** (Actions, SonarQube, Stryker) | Complement; UAP moves the gate left | Their gates fire post-push; UAP's fire in-session, before the PR exists — each in-session catch saves a CI round-trip and a human review cycle |
103
+
104
+ No single competitor covers more than two cells of UAP's capability row (see the matrix in
105
+ COMPARISON.md).
106
+
107
+ ---
108
+
109
+ ## 5. Moats
110
+
111
+ 1. **Incident-derived guardrail corpus.** The proxy/enforcer suite isn't a feature list —
112
+ each breaker (cycle, starvation, contamination, death-spiral, truncation-repair,
113
+ disconnect-abandonment) is annotated with the production failure that motivated it.
114
+ Reproducing it requires *living through* those failures, not reading a spec.
115
+ 2. **Measured, honest uplift evidence.** A paired A/B harness (same task, same model,
116
+ ±UAP) with published confidence intervals — including published *falsifications* of its
117
+ own earlier claims (the +20pp pooled claim was re-tested and corrected). In a market of
118
+ cherry-picked benchmark marketing, falsifiable self-measurement is a credibility moat.
119
+ 3. **Harness-agnostic enforcement surface.** 9 harness integrations with per-harness hook
120
+ installers; switching costs flow the other way (teams keep UAP when they churn
121
+ harnesses).
122
+ 4. **Local-model depth.** Production-proven guidance for self-hosted stacks (llama.cpp,
123
+ exllamav3/EXL3 with speculative decoding), context-window management, and routing —
124
+ validated on real hardware (3090-class) as a daily driver, not a demo.
125
+ 5. **Test mass as correctness evidence.** 459 vitest suites + ~1,200 Python enforcer/proxy
126
+ tests, with suite-coverage meta-tests that fail CI if a test module is unlisted.
127
+
128
+ ## 6. Honest weaknesses & risks
129
+
130
+ | Weakness | Consequence | Mitigation path |
131
+ |---|---|---|
132
+ | Single-maintainer scale | Bus factor; support ceiling | Community building; docs already onboarding-oriented |
133
+ | Self-run benchmarks only | Skeptical buyers discount in-house numbers | Third-party replication; publish raw cell data (already in `benchmark-results/`) |
134
+ | No SOC 2 / enterprise compliance posture | Blocked at regulated procurement | Scope honestly; partner with compliance-layer vendors |
135
+ | No hosted control plane | Teams wanting SaaS dashboards self-host everything | Optional cloud telemetry sync later |
136
+ | Proxy speaks Anthropic Messages shape | OpenAI-native clients need adaptation | Widen proxy dialects as demand appears |
137
+ | Distribution = npm + word of mouth | Discovery limited | Presence in AGENTS.md ecosystem, spec-kit integrations, benchmark publications |
138
+ | Category education required | "Discipline layer" isn't a budget line item yet | Content around the factory-floor metaphor and measured uplift |
139
+
140
+ ## 7. Opportunities & recommendations
141
+
142
+ 1. **Own the category name.** Publish the "agent discipline layer" thesis with the paired
143
+ benchmark methodology as the proof artifact; the falsification-correction story is the
144
+ strongest credibility asset available.
145
+ 2. **Alliance with SDD, not competition.** A `spec-kit`/AGENTS.md integration story
146
+ ("they author intent; UAP enforces delivery") rides an established, growing convention.
147
+ 3. **A2A bridge for inter-org coordination.** UAP's intra-floor coordination + A2A's
148
+ inter-agent standard pair naturally as multi-org agent workflows appear.
149
+ 4. **Memory-backend pluggability.** Formalize the memory backend interface so Zep/mem0 can
150
+ slot behind UAP's write-gates — converts the nearest competitors into integrations.
151
+ 5. **Enterprise wedge: local-first regulated teams.** The fully-local path (local models +
152
+ local memory + local gates, zero egress) is a genuine differentiator for defense,
153
+ health, and finance teams that can't ship code context to vendor clouds.
154
+
155
+ ---
156
+
157
+ ## 8. Sources
158
+
159
+ 1. AI Agent Protocol Ecosystem Map 2026 — digitalapplied.com/blog/ai-agent-protocol-ecosystem-map-2026-mcp-… (2026-03-18)
160
+ 2. Agent Interoperability Protocols 2026: MCP, A2A, ACP — zylos.ai/research/2026-03-26-agent-interoperability-protocols-mcp-a2a-… (2026-03-26)
161
+ 3. A2A Protocol: ecosystem 2026 — aniketkarneai.com/blog/2026-07-06-a2a-protocol-ecosystem-2026 (2026-07-06)
162
+ 4. Six Agent Protocols Every AI Builder Needs to Know in 2026 — mindstudio.ai/blog/six-agent-protocols-ai-builders-2026 (2026-05-20)
163
+ 5. Best AI Coding Agents in 2026 — firecrawl.dev/blog/best-ai-coding-agents (2026-08-03)
164
+ 6. Best AI Coding Agent (Terminal-Bench 2.1 rankings) — morphllm.com/ai-coding-agent (2026-08-21)
165
+ 7. 12 AI Coding Agents Compared in 2026 — ssojet.com/blog/ai-coding-agents-compared (2026-06-08)
166
+ 8. AI Coding Agents: Adoption Trends — blog.jetbrains.com/research/2026/08/ai-coding-agent-adoption-2026 (2026-08-19)
167
+ 9. State of AI Agent Memory 2026 — mem0.ai/blog/state-of-ai-agent-memory-2026 (2026-09-03)
168
+ 10. Best AI Agent Memory Providers in 2026 — developersdigest.tech/blog/best-ai-agent-memory-providers-2026 (2026-07-31)
169
+ 11. Mem0 vs Zep vs Letta vs Cognee — particula.tech/blog/agent-memory-frameworks-tested-mem0-zep-letta-cognee (2026-06-04)
170
+ 12. Mem0 vs Zep vs Letta vs Cognee vs Supermemory (Q3 2026) — mnemoverse.com/docs/library/ai-memory-solutions-2026-q3 (2026-08-06)
171
+ 13. 8 Best AI Agent Guardrails Solutions in 2026 — galileo.ai/blog/best-ai-agent-guardrails-solutions (2026-03-17)
172
+ 14. Enterprise AI Governance & Policy Enforcement (NeMo alternatives) — deepinspect.ai/blog/nemo-guardrails-alternatives (2026-08-17)
173
+ 15. Enterprise AI Agent Guardrails: A Compliance Checklist for 2026 — atlan.com/know/ai-agent/enterprise-ai-agent-guardrails-checklist/ (2026-06-15)
174
+ 16. Spec-Driven Development with AI Coding Agents (2026) — tryzeroshot.com/blog/spec-driven-development-with-ai-coding-agents (2026-07-25)
175
+ 17. AGENTS.md Specification — asdlc.io/practices/agents-md-spec/ (2026-03-16)
176
+ 18. How to Build Your AGENTS.md (2026) — augmentcode.com/guides/how-to-build-agents-md (2026-06-18)
177
+
178
+ *UAP-internal figures (module/suite/enforcer counts, measured uplift, ~98% compression)
179
+ are from this repository's README, docs/INDEX.md, and benchmark-results/ as of v1.224.8.*
@@ -1,6 +1,6 @@
1
1
  # UAP Architecture Overview
2
2
 
3
- `v1.124.1` · ~223 TypeScript modules across 18 `src/` subsystems · 200+ test suites
3
+ `v1.224.0` · 367 TypeScript modules across 26 `src/` subsystems · 459 vitest suites (+ a ~1,200-test Python enforcer/proxy suite)
4
4
 
5
5
  > **Code-verified reference:** this narrative overview is the intent-level floor plan. For
6
6
  > the reverse-engineered, implementation-accurate map — including trust boundaries,
@@ -115,23 +115,32 @@ the harness aborts the call). Hook scripts are generated and installed by
115
115
 
116
116
  ```
117
117
  src/
118
+ ├── delivery/ `uap deliver` convergence loop (86 modules: ladder, critic,
119
+ │ judge, applier, snapshot/rollback, orchestrator, CI watcher…)
120
+ ├── cli/ 60 command modules wired into bin/cli.ts
118
121
  ├── memory/ 4-tier memory: working, session, semantic (Qdrant), graph
119
- ├── mcp-router/ hierarchical MCP router — tool hiding + FTS5 output compression
120
- ├── policies/ hook-based policy gates + 20 Python enforcers
121
- ├── delivery/ `uap deliver` convergence loop (15 modules)
122
+ ├── benchmarks/ paired A/B harness + Terminal-Bench scoring
122
123
  ├── coordination/ multi-agent registry, overlap detection, deploy batching
124
+ ├── self-tuning/ `uap tune` — LLM/GP-BO search over UAP's flag surface
125
+ ├── self-harness/ `uap self-harness` — mine → propose → validate loop
123
126
  ├── models/ multi-model routing, planning, execution profiles
127
+ ├── mcp-router/ hierarchical MCP router — tool hiding + FTS5 output compression
128
+ ├── policies/ hook-based policy gates + 32 Python enforcers
129
+ ├── quality/ quality-metrics gate: complexity/CRAP/coverage/mutation budgets
130
+ │ with a ratchet baseline (`uap quality`)
124
131
  ├── tasks/ dependency-aware task tracker (SQLite, DAG)
125
132
  ├── dashboard/ live task / agent / memory / policy visualization
133
+ ├── principles/ engineering-principles store (`uap principles`)
134
+ ├── design/ DESIGN.md interrogation + design-token gate support
135
+ ├── telemetry/ run telemetry
136
+ ├── state/ shared run state
137
+ ├── config/ configuration loading
138
+ ├── browser/ cloaked browser automation for agents
126
139
  ├── observability/ HALO / OpenInference span export for harness analysis
127
- ├── analyzers/ project structure analysis + metadata generation
140
+ ├── integrity/ protected-file byte verification
128
141
  ├── generators/ CLAUDE.md / config generation
129
- ├── benchmarks/ Terminal-Bench harness + scoring
130
- ├── browser/ cloaked browser automation for agents
131
- ├── telemetry/ run telemetry
132
- ├── models/… (see above)
142
+ ├── analyzers/ project structure analysis + metadata generation
133
143
  ├── bin/ CLI entry (cli.ts), policy bin, llama-server-optimize
134
- ├── cli/ ~35 command modules wired into bin/cli.ts
135
144
  ├── types/ shared types
136
145
  └── utils/ logging and shared helpers
137
146
  ```
@@ -231,14 +240,52 @@ Two layers:
231
240
  on a REQUIRED violation. Stages: `pre-exec | post-exec | review | always`;
232
241
  completion/merge/deploy operations auto-force a `review` stage.
233
242
  - **Shell gate + Python enforcers** — `templates/hooks/uap-policy-gate.sh`
234
- binds to harness hook events and invokes the ~20 enforcers in
243
+ binds to harness hook events and invokes the 32 enforcers in
235
244
  `src/policies/enforcers/`. A blocked verdict is **exit code 2** (hard block).
236
245
 
237
246
  Enforcers cover the worktree gate (`worktree_required.py`), task discipline
238
247
  (`task_required.py`), delivery routing (`delivery_enforcement.py`), test deltas
239
248
  (`test_gate.py`), expert review (`expert_review_required.py`), schema diffs
240
- (`schema_diff_gate.py`), memory-before-plan, MCP-router-first, RTK wrapping, and
241
- more. Levels: **REQUIRED** blocks, **RECOMMENDED** logs, **OPTIONAL** informs.
249
+ (`schema_diff_gate.py`), quality metrics (`quality_metrics_gate.py`), design
250
+ tokens (`design_token_gate.py`), visual verification (`visual_verification.py`),
251
+ branch freshness (`branch_freshness.py`), self-protection
252
+ (`enforcement_self_protect.py` — guards the policy DB, hook scripts, and trust
253
+ anchors like `.uap/operator-overrides.json` against tampering, including
254
+ interpreter-mediated writes), memory-before-plan, MCP-router-first,
255
+ and more. Levels: **REQUIRED** blocks, **RECOMMENDED** logs,
256
+ **OPTIONAL** informs.
257
+
258
+ Two trust anchors sit above the policies themselves (v1.224): the
259
+ **operator-overrides file** (`.uap/operator-overrides.json` — temporary,
260
+ expiring bypasses) and the **liveness cache** (`.uap/policy-liveness.json` —
261
+ for policies that declare liveness requirements, a record that their compliant
262
+ path — the PATH commands, agent-writable dirs, resolvable skills they depend
263
+ on — is still satisfiable, so a policy whose sanctioned route has rotted can
264
+ degrade gracefully instead of silently blocking or silently passing). Both are
265
+ honored only when root-owned, symlink-free, not group/world-writable, and (the
266
+ cache) fresh — so a compromised or misbehaving agent running as the same uid
267
+ cannot mint its own bypass.
268
+
269
+ ### Quality gate (`src/quality/`) — QC station, deterministic edition
270
+
271
+ **The break it prevents:** review-by-eyeball lets complexity and coverage rot
272
+ compound invisibly until the codebase fights every change. This station turns
273
+ ten software-quality metrics into a machine-checked budget that can only
274
+ tighten.
275
+
276
+ The quality-metrics gate (v1.223) polices cyclomatic/cognitive complexity,
277
+ Halstead difficulty, LOC-per-file, coverage, CRAP, surviving mutants, dead
278
+ code, duplicate blocks, and explicit `any`/`unknown` — deterministically, with
279
+ no LLM in the loop. The built-in scanner (LOC, complexity, any-types) always
280
+ runs; external tools (lizard, jscpd, rust-code-analysis, knip, Stryker) are
281
+ probed and skipped with a warning when absent. Existing debt is frozen in a
282
+ **ratchet baseline** (`.uap/quality-baseline.json`): only *new or worsened*
283
+ violations block, and regenerating the baseline is a deliberate,
284
+ reviewer-signed-off act. Enforcement lands at edit time
285
+ (`quality_metrics_gate.py`) and at commit/CI time (`uap quality check`); when
286
+ active, the parallel-review artifact must embed a `quality` block and
287
+ `quality.pass: false` vetoes the ship — reviewers adjudicate the numbers, they
288
+ can't outvote them.
242
289
 
243
290
  ### Delivery — `uap deliver` (`src/delivery/`) — Build & QC stations
244
291
 
@@ -247,7 +294,7 @@ emits plausible-but-wrong code and declares victory on a red build. The deliver
247
294
  loop won't let the work leave the Build/QC stations until the project's *real*
248
295
  gates actually pass.
249
296
 
250
- A 15-module convergence loop that drives an underlying model against the
297
+ An 86-module convergence loop that drives an underlying model against the
251
298
  project's **real** completion gates until the work actually passes — the
252
299
  mechanism behind UAP's "agents stop declaring victory on broken code." See the
253
300
  [deliver flow](#how-uap-deliver-orchestrates) below.
@@ -406,9 +453,27 @@ detect gates ──▶ baseline check ──▶ protect files ──▶ ╔═
406
453
  ```
407
454
 
408
455
  - **Verifier ladder** (`verifier-ladder.ts`) — derives gate rungs from
409
- `package.json` scripts (build → typecheck via `tsc --noEmit` → test → lint),
410
- runs each as a real command in a secret-stripped env, fails fast on required
411
- rungs. "Delivered" means all *required* rungs pass; lint is optional.
456
+ `package.json` scripts (build → typecheck via `tsc --noEmit` → test → lint)
457
+ and merges in **project-declared gates** from `delivery.gates[]` in
458
+ `.uap.json` (each declared `cwd` is contained to the project root), runs each
459
+ as a real command in a secret-stripped env, fails fast on required rungs.
460
+ "Delivered" means all *required* rungs pass; lint is optional.
461
+ - **Polyglot execution gate** (`execution-gate.ts`) — beyond Node: Python
462
+ packages get a venv-aware import smoke test (`.venv/bin/python` is probed
463
+ before the ambient interpreter), and native binaries are executed with
464
+ honest verdicts — a signal death fails, while deliberate exit codes,
465
+ timeouts, and not-executable-here are reported as passes/skips rather than
466
+ fabricated evidence.
467
+ - **Scoped rollback** (`snapshot.ts`) — keep-best rollbacks restore **only the
468
+ run's own write-set** (tracked per-tool-write plus a bash sweep of
469
+ stat-moved paths), never the whole tree, so a rollback in a shared worktree
470
+ can't silently revert another agent's work. Restore is realpath-contained
471
+ to the project root; when the write-set is empty but rollback is warranted,
472
+ the run fails loudly and preserves the snapshot instead of guessing.
473
+ - **Config-driven model routing** — `delivery.model`, `delivery.routing`, and
474
+ `delivery.criticality` in `.uap.json` steer the deliver model (precedence:
475
+ CLI flag > config > criticality > env), and the acceptance judge follows the
476
+ same resolution so the grader matches the builder.
412
477
  - **Explorer + ideation** (`explorer.ts`, `ideation.ts`) — best-of-N: generate
413
478
  N candidates with distinct strategy seeds, apply/verify/rollback each on the
414
479
  same baseline, commit only the winner. A model **judge** (`judge.ts`)
@@ -439,5 +504,4 @@ ceiling (default 30, hard cap 50), and stops once progress stalls.
439
504
  - [PROTOCOL.md](PROTOCOL.md) — the harness↔UAP contract and agent loop
440
505
  - [../guides/DELIVERY_PIPELINE.md](../guides/DELIVERY_PIPELINE.md) — the end-to-end delivery-pipeline walkthrough
441
506
  - [../integrations/MCP_ROUTER.md](../integrations/MCP_ROUTER.md) — MCP Router setup
442
- - [../integrations/RTK.md](../integrations/RTK.md) — RTK (Rust Token Killer)
443
507
  - [../../CONTRIBUTING.md](../../CONTRIBUTING.md) — development workflow
@@ -1,6 +1,6 @@
1
1
  # The UAP Protocol
2
2
 
3
- `v1.93.1`
3
+ `v1.224.0`
4
4
 
5
5
  > **🏭 Where this fits:** Cross-cutting (the factory rulebook) — with no shared
6
6
  > contract, each station's rules are guesswork and your agent slips broken work
@@ -1,5 +1,14 @@
1
1
  # Paired Benchmark Findings — When Does UAP Actually Help?
2
2
 
3
+ > **2026-09-02 replication available:** re-run on Qwen3.8-27B × UAP v1.224.x —
4
+ > the +20pp lift did not replicate. The stronger model moved the ceiling
5
+ > (baseline 78%→94% on the same suite), and pooled across 146 raw-adapter
6
+ > cells the gate loop is an exact wash: **82.9% vs 82.9%, Δ 0.0pp
7
+ > [−5.5, +6.9]** — the CI excludes +20pp. UAP never significantly hurt
8
+ > accuracy on any surface; the one actionable regression is deliver-path
9
+ > stop-criteria latency on slow local models. See
10
+ > [the replication section](#2026-09-02-replication--qwen38-27b-dense--uap-v1224x).
11
+
3
12
  Results from the controlled paired harness (`uap bench paired`, see
4
13
  [PAIRED_HARNESS.md](PAIRED_HARNESS.md)). These supersede earlier uncontrolled
5
14
  numbers and complete the story the [TBench Investigation](TBENCH_INVESTIGATION.md)
@@ -119,6 +128,103 @@ from the hidden superset `verifyCmd` that remains the authoritative scorer.
119
128
  detached tree that keeps the pipe open. Fixed with a detached process-group
120
129
  spawn + group SIGKILL; subsequent runs completed 158–190/192 cleanly.
121
130
 
131
+ ## 2026-09-02 replication — Qwen3.8-27B (dense) × UAP v1.224.x
132
+
133
+ Same paired design, re-run on the current production local stack:
134
+ **Qwen3.8-27B** (dense qwen35-arch, UD-IQ4_XS, native draft-mtp on llama.cpp,
135
+ 131k ctx/slot × 2 slots, RTX 3090) against **UAP v1.224.x** — i.e. *after* the
136
+ quality-metrics gate (v1.223.0) and the deliver-pipeline hardening (v1.224.0)
137
+ shipped. Plan: [qwen38-uap-retest-plan](../plans/qwen38-uap-retest-plan.md).
138
+
139
+ **Headline: the +20pp gate-loop lift did not replicate at that magnitude —
140
+ because the stronger model moved the ceiling.** On the identical gated suite
141
+ the without-UAP baseline rose from 78% (qwen36 MoE) to **94%**, leaving almost
142
+ no headroom; UAP fixed every remaining baseline failure and regressed none.
143
+ On never-before-seen held-out tasks with real headroom (78.4% baseline), the
144
+ raw gate loop was net-neutral (5 fixed, 5 regressed). UAP never significantly
145
+ hurt accuracy on any surface; its costs (tokens, turns, latency) are real and
146
+ quantified below.
147
+
148
+ | Surface | n/arm | WITHOUT UAP | WITH UAP | Δ accuracy (95% CI) | McNemar fixed/regressed | Cost Δ |
149
+ |---|---|---|---|---|---|---|
150
+ | E1 raw, `real-gate-gated`, 10 ep | 50 | 94.0% | **100%** | **+6.0pp [0, +14]**, p=0.25 | **3 / 0** | +272 tok (n.s.) |
151
+ | E3a raw, `real-gate-heldout`, 3 ep | 51 | 78.4% | 78.4% | 0pp [−11.8, +11.8] | 5 / 5 | +1,044 tok [+101, +2,571] |
152
+ | E3b raw, `real-gate-power`, 3 ep | 45 | 75.6% | 68.9% | −6.7pp [−20, +6.7], p=0.51 | 3 / 6 | +117 tok (n.s.; loop never fired — see below) |
153
+ | E2 opencode, `real-gate-hard`, 4 ep | 36 | 94.4% | 97.2% | +2.8pp [0, +8.3], p=1 | 1 / 0 | +52.0k tok [+20.8k, +86.8k], +1.2 turns |
154
+ | E4 `uap deliver` (real pipeline), `real-gate-gated`, 5 ep | 25 | 68.0% | 60.0% | −8.0pp [−32, +16], p=0.75 | 4 / 6 | **+7.7 min/cell, p=0.0007** |
155
+
156
+ **Pooled raw-adapter estimate (E1+E3a+E3b, 146 paired cells, 38 distinct
157
+ tasks): 82.9% vs 82.9% — Δ 0.0pp, sign-flip 95% CI [−5.5, +6.9], p=1.0;
158
+ McNemar 11 fixed / 11 regressed.** The CI now *excludes* the original +20pp:
159
+ for this model, that lift is falsified, not replicated. (Pooled analysis:
160
+ paired sign-flip bootstrap over the union of the three runs' records, seed 1,
161
+ 10k resamples — same method as the per-run reports.)
162
+
163
+ ### How to read it
164
+
165
+ - **E1 (direct replication of the decisive qwen36 run):** same suite, same
166
+ temp (0.6), same epochs. Baseline 78%→94% across model generations is the
167
+ story — Qwen3.8-27B one-shots most edge cases the older MoE missed. UAP's
168
+ gate loop converted the remaining 3 baseline failures into passes with zero
169
+ regressions: same sign as the original +20pp, smaller magnitude because the
170
+ headroom shrank. CI touches 0 at n=50, so treat as directional.
171
+ - **E3a (held-out tasks):** the honest counterweight. On tasks neither the
172
+ model tuning nor this repo's earlier analysis could have overfit to, the
173
+ loop's fixes (5) were exactly offset by rewrites that broke working
174
+ single-shot answers (5). The +1,044-token overhead is real. Net accuracy
175
+ claim on unseen tasks: **no measurable gain, no measurable harm**.
176
+ - **E3b (power suite):** a different null mechanism — uap-full turns = 1.0
177
+ exactly. On these tasks the model's solution passes the *visible* in-repo
178
+ gate but fails the *hidden* verify superset, so the gate loop has nothing
179
+ to catch and never iterates; the arms differ only by prompt-surface
180
+ sampling noise at temp 0.6 (3 flips one way, 6 the other). Lesson for suite
181
+ design: gate-loop value requires the visible gate to correlate with the
182
+ hidden edges; where it doesn't, UAP can neither help nor systematically
183
+ hurt.
184
+ - **E2 (agentic harness):** replicates the original 0pp-at-ceiling finding in
185
+ spirit (94.4% baseline; +2.8pp, 1 fixed / 0 regressed) and confirms the
186
+ cost side precisely: the UAP surface costs ~52k tokens and ~1.2 turns per
187
+ task on opencode. On a self-verifying agent, UAP's contribution is not
188
+ first-pass accuracy.
189
+ - **E4 (the actual v1.224.x deliver pipeline, not the raw miniature):** the
190
+ one surface where UAP underperformed its own bare-turn baseline (−8pp, CI
191
+ spans 0, underpowered at n=25). The mechanism is visible in the records:
192
+ **29 of 50 cells hit the 21-minute cell timeout** (median treatment latency
193
+ = the cap), and every treatment mission ended in a not-delivered verdict —
194
+ including 15 that had in fact written a verify-passing solution. The
195
+ convergence loop does not stop in time on a slow local 27B: stop-criteria
196
+ and acceptance-judge latency are calibrated for fast API models.
197
+ **Actionable follow-up:** tune deliver stop criteria / judge timeouts for
198
+ slow local backends (or auto-scale the cell budget to model speed) before
199
+ quoting deliver-path numbers on this class of hardware.
200
+
201
+ ### Cross-model caveat
202
+
203
+ The qwen36 → qwen38 comparison is **not paired**: model, serving stack
204
+ (llama.cpp build, template, speculative decoding), and UAP version all moved
205
+ between June and September. The per-model paired deltas above are the claims;
206
+ the generational baseline shift (78%→94% on the same suite) is context, not a
207
+ measurement of the model alone.
208
+
209
+ ### Reproduce (this stack)
210
+
211
+ ```bash
212
+ # Raw single-shot vs gate loop (E1):
213
+ UAP_RAW_TEMPERATURE=0.6 uap bench paired --adapter raw --model "Qwen3.8-27B" \
214
+ --suite benchmarks/suites/real-gate-gated --epochs 10 --concurrency 2
215
+
216
+ # Agentic with/without (E2 — model id is opencode's provider/model form):
217
+ uap bench paired --adapter opencode --model "qwen-proxy/Qwen3.8-27B" \
218
+ --suite benchmarks/suites/real-gate-hard --epochs 4 --concurrency 2
219
+
220
+ # Real deliver pipeline (E4 — model is a deliver preset, not the served alias):
221
+ uap bench paired --adapter deliver --model "qwen38-27b" \
222
+ --suite benchmarks/suites/real-gate-gated --epochs 5 --concurrency 2
223
+ ```
224
+
225
+ Artifacts: `benchmark-results/paired-qwen38-e1-gated`,
226
+ `-e2-hard-opencode`, `-e3a-heldout`, `-e3b-power`, `-e4-deliver2`.
227
+
122
228
  ## Reproduce
123
229
 
124
230
  ```bash
@@ -107,6 +107,22 @@ and **pass** once the task is correctly solved.
107
107
  | `mock` | none (deterministic simulation) | exercises the pipeline offline; **not** a source of real claims |
108
108
  | `opencode` | `opencode run --model <m> <instruction>` | tokens, cost, steps, tool-calls (best-effort JSON) |
109
109
  | `claude` | `claude -p <instruction> --output-format json --model <m>` | tokens, cost, turns |
110
+ | `raw` | one chat completion per cell; UAP arm loops it against the visible gate | tokens, turns, latency |
111
+ | `mini` | `mini -y -m <m> -t <instruction>` (mini-SWE-agent) | external comparability anchor |
112
+ | `deliver` | real `uap deliver` CLI per cell (baseline arm runs one bare turn) | verdict + turns from the JSON result |
110
113
 
111
114
  New agents are a few lines: implement `AgentAdapter` (or configure a
112
115
  `SubprocessAdapter` with a `parseUsage` function) in `src/benchmarks/paired/adapter.ts`.
116
+
117
+ ### Time budgets on slow local models
118
+
119
+ A `deliver` cell's budget is `agentTimeoutSec × UAP_BENCH_DELIVER_TIMEOUT_MULT`
120
+ (default 6, raised from 3 in 2026-09). The ×3 era was calibrated on fast hosted
121
+ models; a full convergence mission on a slow local model (plan + self-gate +
122
+ N turns + acceptance judge, each model call costing minutes) blew through it
123
+ and the harness killed missions whose workdir already passed verification —
124
+ paired-qwen38-e4 lost 21/25 treatment cells that way, manufacturing a -8pp
125
+ "regression" out of pure budget starvation. Raise the multiplier (never
126
+ disable it — an unbounded cell is a wedged overnight run) when the backing
127
+ model is slow, and read a `timeout`-errored cell as *harness budget*, not a
128
+ model failure.