@miller-tech/uap 1.222.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 (234) 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/generators/claude-md.js +17 -4
  72. package/dist/generators/claude-md.js.map +1 -1
  73. package/dist/policies/liveness.d.ts +105 -0
  74. package/dist/policies/liveness.d.ts.map +1 -0
  75. package/dist/policies/liveness.js +251 -0
  76. package/dist/policies/liveness.js.map +1 -0
  77. package/dist/policies/policy-memory.d.ts.map +1 -1
  78. package/dist/policies/policy-memory.js +3 -4
  79. package/dist/policies/policy-memory.js.map +1 -1
  80. package/dist/quality/baseline.d.ts +29 -0
  81. package/dist/quality/baseline.d.ts.map +1 -0
  82. package/dist/quality/baseline.js +79 -0
  83. package/dist/quality/baseline.js.map +1 -0
  84. package/dist/quality/complexity.d.ts +38 -0
  85. package/dist/quality/complexity.d.ts.map +1 -0
  86. package/dist/quality/complexity.js +239 -0
  87. package/dist/quality/complexity.js.map +1 -0
  88. package/dist/quality/config.d.ts +40 -0
  89. package/dist/quality/config.d.ts.map +1 -0
  90. package/dist/quality/config.js +77 -0
  91. package/dist/quality/config.js.map +1 -0
  92. package/dist/quality/crap.d.ts +11 -0
  93. package/dist/quality/crap.d.ts.map +1 -0
  94. package/dist/quality/crap.js +54 -0
  95. package/dist/quality/crap.js.map +1 -0
  96. package/dist/quality/languages.d.ts +25 -0
  97. package/dist/quality/languages.d.ts.map +1 -0
  98. package/dist/quality/languages.js +150 -0
  99. package/dist/quality/languages.js.map +1 -0
  100. package/dist/quality/report.d.ts +38 -0
  101. package/dist/quality/report.d.ts.map +1 -0
  102. package/dist/quality/report.js +251 -0
  103. package/dist/quality/report.js.map +1 -0
  104. package/dist/quality/scanner.d.ts +32 -0
  105. package/dist/quality/scanner.d.ts.map +1 -0
  106. package/dist/quality/scanner.js +127 -0
  107. package/dist/quality/scanner.js.map +1 -0
  108. package/dist/quality/tools.d.ts +28 -0
  109. package/dist/quality/tools.d.ts.map +1 -0
  110. package/dist/quality/tools.js +189 -0
  111. package/dist/quality/tools.js.map +1 -0
  112. package/dist/types/config.d.ts +148 -0
  113. package/dist/types/config.d.ts.map +1 -1
  114. package/dist/types/config.js +35 -0
  115. package/dist/types/config.js.map +1 -1
  116. package/docs/ATTRIBUTION.md +0 -1
  117. package/docs/INDEX.md +38 -4
  118. package/docs/analysis/MARKET_POSITION.md +179 -0
  119. package/docs/architecture/OVERVIEW.md +82 -18
  120. package/docs/architecture/PROTOCOL.md +1 -1
  121. package/docs/benchmarks/PAIRED_FINDINGS.md +106 -0
  122. package/docs/benchmarks/PAIRED_HARNESS.md +16 -0
  123. package/docs/benchmarks/README.md +59 -0
  124. package/docs/design/UAP_REACTOR.md +0 -1
  125. package/docs/getting-started/INSTALLATION.md +1 -1
  126. package/docs/guides/AUTOMATIC.md +0 -14
  127. package/docs/guides/AUTOMATIC_FEATURES.md +1 -9
  128. package/docs/guides/COORDINATION.md +1 -1
  129. package/docs/guides/DELIVERY_PIPELINE.md +5 -0
  130. package/docs/guides/DEPLOY_BATCHING.md +1 -1
  131. package/docs/guides/DROIDS_AND_SKILLS.md +1 -1
  132. package/docs/guides/LOCAL_MODELS.md +6 -1
  133. package/docs/guides/MCP_ROUTER.md +1 -1
  134. package/docs/guides/MEMORY.md +1 -1
  135. package/docs/guides/MULTI_MODEL.md +1 -1
  136. package/docs/guides/ORCHESTRATOR.md +1 -1
  137. package/docs/guides/POLICIES.md +19 -3
  138. package/docs/guides/QWEN38_EXL3.md +114 -0
  139. package/docs/guides/WORKTREE_WORKFLOW.md +45 -1
  140. package/docs/integrations/MCP_ROUTER.md +1 -4
  141. package/docs/plans/deliver-hardening-plan-2026-07-13.md +173 -0
  142. package/docs/plans/deliver-hardening-review-response-2026-07-13.md +180 -0
  143. package/docs/plans/k3-uap-uplift-validation.md +216 -0
  144. package/docs/plans/qwen38-uap-retest-plan.md +196 -0
  145. package/docs/reference/API.md +1 -1
  146. package/docs/reference/CLI.md +49 -14
  147. package/docs/reference/COMPARISON.md +248 -0
  148. package/docs/reference/CONFIGURATION.md +1 -3
  149. package/docs/reference/DATABASE_SCHEMA.md +1 -1
  150. package/docs/reference/FEATURES.md +3 -3
  151. package/docs/reference/PATTERNS.md +1 -1
  152. package/docs/reference/PLATFORMS.md +1 -1
  153. package/package.json +2 -2
  154. package/scripts/maintenance/update-skills.py +0 -22
  155. package/scripts/maintenance/verify-compliance.sh +3 -3
  156. package/src/policies/enforcers/__pycache__/_common.cpython-312.pyc +0 -0
  157. package/src/policies/enforcers/__pycache__/quality_metrics_gate.cpython-312.pyc +0 -0
  158. package/src/policies/enforcers/adr_guard.py +0 -0
  159. package/src/policies/enforcers/bearer_lockdown.py +0 -0
  160. package/src/policies/enforcers/branch_freshness.py +0 -0
  161. package/src/policies/enforcers/design_token_gate.py +0 -0
  162. package/src/policies/enforcers/enforcement_self_protect.py +70 -0
  163. package/src/policies/enforcers/expert_review_required.py +22 -0
  164. package/src/policies/enforcers/iac_plan_destruction_check.py +0 -0
  165. package/src/policies/enforcers/quality_metrics_gate.py +447 -0
  166. package/src/policies/enforcers/ship_loop_gate.py +0 -0
  167. package/src/policies/enforcers/validate_plan_on_change.py +0 -0
  168. package/src/policies/enforcers/visual_verification.py +0 -0
  169. package/src/policies/enforcers/workdir_scope.py +0 -0
  170. package/src/policies/schemas/policies/expert-review-required.md +9 -1
  171. package/src/policies/schemas/policies/quality-metrics-gate.md +74 -0
  172. package/templates/CLAUDE.template.md +1 -1
  173. package/templates/hooks/__pycache__/deliver_autoroute.cpython-312.pyc +0 -0
  174. package/templates/hooks/pre-tool-use-bash.sh +50 -3
  175. package/templates/hooks/pre-tool-use-edit-write.sh +31 -0
  176. package/templates/hooks/session-start.sh +15 -0
  177. package/templates/hooks/uap-policy-gate.sh +187 -5
  178. package/templates/stryker.config.json +14 -0
  179. package/tools/agents/scripts/__pycache__/toolcall_path_normalizer.cpython-312.pyc +0 -0
  180. package/tools/agents/scripts/anthropic_proxy.py +254 -28
  181. package/tools/agents/tests/run_acceptance.py +0 -0
  182. package/tools/agents/tests/test_client_disconnect.py +0 -0
  183. package/tools/agents/tests/test_cycle_break_exploration.py +0 -0
  184. package/tools/agents/tests/test_deferral_break.py +0 -0
  185. package/tools/agents/tests/test_delivery_enforcement_all_langs.py +0 -0
  186. package/tools/agents/tests/test_delivery_enforcement_exemptions.py +0 -0
  187. package/tools/agents/tests/test_delivery_enforcement_filepath.py +0 -0
  188. package/tools/agents/tests/test_delivery_enforcement_web_and_bash.py +0 -0
  189. package/tools/agents/tests/test_delivery_enforcement_worktree.py +0 -0
  190. package/tools/agents/tests/test_delivery_enforcement_write_complexity.py +0 -0
  191. package/tools/agents/tests/test_disconnect_watcher.py +0 -0
  192. package/tools/agents/tests/test_doubling_break.py +0 -0
  193. package/tools/agents/tests/test_empty_maxtokens_recovery.py +0 -0
  194. package/tools/agents/tests/test_empty_tool_loop_break.py +0 -0
  195. package/tools/agents/tests/test_enforcement_self_protect.py +90 -0
  196. package/tools/agents/tests/test_enforcer_escape_hatches.py +0 -0
  197. package/tools/agents/tests/test_error_loop_break.py +0 -0
  198. package/tools/agents/tests/test_expert_review_pr_scope.py +13 -5
  199. package/tools/agents/tests/test_fastpath_config.py +0 -0
  200. package/tools/agents/tests/test_finalize_suppression.py +0 -0
  201. package/tools/agents/tests/test_gate_evidence.py +0 -0
  202. package/tools/agents/tests/test_gate_failclosed_indirection.py +0 -0
  203. package/tools/agents/tests/test_gate_integrity.py +0 -0
  204. package/tools/agents/tests/test_live_deliver_kill.py +0 -0
  205. package/tools/agents/tests/test_malformed_unclosed_think.py +0 -0
  206. package/tools/agents/tests/test_mandate_beats_recon.py +0 -0
  207. package/tools/agents/tests/test_mandate_deliver.py +0 -0
  208. package/tools/agents/tests/test_non_stream_resp_log.py +0 -0
  209. package/tools/agents/tests/test_output_token_ceilings.py +0 -0
  210. package/tools/agents/tests/test_overflow_truncate_count_tokens.py +0 -0
  211. package/tools/agents/tests/test_path_containment.py +0 -0
  212. package/tools/agents/tests/test_path_normalizer_hardened.py +0 -0
  213. package/tools/agents/tests/test_repeat_call_guard.py +0 -0
  214. package/tools/agents/tests/test_repeat_guard.py +0 -0
  215. package/tools/agents/tests/test_session_admission.py +0 -0
  216. package/tools/agents/tests/test_stream_heartbeat.py +0 -0
  217. package/tools/agents/tests/test_stream_thinking_deltas.py +405 -0
  218. package/tools/agents/tests/test_stuck_break_hard.py +0 -0
  219. package/tools/agents/tests/test_stuck_break_reattach.py +0 -0
  220. package/tools/agents/tests/test_turn_count_breaker_periodic.py +0 -0
  221. package/tools/agents/tests/test_upstream_chokepoint.py +0 -0
  222. package/tools/agents/tests/test_upstream_model_aliases.py +0 -0
  223. package/tools/agents/tests/test_validate_plan_gate.py +0 -0
  224. package/tools/agents/tests/test_vision_passthrough.py +0 -0
  225. package/tools/agents/tests/test_workdir_scope_enforcer.py +0 -0
  226. package/dist/cli/rtk.d.ts +0 -34
  227. package/dist/cli/rtk.d.ts.map +0 -1
  228. package/dist/cli/rtk.js +0 -401
  229. package/dist/cli/rtk.js.map +0 -1
  230. package/docs/integrations/RTK.md +0 -113
  231. package/scripts/setup/install-rtk.sh +0 -184
  232. package/src/policies/enforcers/rtk_wrap.py +0 -205
  233. package/src/policies/schemas/policies/rtk-wrap.md +0 -50
  234. package/tools/agents/tests/test_rtk_wrap.py +0 -151
