jules-orchestrator-kit 0.26.0 β 0.26.1
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 +173 -327
- package/bin/agentctl.mjs +2 -2
- package/package.json +1 -1
- package/src/merge-blocks.mjs +1 -1
package/README.md
CHANGED
|
@@ -2,398 +2,244 @@
|
|
|
2
2
|
|
|
3
3
|
# π jules-orchestrator-kit
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Universal Autonomous AI Agent Orchestration Kernel for Google Jules
|
|
6
6
|
|
|
7
7
|
[](https://github.com/FullThrottle83/jules-orchestrator-kit/actions/workflows/jules-audit.yml)
|
|
8
8
|
[](https://www.npmjs.com/package/jules-orchestrator-kit)
|
|
9
9
|
[](https://opensource.org/licenses/MIT)
|
|
10
10
|
[](https://nodejs.org)
|
|
11
11
|
[](https://nodejs.org)
|
|
12
|
+
[](#-universal-polyglot-support--stack-detection)
|
|
12
13
|
|
|
13
14
|
<p align="center">
|
|
14
|
-
<b>
|
|
15
|
-
|
|
15
|
+
<b>The zero-dependency safety gatekeeper and self-healing engineering kernel for autonomous coding agent swarms.</b><br/>
|
|
16
|
+
Transforms single-turn AI chat assistants into production-grade engineering swarms running 300+ daily sessions across any language or monorepo.
|
|
16
17
|
</p>
|
|
17
18
|
|
|
18
19
|
<p align="center">
|
|
19
|
-
<a href="#-2-
|
|
20
|
-
<a href="#-
|
|
20
|
+
<a href="#-2-sentence-mental-model">π‘ What is Kit?</a> β’
|
|
21
|
+
<a href="#-universal-30-second-quickstart-zero-to-verified-pr">β‘ 30s Quickstart</a> β’
|
|
22
|
+
<a href="#-feature-comparison-matrix">π Comparison Matrix</a> β’
|
|
21
23
|
<a href="#-system-architecture--visual-diagrams">ποΈ Architecture</a> β’
|
|
22
|
-
<a href="#-cli-command-reference-agentctl">π οΈ CLI
|
|
23
|
-
<a href="
|
|
24
|
+
<a href="#-cli-command-reference-agentctl">π οΈ CLI Reference</a> β’
|
|
25
|
+
<a href="#-v027-next-gen-feature-roadmap">πΊοΈ Roadmap</a> β’
|
|
26
|
+
<a href="./docs/UNIVERSAL_POLYGLOT_ARCHITECTURE.md">π Polyglot Spec</a>
|
|
24
27
|
</p>
|
|
25
28
|
|
|
26
29
|
</div>
|
|
27
30
|
|
|
28
31
|
---
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
<img src="docs/assets/hero-flow.svg?v=3" alt="Autonomous Orchestration Pipeline" width="100%" />
|
|
32
|
-
</p>
|
|
33
|
-
|
|
34
|
-
---
|
|
33
|
+
## π‘ 2-Sentence Mental Model
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
| Your Goal | Recommended Starting Point |
|
|
39
|
-
| :--- | :--- |
|
|
40
|
-
| π£ **First time using Jules / AI Agents** | Follow the [2-Minute Quickstart](#-2-minute-quickstart) below β zero setup required! |
|
|
41
|
-
| π οΈ **Connecting to Claude Code, Cursor, or Antigravity** | Jump to [MCP & IDE Integration](#-5-model-context-protocol-mcp--ide-integration) |
|
|
42
|
-
| β‘ **Automating CI/CD Workflows** | See the [GitHub Actions Composite Action](#-github-actions-composite-action-githubactionssetup-jules) |
|
|
43
|
-
| π **Looking for copy-paste code patterns** | Browse 6 production recipes in [EXAMPLES.md](./EXAMPLES.md) |
|
|
35
|
+
> **Think of `jules-orchestrator-kit` as an automated Engineering Manager for AI coding agents.**
|
|
36
|
+
> **It hands out clear tasks, runs your tests in an isolated sandbox, fixes broken code automatically, and only opens a Pull Request when 100% of your tests pass.**
|
|
44
37
|
|
|
45
38
|
---
|
|
46
39
|
|
|
47
|
-
##
|
|
48
|
-
|
|
49
|
-
> [!TIP]
|
|
50
|
-
> **New to Google Jules or agent automation?** You don't need any complex setup! `jules-orchestrator-kit` works out of the box with standard `npm test` and zero external runtime dependencies.
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
# 1. Initialize orchestrator structure in your target codebase
|
|
54
|
-
npx jules-orchestrator-kit init
|
|
55
|
-
|
|
56
|
-
# 2. Dispatch an autonomous task (Dry-Run mode for local simulation)
|
|
57
|
-
JULES_DRY_RUN=1 npx agentctl dispatch \
|
|
58
|
-
--title "Add JWT Validator" \
|
|
59
|
-
--prompt "Implement JWT validation middleware with unit tests"
|
|
40
|
+
## π― Why `jules-orchestrator-kit`?
|
|
60
41
|
|
|
61
|
-
|
|
62
|
-
npx agentctl gate
|
|
63
|
-
|
|
64
|
-
# 4. Connect as a native stdio MCP server (for Claude Code, Cursor, or Antigravity)
|
|
65
|
-
npx agentctl mcp
|
|
66
|
-
```
|
|
42
|
+
Autonomous coding agents can write software at 100Γ human speedβbut unconstrained agents introduce silent regressions, leak API keys, hallucinate test assertions, and thrash shared monorepos.
|
|
67
43
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
44
|
+
`jules-orchestrator-kit` provides the missing **Safety, Orchestration, and Verification Kernel** for high-reliability AI agent deployments:
|
|
45
|
+
- **π Zero Runtime Dependencies:** Built exclusively on Node.js 20+ built-ins (`node:fs`, `node:child_process`, `node:crypto`, `node:path`, `node:test`). Zero third-party npm packages mean zero supply-chain CVE risk.
|
|
46
|
+
- **π‘οΈ Fail-Closed Security Gatekeeper:** Unconditionally evaluates explicit Deny rules *before* Allow rules, redacts high-entropy secrets and PII from dry-runs and git diffs, and rejects PRs exceeding the 75 KB Diff Payload governor.
|
|
47
|
+
- **π Autonomous OODA Self-Healing:** Captures test stderr/stdout, normalizes failure fingerprints, and feeds structured error contexts back into repair iterations (up to 3 automatic attempts) before human escalation.
|
|
48
|
+
- **π Universal Polyglot Spine:** Natively auto-detects 24+ tech stacks (PHP/Laravel/WordPress, .NET/C#, Python, Go, Rust, C/C++, Flutter/Swift, Node/Deno/Bun) and transparently wraps verification suites in Docker Compose or Devcontainer sandboxes.
|
|
49
|
+
- **π Scoped Monorepo Boundary Resolver:** Statically maps changed files up directory ancestry to invoke isolated subshell test suites (`(cd backend && pytest) && (cd cli && cargo test)`), eliminating global test thrashing.
|
|
50
|
+
- **π Zero-Test Bootstrapping (`agentctl bootstrap`):** Synthesizes deterministic syntax-check and smoke-test verification oracles for untested legacy repositories so agents always operate against a falsifiable feedback loop.
|
|
51
|
+
- **π Proven Scale & Reliability:** Empirically tested with **221 unit tests across 54 suites passing in < 1.2s**, supporting 300+ daily agent sessions per repository.
|
|
71
52
|
|
|
72
53
|
---
|
|
73
54
|
|
|
74
|
-
##
|
|
55
|
+
## π Feature Comparison Matrix
|
|
75
56
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
| **
|
|
81
|
-
| **
|
|
82
|
-
| **
|
|
83
|
-
| **
|
|
84
|
-
| **
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## π οΈ CLI Command Reference (`agentctl`)
|
|
89
|
-
|
|
90
|
-
| Command | Usage Example | Description |
|
|
91
|
-
| :--- | :--- | :--- |
|
|
92
|
-
| **`init`** | `npx agentctl init` | Initializes `.agent/` configuration, workflows, and task queue directory |
|
|
93
|
-
| **`dispatch`** | `agentctl dispatch --title "Fix Bug" --prompt "..."` | Dispatches an autonomous task to Google Jules |
|
|
94
|
-
| **`gate`** | `agentctl gate [--fix] [--base main]` | Runs 4-phase safety gatekeeper audit against workspace |
|
|
95
|
-
| **`queue`** | `agentctl queue` | Processes pending task queue sequentially from `.agent/jules-queue/` |
|
|
96
|
-
| **`swarm`** | `agentctl swarm` | Launches parallel multi-agent swarm in isolated git worktrees |
|
|
97
|
-
| **`merge-swarm`** | `agentctl merge-swarm` | Performs 3-way structural merge on completed swarm PRs |
|
|
98
|
-
| **`mcp`** | `agentctl mcp` | Starts stdio Model Context Protocol (MCP) JSON-RPC 2.0 server |
|
|
99
|
-
| **`doctor`** | `agentctl doctor` | Verifies stack configuration, environment keys, and daily token budget |
|
|
100
|
-
| **`scan`** | `agentctl scan` | Scans codebase for `TODO` and `FIXME` comments and generates task queue |
|
|
101
|
-
| **`clean`** | `agentctl clean` | Audits and cleans up stale git worktrees, orphaned intents, locks, and temporary state files |
|
|
57
|
+
| Dimension | Raw Agent Execution (No Orchestrator) | Standard CI/CD Pipelines | `jules-orchestrator-kit` (v0.26+) |
|
|
58
|
+
| :--- | :--- | :--- | :--- |
|
|
59
|
+
| **Self-Healing Loop** | β None (Crashes on test error) | β None (Fails build; notifies human) | β
**Autonomous OODA Loop** (Max 3 repair turns with error fingerprinting) |
|
|
60
|
+
| **Scope Isolation** | β None (Can modify CI files or lockfiles) | π‘ Post-commit branch rules only | β
**Fail-Closed Scope Guard** (Deny-first evaluation; blocks protected paths) |
|
|
61
|
+
| **Polyglot Stack Detection**| β Manual prompt instructions | π‘ Hardcoded YAML workflow steps | β
**Universal 24+ Stack Detector** (`src/stack-detector.mjs`) |
|
|
62
|
+
| **Flaky Test Quarantine** | β Fails session randomly | β Breaks CI pipeline randomly | β
**Wilson-Score Statistical Quarantine** (Oscillation β₯ 0.40 quarantined automatically) |
|
|
63
|
+
| **Monorepo Scoping** | β Runs full global test suite | π‘ Requires custom Nx/Turbo scripting | β
**Scoped Subshell Boundary Resolver** (`resolveWorkspaceBoundary`) |
|
|
64
|
+
| **Zero-Test Bootstrapping**| β Halts without verification oracle | β Fails build if no tests exist | β
**Instant Oracle Synthesis** (`php -l`, `compileall`, `dotnet build`, `tsc`, `smoke`) |
|
|
65
|
+
| **Secret Leak Prevention**| β Prone to leaking tokens in diffs | π‘ Post-push secret scanning alerts | β
**Pre-Dispatch & Pre-Commit Diff Scanner** (Blocks CVEs/keys before PR creation) |
|
|
66
|
+
| **Dependency Footprint** | β Requires heavy SDKs & parsers | π‘ Many external actions & plugins | β
**0 Native Dependencies** (100% Node.js 20+ ESM built-ins) |
|
|
102
67
|
|
|
103
68
|
---
|
|
104
69
|
|
|
105
|
-
##
|
|
106
|
-
|
|
107
|
-
<details open>
|
|
108
|
-
<summary><b>π 1. Control Plane Architecture Layers</b></summary>
|
|
109
|
-
|
|
110
|
-
<br/>
|
|
111
|
-
|
|
112
|
-
<p align="center">
|
|
113
|
-
<img src="docs/assets/architecture-layers.svg?v=3" alt="Control Plane Architecture Layers" width="100%" />
|
|
114
|
-
</p>
|
|
115
|
-
|
|
116
|
-
<br/>
|
|
117
|
-
|
|
118
|
-
### Engine System Highlights
|
|
119
|
-
|
|
120
|
-
- **Native Task DAG Executor (`src/dag-engine.mjs`)**: Zero-dependency `DagExecutor` with Kahn's topological sort algorithm, SHA-256 interface fingerprinting post-task execution, and pre-execution cycle detection (`DagCycleError`).
|
|
121
|
-
- **Intent Journaling & Zombie Worktree Reaper (`src/journal.mjs`)**: Automatic boot-time scan (`reapOrphanedIntents`) in `agentctl` and MCP server that tracks git operations in `.agent/state/journal.jsonl` and prunes orphaned worktrees left by crashed/recycled processes.
|
|
122
|
-
- **Hermetic Network Egress Guard (`src/preload-net-guard.mjs`)**: Intercepts and blocks unmocked outbound HTTP/HTTPS egress during test execution (`NODE_OPTIONS="--import ./src/preload-net-guard.mjs"`), enforcing hermetic testing while allowing local loopback (`localhost`, `127.0.0.1`).
|
|
123
|
-
- **Linearizable VFS Mutex (`src/state.mjs`)**: Kernel-level directory mutex (`withVfsMutex`) guaranteeing serial linearizability for SHA-256 hash-chained session ledgers with atomic budget reservation (`reserveBudgetAtomic`).
|
|
124
|
-
- **PID Recycling & Stale Lock Protection (`src/state.mjs`)**: Linux `/proc/<pid>/stat` launch-time validation and random UUID nonces prevent false-positive lock reaps from recycled OS process IDs.
|
|
125
|
-
- **Memory-Bounded Content-Length MCP Streaming (`src/mcp.mjs`)**: Native MCP server over stdio streams using `McpFrameDecoder` with a 4 MB memory safety ceiling and panic boundaries to prevent stdout stack trace leaks.
|
|
126
|
-
- **Process Group Isolation (`src/process-group.mjs`)**: `ProcessGroupManager` creates isolated process groups (`detached: true`) and catches `SIGINT`/`SIGTERM`/`exit` signals to execute `process.kill(-pgid)`, guaranteeing zero zombie processes.
|
|
127
|
-
- **TOCTOU & Symlink Defense (`src/security.mjs`)**: `safeAtomicWrite()` uses `O_CREAT | O_EXCL | O_WRONLY` temp files with `fsyncSync` + `renameSync` and `lstatSync`/`realpathSync` symlink checks.
|
|
128
|
-
- **3-Way Structural AST/JSON Merge (`scripts/jules-merge-swarm.mjs`)**: Pure Node `deepMerge3Way()` algorithm for recursive object and array merges executed in isolated temporary directories (`os.tmpdir()`).
|
|
129
|
-
|
|
130
|
-
</details>
|
|
131
|
-
|
|
132
|
-
<details>
|
|
133
|
-
<summary><b>π 2. Self-Healing OODA Loop Cycle</b></summary>
|
|
134
|
-
|
|
135
|
-
<br/>
|
|
136
|
-
|
|
137
|
-
<p align="center">
|
|
138
|
-
<img src="docs/assets/ooda-loop-cycle.svg?v=3" alt="Self-Healing OODA Loop" width="100%" />
|
|
139
|
-
</p>
|
|
140
|
-
|
|
141
|
-
<br/>
|
|
142
|
-
|
|
143
|
-
> [!IMPORTANT]
|
|
144
|
-
> The OODA (Observe-Orient-Decide-Act) loop executes up to 3 repair attempts when tests fail. If the failure output oscillates deterministically without progress, the OODA engine halts repair to save API tokens and returns Exit Code 4.
|
|
145
|
-
|
|
146
|
-
</details>
|
|
147
|
-
|
|
148
|
-
<details>
|
|
149
|
-
<summary><b>π‘οΈ 3. Zero-Trust Security Shield & 4-Phase Gate</b></summary>
|
|
150
|
-
|
|
151
|
-
<br/>
|
|
152
|
-
|
|
153
|
-
<p align="center">
|
|
154
|
-
<img src="docs/assets/security-shield.svg?v=3" alt="Zero-Trust Security Guarantees" width="100%" />
|
|
155
|
-
</p>
|
|
156
|
-
|
|
157
|
-
<br/>
|
|
158
|
-
|
|
159
|
-
### The 4-Phase Safety Audit & Security Boundary (`agentctl gate`)
|
|
160
|
-
|
|
161
|
-
1. **Scope Fencing (`forbidden_paths`)**: Ensures agents cannot modify protected files (`package.json`, `.github/`, deployment keys) without explicit overrides.
|
|
162
|
-
2. **Diff Payload Governor**: Rejects oversized diffs (> 75 KB) to prevent truncation and hidden payload injections.
|
|
163
|
-
3. **Secret Entropy Scanner**: Scans diffs for high-confidence secrets (AWS keys, Stripe keys, GitHub tokens, SSH private keys) using Shannon Entropy analysis (> 3.6 bits).
|
|
164
|
-
4. **Trusted Verification Suite**: Executes auto-detected unit tests and linters (`npm test`) inside a hermetic network sandbox to guarantee zero regressions before merging.
|
|
165
|
-
5. **Prompt Guard Boundary (`src/prompt-guard.mjs`)**: `sanitizeUntrustedData` strips bidi control characters, ANSI escape sequences, zero-width unicode, and neutralizes prompt injection tags (`<|im_start|>`, `[INST]`).
|
|
166
|
-
6. **MCP Stream Isolation (`src/mcp.mjs`)**: Seals `process.stdout.write` framing stream to prevent log output from corrupting JSON-RPC stdio frames.
|
|
167
|
-
|
|
168
|
-
> [!WARNING]
|
|
169
|
-
> All security rules are fetched strictly from `origin/main` (never untrusted PR branches) to prevent prompt-injection attacks from altering security rules.
|
|
170
|
-
|
|
171
|
-
</details>
|
|
172
|
-
|
|
173
|
-
<details>
|
|
174
|
-
<summary><b>π 4. Parallel Swarm Topology & Isolated Worktrees</b></summary>
|
|
175
|
-
|
|
176
|
-
<br/>
|
|
177
|
-
|
|
178
|
-
<p align="center">
|
|
179
|
-
<img src="docs/assets/swarm-topology.svg?v=3" alt="Multi-Agent Swarm Topology" width="100%" />
|
|
180
|
-
</p>
|
|
181
|
-
|
|
182
|
-
<br/>
|
|
183
|
-
|
|
184
|
-
> [!NOTE]
|
|
185
|
-
> Swarm execution spawns dedicated git worktrees for each task in parallel, isolated by VFS locks. Completed tasks are verified and merged back using 3-way AST/JSON structural merging (`agentctl swarm`).
|
|
70
|
+
## β‘ Universal 30-Second Quickstart (Zero to Verified PR)
|
|
186
71
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
<details>
|
|
190
|
-
<summary><b>π 5. Model Context Protocol (MCP) & IDE Integration</b></summary>
|
|
191
|
-
|
|
192
|
-
<br/>
|
|
193
|
-
|
|
194
|
-
<p align="center">
|
|
195
|
-
<img src="docs/assets/mcp-integration.svg?v=3" alt="Dual-Way MCP Integration" width="100%" />
|
|
196
|
-
</p>
|
|
197
|
-
|
|
198
|
-
<br/>
|
|
199
|
-
|
|
200
|
-
### Connecting to Claude Desktop, Cursor, or Antigravity
|
|
201
|
-
|
|
202
|
-
Start the native stdio MCP server:
|
|
72
|
+
Get from zero to an autonomously verified GitHub Pull Request across any software ecosystem in 30 seconds.
|
|
203
73
|
|
|
74
|
+
### 1οΈβ£ Node.js / TypeScript (npm, pnpm, yarn, bun, deno)
|
|
204
75
|
```bash
|
|
205
|
-
|
|
76
|
+
# Dispatch a scoped task; auto-detects package.json / tsconfig.json and runs type-checked tests
|
|
77
|
+
npx jules-orchestrator-kit dispatch --title "Add rate limiting to API router" \
|
|
78
|
+
--prompt "Implement IP-based token-bucket rate limiting in src/router.ts with unit tests."
|
|
206
79
|
```
|
|
207
80
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
</details>
|
|
216
|
-
|
|
217
|
-
<details>
|
|
218
|
-
<summary><b>π³ 6. Subscription Tier Presets Matrix</b></summary>
|
|
219
|
-
|
|
220
|
-
<br/>
|
|
221
|
-
|
|
222
|
-
<p align="center">
|
|
223
|
-
<img src="docs/assets/tier-presets.svg?v=3" alt="Subscription Tier Presets Matrix" width="100%" />
|
|
224
|
-
</p>
|
|
225
|
-
|
|
226
|
-
<br/>
|
|
227
|
-
|
|
228
|
-
Tailor session limits and rate-limiting behavior to your Google Jules API subscription tier:
|
|
229
|
-
|
|
230
|
-
| Tier | `dailyTasks` | `repairAttempts` | `concurrency` | `staggerMs` | Target Usage |
|
|
231
|
-
| :--- | :---: | :---: | :---: | :---: | :--- |
|
|
232
|
-
| **`free`** | `15` | `1` | `1` | `3000 ms` | **Hobby / Free Tier:** Conserves quota, prevents HTTP 429 rate limits. |
|
|
233
|
-
| **`pro`** | `100` | `2` | `2` | `1500 ms` | **Developer Pro:** Balanced throughput for everyday work. |
|
|
234
|
-
| **`ultra`** *(default)* | `300` | `3` | `3` | `1000 ms` | **Swarm / Enterprise:** Maximum parallel throughput & CI/CD. |
|
|
235
|
-
|
|
236
|
-
**How to activate:**
|
|
237
|
-
- **Environment Variable:** `export JULES_TIER=free` (or set in `.env`)
|
|
238
|
-
- **Config File (`.agent/jules.yml`):** Set `tier: free`
|
|
239
|
-
|
|
240
|
-
</details>
|
|
241
|
-
|
|
242
|
-
---
|
|
243
|
-
|
|
244
|
-
## π€ Specialist Agent Prompt Presets (`.agent/prompts/`)
|
|
81
|
+
### 2οΈβ£ Python / FastAPI / Django (pytest, pyproject.toml)
|
|
82
|
+
```bash
|
|
83
|
+
# Bootstrap zero-test or legacy Python repo, then dispatch task
|
|
84
|
+
npx jules-orchestrator-kit bootstrap --force
|
|
85
|
+
npx jules-orchestrator-kit dispatch --title "Add OAuth2 JWT validation" \
|
|
86
|
+
--prompt "Add JWT bearer authentication middleware to backend/api/auth.py and verify via pytest."
|
|
87
|
+
```
|
|
245
88
|
|
|
246
|
-
|
|
89
|
+
### 3οΈβ£ PHP / Laravel / WordPress (Docker Compose + PHPUnit/Pest)
|
|
90
|
+
```bash
|
|
91
|
+
# Auto-detects docker-compose.yml and wraps test commands in `docker compose exec -T app ...`
|
|
92
|
+
npx jules-orchestrator-kit dispatch --title "Upgrade PHP 8.3 type annotations" \
|
|
93
|
+
--prompt "Add strict type hints to all repository classes in app/Repositories/."
|
|
94
|
+
```
|
|
247
95
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
96
|
+
### 4οΈβ£ .NET / C# Enterprise (*.sln, *.csproj)
|
|
97
|
+
```bash
|
|
98
|
+
# Auto-detects .sln / .csproj and runs `dotnet test --no-restore --nologo`
|
|
99
|
+
npx jules-orchestrator-kit dispatch --title "Implement OrderService caching" \
|
|
100
|
+
--prompt "Add IMemoryCache caching to OrderService.cs with xUnit coverage."
|
|
101
|
+
```
|
|
254
102
|
|
|
103
|
+
### 5οΈβ£ Polyglot Monorepo (FastAPI + React + Rust CLI)
|
|
255
104
|
```bash
|
|
256
|
-
#
|
|
257
|
-
npx
|
|
258
|
-
--prompt "$(cat .agent/prompts/Janitor.md) Prune unused helper methods in src/utils.mjs"
|
|
105
|
+
# Run a parallel worktree swarm; changed files automatically route to scoped subproject tests
|
|
106
|
+
npx jules-orchestrator-kit swarm
|
|
259
107
|
```
|
|
260
108
|
|
|
261
109
|
---
|
|
262
110
|
|
|
263
|
-
##
|
|
111
|
+
## ποΈ System Architecture & Visual Diagrams
|
|
264
112
|
|
|
265
|
-
|
|
113
|
+
### 1. The Autonomous OODA Verification Loop
|
|
114
|
+
Every task dispatched to `jules-orchestrator-kit` executes within an immutable, fail-closed verification loop:
|
|
266
115
|
|
|
267
|
-
```yaml
|
|
268
|
-
steps:
|
|
269
|
-
- uses: actions/checkout@v4
|
|
270
|
-
- uses: FullThrottle83/jules-orchestrator-kit/.github/actions/setup-jules@main
|
|
271
|
-
with:
|
|
272
|
-
action: 'gate'
|
|
273
|
-
base_branch: 'main'
|
|
274
|
-
tier: 'ultra'
|
|
275
|
-
env:
|
|
276
|
-
JULES_API_KEY: ${{ secrets.JULES_API_KEY }}
|
|
277
116
|
```
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
117
|
+
+---------------------------------------------------------------------------------------------------+
|
|
118
|
+
| AUTONOMOUS OODA SELF-HEALING ENGINE (v0.26+) |
|
|
119
|
+
| |
|
|
120
|
+
| [Task Envelope] --> (1. Validate Scope & Base Freshness) |
|
|
121
|
+
| | |
|
|
122
|
+
| v |
|
|
123
|
+
| (2. Create Isolated Git Worktree / VFS Lock) |
|
|
124
|
+
| | |
|
|
125
|
+
| v |
|
|
126
|
+
| (3. Dispatch AI Task to Google Jules / LLM) |
|
|
127
|
+
| | |
|
|
128
|
+
| v |
|
|
129
|
+
| (4. Execute Scoped Verification Gate) |
|
|
130
|
+
| -- detectPolyglotStack().testCmd |
|
|
131
|
+
| -- Docker Compose / Devcontainer wrapper |
|
|
132
|
+
| | |
|
|
133
|
+
| +---------+---------+ |
|
|
134
|
+
| | PASS | FAIL |
|
|
135
|
+
| v v |
|
|
136
|
+
| (5. Security Audit) (6. Fingerprint Stderr / Flaky Verdict) |
|
|
137
|
+
| - Redact Secrets | |
|
|
138
|
+
| - Check Diff < 75KB +---> Is test QUARANTINED? (Oscillation >= 0.40) |
|
|
139
|
+
| | | | |
|
|
140
|
+
| v YES NO |
|
|
141
|
+
| (7. Rebase & PR) | | |
|
|
142
|
+
| - git rebase main v v |
|
|
143
|
+
| - gh pr create [Log Quarantined Flake] [Attempt OODA Repair Turn] |
|
|
144
|
+
| (Exit Code 8) (Max 3 Retries; Exit 4 on Exhaust) |
|
|
145
|
+
+---------------------------------------------------------------------------------------------------+
|
|
304
146
|
```
|
|
305
147
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
<details>
|
|
309
|
-
<summary><b>π¦ 2. Exit Code Registry & Troubleshooting Matrix</b></summary>
|
|
148
|
+
### 2. Polyglot Monorepo Scoped Execution Engine
|
|
149
|
+
In monorepos containing multiple languages, `resolveWorkspaceBoundary(changedFiles)` traverses directory ancestry to isolate verification to affected subprojects:
|
|
310
150
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
|
316
|
-
|
|
|
317
|
-
|
|
|
318
|
-
|
|
|
319
|
-
|
|
|
320
|
-
|
|
|
321
|
-
|
|
|
322
|
-
|
|
|
323
|
-
|
|
|
324
|
-
|
|
|
325
|
-
|
|
|
326
|
-
|
|
|
327
|
-
|
|
|
328
|
-
|
|
329
|
-
|
|
151
|
+
```
|
|
152
|
+
+---------------------------------------------------------------------------------------------------+
|
|
153
|
+
| MONOREPO BOUNDARY RESOLVER (resolveWorkspaceBoundary) |
|
|
154
|
+
| |
|
|
155
|
+
| changedFiles: ["backend/api/main.py", "cli/src/main.rs", "docs/README.md"] |
|
|
156
|
+
| | |
|
|
157
|
+
| +---> 1. Check Root Shared Triggers (openapi.yaml, docker-compose.yml, Makefile) |
|
|
158
|
+
| | -> None changed. Continue subproject isolation. |
|
|
159
|
+
| | |
|
|
160
|
+
| +---> 2. Map Files to Subproject Roots by Trigger File Traversal: |
|
|
161
|
+
| | - "backend/api/main.py" -> backend/pyproject.toml (Python Stack) |
|
|
162
|
+
| | - "cli/src/main.rs" -> cli/Cargo.toml (Rust/Cargo Stack) |
|
|
163
|
+
| | - "docs/README.md" -> (Documentation; R0 Cosmetic Risk) |
|
|
164
|
+
| | |
|
|
165
|
+
| +---> 3. Synthesize Scoped POSIX Subshell Verification Plan: |
|
|
166
|
+
| testCmd: "(cd backend && pytest) && (cd cli && cargo test --workspace)" |
|
|
167
|
+
| buildCmd: "(cd cli && cargo build)" |
|
|
168
|
+
| |
|
|
169
|
+
| Result: 100% test isolation, 0 global test thrashing, 0 git index lock collisions. |
|
|
170
|
+
+---------------------------------------------------------------------------------------------------+
|
|
171
|
+
```
|
|
330
172
|
|
|
331
|
-
|
|
332
|
-
<summary><b>π 3. Environment Variables Reference</b></summary>
|
|
173
|
+
---
|
|
333
174
|
|
|
334
|
-
|
|
175
|
+
## π οΈ CLI Command Reference (`agentctl`)
|
|
335
176
|
|
|
336
|
-
|
|
337
|
-
| :--- | :--- | :--- |
|
|
338
|
-
| `JULES_API_KEY` | Google Jules REST API key | *(none)* |
|
|
339
|
-
| `JULES_REPO` | Target GitHub Repository (`owner/repo`) | Auto-detected from `git remote` |
|
|
340
|
-
| `JULES_TIER` | Subscription tier preset (`free`, `pro`, `ultra`) | `ultra` |
|
|
341
|
-
| `JULES_DRY_RUN` | Set to `1` or `true` for dry-run simulation mode | `false` |
|
|
342
|
-
| `JULES_DAILY_BUDGET` | Custom daily session budget limit | `300` |
|
|
343
|
-
| `JULES_MAX_DIFF_KB` | Custom git diff payload limit in KB | `75` |
|
|
344
|
-
| `JULES_ALLOW_COMMAND_FILE_CHANGES` | Allow PR changes to command files (`package.json`, etc.) | `false` |
|
|
345
|
-
| `JULES_ALLOW_AGENT_RULE_CHANGES` | Allow PR changes to agent rule files (`AGENTS.md`, etc.) | `false` |
|
|
346
|
-
| `BASE_BRANCH` | Base branch for PR Audits & Merge-Base checks | `main` |
|
|
347
|
-
| `NO_COLOR` | Set to `true` to disable ANSI color output | `false` |
|
|
177
|
+
`agentctl` is the unified command-line interface for `jules-orchestrator-kit`, available via `bin/agentctl.mjs` or `npx jules-orchestrator-kit <command>`.
|
|
348
178
|
|
|
349
|
-
|
|
179
|
+
| Command | Usage | Description | Exit Codes |
|
|
180
|
+
| :--- | :--- | :--- | :--- |
|
|
181
|
+
| `dispatch` | `agentctl dispatch --title <t> --prompt <p>` | Dispatches a single task to an AI agent in an isolated worktree. | `0` (Success), `1` (Arg error), `2` (429 Rate limit), `3` (Scope deny), `4` (OODA exhausted), `5` (Diff > 75KB), `6` (Secret leak) |
|
|
182
|
+
| `gate` / `audit`| `agentctl gate --base main --json` | Runs security, secret scanning, and verification gate against current branch. | `0` (Approved), `3` (Scope violation), `5` (Diff limit), `6` (Secret leak) |
|
|
183
|
+
| `bootstrap` | `agentctl bootstrap [--force] [--json]` | Inspects an untested repository and synthesizes `.agent/config.yml` with a zero-test verification oracle (`php -l`, `compileall`, `dotnet build`, `tsc`, `smoke`). | `0` (Bootstrapped / Existing) |
|
|
184
|
+
| `review-repair`| `agentctl review-repair <pr-comments.json>`| Parses GitHub PR review comments and synthesizes actionable OODA repair tasks. | `0` (Parsed), `1` (Missing file) |
|
|
185
|
+
| `queue` | `agentctl queue` | Consumes and executes pending markdown task envelopes in `.agent/queue/`. | `0` (Complete) |
|
|
186
|
+
| `swarm` | `agentctl swarm` | Runs parallel multi-agent swarm across queued tasks with token-bucket concurrency. | `0` (Complete) |
|
|
187
|
+
| `doctor` | `agentctl doctor` | Diagnostic inspect: displays detected stack, container wrapper, test command, and daily session budget. | `0` (Healthy) |
|
|
188
|
+
| `lock` | `agentctl lock <acquire\|release\|status>`| Manages VFS mutex locks for multi-agent non-overlapping file ownership. | `0` (Locked/Released), `1` (Conflict) |
|
|
189
|
+
| `clean` | `agentctl clean` | Prunes stale git worktrees, lockfiles, and temporary ledgers. | `0` (Clean) |
|
|
190
|
+
| `init` | `agentctl init` | Scaffolds `.agent/` directory structure and default `.agent/config.yml`. | `0` (Created) |
|
|
191
|
+
| `mcp` | `agentctl mcp` | Starts stdio Model Context Protocol (MCP) server for tool integration. | `0` / Stdio stream |
|
|
192
|
+
| `version` | `agentctl version` | Outputs orchestrator kit semantic version (`v0.26.0`). | `0` |
|
|
350
193
|
|
|
351
|
-
|
|
352
|
-
<summary><b>π 4. Supported Tech Stacks & Auto-Detection Matrix</b></summary>
|
|
194
|
+
---
|
|
353
195
|
|
|
354
|
-
|
|
196
|
+
## π Universal Polyglot Support & Stack Detection
|
|
355
197
|
|
|
356
|
-
The
|
|
198
|
+
The table below illustrates the 24+ software ecosystems natively supported by `src/stack-detector.mjs`:
|
|
357
199
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
200
|
+
```
|
|
201
|
+
Ecosystems Supported:
|
|
202
|
+
βββ PHP / Laravel / WordPress (composer.json, phpunit.xml, pest.php, artisan, wp-cli.yml)
|
|
203
|
+
βββ .NET / C# / F# (*.sln, *.csproj, *.fsproj, global.json)
|
|
204
|
+
βββ Mobile / Dart / Flutter (pubspec.yaml)
|
|
205
|
+
βββ Mobile / Swift / Xcode (Package.swift)
|
|
206
|
+
βββ Mobile / React Native (app.json, react-native.config.js)
|
|
207
|
+
βββ Systems / CMake (CMakeLists.txt)
|
|
208
|
+
βββ Systems / Rust Cargo (Cargo.toml)
|
|
209
|
+
βββ Systems / Go (go.mod)
|
|
210
|
+
βββ Systems / Make (Makefile)
|
|
211
|
+
βββ Python / FastAPI / Django (pyproject.toml, requirements.txt, setup.py)
|
|
212
|
+
βββ Elixir / Phoenix (mix.exs)
|
|
213
|
+
βββ Ruby / Rails (Gemfile)
|
|
214
|
+
βββ Java / Maven (pom.xml)
|
|
215
|
+
βββ Java / Gradle (build.gradle, build.gradle.kts)
|
|
216
|
+
βββ JS / TS Workspaces (turbo.json, pnpm-workspace.yaml, nx.json)
|
|
217
|
+
βββ JS / TS Runtimes (bunfig.toml, deno.json, package.json)
|
|
218
|
+
βββ Devcontainers & Docker Compose (.devcontainer/devcontainer.json, docker-compose.yml, Dockerfile)
|
|
219
|
+
```
|
|
372
220
|
|
|
373
221
|
---
|
|
374
222
|
|
|
375
|
-
##
|
|
376
|
-
|
|
377
|
-
We welcome community contributions! Please adhere to our core engineering invariants:
|
|
223
|
+
## πΊοΈ v0.27+ Next-Gen Feature Roadmap
|
|
378
224
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
225
|
+
| Feature | Module / Command | Architectural Blueprint | Target Release |
|
|
226
|
+
| :--- | :--- | :--- | :---: |
|
|
227
|
+
| **PR Review Auto-Remediation Loop** | `agentctl review-repair` (`src/review-repair.mjs`) | Ingests GitHub PR review comments (`CHANGES_REQUESTED`), extracts line/file context, and dispatches automated OODA repair turns until reviewer comments are resolved. | **v0.27.0** *(Implemented prototype)* |
|
|
228
|
+
| **Multi-Provider Failover Router** | `createFailoverProvider` (`src/provider.mjs`) | Ordered router (`["jules", "claude-code", "local-mcp"]`) that seamlessly falls back to secondary LLMs on HTTP 429 rate limits or 5xx service unavailability. | **v0.27.0** *(Implemented prototype)* |
|
|
229
|
+
| **Telemetry & Audit Web Dashboard**| `agentctl dashboard` (`src/dashboard.mjs`) | Zero-dependency local HTTP server displaying real-time DAG execution graphs, Wilson-Score flaky test ledgers, and SHA-256 telemetry chains. | **v0.27.0** |
|
|
230
|
+
| **Cross-Language Contract Guard** | `hashCrossLanguageInterface` (`src/merge-blocks.mjs`)| Canonical SHA-256 schema hashing for OpenAPI/Protobuf specs across polyglot task dependencies in `DagExecutor`. | **v0.26.0** *(Shipped)* |
|
|
382
231
|
|
|
383
|
-
|
|
232
|
+
---
|
|
384
233
|
|
|
385
|
-
|
|
386
|
-
# Clone the repository
|
|
387
|
-
git clone https://github.com/FullThrottle83/jules-orchestrator-kit.git
|
|
388
|
-
cd jules-orchestrator-kit
|
|
234
|
+
## π Recipes, Documentation & Prior Art
|
|
389
235
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
236
|
+
- [**Universal Polyglot Architecture & Zero-Test Specification**](./docs/UNIVERSAL_POLYGLOT_ARCHITECTURE.md) β Comprehensive technical report on boundary resolution, OODA math, and B2B workflows.
|
|
237
|
+
- [**Examples & Task Envelope Recipes**](./EXAMPLES.md) β Production YAML and Markdown task envelopes.
|
|
238
|
+
- [**Adversarial Security Audit Phase 4 Report**](./docs/AUDIT_REPORT.md) β CWE-77, CWE-1321, and CWE-183 security hardening analysis.
|
|
239
|
+
- [**Changelog**](./CHANGELOG.md) β Full release history and migration guides.
|
|
394
240
|
|
|
395
241
|
---
|
|
396
242
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
243
|
+
<div align="center">
|
|
244
|
+
<p><b>jules-orchestrator-kit</b> β’ Built with zero external dependencies for Google Jules and enterprise AI agent swarms.</p>
|
|
245
|
+
</div>
|
package/bin/agentctl.mjs
CHANGED
|
@@ -14,7 +14,7 @@ const command = args[0];
|
|
|
14
14
|
|
|
15
15
|
function printHelp() {
|
|
16
16
|
console.log(`
|
|
17
|
-
π agentctl v0.26.
|
|
17
|
+
π agentctl v0.26.1 β Universal Agent Orchestrator & Safety Gatekeeper
|
|
18
18
|
|
|
19
19
|
Usage: agentctl <command> [options]
|
|
20
20
|
|
|
@@ -45,7 +45,7 @@ async function main() {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
if (command === "version" || command === "--version" || command === "-v") {
|
|
48
|
-
console.log("agentctl v0.26.
|
|
48
|
+
console.log("agentctl v0.26.1");
|
|
49
49
|
process.exit(0);
|
|
50
50
|
}
|
|
51
51
|
|
package/package.json
CHANGED
package/src/merge-blocks.mjs
CHANGED
|
@@ -30,7 +30,7 @@ function sortKeysRecursive(obj) {
|
|
|
30
30
|
/**
|
|
31
31
|
* Computes canonical SHA-256 fingerprint for cross-language API contracts (OpenAPI/JSON/YAML).
|
|
32
32
|
*/
|
|
33
|
-
export function hashCrossLanguageInterface(taskId, outputFile, content = "",
|
|
33
|
+
export function hashCrossLanguageInterface(taskId, outputFile, content = "", _schemaType = "json") {
|
|
34
34
|
let cleaned = content;
|
|
35
35
|
// Strip single-line comments
|
|
36
36
|
cleaned = cleaned.replace(/^\s*\/\/.*$/gm, "").replace(/^\s*#.*$/gm, "");
|