opencode-autoresearch 3.1.0 → 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.
- package/.opencode-plugin/plugin.json +1 -1
- package/AGENTS.md +42 -0
- package/README.md +246 -30
- package/VERSION +1 -0
- package/dist/cli.js +687 -31
- package/dist/cli.js.map +1 -1
- package/dist/constants.d.ts +3 -7
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -7
- package/dist/constants.js.map +1 -1
- package/dist/helpers.d.ts +1 -2
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +23 -16
- package/dist/helpers.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/run-manager.d.ts +2 -2
- package/dist/run-manager.d.ts.map +1 -1
- package/dist/run-manager.js +18 -16
- package/dist/run-manager.js.map +1 -1
- package/dist/subagent-pool.d.ts +6 -0
- package/dist/subagent-pool.d.ts.map +1 -1
- package/dist/subagent-pool.js +12 -2
- package/dist/subagent-pool.js.map +1 -1
- package/dist/types.d.ts +15 -38
- package/dist/types.d.ts.map +1 -1
- package/dist/wizard.d.ts.map +1 -1
- package/dist/wizard.js +3 -2
- package/dist/wizard.js.map +1 -1
- package/docs/ARCHITECTURE.md +134 -28
- package/docs/RELEASE.md +54 -25
- package/hooks/init.sh +6 -2
- package/hooks/status.sh +4 -3
- package/hooks/stop.sh +10 -6
- package/hooks/verify-package.sh +78 -0
- package/package.json +34 -14
- package/skills/autoresearch/SKILL.md +29 -4
- package/skills/autoresearch/references/core-principles.md +3 -3
- package/skills/autoresearch/references/interaction-wizard.md +1 -1
- package/skills/autoresearch/references/loop-workflow.md +4 -4
- package/skills/autoresearch/references/plan-workflow.md +3 -3
- package/skills/autoresearch/references/results-logging.md +2 -2
- package/skills/autoresearch/references/self-improve-loop.md +255 -0
- package/skills/autoresearch/references/state-management.md +3 -3
- package/skills/autoresearch/references/subagent-orchestration.md +1 -1
- package/dist/complete.d.ts +0 -2
- package/dist/complete.d.ts.map +0 -1
- package/dist/complete.js +0 -36
- package/dist/complete.js.map +0 -1
- package/dist/init.d.ts +0 -2
- package/dist/init.d.ts.map +0 -1
- package/dist/init.js +0 -48
- package/dist/init.js.map +0 -1
- package/dist/launch.d.ts +0 -2
- package/dist/launch.d.ts.map +0 -1
- package/dist/launch.js +0 -51
- package/dist/launch.js.map +0 -1
- package/dist/record.d.ts +0 -2
- package/dist/record.d.ts.map +0 -1
- package/dist/record.js +0 -26
- package/dist/record.js.map +0 -1
- package/dist/resume.d.ts +0 -2
- package/dist/resume.d.ts.map +0 -1
- package/dist/resume.js +0 -20
- package/dist/resume.js.map +0 -1
- package/dist/status.d.ts +0 -2
- package/dist/status.d.ts.map +0 -1
- package/dist/status.js +0 -20
- package/dist/status.js.map +0 -1
- package/dist/stop.d.ts +0 -2
- package/dist/stop.d.ts.map +0 -1
- package/dist/stop.js +0 -20
- package/dist/stop.js.map +0 -1
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
>
|
|
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
|
-
|
|
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
|
-
|
|
23
|
+
<p align="center"><strong>Autonomous recursive self-improvement engine for OpenCode.</strong></p>
|
|
12
24
|
|
|
13
|
-
|
|
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
|
-
##
|
|
35
|
+
## What It Does
|
|
16
36
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
128
|
+
# 3. Navigate to your project
|
|
129
|
+
cd ~/Projects/my-project
|
|
33
130
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
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 #
|
|
255
|
+
npm run typecheck # TypeScript strict checks
|
|
53
256
|
npm run build # Compile TypeScript to dist/
|
|
54
|
-
npm
|
|
257
|
+
npm run test # Run test suite
|
|
258
|
+
npm pack --dry-run # Preview shipped package contents
|
|
55
259
|
```
|
|
56
260
|
|
|
57
|
-
## Repository
|
|
261
|
+
## Repository Layout
|
|
58
262
|
|
|
59
263
|
```text
|
|
60
|
-
src/
|
|
61
|
-
dist/
|
|
62
|
-
commands/
|
|
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
|
-
|
|
65
|
-
|
|
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
|
-
-
|
|
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
|