@@ -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.
@@ -2,6 +2,27 @@
2
2
 
3
3
  Performance and accuracy results for the Universal Agent Protocol.
4
4
 
5
+ ## How to read these numbers (the rationale)
6
+
7
+ UAP's core claim is *process* value: gates, memory, and coordination make an
8
+ agent's output more reliable. Measuring that honestly is hard, because an
9
+ agentic scaffold changes many variables at once (prompts, retries, tools,
10
+ budgets). So the benchmark program runs in two tiers, and they answer
11
+ different questions:
12
+
13
+ 1. **Controlled paired A/B** (`uap bench paired`) — same model, same tasks,
14
+ same seeds, same harness; the *only* thing toggled is the UAP scaffold.
15
+ This is the only design that isolates UAP's causal contribution, and it's
16
+ the tier whose numbers we quote as findings.
17
+ 2. **Uncontrolled field runs** (Terminal-Bench 2.0, uplift sweeps) — real
18
+ tasks, real agents, real token bills. These show magnitude and cost shape
19
+ but can't attribute causation; the
20
+ [TBench Investigation](TBENCH_INVESTIGATION.md) documents exactly how
21
+ apparent lifts dissolve into confounds when you control the variables.
22
+
23
+ The headline below is therefore deliberately narrower than a marketing page
24
+ would like — that's the point.
25
+
5
26
  ## Controlled paired result (start here)
