yburn 1.0.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.
- yburn-1.0.0/LICENSE +21 -0
- yburn-1.0.0/PKG-INFO +318 -0
- yburn-1.0.0/README.md +284 -0
- yburn-1.0.0/pyproject.toml +57 -0
- yburn-1.0.0/setup.cfg +4 -0
- yburn-1.0.0/tests/test_classifier.py +353 -0
- yburn-1.0.0/tests/test_converter.py +303 -0
- yburn-1.0.0/tests/test_replacer.py +142 -0
- yburn-1.0.0/tests/test_scanner.py +215 -0
- yburn-1.0.0/tests/test_telegram.py +132 -0
- yburn-1.0.0/tests/test_yburn_health.py +842 -0
- yburn-1.0.0/tests/test_yburn_watch.py +524 -0
- yburn-1.0.0/yburn/__init__.py +3 -0
- yburn-1.0.0/yburn/channels/__init__.py +1 -0
- yburn-1.0.0/yburn/channels/telegram.py +173 -0
- yburn-1.0.0/yburn/classifier.py +236 -0
- yburn-1.0.0/yburn/cli.py +416 -0
- yburn-1.0.0/yburn/config.py +77 -0
- yburn-1.0.0/yburn/converter.py +314 -0
- yburn-1.0.0/yburn/flagship/__init__.py +1 -0
- yburn-1.0.0/yburn/flagship/yburn_health.py +903 -0
- yburn-1.0.0/yburn/flagship/yburn_watch.py +524 -0
- yburn-1.0.0/yburn/replacer.py +239 -0
- yburn-1.0.0/yburn/scanner.py +191 -0
- yburn-1.0.0/yburn/templates/api-endpoint-check/script.py +106 -0
- yburn-1.0.0/yburn/templates/cron-health-report/script.py +141 -0
- yburn-1.0.0/yburn/templates/file-watcher/script.py +161 -0
- yburn-1.0.0/yburn/templates/git-backup-status/script.py +150 -0
- yburn-1.0.0/yburn/templates/system-diagnostics/script.py +236 -0
- yburn-1.0.0/yburn.egg-info/PKG-INFO +318 -0
- yburn-1.0.0/yburn.egg-info/SOURCES.txt +33 -0
- yburn-1.0.0/yburn.egg-info/dependency_links.txt +1 -0
- yburn-1.0.0/yburn.egg-info/entry_points.txt +4 -0
- yburn-1.0.0/yburn.egg-info/requires.txt +5 -0
- yburn-1.0.0/yburn.egg-info/top_level.txt +1 -0
yburn-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Oscar Sterling
|
|
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.
|
yburn-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: yburn
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Why burn tokens? Audit AI agent cron jobs, replace mechanical ones with local scripts. Includes yburn-health (system monitor) and yburn-watch (uptime monitor).
|
|
5
|
+
Author: Jason Haugh
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/oscarsterling/yburn
|
|
8
|
+
Project-URL: Repository, https://github.com/oscarsterling/yburn
|
|
9
|
+
Project-URL: Issues, https://github.com/oscarsterling/yburn/issues
|
|
10
|
+
Keywords: ai,automation,cron,monitoring,health-check,token-optimization,openclaw,claude-code,devops
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: System Administrators
|
|
15
|
+
Classifier: Operating System :: MacOS
|
|
16
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: System :: Monitoring
|
|
24
|
+
Classifier: Topic :: System :: Systems Administration
|
|
25
|
+
Classifier: Topic :: Utilities
|
|
26
|
+
Requires-Python: >=3.9
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Requires-Dist: requests
|
|
30
|
+
Requires-Dist: pyyaml
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# yburn
|
|
36
|
+
|
|
37
|
+
**Why burn tokens on tasks that don't think?**
|
|
38
|
+
|
|
39
|
+
Audit your AI agent cron jobs, identify the ones that never needed an LLM, and replace them with local scripts that run in under a second and cost nothing.
|
|
40
|
+
|
|
41
|
+

|
|
42
|
+

|
|
43
|
+

