opencode-autoresearch 3.1.0-beta.2 → 3.3.0

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 (45) hide show
  1. package/.opencode-plugin/plugin.json +1 -1
  2. package/AGENTS.md +42 -0
  3. package/README.md +246 -30
  4. package/VERSION +1 -0
  5. package/dist/cli.js +508 -15
  6. package/dist/cli.js.map +1 -1
  7. package/dist/constants.d.ts +1 -5
  8. package/dist/constants.d.ts.map +1 -1
  9. package/dist/constants.js +1 -5
  10. package/dist/constants.js.map +1 -1
  11. package/dist/helpers.d.ts +1 -2
  12. package/dist/helpers.d.ts.map +1 -1
  13. package/dist/helpers.js +19 -10
  14. package/dist/helpers.js.map +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/run-manager.d.ts +2 -2
  18. package/dist/run-manager.d.ts.map +1 -1
  19. package/dist/run-manager.js +18 -16
  20. package/dist/run-manager.js.map +1 -1
  21. package/dist/subagent-pool.d.ts +6 -0
  22. package/dist/subagent-pool.d.ts.map +1 -1
  23. package/dist/subagent-pool.js +12 -2
  24. package/dist/subagent-pool.js.map +1 -1
  25. package/dist/types.d.ts +15 -38
  26. package/dist/types.d.ts.map +1 -1
  27. package/dist/wizard.d.ts.map +1 -1
  28. package/dist/wizard.js +2 -1
  29. package/dist/wizard.js.map +1 -1
  30. package/docs/ARCHITECTURE.md +134 -28
  31. package/docs/RELEASE.md +54 -25
  32. package/hooks/init.sh +6 -2
  33. package/hooks/status.sh +4 -3
  34. package/hooks/stop.sh +10 -6
  35. package/hooks/verify-package.sh +78 -0
  36. package/package.json +34 -14
  37. package/skills/autoresearch/SKILL.md +29 -4
  38. package/skills/autoresearch/references/core-principles.md +3 -3
  39. package/skills/autoresearch/references/interaction-wizard.md +1 -1
  40. package/skills/autoresearch/references/loop-workflow.md +4 -4
  41. package/skills/autoresearch/references/plan-workflow.md +2 -2
  42. package/skills/autoresearch/references/results-logging.md +1 -1
  43. package/skills/autoresearch/references/self-improve-loop.md +255 -0
  44. package/skills/autoresearch/references/state-management.md +3 -3
  45. package/skills/autoresearch/references/subagent-orchestration.md +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autoresearch",
3
- "version": "3.1.0-beta.2",
3
+ "version": "3.3.0",
4
4
  "description": "Auto Research for OpenCode. Run a structured autonomous iteration loop with a standing subagent pool.",