6
27
 
7
28
  The rigorous, reproducible finding from the [paired harness](PAIRED_HARNESS.md)
@@ -41,4 +62,42 @@ authoritative.
41
62
  | [Accuracy Analysis](ACCURACY_ANALYSIS.md) | Success-rate and error analysis |
42
63
  | [Comprehensive Benchmarks](COMPREHENSIVE_BENCHMARKS.md) | Extended measurements |
43
64
 
65
+ ## Task suites and raw runs
66
+
67
+ Reproduce or extend any of it:
68
+
69
+ - **Task suites** (`benchmarks/suites/`) — the paired-harness suites, ordered
70
+ roughly by difficulty: `smoke/` (easy/medium/hard sanity checks),
71
+ `real-gate/` and `real-gate-medium/` (small real tasks), `real-gate-hard/`,
72
+ `real-gate-brutal/`, `real-gate-power/`, `real-gate-gated/` (tasks with a
73
+ deterministic `verifyCmd` as ground truth — no LLM judge),
74
+ `real-gate-heldout/` (kept out of tuning), and `swe-bench-pro/` (generator +
75
+ A/B runner for SWE-bench-style tasks).
76
+ - **Cluster jobs** (`benchmarks/harbor-*.yaml`, `benchmarks/harbor-configs/`,
77
+ `benchmarks/harbor-tasks/`) — Harbor job definitions for running the suites
78
+ on a GPU box against local llama.cpp models (e.g. the Qwen3.5/3.6 configs).
79
+ - **Terminal-Bench shim** (`benchmarks/terminal_bench/`) — the opencode agent
80
+ adapter used for the TBench runs.
81
+ - **Raw results** (`benchmark-results/`, untracked — local only) — every
82
+ paired run drops a named directory (timestamped or version-labeled) with
83
+ `records.jsonl`, `report.json`, and `report.md`. Notable series: the June
84
+ 2026 `paired-qwen36-*` sweeps (model/adapter/budget ablations), the
85
+ `paired-uplift-*` regression series (per-version uplift tracking), and
86
+ `real-uplift-1610/` (an agentic-baseline run: 100% → 83.3%, Δ −16.7pp with
87
+ CI [−0.50, 0.00] spanning 0 — i.e. no measurable lift against an agent that
88
+ already self-verifies, matching the paired finding).
89
+
90
+ A typical reproduction:
91
+
92
+ ```bash
93
+ uap bench paired --adapter raw --suite benchmarks/suites/real-gate-gated
94
+ ```
95
+
96
+ ## What we measure
97
+
98
+ Each paired run reports a vector, not a single score: correctness delta with a
99
+ bootstrap 95% CI, a McNemar gate-value 2×2 (tasks the gates rescued vs tasks
100
+ they broke), token/turn/latency deltas, and a leave-one-out ablation over UAP
101
+ components so you can see which station earns its keep.
102
+
44
103
  See the [documentation index](../INDEX.md) for the rest of the docs.
@@ -137,7 +137,6 @@ mode (Assist = intake/routing context; Enforce = a station gate):
137
137
  | completion gate | stop | Enforce |
138
138
  | HALO analyze | session-end | Assist |