|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## The Problem
|
|
48
|
+
|
|
49
|
+
If you run an AI agent with scheduled cron jobs, a significant portion of those jobs are probably doing mechanical work: running a script, checking an endpoint, pushing a git backup, rotating a log file. They do not reason. They do not need context. They just execute the same deterministic steps every time.
|
|
50
|
+
|
|
51
|
+
But they still call the LLM. Every run. Every day.
|
|
52
|
+
|
|
53
|
+
Real numbers from a live 92-cron OpenClaw setup (M10 audit, March 2026):
|
|
54
|
+
|
|
55
|
+
- **44 of 92 crons (48%) were mechanical** - the LLM was doing nothing a Python script couldn't do faster
|
|
56
|
+
- **15-25% of daily cron token spend** is recoverable by converting the clearest mechanical jobs
|
|
57
|
+
- **30-second average execution time** per mechanical LLM cron drops to **under 1 second** with a local script
|
|
58
|
+
- Common culprits: DB maintenance, OAuth health checks, git backups, system diagnostics, update checkers
|
|
59
|
+
|
|
60
|
+
The community has been finding this manually. A developer at Moltbook AI manually replaced two OpenClaw crons (CLAW token minting, crypto price reporting) with Python scripts and dropped those jobs to zero tokens. Cyfrin documented a 21,000-token charge for a one-word typo fix. nickbuilds.ai cut their OpenClaw costs by 60% by auditing crons and switching models. Yburn automates the audit-to-replacement workflow they all did by hand.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## The Solution
|
|
65
|
+
|
|
66
|
+
Yburn is a CLI tool that:
|
|
67
|
+
|
|
68
|
+
- **Scans** your agent cron configuration and extracts every scheduled job
|
|
69
|
+
- **Classifies** each job as `MECHANICAL` (no reasoning needed), `REASONING` (keep the LLM), or `UNSURE` (needs your call)
|
|
70
|
+
- **Converts** mechanical jobs to local Python scripts using a built-in template library
|
|
71
|
+
- **Replaces** the original cron with a script-based equivalent and tracks the swap so you can roll back
|
|
72
|
+
|
|
73
|
+
Classification is deterministic keyword scoring - no LLM required to classify. The tool that finds your LLM waste does not itself create LLM waste.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Quick Demo
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
$ yburn audit
|
|
81
|
+
|
|
82
|
+
Scanning cron jobs...
|
|
83
|
+
Found 92 jobs. Classifying...
|
|
84
|
+
|
|
85
|
+
Mechanical: 44 jobs (convertible)
|
|
86
|
+
Reasoning: 14 jobs (kept as-is)
|
|
87
|
+
Unsure: 34 jobs (need your input)
|
|
88
|
+
|
|
89
|
+
--- MECHANICAL (convertible) ---
|
|
90
|
+
DB Maintenance - Daily Full [enabled]
|
|
91
|
+
Score: mech=18 reason=2 conf=1.00
|
|
92
|
+
Template -> system-diagnostics
|
|
93
|
+
|
|
94
|
+
OAuth Token Health Check [enabled]
|
|
95
|
+
Score: mech=16 reason=1 conf=1.00
|
|
96
|
+
Template -> api-endpoint-check
|
|
97
|
+
|
|
98
|
+
Pre-Dream Git Snapshot [enabled]
|
|
99
|
+
Score: mech=15 reason=0 conf=1.00
|
|
100
|
+
Template -> git-backup-status
|
|
101
|
+
|
|
102
|
+
OpenClaw Update Check [enabled]
|
|
103
|
+
Score: mech=12 reason=3 conf=0.82
|
|
104
|
+
Template -> api-endpoint-check
|
|
105
|
+
|
|
106
|
+
Estimated monthly savings: ~$4.20 in tokens
|
|
107
|
+
Speed improvement: ~30s avg -> <1s per converted job
|
|
108
|
+
|
|
109
|
+
Run yburn convert --all to convert mechanical jobs.
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Installation
|
|
115
|
+
|
|
116
|
+
Requires Python 3.9 or higher. A virtual environment is strongly recommended.
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Create and activate a venv (recommended)
|
|
120
|
+
python3 -m venv .venv
|
|
121
|
+
source .venv/bin/activate
|
|
122
|
+
|
|
123
|
+
# Install from source
|
|
124
|
+
git clone https://github.com/oscarsterling/yburn.git
|
|
125
|
+
cd yburn
|
|
126
|
+
pip install -e .
|
|
127
|
+
|
|
128
|
+
# Install with dev dependencies (for testing)
|
|
129
|
+
pip install -e '.[dev]'
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Verify:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
yburn version
|
|
136
|
+
# yburn 0.1.0
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Usage
|
|
142
|
+
|
|
143
|
+
### `yburn audit`
|
|
144
|
+
|
|
145
|
+
Scan and classify all cron jobs. This is the starting point. Read-only, no changes made.
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Audit your live cron setup
|
|
149
|
+
yburn audit
|
|
150
|
+
|
|
151
|
+
# Verbose mode (shows reasoning jobs too)
|
|
152
|
+
yburn audit --verbose
|
|
153
|
+
|
|
154
|
+
# Lower the classification threshold (more jobs classified)
|
|
155
|
+
yburn audit --threshold 2
|
|
156
|
+
|
|
157
|
+
# Audit from a JSON file (useful for testing or CI)
|
|
158
|
+
yburn audit --file jobs.json
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### `yburn convert`
|
|
162
|
+
|
|
163
|
+
Generate a local Python replacement script for a mechanical job.
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# Convert a specific job (by name or ID)
|
|
167
|
+
yburn convert "OAuth Token Health Check"
|
|
168
|
+
|
|
169
|
+
# Preview without writing any files
|
|
170
|
+
yburn convert "OAuth Token Health Check" --dry-run
|
|
171
|
+
|
|
172
|
+
# Convert all mechanical jobs at once
|
|
173
|
+
yburn convert --all
|
|
174
|
+
|
|
175
|
+
# Preview all conversions without writing
|
|
176
|
+
yburn convert --all --dry-run
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### `yburn replace`
|
|
180
|
+
|
|
181
|
+
Swap the original LLM cron for the generated script-based cron.
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# Replace with confirmation prompt
|
|
185
|
+
yburn replace <job-id>
|
|
186
|
+
|
|
187
|
+
# Skip confirmation
|
|
188
|
+
yburn replace <job-id> --yes
|
|
189
|
+
|
|
190
|
+
# Preview the replacement without making changes
|
|
191
|
+
yburn replace <job-id> --dry-run
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### `yburn list`
|
|
195
|
+
|
|
196
|
+
Show all converted jobs and their replacement status.
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
yburn list
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### `yburn test`
|
|
203
|
+
|
|
204
|
+
Run a converted script once and display the output. Confirm it works before replacing.
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
yburn test "OAuth Token Health Check"
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### `yburn rollback`
|
|
211
|
+
|
|
212
|
+
Undo a replacement and restore the original cron configuration.
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
yburn rollback <job-id>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### `yburn version`
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
yburn version
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## How It Works
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
scan -> classify -> convert -> replace
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
1. **Scan:** Reads your cron configuration (OpenClaw via `openclaw cron list`, or a JSON file). Extracts job name, schedule, model, payload text, and tool calls.
|
|
233
|
+
|
|
234
|
+
2. **Classify:** Scores each job against weighted keyword sets. Mechanical signals: shell commands, script invocations, file operations, exit-on-result patterns. Reasoning signals: synthesis, analysis, research, creative tasks, decision language. Score delta determines classification.
|
|
235
|
+
|
|
236
|
+
3. **Convert:** Matches the mechanical job to a built-in template by keyword overlap. Generates a standalone Python script that replicates the job's behavior without an LLM call.
|
|
237
|
+
|
|
238
|
+
4. **Replace:** Records the replacement, disables the original LLM cron, and activates the script-based equivalent. Tracks the swap in a local database so rollback is always available.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Template Library
|
|
243
|
+
|
|
244
|
+
Yburn ships with five built-in templates covering the most common mechanical cron patterns:
|
|
245
|
+
|
|
246
|
+
| Template | What It Replaces |
|
|
247
|
+
|---|---|
|
|
248
|
+
| `system-diagnostics` | Disk, CPU, memory, uptime, process health checks |
|
|
249
|
+
| `api-endpoint-check` | HTTP health checks, OAuth token validation, status pings |
|
|
250
|
+
| `cron-health-report` | Cron job status audits, failure counts, schedule compliance |
|
|
251
|
+
| `git-backup-status` | Git add/commit/push automations, repo state reporting |
|
|
252
|
+
| `file-watcher` | File existence checks, size monitors, rotation triggers |
|
|
253
|
+
|
|
254
|
+
If no template matches your job, Yburn flags it for manual review. Custom templates can be added to `~/.yburn/templates/`. Template spec: `yburn/templates/TEMPLATE_SPEC.md`.
|
|
255
|
+
|
|
256
|
+
The M10 audit identified two high-value templates not yet built: `script-runner` (for jobs that already wrap an existing Python/bash script) and `model-setter` (for jobs that only call session_status to set model overrides). These are on the roadmap.
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Supported Platforms
|
|
261
|
+
|
|
262
|
+
**OpenClaw (primary integration)**
|
|
263
|
+
|
|
264
|
+
Yburn reads from `openclaw cron list` JSON output and writes back to the OpenClaw cron system. Native support for OpenClaw's job schema (`sessionTarget`, `payload.kind`, `delivery`, `schedule`).
|
|
265
|
+
|
|
266
|
+
**Extensible**
|
|
267
|
+
|
|
268
|
+
The scanner accepts any JSON array of job objects via `--file`. If your agent framework can export cron jobs to JSON, Yburn can classify them. Replacement script generation is framework-agnostic.
|
|
269
|
+
|
|
270
|
+
Planned integrations: Claude Code (AGENTS.md cron annotations), AutoGen scheduled agents, LangGraph cron nodes.
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## Test Suite
|
|
275
|
+
|
|
276
|
+
```
|
|
277
|
+
$ pytest
|
|
278
|
+
|
|
279
|
+
platform darwin -- Python 3.14.2
|
|
280
|
+
collected 124 items
|
|
281
|
+
|
|
282
|
+
tests/test_classifier.py 46 passed
|
|
283
|
+
tests/test_converter.py 33 passed
|
|
284
|
+
tests/test_replacer.py 23 passed
|
|
285
|
+
tests/test_scanner.py 37 passed
|
|
286
|
+
tests/test_telegram.py 15 passed
|
|
287
|
+
============================== 124 passed in 0.06s
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## Contributing
|
|
293
|
+
|
|
294
|
+
Contributions welcome, especially:
|
|
295
|
+
|
|
296
|
+
- New templates for common mechanical cron patterns
|
|
297
|
+
- Scanner adapters for other agent frameworks
|
|
298
|
+
- Classification signal improvements (see `M10-RESULTS.md` for known edge cases)
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# Run tests
|
|
302
|
+
pytest
|
|
303
|
+
|
|
304
|
+
# Run with coverage
|
|
305
|
+
pytest --cov=yburn
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Please open an issue before submitting a large PR. The classification engine is the core of the tool - changes to scoring weights need evidence from real cron audits.
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## License
|
|
313
|
+
|
|
314
|
+
MIT. See `LICENSE`.
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
*Built because the blog posts all found the same fix. Someone had to automate it.*
|
yburn-1.0.0/README.md
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
# yburn
|
|
2
|
+
|
|
3
|
+
**Why burn tokens on tasks that don't think?**
|
|
4
|
+
|
|
5
|
+
Audit your AI agent cron jobs, identify the ones that never needed an LLM, and replace them with local scripts that run in under a second and cost nothing.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## The Problem
|
|
14
|
+
|
|
15
|
+
If you run an AI agent with scheduled cron jobs, a significant portion of those jobs are probably doing mechanical work: running a script, checking an endpoint, pushing a git backup, rotating a log file. They do not reason. They do not need context. They just execute the same deterministic steps every time.
|
|
16
|
+
|
|
17
|
+
But they still call the LLM. Every run. Every day.
|
|
18
|
+
|
|
19
|
+
Real numbers from a live 92-cron OpenClaw setup (M10 audit, March 2026):
|
|
20
|
+
|
|
21
|
+
- **44 of 92 crons (48%) were mechanical** - the LLM was doing nothing a Python script couldn't do faster
|
|
22
|
+
- **15-25% of daily cron token spend** is recoverable by converting the clearest mechanical jobs
|
|
23
|
+
- **30-second average execution time** per mechanical LLM cron drops to **under 1 second** with a local script
|
|
24
|
+
- Common culprits: DB maintenance, OAuth health checks, git backups, system diagnostics, update checkers
|
|
25
|
+
|
|
26
|
+
The community has been finding this manually. A developer at Moltbook AI manually replaced two OpenClaw crons (CLAW token minting, crypto price reporting) with Python scripts and dropped those jobs to zero tokens. Cyfrin documented a 21,000-token charge for a one-word typo fix. nickbuilds.ai cut their OpenClaw costs by 60% by auditing crons and switching models. Yburn automates the audit-to-replacement workflow they all did by hand.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## The Solution
|
|
31
|
+
|
|
32
|
+
Yburn is a CLI tool that:
|
|
33
|
+
|
|
34
|
+
- **Scans** your agent cron configuration and extracts every scheduled job
|
|
35
|
+
- **Classifies** each job as `MECHANICAL` (no reasoning needed), `REASONING` (keep the LLM), or `UNSURE` (needs your call)
|
|
36
|
+
- **Converts** mechanical jobs to local Python scripts using a built-in template library
|
|
37
|
+
- **Replaces** the original cron with a script-based equivalent and tracks the swap so you can roll back
|
|
38
|
+
|
|
39
|
+
Classification is deterministic keyword scoring - no LLM required to classify. The tool that finds your LLM waste does not itself create LLM waste.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Quick Demo
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
$ yburn audit
|
|
47
|
+
|
|
48
|
+
Scanning cron jobs...
|
|
49
|
+
Found 92 jobs. Classifying...
|
|
50
|
+
|
|
51
|
+
Mechanical: 44 jobs (convertible)
|
|
52
|
+
Reasoning: 14 jobs (kept as-is)
|
|
53
|
+
Unsure: 34 jobs (need your input)
|
|
54
|
+
|
|
55
|
+
--- MECHANICAL (convertible) ---
|
|
56
|
+
DB Maintenance - Daily Full [enabled]
|
|
57
|
+
Score: mech=18 reason=2 conf=1.00
|
|
58
|
+
Template -> system-diagnostics
|
|
59
|
+
|
|
60
|
+
OAuth Token Health Check [enabled]
|
|
61
|
+
Score: mech=16 reason=1 conf=1.00
|
|
62
|
+
Template -> api-endpoint-check
|
|
63
|
+
|
|
64
|
+
Pre-Dream Git Snapshot [enabled]
|
|
65
|
+
Score: mech=15 reason=0 conf=1.00
|
|
66
|
+
Template -> git-backup-status
|
|
67
|
+
|
|
68
|
+
OpenClaw Update Check [enabled]
|
|
69
|
+
Score: mech=12 reason=3 conf=0.82
|
|
70
|
+
Template -> api-endpoint-check
|
|
71
|
+
|
|
72
|
+
Estimated monthly savings: ~$4.20 in tokens
|
|
73
|
+
Speed improvement: ~30s avg -> <1s per converted job
|
|
74
|
+
|
|
75
|
+
Run yburn convert --all to convert mechanical jobs.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Installation
|
|
81
|
+
|
|
82
|
+
Requires Python 3.9 or higher. A virtual environment is strongly recommended.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Create and activate a venv (recommended)
|
|
86
|
+
python3 -m venv .venv
|
|
87
|
+
source .venv/bin/activate
|
|
88
|
+
|
|
89
|
+
# Install from source
|
|
90
|
+
git clone https://github.com/oscarsterling/yburn.git
|
|
91
|
+
cd yburn
|
|
92
|
+
pip install -e .
|
|
93
|
+
|
|
94
|
+
# Install with dev dependencies (for testing)
|
|
95
|
+
pip install -e '.[dev]'
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Verify:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
yburn version
|
|
102
|
+
# yburn 0.1.0
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Usage
|
|
108
|
+
|
|
109
|
+
### `yburn audit`
|
|
110
|
+
|
|
111
|
+
Scan and classify all cron jobs. This is the starting point. Read-only, no changes made.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Audit your live cron setup
|
|
115
|
+
yburn audit
|
|
116
|
+
|
|
117
|
+
# Verbose mode (shows reasoning jobs too)
|
|
118
|
+
yburn audit --verbose
|
|
119
|
+
|
|
120
|
+
# Lower the classification threshold (more jobs classified)
|
|
121
|
+
yburn audit --threshold 2
|
|
122
|
+
|
|
123
|
+
# Audit from a JSON file (useful for testing or CI)
|
|
124
|
+
yburn audit --file jobs.json
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### `yburn convert`
|
|
128
|
+
|
|
129
|
+
Generate a local Python replacement script for a mechanical job.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Convert a specific job (by name or ID)
|
|
133
|
+
yburn convert "OAuth Token Health Check"
|
|
134
|
+
|
|
135
|
+
# Preview without writing any files
|
|
136
|
+
yburn convert "OAuth Token Health Check" --dry-run
|
|
137
|
+
|
|
138
|
+
# Convert all mechanical jobs at once
|
|
139
|
+
yburn convert --all
|
|
140
|
+
|
|
141
|
+
# Preview all conversions without writing
|
|
142
|
+
yburn convert --all --dry-run
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### `yburn replace`
|
|
146
|
+
|
|
147
|
+
Swap the original LLM cron for the generated script-based cron.
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Replace with confirmation prompt
|
|
151
|
+
yburn replace <job-id>
|
|
152
|
+
|
|
153
|
+
# Skip confirmation
|
|
154
|
+
yburn replace <job-id> --yes
|
|
155
|
+
|
|
156
|
+
# Preview the replacement without making changes
|
|
157
|
+
yburn replace <job-id> --dry-run
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### `yburn list`
|
|
161
|
+
|
|
162
|
+
Show all converted jobs and their replacement status.
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
yburn list
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### `yburn test`
|
|
169
|
+
|
|
170
|
+
Run a converted script once and display the output. Confirm it works before replacing.
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
yburn test "OAuth Token Health Check"
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### `yburn rollback`
|
|
177
|
+
|
|
178
|
+
Undo a replacement and restore the original cron configuration.
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
yburn rollback <job-id>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### `yburn version`
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
yburn version
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## How It Works
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
scan -> classify -> convert -> replace
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
1. **Scan:** Reads your cron configuration (OpenClaw via `openclaw cron list`, or a JSON file). Extracts job name, schedule, model, payload text, and tool calls.
|
|
199
|
+
|
|
200
|
+
2. **Classify:** Scores each job against weighted keyword sets. Mechanical signals: shell commands, script invocations, file operations, exit-on-result patterns. Reasoning signals: synthesis, analysis, research, creative tasks, decision language. Score delta determines classification.
|
|
201
|
+
|
|
202
|
+
3. **Convert:** Matches the mechanical job to a built-in template by keyword overlap. Generates a standalone Python script that replicates the job's behavior without an LLM call.
|
|
203
|
+
|
|
204
|
+
4. **Replace:** Records the replacement, disables the original LLM cron, and activates the script-based equivalent. Tracks the swap in a local database so rollback is always available.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Template Library
|
|
209
|
+
|
|
210
|
+
Yburn ships with five built-in templates covering the most common mechanical cron patterns:
|
|
211
|
+
|
|
212
|
+
| Template | What It Replaces |
|
|
213
|
+
|---|---|
|
|
214
|
+
| `system-diagnostics` | Disk, CPU, memory, uptime, process health checks |
|
|
215
|
+
| `api-endpoint-check` | HTTP health checks, OAuth token validation, status pings |
|
|
216
|
+
| `cron-health-report` | Cron job status audits, failure counts, schedule compliance |
|
|
217
|
+
| `git-backup-status` | Git add/commit/push automations, repo state reporting |
|
|
218
|
+
| `file-watcher` | File existence checks, size monitors, rotation triggers |
|
|
219
|
+
|
|
220
|
+
If no template matches your job, Yburn flags it for manual review. Custom templates can be added to `~/.yburn/templates/`. Template spec: `yburn/templates/TEMPLATE_SPEC.md`.
|
|
221
|
+
|
|
222
|
+
The M10 audit identified two high-value templates not yet built: `script-runner` (for jobs that already wrap an existing Python/bash script) and `model-setter` (for jobs that only call session_status to set model overrides). These are on the roadmap.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Supported Platforms
|
|
227
|
+
|
|
228
|
+
**OpenClaw (primary integration)**
|
|
229
|
+
|
|
230
|
+
Yburn reads from `openclaw cron list` JSON output and writes back to the OpenClaw cron system. Native support for OpenClaw's job schema (`sessionTarget`, `payload.kind`, `delivery`, `schedule`).
|
|
231
|
+
|
|
232
|
+
**Extensible**
|
|
233
|
+
|
|
234
|
+
The scanner accepts any JSON array of job objects via `--file`. If your agent framework can export cron jobs to JSON, Yburn can classify them. Replacement script generation is framework-agnostic.
|
|
235
|
+
|
|
236
|
+
Planned integrations: Claude Code (AGENTS.md cron annotations), AutoGen scheduled agents, LangGraph cron nodes.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Test Suite
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
$ pytest
|
|
244
|
+
|
|
245
|
+
platform darwin -- Python 3.14.2
|
|
246
|
+
collected 124 items
|
|
247
|
+
|
|
248
|
+
tests/test_classifier.py 46 passed
|
|
249
|
+
tests/test_converter.py 33 passed
|
|
250
|
+
tests/test_replacer.py 23 passed
|
|
251
|
+
tests/test_scanner.py 37 passed
|
|
252
|
+
tests/test_telegram.py 15 passed
|
|
253
|
+
============================== 124 passed in 0.06s
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## Contributing
|
|
259
|
+
|
|
260
|
+
Contributions welcome, especially:
|
|
261
|
+
|
|
262
|
+
- New templates for common mechanical cron patterns
|
|
263
|
+
- Scanner adapters for other agent frameworks
|
|
264
|
+
- Classification signal improvements (see `M10-RESULTS.md` for known edge cases)
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
# Run tests
|
|
268
|
+
pytest
|
|
269
|
+
|
|
270
|
+
# Run with coverage
|
|
271
|
+
pytest --cov=yburn
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Please open an issue before submitting a large PR. The classification engine is the core of the tool - changes to scoring weights need evidence from real cron audits.
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## License
|
|
279
|
+
|
|
280
|
+
MIT. See `LICENSE`.
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
*Built because the blog posts all found the same fix. Someone had to automate it.*
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "yburn"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Why burn tokens? Audit AI agent cron jobs, replace mechanical ones with local scripts. Includes yburn-health (system monitor) and yburn-watch (uptime monitor)."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Jason Haugh"},
|
|
14
|
+
]
|
|
15
|
+
keywords = ["ai", "automation", "cron", "monitoring", "health-check", "token-optimization", "openclaw", "claude-code", "devops"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Intended Audience :: System Administrators",
|
|
21
|
+
"Operating System :: MacOS",
|
|
22
|
+
"Operating System :: POSIX :: Linux",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Programming Language :: Python :: 3.9",
|
|
25
|
+
"Programming Language :: Python :: 3.10",
|
|
26
|
+
"Programming Language :: Python :: 3.11",
|
|
27
|
+
"Programming Language :: Python :: 3.12",
|
|
28
|
+
"Programming Language :: Python :: 3.13",
|
|
29
|
+
"Topic :: System :: Monitoring",
|
|
30
|
+
"Topic :: System :: Systems Administration",
|
|
31
|
+
"Topic :: Utilities",
|
|
32
|
+
]
|
|
33
|
+
dependencies = [
|
|
34
|
+
"requests",
|
|
35
|
+
"pyyaml",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.optional-dependencies]
|
|
39
|
+
dev = [
|
|
40
|
+
"pytest>=7.0",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
Homepage = "https://github.com/oscarsterling/yburn"
|
|
45
|
+
Repository = "https://github.com/oscarsterling/yburn"
|
|
46
|
+
Issues = "https://github.com/oscarsterling/yburn/issues"
|
|
47
|
+
|
|
48
|
+
[project.scripts]
|
|
49
|
+
yburn = "yburn.cli:main"
|
|
50
|
+
yburn-health = "yburn.flagship.yburn_health:main"
|
|
51
|
+
yburn-watch = "yburn.flagship.yburn_watch:main"
|
|
52
|
+
|
|
53
|
+
[tool.pytest.ini_options]
|
|
54
|
+
testpaths = ["tests"]
|
|
55
|
+
|
|
56
|
+
[tool.setuptools.packages.find]
|
|
57
|
+
include = ["yburn*"]
|
yburn-1.0.0/setup.cfg
ADDED