opencode-autoresearch 3.1.0-beta.2

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 (71) hide show
  1. package/.opencode-plugin/plugin.json +37 -0
  2. package/LICENSE +21 -0
  3. package/README.md +74 -0
  4. package/commands/autoresearch/debug.md +23 -0
  5. package/commands/autoresearch/fix.md +21 -0
  6. package/commands/autoresearch/learn.md +21 -0
  7. package/commands/autoresearch/plan.md +25 -0
  8. package/commands/autoresearch/predict.md +21 -0
  9. package/commands/autoresearch/scenario.md +21 -0
  10. package/commands/autoresearch/security.md +21 -0
  11. package/commands/autoresearch/ship.md +22 -0
  12. package/commands/autoresearch.md +45 -0
  13. package/dist/cli.d.ts +3 -0
  14. package/dist/cli.d.ts.map +1 -0
  15. package/dist/cli.js +202 -0
  16. package/dist/cli.js.map +1 -0
  17. package/dist/constants.d.ts +13 -0
  18. package/dist/constants.d.ts.map +1 -0
  19. package/dist/constants.js +13 -0
  20. package/dist/constants.js.map +1 -0
  21. package/dist/helpers.d.ts +19 -0
  22. package/dist/helpers.d.ts.map +1 -0
  23. package/dist/helpers.js +137 -0
  24. package/dist/helpers.js.map +1 -0
  25. package/dist/index.d.ts +4 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +3 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/run-manager.d.ts +9 -0
  30. package/dist/run-manager.d.ts.map +1 -0
  31. package/dist/run-manager.js +239 -0
  32. package/dist/run-manager.js.map +1 -0
  33. package/dist/subagent-pool.d.ts +7 -0
  34. package/dist/subagent-pool.d.ts.map +1 -0
  35. package/dist/subagent-pool.js +101 -0
  36. package/dist/subagent-pool.js.map +1 -0
  37. package/dist/types.d.ts +129 -0
  38. package/dist/types.d.ts.map +1 -0
  39. package/dist/types.js +2 -0
  40. package/dist/types.js.map +1 -0
  41. package/dist/wizard.d.ts +3 -0
  42. package/dist/wizard.d.ts.map +1 -0
  43. package/dist/wizard.js +56 -0
  44. package/dist/wizard.js.map +1 -0
  45. package/docs/ARCHITECTURE.md +88 -0
  46. package/docs/CNAME +1 -0
  47. package/docs/OPENCODE_INSTALL.md +48 -0
  48. package/docs/RELEASE.md +67 -0
  49. package/docs/autoresearch-loop.svg +95 -0
  50. package/docs/index.html +249 -0
  51. package/hooks/init.sh +21 -0
  52. package/hooks/status.sh +23 -0
  53. package/hooks/stop.sh +27 -0
  54. package/package.json +49 -0
  55. package/skills/autoresearch/SKILL.md +77 -0
  56. package/skills/autoresearch/references/core-principles.md +20 -0
  57. package/skills/autoresearch/references/debug-workflow.md +31 -0
  58. package/skills/autoresearch/references/fix-workflow.md +25 -0
  59. package/skills/autoresearch/references/interaction-wizard.md +33 -0
  60. package/skills/autoresearch/references/learn-workflow.md +15 -0
  61. package/skills/autoresearch/references/loop-workflow.md +35 -0
  62. package/skills/autoresearch/references/plan-workflow.md +42 -0
  63. package/skills/autoresearch/references/predict-workflow.md +15 -0
  64. package/skills/autoresearch/references/results-logging.md +29 -0
  65. package/skills/autoresearch/references/runtime-hard-invariants.md +13 -0
  66. package/skills/autoresearch/references/scenario-workflow.md +15 -0
  67. package/skills/autoresearch/references/security-workflow.md +15 -0
  68. package/skills/autoresearch/references/ship-workflow.md +15 -0
  69. package/skills/autoresearch/references/state-management.md +39 -0
  70. package/skills/autoresearch/references/structured-output-spec.md +34 -0
  71. package/skills/autoresearch/references/subagent-orchestration.md +42 -0