139
139
  | deploy flush | on deliver success | Enforce |
140
- | rtk token-opt | pre-tool (bash) | Enforce (already) |
141
140
  | ideate | on-demand only (router suggests when stuck) | Assist |
142
141
 
143
142
  ## 5. Per-harness wiring
@@ -9,7 +9,7 @@ edits your main branch, writes plausible-but-wrong code, and cheerfully declares
9
9
  "done" on something that never actually ran. UAP puts a station at each of those
10
10
  break points so the work that comes off the line is trustworthy.
11
11
 
12
- It ships as a single npm package (`@miller-tech/uap`, v1.93.1) that installs the
12
+ It ships as a single npm package (`@miller-tech/uap`, v1.224.0) that installs the
13
13
  `uap` CLI. This page gets it onto your machine and wired into your project.
14
14
 
15
15
  ## Prerequisites
@@ -137,7 +137,6 @@ automatically on every operation. No manual code reviews for common issues.
137
137
 
138
138
  | Gate | What it checks | When it fires |
139
139
  |---|---|---|
140
- | rtk_wrap | Token optimization | Every CLI command |
141
140
  | iac_parity | Infrastructure-as-Code safety | kubectl, helm, aws, gcloud, doctl |
142
141
  | delivery_enforcement | Verified output | Every source file edit |
143
142
 
@@ -233,18 +232,6 @@ changes are batched together and deployed as a single atomic unit.
233
232
 
234
233
  ---
235
234
 
236
- ### rtk — 60–90% Token Savings
237
-
238
- **Benefit:** Massive token savings on every CLI command. rtk intercepts commands,
239
- optimizes them, and proxies through a token-efficient layer.
240
-
241
- **When it kicks in:** On every CLI command. rtk rewrites commands to use
242
- optimized paths and caches results.
243
-
244
- **You get:** Dramatically lower API costs and faster command execution.
245
-
246
- ---
247
-
248
235
  ### HALO — Human Oversight
249
236
 
250
237
  **Benefit:** Critical operations require human approval before execution.
@@ -288,7 +275,6 @@ VRAM-tiered configurations.
288
275
  | Schema-diff | API contract safety | Schema edits |
289
276
  | Completion gates | Verify "done" is done | Agent claims done |
290
277
  | Deploy batching | Atomic multi-change deploys | Deployable changes |
291
- | rtk | 60–90% token savings | Every CLI command |
292
278
  | HALO | Human oversight for critical ops | Critical actions |
293
279
 
294
280
  **Install UAP. Use your coding agent normally. Everything else is automatic.**
@@ -195,16 +195,9 @@ the definition of done, and work resumes across sessions without being asked.
195
195
 
196
196
  ## Developer Experience
197
197
 
198
- ### RTK (Rust Token Killer)
199
- **What it does:** CLI proxy that intercepts common commands (`git status`, `npm install`, etc.) and rewrites them for token efficiency — 60-90% token savings on dev operations.
200
-
201
- **When it kicks in:** Automatically for every shell command you run. No flags needed.
202
-
203
- **Why it matters:** Token costs add up fast. RTK transparently optimizes every command without you thinking about it.
204
-
205
198
  ### Dashboard — Savings & Orchestration Visibility
206
199
  **What it does:** `uap dash serve` shows **Token Savings by Influence** (real
207
- tokens/cost saved per mechanism — RTK, model routing, context compression — with
200
+ tokens/cost saved per mechanism — model routing, context compression — with
208
201
  honest *measured/estimated* labels) and an **Orchestrations & Hierarchy** tree
