@miller-tech/uap 1.133.2 → 1.134.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 (36) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/bin/cli.js +4 -1
  3. package/dist/bin/cli.js.map +1 -1
  4. package/dist/cli/config-command.d.ts +49 -0
  5. package/dist/cli/config-command.d.ts.map +1 -0
  6. package/dist/cli/config-command.js +465 -0
  7. package/dist/cli/config-command.js.map +1 -0
  8. package/dist/cli/config-wizard.d.ts +13 -0
  9. package/dist/cli/config-wizard.d.ts.map +1 -0
  10. package/dist/cli/config-wizard.js +134 -0
  11. package/dist/cli/config-wizard.js.map +1 -0
  12. package/dist/cli/guided-setup.d.ts.map +1 -1
  13. package/dist/cli/guided-setup.js +11 -0
  14. package/dist/cli/guided-setup.js.map +1 -1
  15. package/dist/cli/policy.d.ts.map +1 -1
  16. package/dist/cli/policy.js +34 -0
  17. package/dist/cli/policy.js.map +1 -1
  18. package/dist/cli/setup.d.ts +1 -1
  19. package/dist/cli/setup.d.ts.map +1 -1
  20. package/dist/cli/setup.js +22 -0
  21. package/dist/cli/setup.js.map +1 -1
  22. package/dist/config/policy-recommendations.d.ts +29 -0
  23. package/dist/config/policy-recommendations.d.ts.map +1 -0
  24. package/dist/config/policy-recommendations.js +108 -0
  25. package/dist/config/policy-recommendations.js.map +1 -0
  26. package/dist/config/settings-registry.d.ts +65 -0
  27. package/dist/config/settings-registry.d.ts.map +1 -0
  28. package/dist/config/settings-registry.js +334 -0
  29. package/dist/config/settings-registry.js.map +1 -0
  30. package/docs/INDEX.md +2 -0
  31. package/docs/guides/POLICY_SELECTION.md +98 -0
  32. package/docs/reference/CONFIGURATION_REFERENCE.md +688 -0
  33. package/package.json +1 -1
  34. package/src/policies/enforcers/__pycache__/_common.cpython-312.pyc +0 -0
  35. package/tools/agents/scripts/__pycache__/toolcall_path_normalizer.cpython-312.pyc +0 -0
  36. package/tools/agents/scripts/anthropic_proxy.py +137 -12
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-registry.d.ts","sourceRoot":"","sources":["../../src/config/settings-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,KAAK,CAAC;AACzC,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AACnE,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GACzB,UAAU,GACV,cAAc,GACd,SAAS,GACT,SAAS,GACT,QAAQ,GACR,aAAa,GACb,eAAe,GACf,eAAe,GACf,SAAS,GACT,QAAQ,GACR,UAAU,GACV,OAAO,GACP,WAAW,GACX,cAAc,GACd,SAAS,CAAC;AAEd,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,iBAAiB,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,iFAAiF;IACjF,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,WAAW,CAAC;IAClB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,6CAA6C;IAC7C,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,qFAAqF;IACrF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAC1C,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,cAAc,EAAE,MAAM,CAAC;IACvB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,kFAAkF;IAClF,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,UAAU,EAAE,SAAS,eAAe,EAgBhD,CAAC;AAIF,eAAO,MAAM,QAAQ,EAAE,SAAS,UAAU,EA+RzC,CAAC;AAMF,4CAA4C;AAC5C,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAE9D;AAED,qDAAqD;AACrD,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,iBAAiB,GAAG,UAAU,EAAE,CAEtE;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,EAAE,CAGxD;AAED,uCAAuC;AACvC,wBAAgB,QAAQ,CAAC,EAAE,EAAE,iBAAiB,GAAG,eAAe,GAAG,SAAS,CAE3E"}
@@ -0,0 +1,334 @@
1
+ /**
2
+ * UAP Settings Registry — the single source of truth for every user-facing
3
+ * setting UAP exposes.
4
+ *
5
+ * This one catalog powers three things so they can never drift:
6
+ * - `uap config` (list / get / set / explain / doctor)
7
+ * - the `uap setup --profile custom` expert wizard
8
+ * - the generated `docs/reference/CONFIGURATION_REFERENCE.md`
9
+ *
10
+ * Two kinds of setting:
11
+ * - kind 'json' — a field in `.uap.json` (persistent, first-class). `path` is
12
+ * the dotted location; `uap config set` writes it via modifyUapConfig.
13
+ * - kind 'env' — an environment variable. `target: 'proxyEnv'` persists to
14
+ * `.uap/proxy.env` (loaded by the inference proxy); `target: 'shell'` is a
15
+ * runtime toggle read from the process env by hooks/CLI, so `set` prints the
16
+ * export line to add rather than pretending to persist it.
17
+ *
18
+ * Adding a setting here automatically surfaces it in the CLI, the wizard, and
19
+ * the docs. Keep descriptions plain-language (what it does) and recommendations
20
+ * actionable (what to pick and when).
21
+ */
22
+ export const CATEGORIES = [
23
+ { id: 'delivery', title: 'Delivery & enforcement', blurb: 'Whether coding routes through `uap deliver` and how hard the gates block.' },
24
+ { id: 'verification', title: 'Verification gates', blurb: 'Proving generated code actually builds and runs before "done".' },
25
+ { id: 'routing', title: 'Model routing', blurb: 'Which model handles planning, execution, and review.' },
26
+ { id: 'recipes', title: 'Serving recipes & escalation', blurb: 'Confidence/fusion recipes and the judge model that grades a local model.' },
27
+ { id: 'memory', title: 'Memory', blurb: 'Short-term recall, long-term semantic memory, and pattern RAG.' },
28
+ { id: 'concurrency', title: 'Concurrency & model slots', blurb: 'How many agents/inference slots run in parallel before backpressure.' },
29
+ { id: 'collaboration', title: 'Multi-agent collaboration', blurb: 'The shared coordination board and file-overlap protection.' },
30
+ { id: 'orchestration', title: 'Orchestrator & hands-free', blurb: 'Long-task autonomy: decompose, resume, and loop-to-100%.' },
31
+ { id: 'reactor', title: 'Reactor (auto-apply)', blurb: 'Per-prompt injection of the matching experts, skills, and patterns.' },
32
+ { id: 'design', title: 'Design system', blurb: 'DESIGN.md interrogation and the hard token gate for UI work.' },
33
+ { id: 'worktree', title: 'Worktree workflow', blurb: 'Branch-per-feature isolation and auto-cleanup.' },
34
+ { id: 'proxy', title: 'Inference proxy tuning', blurb: 'Guardrails and context limits for a local model behind the proxy.' },
35
+ { id: 'dashboard', title: 'Dashboard', blurb: 'The live analytics server and its mutation token.' },
36
+ { id: 'optimization', title: 'Token & time optimization', blurb: 'Context budgets, caching, batching, and parallelism.' },
37
+ { id: 'general', title: 'General', blurb: 'Project metadata and CLI behavior.' },
38
+ ];
39
+ // A tuned local model with real gates is the reference environment for the
40
+ // recommendations below; cloud-model users can relax the guardrail-heavy knobs.
41
+ export const SETTINGS = [
42
+ // ── Delivery & enforcement ────────────────────────────────────────────────
43
+ {
44
+ key: 'delivery.enforcement', kind: 'json', type: 'enum', enumValues: ['block', 'advisory', 'off'],
45
+ default: 'block', category: 'delivery',
46
+ description: 'How the delivery gate treats a direct source edit outside `uap deliver`. `block` refuses it (exit 2), `advisory` warns but allows, `off` disables the gate. (The `UAP_ENFORCE_DELIVERY` env var overrides this at runtime.)',
47
+ recommendation: '`block` for hands-free/local-model work so every change is gated and verified; `advisory` when a capable human/Opus is driving and you want warnings without friction.',
48
+ },
49
+ {
50
+ key: 'delivery.localMode', kind: 'json', type: 'enum', enumValues: ['advisory', 'deliver', 'block'],
51
+ default: 'advisory', category: 'delivery',
52
+ description: 'How local-model sessions are routed through delivery. `deliver` runs builds through the convergence loop; `block` forbids raw edits; `advisory` warns.',
53
+ recommendation: '`deliver` when a local model does the writing (routes it through the verified loop); `advisory` for exploratory work.',
54
+ },
55
+ {
56
+ key: 'UAP_ENFORCE_DELIVERY', kind: 'env', type: 'enum', enumValues: ['block', 'advisory', 'off'],
57
+ default: 'block', category: 'delivery', target: 'shell',
58
+ description: 'Runtime override of the delivery gate read by the hooks/enforcers from the shell env. Takes precedence over `delivery.enforcement`.',
59
+ recommendation: 'Leave UNSET so it defaults to `block`. Exporting `advisory` globally leaks into every shell and silently disables the gate + the delivery-enforcement tests — set it inline per-command if you must.',
60
+ },
61
+ {
62
+ key: 'UAP_DELIVER_BYPASS', kind: 'env', type: 'boolean', default: false, category: 'delivery', target: 'shell',
63
+ description: 'When set to 1 for a single command, exempts that one sanctioned manual edit from the delivery gate.',
64
+ recommendation: 'Use inline (`UAP_DELIVER_BYPASS=1 <cmd>`) for a one-off edit; never export it.',
65
+ },
66
+ // ── Verification gates ────────────────────────────────────────────────────
67
+ {
68
+ key: 'delivery.runtimeVerify', kind: 'json', type: 'boolean', default: false, category: 'verification',
69
+ description: 'Installs the runtime-verify Stop-hook: at end of turn it actually runs the changed code (headless / vm-dom / child-process) and blocks stopping on a genuine runtime failure.',
70
+ recommendation: 'Enable for any project with a runnable artifact — it catches "declared done but never ran". Safe on empty projects (it skips when nothing is runnable).',
71
+ },
72
+ {
73
+ key: 'UAP_VERIFY_ON_STOP', kind: 'env', type: 'boolean', default: true, category: 'verification', target: 'shell',
74
+ description: 'Master switch for the runtime execution gate in the Stop hook. `0` bypasses it.',
75
+ recommendation: 'Leave on (default). Set `0` only to unblock a session where the runtime gate misfires.',
76
+ },
77
+ // ── Model routing ─────────────────────────────────────────────────────────
78
+ {
79
+ key: 'multiModel.enabled', kind: 'json', type: 'boolean', default: false, category: 'routing',
80
+ description: 'Turns on multi-model routing (distinct planner/executor/reviewer models) instead of a single model for everything.',
81
+ recommendation: 'Enable to pair a cheap local executor with a strong cloud reviewer. Configure via `uap model routing use <preset>`.',
82
+ },
83
+ {
84
+ key: 'multiModel.routingStrategy', kind: 'json', type: 'enum',
85
+ enumValues: ['cost-optimized', 'performance-first', 'balanced', 'adaptive'],
86
+ default: 'balanced', category: 'routing',
87
+ description: 'How the router trades cost against capability when picking a model per task.',
88
+ recommendation: '`cost-optimized` for local-first setups, `performance-first` for all-cloud hot paths, `balanced`/`adaptive` otherwise.',
89
+ },
90
+ {
91
+ key: 'ANTHROPIC_PASSTHROUGH_MODELS', kind: 'env', type: 'string', default: '', category: 'routing', target: 'proxyEnv',
92
+ description: 'Comma-separated model IDs the proxy forwards to Anthropic instead of serving locally. The sentinel `__local_only__` forces every model ID onto the local Qwen.',
93
+ recommendation: 'Set automatically by `uap model routing use`. Use `__local_only__` for a fully offline setup; list cloud IDs for a hybrid local+cloud routing preset.',
94
+ },
95
+ // ── Serving recipes & escalation ──────────────────────────────────────────
96
+ {
97
+ key: 'recipes.enabled', kind: 'json', type: 'boolean', default: false, category: 'recipes',
98
+ description: 'Enables serving-layer recipes (confidence escalation, fusion, ratings) in front of the local model.',
99
+ recommendation: 'Enable for a local model when you have a stronger judge model available — it materially lifts output quality.',
100
+ },
101
+ {
102
+ key: 'recipes.recipe', kind: 'json', type: 'enum',
103
+ enumValues: ['auto', 'single', 'confidence', 'fusion', 'ratings', 'remom'],
104
+ default: 'auto', category: 'recipes',
105
+ description: 'Which recipe to apply. `confidence` escalates only low-confidence turns to the judge; `fusion` samples N and judges; `auto` picks per-signal.',
106
+ recommendation: '`auto` is the safe default; `confidence` for the best cost/quality trade when the judge is expensive.',
107
+ },
108
+ {
109
+ key: 'recipes.confidenceThreshold', kind: 'json', type: 'number', min: 0, max: 1, default: 0.5, category: 'recipes',
110
+ description: 'Below this confidence, a turn is escalated to the judge model.',
111
+ recommendation: '0.5 to start; raise toward 0.7 to escalate more often (higher quality, higher cost).',
112
+ },
113
+ {
114
+ key: 'recipes.fusionN', kind: 'json', type: 'number', int: true, min: 2, max: 6, default: 3, category: 'recipes',
115
+ description: 'How many candidate samples the fusion recipe generates before the judge picks/merges.',
116
+ recommendation: '3 balances quality and cost; 5 for hard tasks if you can afford the samples.',
117
+ },
118
+ {
119
+ key: 'recipes.allowSelfJudge', kind: 'json', type: 'boolean', default: false, category: 'recipes',
120
+ description: 'Allows the generating model to also act as its own judge (generator == evaluator).',
121
+ recommendation: 'Keep `false` — a distinct, stronger judge is what adds the lift. Only allow self-judge if no separate judge is available.',
122
+ },
123
+ {
124
+ key: 'recipes.judge.model', kind: 'json', type: 'string', default: null, category: 'recipes',
125
+ description: 'The model ID used to grade/escalate. Must be distinct from and stronger than the executor to help.',
126
+ recommendation: 'Point at your strongest available model (e.g. an Opus/Sonnet cloud ID) even if the executor is local.',
127
+ },
128
+ {
129
+ key: 'PROXY_ESCALATE_API_KEY', kind: 'env', type: 'string', default: null, category: 'recipes', target: 'proxyEnv', secret: true,
130
+ description: 'API key for the judge/escalation model endpoint.',
131
+ recommendation: 'Store only in `.uap/proxy.env` (chmod 600) — never in `.uap.json`. `uap config set` writes it there.',
132
+ },
133
+ // ── Memory ────────────────────────────────────────────────────────────────
134
+ {
135
+ key: 'memory.longTerm.enabled', kind: 'json', type: 'boolean', default: true, category: 'memory',
136
+ description: 'Enables long-term semantic memory (vector recall across sessions) via Qdrant.',
137
+ recommendation: 'Keep on — cross-session recall is a core value. Requires a running Qdrant (`uap memory start`).',
138
+ },
139
+ {
140
+ key: 'memory.longTerm.provider', kind: 'json', type: 'enum',
141
+ enumValues: ['qdrant', 'chroma', 'pinecone', 'github', 'qdrant-cloud', 'serverless', 'none'],
142
+ default: 'qdrant', category: 'memory',
143
+ description: 'The long-term memory backend.',
144
+ recommendation: '`qdrant` (local) for privacy/speed; `qdrant-cloud` or `github` if you want memory to follow you across machines.',
145
+ },
146
+ {
147
+ key: 'memory.shortTerm.maxEntries', kind: 'json', type: 'number', default: 50, category: 'memory',
148
+ description: 'How many recent short-term entries are retained/injected per session.',
149
+ recommendation: '50 is a good default; raise for long, context-heavy sessions if token budget allows.',
150
+ },
151
+ {
152
+ key: 'memory.patternRag.enabled', kind: 'json', type: 'boolean', default: false, category: 'memory',
153
+ description: 'Enables pattern RAG — semantic retrieval of the 23 execution patterns to steer the agent.',
154
+ recommendation: 'Enable for local models (patterns compensate for weaker planning); optional for frontier models.',
155
+ },
156
+ {
157
+ key: 'QDRANT_URL', kind: 'env', type: 'string', default: 'http://localhost:6333', category: 'memory', target: 'shell',
158
+ description: 'Qdrant endpoint for long-term/pattern memory.',
159
+ recommendation: 'Leave default for local Qdrant; point at your cloud cluster URL for `qdrant-cloud`.',
160
+ },
161
+ {
162
+ key: 'QDRANT_API_KEY', kind: 'env', type: 'string', default: null, category: 'memory', target: 'shell', secret: true,
163
+ description: 'API key for a cloud Qdrant cluster.',
164
+ recommendation: 'Only needed for `qdrant-cloud`. Keep it in your shell env / secret store, not in `.uap.json`.',
165
+ },
166
+ // ── Concurrency & model slots ─────────────────────────────────────────────
167
+ {
168
+ key: 'modelConcurrency.slots', kind: 'json', type: 'number', int: true, min: 1, default: null, category: 'concurrency',
169
+ description: 'How many inference slots the local server exposes; the lease system caps parallel agents to this.',
170
+ recommendation: 'Set to your llama.cpp `--parallel` value so fan-out never exhausts the server. Leave null to auto-probe.',
171
+ },
172
+ {
173
+ key: 'modelConcurrency.headroom', kind: 'json', type: 'number', int: true, min: 0, default: null, category: 'concurrency',
174
+ description: 'Slots to hold back from the budget so the interactive session never starves behind background agents.',
175
+ recommendation: 'Reserve 1 on small servers so foreground work stays responsive.',
176
+ },
177
+ {
178
+ key: 'modelConcurrency.adaptive', kind: 'json', type: 'boolean', default: true, category: 'concurrency',
179
+ description: 'AIMD backpressure: shrinks the effective slot budget on exhaustion signals (429/timeouts) and recovers over time.',
180
+ recommendation: 'Keep on — it prevents overload cascades when many agents run at once.',
181
+ },
182
+ {
183
+ key: 'UAP_MAX_PARALLEL', kind: 'env', type: 'number', default: 4, category: 'concurrency', target: 'shell',
184
+ description: 'Upper bound on parallel agent/tool fan-out regardless of slot budget.',
185
+ recommendation: 'Match to CPU/GPU capacity; 4 is a safe default, lower it on constrained hosts.',
186
+ },
187
+ // ── Multi-agent collaboration ─────────────────────────────────────────────
188
+ {
189
+ key: 'collaboration.mode', kind: 'json', type: 'enum', enumValues: ['auto', 'always', 'off'],
190
+ default: 'auto', category: 'collaboration',
191
+ description: 'The shared coordination board + live file-overlap protection. `always` injects the board every turn; `auto` only when peers are active; `off` disables it.',
192
+ recommendation: '`auto` for solo work, `always` when multiple agents/worktrees run concurrently so they compound instead of colliding.',
193
+ },
194
+ {
195
+ key: 'coordination.deployBatching', kind: 'json', type: 'boolean', default: true, category: 'collaboration',
196
+ description: 'Batches git/deploy actions across agents to avoid conflicting concurrent pushes.',
197
+ recommendation: 'Keep on for multi-agent setups.',
198
+ },
199
+ // ── Orchestrator & hands-free ─────────────────────────────────────────────
200
+ {
201
+ key: 'handsfree.enabled', kind: 'json', type: 'boolean', default: false, category: 'orchestration',
202
+ description: 'Forces any model to keep working until a multi-epic completion ledger is 100% done, instead of stopping early.',
203
+ recommendation: 'Enable for large autonomous builds; leave off for interactive/exploratory sessions.',
204
+ },
205
+ {
206
+ key: 'handsfree.intensity', kind: 'json', type: 'enum', enumValues: ['gentle', 'normal', 'aggressive'],
207
+ default: 'normal', category: 'orchestration',
208
+ description: 'How hard hands-free pushes back against early stops before the ledger is complete.',
209
+ recommendation: '`normal` for most work; `aggressive` for unattended overnight runs; `gentle` if the model over-persists on dead ends.',
210
+ },
211
+ {
212
+ key: 'UAP_HANDSFREE_STAGNATION_LIMIT', kind: 'env', type: 'number', default: 8, category: 'orchestration', target: 'shell',
213
+ description: 'Consecutive no-progress turns before hands-free breaks the loop instead of pushing on.',
214
+ recommendation: 'Lower (e.g. 5) if runs waste turns stuck; raise for genuinely long-horizon tasks.',
215
+ },
216
+ // ── Reactor ───────────────────────────────────────────────────────────────
217
+ {
218
+ key: 'reactor.enabled', kind: 'json', type: 'boolean', default: true, category: 'reactor',
219
+ description: 'Per-prompt injection of the experts, skills, and patterns that match what you just asked — so relevant capability is on the bench before the agent starts.',
220
+ recommendation: 'Keep on. Disable only to debug prompt bloat or measure the reactor\'s own contribution.',
221
+ },
222
+ // ── Design system ─────────────────────────────────────────────────────────
223
+ {
224
+ key: 'design.enabled', kind: 'json', type: 'boolean', default: false, category: 'design',
225
+ description: 'Turns on DESIGN.md: the agent interrogates and lints UI work against your design brief.',
226
+ recommendation: 'Enable for any project with a UI so design work starts from intent, not a guess.',
227
+ },
228
+ {
229
+ key: 'design.tokenGate', kind: 'json', type: 'boolean', default: false, category: 'design',
230
+ description: 'Hard-blocks UI edits that hardcode off-token colors or off-scale spacing.',
231
+ recommendation: 'Enable once your DESIGN.md tokens are stable — it keeps the UI on-system automatically.',
232
+ },
233
+ // ── Worktree workflow ─────────────────────────────────────────────────────
234
+ {
235
+ key: 'worktrees.enabled', kind: 'json', type: 'boolean', default: true, category: 'worktree',
236
+ description: 'Branch-per-feature isolation: edits happen in `.worktrees/NNN-slug/`, never the working tree, with auto-PR.',
237
+ recommendation: 'Keep on for any team or multi-agent workflow; it is the safety net against clobbering `main`.',
238
+ },
239
+ {
240
+ key: 'worktrees.branchPrefix', kind: 'json', type: 'string', default: 'feature/', category: 'worktree',
241
+ description: 'Prefix for auto-created worktree branches.',
242
+ recommendation: 'Match your team\'s branch convention (e.g. `feat/`, `fix/`).',
243
+ },
244
+ {
245
+ key: 'worktrees.autoCleanup', kind: 'json', type: 'boolean', default: true, category: 'worktree',
246
+ description: 'Removes a worktree automatically once its branch is merged/unchanged.',
247
+ recommendation: 'Keep on to avoid a pile of stale worktrees.',
248
+ },
249
+ // ── Inference proxy tuning (curated high-impact subset) ────────────────────
250
+ {
251
+ key: 'PROXY_CONTEXT_WINDOW', kind: 'env', type: 'number', default: 65536, category: 'proxy', target: 'proxyEnv',
252
+ description: 'The context window the proxy advertises/enforces for the local model. Must match the server\'s KV allocation.',
253
+ recommendation: 'Set to your llama.cpp per-slot context size. Too high overflows KV; too low truncates history.',
254
+ },
255
+ {
256
+ key: 'PROXY_CONCURRENCY_LIMIT', kind: 'env', type: 'number', default: null, category: 'proxy', target: 'proxyEnv',
257
+ description: 'Max concurrent upstream generations the proxy admits before queuing.',
258
+ recommendation: 'Match to the server\'s parallel slots so the proxy queues instead of overloading the model.',
259
+ },
260
+ {
261
+ key: 'PROXY_LOOP_BREAKER', kind: 'env', type: 'boolean', default: true, category: 'proxy', target: 'proxyEnv',
262
+ description: 'Breaks no-progress generation loops by forcing a single non-streaming call.',
263
+ recommendation: 'Keep on for local models — it is a core reliability guardrail.',
264
+ },
265
+ {
266
+ key: 'PROXY_STUCK_BREAK', kind: 'env', type: 'boolean', default: true, category: 'proxy', target: 'proxyEnv',
267
+ description: 'When the model self-reports "stuck" but keeps repeating the same failing tool, releases it to a prose exit.',
268
+ recommendation: 'Keep on for local models; harmless for cloud models (rarely triggers).',
269
+ },
270
+ {
271
+ key: 'PROXY_RECON_CONVERGENCE_THRESHOLD', kind: 'env', type: 'number', default: 40, category: 'proxy', target: 'proxyEnv',
272
+ description: 'After this many read-only (no-write) turns, the proxy forces synthesis/`deliver` so the model stops exploring forever.',
273
+ recommendation: '40 is balanced; lower it (e.g. 20) if local sessions over-explore before writing.',
274
+ },
275
+ {
276
+ key: 'PROXY_RECIPE', kind: 'env', type: 'enum', enumValues: ['auto', 'single', 'confidence', 'fusion', 'ratings', 'remom'],
277
+ default: 'auto', category: 'proxy', target: 'proxyEnv',
278
+ description: 'The serving recipe the proxy applies (mirror of `recipes.recipe`, consumed by the proxy process).',
279
+ recommendation: 'Keep in sync with `recipes.recipe`; `uap setup`/`uap config` write both.',
280
+ },
281
+ // ── Dashboard ─────────────────────────────────────────────────────────────
282
+ {
283
+ key: 'UAP_DASHBOARD_TOKEN', kind: 'env', type: 'string', default: null, category: 'dashboard', target: 'shell', secret: true,
284
+ description: 'The token required for dashboard policy-mutation routes (enable/disable/stage/level). Read routes stay open.',
285
+ recommendation: 'Set a strong token if the dashboard binds beyond localhost (`--host 0.0.0.0`); otherwise a generated per-session token is used.',
286
+ },
287
+ {
288
+ key: 'UAP_DASH_REFRESH_MS', kind: 'env', type: 'number', default: 2000, category: 'dashboard', target: 'shell',
289
+ description: 'Dashboard data refresh interval in milliseconds (floor 250).',
290
+ recommendation: '2000 is fine; lower for a more live feel at higher CPU cost.',
291
+ },
292
+ // ── Token & time optimization ─────────────────────────────────────────────
293
+ {
294
+ key: 'costOptimization.enabled', kind: 'json', type: 'boolean', default: true, category: 'optimization',
295
+ description: 'Enables token budgets, response caching, and embedding batching to cut token spend.',
296
+ recommendation: 'Keep on — it is free savings with no quality cost.',
297
+ },
298
+ {
299
+ key: 'timeOptimization.parallelExecution.maxParallelDroids', kind: 'json', type: 'number', default: 4, category: 'optimization',
300
+ description: 'Max expert droids run in parallel during a task.',
301
+ recommendation: 'Match to host capacity; 4 is a safe default.',
302
+ },
303
+ // ── General ───────────────────────────────────────────────────────────────
304
+ {
305
+ key: 'project.defaultBranch', kind: 'json', type: 'string', default: 'main', category: 'general',
306
+ description: 'The branch PRs target and worktrees branch from.',
307
+ recommendation: 'Set to your repo\'s default branch (`main` or `master`).',
308
+ },
309
+ {
310
+ key: 'UAP_NO_SELF_UPDATE', kind: 'env', type: 'boolean', default: false, category: 'general', target: 'shell',
311
+ description: 'Disables the automatic global-CLI version check/self-update on `uap setup`.',
312
+ recommendation: 'Set in CI or pinned environments where you manage the UAP version yourself.',
313
+ },
314
+ ];
315
+ // ── Lookup helpers ──────────────────────────────────────────────────────────
316
+ const BY_KEY = new Map(SETTINGS.map((s) => [s.key.toLowerCase(), s]));
317
+ /** Case-insensitive exact lookup by key. */
318
+ export function getSetting(key) {
319
+ return BY_KEY.get(key.toLowerCase());
320
+ }
321
+ /** All settings in a category, in registry order. */
322
+ export function settingsByCategory(id) {
323
+ return SETTINGS.filter((s) => s.category === id);
324
+ }
325
+ /** Fuzzy match for `config get/set/explain` when the key isn't exact. */
326
+ export function findSettings(query) {
327
+ const q = query.toLowerCase();
328
+ return SETTINGS.filter((s) => s.key.toLowerCase().includes(q));
329
+ }
330
+ /** The category metadata for an id. */
331
+ export function category(id) {
332
+ return CATEGORIES.find((c) => c.id === id);
333
+ }
334
+ //# sourceMappingURL=settings-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-registry.js","sourceRoot":"","sources":["../../src/config/settings-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAsDH,MAAM,CAAC,MAAM,UAAU,GAA+B;IACpD,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,wBAAwB,EAAE,KAAK,EAAE,2EAA2E,EAAE;IACvI,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,gEAAgE,EAAE;IAC5H,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,sDAAsD,EAAE;IACxG,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,8BAA8B,EAAE,KAAK,EAAE,0EAA0E,EAAE;IAC3I,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,gEAAgE,EAAE;IAC1G,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,2BAA2B,EAAE,KAAK,EAAE,sEAAsE,EAAE;IACxI,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,2BAA2B,EAAE,KAAK,EAAE,4DAA4D,EAAE;IAChI,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,2BAA2B,EAA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AAC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,QAAQ,CAAC,EAAqB;IAC5C,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAC7C,CAAC"}
package/docs/INDEX.md CHANGED
@@ -53,6 +53,7 @@ Full map: **[The UAP Delivery Pipeline](guides/DELIVERY_PIPELINE.md)**.
53
53
  | [Worktree Workflow](guides/WORKTREE_WORKFLOW.md) | Branch-per-feature isolation, auto-PR, enforcement |
