auto-optimize 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.
Files changed (130) hide show
  1. auto_optimize-1.0.0/.claude-plugin/marketplace.json +15 -0
  2. auto_optimize-1.0.0/.claude-plugin/plugin.json +13 -0
  3. auto_optimize-1.0.0/.gitignore +11 -0
  4. auto_optimize-1.0.0/CHANGELOG.md +112 -0
  5. auto_optimize-1.0.0/LICENSE +21 -0
  6. auto_optimize-1.0.0/PKG-INFO +610 -0
  7. auto_optimize-1.0.0/README.md +589 -0
  8. auto_optimize-1.0.0/examples/fasta-stats/README.md +64 -0
  9. auto_optimize-1.0.0/examples/fasta-stats/dashboard.png +0 -0
  10. auto_optimize-1.0.0/examples/fasta-stats/example.fa +7 -0
  11. auto_optimize-1.0.0/examples/fasta-stats/fasta_stats.py +69 -0
  12. auto_optimize-1.0.0/examples/fasta-stats/objective.png +0 -0
  13. auto_optimize-1.0.0/examples/kmer-memory/README.md +66 -0
  14. auto_optimize-1.0.0/examples/kmer-memory/dashboard.png +0 -0
  15. auto_optimize-1.0.0/examples/kmer-memory/kmers.py +25 -0
  16. auto_optimize-1.0.0/examples/kmer-memory/objective.png +0 -0
  17. auto_optimize-1.0.0/examples/one-hot/README.md +22 -0
  18. auto_optimize-1.0.0/examples/one-hot/onehot.py +30 -0
  19. auto_optimize-1.0.0/examples/smooth-coverage/README.md +71 -0
  20. auto_optimize-1.0.0/examples/smooth-coverage/dashboard.png +0 -0
  21. auto_optimize-1.0.0/examples/smooth-coverage/objective.png +0 -0
  22. auto_optimize-1.0.0/examples/smooth-coverage/smooth.py +31 -0
  23. auto_optimize-1.0.0/pyproject.toml +52 -0
  24. auto_optimize-1.0.0/skills/auto-optimize-code/LICENSE +21 -0
  25. auto_optimize-1.0.0/skills/auto-optimize-code/SKILL.md +251 -0
  26. auto_optimize-1.0.0/skills/auto-optimize-code/VERSION +1 -0
  27. auto_optimize-1.0.0/skills/auto-optimize-code/references/algorithm.md +182 -0
  28. auto_optimize-1.0.0/skills/auto-optimize-code/references/changes.md +146 -0
  29. auto_optimize-1.0.0/skills/auto-optimize-code/references/cli.md +206 -0
  30. auto_optimize-1.0.0/skills/auto-optimize-code/references/dashboard.md +203 -0
  31. auto_optimize-1.0.0/skills/auto-optimize-code/references/documents.md +55 -0
  32. auto_optimize-1.0.0/skills/auto-optimize-code/references/extending.md +87 -0
  33. auto_optimize-1.0.0/skills/auto-optimize-code/references/external-validation.md +98 -0
  34. auto_optimize-1.0.0/skills/auto-optimize-code/references/glossary.md +134 -0
  35. auto_optimize-1.0.0/skills/auto-optimize-code/references/idea-miner.md +108 -0
  36. auto_optimize-1.0.0/skills/auto-optimize-code/references/issue-bugs.md +182 -0
  37. auto_optimize-1.0.0/skills/auto-optimize-code/references/layout.md +300 -0
  38. auto_optimize-1.0.0/skills/auto-optimize-code/references/main-session.md +45 -0
  39. auto_optimize-1.0.0/skills/auto-optimize-code/references/measuring.md +208 -0
  40. auto_optimize-1.0.0/skills/auto-optimize-code/references/pr-optimization.md +127 -0
  41. auto_optimize-1.0.0/skills/auto-optimize-code/references/pr-tests.md +254 -0
  42. auto_optimize-1.0.0/skills/auto-optimize-code/references/promotion.md +133 -0
  43. auto_optimize-1.0.0/skills/auto-optimize-code/references/reading-a-search.md +65 -0
  44. auto_optimize-1.0.0/skills/auto-optimize-code/references/repo-mode.md +224 -0
  45. auto_optimize-1.0.0/skills/auto-optimize-code/references/resume.md +81 -0
  46. auto_optimize-1.0.0/skills/auto-optimize-code/references/shared-knowledge.md +114 -0
  47. auto_optimize-1.0.0/skills/auto-optimize-code/references/step0-interview.md +298 -0
  48. auto_optimize-1.0.0/skills/auto-optimize-code/references/step1-unit-tests.md +136 -0
  49. auto_optimize-1.0.0/skills/auto-optimize-code/references/step2-baseline.md +708 -0
  50. auto_optimize-1.0.0/skills/auto-optimize-code/references/step3-rounds.md +350 -0
  51. auto_optimize-1.0.0/skills/auto-optimize-code/references/step4-final.md +121 -0
  52. auto_optimize-1.0.0/skills/auto-optimize-code/references/step5-ship.md +220 -0
  53. auto_optimize-1.0.0/skills/auto-optimize-code/references/step6-finish.md +67 -0
  54. auto_optimize-1.0.0/skills/auto-optimize-code/references/subagent.md +467 -0
  55. auto_optimize-1.0.0/skills/auto-optimize-code/references/symptoms.md +67 -0
  56. auto_optimize-1.0.0/skills/auto-optimize-code/references/writing-briefs.md +117 -0
  57. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/attribution.py +156 -0
  58. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/autoopt.py +12863 -0
  59. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/check_seeding.py +334 -0
  60. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/cold.py +90 -0
  61. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/dashboard/README.md +165 -0
  62. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/dashboard/autoopt_monitor.py +850 -0
  63. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/dashboard/gpu_scan.py +954 -0
  64. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/dashboard/monitor_writer.py +684 -0
  65. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/dashboard/scan.py +1030 -0
  66. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/dashboard/static/dashboard.css +775 -0
  67. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/dashboard/static/dashboard.js +3652 -0
  68. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/dashboard/static/index.html +191 -0
  69. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/issue_body.py +2118 -0
  70. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/lint_text.py +448 -0
  71. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/opt_pr_body.py +894 -0
  72. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/opt_pr_tables.py +367 -0
  73. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/paired.py +188 -0
  74. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/preflight.py +280 -0
  75. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/probe_run.py +72 -0
  76. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/publish.py +385 -0
  77. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/run_iteration.py +1382 -0
  78. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/ship.py +1193 -0
  79. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/stages.py +651 -0
  80. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/tests_pr_body.py +1267 -0
  81. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/tests_pr_push.py +426 -0
  82. auto_optimize-1.0.0/skills/auto-optimize-code/scripts/tests_pr_tables.py +779 -0
  83. auto_optimize-1.0.0/src/auto_optimize/__init__.py +3 -0
  84. auto_optimize-1.0.0/src/auto_optimize/__main__.py +5 -0
  85. auto_optimize-1.0.0/src/auto_optimize/cli.py +651 -0
  86. auto_optimize-1.0.0/tests/code/dashboard/README.md +80 -0
  87. auto_optimize-1.0.0/tests/code/dashboard/make_fixture.py +426 -0
  88. auto_optimize-1.0.0/tests/code/dashboard/spacing_check.py +313 -0
  89. auto_optimize-1.0.0/tests/code/dashboard/test_frontend.py +3634 -0
  90. auto_optimize-1.0.0/tests/code/dashboard/test_notebook.py +284 -0
  91. auto_optimize-1.0.0/tests/code/fixtures/issue/data/bugs.tsv +9 -0
  92. auto_optimize-1.0.0/tests/code/fixtures/issue/data/prose.md +380 -0
  93. auto_optimize-1.0.0/tests/code/fixtures/issue/data/verify-logs/01-single-end-chr-order.log +9 -0
  94. auto_optimize-1.0.0/tests/code/fixtures/issue/data/verify-logs/02-bc-error-threshold-2-n.log +9 -0
  95. auto_optimize-1.0.0/tests/code/fixtures/issue/data/verify-logs/03-feature-matrix.log +3 -0
  96. auto_optimize-1.0.0/tests/code/fixtures/issue/data/verify-logs/04-sam-fasta-reads.log +18 -0
  97. auto_optimize-1.0.0/tests/code/fixtures/issue/data/verify-logs/05-paired-end-nondeterminism.log +25 -0
  98. auto_optimize-1.0.0/tests/code/fixtures/issue/data/verify-logs/06-truncated-gzip-input.log +9 -0
  99. auto_optimize-1.0.0/tests/code/fixtures/issue/data/verify-logs/07-single-end-64-threads.log +11 -0
  100. auto_optimize-1.0.0/tests/code/fixtures/issue/data/verify-logs/08-version-stdout.log +7 -0
  101. auto_optimize-1.0.0/tests/code/fixtures/issue/data/verify.tsv +9 -0
  102. auto_optimize-1.0.0/tests/code/fixtures/issue/expected.md +389 -0
  103. auto_optimize-1.0.0/tests/code/fixtures/tests_pr/data/collection.tsv +9 -0
  104. auto_optimize-1.0.0/tests/code/fixtures/tests_pr/data/coverage.tsv +7 -0
  105. auto_optimize-1.0.0/tests/code/fixtures/tests_pr/data/files.tsv +5 -0
  106. auto_optimize-1.0.0/tests/code/fixtures/tests_pr/data/names.tsv +5 -0
  107. auto_optimize-1.0.0/tests/code/fixtures/tests_pr/data/parts.tsv +5 -0
  108. auto_optimize-1.0.0/tests/code/fixtures/tests_pr/data/prose.md +54 -0
  109. auto_optimize-1.0.0/tests/code/fixtures/tests_pr/expected.md +79 -0
  110. auto_optimize-1.0.0/tests/code/run_tests.py +102 -0
  111. auto_optimize-1.0.0/tests/code/test_budget.py +275 -0
  112. auto_optimize-1.0.0/tests/code/test_end.py +494 -0
  113. auto_optimize-1.0.0/tests/code/test_issue_body.py +1312 -0
  114. auto_optimize-1.0.0/tests/code/test_lease.py +151 -0
  115. auto_optimize-1.0.0/tests/code/test_lint_text.py +137 -0
  116. auto_optimize-1.0.0/tests/code/test_preflight.py +268 -0
  117. auto_optimize-1.0.0/tests/code/test_probe_run.py +357 -0
  118. auto_optimize-1.0.0/tests/code/test_reading.py +329 -0
  119. auto_optimize-1.0.0/tests/code/test_records.py +121 -0
  120. auto_optimize-1.0.0/tests/code/test_runner.py +4896 -0
  121. auto_optimize-1.0.0/tests/code/test_runner_files.py +95 -0
  122. auto_optimize-1.0.0/tests/code/test_ship.py +769 -0
  123. auto_optimize-1.0.0/tests/code/test_shortcut.py +253 -0
  124. auto_optimize-1.0.0/tests/code/test_stages.py +361 -0
  125. auto_optimize-1.0.0/tests/code/test_tests_pr.py +931 -0
  126. auto_optimize-1.0.0/tests/code/test_tests_pr_push.py +381 -0
  127. auto_optimize-1.0.0/tests/code/test_toolchain.py +295 -0
  128. auto_optimize-1.0.0/tests/package/conftest.py +7 -0
  129. auto_optimize-1.0.0/tests/package/test_installer.py +346 -0
  130. auto_optimize-1.0.0/tests/package/test_skill_files.py +213 -0
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "auto-optimize",
3
+ "owner": {
4
+ "name": "Jacob Schreiber",
5
+ "url": "https://github.com/jmschrei"
6
+ },
7
+ "plugins": [
8
+ {
9
+ "name": "auto-optimize",
10
+ "source": "./",
11
+ "description": "Search for a faster, leaner or smaller implementation of code by running many small measured experiments, each in its own git worktree, and keeping what survives.",
12
+ "version": "1.0.0"
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "auto-optimize",
3
+ "version": "1.0.0",
4
+ "description": "Search for a faster, leaner or smaller implementation of code by running many small measured experiments, each in its own git worktree, and keeping what survives.",
5
+ "author": {
6
+ "name": "Jacob Schreiber",
7
+ "url": "https://programmable-genomics.github.io"
8
+ },
9
+ "homepage": "https://github.com/jmschrei/auto-optimize",
10
+ "repository": "https://github.com/jmschrei/auto-optimize",
11
+ "license": "MIT",
12
+ "keywords": ["optimization", "performance", "benchmarking", "speedup", "subagents"]
13
+ }
@@ -0,0 +1,11 @@
1
+ CLAUDE.md
2
+ claude_comments/
3
+ __pycache__/
4
+ *.pyc
5
+ .pytest_cache/
6
+ .ipynb_checkpoints/
7
+ .venv/
8
+ dist/
9
+ build/
10
+ *.egg-info/
11
+ .install.json
@@ -0,0 +1,112 @@
1
+ # Changelog
2
+
3
+ ## [1.0.0]
4
+
5
+ The first release: `auto-optimize-code`, a Claude Code skill that searches
6
+ for a faster, leaner or smaller implementation of code by running many small
7
+ measured experiments and keeping what survives; a Claude Code plugin that
8
+ carries it; and `auto-optimize`, a command that installs it. It runs on
9
+ Linux with Python 3.9 or later, and the skill's scripts use only the
10
+ standard library.
11
+
12
+ ### Installation
13
+
14
+ - The skill is one self-contained folder, `skills/auto-optimize-code/`, with
15
+ its own `LICENSE` and `VERSION`.
16
+ - The repository is a Claude Code plugin and its own marketplace:
17
+ `/plugin marketplace add jmschrei/auto-optimize`, then
18
+ `/plugin install auto-optimize@auto-optimize`.
19
+ - `uvx auto-optimize install` installs the skill without a clone: into
20
+ `~/.claude/skills/` (`$CLAUDE_CONFIG_DIR/skills/` when set), a project's
21
+ `.claude/skills/` with `--project`, or any folder with `-d`, copied or, with
22
+ `--symlink`, linked. It replaces only a copy it made itself unless given
23
+ `--force`, and a failed install leaves the previous copy in place.
24
+ - `auto-optimize uninstall` removes a copy the installer made; `list` shows
25
+ every copy Claude Code would load (user, project and plugin) and warns when
26
+ the skill is installed twice; `path` prints the installed folder; `doctor`
27
+ checks Linux, `python3`, git, tar and the dashboard's optional modules in
28
+ the `python3` the skill runs.
29
+
30
+ ### The search
31
+
32
+ - **Interview (step 0).** The number to improve and its direction; what must
33
+ not change and how strictly (bitwise, a tolerance or a correlation); what
34
+ to record without optimizing; runs per iteration; GPUs and the allocator
35
+ command; the iteration subagents' model; the budget; and where the search
36
+ lives. Every answer, and each default taken, goes into `spec.md`, which
37
+ every subagent reads.
38
+ - **Repository mode.** A copy of a git repository is searched, optionally
39
+ after step 1 writes a new unit-test suite for it and records the bugs that
40
+ suite finds. The original is never written to during the search.
41
+ - **Setup (step 2).** A setup subagent writes the benchmark, checks that the
42
+ seed controls what it should, proves that each gate catches a planted
43
+ fault, measures whether runs at once disturb each other, and runs the
44
+ baseline, A0.
45
+ - **Rounds (step 3).** An idea miner reads the profile and writes ideas by
46
+ category. An orchestrator subagent briefs one iteration subagent per idea,
47
+ each in its own git worktree forked from the current root, and the miner
48
+ refills the ideas as they run out.
49
+ - **Measurement and the keep rule.** `run_iteration.py` measures each
50
+ iteration over several seeded runs and judges it against its gates. A
51
+ change is kept when its median beats its parent's by more than the noise
52
+ band (`keep.band_k`, `keep.min_gain_pct`), or by a rule written in the
53
+ user's words (`promote=orchestrator`), and a kept change becomes the root
54
+ the next ideas build on. The package's own tests can gate every iteration
55
+ (`tests.command`), and an external validation can run once a round on
56
+ inputs the search never measures. Observers record other measures, such
57
+ as peak memory, the first call or tiny and very large inputs, without
58
+ deciding anything.
59
+ - **Budgets.** A number of iterations (`after.budget_iterations`), idea-miner
60
+ stages (`after.budget_stages`) or wall-clock hours (`after.budget_hours`).
61
+ - **The end (step 4).** The winner is timed against A0 in alternating,
62
+ separate processes, and `ended.md` gives the medians from A0 to the
63
+ winner, each gate's status and the paired verdict. A search can be
64
+ reopened with `end --reopen`.
65
+ - **Shipping (step 5).** The skill asks how to ship the winner and writes
66
+ nothing before the user approves a preview: the winner's files written
67
+ back where they were copied from (`ship.py apply`), a branch in the
68
+ original repository with one commit per kept change (`ship.py branch`), or
69
+ GitHub documents (the optimization PR, the unit-test PR and the bug
70
+ report), drafted from the search's own measurements, rendered together by
71
+ `ship.py rehearse` and posted by `ship.py post` only as the batch the user
72
+ reviewed. A fork is used for a repository the user cannot push to
73
+ (`after.pr_remote`, `after.pr_head_owner`).
74
+ - **Finish (step 6).** The winner is copied out with a final report, and the
75
+ disk is reclaimed on the user's word.
76
+ - **Resuming.** Everything a search needs is on disk: `NOTES.md` and
77
+ `stages.py` give the six stages and the next move, and a new session
78
+ resumes from there.
79
+ - **Reading a search.** Read-only commands answer questions about it:
80
+ `autoopt.py status`; `table`, every iteration filtered, sorted and cut as
81
+ text, TSV or JSON; `show`, one iteration on one screen; `path`, the kept
82
+ changes from A0 to the winner; and `tokens`, what the search's agents
83
+ spent.
84
+ - **The machine.** Busy checks read the CPUs' idle share from `/proc/stat`
85
+ (`busy_percent` sets when another process counts as busy), and GPU runs
86
+ start under the configured allocator (`gpu_command`).
87
+ - **Records.** `config.json`, `state.json`, `result.json` and `ended.json`
88
+ carry `schema_version` 1, and `config.json` records the skill that made the
89
+ search.
90
+
91
+ ### Dashboard
92
+
93
+ - A live dashboard in a JupyterLab notebook, `<work>/dashboard.ipynb`: the
94
+ objective by iteration with the frontier, the search tree, every run, the
95
+ GPUs and running processes, and each iteration's code change against its
96
+ parent and its README, opened from the charts and the tree.
97
+ - `final/dashboard.html`, a self-contained snapshot written when the search
98
+ ends, which opens in any browser (`autoopt_monitor.py --export`).
99
+
100
+ ### Documentation and examples
101
+
102
+ - The README walks through a real search on `examples/one-hot/`, a one-hot
103
+ encoder made 1,070 times faster, with screenshots in `docs/walkthrough/`
104
+ and its dashboard online.
105
+ - `examples/fasta-stats/` (a command-line tool, output byte-identical),
106
+ `examples/kmer-memory/` (peak memory as the objective, time observed) and
107
+ `examples/smooth-coverage/` (a 1e-9 tolerance gate) are shorter searches,
108
+ each with its prompt, its dashboard at the end and what it found.
109
+ - `references/extending.md` lists every setting, environment variable and
110
+ code hook; `references/reading-a-search.md` maps questions about a search
111
+ to the commands that answer them; `references/glossary.md` defines the
112
+ terms.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jacob Schreiber
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.