opencode-autoresearch 3.1.0 → 3.3.1
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/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 +7 -3
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +100 -20
- package/dist/helpers.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.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 +24 -22
- 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 +135 -28
- package/docs/QUICKSTART.md +103 -0
- package/docs/RELEASE.md +54 -25
- package/docs/superpowers/plans/2026-05-03-install-release-security.md +855 -0
- package/docs/superpowers/specs/2026-05-03-install-release-security-design.md +80 -0
- 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 +35 -14
- package/plugins/autoresearch.ts +13 -0
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-pool.d.ts","sourceRoot":"","sources":["../src/subagent-pool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"subagent-pool.d.ts","sourceRoot":"","sources":["../src/subagent-pool.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAiDD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiD1B;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAW7E"}
|
package/dist/subagent-pool.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const ROLE_LIMIT = 6;
|
|
2
|
+
let poolKeyCounter = 0;
|
|
2
3
|
const RESOURCE_TIERS = {
|
|
3
4
|
lite: ["orchestrator", "scout", "verifier"],
|
|
4
5
|
balanced: ["orchestrator", "scout", "analyst", "verifier"],
|
|
@@ -16,10 +17,19 @@ const SPECIAL_ROLES = [
|
|
|
16
17
|
{ id: "debugger", name: "Debugger", focus: "Reproduce failures, isolate causes, and narrow the repair path.", triggers: ["debug", "fix", "bug", "error", "fail", "failing"] },
|
|
17
18
|
{ id: "release_guard", name: "Release Guard", focus: "Check ship-readiness, rollout risk, and user-visible regressions.", triggers: ["ship", "release", "deploy", "rollout"] },
|
|
18
19
|
{ id: "research_tracker", name: "Research Tracker", focus: "Collect background, comparisons, and scenario coverage for the loop.", triggers: ["learn", "research", "predict", "scenario"] },
|
|
20
|
+
{ id: "meta_orchestrator", name: "Meta Orchestrator", focus: "Owns meta-goal and child loop decisions for self-improvement runs.", triggers: ["self-improve", "recursive", "meta", "improve itself", "improve auto"] },
|
|
21
|
+
{ id: "pattern_analyst", name: "Pattern Analyst", focus: "Extract reusable patterns from child loop results across meta-iterations.", triggers: ["self-improve", "recursive", "meta", "pattern"] },
|
|
22
|
+
{ id: "strategy_advisor", name: "Strategy Advisor", focus: "Recommend tactic changes when repeated discards occur across meta-iterations.", triggers: ["self-improve", "recursive", "meta", "adapt", "strategy"] },
|
|
23
|
+
{ id: "regression_guard", name: "Regression Guard", focus: "Extra verification for self-modification scenarios to catch regressions.", triggers: ["self-improve", "recursive", "meta", "regression", "guard"] },
|
|
24
|
+
{ id: "doc_reviewer", name: "Doc Reviewer", focus: "Review documentation changes for accuracy, clarity, and completeness.", triggers: ["doc", "docs", "documentation", "wiki", "readme"] },
|
|
25
|
+
{ id: "test_designer", name: "Test Designer", focus: "Design tests for new functionality and identify coverage gaps.", triggers: ["test", "coverage", "tdd"] },
|
|
19
26
|
];
|
|
20
27
|
function chooseSpecialRole(goal, scope, mode) {
|
|
21
28
|
const lowered = `${goal} ${scope ?? ""} ${mode}`.toLowerCase();
|
|
22
|
-
return SPECIAL_ROLES.find((r) => r.triggers?.some((t) =>
|
|
29
|
+
return SPECIAL_ROLES.find((r) => r.triggers?.some((t) => {
|
|
30
|
+
const re = new RegExp("\\b" + t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "\\b", "i");
|
|
31
|
+
return re.test(lowered);
|
|
32
|
+
}));
|
|
23
33
|
}
|
|
24
34
|
function chooseResourceTier(goal, scope, mode, specialRole) {
|
|
25
35
|
if (mode === "background")
|
|
@@ -48,7 +58,7 @@ export function buildSubagentPoolPlan(params) {
|
|
|
48
58
|
return {
|
|
49
59
|
kind: "autoresearch_subagent_pool",
|
|
50
60
|
version: 1,
|
|
51
|
-
pool_key: `autoresearch-pool-${Date.now().toString(36)}`,
|
|
61
|
+
pool_key: `autoresearch-pool-${Date.now().toString(36)}-${poolKeyCounter++}`,
|
|
52
62
|
role_limit: ROLE_LIMIT,
|
|
53
63
|
standing_pool: true,
|
|
54
64
|
reuse_across_iterations: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-pool.js","sourceRoot":"","sources":["../src/subagent-pool.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,CAAC,CAAC;AACrB,MAAM,cAAc,GAA6B;IAC/C,IAAI,EAAE,CAAC,cAAc,EAAE,OAAO,EAAE,UAAU,CAAC;IAC3C,QAAQ,EAAE,CAAC,cAAc,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC;IAC1D,IAAI,EAAE,CAAC,cAAc,EAAE,OAAO,EAAE,SAAS,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}
|
|
5
|
+
export interface ArtifactPaths {
|
|
6
|
+
results: string;
|
|
7
|
+
state: string;
|
|
8
|
+
}
|
|
1
9
|
export interface RunConfig {
|
|
2
10
|
goal: string;
|
|
3
11
|
metric: string;
|
|
@@ -15,23 +23,10 @@ export interface RunConfig {
|
|
|
15
23
|
stop_condition?: string;
|
|
16
24
|
baseline?: string;
|
|
17
25
|
}
|
|
18
|
-
export
|
|
19
|
-
goal?: string;
|
|
20
|
-
scope?: string;
|
|
21
|
-
metric?: string;
|
|
22
|
-
direction?: string;
|
|
23
|
-
verify?: string;
|
|
24
|
-
guard?: string;
|
|
25
|
-
mode?: string;
|
|
26
|
-
iterations?: number;
|
|
27
|
-
duration?: string;
|
|
28
|
-
memory_path?: string;
|
|
29
|
-
required_keep_labels?: string[];
|
|
30
|
-
required_stop_labels?: string[];
|
|
31
|
-
stop_condition?: string;
|
|
26
|
+
export type WizardConfig = Partial<Omit<RunConfig, 'baseline'>> & {
|
|
32
27
|
rollback_strategy?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface Metric {
|
|
28
|
+
};
|
|
29
|
+
export interface Metric extends Record<string, unknown> {
|
|
35
30
|
name: string;
|
|
36
31
|
direction: string;
|
|
37
32
|
baseline?: string;
|
|
@@ -83,15 +78,9 @@ export interface RunState {
|
|
|
83
78
|
memory?: Record<string, unknown>;
|
|
84
79
|
subagent_pool?: Record<string, unknown>;
|
|
85
80
|
continuation_policy?: Record<string, unknown>;
|
|
86
|
-
label_requirements:
|
|
87
|
-
keep: string[];
|
|
88
|
-
stop: string[];
|
|
89
|
-
};
|
|
81
|
+
label_requirements: LabelRequirements;
|
|
90
82
|
stop_condition?: string;
|
|
91
|
-
artifact_paths:
|
|
92
|
-
results: string;
|
|
93
|
-
state: string;
|
|
94
|
-
};
|
|
83
|
+
artifact_paths: ArtifactPaths;
|
|
95
84
|
stats: RunStats;
|
|
96
85
|
flags: RunFlags;
|
|
97
86
|
last_iteration?: LastIteration;
|
|
@@ -107,23 +96,11 @@ export interface SupervisorSnapshot {
|
|
|
107
96
|
stats: RunStats;
|
|
108
97
|
last_iteration?: LastIteration;
|
|
109
98
|
results_rows: number;
|
|
110
|
-
artifact_paths:
|
|
99
|
+
artifact_paths: ArtifactPaths;
|
|
111
100
|
flags: RunFlags;
|
|
112
|
-
label_requirements:
|
|
101
|
+
label_requirements: LabelRequirements;
|
|
113
102
|
subagent_pool?: Record<string, unknown>;
|
|
114
103
|
continuation_policy?: Record<string, unknown>;
|
|
115
104
|
subagent_guidance?: Record<string, unknown>;
|
|
116
105
|
}
|
|
117
|
-
export interface Result {
|
|
118
|
-
timestamp: string;
|
|
119
|
-
iteration: string;
|
|
120
|
-
decision: string;
|
|
121
|
-
metric_value: string;
|
|
122
|
-
verify_status: string;
|
|
123
|
-
guard_status: string;
|
|
124
|
-
hypothesis: string;
|
|
125
|
-
change_summary: string;
|
|
126
|
-
labels: string;
|
|
127
|
-
note: string;
|
|
128
|
-
}
|
|
129
106
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAA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AM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,QAAQ,CAAC;IAChB,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,aAAa,CAAC;IAC9B,KAAK,EAAE,QAAQ,CAAC;IAChB,kBAAkB,EAAE,iBAAiB,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9C,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7C"}
|
package/dist/wizard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wizard.d.ts","sourceRoot":"","sources":["../src/wizard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"wizard.d.ts","sourceRoot":"","sources":["../src/wizard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAY/C,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,MAAM,EAAE,YAAY,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiDzB"}
|
package/dist/wizard.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { basename } from "path";
|
|
1
2
|
import { resolveRepo, normalizeDirection, normalizeMode, parseDurationSeconds, normalizeLabels, inferVerifyCommand, } from "./helpers.js";
|
|
2
3
|
import { buildSubagentPoolPlan, buildContinuationPolicy } from "./subagent-pool.js";
|
|
3
4
|
export function buildSetupSummary(repo, config) {
|
|
@@ -5,7 +6,7 @@ export function buildSetupSummary(repo, config) {
|
|
|
5
6
|
const direction = normalizeDirection(config.direction);
|
|
6
7
|
const mode = normalizeMode(config.mode);
|
|
7
8
|
const durationSeconds = parseDurationSeconds(config.duration);
|
|
8
|
-
const scope = config.scope ?? resolveRepo(repo)
|
|
9
|
+
const scope = config.scope ?? (basename(resolveRepo(repo)) || "current repository");
|
|
9
10
|
const subagentPool = buildSubagentPoolPlan({
|
|
10
11
|
goal: config.goal ?? "pending",
|
|
11
12
|
scope,
|
|
@@ -15,7 +16,7 @@ export function buildSetupSummary(repo, config) {
|
|
|
15
16
|
const missingRequired = [];
|
|
16
17
|
if (!config.goal)
|
|
17
18
|
missingRequired.push("goal");
|
|
18
|
-
if (
|
|
19
|
+
if (verify === "<set verify command>")
|
|
19
20
|
missingRequired.push("verify");
|
|
20
21
|
const stopReasons = [];
|
|
21
22
|
if (verify !== "<set verify command>") {
|
package/dist/wizard.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wizard.js","sourceRoot":"","sources":["../src/wizard.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAEpF,MAAM,UAAU,iBAAiB,CAC/B,IAAwB,EACxB,MAAoB;IAEpB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACvD,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,eAAe,GAAG,oBAAoB,CAAC,MAAM,CAAC,QAAQ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Y;QAC3B,mBAAmB,EAAE,kBAAkB;QACvC,oBAAoB,EAAE,eAAe,CAAC,MAAM,CAAC,oBAAoB,IAAI,EAAE,CAAC;QACxE,oBAAoB,EAAE,eAAe,CAAC,MAAM,CAAC,oBAAoB,IAAI,EAAE,CAAC;QACxE,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,aAAa,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QAChF,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,IAAI,yDAAyD;QACxG,gBAAgB,EAAE,eAAe;QACjC,SAAS;KACV,CAAC;AACJ,CAAC"}
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -1,48 +1,104 @@
|
|
|
1
1
|
# Auto Research Architecture
|
|
2
2
|
|
|
3
|
-
> Current reference for v3.
|
|
3
|
+
> Current reference for v3.3.0.
|
|
4
4
|
|
|
5
|
-
Auto Research is
|
|
5
|
+
Auto Research is an OpenCode-only npm package with recursive self-improvement capabilities. The runtime is Node.js ESM. All workflow semantics are preserved from earlier releases.
|
|
6
6
|
|
|
7
|
-
## Package
|
|
7
|
+
## Package Layout
|
|
8
8
|
|
|
9
9
|
```text
|
|
10
10
|
src/index.ts # Main plugin entry
|
|
11
|
-
src/cli.ts
|
|
12
|
-
src/constants.ts
|
|
13
|
-
src/types.ts
|
|
14
|
-
src/helpers.ts
|
|
15
|
-
src/wizard.ts
|
|
11
|
+
src/cli.ts # CLI entry point
|
|
12
|
+
src/constants.ts # Package constants (version, names, paths)
|
|
13
|
+
src/types.ts # TypeScript type definitions
|
|
14
|
+
src/helpers.ts # Runtime helpers (state, results, paths)
|
|
15
|
+
src/wizard.ts # Setup wizard
|
|
16
16
|
src/subagent-pool.ts # Subagent pool builder
|
|
17
17
|
src/run-manager.ts # Run lifecycle (init, record, status, stop, resume, complete)
|
|
18
18
|
commands/autoresearch.md # Main command
|
|
19
19
|
commands/autoresearch/*.md # Mode commands (plan, debug, fix, learn, etc.)
|
|
20
|
-
skills/autoresearch/
|
|
21
|
-
skills/autoresearch/references
|
|
22
|
-
hooks/init.sh
|
|
23
|
-
hooks/status.sh
|
|
24
|
-
hooks/stop.sh
|
|
25
|
-
|
|
26
|
-
docs/
|
|
27
|
-
|
|
28
|
-
.
|
|
20
|
+
skills/autoresearch/ # OpenCode skill bundle
|
|
21
|
+
skills/autoresearch/references/# Workflow and runtime references
|
|
22
|
+
hooks/init.sh # SessionStart hook
|
|
23
|
+
hooks/status.sh # Status hook
|
|
24
|
+
hooks/stop.sh # Stop hook
|
|
25
|
+
hooks/verify-package.sh # Package verification
|
|
26
|
+
docs/OPENCODE_INSTALL.md # OpenCode install guide
|
|
27
|
+
docs/ARCHITECTURE.md # This document
|
|
28
|
+
docs/RELEASE.md # Release process
|
|
29
|
+
plugins/autoresearch.ts # OpenCode plugin entry point
|
|
30
|
+
.opencode-plugin/plugin.json # OpenCode plugin manifest
|
|
31
|
+
.autoresearch/ # Runtime state directory (created at runtime)
|
|
29
32
|
```
|
|
30
33
|
|
|
31
|
-
##
|
|
34
|
+
## High-Level Architecture
|
|
35
|
+
|
|
36
|
+
```mermaid
|
|
37
|
+
flowchart LR
|
|
38
|
+
A[OpenCode /autoresearch] --> B[CLI]
|
|
39
|
+
B --> C[Run Manager]
|
|
40
|
+
C --> D[State JSON]
|
|
41
|
+
C --> E[Results TSV]
|
|
42
|
+
C --> F[Subagent Pool]
|
|
43
|
+
F --> G[Orchestrator]
|
|
44
|
+
F --> H[Scout]
|
|
45
|
+
F --> I[Analyst]
|
|
46
|
+
F --> J[Verifier]
|
|
47
|
+
F --> K[Synthesizer]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Core Loop
|
|
51
|
+
|
|
52
|
+
```mermaid
|
|
53
|
+
flowchart TD
|
|
54
|
+
A[Goal + Metric + Verify] --> B[Baseline]
|
|
55
|
+
B --> C[Standing Pool Init]
|
|
56
|
+
C --> D[Iteration N]
|
|
57
|
+
D --> E[Subagent Context]
|
|
58
|
+
E --> F[Focused Change]
|
|
59
|
+
F --> G[Mechanical Verify]
|
|
60
|
+
G --> H{Strict Improvement?}
|
|
61
|
+
H -->|yes| I[Keep + Record]
|
|
62
|
+
H -->|no| J[Discard + Reset]
|
|
63
|
+
I --> K{Stop Condition?}
|
|
64
|
+
J --> K
|
|
65
|
+
K -->|no| D
|
|
66
|
+
K -->|yes| L[Report + Memory]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Self-Improvement Loop
|
|
70
|
+
|
|
71
|
+
```mermaid
|
|
72
|
+
flowchart TD
|
|
73
|
+
A[Meta-Goal] --> B[Run Child Loop]
|
|
74
|
+
B --> C[Measure: Tests pass? Docs improved?]
|
|
75
|
+
C --> D{Child Success?}
|
|
76
|
+
D -->|yes| E[Update Memory + Strategy]
|
|
77
|
+
D -->|no| F[Adapt Approach]
|
|
78
|
+
E --> G[Persist Learnings]
|
|
79
|
+
F --> B
|
|
80
|
+
G --> H[Meta-Report]
|
|
81
|
+
H --> I{Meta-Stop?}
|
|
82
|
+
I -->|no| B
|
|
83
|
+
I -->|yes| J[Archive Run]
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Source of Truth
|
|
32
87
|
|
|
33
88
|
`src/` is authoritative for runtime behavior. `commands/` and `skills/` define the OpenCode surfaces.
|
|
34
89
|
|
|
35
|
-
## Runtime
|
|
90
|
+
## Runtime Artifacts
|
|
36
91
|
|
|
37
92
|
| Artifact | Purpose |
|
|
38
93
|
| --- | --- |
|
|
39
94
|
| `.autoresearch/state.json` | Current run checkpoint |
|
|
40
95
|
| `autoresearch-results.tsv` | Iteration log |
|
|
41
|
-
|
|
|
96
|
+
| `.autoresearch/launch.json` | Background launch request |
|
|
42
97
|
| `autoresearch-report.md` | End-of-run report |
|
|
43
98
|
| `autoresearch-memory.md` | Reusable run memory |
|
|
99
|
+
| `.autoresearch/self-improvement.md` | Self-improvement run state |
|
|
44
100
|
|
|
45
|
-
## Command
|
|
101
|
+
## Command Surface
|
|
46
102
|
|
|
47
103
|
| Command | Workflow |
|
|
48
104
|
| --- | --- |
|
|
@@ -56,7 +112,7 @@ docs/RELEASE.md # Release process
|
|
|
56
112
|
| `/autoresearch:security` | Security review |
|
|
57
113
|
| `/autoresearch:ship` | Ship-readiness workflow |
|
|
58
114
|
|
|
59
|
-
## CLI
|
|
115
|
+
## CLI Commands
|
|
60
116
|
|
|
61
117
|
| Command | Purpose |
|
|
62
118
|
| --- | --- |
|
|
@@ -68,21 +124,72 @@ docs/RELEASE.md # Release process
|
|
|
68
124
|
| `autoresearch resume` | Resume background run |
|
|
69
125
|
| `autoresearch complete` | Mark run complete |
|
|
70
126
|
| `autoresearch record` | Record iteration result |
|
|
127
|
+
| `autoresearch doctor` | Verify installation |
|
|
128
|
+
|
|
129
|
+
## Subagent Pool
|
|
130
|
+
|
|
131
|
+
```mermaid
|
|
132
|
+
flowchart LR
|
|
133
|
+
A[Subagent Pool] --> B[Orchestrator]
|
|
134
|
+
A --> C[Scout]
|
|
135
|
+
A --> D[Analyst]
|
|
136
|
+
A --> E[Verifier]
|
|
137
|
+
A --> F[Synthesizer]
|
|
138
|
+
A --> G[Specialists]
|
|
139
|
+
G --> H[Security Reviewer]
|
|
140
|
+
G --> I[Debugger]
|
|
141
|
+
G --> J[Release Guard]
|
|
142
|
+
G --> K[Research Tracker]
|
|
143
|
+
G --> L[Meta Orchestrator]
|
|
144
|
+
```
|
|
71
145
|
|
|
72
|
-
|
|
146
|
+
The standing pool provides:
|
|
73
147
|
|
|
74
|
-
|
|
148
|
+
| Role | Purpose |
|
|
149
|
+
| --- | --- |
|
|
150
|
+
| `orchestrator` | Owns goal, state, and keep/discard decisions |
|
|
151
|
+
| `scout` | Gathers context and surfaces opportunities |
|
|
152
|
+
| `analyst` | Challenges hypotheses and identifies risks |
|
|
153
|
+
| `verifier` | Runs mechanical verification independently |
|
|
154
|
+
| `synthesizer` | Compiles findings into next iteration plan |
|
|
155
|
+
| `security_reviewer` | Security-focused review variant |
|
|
156
|
+
| `debugger` | Debug workflow specialization |
|
|
157
|
+
| `release_guard` | Ship-readiness verification |
|
|
158
|
+
| `research_tracker` | Pattern tracking across iterations |
|
|
159
|
+
| `meta_orchestrator` | Owns meta-goal and child loop decisions (self-improvement) |
|
|
75
160
|
|
|
76
161
|
## Validation
|
|
77
162
|
|
|
78
163
|
1. `npm run typecheck` — TypeScript strict checks.
|
|
79
|
-
2. `npm
|
|
80
|
-
3.
|
|
164
|
+
2. `npm run build` — Compile to `dist/`.
|
|
165
|
+
3. `npm run verify:pack` — Package contents verification.
|
|
166
|
+
4. `npm test` — Run test suite.
|
|
167
|
+
5. Package install and `autoresearch doctor` verification.
|
|
168
|
+
|
|
169
|
+
## Release Pipeline
|
|
170
|
+
|
|
171
|
+
```mermaid
|
|
172
|
+
flowchart LR
|
|
173
|
+
A[Tag Push] --> B[Build]
|
|
174
|
+
B --> C[Type Check]
|
|
175
|
+
C --> D[Verify Pack]
|
|
176
|
+
D --> E[Tests]
|
|
177
|
+
E --> F[GitHub Release]
|
|
178
|
+
E --> G[npm Publish]
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
The release workflow is automated via GitHub Actions:
|
|
182
|
+
|
|
183
|
+
1. Push a `v*.*.*` tag
|
|
184
|
+
2. GitHub Actions builds, type-checks, verifies package, runs tests
|
|
185
|
+
3. Creates a GitHub Release with CHANGELOG section
|
|
186
|
+
4. Publishes to npm automatically
|
|
81
187
|
|
|
82
|
-
## Migration from
|
|
188
|
+
## Migration from Earlier Releases
|
|
83
189
|
|
|
84
190
|
- Results log is now `autoresearch-results.tsv` only (dropped `research-results.tsv`).
|
|
85
191
|
- State is now in `.autoresearch/state.json` (was `autoresearch-state.json` at root).
|
|
86
192
|
- Runtime helpers are TypeScript (`src/helpers.ts`) not Python.
|
|
87
193
|
- Plugin format is `.opencode-plugin/plugin.json`.
|
|
88
|
-
- The Claude and Codex plugin bundles (`plugins/autoresearch/`, `plugins/codex-autoresearch/`) are no longer shipped.
|
|
194
|
+
- The Claude and Codex plugin bundles (`plugins/autoresearch/`, `plugins/codex-autoresearch/`) are no longer shipped.
|
|
195
|
+
- Self-improvement loop added in v3.2.0.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Quick Start Guide
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install -g opencode-autoresearch
|
|
7
|
+
autoresearch doctor
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Basic Usage
|
|
11
|
+
|
|
12
|
+
### 1. Initialize a run
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
autoresearch init \
|
|
16
|
+
--goal "Improve response time" \
|
|
17
|
+
--metric "response_time_ms" \
|
|
18
|
+
--direction "lower" \
|
|
19
|
+
--verify "npm test"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### 2. Check status
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
autoresearch status
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 3. Record an iteration
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
autoresearch record \
|
|
32
|
+
--decision keep \
|
|
33
|
+
--metric-value "120" \
|
|
34
|
+
--verify-status pass \
|
|
35
|
+
--change-summary "Optimized database queries" \
|
|
36
|
+
--labels "perf,database"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 4. View history
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
autoresearch history
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 5. Complete the run
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
autoresearch complete
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Background Runs
|
|
52
|
+
|
|
53
|
+
For overnight or long-running improvements:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
autoresearch init \
|
|
57
|
+
--goal "Refactor codebase" \
|
|
58
|
+
--metric "complexity" \
|
|
59
|
+
--direction "lower" \
|
|
60
|
+
--verify "npm test" \
|
|
61
|
+
--mode background \
|
|
62
|
+
--iterations 20
|
|
63
|
+
|
|
64
|
+
autoresearch launch
|
|
65
|
+
# ... work on other things ...
|
|
66
|
+
autoresearch status
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Self-Improvement
|
|
70
|
+
|
|
71
|
+
Run AutoResearch on itself:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
autoresearch init \
|
|
75
|
+
--goal "Improve test coverage" \
|
|
76
|
+
--metric "test_count" \
|
|
77
|
+
--direction "higher" \
|
|
78
|
+
--verify "npm test" \
|
|
79
|
+
--mode background
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Shell Completion
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Bash
|
|
86
|
+
autoresearch completion --shell bash >> ~/.bashrc
|
|
87
|
+
|
|
88
|
+
# Zsh
|
|
89
|
+
autoresearch completion --shell zsh >> ~/.zshrc
|
|
90
|
+
|
|
91
|
+
# Fish
|
|
92
|
+
autoresearch completion --shell fish >> ~/.config/fish/completions/autoresearch.fish
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Exporting Results
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# JSON export
|
|
99
|
+
autoresearch export --format json > results.json
|
|
100
|
+
|
|
101
|
+
# Markdown report
|
|
102
|
+
autoresearch report > report.md
|
|
103
|
+
```
|
package/docs/RELEASE.md
CHANGED
|
@@ -1,56 +1,81 @@
|
|
|
1
1
|
# Release Process
|
|
2
2
|
|
|
3
|
-
This package uses npm publish for releases.
|
|
3
|
+
This package uses npm publish for releases. GitHub Actions automates the full release pipeline.
|
|
4
4
|
|
|
5
5
|
## Version Alignment
|
|
6
6
|
|
|
7
|
-
`VERSION`
|
|
7
|
+
`VERSION`, `package.json`, `src/constants.ts`, and `.opencode-plugin/plugin.json` must all stay aligned. The `VERSION` file is the canonical source of truth.
|
|
8
8
|
|
|
9
9
|
## Release Steps
|
|
10
10
|
|
|
11
11
|
### 1. Update version
|
|
12
12
|
|
|
13
|
-
Bump the version in `package.json` and `src/constants.ts`.
|
|
14
|
-
|
|
15
13
|
```bash
|
|
16
|
-
# Update
|
|
17
|
-
|
|
14
|
+
# Update VERSION file
|
|
15
|
+
echo "3.2.0" > VERSION
|
|
16
|
+
|
|
17
|
+
# Sync to package.json
|
|
18
|
+
npm version 3.2.0 --no-git-tag-version
|
|
18
19
|
|
|
19
20
|
# Sync to src/constants.ts
|
|
20
|
-
|
|
21
|
+
# Update the VERSION export manually or use sed
|
|
21
22
|
```
|
|
22
23
|
|
|
23
|
-
### 2. Build
|
|
24
|
+
### 2. Build and verify
|
|
24
25
|
|
|
25
26
|
```bash
|
|
27
|
+
npm ci
|
|
26
28
|
npm run build
|
|
29
|
+
npm run typecheck
|
|
30
|
+
npm run verify:pack
|
|
31
|
+
npm test
|
|
27
32
|
```
|
|
28
33
|
|
|
29
|
-
### 3.
|
|
34
|
+
### 3. Update CHANGELOG
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
Add a new section for the version in `CHANGELOG.md`:
|
|
37
|
+
|
|
38
|
+
```markdown
|
|
39
|
+
## [3.2.0] - YYYY-MM-DD
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
- Recursive self-improvement loop support
|
|
43
|
+
- Mermaid diagrams in documentation
|
|
44
|
+
- Enhanced subagent pool with meta-orchestrator role
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
- Updated README with banner and visual diagrams
|
|
48
|
+
- Improved wiki pages with architecture charts
|
|
33
49
|
```
|
|
34
50
|
|
|
35
|
-
### 4.
|
|
51
|
+
### 4. Commit and tag
|
|
36
52
|
|
|
37
53
|
```bash
|
|
38
|
-
|
|
54
|
+
git add -A
|
|
55
|
+
git commit -m "Release v3.2.0"
|
|
56
|
+
git tag v3.2.0
|
|
57
|
+
git push origin main v3.2.0
|
|
39
58
|
```
|
|
40
59
|
|
|
41
|
-
|
|
60
|
+
### 5. Automated release
|
|
42
61
|
|
|
43
|
-
|
|
62
|
+
GitHub Actions will:
|
|
44
63
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
64
|
+
1. Build and type-check
|
|
65
|
+
2. Verify package contents
|
|
66
|
+
3. Run tests
|
|
67
|
+
4. Create a GitHub Release with CHANGELOG section
|
|
68
|
+
5. Publish to npm
|
|
69
|
+
|
|
70
|
+
## Manual publish (fallback)
|
|
48
71
|
|
|
49
|
-
|
|
72
|
+
If you need to publish manually:
|
|
50
73
|
|
|
51
74
|
```bash
|
|
52
|
-
|
|
53
|
-
|
|
75
|
+
npm run build
|
|
76
|
+
npm run typecheck
|
|
77
|
+
npm run verify:pack
|
|
78
|
+
npm publish --access public
|
|
54
79
|
```
|
|
55
80
|
|
|
56
81
|
## Package Contents
|
|
@@ -61,7 +86,11 @@ The shipped package includes:
|
|
|
61
86
|
- `commands/` — OpenCode command surfaces (`autoresearch.md`, `autoresearch/*.md`)
|
|
62
87
|
- `skills/autoresearch/` — Skill bundle with references
|
|
63
88
|
- `hooks/` — Shell hooks for session lifecycle
|
|
64
|
-
- `docs/` — Installation and
|
|
65
|
-
- `.opencode-plugin/plugin.json` —
|
|
66
|
-
|
|
67
|
-
|
|
89
|
+
- `docs/` — Installation, architecture, and release docs
|
|
90
|
+
- `.opencode-plugin/plugin.json` — OpenCode plugin manifest
|
|
91
|
+
- `AGENTS.md` — Agent guide
|
|
92
|
+
- `VERSION` — Version marker
|
|
93
|
+
- `README.md` — Product overview
|
|
94
|
+
- `LICENSE` — MIT license
|
|
95
|
+
|
|
96
|
+
Runtime artifacts (`.autoresearch/`) and Node modules are **not** included.
|