5
5
  "author": {
6
6
  "name": "Maleick",
package/AGENTS.md ADDED
@@ -0,0 +1,42 @@
1
+ # Auto Research Agent Guide
2
+
3
+ Auto Research is an OpenCode-only autonomous iteration engine with recursive self-improvement capabilities.
4
+
5
+ ## Runtime Policy
6
+
7
+ - OpenCode is the only supported runtime.
8
+ - The iteration engine is subagent-first: a standing pool of specialized subagents supports the orchestrator.
9
+ - Mechanical verification is mandatory — no keep decisions on intuition alone.
10
+ - Background runs support overnight unattended operation.
11
+
12
+ ## Local State
13
+
14
+ `.autoresearch/` is runtime state and must not be committed.
15
+
16
+ ## Verification
17
+
18
+ Before claiming work is complete, run:
19
+
20
+ ```bash
21
+ npm run typecheck
22
+ npm run build
23
+ npm run verify:pack
24
+ ```
25
+
26
+ ## Self-Improvement
27
+
28
+ Auto Research can run on itself. See `skills/autoresearch/references/self-improve-loop.md` for recursive loop semantics.
29
+
30
+ When running self-improvement:
31
+
32
+ 1. Define a measurable meta-goal.
33
+ 2. Use `--mode background` for long runs.
34
+ 3. Always set a `--guard` command to catch regressions.
35
+ 4. Review `autoresearch-memory.md` between meta-iterations.
36
+
37
+ ## Docs
38
+
39
+ - [README.md](README.md) — Product overview
40
+ - [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) — Architecture reference
41
+ - [docs/RELEASE.md](docs/RELEASE.md) — Release process
42
+ - [wiki/Home.md](wiki/Home.md) — Wiki index
package/README.md CHANGED
@@ -1,43 +1,197 @@
1
1
  # Auto Research
2
2
 
3
- [![GitHub Release](https://img.shields.io/github/v/release/Maleick/AutoResearch?style=flat-square&label=release)](https://github.com/Maleick/AutoResearch/releases)
4
- [![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](LICENSE)
5
- [![Runtime](https://img.shields.io/badge/runtime-OpenCode-0F766E?style=flat-square)](.)
3
+ <p align="center">
4
+ <img src="assets/autoresearch-banner.svg" width="900" alt="Auto Research — Autonomous recursive self-improvement engine" />
5
+ </p>
6
6
 
7
- > **v3.1.0** — OpenCode-only npm package
7
+ <p align="center">
8
+ <a href="https://github.com/Maleick/AutoResearch/stargazers"><img src="https://img.shields.io/github/stars/Maleick/AutoResearch?style=flat&color=58a6ff" alt="Stars"></a>
9
+ <a href="https://github.com/Maleick/AutoResearch/commits/main"><img src="https://img.shields.io/github/last-commit/Maleick/AutoResearch?style=flat" alt="Last Commit"></a>
10
+ <a href="https://github.com/Maleick/AutoResearch/releases"><img src="https://img.shields.io/github/v/release/Maleick/AutoResearch?style=flat" alt="Version"></a>
11
+ <a href="LICENSE"><img src="https://img.shields.io/github/license/Maleick/AutoResearch?style=flat" alt="License"></a>
12
+ <a href="https://autoresearch.teamoperator.red"><img src="https://img.shields.io/badge/docs-autoresearch.teamoperator.red-blue?style=flat" alt="Docs"></a>
13
+ </p>
8
14
 
9
- Auto Research is a subagent-first autonomous iteration engine for OpenCode. It keeps the existing `/autoresearch` command surface intact and adds specialized mode workflows.
15
+ <p align="center">
16
+ <a href="https://autoresearch.teamoperator.red">Docs</a> •
17
+ <a href="https://github.com/Maleick/AutoResearch/wiki">Wiki</a> •
18
+ <a href="#commands">Commands</a> •
19
+ <a href="#runtime">Runtime</a> •
20
+ <a href="#self-improvement-loop">Self-Improvement</a>
21
+ </p>
10
22
 
11
- Inspired by [Karpathy's autoresearch](https://github.com/karpathy/autoresearch). The core loop is still the same:
23
+ <p align="center"><strong>Autonomous recursive self-improvement engine for OpenCode.</strong></p>
12
24
 
13
- **Modify -> Verify -> Keep or Discard -> Repeat**
25
+ ```text
26
+ ┌──────────────────────────────────────────────┐
27
+ │ ITERATION MODEL Subagent-first │
28
+ │ ORCHESTRATION Standing pool │
29
+ │ VERIFICATION Mechanical metrics │
30
+ │ PERSISTENCE State + Memory │
31
+ │ META-LEARNING Strategy adaptation │
32
+ └──────────────────────────────────────────────┘
33
+ ```
14
34
 
15
- ## Runtime surfaces
35
+ ## What It Does
16
36
 
17
- | Surface | Entry point |
18
- | --- | --- |
19
- | OpenCode | `/autoresearch`, `/autoresearch:plan`, `/autoresearch:debug`, `/autoresearch:fix`, `/autoresearch:learn`, `/autoresearch:predict`, `/autoresearch:scenario`, `/autoresearch:security`, `/autoresearch:ship` |
37
+ Auto Research is a **subagent-first autonomous iteration engine** that runs structured improve-verify loops inside OpenCode. Unlike simple task runners, it maintains a standing pool of specialized subagents, persists learnings across iterations, and can run recursive self-improvement loops on its own codebase.
38
+
39
+ - **Plans** experiments from a measurable goal
40
+ - **Modifies** one focused change per iteration
41
+ - **Verifies** mechanically — never on intuition alone
42
+ - **Keeps or discards** based on strict metric improvement
43
+ - **Learns** from patterns across iterations
44
+ - **Repeats** until the stop condition is met
45
+
46
+ ## The Core Loop
47
+
48
+ ```mermaid
49
+ flowchart LR
50
+ A[Plan] --> B[Modify]
51
+ B --> C[Verify]
52
+ C --> D{Keep?}
53
+ D -->|yes| E[Learn]
54
+ D -->|no| B
55
+ E --> F[Memory]
56
+ F --> A
57
+ ```
58
+
59
+ ```mermaid
60
+ flowchart TD
61
+ A[Goal + Metric + Verify] --> B[Baseline]
62
+ B --> C[Standing Pool Init]
63
+ C --> D[Iteration N]
64
+ D --> E[Subagent Context]
65
+ E --> F[Focused Change]
66
+ F --> G[Mechanical Verify]
67
+ G --> H{Strict Improvement?}
68
+ H -->|yes| I[Keep + Record]
69
+ H -->|no| J[Discard + Reset]
70
+ I --> K{Stop Condition?}
71
+ J --> K
72
+ K -->|no| D
73
+ K -->|yes| L[Report + Memory]
74
+ ```
75
+
76
+ ## The Self-Improvement Loop
77
+
78
+ Auto Research can run on itself. The recursive loop adds a meta-orchestrator that:
79
+
80
+ ```mermaid
81
+ flowchart TD
82
+ A[Meta-Goal: Improve AutoResearch] --> B[Run Child Loop]
83
+ B --> C[Measure: Tests pass? Docs improved?]
84
+ C --> D{Child Success?}
85
+ D -->|yes| E[Update Memory + Strategy]
86
+ D -->|no| F[Adapt Approach]
87
+ E --> G[Persist Learnings]
88
+ F --> B
89
+ G --> H[Meta-Report]
90
+ H --> I{Meta-Stop?}
91
+ I -->|no| B
92
+ I -->|yes| J[Archive Run]
93
+ ```
20
94
 
21
- ## Install
95
+ See [`skills/autoresearch/references/self-improve-loop.md`](skills/autoresearch/references/self-improve-loop.md) for the full recursive loop specification.
96
+
97
+ ## Installation
98
+
99
+ Install the CLI globally if you want Auto Research available long-term on your PATH:
22
100
 
23
101
  ```bash
24
102
  npm install -g opencode-autoresearch
25
103
  opencode-autoresearch doctor
26
104
  ```
27
105
 
28
- See [docs/OPENCODE_INSTALL.md](docs/OPENCODE_INSTALL.md) for full install and verification steps.
106
+ For a one-time install without keeping a global CLI, use `bunx` instead:
107
+
108
+ ```bash
109
+ bunx opencode-autoresearch install
110
+ bunx opencode-autoresearch doctor
111
+ ```
112
+
113
+ Then start the setup wizard inside OpenCode:
114
+
115
+ ```text
116
+ /autoresearch
117
+ ```
118
+
119
+ ## Quick Start
29
120
 
30
- ## Core loop
121
+ ```bash
122
+ # 1. Install the CLI globally
123
+ npm install -g opencode-autoresearch
124
+
125
+ # 2. Verify installation
126
+ opencode-autoship doctor
31
127
 
32
- Auto Research requires a goal, scope, and a mechanical verification command. It then:
128
+ # 3. Navigate to your project
129
+ cd ~/Projects/my-project
33
130
 
34
- 1. Baselines the current state.
35
- 2. Makes one focused experiment.
36
- 3. Verifies it mechanically.
37
- 4. Keeps strict improvements and discards regressions.
38
- 5. Records the result and continues until the stop condition is met.
131
+ # 4. Start Auto Research in OpenCode
132
+ /autoresearch
133
+ ```
39
134
 
40
- ## Runtime artifacts
135
+ ## Runtime Surfaces
136
+
137
+ | Surface | Entry point |
138
+ | --- | --- |
139
+ | OpenCode | `/autoresearch`, `/autoresearch:plan`, `/autoresearch:debug`, `/autoresearch:fix`, `/autoresearch:learn`, `/autoresearch:predict`, `/autoresearch:scenario`, `/autoresearch:security`, `/autoresearch:ship` |
140
+
141
+ ## Commands
142
+
143
+ | Command | Purpose |
144
+ | --- | --- |
145
+ | `/autoresearch` | Default improve-verify loop |
146
+ | `/autoresearch:plan` | Planning workflow |
147
+ | `/autoresearch:debug` | Debugging workflow |
148
+ | `/autoresearch:fix` | Fix workflow |
149
+ | `/autoresearch:learn` | Learning workflow |
150
+ | `/autoresearch:predict` | Prediction workflow |
151
+ | `/autoresearch:scenario` | Scenario expansion |
152
+ | `/autoresearch:security` | Security review |
153
+ | `/autoresearch:ship` | Ship-readiness workflow |
154
+
155
+ ## CLI Commands
156
+
157
+ | Command | Purpose |
158
+ | --- | --- |
159
+ | `autoresearch init` | Initialize a run |
160
+ | `autoresearch wizard` | Generate setup summary |
161
+ | `autoresearch status` | Print run status |
162
+ | `autoresearch explain` | Human-readable run state |
163
+ | `autoresearch history` | Show recent iteration log |
164
+ | `autoresearch config` | Show runtime configuration |
165
+ | `autoresearch report` | Generate markdown report |
166
+ | `autoresearch summary` | Aggregate stats across runs |
167
+ | `autoresearch suggest` | Suggest next goal from memory |
168
+ | `autoresearch launch` | Launch background run |
169
+ | `autoresearch stop` | Request stop |
170
+ | `autoresearch resume` | Resume background run |
171
+ | `autoresearch complete` | Mark run complete |
172
+ | `autoresearch record` | Record iteration result |
173
+ | `autoresearch export` | Export run data (json/md) |
174
+ | `autoresearch completion` | Generate shell completions |
175
+ | `autoresearch doctor` | Verify installation |
176
+ | `autoresearch help` | Show usage |
177
+
178
+ ## Architecture
179
+
180
+ ```mermaid
181
+ flowchart LR
182
+ A[OpenCode /autoresearch] --> B[CLI]
183
+ B --> C[Run Manager]
184
+ C --> D[State JSON]
185
+ C --> E[Results TSV]
186
+ C --> F[Subagent Pool]
187
+ F --> G[Orchestrator]
188
+ F --> H[Scout]
189
+ F --> I[Analyst]
190
+ F --> J[Verifier]
191
+ F --> K[Synthesizer]
192
+ ```
193
+
194
+ ## Runtime Artifacts
41
195
 
42
196
  | Artifact | Purpose |
43
197
  | --- | --- |
@@ -45,24 +199,81 @@ Auto Research requires a goal, scope, and a mechanical verification command. It
45
199
  | `autoresearch-results.tsv` | Iteration log |
46
200
  | `autoresearch-report.md` | End-of-run report |
47
201
  | `autoresearch-memory.md` | Reusable memory for later runs |
202
+ | `.autoresearch/launch.json` | Background launch manifest |
203
+
204
+ ## Self-Improvement Mode
205
+
206
+ Run Auto Research on its own codebase:
207
+
208
+ ```bash
209
+ # Initialize a recursive self-improvement run
210
+ autoresearch init \
211
+ --goal "Improve test coverage and documentation" \
212
+ --metric "coverage_pct" \
213
+ --direction "higher" \
214
+ --verify "npm run test:coverage" \
215
+ --guard "npm run typecheck" \
216
+ --mode "background" \
217
+ --iterations "20"
218
+
219
+ # Check status
220
+ autoresearch status
221
+
222
+ # Resume if stopped
223
+ autoresearch resume
224
+ ```
225
+
226
+ The self-improvement loop:
227
+ 1. Baselines current state (tests, docs, metrics)
228
+ 2. Dispatches subagents to identify improvement opportunities
229
+ 3. Makes one focused change per iteration
230
+ 4. Verifies mechanically (tests, typechecks, lint)
231
+ 5. Keeps strict improvements, discards regressions
232
+ 6. Records patterns to `autoresearch-memory.md`
233
+ 7. Adapts strategy when repeated discards occur
234
+ 8. Continues until iteration cap or goal met
235
+
236
+ ## Subagent Pool
237
+
238
+ The standing pool provides specialized roles reused across iterations:
239
+
240
+ | Role | Purpose |
241
+ | --- | --- |
242
+ | `orchestrator` | Owns goal, state, and keep/discard decisions |
243
+ | `scout` | Gathers context and surfaces opportunities |
244
+ | `analyst` | Challenges hypotheses and identifies risks |
245
+ | `verifier` | Runs mechanical verification independently |
246
+ | `synthesizer` | Compiles findings into next iteration plan |
247
+ | `security_reviewer` | Security-focused review variant |
248
+ | `debugger` | Debug workflow specialization |
249
+ | `release_guard` | Ship-readiness verification |
250
+ | `research_tracker` | Pattern tracking across iterations |
48
251
 
49
252
  ## Development
50
253
 
51
254
  ```bash
52
- npm run typecheck # Type check the TypeScript sources
255
+ npm run typecheck # TypeScript strict checks
53
256
  npm run build # Compile TypeScript to dist/
54
- npm pack --dry-run # Preview shipped package contents
257
+ npm run test # Run test suite
258
+ npm pack --dry-run # Preview shipped package contents
55
259
  ```
56
260
 
57
- ## Repository layout
261
+ ## Repository Layout
58
262
 
59
263
  ```text
60
- src/ # TypeScript source (runtime helpers, CLI, subagent pool)
61
- dist/ # Compiled JavaScript output
62
- commands/ # OpenCode command surfaces
264
+ src/ # TypeScript source (runtime helpers, CLI, subagent pool)
265
+ dist/ # Compiled JavaScript output
266
+ commands/ # OpenCode command surfaces
63
267
  skills/autoresearch/ # Skill bundle with references
64
- hooks/ # Shell hooks for session lifecycle
65
- docs/ # Install and architecture docs
268
+ references/ # Workflow and runtime references
269
+ core-principles.md # Loop discipline
270
+ loop-workflow.md # Main iteration workflow
271
+ subagent-orchestration.md # Pool management
272
+ state-management.md # State semantics
273
+ self-improve-loop.md # Recursive self-improvement
274
+ hooks/ # Shell hooks for session lifecycle
275
+ docs/ # Install and architecture docs
276
+ wiki/ # GitHub wiki pages
66
277
  .autoresearch/ # Runtime state directory
67
278
  .opencode-plugin/ # Plugin manifest
68
279
  ```
@@ -71,4 +282,9 @@ docs/ # Install and architecture docs
71
282
 
72
283
  - This is an **OpenCode-only** package. No Claude or Codex runtime is supported.
73
284
  - The CLI uses Node.js ESM modules.
74
- - Python scripts were used in earlier releases and are no longer shipped.
285
+ - Self-improvement loops require `--mode background` for long-running unattended operation.
286
+ - Memory files (`autoresearch-memory.md`) are portable across runs and repositories.
287
+
288
+ ## License
289
+
290
+ MIT — See [LICENSE](LICENSE) for details.
package/VERSION ADDED
@@ -0,0 +1 @@
1
+ 3.3.0