54
54
  | [Sandbox](guides/SANDBOX.md) | Kernel-level (bubblewrap) write isolation — the boundary that survives `--dangerously-skip-permissions` |
55
55
  | [Policies](guides/POLICIES.md) | Executable policy gates that block non-compliant tool calls |
56
+ | [**Policy Selection & Recommendations**](guides/POLICY_SELECTION.md) | Which policies to enable for your workflow — a recommended core + tailored sets by scenario; `uap policy recommend` ⭐ |
56
57
  | [Multi-Model Routing](guides/MULTI_MODEL.md) | Plan → route → execute across 7 model profiles |
57
58
  | [Droids & Skills](guides/DROIDS_AND_SKILLS.md) | 38 expert droids, 32 skills, the expert router |
58
59
  | [Deploy Batching](guides/DEPLOY_BATCHING.md) | Conflict-free batched git/deploy actions |
@@ -79,6 +80,7 @@ Full map: **[The UAP Delivery Pipeline](guides/DELIVERY_PIPELINE.md)**.
79
80
  | [Patterns](reference/PATTERNS.md) | The 23 Terminal-Bench patterns |
80
81
  | [Platforms](reference/PLATFORMS.md) | The 9 supported harnesses + support matrix |
81
82
  | [Configuration](reference/CONFIGURATION.md) | All config files and env vars |