@@ -0,0 +1,129 @@
1
+ export interface RunConfig {
2
+ goal: string;
3
+ metric: string;
4
+ direction: string;
5
+ verify: string;
6
+ mode: string;
7
+ scope?: string;
8
+ guard?: string;
9
+ iterations?: number;
10
+ duration?: string;
11
+ memory_path?: string;
12
+ required_keep_labels?: string[];
13
+ required_stop_labels?: string[];
14
+ run_tag?: string;
15
+ stop_condition?: string;
16
+ baseline?: string;
17
+ }
18
+ export interface WizardConfig {
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;
32
+ rollback_strategy?: string;
33
+ }
34
+ export interface Metric {
35
+ name: string;
36
+ direction: string;
37
+ baseline?: string;
38
+ best?: string;
39
+ latest?: string;
40
+ }
41
+ export interface RunStats {
42
+ total_iterations: number;
43
+ kept: number;
44
+ discarded: number;
45
+ needs_human: number;
46
+ consecutive_discards: number;
47
+ best_iteration?: number;
48
+ }
49
+ export interface RunFlags {
50
+ stop_requested: boolean;
51
+ needs_human: boolean;
52
+ background_active: boolean;
53
+ stop_ready: boolean;
54
+ }
55
+ export interface LastIteration {
56
+ iteration: number;
57
+ decision: string;
58
+ metric_value?: string;
59
+ change_summary: string;
60
+ labels: string[];
61
+ timestamp: string;
62
+ keep_labels_satisfied: boolean;
63
+ stop_labels_satisfied: boolean;
64
+ missing_keep_labels: string[];
65
+ missing_stop_labels: string[];
66
+ }
67
+ export interface RunState {
68
+ schema_version: number;
69
+ run_id: string;
70
+ created_at: string;
71
+ updated_at: string;
72
+ status: string;
73
+ mode: string;
74
+ goal: string;
75
+ scope: string;
76
+ metric: Metric;
77
+ verify: string;
78
+ guard?: string;
79
+ iterations_cap?: number;
80
+ duration?: string;
81
+ duration_seconds?: number;
82
+ deadline_at?: string;
83
+ memory?: Record<string, unknown>;
84
+ subagent_pool?: Record<string, unknown>;
85
+ continuation_policy?: Record<string, unknown>;
86
+ label_requirements: {
87
+ keep: string[];
88
+ stop: string[];
89
+ };
90
+ stop_condition?: string;
91
+ artifact_paths: {
92
+ results: string;
93
+ state: string;
94
+ };
95
+ stats: RunStats;
96
+ flags: RunFlags;
97
+ last_iteration?: LastIteration;
98
+ }
99
+ export interface SupervisorSnapshot {
100
+ decision: string;
101
+ reason: string;
102
+ run_id: string;
103
+ status: string;
104
+ mode: string;
105
+ goal: string;
106
+ metric: Metric;
107
+ stats: RunStats;
108
+ last_iteration?: LastIteration;
109
+ results_rows: number;
110
+ artifact_paths: Record<string, string>;
111
+ flags: RunFlags;
112
+ label_requirements: Record<string, string[]>;
113
+ subagent_pool?: Record<string, unknown>;
114
+ continuation_policy?: Record<string, unknown>;
115
+ subagent_guidance?: Record<string, unknown>;
116
+ }
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
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,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,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAA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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,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,KAAK,EAAE,QAAQ,CAAC;IAChB,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7C,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;AAED,MAAM,WAAW,MAAM;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import type { WizardConfig } from "./types.js";
2
+ export declare function buildSetupSummary(repo: string | undefined, config: WizardConfig): Record<string, unknown>;
3
+ //# sourceMappingURL=wizard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wizard.d.ts","sourceRoot":"","sources":["../src/wizard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAW/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 ADDED
@@ -0,0 +1,56 @@
1
+ import { resolveRepo, normalizeDirection, normalizeMode, parseDurationSeconds, normalizeLabels, inferVerifyCommand, } from "./helpers.js";
2
+ import { buildSubagentPoolPlan, buildContinuationPolicy } from "./subagent-pool.js";
3
+ export function buildSetupSummary(repo, config) {
4
+ const verify = config.verify ?? inferVerifyCommand(repo);
5
+ const direction = normalizeDirection(config.direction);
6
+ const mode = normalizeMode(config.mode);
7
+ const durationSeconds = parseDurationSeconds(config.duration);
8
+ const scope = config.scope ?? resolveRepo(repo).split("/").pop() ?? "current repository";
9
+ const subagentPool = buildSubagentPoolPlan({
10
+ goal: config.goal ?? "pending",
11
+ scope,
12
+ mode: config.mode ?? "foreground",
13
+ });
14
+ const continuationPolicy = buildContinuationPolicy(mode);
15
+ const missingRequired = [];
16
+ if (!config.goal)
17
+ missingRequired.push("goal");
18
+ if (verify === "<set verify command>")
19
+ missingRequired.push("verify");
20
+ const stopReasons = [];
21
+ if (verify !== "<set verify command>") {
22
+ stopReasons.push(`\`${verify}\` reaches the target metric`);
23
+ }
24
+ if (config.iterations != null)
25
+ stopReasons.push(`${config.iterations} iterations complete`);
26
+ if (config.duration)
27
+ stopReasons.push(`${config.duration} elapses`);
28
+ const questions = [];
29
+ if (!config.goal)
30
+ questions.push({ id: "goal", prompt: "What outcome should this run optimize for?", reason: "The loop needs one concrete result to chase." });
31
+ if (!config.verify)
32
+ questions.push({ id: "verify", prompt: "What command should mechanically verify the metric?", reason: "The loop should not keep changes on intuition alone." });
33
+ if (!config.mode)
34
+ questions.push({ id: "mode", prompt: "Should the run stay in `foreground` or move to `background`?", reason: "The skill requires an explicit run-mode choice." });
35
+ return {
36
+ goal: config.goal,
37
+ scope,
38
+ metric: config.metric ?? "primary verify metric",
39
+ direction,
40
+ verify,
41
+ guard: config.guard,
42
+ mode,
43
+ iterations_cap: config.iterations,
44
+ duration: config.duration,
45
+ duration_seconds: durationSeconds,
46
+ subagent_pool: subagentPool,
47
+ continuation_policy: continuationPolicy,
48
+ required_keep_labels: normalizeLabels(config.required_keep_labels ?? []),
49
+ required_stop_labels: normalizeLabels(config.required_stop_labels ?? []),
50
+ stop_condition: config.stop_condition ?? `stop when ${stopReasons.join(" or ")}`,
51
+ rollback_strategy: config.rollback_strategy ?? "discard current experiment and keep last verified state",
52
+ missing_required: missingRequired,
53
+ questions,
54
+ };
55
+ }
56
+ //# sourceMappingURL=wizard.js.map
@@ -0,0 +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,CAAC,CAAC;IAC9D,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,oBAAoB,CAAC;IACzF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AAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,8DAA8D,EAAE,MAAM,EAAE,iDAAiD,EAAE,CAAC,CAAC;IAEpL,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK;QACL,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,uBAAuB;QAChD,SAAS;QACT,MAAM;QACN,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,IAAI;QACJ,cAAc,EAAE,MAAM,CAAC,UAAU;QACjC,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,gBAAgB,EAAE,eAAe;QACjC,aAAa,EAAE,YAAY;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"}
@@ -0,0 +1,88 @@
1
+ # Auto Research Architecture
2
+
3
+ > Current reference for v3.1.0.
4
+
5
+ Auto Research is now an OpenCode-only npm package. The runtime is Node.js ESM. All workflow semantics are preserved from earlier releases.
6
+
7
+ ## Package layout
8
+
9
+ ```text
10
+ src/index.ts # Main plugin entry
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
+ src/subagent-pool.ts # Subagent pool builder
17
+ src/run-manager.ts # Run lifecycle (init, record, status, stop, resume, complete)
18
+ commands/autoresearch.md # Main command
19
+ commands/autoresearch/*.md # Mode commands (plan, debug, fix, learn, etc.)
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
+ docs/OPENCODE_INSTALL.md # OpenCode install guide
26
+ docs/RELEASE.md # Release process
27
+ .opencode-plugin/plugin.json # OpenCode plugin manifest
28
+ .autoresearch/ # Runtime state directory (created at runtime)
29
+ ```
30
+
31
+ ## Source of truth
32
+
33
+ `src/` is authoritative for runtime behavior. `commands/` and `skills/` define the OpenCode surfaces.
34
+
35
+ ## Runtime artifacts
36
+
37
+ | Artifact | Purpose |
38
+ | --- | --- |
39
+ | `.autoresearch/state.json` | Current run checkpoint |
40
+ | `autoresearch-results.tsv` | Iteration log |
41
+ | `autoresearch-launch.json` | Background launch request |
42
+ | `autoresearch-report.md` | End-of-run report |
43
+ | `autoresearch-memory.md` | Reusable run memory |
44
+
45
+ ## Command surface
46
+
47
+ | Command | Workflow |
48
+ | --- | --- |
49
+ | `/autoresearch` | Default improve-verify loop |
50
+ | `/autoresearch:plan` | Planning workflow |
51
+ | `/autoresearch:debug` | Debugging workflow |
52
+ | `/autoresearch:fix` | Fix workflow |
53
+ | `/autoresearch:learn` | Learning workflow |
54
+ | `/autoresearch:predict` | Prediction workflow |
55
+ | `/autoresearch:scenario` | Scenario expansion |
56
+ | `/autoresearch:security` | Security review |
57
+ | `/autoresearch:ship` | Ship-readiness workflow |
58
+
59
+ ## CLI commands
60
+
61
+ | Command | Purpose |
62
+ | --- | --- |
63
+ | `autoresearch init` | Initialize a run |
64
+ | `autoresearch wizard` | Generate setup summary |
65
+ | `autoresearch status` | Print run status |
66
+ | `autoresearch launch` | Launch background run |
67
+ | `autoresearch stop` | Request stop |
68
+ | `autoresearch resume` | Resume background run |
69
+ | `autoresearch complete` | Mark run complete |
70
+ | `autoresearch record` | Record iteration result |
71
+
72
+ ## Subagent pool
73
+
74
+ The standing pool provides: orchestrator, scout, analyst, verifier, synthesizer, and role-specialized variants (security_reviewer, debugger, release_guard, research_tracker). The pool is reused across iterations unless drift or repeated discards force a reset.
75
+
76
+ ## Validation
77
+
78
+ 1. `npm run typecheck` — TypeScript strict checks.
79
+ 2. `npm pack --dry-run` — Package contents preview.
80
+ 3. Package install and `autoresearch doctor` verification.
81
+
82
+ ## Migration from earlier releases
83
+
84
+ - Results log is now `autoresearch-results.tsv` only (dropped `research-results.tsv`).
85
+ - State is now in `.autoresearch/state.json` (was `autoresearch-state.json` at root).
86
+ - Runtime helpers are TypeScript (`src/helpers.ts`) not Python.
87
+ - Plugin format is `.opencode-plugin/plugin.json`.
88
+ - The Claude and Codex plugin bundles (`plugins/autoresearch/`, `plugins/codex-autoresearch/`) are no longer shipped.
package/docs/CNAME ADDED
@@ -0,0 +1 @@
1
+ autoresearch.teamoperator.red
@@ -0,0 +1,48 @@
1
+ # OpenCode Install
2
+
3
+ Install `opencode-autoresearch` as a global npm package.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g opencode-autoresearch
9
+ ```
10
+
11
+ ## Verify Installation
12
+
13
+ ```bash
14
+ opencode-autoresearch doctor
15
+ ```
16
+
17
+ Should print the package version and confirm the plugin surfaces are in place.
18
+
19
+ ## OpenCode Plugin Registration
20
+
21
+ After install, the plugin is available as `autoresearch`:
22
+
23
+ - `/autoresearch` — Run the main improve-verify loop
24
+ - `/autoresearch:plan` — Planning workflow
25
+ - `/autoresearch:debug` — Debugging workflow
26
+ - `/autoresearch:fix` — Fix workflow
27
+ - `/autoresearch:learn` — Learning workflow
28
+ - `/autoresearch:predict` — Prediction workflow
29
+ - `/autoresearch:scenario` — Scenario expansion
30
+ - `/autoresearch:security` — Security review
31
+ - `/autoresearch:ship` — Ship-readiness workflow
32
+
33
+ ## Runtime Artifacts
34
+
35
+ After install, artifacts are stored in `.autoresearch/` under the working directory:
36
+
37
+ | Artifact | Purpose |
38
+ | --- | --- |
39
+ | `.autoresearch/state.json` | Current run state |
40
+ | `autoresearch-results.tsv` | Iteration log |
41
+ | `autoresearch-report.md` | End-of-run report |
42
+ | `autoresearch-memory.md` | Reusable memory |
43
+
44
+ ## Uninstall
45
+
46
+ ```bash
47
+ npm uninstall -g opencode-autoresearch
48
+ ```
@@ -0,0 +1,67 @@
1
+ # Release Process
2
+
3
+ This package uses npm publish for releases.
4
+
5
+ ## Version Alignment
6
+
7
+ `VERSION` in `src/constants.ts` and `version` in `package.json` must stay aligned. The `package.json` version is the canonical source of truth for npm.
8
+
9
+ ## Release Steps
10
+
11
+ ### 1. Update version
12
+
13
+ Bump the version in `package.json` and `src/constants.ts`.
14
+
15
+ ```bash
16
+ # Update package.json
17
+ npm version patch # or minor, major
18
+
19
+ # Sync to src/constants.ts
20
+ sed -i '' 's/"3\.\([0-9]\+\)\.[0-9]*"/"3.\1.\1"/' src/constants.ts
21
+ ```
22
+
23
+ ### 2. Build
24
+
25
+ ```bash
26
+ npm run build
27
+ ```
28
+
29
+ ### 3. Test
30
+
31
+ ```bash
32
+ npm run typecheck
33
+ ```
34
+
35
+ ### 4. Dry-run pack
36
+
37
+ ```bash
38
+ npm pack --dry-run
39
+ ```
40
+
41
+ Verify the output includes: `dist/`, `commands/`, `skills/`, `hooks/`, `docs/`, `.opencode-plugin/`.
42
+
43
+ ### 5. Publish
44
+
45
+ ```bash
46
+ npm publish
47
+ ```
48
+
49
+ ### 6. Tag
50
+
51
+ ```bash
52
+ git tag v$(node -p "require('./package.json').version")
53
+ git push origin v$(node -p "require('./package.json').version")
54
+ ```
55
+
56
+ ## Package Contents
57
+
58
+ The shipped package includes:
59
+
60
+ - `dist/` — Compiled TypeScript (CLI entry point, helpers, subagent pool, run manager)
61
+ - `commands/` — OpenCode command surfaces (`autoresearch.md`, `autoresearch/*.md`)
62
+ - `skills/autoresearch/` — Skill bundle with references
63
+ - `hooks/` — Shell hooks for session lifecycle
64
+ - `docs/` — Installation and architecture docs
65
+ - `.opencode-plugin/plugin.json` — Plugin manifest
66
+
67
+ Python scripts are **not** included in the shipped package.
@@ -0,0 +1,95 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 400" width="1200" height="400">
2
+ <defs>
3
+ <style>
4
+ .ui { font-family: 'Segoe UI', system-ui, sans-serif; }
5
+ .mono { font-family: 'Cascadia Code', 'Fira Code', monospace; }
6
+ </style>
7
+ <marker id="arr" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
8
+ <polygon points="0 0, 8 3, 0 6" fill="context-stroke"/>
9
+ </marker>
10
+ </defs>
11
+
12
+ <!-- Background -->
13
+ <rect width="1200" height="400" fill="#0d1117"/>
14
+
15
+ <!-- Section dividers -->
16
+ <line x1="390" y1="30" x2="390" y2="370" stroke="#21262d" stroke-width="1"/>
17
+ <line x1="830" y1="30" x2="830" y2="370" stroke="#21262d" stroke-width="1"/>
18
+
19
+ <!-- ===== LEFT: Title block ===== -->
20
+ <text x="56" y="138" class="ui" font-size="46" font-weight="700" fill="#e6edf3">autoresearch</text>
21
+ <text x="56" y="170" class="ui" font-size="14" fill="#8b949e">Cross-platform autonomous iteration engine</text>
22
+
23
+ <!-- v2.2.1 pill -->
24
+ <rect x="56" y="183" width="76" height="22" rx="11" fill="#1a2f1a"/>
25
+ <text x="94" y="198" class="ui" font-size="11" font-weight="600" fill="#30a14e" text-anchor="middle">v2.2.1</text>
26
+
27
+ <!-- Tagline -->
28
+ <text x="56" y="258" class="ui" font-size="15" fill="#c9d1d9">Fire it before bed.</text>
29
+ <text x="56" y="280" class="ui" font-size="15" fill="#c9d1d9">Review improvements in the morning.</text>
30
+
31
+ <!-- Core loop label -->
32
+ <text x="56" y="336" class="ui" font-size="11" fill="#58a6ff" letter-spacing="2">CORE LOOP</text>
33
+ <line x1="56" y1="342" x2="200" y2="342" stroke="#58a6ff" stroke-width="1" opacity="0.4"/>
34
+
35
+ <!-- ===== CENTER: Diamond loop diagram ===== -->
36
+ <!-- Arrow: MODIFY to VERIFY -->
37
+ <path d="M 658 108 Q 726 130 726 178" fill="none" stroke="#58a6ff" stroke-width="2" marker-end="url(#arr)"/>
38
+ <!-- Arrow: VERIFY to KEEP/DISCARD -->
39
+ <path d="M 726 222 Q 726 268 672 290" fill="none" stroke="#58a6ff" stroke-width="2" marker-end="url(#arr)"/>
40
+ <!-- Arrow: KEEP/DISCARD to REPEAT -->
41
+ <path d="M 548 300 Q 488 282 488 222" fill="none" stroke="#30a14e" stroke-width="2" marker-end="url(#arr)"/>
42
+ <!-- Arrow: REPEAT to MODIFY -->
43
+ <path d="M 488 178 Q 488 118 558 104" fill="none" stroke="#30a14e" stroke-width="2" marker-end="url(#arr)"/>
44
+
45
+ <!-- Node: MODIFY -->
46
+ <rect x="558" y="82" width="104" height="36" rx="8" fill="#161b22" stroke="#58a6ff" stroke-width="1.5"/>
47
+ <text x="610" y="105" class="ui" font-size="13" font-weight="700" fill="#58a6ff" text-anchor="middle">MODIFY</text>
48
+
49
+ <!-- Node: VERIFY -->
50
+ <rect x="674" y="182" width="104" height="36" rx="8" fill="#161b22" stroke="#58a6ff" stroke-width="1.5"/>
51
+ <text x="726" y="205" class="ui" font-size="13" font-weight="700" fill="#58a6ff" text-anchor="middle">VERIFY</text>
52
+
53
+ <!-- Node: KEEP / DISCARD -->
54
+ <rect x="524" y="282" width="172" height="36" rx="8" fill="#161b22" stroke="#30a14e" stroke-width="1.5"/>
55
+ <text x="610" y="300" class="ui" font-size="12" font-weight="700" fill="#30a14e" text-anchor="middle">KEEP</text>
56
+ <text x="610" y="313" class="ui" font-size="10" fill="#6e7681" text-anchor="middle">or discard + reset</text>
57
+
58
+ <!-- Node: REPEAT -->
59
+ <rect x="438" y="182" width="104" height="36" rx="8" fill="#161b22" stroke="#30a14e" stroke-width="1.5"/>
60
+ <text x="490" y="205" class="ui" font-size="13" font-weight="700" fill="#30a14e" text-anchor="middle">REPEAT</text>
61
+
62
+ <!-- Center label -->
63
+ <text x="610" y="194" class="ui" font-size="11" fill="#6e7681" text-anchor="middle">autonomous</text>
64
+ <text x="610" y="210" class="ui" font-size="11" fill="#6e7681" text-anchor="middle">loop</text>
65
+
66
+ <!-- ===== RIGHT: Terminal window ===== -->
67
+ <rect x="858" y="56" width="306" height="288" rx="10" fill="#161b22" stroke="#30363d" stroke-width="1"/>
68
+ <!-- Title bar: top-rounded only via path -->
69
+ <path d="M 868 56 Q 858 56 858 66 L 858 90 L 1164 90 L 1164 66 Q 1164 56 1154 56 Z" fill="#21262d"/>
70
+ <!-- Traffic lights -->
71
+ <circle cx="882" cy="73" r="5.5" fill="#ff5f57"/>
72
+ <circle cx="902" cy="73" r="5.5" fill="#ffbd2e"/>
73
+ <circle cx="922" cy="73" r="5.5" fill="#28c840"/>
74
+ <!-- Window title -->
75
+ <text x="1011" y="77" class="ui" font-size="11" fill="#6e7681" text-anchor="middle">autoresearch</text>
76
+
77
+ <!-- Column headers -->
78
+ <text x="874" y="116" class="mono" font-size="11" fill="#6e7681">iter metric result</text>
79
+ <line x1="874" y1="122" x2="1148" y2="122" stroke="#30363d" stroke-width="1"/>
80
+
81
+ <!-- Iteration rows -->
82
+ <text x="874" y="142" class="mono" font-size="11" fill="#30a14e">001 94.2 ✓ keep</text>
83
+ <text x="874" y="160" class="mono" font-size="11" fill="#f85149">002 93.8 ✗ discard</text>
84
+ <text x="874" y="178" class="mono" font-size="11" fill="#30a14e">003 96.1 ✓ keep</text>
85
+ <text x="874" y="196" class="mono" font-size="11" fill="#30a14e">004 97.4 ✓ keep</text>
86
+ <text x="874" y="214" class="mono" font-size="11" fill="#f85149">005 97.1 ✗ discard</text>
87
+ <text x="874" y="232" class="mono" font-size="11" fill="#30a14e">006 99.0 ✓ keep</text>
88
+ <text x="874" y="250" class="mono" font-size="11" fill="#6e7681">007 ...</text>
89
+
90
+ <!-- Best metric footer bar -->
91
+ <rect x="858" y="292" width="306" height="52" fill="#0d2818"/>
92
+ <rect x="867" y="300" width="3" height="28" rx="1.5" fill="#30a14e"/>
93
+ <text x="880" y="314" class="mono" font-size="11" fill="#30a14e">best: 99.0 (+5.1%) 4 kept</text>
94
+ <text x="880" y="330" class="mono" font-size="11" fill="#6e7681">→ autoresearch-report.md</text>
95
+ </svg>