209
202
  (the live mission → epic → task tree with the agents on each node and the active
210
203
  build ledger's progress).
@@ -277,7 +270,6 @@ long-running build is progressing — no guesswork.
277
270
  | Pattern RAG | ✅ | Every prompt | Battle-tested implementations |
278
271
  | Coordination | ✅ | Complex tasks | Parallel subagent execution |
279
272
  | Deploy batching | ✅ | Multiple changes | Atomic, efficient deploys |
280
- | RTK | ✅ | Every command | 60-90% token savings |
281
273
  | HALO | ✅ | Substantial prompts | Automatic task decomposition |
282
274
  | Model presets | ✅ | Model selection | Optimal params per model |
283
275
 
@@ -1,6 +1,6 @@
1
1
  # Multi-Agent Coordination
2
2
 
3
- > UAP v1.163
3
+ > UAP v1.224.0
4
4
 
5
5
  > **🏭 Where this fits:** LINE COORDINATION — the station where parallel agents on the [delivery pipeline](./DELIVERY_PIPELINE.md) quietly step on each other: two of them editing the same file, duplicating work, or deadlocking at merge. **What it delivers:** agents register, announce what they're about to touch, and check for overlaps *before* they start — so the line runs many workers at once and still stays conflict-free.
6
6
 
@@ -62,6 +62,8 @@ Two things run the length of the whole line: **policy gates** (the rules are *ex
62
62
 
63
63
  **What UAP puts here:**
64
64
  - **[`uap deliver`](DELIVER.md)** — a convergence loop that keeps iterating a model against your real gates until the work is actually built.
65
+ - **Your gates, including the ones you declare** — build/test/lint are discovered from `package.json`, and anything extra (a migration check, a codegen diff, a contract test) can be declared in `delivery.gates[]` in `.uap.json` and joins the same ladder.
66
+ - **A polyglot execution gate** — not everything is `node`: Python packages get a venv-aware import smoke test, native binaries are actually executed, and a binary that can't run on this host is an honest *skip*, never fabricated pass-evidence.
65
67
  - **Serving-layer recipes** — Fusion / Confidence / Ratings / ReMoM run behind the proxy to raise output quality, *escalating to a stronger, distinct judge* when it counts. (A same-model judge — qwen grading qwen — was measured to add nothing, so recipes only spend that budget when a genuinely stronger judge is wired.)
66
68
  - **[Local-model handling](LOCAL_MODELS.md)** — the proxy's guardrails (loop-breaker, recon-convergence, the no-tool empty-output guard, path normalization) keep a cheap local model on the rails so it produces real modules, not scaffolding.
67
69
 
@@ -74,8 +76,10 @@ Two things run the length of the whole line: **policy gates** (the rules are *ex
74
76
  **What UAP puts here:**
75
77
  - **Completion gates** — build, tests, lint, type-check must be green before anything can claim "done."
76
78
  - **Execution / runtime verify** (`uap verify`) — the generated code is actually *run* (headless browser, vm-dom, or child process) to prove it works, not just that it parses.
79
+ - **The quality-metrics gate** (`uap quality check`) — ten code-quality budgets (complexity, coverage, CRAP, surviving mutants, dead code, duplicates, `any` types…) enforced deterministically, with a ratchet baseline so existing debt is frozen but the floor can only rise. Reviewers adjudicate the numbers; they can't outvote them.
77
80
  - **The acceptance judge** — an independent check that the behaviour matches the spec.
78
81
  - **Generator ≠ evaluator** — the thing that grades the work is deliberately *not* the thing that wrote it.
82
+ - **Scoped rollback** — when a turn makes things worse, keep-best restores *only the files that run actually wrote* (tracked per-write plus a shell sweep), never the whole tree — so a rollback on a shared floor can't eat another agent's work.
79
83
 
80
84
  **Delivered:** "done" you can trust, because a different checker signed off.
81
85
 
@@ -98,6 +102,7 @@ Two things run the length of the whole line: **policy gates** (the rules are *ex
98
102
  - **Worktree → PR flow** with completion and version gates, so merges are clean and versioned.
99
103
  - **CI feedback watcher** — when CI goes red after a push, the loop re-converges instead of walking away.
100
104
  - **Never-regress + git-safety** — destructive git operations are guarded; passing work stays passing.
105
+ - **Policy liveness + operator overrides** — the gates themselves are watched: a liveness registry tracks whether each liveness-declaring policy's compliant path (its tools, dirs, skills) is still satisfiable, and emergency bypasses live in a root-owned, expiring `.uap/operator-overrides.json` — so an agent can neither quietly let a gate rot nor mint its own exemption.
101
106
 
102
107
  **Delivered:** changes reach `main` clean, versioned, and CI-verified.
103
108
 
@@ -1,6 +1,6 @@
1
1
  # Deploy Batching
2
2
 
3
- > UAP v1.163
3
+ > UAP v1.224.0
4
4
 
5
5
  > **🏭 Where this fits:** LINE COORDINATION → SHIPPING — this is the station
6
6
  > where parallel agents collide: two push to the same branch within seconds and
@@ -1,6 +1,6 @@
1
1
  # Droids and Skills
2
2
 
3
- > Applies to UAP **v1.163**
3
+ > Applies to UAP **v1.224.0**
4
4
 
5
5
  > **🏭 Where this fits:** PREP/ROUTING — this is the station where a
6
6
  > generalist agent takes the wrong approach on specialist work: reviewing
@@ -1,6 +1,6 @@
1
1
  # Running UAP Against Local Models
2
2
 
3
- > UAP v1.163
3
+ > UAP v1.224.0
4
4
 
5
5
  > **🏭 Where this fits:** BUILD — this is the station where a cheap local model
6
6
  > flails: plausible-but-wrong code, empty output, or a loop that never lands a
@@ -23,6 +23,11 @@ productive station on your [delivery pipeline](./DELIVERY_PIPELINE.md).
23
23
  > [Qwen3.6 35B-A3B on llama.cpp, by VRAM tier](QWEN36_LLAMACPP.md) for
24
24
  > copy-paste launch commands for 8 / 12 / 16 / 24 / 32 GB GPUs, and how
25
25
  > `uap deliver` uplifts a small local model to *verified* results.
26
+ >
27
+ > **Production note (2026-09-04):** the reference box now serves Qwen3.8-27B
28
+ > via **exllamav3/EXL3** (~1.5x faster decode at the same 131k context) —
29
+ > see [Qwen3.8-27B on exllamav3 (EXL3)](QWEN38_EXL3.md). The llama.cpp path
30
+ > below remains fully supported and is the rollback stack there.
26
31
 
27
32
  There are two endpoint shapes involved, and it matters which client speaks
28
33
  which protocol:
@@ -1,6 +1,6 @@
1
1
  # MCP Router
2
2
 
3
- > UAP v1.163
3
+ > UAP v1.224.0
4
4
 
5
5
  > **🏭 Where this fits:** CROSS-CUTTING — keeping the context window lean at every station of the [delivery pipeline](./DELIVERY_PIPELINE.md). In a normal agentic workflow every tool call dumps its full result into context, so mostly-irrelevant output crowds out the details your agent actually needs. **What it delivers:** a proxy that compresses tool output before it reaches the model — up to 98% fewer tokens on large results — so the agent keeps room for real work and you spend less per session.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Memory System
2
2
 
3
- > UAP v1.163
3
+ > UAP v1.224.0
4
4
 
5
5
  > **🏭 Where this fits:** INTAKE + FEEDBACK — the front and back doors of the [delivery pipeline](./DELIVERY_PIPELINE.md). At intake, a fresh agent forgets everything the last session learned and re-hallucinates scope; at feedback, nobody records the lesson, so the same mistake ships again next week. **What it delivers:** a persistent, searchable memory that hands each new agent the relevant past learnings on the way in, and captures durable lessons on the way out — so your team of agents gets smarter every run instead of starting from zero.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Multi-Model Routing
2
2
 
3
- > Applies to UAP **v1.163**
3
+ > Applies to UAP **v1.224.0**
4
4
 
5
5
  > **🏭 Where this fits:** PREP/ROUTING — this is the station where a normal
6
6
  > agentic workflow sends *everything* to one model: paying premium-model rates
@@ -186,7 +186,7 @@ this machinery:
186
186
  per-node status and the agents working each node, plus the active build
187
187
  ledger's progress.
188
188
  - **Token Savings by Influence** — real tokens/cost saved, attributed per
189
- mechanism (RTK, model routing, context compression), with honest
189
+ mechanism (model routing, context compression), with honest
190
190
  *measured / estimated* labels.
191
191
 
192
192
  ---
@@ -1,6 +1,6 @@
1
1
  # Policies
2
2
 
3
- > Applies to UAP v1.163
3
+ > Applies to UAP v1.224.0
4
4
 
5
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.
6
6
 
@@ -62,10 +62,13 @@ Each enforcer guards a specific station of the pipeline. The enforcers in
62
62
  | Enforcer | What it gates |
63
63
  |----------|---------------|
64
64
  | `worktree_required` | Edit/Write/MultiEdit must target a `.worktrees/` path |
65
+ | `workdir_scope` | File-mutating tool calls must stay within the project working directory |
65
66
  | `task_required` | A UAP task must be `in_progress` before mutating work |
66
67
  | `coord_overlap` | Checks for in-flight agent path reservations (parallel-agent overlap) |
67
68
  | `branch_freshness` | Worktree edits blocked once the branch drifts too far from the integration branch (warn 50, block 200) |
68
69
  | `delivery_enforcement` | Route substantive coding through `uap deliver` |
70
+ | `commitment_reserve` | Blocks all-in, no-way-back moves that exhaust the commitment reserve |
71
+ | `adr_guard` | Generic ADR-driven tool-call gate |
69
72
 
70
73
  ### Plan discipline
71
74
 
@@ -73,7 +76,7 @@ Each enforcer guards a specific station of the pipeline. The enforcers in
73
76
  |----------|---------------|
74
77
  | `memory_before_plan` | Plans require a recent `uap memory query` |
75
78
  | `codebase_read_before_plan` | Plans require prior reads of the target paths |
76
- | `validate_plan_before_build` | A plan must be validated before building |
79
+ | `validate_plan_on_change` | A plan must be validated before building (fires before the build, not on the write) |
77
80
 
78
81
  ### Quality & review gates
79
82
 
@@ -83,6 +86,11 @@ Each enforcer guards a specific station of the pipeline. The enforcers in
83
86
  | `schema_diff_gate` | Schema/pool changes must pass `uap schema-diff` |
84
87
  | `expert_review_required` | A parallel expert review must precede ship |
85
88
  | `architecture_review` | Merge / PR-ready operations need an architecture review when the diff warrants it |
89
+ | `quality_metrics_gate` | Edits must not introduce NEW or WORSENED metric debt (complexity, coverage, duplication, `any` types) against the ratchet baseline |
90
+ | `design_token_gate` | UI edits must stay on the project's DESIGN.md token system |
91
+ | `visual_verification` | Under MAX fidelity, a commit that changes UI files requires visual verification |
92
+ | `local_build_before_push` | Branches with C++ API source changes need a local Docker `--target builder` compile before `git push` / `gh pr create` / `gh pr merge` |
93
+ | `ship_loop_gate` | A task may only transition to `completed` with evidence it was merged, deployed, monitored, and verified |
86
94
 
87
95
  ### Hygiene & artifacts
88
96
 
@@ -97,7 +105,6 @@ Each enforcer guards a specific station of the pipeline. The enforcers in
97
105
  | Enforcer | What it gates |
98
106
  |----------|---------------|
99
107
  | `mcp_router_first` | MCP tools must be loaded on demand |
100
- | `rtk_wrap` | Heavy CLIs must be invoked via `rtk` |
101
108
  | `parallel_reads` | Nudge when serial read fan-out is detected |
102
109
 
103
110
  ### Infrastructure
@@ -105,8 +112,17 @@ Each enforcer guards a specific station of the pipeline. The enforcers in
105
112
  | Enforcer | What it gates |
106
113
  |----------|---------------|
107
114
  | `iac_parity` | Live-state changes must have a matching infrastructure-as-code diff |
115
+ | `iac_plan_destruction_check` | Destructive IaC plan operations are blocked |
108
116
  | `cluster_routing` | Cluster tooling context must match the component domain |
109
117
 
118
+ ### Enforcement protection
119
+
120
+ | Enforcer | What it gates |
121
+ |----------|---------------|
122
+ | `enforcement_self_protect` | The model must not be able to disable the enforcement layer |
123
+ | `enforcement_infra_protect` | The model must not kill or displace the inference stack (the Anthropic proxy, llama-server, their ports) |
124
+ | `bearer_lockdown` | ADR-0007 cookie-only frontend gate — blocks bearer-token auth in the frontend |
125
+
110
126
  > The `architecture_review` enforcer file is stored with a policy-ID prefix
111
127
  > (`<uuid>_architecture_review.py`) because it is attached to a specific
112
128
  > installed policy; the others are named directly after their policy slug.
@@ -0,0 +1,114 @@
1
+ # Qwen3.8-27B on exllamav3 (EXL3) — the production serving stack
2
+
3
+ > UAP v1.224.7 — added 2026-09-04, the day the box switched over.
4
+
5
+ Since 2026-09-04 the production local model is served by **exllamav3**
6
+ (MiaAI-Lab fork 1.4.2), not llama.cpp: **Qwen3.8-27B EXL3 3.5bpw** (14.2 GB,
7
+ workload-calibrated) with a **DFlash2 EXL3 5.0bpw** draft model (1.4 GB) for
8
+ speculative decoding. The recipe comes from yume_arasaki's RTX 4090 write-up
9
+ and the Mia-AiLab quant cards, adapted for this box's RTX 3090.
10
+
11
+ The llama.cpp stack (binary, `config/llama-profiles/`, `uap-llama-server`
12
+ unit) is untouched and remains the **rollback path** — see the bottom of this
13
+ doc.
14
+
15
+ ## Why switch
16
+
17
+ | | llama.cpp (UD-IQ4_XS GGUF) | exllamav3 (EXL3 3.5bpw) |
18
+ |---|---|---|
19
+ | decode, short ctx, warm | ~55 tok/s (measured essay probe) | **~82 tok/s** (same probe) |
20
+ | decode, deep into a long ctx | similar falloff | ~41–51 tok/s (KV grows) |
21
+ | context | 131072 per slot, `--parallel 1` | 131072 per request, batch-1 + queue |
22
+ | VRAM | ~21.9 GB resident | 20964 MiB resident |
23
+ | tool calling | jinja template + grammar | native OpenAI-style, verified |
24
+ | model id handling | `--alias` list, std::set-ordered | accepts any client-sent id |
25
+
26
+ ## The 3090 adaptation (read before copying the 4090 recipe)
27
+
28
+ The article's `CACHE_QUANT=nvfp4` (and `fp8`) **does not compile on this
29
+ box**: those Triton kernels need compute capability ≥ 8.9 (Ada/Hopper). The
30
+ RTX 3090 is Ampere, **sm_86 — compute capability is fixed in hardware**, no
31
+ driver or toolkit update changes it. The equivalent-density fallback is
32
+ `CACHE_QUANT=4` (Hadamard int4, same ~4.5 bits/element), which is what runs.
33
+
34
+ Second 3090 gotcha: the kit's default torch index (cu130) cannot compile the
35
+ engine's CUDA kernels against this box's nvcc 12.4 — `TORCH_INDEX_URL` is
36
+ pinned to `cu124` in the kit `.env`.
37
+
38
+ ## Layout
39
+
40
+ Everything lives outside the repo at `/home/cogtek/Qwen3.8-EXL3-kit/`:
41
+
42
+ ```
43
+ Qwen3.8-EXL3-kit/
44
+ ├── .env # the config (PORT, CONTEXT_SIZE, CACHE_QUANT, …)
45
+ ├── start.sh / stop.sh # launcher (bootstraps venv on first run)
46
+ ├── models/
47
+ │ ├── Qwen3.8-27B-EXL3-3.5bpw/ # target, 15 GB
48
+ │ └── Qwen3.8-27B-DFlash2-EXL3-5.0bpw/ # draft, 1.4 GB
49
+ ├── .venv/ # torch 2.6.0+cu124, exllamav3 fork 1.4.2, triton 3.3.1
50
+ └── tools/
51
+ ├── serve_openai.py # OpenAI-compatible server (+ local shim, below)
52
+ ├── healthcheck.py # start.sh's venv gate (local addition)
53
+ └── tokps.sh # live tok/s monitor: tools/tokps.sh [interval] [port]
54
+ ```
55
+
56
+ A reference copy of the `.env` is versioned at
57
+ [`config/exl3-profiles/qwen38-27b-exl3.env`](../../config/exl3-profiles/qwen38-27b-exl3.env).
58
+
59
+ ## Local patches in the kit (reapply if the kit is re-cloned)
60
+
61
+ 1. **`triton_paged.py` parenthesization** — the fork's jit kernel used chained
62
+ boolean operators (`A and not B and not C`) that current Triton rejects;
63
+ lines ~1698/1719 parenthesized to `A and (not B and not C)`.
64
+ 2. **`torch.compile` → identity shim** in `tools/serve_openai.py` — the fork's
65
+ Hadamard-4 KV path needs triton ≥ 3.3 (`ASTSource(constexprs=…)`), but
66
+ torch 2.6's inductor imports `AttrsDescriptor`, which triton 3.3 removed,
67
+ so fla's import-time `@torch.compile` decorators exploded the import chain.
68
+ Nothing on the serving hot path uses inductor (the speed comes from
69
+ hand-written Triton kernels), so the shim falls back to the undecorated
70
+ function. torch 2.7 was not an option: no cu124 wheels.
71
+ 3. **`tools/healthcheck.py`** — start.sh gates its bootstrap on a bare
72
+ `import torch, exllamav3, aiohttp, huggingface_hub`, which fails for the
73
+ reason in (2) and re-entered setup, downgrading triton back to 3.2 (torch's
74
+ pin) and breaking the engine again. The health check now applies the same
75
+ shim, so bootstrap runs only when the venv is genuinely incomplete.
76
+
77
+ Do **not** "fix" the triton version to match torch's pin: torch 2.6.0 asks
78
+ for triton 3.2.0, but the engine fork requires ≥ 3.3. The pair
79
+ (torch 2.6.0+cu124, triton 3.3.1, shim) is the working combination; pip will
80
+ keep printing a dependency-conflict warning about it — that warning is the
81
+ price of admission, not a problem.
82
+
83
+ ## Service management
84
+
85
+ ```bash
86
+ systemctl --user status uap-exl3-server # enabled, Restart=always
87
+ journalctl --user -u uap-exl3-server -f # live log
88
+ /home/cogtek/Qwen3.8-EXL3-kit/tools/tokps.sh # live tok/s
89
+ ```
90
+
91
+ Unit: `~/.config/systemd/user/uap-exl3-server.service` → kit `start.sh`.
92
+ The server binds `0.0.0.0:8080` (the port every client config already points
93
+ at) and reports `max_model_len=131072` at `/v1/models`.
94
+
95
+ **Proxy rails unchanged and still correct:** `PROXY_CONTEXT_WINDOW=131072`
96
+ (exllamav3's `--cache_size` is per-request, matching llama.cpp's per-slot
97
+ 131072 at `--parallel 1`) and `PROXY_CONCURRENCY_LIMIT=1` (the EXL3 server is
98
+ batch-1 and serializes concurrent callers internally — same shape as the
99
+ 1-slot llama.cpp config these rails were last tuned for). The server's
100
+ `/v1/models` id is `qwen3.8-27b-exl3-3.5bpw-wm`, but it accepts any
101
+ client-sent model id, so presets (`qwen3.8-27b`, etc.) flow through
102
+ unmodified.
103
+
104
+ ## Rollback
105
+
106
+ ```bash
107
+ systemctl --user stop uap-exl3-server
108
+ systemctl --user enable --now uap-llama-server # unit + env + binary untouched
109
+ ```
110
+
111
+ The llama.cpp env (`~/.config/uap/llama-server.env` →
112
+ `config/llama-profiles/qwen38-27b-dflash2.env`) and the ik/DFlash2 binary are
113
+ exactly as they were; the service was only `disable`d so it stops competing
114
+ for VRAM and port 8080 on boot.
@@ -1,6 +1,6 @@
1
1
  # Worktree Workflow
2
2
 
3
- > Applies to UAP v1.163
3
+ > Applies to UAP v1.224.0
4
4
 
5
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.
6
6
 
@@ -85,6 +85,50 @@ check; the advisory variant is for interactive orientation.
85
85
  The same `.worktrees/` containment is enforced at edit time by the
86
86
  `worktree-required` policy enforcer — see [POLICIES.md](./POLICIES.md).
87
87
 
88
+ ### Making enforcement optional
89
+
90
+ Worktree *enforcement* is a project choice, asked at setup time. In the guided
91
+ setup wizard (`uap setup`), the **Worktree isolation** toggle under
92
+ "Multi-agent coordination" drives it:
93
+
94
+ - **On (default)** — the pre-edit hooks hard-block edits outside
95
+ `.worktrees/`, the `worktree-required` policy enforcer stays active, and
96
+ generated CLAUDE.md files carry the MANDATORY worktree section.
97
+ - **Off** — setup writes `"worktrees": { "enabled": true, "enforce": false }`
98
+ to `.uap.json`, deactivates the `worktree-required` policy, and omits the
99
+ MANDATORY section from generated CLAUDE.md. Worktrees remain fully
100
+ *supported* (`uap worktree create/pr/finish` all work); edits in the project
101
+ root are simply no longer blocked.
102
+
103
+ You can flip it later by editing `.uap.json` — set both keys so every layer
104
+ agrees:
105
+
106
+ ```json
107
+ "worktrees": { "enabled": true, "enforce": false },
108
+ "template": { "sections": { "worktreeWorkflow": false } }
109
+ ```
110
+
111
+ and stand the policy enforcer down with:
112
+
113
+ ```bash
114
+ uap policy disable worktree-required
115
+ ```
116
+
117
+ The three enforcement layers read different signals: the pre-edit hooks and
118
+ `uap worktree ensure` honor the `.uap.json` flags at runtime (no reinstall
119
+ needed), while the `worktree-required` policy enforcer follows its active
120
+ state in the policy database. A missing or unreadable flag defaults to
121
+ `enforce: true` (the historical behavior). For a one-off bypass,
122
+ `UAP_NO_WORKTREE=1` wins over the file for the edit and commit/push guards
123
+ (the `git reset --hard` / `git clean -f` data-loss guard keys on the config
124
+ only).
125
+
126
+ **Integrity note:** the self-disable path relies on the
127
+ `enforcement-self-protect` policy (installed by `uap init`) — it hard-blocks
128
+ agent edits to `.uap.json` on both the Edit/Write and Bash channels, so an
129
+ agent cannot flip `enforce` itself. Projects that deploy the hook templates
130
+ *without* the seeded policy DB get no such protection on the Bash channel.
131
+
88
132
  ## Parallel-agent safety
89
133
 
90
134
  The numeric ID is allocated from the SQLite registry, not from a directory