83
+ | [**Configuration Reference**](reference/CONFIGURATION_REFERENCE.md) | Every setting `uap config` exposes — what it does, default, and a recommendation (generated from the registry); `uap config list/explain/set/doctor/wizard` ⭐ |
82
84
  | [Database Schema](reference/DATABASE_SCHEMA.md) | SQLite databases + Qdrant collections |
83
85
 
84
86
  ## Integrations
@@ -0,0 +1,98 @@
1
+ # Policy Selection & Recommendations
2
+
3
+ UAP ships ~33 executable policies (the [enforcer catalog](POLICIES.md)). You don't want all of them on for every project — you want the set that fits *your* workflow. This guide gives you a recommended core plus tailored add-ons by scenario, and the commands to apply them.
4
+
5
+ > **Live version of this guide:** `uap policy recommend` (all scenarios) or `uap policy recommend <scenario>` (a tailored set with an install command). The recommendations here and in the CLI come from the same source (`src/config/policy-recommendations.ts`).
6
+
7
+ ## How policies work (the 20-second version)
8
+
9
+ A policy is enforced by a hook → the enforcer inspects the tool call → it **allows (exit 0)** or **blocks (exit 2)**. Only `REQUIRED`-level policies hard-block; `RECOMMENDED`/`OPTIONAL` are advisory. Each enforcer also has an env kill-switch (e.g. `UAP_NO_WORKTREE`, `UAP_DELIVER_BYPASS`) so a human can override a single call — they're **cooperative guardrails**, not a sandbox. For a true write boundary, pair them with the [sandbox](SANDBOX.md). Full mechanics: [Policies](POLICIES.md).
10
+
11
+ ## Apply them
12
+
13
+ ```bash
14
+ uap policy recommend # list the core set + all scenarios
15
+ uap policy recommend team # tailored set for a scenario + an install command
16
+ uap policy install <slug> # install one policy (attaches its enforcer)
17
+ uap policy matrix # see everything installed + how to adjust it
18
+ uap config wizard # interactive: pick a scenario, install in one step
19
+ uap setup --profile custom # baseline setup, then the wizard (config + policies)
20
+ ```
21
+
22
+ ## The core set — recommended for every project
23
+
24
+ The safety floor. `uap setup` installs the delivery-enforcement + self-protect pieces automatically; the rest are one `uap policy install` away.
25
+
26
+ | Policy | Why |
27
+ |---|---|
28
+ | `worktree-required` | Edits land in an isolated worktree, never the working tree. |
29
+ | `delivery-enforcement` | Source changes route through the verified `deliver` loop. |
30
+ | `enforcement-self-protect` | Agents cannot disable the gates that constrain them. |
31
+ | `task-required` | Work is tied to a tracked task, not ad-hoc. |
32
+ | `test-gate` | Changed code must pass tests before "done". |
33
+ | `memory-before-plan` | The agent recalls prior decisions before re-deriving them. |
34
+ | `workdir-scope` | Writes are contained to the project directory. |
35
+
36
+ ## Scenarios — add these on top of the core
37
+
38
+ Pick the row that matches how you work. Each adds to the core set above.
39
+
40
+ ### Solo dev, local model
41
+ *One person driving a local (llama.cpp/Qwen) model that needs strong guardrails.*
42
+
43
+ `codebase-read-before-plan` · `validate-plan-before-build` · `mcp-router-first` · `local-build-before-push` · `ship-loop-gate` · `doc-live-over-report`
44
+
45
+ Weaker models benefit most from "read before you plan", a lean context window, and converging to green before shipping.
46
+
47
+ ### Team / multi-agent
48
+ *Multiple people or agents working the same repo concurrently.*
49
+
50
+ `coord-overlap` · `expert-review-required` · `schema-diff-gate` · `session-memory-write` · `artifact-hygiene`
51
+
52
+ The point is to stop agents colliding, surface contract changes for review, and capture learnings so peers compound them.
53
+
54
+ ### CI-gated delivery
55
+ *Changes must survive a CI pipeline and controlled deploys.*
56
+
57
+ `local-build-before-push` · `ship-loop-gate` · `merge-deploy-monitor-verify` · `schema-diff-gate`
58
+
59
+ Fail fast locally, re-converge on red CI, and treat deploys as monitored + verified rather than fire-and-forget.
60
+
61
+ ### High autonomy / hands-free
62
+ *Long unattended builds where the model must not cut corners.*
63
+
64
+ `validate-plan-before-build` · `ship-loop-gate` · `artifact-hygiene` · `doc-live-over-report` · `codebase-read-before-plan`
65
+
66
+ A wrong plan wastes an entire autonomous run — validate up front, grade the real system (not the model's optimism), and only end when the work is genuinely done.
67
+
68
+ ### Security-sensitive
69
+ *Handling secrets, infrastructure, or regulated code.*
70
+
71
+ `bearer-lockdown` · `schema-diff-gate` · `iac-parity` · `iac-plan-destruction-check`
72
+
73
+ Block credential leaks, forbid silent permission/API-surface changes, and flag destructive infra plans before apply.
74
+
75
+ ### UI / design work
76
+ *Projects with a front-end and a design system.*
77
+
78
+ `design-token-gate` · `visual-verification`
79
+
80
+ Keep UI edits on your design tokens/spacing and verify changes visually, not just by tests. Pair with [DESIGN.md](../design/UAP_REACTOR.md) and `uap config set design.enabled true`.
81
+
82
+ ## Tuning the level of any policy
83
+
84
+ A policy's *level* decides whether it hard-blocks or just warns:
85
+
86
+ ```bash
87
+ uap policy level <id> RECOMMENDED # downgrade a REQUIRED gate to advisory
88
+ uap policy level <id> REQUIRED # promote an advisory to a hard block
89
+ uap policy disable <id> # turn it off entirely
90
+ ```
91
+
92
+ Start stricter than you think you need — it's easier to relax a gate that's too noisy than to notice a class of mistakes a missing gate let through. Run `uap config doctor` to catch settings that quietly weaken the whole set (e.g. a leaked `UAP_ENFORCE_DELIVERY=advisory`).
93
+
94
+ ## See also
95
+
96
+ - [Policies](POLICIES.md) — the full enforcer catalog + CLI reference
97
+ - [Configuration Reference](../reference/CONFIGURATION_REFERENCE.md) — every setting `uap config` exposes
98
+ - [Sandbox](SANDBOX.md) — the kernel-level write boundary that backs the cooperative gates