@miller-tech/uap 1.40.0 → 1.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -642
- package/dist/.tsbuildinfo +1 -1
- package/dist/cli/deliver-defaults.d.ts +23 -0
- package/dist/cli/deliver-defaults.d.ts.map +1 -0
- package/dist/cli/deliver-defaults.js +121 -0
- package/dist/cli/deliver-defaults.js.map +1 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +29 -0
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +19 -0
- package/dist/cli/setup.js.map +1 -1
- package/dist/policies/policy-tools.d.ts +7 -0
- package/dist/policies/policy-tools.d.ts.map +1 -1
- package/dist/policies/policy-tools.js +24 -2
- package/dist/policies/policy-tools.js.map +1 -1
- package/docs/INDEX.md +48 -286
- package/docs/architecture/OVERVIEW.md +328 -0
- package/docs/architecture/PROTOCOL.md +204 -0
- package/docs/benchmarks/README.md +17 -192
- package/docs/getting-started/CONFIGURATION.md +237 -0
- package/docs/getting-started/INSTALLATION.md +125 -0
- package/docs/getting-started/QUICKSTART.md +115 -0
- package/docs/guides/COORDINATION.md +162 -0
- package/docs/guides/DELIVER.md +115 -0
- package/docs/guides/DEPLOY_BATCHING.md +212 -0
- package/docs/guides/DROIDS_AND_SKILLS.md +202 -0
- package/docs/guides/LOCAL_MODELS.md +148 -0
- package/docs/guides/MCP_ROUTER.md +195 -0
- package/docs/guides/MEMORY.md +235 -0
- package/docs/guides/MULTI_MODEL.md +223 -0
- package/docs/guides/POLICIES.md +190 -0
- package/docs/guides/WORKTREE_WORKFLOW.md +185 -0
- package/docs/integrations/MCP_ROUTER.md +147 -0
- package/docs/integrations/RTK.md +102 -0
- package/docs/reference/API.md +485 -0
- package/docs/reference/CLI.md +719 -0
- package/docs/reference/CONFIGURATION.md +90 -193
- package/docs/reference/DATABASE_SCHEMA.md +110 -344
- package/docs/reference/FEATURES.md +176 -472
- package/docs/reference/PATTERNS.md +102 -0
- package/docs/reference/PLATFORMS.md +83 -0
- package/package.json +3 -1
- package/src/policies/enforcers/7ebbc721-7540-4e9f-879a-770e0213a09b_architecture_review.py +101 -0
- package/src/policies/enforcers/__pycache__/_common.cpython-312.pyc +0 -0
- package/src/policies/enforcers/_common.py +100 -0
- package/src/policies/enforcers/artifact_hygiene.py +52 -0
- package/src/policies/enforcers/cluster_routing.py +63 -0
- package/src/policies/enforcers/codebase_read_before_plan.py +52 -0
- package/src/policies/enforcers/coord_overlap.py +81 -0
- package/src/policies/enforcers/delivery_enforcement.py +97 -0
- package/src/policies/enforcers/doc_live_over_report.py +50 -0
- package/src/policies/enforcers/expert_review_required.py +135 -0
- package/src/policies/enforcers/iac_parity.py +53 -0
- package/src/policies/enforcers/mcp_router_first.py +37 -0
- package/src/policies/enforcers/memory_before_plan.py +61 -0
- package/src/policies/enforcers/parallel_reads.py +50 -0
- package/src/policies/enforcers/rtk_wrap.py +44 -0
- package/src/policies/enforcers/schema_diff_gate.py +80 -0
- package/src/policies/enforcers/session_memory_write.py +52 -0
- package/src/policies/enforcers/task_required.py +131 -0
- package/src/policies/enforcers/test_gate.py +58 -0
- package/src/policies/enforcers/validate_plan_before_build.py +75 -0
- package/src/policies/enforcers/worktree_required.py +57 -0
- package/src/policies/schemas/policies/architecture-review.md +51 -0
- package/src/policies/schemas/policies/artifact-hygiene.md +29 -0
- package/src/policies/schemas/policies/cluster-routing.md +31 -0
- package/src/policies/schemas/policies/codebase-read-before-plan.md +30 -0
- package/src/policies/schemas/policies/coord-overlap.md +24 -0
- package/src/policies/schemas/policies/delivery-enforcement.md +45 -0
- package/src/policies/schemas/policies/doc-live-over-report.md +32 -0
- package/src/policies/schemas/policies/expert-review-required.md +60 -0
- package/src/policies/schemas/policies/iac-parity.md +31 -0
- package/src/policies/schemas/policies/mandatory-testing-deployment.md +147 -0
- package/src/policies/schemas/policies/mcp-router-first.md +24 -0
- package/src/policies/schemas/policies/memory-before-plan.md +24 -0
- package/src/policies/schemas/policies/merge-deploy-monitor-verify.md +145 -0
- package/src/policies/schemas/policies/parallel-reads.md +24 -0
- package/src/policies/schemas/policies/rtk-wrap.md +26 -0
- package/src/policies/schemas/policies/schema-diff-gate.md +30 -0
- package/src/policies/schemas/policies/session-memory-write.md +24 -0
- package/src/policies/schemas/policies/task-required.md +49 -0
- package/src/policies/schemas/policies/test-gate.md +24 -0
- package/src/policies/schemas/policies/validate-plan-before-build.md +28 -0
- package/src/policies/schemas/policies/worktree-required.md +28 -0
- package/templates/hooks/uap-policy-gate.sh +5 -0
- package/docs/AGENTS.md +0 -423
- package/docs/DOCUMENTATION_AUDIT_REPORT.md +0 -131
- package/docs/GETTING_STARTED.md +0 -288
- package/docs/PROJECT_ANALYSIS_REPORT.md +0 -510
- package/docs/architecture/COMPLETE_ARCHITECTURE.md +0 -748
- package/docs/architecture/EXPERT_STACK.md +0 -137
- package/docs/architecture/MULTI_MODEL.md +0 -224
- package/docs/architecture/PLATFORM_GATING.md +0 -68
- package/docs/architecture/SYSTEM_ANALYSIS.md +0 -334
- package/docs/architecture/UAP_COMPLIANCE.md +0 -217
- package/docs/architecture/UAP_PROTOCOL.md +0 -339
- package/docs/architecture/UAP_STRICT_DROIDS.md +0 -172
- package/docs/archive/BALLS_MODE_SELF_ANALYSIS.md +0 -260
- package/docs/archive/BENCHMARK_GAPS_AND_PLAN.md +0 -146
- package/docs/archive/FAILING_TASKS_SOLUTION_PLAN.md +0 -668
- package/docs/archive/JINJA2-SYSTEM-MESSAGE-FIX.md +0 -209
- package/docs/archive/MODEL_ROUTING_IMPLEMENTATION_SUMMARY.md +0 -281
- package/docs/archive/MODEL_ROUTING_OPTIMIZATION_PLAN.md +0 -320
- package/docs/archive/NPM-PUBLISH-V0.9.1.md +0 -240
- package/docs/archive/OPTIMIZATION_OPTIONS.md +0 -334
- package/docs/archive/PARALLELISM_GAPS_AND_OPTIONS.md +0 -422
- package/docs/archive/POLICY_GATE_IMPLEMENTATION.md +0 -245
- package/docs/archive/SETUP_IMPROVEMENTS.md +0 -213
- package/docs/archive/UAP_GENERIC_OPTIMIZATION_PLAN.md +0 -270
- package/docs/archive/UAP_OPTIMIZATION_PLAN.md +0 -701
- package/docs/archive/UAP_V103_PATTERN_DESIGN.md +0 -315
- package/docs/archive/UAP_V104_COMPLIANCE_DESIGN.md +0 -223
- package/docs/archive/changelog/2026-03-10_uap-100-compliance.md +0 -77
- package/docs/archive/changelog/2026-03-10_uap-full-system-verification.md +0 -109
- package/docs/archive/opencode-integration-guide.md +0 -740
- package/docs/archive/opencode-integration-quickref.md +0 -180
- package/docs/benchmarks/OVERNIGHT_RUNNER.md +0 -341
- package/docs/benchmarks/SPECULATIVE_DECODING_JOURNEY_2026-03.md +0 -221
- package/docs/benchmarks/VALIDATION_PLAN.md +0 -568
- package/docs/blog/SPECULATIVE_DECODING_PRODUCTION_PLAYBOOK.md +0 -139
- package/docs/blog/local-coding-agents.md +0 -266
- package/docs/blog/x-thread.md +0 -254
- package/docs/deployment/DEPLOYMENT.md +0 -895
- package/docs/deployment/DEPLOYMENT_STRATEGIES.md +0 -518
- package/docs/deployment/DEPLOY_BATCHER_ANALYSIS.md +0 -224
- package/docs/deployment/DEPLOY_BATCHING.md +0 -273
- package/docs/deployment/DEPLOY_BUCKETING_ANALYSIS.md +0 -420
- package/docs/deployment/QWEN35_LLAMA_CPP.md +0 -426
- package/docs/deployment/UAP_LLAMA_ANTHROPIC_PROXY_BOOTSTRAP.md +0 -279
- package/docs/getting-started/INTEGRATION.md +0 -628
- package/docs/getting-started/OVERVIEW.md +0 -324
- package/docs/getting-started/SETUP.md +0 -377
- package/docs/integrations/MCP_ROUTER_SETUP.md +0 -445
- package/docs/integrations/RTK_INTEGRATION.md +0 -468
- package/docs/operations/TROUBLESHOOTING.md +0 -660
- package/docs/pr/PR_SPECULATIVE_DOCS_TEMPLATE.md +0 -146
- package/docs/pr/UPSTREAM_PRS.md +0 -424
- package/docs/reference/API_REFERENCE.md +0 -903
- package/docs/reference/EXPERT_DROIDS.md +0 -219
- package/docs/reference/HARNESS-MATRIX.md +0 -318
- package/docs/reference/PATTERN_LIBRARY.md +0 -636
- package/docs/reference/UAP_CLI_REFERENCE.md +0 -620
- package/docs/research/BEHAVIORAL_PATTERNS.md +0 -228
- package/docs/research/DOMAIN_STRATEGIES.md +0 -316
- package/docs/research/MEMORY_SYSTEMS_COMPARISON.md +0 -812
- package/docs/research/PATTERN_ANALYSIS_2026-01-18.md +0 -436
- package/docs/research/PERFORMANCE_ANALYSIS_2026-01-18.md +0 -209
- package/docs/research/PERFORMANCE_TEST_PLAN.md +0 -383
- package/docs/research/TERMINAL_BENCH_LEARNINGS.md +0 -217
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
# DeployBatcher Analysis
|
|
2
|
-
|
|
3
|
-
Intelligent batching and deduplication for multi-agent deployment scenarios.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
The `DeployBatcher` optimizes CI/CD pipeline usage in multi-agent environments through SQLite-backed coordination. Multiple agents queue actions that batch into single CI runs, reducing pipeline minutes by 50-80%.
|
|
10
|
-
|
|
11
|
-
### Problem Solved
|
|
12
|
-
|
|
13
|
-
```text
|
|
14
|
-
Without DeployBatcher:
|
|
15
|
-
Agent A commits → CI Run 1 (5 min)
|
|
16
|
-
Agent B commits → CI Run 2 (5 min)
|
|
17
|
-
Agent C commits → CI Run 3 (5 min)
|
|
18
|
-
Agent A pushes → CI Run 4 (5 min)
|
|
19
|
-
Total: 4 runs × 5 min = 20 CI minutes
|
|
20
|
-
|
|
21
|
-
With DeployBatcher:
|
|
22
|
-
Agent A, B, C queue commits → Batched → Single squashed commit
|
|
23
|
-
Total: 1 run × 5 min = 5 CI minutes (75% reduction)
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Architecture
|
|
29
|
-
|
|
30
|
-
```mermaid
|
|
31
|
-
flowchart TB
|
|
32
|
-
subgraph "Multi-Agent Environment"
|
|
33
|
-
A1[Agent 1]
|
|
34
|
-
A2[Agent 2]
|
|
35
|
-
A3[Agent N]
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
subgraph "DeployBatcher Core"
|
|
39
|
-
Q[Queue Layer]
|
|
40
|
-
B[Batch Creator]
|
|
41
|
-
S[Squash Engine]
|
|
42
|
-
E[Executor]
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
subgraph "Storage"
|
|
46
|
-
DB[(SQLite DB)]
|
|
47
|
-
DQ[deploy_queue]
|
|
48
|
-
DBT[deploy_batches]
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
subgraph "Execution Targets"
|
|
52
|
-
GIT[Git Operations]
|
|
53
|
-
GH[GitHub CLI]
|
|
54
|
-
DEPLOY[Deploy Scripts]
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
A1 --> Q
|
|
58
|
-
A2 --> Q
|
|
59
|
-
A3 --> Q
|
|
60
|
-
|
|
61
|
-
Q --> DB
|
|
62
|
-
DB --> DQ
|
|
63
|
-
DB --> DBT
|
|
64
|
-
|
|
65
|
-
Q --> B
|
|
66
|
-
B --> S
|
|
67
|
-
S --> E
|
|
68
|
-
|
|
69
|
-
E --> GIT
|
|
70
|
-
E --> GH
|
|
71
|
-
E --> DEPLOY
|
|
72
|
-
|
|
73
|
-
style Q fill:#e3f2fd,stroke:#1976d2
|
|
74
|
-
style B fill:#fff3e0,stroke:#f57c00
|
|
75
|
-
style S fill:#c8e6c9,stroke:#388e3c
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
## Usage Examples
|
|
81
|
-
|
|
82
|
-
### Example 1: Multi-Agent Commit Batching
|
|
83
|
-
|
|
84
|
-
```typescript
|
|
85
|
-
import { DeployBatcher } from './coordination/deploy-batcher.js';
|
|
86
|
-
|
|
87
|
-
const batcher = new DeployBatcher({ message: 'feat: add user auth',
|
|
88
|
-
files: ['src/auth.ts', 'src/user.ts']
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
// Agent 2 commits (within window - will be merged)
|
|
92
|
-
await batcher.queue('agent-2', 'commit', 'main', {
|
|
93
|
-
message: 'feat: add logging',
|
|
94
|
-
files: ['src/logger.ts']
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
// After 30s, create and execute batch
|
|
98
|
-
const batch = await batcher.createBatch();
|
|
99
|
-
const result = await batcher.executeBatch(batch.id);
|
|
100
|
-
|
|
101
|
-
console.log(result);
|
|
102
|
-
// {
|
|
103
|
-
// batchId: 'uuid',
|
|
104
|
-
// success: true,
|
|
105
|
-
// executedActions: 1, // Squashed into single commit
|
|
106
|
-
// failedActions: 0,
|
|
107
|
-
// duration: 1234
|
|
108
|
-
// }
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### Example 2: Urgent Deployment
|
|
112
|
-
|
|
113
|
-
```typescript
|
|
114
|
-
const batcher = new DeployBatcher();
|
|
115
|
-
|
|
116
|
-
// Enable urgent mode for critical fix
|
|
117
|
-
batcher.setUrgentMode(true);
|
|
118
|
-
|
|
119
|
-
// Queue with minimal delay
|
|
120
|
-
await batcher.queue('agent-1', 'commit', 'main', {
|
|
121
|
-
message: 'hotfix: critical security patch',
|
|
122
|
-
files: ['src/security.ts']
|
|
123
|
-
}, { urgent: true });
|
|
124
|
-
|
|
125
|
-
await batcher.queue('agent-1', 'push', 'main', {}, { urgent: true });
|
|
126
|
-
|
|
127
|
-
// Immediately flush
|
|
128
|
-
const results = await batcher.flushAll();
|
|
129
|
-
|
|
130
|
-
// Restore normal mode
|
|
131
|
-
batcher.setUrgentMode(false);
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Example 3: Bulk Queue with Transaction
|
|
135
|
-
|
|
136
|
-
```typescript
|
|
137
|
-
import { DeployBatcher } from './coordination/deploy-batcher.js';
|
|
138
|
-
|
|
139
|
-
const batcher = new DeployBatcher();
|
|
140
|
-
|
|
141
|
-
console.log(`Queued ${ids.length} actions`);
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## Performance Characteristics
|
|
147
|
-
|
|
148
|
-
### Time Complexity
|
|
149
|
-
|
|
150
|
-
| Operation | Complexity | Notes |
|
|
151
|
-
|-----------|------------|-------|
|
|
152
|
-
| `queue()` | O(1) | Single INSERT |
|
|
153
|
-
| `queueBulk()` | O(n) | Transaction with n INSERTs |
|
|
154
|
-
| `createBatch()` | O(n log n) | SELECT + grouping + squashing |
|
|
155
|
-
| `executeBatch()` | O(n) sequential, O(n/p) parallel | p = maxParallelActions |
|
|
156
|
-
| `flushAll()` | O(b × n) | b batches, n actions each |
|
|
157
|
-
|
|
158
|
-
### Space Complexity
|
|
159
|
-
|
|
160
|
-
| Storage | Size |
|
|
161
|
-
|---------|------|
|
|
162
|
-
| Per action | ~500 bytes (JSON payload) |
|
|
163
|
-
| Per batch | ~100 bytes + action references |
|
|
164
|
-
| SQLite overhead | ~4KB per page |
|
|
165
|
-
|
|
166
|
-
### Recommended Limits
|
|
167
|
-
|
|
168
|
-
| Parameter | Default | Max Recommended |
|
|
169
|
-
|-----------|---------|-----------------|
|
|
170
|
-
| `maxBatchSize` | 20 | 100 |
|
|
171
|
-
| `maxParallelActions` | 5 | 10 |
|
|
172
|
-
| Queue depth | - | 1000 actions |
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## Database Schema
|
|
177
|
-
|
|
178
|
-
```mermaid
|
|
179
|
-
erDiagram
|
|
180
|
-
deploy_queue {
|
|
181
|
-
INTEGER id PK
|
|
182
|
-
TEXT agent_id
|
|
183
|
-
TEXT action_type
|
|
184
|
-
TEXT target
|
|
185
|
-
TEXT payload
|
|
186
|
-
TEXT status
|
|
187
|
-
TEXT batch_id FK
|
|
188
|
-
TEXT queued_at
|
|
189
|
-
TEXT execute_after
|
|
190
|
-
INTEGER priority
|
|
191
|
-
TEXT dependencies
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
deploy_batches {
|
|
195
|
-
TEXT id PK
|
|
196
|
-
TEXT created_at
|
|
197
|
-
TEXT executed_at
|
|
198
|
-
TEXT status
|
|
199
|
-
TEXT result
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
deploy_queue }o--|| deploy_batches : "belongs to"
|
|
203
|
-
|
|
204
|
-
style deploy_queue fill:#e3f2fd,stroke:#1976d2
|
|
205
|
-
style deploy_batches fill:#fff3e0,stroke:#f57c00
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
---
|
|
209
|
-
|
|
210
|
-
## Summary
|
|
211
|
-
|
|
212
|
-
The `DeployBatcher` provides a comprehensive solution for optimizing CI/CD pipeline usage in multi-agent environments:
|
|
213
|
-
|
|
214
|
-
| Feature | Benefit |
|
|
215
|
-
|---------|---------|
|
|
216
|
-
| Dynamic batch windows | Balances speed vs batching per action type |
|
|
217
|
-
| Commit squashing | Reduces N commits to 1 CI run |
|
|
218
|
-
| Action merging | Deduplicates redundant operations |
|
|
219
|
-
| Parallel execution | Faster batch completion |
|
|
220
|
-
| Urgent mode | Fast path for critical operations |
|
|
221
|
-
| SQLite persistence | Survives agent restarts |
|
|
222
|
-
| CLI integration | Easy manual control |
|
|
223
|
-
|
|
224
|
-
**Typical CI/CD savings**: 50-80% reduction in pipeline minutes for multi-agent workflows.
|
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
# Deploy Batching & Bucketing System
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
The UAP Deploy system provides intelligent action batching and execution for automated deployments. It uses **dynamic batch windows** to group related actions together, reducing unnecessary operations and improving efficiency.
|
|
6
|
-
|
|
7
|
-
## Key Features
|
|
8
|
-
|
|
9
|
-
### 1. Dynamic Batch Windows
|
|
10
|
-
|
|
11
|
-
Actions are queued with type-specific waiting periods before being batched together:
|
|
12
|
-
|
|
13
|
-
| Action Type | Default Window | Description |
|
|
14
|
-
| ----------- | -------------- | --------------------------------- |
|
|
15
|
-
| `commit` | 30,000ms (30s) | Allows squashing multiple commits |
|
|
16
|
-
| `push` | 5,000ms (5s) | Fast for PR creation |
|
|
17
|
-
| `merge` | 10,000ms (10s) | Moderate safety buffer |
|
|
18
|
-
| `workflow` | 5,000ms (5s) | Fast workflow triggers |
|
|
19
|
-
| `deploy` | 60,000ms (60s) | Safety buffer for deployments |
|
|
20
|
-
|
|
21
|
-
### 2. Smart Deduplication
|
|
22
|
-
|
|
23
|
-
The system automatically detects and merges similar actions:
|
|
24
|
-
|
|
25
|
-
- Multiple commits to the same branch are squashed
|
|
26
|
-
- Multiple pushes to the same branch are merged
|
|
27
|
-
- Duplicate workflow triggers are deduplicated
|
|
28
|
-
|
|
29
|
-
### 3. Parallel Execution
|
|
30
|
-
|
|
31
|
-
Independent actions (like workflow triggers) can execute in parallel while maintaining order for dependent actions (commits → push → merge).
|
|
32
|
-
|
|
33
|
-
### 4. Urgent Mode
|
|
34
|
-
|
|
35
|
-
For time-critical operations, urgent mode reduces all batch windows to minimum values:
|
|
36
|
-
|
|
37
|
-
- commit: 2,000ms
|
|
38
|
-
- push: 1,000ms
|
|
39
|
-
- merge: 2,000ms
|
|
40
|
-
- workflow: 1,000ms
|
|
41
|
-
- deploy: 5,000ms
|
|
42
|
-
|
|
43
|
-
## CLI Commands
|
|
44
|
-
|
|
45
|
-
### View Current Configuration
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
uap deploy config
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
**Output:**
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
📋 Deploy Batch Configuration
|
|
55
|
-
|
|
56
|
-
Current batch window settings (ms):
|
|
57
|
-
|
|
58
|
-
commit: 30000ms (30s)
|
|
59
|
-
push: 5000ms (5s)
|
|
60
|
-
merge: 10000ms (10s)
|
|
61
|
-
workflow: 5000ms (5s)
|
|
62
|
-
deploy: 60000ms (60s)
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Set Custom Configuration
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
uap deploy set-config --message '{"commit":60000,"push":3000,"merge":15000}'
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
**Examples:**
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
# Set custom windows for all types
|
|
75
|
-
uap deploy set-config --message '{"commit":60000,"push":5000,"merge":10000,"workflow":5000,"deploy":120000}'
|
|
76
|
-
|
|
77
|
-
# Set only specific windows (others remain unchanged)
|
|
78
|
-
uap deploy set-config --message '{"commit":120000}'
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Enable/Disable Urgent Mode
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
# Enable urgent mode (fast execution)
|
|
85
|
-
uap deploy urgent --on
|
|
86
|
-
|
|
87
|
-
# Disable urgent mode (return to default windows)
|
|
88
|
-
uap deploy urgent --off
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## Usage Examples
|
|
92
|
-
|
|
93
|
-
### Queue a Deploy Action
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
# Queue a commit action
|
|
97
|
-
uap deploy queue --agent-id my-agent --action-type commit --target main --message "Fix bug" --files src/file.ts
|
|
98
|
-
|
|
99
|
-
# Queue a push action
|
|
100
|
-
uap deploy queue --agent-id my-agent --action-type push --target main --remote origin --force
|
|
101
|
-
|
|
102
|
-
# Queue a merge action
|
|
103
|
-
uap deploy queue --agent-id my-agent --action-type merge --target main
|
|
104
|
-
|
|
105
|
-
# Queue a workflow trigger
|
|
106
|
-
uap deploy queue --agent-id my-agent --action-type workflow --target CI --ref main --inputs '{"deploy_env":"production"}'
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Create and Execute Batches
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
# Create a batch from pending actions
|
|
113
|
-
uap deploy batch
|
|
114
|
-
|
|
115
|
-
# Execute a specific batch
|
|
116
|
-
uap deploy execute --batch-id <batch-id>
|
|
117
|
-
|
|
118
|
-
# Execute all pending batches
|
|
119
|
-
uap deploy flush
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Check Status
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
# View queue status
|
|
126
|
-
uap deploy status
|
|
127
|
-
|
|
128
|
-
# View detailed status
|
|
129
|
-
uap deploy status --verbose
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
## Configuration Schema
|
|
133
|
-
|
|
134
|
-
The batch window configuration follows this schema:
|
|
135
|
-
|
|
136
|
-
```typescript
|
|
137
|
-
interface DynamicBatchWindows {
|
|
138
|
-
commit: number; // Default: 30000ms (30s)
|
|
139
|
-
push: number; // Default: 5000ms (5s)
|
|
140
|
-
merge: number; // Default: 10000ms (10s)
|
|
141
|
-
workflow: number; // Default: 5000ms (5s)
|
|
142
|
-
deploy: number; // Default: 60000ms (60s)
|
|
143
|
-
}
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
## Best Practices
|
|
147
|
-
|
|
148
|
-
### When to Adjust Windows
|
|
149
|
-
|
|
150
|
-
1. **Increase windows** when:
|
|
151
|
-
- You want more aggressive batching
|
|
152
|
-
- Multiple developers are working on the same branch
|
|
153
|
-
- You prefer fewer, larger deployments
|
|
154
|
-
|
|
155
|
-
2. **Decrease windows** when:
|
|
156
|
-
- You need faster feedback
|
|
157
|
-
- Time-sensitive deployments
|
|
158
|
-
- CI/CD pipeline is the bottleneck
|
|
159
|
-
|
|
160
|
-
3. **Use urgent mode** when:
|
|
161
|
-
- Hotfix deployment
|
|
162
|
-
- Security patch
|
|
163
|
-
- Critical bug fix
|
|
164
|
-
|
|
165
|
-
### Performance Considerations
|
|
166
|
-
|
|
167
|
-
- **Shorter windows** = Faster execution but more individual operations
|
|
168
|
-
- **Longer windows** = More batching but slower response time
|
|
169
|
-
- **Parallel execution** works best for independent workflow triggers
|
|
170
|
-
|
|
171
|
-
## Architecture
|
|
172
|
-
|
|
173
|
-
The deploy system consists of:
|
|
174
|
-
|
|
175
|
-
1. **DeployBatcher** - Core batching logic with dynamic windows
|
|
176
|
-
2. **CoordinationService** - Manages agent coordination state
|
|
177
|
-
3. **SQLite Database** - Persistent storage for pending actions and batches
|
|
178
|
-
|
|
179
|
-
## API Reference
|
|
180
|
-
|
|
181
|
-
### DeployBatcher Configuration
|
|
182
|
-
|
|
183
|
-
```typescript
|
|
184
|
-
interface DeployBatcherConfig {
|
|
185
|
-
dbPath?: string;
|
|
186
|
-
batchWindowMs?: number; // Legacy: single window for all types
|
|
187
|
-
dynamicWindows?: Partial<DynamicBatchWindows>; // NEW: per-type windows
|
|
188
|
-
maxBatchSize?: number;
|
|
189
|
-
dryRun?: boolean;
|
|
190
|
-
parallelExecution?: boolean;
|
|
191
|
-
maxParallelActions?: number;
|
|
192
|
-
}
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### Methods
|
|
196
|
-
|
|
197
|
-
```typescript
|
|
198
|
-
class DeployBatcher {
|
|
199
|
-
// Queue an action with type-specific batching
|
|
200
|
-
async queue(
|
|
201
|
-
agentId: string,
|
|
202
|
-
actionType: DeployActionType,
|
|
203
|
-
target: string,
|
|
204
|
-
payload?: Record<string, unknown>,
|
|
205
|
-
options?: { priority?: number; dependencies?: string[]; urgent?: boolean }
|
|
206
|
-
): Promise<number>;
|
|
207
|
-
|
|
208
|
-
// Get current batch window for action type
|
|
209
|
-
getBatchWindow(actionType: DeployActionType): number;
|
|
210
|
-
|
|
211
|
-
// Set urgent mode
|
|
212
|
-
setUrgentMode(urgent: boolean): void;
|
|
213
|
-
|
|
214
|
-
// Get current configuration
|
|
215
|
-
getWindowConfig(): DynamicBatchWindows;
|
|
216
|
-
|
|
217
|
-
// Create batch from ready actions
|
|
218
|
-
async createBatch(): Promise<DeployBatch | null>;
|
|
219
|
-
|
|
220
|
-
// Execute a batch
|
|
221
|
-
async executeBatch(batchId: string): Promise<BatchResult>;
|
|
222
|
-
|
|
223
|
-
// Flush all pending deploys
|
|
224
|
-
async flushAll(): Promise<BatchResult[]>;
|
|
225
|
-
}
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
## Troubleshooting
|
|
229
|
-
|
|
230
|
-
### Actions Not Batching
|
|
231
|
-
|
|
232
|
-
**Issue:** Actions remain in "pending" status for too long.
|
|
233
|
-
|
|
234
|
-
**Solution:** Check batch window configuration:
|
|
235
|
-
|
|
236
|
-
```bash
|
|
237
|
-
uap deploy config
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
Adjust windows if needed:
|
|
241
|
-
|
|
242
|
-
```bash
|
|
243
|
-
uap deploy set-config --message '{"commit":5000,"push":2000}'
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
### Urgent Mode Not Working
|
|
247
|
-
|
|
248
|
-
**Issue:** Urgent mode doesn't reduce wait times.
|
|
249
|
-
|
|
250
|
-
**Solution:** Ensure you're using the correct flags:
|
|
251
|
-
|
|
252
|
-
```bash
|
|
253
|
-
uap deploy urgent --on
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
### Parallel Execution Not Working
|
|
257
|
-
|
|
258
|
-
**Issue:** Actions execute sequentially instead of in parallel.
|
|
259
|
-
|
|
260
|
-
**Solution:** Check that actions are independent (different action types or targets).
|
|
261
|
-
|
|
262
|
-
## Related Documentation
|
|
263
|
-
|
|
264
|
-
- [Deploy Command Reference](./CLI_DEPLOY.md)
|
|
265
|
-
- [Coordination System](./COORDINATION.md)
|
|
266
|
-
- [Batch Execution Guide](./BATCH_EXECUTION.md)
|
|
267
|
-
|
|
268
|
-
## Version History
|
|
269
|
-
|
|
270
|
-
- **v4.3.0** - Added dynamic batch windows per action type
|
|
271
|
-
- **v4.2.0** - Added urgent mode for fast execution
|
|
272
|
-
- **v4.1.0** - Added parallel execution for independent actions
|
|
273
|
-
- **v4.0.0** - Initial deploy batching system
|