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 CHANGED
@@ -2,398 +2,244 @@
2
2
 
3
3
  # πŸš€ jules-orchestrator-kit
4
4
 
5
- ### High-Volume Autonomous AI Agent Orchestration Engine for Google Jules
5
+ ### Universal Autonomous AI Agent Orchestration Kernel for Google Jules
6
6
 
7
7
  [![Jules PR Audit](https://github.com/FullThrottle83/jules-orchestrator-kit/actions/workflows/jules-audit.yml/badge.svg)](https://github.com/FullThrottle83/jules-orchestrator-kit/actions/workflows/jules-audit.yml)
8
8
  [![npm version](https://img.shields.io/npm/v/jules-orchestrator-kit.svg)](https://www.npmjs.com/package/jules-orchestrator-kit)
9
9
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
10
10
  [![Node.js Version](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen.svg)](https://nodejs.org)
11
11
  [![Zero Dependencies](https://img.shields.io/badge/dependencies-0%20native-blue.svg)](https://nodejs.org)
12
+ [![Polyglot Stacks](https://img.shields.io/badge/polyglot--stacks-24%2B-8A2BE2.svg)](#-universal-polyglot-support--stack-detection)
12
13
 
13
14
  <p align="center">
14
- <b>Zero-dependency safety kernel and high-throughput orchestration engine for autonomous AI agent swarms.</b><br/>
15
- Built specifically to execute 300+ daily agent sessions and parallel worktree swarms safely on native Node.js 20+ ESM.
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-minute-quickstart">⚑ Quickstart</a> β€’
20
- <a href="#-why-jules-orchestrator-kit">🎯 Why Kit?</a> β€’
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 Commands</a> β€’
23
- <a href="./EXAMPLES.md">πŸ“– Recipes & Examples</a>
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
- <p align="center">
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
- ## 🧭 Fast-Track Guide (Choose Your Path)
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
- ## ⚑ 2-Minute Quickstart
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
- # 3. Run the 4-phase security & verification gatekeeper
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
- > [!NOTE]
69
- > **Looking for production deployment patterns?**
70
- > Check out [**EXAMPLES.md**](./EXAMPLES.md) for 6 real-world recipes (Nightly TODO Scanner, Composite CI Action, Multi-Worktree Swarms, OODA Auto-Fix, MCP IDE setup, and Specialist Rosters).
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
- ## 🎯 Why jules-orchestrator-kit?
55
+ ## πŸ“Š Feature Comparison Matrix
75
56
 
76
- Whether you are dispatching your first automated coding task or managing high-throughput CI/CD swarms across large engineering teams, `jules-orchestrator-kit` provides total operational safety:
77
-
78
- | Feature | 🐣 For Rookies & Beginners | πŸ› οΈ For Senior Developers & Infrastructure Engineers |
79
- | :--- | :--- | :--- |
80
- | **Safety First** | Never breaks `main` branch or pushes failing code. | 4-Phase Safety Gatekeeper fails closed on scope drift, high entropy secrets, or test regressions. |
81
- | **Token Budget Protection** | Prevents runaway loops from burning API quotas. | Sliding-window OODA thrash detector ($A \rightarrow B \rightarrow A \rightarrow B$) halts non-convergent repair cycles automatically. |
82
- | **Zero Setup Hassle** | Works out of the box with standard `npm test`. | **Zero External Runtime Dependencies** (`node:fs`, `node:path`, `node:crypto`, `node:child_process`). |
83
- | **Multi-Agent Swarms** | Run multiple tasks simultaneously without conflict. | Deterministic VFS mutex and 3-way structural merge engine resolve parallel worktree changes cleanly. |
84
- | **IDE & Tooling** | Seamlessly connects to your favorite editor. | Native Model Context Protocol (MCP) server over memory-bounded stdio streams. |
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
- ## πŸ›οΈ System Architecture & Visual Diagrams
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
- </details>
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
- npx agentctl mcp
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
- #### MCP Tool Registry Exposed:
209
- - `dispatch_jules_task`: Dispatch autonomous coding tasks directly from your LLM prompt.
210
- - `audit_jules_gate`: Execute the 4-phase safety gate against the workspace.
211
- - `check_risk_tier`: Classify workspace changes into Risk Tiers (R0 Cosmetic to R3 Restricted).
212
- - `get_jules_status`: Fetch real-time status of active, pending, and completed tasks.
213
- - `telemetry_tail`: Query last N real-time telemetry events from the SHA-256 hash spine.
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
- Specialized prompt presets enforce payload limits (< 75 KB) and domain guardrails out of the box:
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
- | Preset | Role & Domain | Primary Focus |
249
- | :--- | :--- | :--- |
250
- | **`Overseer.md`** | **Architect & Supervisor** | System-wide refactoring, linearizable state, and structural integrity. |
251
- | **`Bolt.md`** | **Performance Engineer** | Bottleneck elimination, streaming optimization, and low-latency execution. |
252
- | **`Sentinel.md`** | **Security Auditor** | Vulnerability patching, secret sanitization, and TOCTOU defense. |
253
- | **`Janitor.md`** | **Technical Debt & Cleanup** | Dead code elimination, unused import pruning, and zero-dependency compliance. |
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
- # Example: Dispatch a cleanup task using the Janitor preset
257
- npx agentctl dispatch \
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
- ## ⚑ GitHub Actions Composite Action (`.github/actions/setup-jules`)
111
+ ## πŸ›οΈ System Architecture & Visual Diagrams
264
112
 
265
- Integrate `jules-orchestrator-kit` into any GitHub Actions workflow with 3 lines of YAML:
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
- ## πŸ“– Deep Reference Manuals & Technical Specs
282
-
283
- <details>
284
- <summary><b>πŸ“ 1. Configuration Reference (.agent/jules.yml)</b></summary>
285
-
286
- <br/>
287
-
288
- Auto-generated by `agentctl init` at the root of your project:
289
-
290
- ```yaml
291
- version: 2
292
- tier: "pro" # Options: free, pro, ultra (default: ultra)
293
- test_cmd: "npm test"
294
- build_cmd: "npm run build"
295
- forbidden_paths:
296
- - ".github/"
297
- - "package.json"
298
- - ".agent/jules.yml"
299
- allow_paths: []
300
- limits:
301
- dailyTasks: 300
302
- repairAttempts: 3
303
- diffKb: 75
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
- </details>
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
- <br/>
312
-
313
- Standardized exit codes enforced across all CLI utilities and CI pipelines:
314
-
315
- | Exit Code | Classification | Description & Immediate Remediation Action |
316
- | :---: | :--- | :--- |
317
- | `0` | **Success** | Task completed cleanly; PR opened or verification passed. |
318
- | `1` | **Pre-Dispatch / Arg Error** | Invalid arguments, prompt > 50 KB, or pre-dispatch validation error. |
319
- | `2` | **API / Network Failure** | Jules API rate-limit (HTTP 429), `FAILED_PRECONDITION` quota, or timeout. |
320
- | `3` | **Scope Violation** | Attempted modification of restricted files (`.github/`, command files, agent rules). |
321
- | `4` | **OODA Exhausted / Thrash** | Verification suite failed after 3 repair attempts or hit deterministic regression. |
322
- | `5` | **Diff Payload Limit** | Post-change git diff exceeds payload budget (`limits.diffKb`, default 75 KB). |
323
- | `6` | **Secret Detected** | High-confidence secret or private key detected in patch diff (Shannon entropy > 3.6 bits). |
324
- | `7` | **Budget Exhausted** | Daily task session quota limit reached (`limits.dailyTasks`, default 300). |
325
- | `8` | **FLAKY_QUARANTINE** | Statistical test flakiness detected (oscillation >= 0.4, Wilson CI); OODA repair suppressed. |
326
- | `124` | **Execution Timeout** | Subprocess execution exceeded hard timeout limit (default 10 minutes). |
327
- | `188` | **ERR_UNMOCKED_NET** | Unmocked outbound HTTP/HTTPS egress intercepted by hermetic network guard. |
328
-
329
- </details>
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
- <details>
332
- <summary><b>πŸ” 3. Environment Variables Reference</b></summary>
173
+ ---
333
174
 
334
- <br/>
175
+ ## πŸ› οΈ CLI Command Reference (`agentctl`)
335
176
 
336
- | Variable | Description | Default |
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
- </details>
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
- <details>
352
- <summary><b>🌐 4. Supported Tech Stacks & Auto-Detection Matrix</b></summary>
194
+ ---
353
195
 
354
- <br/>
196
+ ## 🌐 Universal Polyglot Support & Stack Detection
355
197
 
356
- The orchestrator automatically infers verification and build commands across ecosystems:
198
+ The table below illustrates the 24+ software ecosystems natively supported by `src/stack-detector.mjs`:
357
199
 
358
- | Stack / Ecosystem | Manifest File | Inferred Test Command | Inferred Build Command |
359
- | :--- | :--- | :--- | :--- |
360
- | **Turborepo** | `turbo.json` | `npx turbo run test` | `npx turbo run build` |
361
- | **pnpm Workspace** | `pnpm-workspace.yaml` | `pnpm test` | `pnpm build` |
362
- | **Nx Workspace** | `nx.json` | `npx nx run-many -t test` | `npx nx run-many -t build` |
363
- | **JavaScript / TypeScript** | `package.json` | `npm test` | `npm run build` |
364
- | **Rust** | `Cargo.toml` | `cargo test --workspace` | `cargo build` |
365
- | **Go** | `go.mod` | `go test ./...` | `go build ./...` |
366
- | **Python** | `pyproject.toml` | `pytest` | *(none)* |
367
- | **Bun / Deno** | `bunfig.toml` / `deno.json` | `bun test` / `deno test` | `bun run build` |
368
- | **Elixir / Ruby** | `mix.exs` / `Gemfile` | `mix test` / `rake test` | *(standard build)* |
369
- | **Java / C / C++** | `pom.xml` / `Makefile` | `mvn test` / `make test` | `mvn compile` / `make` |
370
-
371
- </details>
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
- ## 🀝 Contributing & Standards
376
-
377
- We welcome community contributions! Please adhere to our core engineering invariants:
223
+ ## πŸ—ΊοΈ v0.27+ Next-Gen Feature Roadmap
378
224
 
379
- 1. **Zero External Runtime Dependencies**: Use ONLY native Node.js ESM built-in modules (`node:fs`, `node:path`, `node:crypto`, `node:child_process`, `node:os`).
380
- 2. **100% Verification Suite**: All test suites must pass cleanly with 0 errors.
381
- 3. **Cross-Platform Compatibility**: Always normalize Windows backslashes (`\`) to POSIX slashes (`/`).
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
- ### Running Tests Locally
232
+ ---
384
233
 
385
- ```bash
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
- # Run ESLint & node unit test suite (100% zero external runtime deps)
391
- npm run lint
392
- npm test
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
- ## πŸ“„ License
398
-
399
- Distributed under the [MIT License](LICENSE).
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.0 β€” Universal Agent Orchestrator & Safety Gatekeeper
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.0");
48
+ console.log("agentctl v0.26.1");
49
49
  process.exit(0);
50
50
  }
51
51
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jules-orchestrator-kit",
3
- "version": "0.26.0",
3
+ "version": "0.26.1",
4
4
  "description": "Orchestration kit for running Google Jules autonomous agents.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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 = "", schemaType = "json") {
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, "");