simplicio-prompt 1.5.0__tar.gz

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Wesley Simplicio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,514 @@
1
+ Metadata-Version: 2.4
2
+ Name: simplicio-prompt
3
+ Version: 1.5.0
4
+ Summary: Tuple-Space + Yool safe-speed runtime kernel: lazy 1,000,000+ subagent batch_spawn, adaptive lane concurrency, and a dependency-free OpenAI-compatible provider client for real subagents on DeepSeek / MiMo / OpenRouter / local LLMs.
5
+ Author: Wesley Simplicio
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/wesleysimplicio/simplicio-prompt
8
+ Project-URL: Repository, https://github.com/wesleysimplicio/simplicio-prompt
9
+ Project-URL: Issues, https://github.com/wesleysimplicio/simplicio-prompt/issues
10
+ Keywords: claude,subagents,tuple-space,yool,hamt,runtime,ai-agents,prompt,deepseek,mimo,openrouter,ollama,llm
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Dynamic: license-file
26
+
27
+ <p align="center">
28
+ <img src="docs/assets/simplicio-prompt-hero.jpg" alt="simplicio-prompt — AI with 1,000,000+ subagents / IA com 1.000.000+ subagentes" width="100%" />
29
+ </p>
30
+
31
+ # simplicio-prompt
32
+
33
+ > Capability-addressing pattern: **yool** (atomic action) wrapped in **tuples** (addressable envelopes) over an **HAMT** (Hash Array Mapped Trie) registry, coordinated through a **tuple-space** with **content-addressable receipts**.
34
+
35
+ This repo is the canonical spec. Vendor it into any project that wants the pattern.
36
+
37
+ ## What's new in 1.5
38
+
39
+ More features, more reach, and a tighter runtime:
40
+
41
+ - **Now on PyPI** — `pip install simplicio-prompt` ships the dependency-free
42
+ Python kernel and a `simplicio-subagents` console command, alongside the
43
+ existing npm package.
44
+ - **Real subagents on any model / provider** — DeepSeek, MiMo, OpenRouter, or a
45
+ free local LLM (Ollama / vLLM / LM Studio) all run through the same
46
+ `--provider` / `--model` flags, defaulting to a 600-subagent fan-out.
47
+ - **First-class observability** — `PromptFanout` adapters plus per-lane
48
+ token/cost accounting, circuit-breaker state, and cache stats in every
49
+ snapshot.
50
+ - **Always-on invocation** — a `UserPromptSubmit` hook routes every message
51
+ through the runtime with no trigger keyword, now including a Gemini CLI target.
52
+ - **One-command test suite** — `npm test` runs both the Node CLI/hook tests and
53
+ the full Python kernel suite (44 tests) in a single pass.
54
+
55
+ ## Highlight: 1,000,000+ subagents, zero enumeration
56
+
57
+ > **`simplicio-prompt` scales to 1,000,000+ subagents in a single task without
58
+ > enumerating them, without spawning a million processes, and without melting
59
+ > your provider quota.**
60
+
61
+ It does this with `batch_spawn(depth, branching, compression_threshold)` — a
62
+ lazy hierarchical fan-out over a Hilbert-indexed tuple graph. The kernel stores
63
+ **virtual-agent counts and content-addressable receipts** instead of a flat
64
+ list of agents, so the cost of representing the work is logarithmic, not
65
+ linear.
66
+
67
+ - **`depth=4, branching=32` ⇒ 1,048,576 subagents** materialized only when a
68
+ tuple is actually visited.
69
+ - `2,833.75x` faster scale representation than a flat instruction flow
70
+ (V2 benchmark).
71
+ - `26.93x` faster active execution than naive sequential fan-out.
72
+ - `compress_token` + `prune_idle` keep inactive subagents as auditable tokens,
73
+ so a million-subagent task still fits in a small working set.
74
+ - `LaneWorkerPool` enforces bounded per-lane concurrency
75
+ (`YOOL_TUPLE_LANE_CONCURRENCY=32`, `YOOL_TUPLE_MAX_LANE_CONCURRENCY=64`),
76
+ so a million-subagent graph never turns into a million concurrent calls.
77
+ - Provider safety stays intact: receipt/input cache, jittered backoff,
78
+ circuit breakers, and small-task batching apply at the million-subagent
79
+ scale exactly as they do at one.
80
+ - Observability is first-class: snapshots include per-lane token/cost usage,
81
+ circuit breaker state, cache stats, and lane worker success/failure metrics.
82
+
83
+ The output shape stays auditable at any scale:
84
+
85
+ ```text
86
+ [Tuple Space Snapshot]
87
+ [Active Agents/Subagents] ← materialized, small
88
+ [Total Agents/Subagents] ← virtual, up to 1,000,000+
89
+ [Proximo Yool a executar]
90
+ [Resultado parcial]
91
+ ```
92
+
93
+ See [`prompts/agent-runtime-execution-prompt.md`](prompts/agent-runtime-execution-prompt.md)
94
+ and [`kernel/yool_tuple_kernel.py`](kernel/yool_tuple_kernel.py) for the
95
+ canonical `batch_spawn` contract.
96
+
97
+ ## Real subagents — any model, any provider
98
+
99
+ > **Point `simplicio-prompt` at any OpenAI-compatible provider and one task fans
100
+ > out across 600 real subagents by default** — actual LLM calls, not placeholders,
101
+ > through the same safe-speed runtime. **The provider doesn't matter**: DeepSeek,
102
+ > MiMo, OpenRouter (any model it gateways), a free local LLM (Ollama / vLLM /
103
+ > LM Studio), or any custom endpoint all work through the same `--provider` /
104
+ > `--model` flags.
105
+ >
106
+ > Verified live on OpenRouter (`deepseek/deepseek-chat`): **600/600 subagents, 0
107
+ > failures, ~103s, ≈$0.045** at illustrative pricing on a single task. Change
108
+ > `--subagents` to run any count.
109
+
110
+ `batch_spawn` represents subagents *virtually*. To make them **real**, the kernel
111
+ ships a dependency-free, OpenAI-compatible provider client and a fan-out runtime
112
+ that drains N materialized subagent tuples through `LaneWorkerPool` — so every
113
+ real call inherits the same guardrails (bounded per-lane concurrency, the
114
+ receipt/input cache that de-duplicates identical prompts, jittered backoff, and a
115
+ provider circuit breaker).
116
+
117
+ - [`kernel/providers.py`](kernel/providers.py) — `LLMProvider` + presets for
118
+ `deepseek`, `mimo`, `local`/`ollama`, and a generic OpenAI-compatible config,
119
+ with per-call token usage and **cost accounting**.
120
+ - [`kernel/subagent_runtime.py`](kernel/subagent_runtime.py) — `SubagentRuntime`
121
+ fans a task across N real subagents and aggregates results, tokens, and cost.
122
+
123
+ Run 600 **real** subagents on DeepSeek:
124
+
125
+ ```bash
126
+ export DEEPSEEK_API_KEY=sk-...
127
+ python kernel/subagent_runtime.py --provider deepseek --subagents 600 \
128
+ --task "Brainstorm edge cases and tests for a distributed rate limiter"
129
+
130
+ # offline cost projection / demo — no key, no network:
131
+ python kernel/subagent_runtime.py --provider deepseek --subagents 600 \
132
+ --task "..." --dry-run
133
+
134
+ # other providers
135
+ python kernel/subagent_runtime.py --provider mimo --subagents 600 --task "..."
136
+ python kernel/subagent_runtime.py --provider local --subagents 50 --task "..." # Ollama
137
+ ```
138
+
139
+ Or programmatically:
140
+
141
+ ```python
142
+ from kernel.providers import resolve_provider_config, LLMProvider
143
+ from kernel.subagent_runtime import SubagentRuntime
144
+
145
+ provider = LLMProvider(resolve_provider_config("deepseek"))
146
+ report = SubagentRuntime(provider).run("Audit this module", subagents=600)
147
+ print(report.format_summary()) # completed/failed, tokens, total cost in USD
148
+ ```
149
+
150
+ ### Provider configuration
151
+
152
+ | Preset | Default base URL | API key env | Notes |
153
+ |---|---|---|---|
154
+ | `deepseek` | `https://api.deepseek.com/v1` | `DEEPSEEK_API_KEY` | cheap cloud, OpenAI-compatible |
155
+ | `mimo` | `https://api.mimo.ai/v1` | `MIMO_API_KEY` | set `MIMO_BASE_URL` to your endpoint |
156
+ | `openrouter` | `https://openrouter.ai/api/v1` | `OPENROUTER_API_KEY` | OpenAI-compatible gateway; set `--model` (e.g. `deepseek/deepseek-chat`) |
157
+ | `local` / `ollama` | `http://localhost:11434/v1` | none | free/offline (Ollama, vLLM, LM Studio) |
158
+ | *(any other id)* | `SIMPLICIO_LLM_BASE_URL` | `SIMPLICIO_LLM_API_KEY` | generic OpenAI-compatible |
159
+
160
+ Per-provider env overrides (example for DeepSeek): `DEEPSEEK_BASE_URL`,
161
+ `DEEPSEEK_MODEL`, `DEEPSEEK_PROMPT_COST_PER_MTOK`,
162
+ `DEEPSEEK_COMPLETION_COST_PER_MTOK`. **Cost defaults are illustrative** — set the
163
+ `*_COST_PER_MTOK` vars to your live contract pricing (e.g. `0.003`) so the
164
+ reported `cost_usd` matches your bill.
165
+
166
+ ## Acknowledgement
167
+
168
+ Special thanks to [Jesse Daniel Brown, PhD](https://github.com/JesseBrown1980), my mentor, a California, USA native and author of 100+ scientific articles. His humanitarian and educational perspective on programming, AI, and scientific work helped reinforce the mission behind this repository: practical agent systems that increase human capability through safer, more auditable automation.
169
+
170
+ ## V2 safe-speed infographics
171
+
172
+ ### English
173
+ ![YOOL V2 Safe-Speed Runtime infographic in English](docs/assets/yool-v2-safe-speed-infographic-en.png)
174
+
175
+ ### Portuguese Brazil
176
+ ![YOOL V2 Safe-Speed Runtime infographic in Portuguese Brazil](docs/assets/yool-v2-safe-speed-infographic-pt.png)
177
+
178
+ ### Infographic Explanation
179
+
180
+ The infographics compare a loose prompt flow against the `simplicio-prompt` V2
181
+ safe-speed runtime. The left side shows the old failure modes: flat agent lists,
182
+ sequential work, repeated provider calls, no cache, fixed concurrency, retry
183
+ storms, large LLM context, and weak audit trails.
184
+
185
+ The right side shows the V2 path: tuple-space routing, lazy `batch_spawn`,
186
+ adaptive `LaneWorkerPool`, receipt/input cache, small-task batching, circuit
187
+ breakers, backoff with jitter, context compression, local yool routing, and
188
+ speculative execution only for idempotent work. The practical result is faster
189
+ delivery through avoided repeat work and safer provider behavior, not through
190
+ unbounded calls.
191
+
192
+ Measured V2 benchmark highlights:
193
+
194
+ - Scale representation: `2,833.75x` faster than a normal instruction flow.
195
+ - Active execution: `26.93x` faster than normal sequential execution.
196
+ - Cache: `4x` fewer provider calls, a `75%` reduction.
197
+ - Batching: `32x` fewer small-task calls, a `96.88%` reduction.
198
+ - Circuit breaker: `64x` fewer failure attempts, a `98.44%` reduction.
199
+ - Token economy: `76.32%` estimated savings through context compression.
200
+
201
+ ## Quick read
202
+
203
+ - `YOOL_TUPLE_HAMT.md` - full spec with diagrams, algorithms, examples, guardrails.
204
+ - `kernel/yool_tuple_kernel.py` - reference Python kernel with lazy `batch_spawn`,
205
+ `compress_token`, hookwall, indexed tuple-space scans, and lane worker fan-out.
206
+ - `prompts/agent-runtime-execution-prompt.md` - ready prompt for Claude, Codex,
207
+ Hermes, and other coding agents.
208
+ - `examples/` - runnable minimal implementations (Python, Node).
209
+ - `guardrails/` - CPU throttle + disk GC reference implementations.
210
+ - `adopters.md` - projects that vendor this spec.
211
+
212
+ ## Install via npm
213
+
214
+ The repo ships as an npm package and as a **multi-IDE plugin**. Use it without
215
+ cloning:
216
+
217
+ ```bash
218
+ # print the full prompt
219
+ npx simplicio-prompt
220
+
221
+ # print only the `## Prompt` body (no surrounding markdown)
222
+ npx simplicio-prompt --raw
223
+
224
+ # install as a plugin for one (or many) coding agents
225
+ npx simplicio-prompt --target claude-code # → CLAUDE.md
226
+ npx simplicio-prompt --target codex # → AGENTS.md
227
+ npx simplicio-prompt --target hermes # → AGENTS.md
228
+ npx simplicio-prompt --target opencode # → AGENTS.md (alias: openclaw)
229
+ npx simplicio-prompt --target cursor # → .cursor/rules/*.mdc + .cursorrules
230
+ npx simplicio-prompt --target copilot # → .github/copilot-instructions.md
231
+ npx simplicio-prompt --target cline # → .clinerules/simplicio-prompt.md
232
+ npx simplicio-prompt --target aider # → CONVENTIONS.md
233
+ npx simplicio-prompt --target gemini # → GEMINI.md
234
+ npx simplicio-prompt --install-all # → every target above
235
+
236
+ # inspect / discover
237
+ npx simplicio-prompt --list-targets
238
+ ```
239
+
240
+ Or add it as a dependency and consume it programmatically:
241
+
242
+ ```bash
243
+ npm install simplicio-prompt
244
+ ```
245
+
246
+ ```js
247
+ import {
248
+ getPrompt,
249
+ getPromptSection,
250
+ getPromptPath,
251
+ getTargets,
252
+ findTarget,
253
+ } from "simplicio-prompt";
254
+
255
+ const fullMarkdown = getPrompt(); // entire prompt file
256
+ const promptOnly = getPromptSection(); // just the `## Prompt` body
257
+ const filePath = getPromptPath(); // absolute path on disk
258
+ const targets = getTargets(); // multi-IDE plugin target registry
259
+ const cursor = findTarget("cursor");
260
+ ```
261
+
262
+ Every install wraps the prompt in `<!-- simplicio-prompt:start -->` /
263
+ `<!-- simplicio-prompt:end -->` markers so reinstalling updates the block in
264
+ place instead of duplicating it. The Cursor `.mdc` rule and any new directory
265
+ (`.cursor/rules/`, `.github/`, `.clinerules/`) are created automatically.
266
+
267
+ ## Install via PyPI (Python)
268
+
269
+ The reference kernel ships as a **dependency-free** Python package, so you can
270
+ run real subagents on any OpenAI-compatible provider without cloning the repo:
271
+
272
+ ```bash
273
+ pip install simplicio-prompt
274
+ ```
275
+
276
+ ```python
277
+ from kernel.providers import resolve_provider_config, LLMProvider
278
+ from kernel.subagent_runtime import SubagentRuntime
279
+ from kernel.yool_tuple_kernel import build_default_space
280
+
281
+ # 1,000,000+ subagents represented lazily, materialized only when visited
282
+ space, root = build_default_space()
283
+ receipt = space.batch_spawn(root, "codex_worker", depth=4, branching=32)
284
+ print(receipt.virtual_agents) # 1048576
285
+
286
+ # real subagents on any provider (DeepSeek / MiMo / OpenRouter / local)
287
+ provider = LLMProvider(resolve_provider_config("deepseek"))
288
+ report = SubagentRuntime(provider).run("audit this module", subagents=600)
289
+ print(report.format_summary()) # completed/failed, tokens, total cost in USD
290
+ ```
291
+
292
+ The install also exposes a console entry point for offline cost projection and
293
+ live fan-out:
294
+
295
+ ```bash
296
+ # offline cost projection — no API key, no network
297
+ simplicio-subagents --provider deepseek --subagents 600 --task "..." --dry-run
298
+ ```
299
+
300
+ ### Multi-IDE plugin matrix
301
+
302
+ | Target id | IDE / agent | Files written |
303
+ |---|---|---|
304
+ | `claude-code` | Anthropic Claude Code | `CLAUDE.md` |
305
+ | `codex` | OpenAI Codex CLI | `AGENTS.md` |
306
+ | `hermes` | Nous Research Hermes | `AGENTS.md` |
307
+ | `opencode` (alias `openclaw`) | OpenCode / OpenClaw | `AGENTS.md` |
308
+ | `cursor` | Cursor IDE | `.cursor/rules/simplicio-prompt.mdc`, `.cursorrules` |
309
+ | `copilot` (alias `github-copilot`) | GitHub Copilot | `.github/copilot-instructions.md` |
310
+ | `cline` | Cline (VS Code) | `.clinerules/simplicio-prompt.md` |
311
+ | `aider` | Aider | `CONVENTIONS.md` |
312
+ | `gemini` (alias `gemini-cli`) | Google Gemini CLI | `GEMINI.md` |
313
+
314
+ ### Auto-invocation per agent
315
+
316
+ The runtime is meant to be **always-on** — every user message is treated as the
317
+ task and routed through the runtime, with no trigger keyword. How that
318
+ invocation is wired depends on the agent:
319
+
320
+ | Agent | Invocation mechanism | Always-on? |
321
+ |---|---|---|
322
+ | **Claude Code** | `UserPromptSubmit` **hook** (`plugins/claude-code/hooks/`) injects the runtime contract on every prompt; plus a `simplicio-runtime` **skill** and slash commands | yes, programmatic |
323
+ | Codex / Hermes / OpenCode | `AGENTS.md` loaded as standing instructions | yes (context file) |
324
+ | Cursor | `.cursor/rules/*.mdc` with `alwaysApply: true` | yes (always-apply rule) |
325
+ | GitHub Copilot | `.github/copilot-instructions.md` | yes (context file) |
326
+ | Cline | `.clinerules/simplicio-prompt.md` | yes (context file) |
327
+ | Aider | `CONVENTIONS.md` | yes (context file) |
328
+ | Gemini CLI | `GEMINI.md` loaded every turn | yes (context file) |
329
+
330
+ A true prompt-submit *hook* (inject-on-every-prompt with programmatic
331
+ stand-down) exists only in Claude Code. For the other agents, the always-applied
332
+ context file **is** the invocation — it is read on every turn, so the contract is
333
+ always present. All of them honor in-message stand-down phrases ("stop",
334
+ "cancel", "exit runtime", "ignore simplicio").
335
+
336
+ ### Claude Code plugin
337
+
338
+ `plugins/claude-code/` is a full Claude Code plugin: drop it into
339
+ `~/.claude/plugins/simplicio-prompt/` (or your project's `.claude/plugins/`) to
340
+ get an always-on hook, three slash commands, and a runtime skill:
341
+
342
+ - **`UserPromptSubmit` hook** (`hooks/hooks.json` → `hooks/user-prompt-submit.mjs`)
343
+ — injects the runtime contract (`hooks/runtime-directive.md`) on every prompt,
344
+ unless the prompt is an explicit stand-down. This is the always-on invocation.
345
+ - `/simplicio <task>` — run the next task through the Tuple-Space + Yool runtime.
346
+ - `/simplicio-install <target>` — install the runtime contract into the
347
+ current repo (`claude-code`, `codex`, `cursor`, `copilot`, `gemini`, `all`, …).
348
+ - `/simplicio-status on|off|<field>:on` — toggle the opt-in status output.
349
+ - `simplicio-runtime` skill — auto-activates in repos that vendor the spec.
350
+
351
+ ### Legacy `--install`
352
+
353
+ The original single-file installer still works for backwards compatibility:
354
+
355
+ ```bash
356
+ npx simplicio-prompt --install CLAUDE.md
357
+ npx simplicio-prompt --install AGENTS.md
358
+ npx simplicio-prompt --install .cursorrules
359
+ ```
360
+
361
+ ## Integration adapter
362
+
363
+ For orchestration repos that want the runtime without copying tuple boilerplate,
364
+ use the Python adapter:
365
+
366
+ ```python
367
+ from examples.python.prompt_fanout import PromptFanout
368
+
369
+ fanout = PromptFanout(repo="my-service", authority="simplicio-sprint")
370
+ root, receipt = fanout.spawn_task(
371
+ "review checkout edge cases",
372
+ mapper_context={"target": "src/checkout.ts"},
373
+ depth=2,
374
+ branching=8,
375
+ )
376
+ fanout.record_tokens("analysis", prompt_tokens=1200, completion_tokens=300, cost_usd=0.02)
377
+ print(receipt.virtual_agents)
378
+ print(fanout.snapshot()["token_usage"])
379
+ ```
380
+
381
+ `simplicio-dev-cli` can use the same adapter for internal verification
382
+ reasoning when it already has structured mapper context.
383
+
384
+ ## How to use the prompt
385
+
386
+ Use `simplicio-prompt` as a canonical execution prompt for coding agents such as
387
+ Claude, Codex, Hermes, Cursor, Cline, or any assistant that can read repository
388
+ instructions.
389
+
390
+ 1. Run `npx simplicio-prompt --install CLAUDE.md` (or paste the `## Prompt`
391
+ section from [`prompts/agent-runtime-execution-prompt.md`](prompts/agent-runtime-execution-prompt.md)
392
+ into `AGENTS.md`, `CLAUDE.md`, `.cursorrules`, or a custom system prompt).
393
+ 2. In the target repository, just ask for work in your own words. **You do not
394
+ need to start the message with `Implement`** — any user input (a sentence, a
395
+ bug description, a code snippet, a one-word request) is treated as the task
396
+ `X` and routed through the same runtime. The only opt-outs are explicit
397
+ stand-down phrases like "stop", "cancel", "exit runtime".
398
+ 3. The agent will read the canonical files listed in the prompt, decompose the
399
+ task into a Hilbert-indexed tuple graph, create a root tuple, route active
400
+ work through tuple-space primitives, and use `LaneWorkerPool` plus the V2
401
+ safe-speed controls.
402
+ 4. Status output is **opt-in** (default: silent). Enable with
403
+ `YOOL_TUPLE_STATUS=true` (or `status_output=true` runtime flag). When on,
404
+ the agent returns this shape:
405
+
406
+ ```text
407
+ [Tuple Space Snapshot]
408
+ [Active Agents/Subagents]
409
+ [Total Agents/Subagents]
410
+ [Next Yool to Execute]
411
+ [Partial Result]
412
+ ```
413
+
414
+ Per-field toggles (default `false`): `YOOL_TUPLE_STATUS_SNAPSHOT`,
415
+ `YOOL_TUPLE_STATUS_ACTIVE`, `YOOL_TUPLE_STATUS_TOTAL`,
416
+ `YOOL_TUPLE_STATUS_NEXT`, `YOOL_TUPLE_STATUS_PARTIAL`.
417
+
418
+ For high-throughput local runs, set the runtime environment variables before
419
+ starting the agent or scripts:
420
+
421
+ ```powershell
422
+ $env:YOOL_TUPLE_LANE_CONCURRENCY="32"
423
+ $env:YOOL_TUPLE_MAX_LANE_CONCURRENCY="64"
424
+ $env:YOOL_TUPLE_CPU_QUOTA_PCT="95"
425
+ $env:YOOL_TUPLE_QUEUE_MAXSIZE="8192"
426
+ $env:YOOL_TUPLE_COMPRESSION_THRESHOLD="1024"
427
+ $env:YOOL_TUPLE_CACHE_MAX_ENTRIES="16384"
428
+ $env:YOOL_TUPLE_CACHE_TTL_S="3600"
429
+ $env:YOOL_TUPLE_API_MAX_RETRIES="3"
430
+ $env:YOOL_TUPLE_API_BACKOFF_BASE_MS="100"
431
+ $env:YOOL_TUPLE_API_BACKOFF_MAX_MS="5000"
432
+ $env:YOOL_TUPLE_CIRCUIT_FAILURE_THRESHOLD="5"
433
+ $env:YOOL_TUPLE_CIRCUIT_COOLDOWN_S="30"
434
+ $env:YOOL_TUPLE_BATCH_SMALL_TASK_SIZE="32"
435
+ $env:YOOL_TUPLE_CONTEXT_COMPRESSION_CHARS="6000"
436
+ ```
437
+
438
+ Run the reference kernel and tests:
439
+
440
+ ```bash
441
+ python kernel/yool_tuple_kernel.py
442
+ python -m unittest discover -s tests -p "test_*.py"
443
+ ```
444
+
445
+ ## V2 benchmark report
446
+
447
+ The V2 report is the main evidence for the safe-speed runtime. Read it before
448
+ adopting the prompt in another project:
449
+
450
+ - [V2 Markdown report](benchmarks/v2_safe_speed_results.md)
451
+ - [V2 PDF report](benchmarks/v2_safe_speed_benchmark.pdf)
452
+ - [V2 benchmark script](benchmarks/v2_safe_speed_benchmark.py)
453
+ - [V2 PDF generator](benchmarks/generate_v2_benchmark_pdf.py)
454
+
455
+ What the V2 report shows:
456
+
457
+ - `2,833.75x` faster scale representation than normal instruction flow.
458
+ - `26.93x` faster active execution than normal sequential execution.
459
+ - `4x` fewer repeated provider calls through receipt/input cache.
460
+ - `32x` fewer small-task calls through batching.
461
+ - `64x` fewer provider failure attempts through circuit breakers.
462
+ - `76.32%` estimated token savings through context compression.
463
+
464
+ The key point: V2 speeds up by avoiding repeated work and controlling provider
465
+ pressure. It does not depend on unsafe infinite calls, unbounded concurrency, or
466
+ retry storms.
467
+
468
+ ## High-throughput runtime defaults
469
+
470
+ The reference kernel is tuned for speed while keeping host guardrails explicit:
471
+
472
+ | Env var | Default | Purpose |
473
+ |---|---:|---|
474
+ | `YOOL_TUPLE_LANE_CONCURRENCY` / `YOOL_LANE_CONCURRENCY` | `32` | Preferred workers per lane. |
475
+ | `YOOL_TUPLE_MAX_LANE_CONCURRENCY` / `YOOL_MAX_LANE_CONCURRENCY` | `64` | Ceiling for workers per lane. |
476
+ | `YOOL_TUPLE_CPU_QUOTA_PCT` / `YOOL_CPU_QUOTA_PCT` | `95` | Default per-yool CPU budget. |
477
+ | `YOOL_TUPLE_QUEUE_MAXSIZE` / `YOOL_QUEUE_MAXSIZE` | `8192` | Lane queue scan cap. |
478
+ | `YOOL_TUPLE_COMPRESSION_THRESHOLD` / `YOOL_COMPRESSION_THRESHOLD` | `1024` | Active materialized agents before pruning. |
479
+ | `YOOL_TUPLE_CACHE_MAX_ENTRIES` / `YOOL_CACHE_MAX_ENTRIES` | `16384` | Receipt/input-hash cache size. |
480
+ | `YOOL_TUPLE_CACHE_TTL_S` / `YOOL_CACHE_TTL_S` | `3600` | Cache TTL in seconds. |
481
+ | `YOOL_TUPLE_API_MAX_RETRIES` / `YOOL_API_MAX_RETRIES` | `3` | Retry budget for transient API/LLM failures. |
482
+ | `YOOL_TUPLE_API_BACKOFF_BASE_MS` / `YOOL_API_BACKOFF_BASE_MS` | `100` | Initial jittered backoff delay. |
483
+ | `YOOL_TUPLE_API_BACKOFF_MAX_MS` / `YOOL_API_BACKOFF_MAX_MS` | `5000` | Backoff ceiling. |
484
+ | `YOOL_TUPLE_CIRCUIT_FAILURE_THRESHOLD` / `YOOL_CIRCUIT_FAILURE_THRESHOLD` | `5` | Failures before opening provider breaker. |
485
+ | `YOOL_TUPLE_CIRCUIT_COOLDOWN_S` / `YOOL_CIRCUIT_COOLDOWN_S` | `30` | Provider cooldown after breaker opens. |
486
+ | `YOOL_TUPLE_BATCH_SMALL_TASK_SIZE` / `YOOL_BATCH_SMALL_TASK_SIZE` | `32` | Default small-task batch size. |
487
+ | `YOOL_TUPLE_CONTEXT_COMPRESSION_CHARS` / `YOOL_CONTEXT_COMPRESSION_CHARS` | `6000` | Large LLM context compression threshold. |
488
+
489
+ Safe speedups now live in the kernel, not only in the prompt: receipt/input
490
+ cache, adaptive lane concurrency, jittered backoff, provider circuit breakers,
491
+ small-task batching, prompt/context compression, local yool routing, and
492
+ speculative execution only for tuples marked `idempotent=True`.
493
+
494
+ Run the reference kernel and tests:
495
+
496
+ ```bash
497
+ python kernel/yool_tuple_kernel.py
498
+ python -m unittest discover -s tests -p "test_*.py"
499
+ ```
500
+
501
+ Benchmark reports:
502
+
503
+ - [Prompt vs normal Markdown](benchmarks/prompt_vs_normal_results.md)
504
+ - [Prompt vs normal PDF](benchmarks/prompt_vs_normal_benchmark.pdf)
505
+ - [V2 safe-speed Markdown](benchmarks/v2_safe_speed_results.md)
506
+ - [V2 safe-speed PDF](benchmarks/v2_safe_speed_benchmark.pdf)
507
+
508
+ ## Why a separate repo
509
+
510
+ The pattern is cross-project. SendSprint, llm-project-mapper, future agents - all consume the same spec. One source of truth, vendored on demand.
511
+
512
+ ## License
513
+
514
+ MIT © Wesley Simplicio. See [`LICENSE`](LICENSE).