rigorloop 0.1.0__py3-none-any.whl
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.
- rigorloop/__init__.py +18 -0
- rigorloop/_version.py +24 -0
- rigorloop/core/__init__.py +1 -0
- rigorloop/core/config_calcs.py +302 -0
- rigorloop/core/dataset_calcs.py +193 -0
- rigorloop/core/prompt_calcs.py +329 -0
- rigorloop/core/report_calcs.py +194 -0
- rigorloop/core/scoring_calcs.py +264 -0
- rigorloop/core/strategy_calcs.py +507 -0
- rigorloop/core/types.py +649 -0
- rigorloop/py.typed +0 -0
- rigorloop/shell/__init__.py +1 -0
- rigorloop/shell/agent_calls.py +120 -0
- rigorloop/shell/cli.py +1111 -0
- rigorloop/shell/io_actions.py +497 -0
- rigorloop-0.1.0.dist-info/METADATA +224 -0
- rigorloop-0.1.0.dist-info/RECORD +20 -0
- rigorloop-0.1.0.dist-info/WHEEL +4 -0
- rigorloop-0.1.0.dist-info/entry_points.txt +2 -0
- rigorloop-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rigorloop
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Statistically-sound agentic build framework: dev/val/test-split loops that produce code artifacts without overfitting.
|
|
5
|
+
Project-URL: Homepage, https://github.com/ronikobrosly/RigorLoop
|
|
6
|
+
Project-URL: Issues, https://github.com/ronikobrosly/RigorLoop/issues
|
|
7
|
+
Project-URL: Changelog, https://github.com/ronikobrosly/RigorLoop/blob/main/CHANGELOG.md
|
|
8
|
+
Author-email: Roni Kobrosly <roni.kobrosly@gmail.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agents,claude,data-science,evaluation,llm
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Python: >=3.12
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# RigorLoop
|
|
26
|
+
|
|
27
|
+
A statistically-sound agentic build framework. You give it a task description,
|
|
28
|
+
a pile of gold-standard input/output examples, and a set of checks; it runs
|
|
29
|
+
agentic loops (a strategy agent directing concurrent executor agents) that
|
|
30
|
+
iteratively build and refine a solution — and it evaluates that solution the
|
|
31
|
+
way a careful data scientist would: on a strict **dev / validation / test**
|
|
32
|
+
split, so the score you see at the end is one you can actually trust.
|
|
33
|
+
|
|
34
|
+
The solution it produces is a portable artifact you can take away and use
|
|
35
|
+
without RigorLoop:
|
|
36
|
+
|
|
37
|
+
- an **executable Python script** (reads your input on stdin, writes the output),
|
|
38
|
+
- an **agent skill** (a `SKILL.md`-style document, e.g. for Claude Skills), or
|
|
39
|
+
- a **guidance file** (an `AGENTS.md`/`CLAUDE.md`-style document for coding agents).
|
|
40
|
+
|
|
41
|
+
## When to use it (and when not to)
|
|
42
|
+
|
|
43
|
+
Use RigorLoop for **data-science-like transformation tasks**: you have many
|
|
44
|
+
representative examples of messy inputs (structured or unstructured text) and
|
|
45
|
+
the structured outputs you want, and you need a solution that generalizes to
|
|
46
|
+
*new* inputs — extraction, normalization, classification-with-output-format,
|
|
47
|
+
reformatting, tagging.
|
|
48
|
+
|
|
49
|
+
Do **not** use it to generate a simple deterministic script that just needs to
|
|
50
|
+
pass a handful of fixed unit tests — a single coding-agent session does that
|
|
51
|
+
job better. RigorLoop's machinery (splits, confidence intervals, budgeted
|
|
52
|
+
validation peeks) only pays off when overfitting is a real risk.
|
|
53
|
+
|
|
54
|
+
## Requirements
|
|
55
|
+
|
|
56
|
+
- **Python ≥ 3.12** on Linux or macOS (Windows is not supported in v1)
|
|
57
|
+
- The **[claude CLI](https://claude.com/claude-code)** installed and
|
|
58
|
+
authenticated (`claude --version` should work) — agents are invoked
|
|
59
|
+
headless and tool-less via `claude -p`
|
|
60
|
+
- **Examples: the more, the better.** RigorLoop will run with a couple dozen,
|
|
61
|
+
but it will warn you plainly about what small sets can and cannot prove
|
|
62
|
+
(with ~30 examples, a validation set of 6 can only distinguish pass-rate
|
|
63
|
+
differences of roughly ±40 points). Aim for 100+ if you can.
|
|
64
|
+
- A budget: every loop spends real model calls. `rigorloop check` estimates
|
|
65
|
+
the call count before you commit (skill/guidance artifacts cost far more to
|
|
66
|
+
evaluate than scripts, because *evaluating* each example is itself a model
|
|
67
|
+
call).
|
|
68
|
+
|
|
69
|
+
## Install
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
pip install rigorloop
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Quickstart
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
mkdir my-task && cd my-task
|
|
79
|
+
rigorloop init # scaffolds rigorloop.toml, task.md, examples.jsonl (a toy dataset)
|
|
80
|
+
# 1. Describe your task in task.md
|
|
81
|
+
# 2. Replace examples.jsonl with your real examples
|
|
82
|
+
# 3. Adjust rigorloop.toml (solution kind, checks, budgets)
|
|
83
|
+
rigorloop check # validates everything, prints split sizes, warnings, and
|
|
84
|
+
# the agent-call budget estimate — spends no tokens
|
|
85
|
+
rigorloop run # runs the loops; artifacts land in runs/<run_id>/
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
When the run finishes you get, under `runs/<run_id>/final/`:
|
|
89
|
+
|
|
90
|
+
- **the solution** (`solution.py`, `SKILL.md`, or `GUIDANCE.md`) — copy it out
|
|
91
|
+
and use it anywhere;
|
|
92
|
+
- **`report.md`** — pass rates with 95% confidence intervals on all three
|
|
93
|
+
splits, per-check breakdowns, the loop history, and honest caveats about
|
|
94
|
+
what the numbers mean;
|
|
95
|
+
- `test_results.json` — the same, machine-readable.
|
|
96
|
+
|
|
97
|
+
A run that stops midway (crash, Ctrl-C) can be continued with
|
|
98
|
+
`rigorloop run --resume <run_id>`, and `rigorloop report <run_id>` re-renders
|
|
99
|
+
the report of a finished run.
|
|
100
|
+
|
|
101
|
+
## What you provide
|
|
102
|
+
|
|
103
|
+
**`task.md`** — a plain-language description of the transformation, written
|
|
104
|
+
for the agent that will build the solution. Say what the inputs look like,
|
|
105
|
+
what the outputs must look like, and any rules that matter.
|
|
106
|
+
|
|
107
|
+
**`examples.jsonl`** — one JSON object per line:
|
|
108
|
+
|
|
109
|
+
```jsonl
|
|
110
|
+
{"input": "Name: Ada Lovelace\nEmail: ada@calc.org\nCity: London", "expected_output": "{\"city\": \"London\", \"email\": \"ada@calc.org\", \"name\": \"Ada Lovelace\"}"}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Both fields may be strings or JSON structures (structures are canonicalized to
|
|
114
|
+
JSON text). These examples should be *highly representative* of the inputs
|
|
115
|
+
you'll see in production — the final score is only as honest as the examples
|
|
116
|
+
are representative.
|
|
117
|
+
|
|
118
|
+
**Checks** — one or more `[[checks]]` blocks in `rigorloop.toml`. An example
|
|
119
|
+
passes only if **every** check passes:
|
|
120
|
+
|
|
121
|
+
| `type` | What it verifies | Options (defaults) |
|
|
122
|
+
|---|---|---|
|
|
123
|
+
| `exact_match` | output equals the expected output | — |
|
|
124
|
+
| `normalized_match` | equal after normalization | `lowercase`, `strip`, `collapse_whitespace` (all `true`) |
|
|
125
|
+
| `json_equality` | output parses to the same JSON value | — |
|
|
126
|
+
| `regex_match` | output contains a match | `pattern` (required) |
|
|
127
|
+
| `numeric_tolerance` | output is a number within tolerance | `atol`, `rtol` (`1e-6`) |
|
|
128
|
+
| `custom_python` | your own checker script passes | `script_path` (required); gets JSON on stdin, exit 0 = pass, 1 = fail |
|
|
129
|
+
| `llm_judge` | a model judges the output against a rubric | `rubric` (required), `n_samples` (3), `pass_threshold` (0.5) |
|
|
130
|
+
|
|
131
|
+
## The knobs (`rigorloop.toml`)
|
|
132
|
+
|
|
133
|
+
Everything has a sensible default; a minimal config is just the `[task]`
|
|
134
|
+
section and one check.
|
|
135
|
+
|
|
136
|
+
```toml
|
|
137
|
+
[task]
|
|
138
|
+
description_file = "task.md"
|
|
139
|
+
solution_kind = "script" # script | skill | guidance
|
|
140
|
+
examples_file = "examples.jsonl"
|
|
141
|
+
|
|
142
|
+
[split]
|
|
143
|
+
ratios = [0.6, 0.2, 0.2] # dev / validation / test
|
|
144
|
+
seed = 17 # same seed => same split, always
|
|
145
|
+
|
|
146
|
+
[loop]
|
|
147
|
+
max_loops = 12 # hard cap on strategy loops
|
|
148
|
+
executors_per_loop = 4 # concurrent solution builders per loop
|
|
149
|
+
dev_examples_in_prompt = 30 # examples each builder sees (resampled per loop)
|
|
150
|
+
|
|
151
|
+
[validation]
|
|
152
|
+
val_every = 3 # scheduled validation checkpoint cadence
|
|
153
|
+
max_peeks = 10 # total validation evaluations allowed per run
|
|
154
|
+
patience = 2 # checkpoints without real improvement => stop
|
|
155
|
+
target_pass_rate = 0.95 # optional: stop early on hitting this on validation
|
|
156
|
+
|
|
157
|
+
[agents]
|
|
158
|
+
model = "claude-sonnet-5" # model for all agent roles
|
|
159
|
+
timeout_s = 300
|
|
160
|
+
|
|
161
|
+
[[checks]]
|
|
162
|
+
type = "json_equality"
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The knobs that matter most in practice:
|
|
166
|
+
|
|
167
|
+
- **`solution_kind`** — also sets the evaluation cost model: scripts are
|
|
168
|
+
executed locally (cheap); skills/guidance are evaluated by running a model
|
|
169
|
+
per example (expensive — check the budget estimate).
|
|
170
|
+
- **`max_loops` × `executors_per_loop`** — your primary cost lever.
|
|
171
|
+
- **`max_peeks` / `patience`** — how often the loop is allowed to look at the
|
|
172
|
+
validation set, and how long it tolerates no genuine (beyond-noise)
|
|
173
|
+
improvement before stopping.
|
|
174
|
+
- **`seed`** — makes the split reproducible; changing it reshuffles which
|
|
175
|
+
examples land in the holdout.
|
|
176
|
+
|
|
177
|
+
## How it stays honest
|
|
178
|
+
|
|
179
|
+
- Your examples are split once, up front; the split is fingerprinted so a
|
|
180
|
+
resumed run can never quietly reshuffle it.
|
|
181
|
+
- The building agents only ever see **dev** examples. Validation scores reach
|
|
182
|
+
the strategy agent only as aggregates; test examples reach no agent, ever.
|
|
183
|
+
- "Improved" always means *beyond the statistical noise band* (paired tests),
|
|
184
|
+
not just a higher number — so the loop doesn't chase luck.
|
|
185
|
+
- The validation set (capped, counted peeks) picks the winner; the **test set
|
|
186
|
+
is evaluated exactly once**, at the very end, and that is the number to
|
|
187
|
+
report.
|
|
188
|
+
|
|
189
|
+
## ⚠️ The final test set is only honest once
|
|
190
|
+
|
|
191
|
+
RigorLoop holds out a final test set and evaluates the winning solution on it **exactly once per run**. That guarantee cannot protect you from yourself *across* runs: if you look at the test score, tweak your task description or checks, and re-run on the same examples file, the "held-out" test set is no longer unseen. After a few such iterations it has effectively become a second validation set, and its scores will be optimistically biased.
|
|
192
|
+
|
|
193
|
+
If you iterate after seeing a test result, treat that test set as spent — supply fresh, never-before-used examples for the next run's holdout.
|
|
194
|
+
|
|
195
|
+
Related caveat: RigorLoop deduplicates *exact* duplicate inputs before splitting, but near-duplicates (the same example lightly reworded) can still straddle the dev/test boundary and quietly inflate test scores. If your dataset may contain near-duplicates, deduplicate it yourself before handing it to RigorLoop.
|
|
196
|
+
|
|
197
|
+
## Other things worth knowing
|
|
198
|
+
|
|
199
|
+
- **RigorLoop runs generated code on your machine.** Candidate scripts and
|
|
200
|
+
`custom_python` checks execute as subprocesses with timeouts and output
|
|
201
|
+
caps — guardrails, not a security boundary. Run inside a container/VM if
|
|
202
|
+
that worries you. See `SECURITY.md`.
|
|
203
|
+
- Your task description and dev examples are sent to the model; validation
|
|
204
|
+
and test examples are embedded one at a time in evaluation calls. Don't
|
|
205
|
+
include data that must not leave your machine.
|
|
206
|
+
- Skill/guidance scores are conditional on the evaluating model (pinned in
|
|
207
|
+
the run manifest) and are measured tool-less; transfer to tool-using agents
|
|
208
|
+
in the wild is weaker, and the report says so.
|
|
209
|
+
|
|
210
|
+
## Example
|
|
211
|
+
|
|
212
|
+
A complete toy project (contact-card text → JSON) lives in
|
|
213
|
+
[`examples/contact-cards/`](examples/contact-cards/) — it is exactly what
|
|
214
|
+
`rigorloop init` scaffolds.
|
|
215
|
+
|
|
216
|
+
## Contributing & development
|
|
217
|
+
|
|
218
|
+
See [`CONTRIBUTING.md`](CONTRIBUTING.md). The design plan is in `PLAN.md`, the
|
|
219
|
+
packaging/release plan in `PACKAGING_PLAN.md`, and the (strict) coding rules
|
|
220
|
+
in `CODING_STYLE.md`.
|
|
221
|
+
|
|
222
|
+
## License
|
|
223
|
+
|
|
224
|
+
MIT — see [`LICENSE`](LICENSE).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
rigorloop/__init__.py,sha256=gqCrxD0q4BCdpt-suof02F_qBwX87jOEQghkodg8tPk,454
|
|
2
|
+
rigorloop/_version.py,sha256=n_5vdJsPNu7wZ57LGuRL585uvll-hiuvZUBWzdG0RQU,520
|
|
3
|
+
rigorloop/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
rigorloop/core/__init__.py,sha256=DIn0hgHfqAVo6vMSEruCMtwVZaMoouTk9-QTTqJy354,61
|
|
5
|
+
rigorloop/core/config_calcs.py,sha256=fhZ--GB2gtX_-4UaZX-dTealtTp-48sTup6YOnGjMpE,11188
|
|
6
|
+
rigorloop/core/dataset_calcs.py,sha256=sqAs7h9ICFWpw6b_9VM5iVubdig12ueZn4wweVIF6nU,7197
|
|
7
|
+
rigorloop/core/prompt_calcs.py,sha256=86z6Q8lrqx0YPr-k4kLuOoJmc8VddEkWn9BPy_hkH-A,13224
|
|
8
|
+
rigorloop/core/report_calcs.py,sha256=F9uBPZrzBUrWFqf1WAlzAL-lawUx13Xu-2JU23u4Tl8,7216
|
|
9
|
+
rigorloop/core/scoring_calcs.py,sha256=yfYqOi4D_2OJiaPyyLeoKRN0Q-Qt_4bN2LJxqGZxv9g,9761
|
|
10
|
+
rigorloop/core/strategy_calcs.py,sha256=ktLMBQTk2fAgI4CyfCASQafmhRZzq2sTkyYUZ6ISaXk,19372
|
|
11
|
+
rigorloop/core/types.py,sha256=TdShBIW4s00wqy-iR0-dXfDudW_ISO8unWIav9Jk4s8,13540
|
|
12
|
+
rigorloop/shell/__init__.py,sha256=KNVKC2bz7-lNuD3EYycGpHKukKoA-BSL6Z8kibhW1OQ,69
|
|
13
|
+
rigorloop/shell/agent_calls.py,sha256=WPiV_wgpLLT9m7LkFx_hgSFPXz4W_DKZYniiOWOyN2s,3718
|
|
14
|
+
rigorloop/shell/cli.py,sha256=sYhR9FcTAuXdqTltJCtelqjQ3lHMYe43vQaxvbVzvFM,43421
|
|
15
|
+
rigorloop/shell/io_actions.py,sha256=tTHLp-ChiJ0P3nPZAwuEPf4lp9jHUW1UeUbuj0brmxA,16562
|
|
16
|
+
rigorloop-0.1.0.dist-info/METADATA,sha256=5aR5BNxnry2iEvy8ExPJX4I6eKiJlgTyTYR3hLtbqoU,10474
|
|
17
|
+
rigorloop-0.1.0.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
|
|
18
|
+
rigorloop-0.1.0.dist-info/entry_points.txt,sha256=BOsWitulcZUoZSuFmC3KOSvcYGuwye78LwvWh9xP6-Q,55
|
|
19
|
+
rigorloop-0.1.0.dist-info/licenses/LICENSE,sha256=pxkJvysic-mY3ELfi-ts2445liyatgXLCbZig1vnhZA,1070
|
|
20
|
+
rigorloop-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Roni Kobrosly
|
|
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.
|