opencode-autoresearch 3.3.1 → 3.4.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.
@@ -1,855 +0,0 @@
1
- # Install Release Security Implementation Plan
2
-
3
- > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
4
-
5
- **Goal:** Prepare Auto Research v3.3.2 with native OpenCode install documentation, aligned release packaging, and hardened shell hooks.
6
-
7
- **Architecture:** Keep npm as the distribution artifact and document OpenCode's native npm plugin install as the primary path. Keep the CLI global install as an optional path, and keep package contents guarded by an explicit allowlist.
8
-
9
- **Tech Stack:** TypeScript ESM, Jest with ts-jest, npm package distribution, POSIX shell hooks, GitHub Actions release workflow.
10
-
11
- ---
12
-
13
- ## File Structure
14
-
15
- - Create: `.opencode/INSTALL.md` as the repo-level OpenCode install guide.
16
- - Create: `AGENTS.md` as the tracked repository-specific agent guide.
17
- - Modify: `.gitignore` to stop ignoring the tracked `AGENTS.md`.
18
- - Modify: `README.md:97-133` to make native OpenCode plugin install primary and npm CLI install secondary.
19
- - Modify: `docs/OPENCODE_INSTALL.md` to mirror the new install flow with troubleshooting.
20
- - Modify: `wiki/Installation.md` to mirror the new install flow.
21
- - Modify: `hooks/status.sh` and `hooks/stop.sh` to pass state paths through environment variables into Node.
22
- - Modify: `hooks/verify-package.sh` to allow and require `.opencode/INSTALL.md` and `AGENTS.md` in package dry runs.
23
- - Modify: `package.json`, `package-lock.json`, `VERSION`, `src/constants.ts`, and `.opencode-plugin/plugin.json` for version `3.3.2` and packaged file coverage.
24
- - Modify: `.github/workflows/release.yml` to add the missing `npm test` release gate.
25
- - Modify: `CHANGELOG.md`, `docs/ARCHITECTURE.md`, and `docs/RELEASE.md` to align release docs.
26
- - Modify: `tests/test_package_structure.ts` and `tests/test_constants.ts` to make the release/install/security expectations executable.
27
-
28
- Do not commit, tag, push, create a GitHub release, or publish to npm unless the user explicitly approves those operations after verification.
29
-
30
- ---
31
-
32
- ### Task 1: Add Failing Release and Security Tests
33
-
34
- **Files:**
35
- - Modify: `tests/test_package_structure.ts`
36
- - Modify: `tests/test_constants.ts`
37
-
38
- - [ ] **Step 1: Add package, install, workflow, and hook assertions**
39
-
40
- Add these tests to `tests/test_package_structure.ts` in the nearest existing `describe` blocks, creating new `describe` blocks where needed:
41
-
42
- ```ts
43
- describe("package.json", () => {
44
- it("packages repo-level OpenCode install guide", () => {
45
- const files = readJson(resolve(REPO_ROOT, "package.json")).files as string[];
46
- expect(files).toContain(".opencode");
47
- expect(files).toContain("AGENTS.md");
48
- });
49
- });
50
-
51
- describe(".opencode/", () => {
52
- it("has OpenCode install guide with plugin and npm paths", () => {
53
- const content = readFileSync(resolve(REPO_ROOT, ".opencode/INSTALL.md"), "utf-8");
54
- expect(content).toContain('"plugin": ["opencode-autoresearch"]');
55
- expect(content).toContain("npm install -g opencode-autoresearch");
56
- expect(content).toContain("opencode-autoresearch doctor");
57
- });
58
- });
59
-
60
- describe("AGENTS.md", () => {
61
- it("is tracked repository guidance, not local-only context", () => {
62
- const content = readFileSync(resolve(REPO_ROOT, "AGENTS.md"), "utf-8");
63
- expect(content).toContain("Auto Research");
64
- expect(content).toContain("npm run verify:pack");
65
- });
66
- });
67
-
68
- describe("release workflow", () => {
69
- it("runs tests before publishing", () => {
70
- const content = readFileSync(resolve(REPO_ROOT, ".github/workflows/release.yml"), "utf-8");
71
- expect(content).toContain("npm test");
72
- expect(content).toContain("npm publish --access public --provenance");
73
- });
74
- });
75
-
76
- describe("hooks/", () => {
77
- it("does not interpolate AUTORESEARCH_STATE into inline JavaScript", () => {
78
- const status = readFileSync(resolve(REPO_ROOT, "hooks/status.sh"), "utf-8");
79
- const stop = readFileSync(resolve(REPO_ROOT, "hooks/stop.sh"), "utf-8");
80
-
81
- expect(status).toContain("process.env.AUTORESEARCH_STATUS_FILE");
82
- expect(stop).toContain("process.env.AUTORESEARCH_STATUS_FILE");
83
- expect(status).not.toContain("readFileSync('$STATUS_FILE'");
84
- expect(stop).not.toContain("readFileSync('$STATUS_FILE'");
85
- });
86
- });
87
- ```
88
-
89
- Update the version assertion in `tests/test_constants.ts`:
90
-
91
- ```ts
92
- expect(VERSION).toBe("3.3.2");
93
- ```
94
-
95
- - [ ] **Step 2: Run focused tests and verify they fail**
96
-
97
- Run:
98
-
99
- ```bash
100
- npm run build
101
- npm test -- tests/test_package_structure.ts tests/test_constants.ts
102
- ```
103
-
104
- Expected: FAIL because `.opencode/INSTALL.md` and `AGENTS.md` do not exist yet, package files do not include `.opencode`, the release workflow does not run `npm test`, hooks still interpolate `$STATUS_FILE`, and the compiled version is still `3.3.1`.
105
-
106
- ---
107
-
108
- ### Task 2: Add Install Guide and Agent Guidance
109
-
110
- **Files:**
111
- - Create: `.opencode/INSTALL.md`
112
- - Create: `AGENTS.md`
113
- - Modify: `.gitignore`
114
-
115
- - [ ] **Step 1: Add `.opencode/INSTALL.md`**
116
-
117
- Create `.opencode/INSTALL.md` with this content:
118
-
119
- ````md
120
- # Installing Auto Research for OpenCode
121
-
122
- ## Prerequisites
123
-
124
- - [OpenCode.ai](https://opencode.ai) installed
125
-
126
- ## Recommended: OpenCode Plugin Install
127
-
128
- Add Auto Research to the `plugin` array in your global or project-level `opencode.json`:
129
-
130
- ```json
131
- {
132
- "plugin": ["opencode-autoresearch"]
133
- }
134
- ```
135
-
136
- Restart OpenCode. OpenCode installs npm plugins automatically and registers the Auto Research commands.
137
-
138
- Verify inside OpenCode by running:
139
-
140
- ```text
141
- /autoresearch
142
- ```
143
-
144
- ## Optional: Global CLI Install
145
-
146
- Install the CLI globally if you also want `autoresearch` and `opencode-autoresearch` on your shell `PATH`:
147
-
148
- ```bash
149
- npm install -g opencode-autoresearch
150
- opencode-autoresearch doctor
151
- ```
152
-
153
- For one-time use without a global install:
154
-
155
- ```bash
156
- npx opencode-autoresearch doctor
157
- ```
158
-
159
- ## Commands
160
-
161
- After installation, these commands are available in OpenCode:
162
-
163
- - `/autoresearch`
164
- - `/autoresearch:plan`
165
- - `/autoresearch:debug`
166
- - `/autoresearch:fix`
167
- - `/autoresearch:learn`
168
- - `/autoresearch:predict`
169
- - `/autoresearch:scenario`
170
- - `/autoresearch:security`
171
- - `/autoresearch:ship`
172
-
173
- ## Updating
174
-
175
- OpenCode refreshes npm plugins when it starts. Restart OpenCode after changing `opencode.json` or after a new Auto Research package release is published.
176
-
177
- To pin a version:
178
-
179
- ```json
180
- {
181
- "plugin": ["opencode-autoresearch@3.3.2"]
182
- }
183
- ```
184
-
185
- ## Troubleshooting
186
-
187
- ### Plugin not loading
188
-
189
- 1. Verify the package name in `opencode.json` is `opencode-autoresearch`.
190
- 2. Restart OpenCode after editing config.
191
- 3. Check OpenCode logs with `opencode run --print-logs "hello"`.
192
-
193
- ### CLI not found
194
-
195
- 1. Run `npm install -g opencode-autoresearch`.
196
- 2. Verify your npm global bin directory is on `PATH`.
197
- 3. Run `opencode-autoresearch doctor`.
198
-
199
- ## Getting Help
200
-
201
- - Issues: https://github.com/Maleick/AutoResearch/issues
202
- - Documentation: https://github.com/Maleick/AutoResearch#readme
203
- ````
204
-
205
- - [ ] **Step 2: Add `AGENTS.md`**
206
-
207
- Create `AGENTS.md` with this content:
208
-
209
- ````md
210
- # Auto Research Agent Guide
211
-
212
- ## Project Purpose
213
-
214
- Auto Research is an OpenCode workflow bundle and npm package for structured autonomous improve-verify loops.
215
-
216
- ## Source of Truth
217
-
218
- - Runtime source lives in `src/`.
219
- - OpenCode commands live in `commands/`.
220
- - The Auto Research skill bundle lives in `skills/autoresearch/`.
221
- - Shell hooks live in `hooks/`.
222
- - OpenCode package metadata lives in `.opencode-plugin/plugin.json`.
223
- - Installation, architecture, and release docs live in `docs/` and `wiki/`.
224
-
225
- ## Development Rules
226
-
227
- - Build context from existing files before changing behavior.
228
- - Prefer the smallest correct change.
229
- - Do not commit, tag, push, create releases, or publish packages unless the user explicitly asks.
230
- - Do not commit runtime artifacts from `.autoresearch/` or generated result files.
231
- - Keep `VERSION`, `package.json`, `package-lock.json`, `src/constants.ts`, and `.opencode-plugin/plugin.json` aligned for releases.
232
-
233
- ## Security Rules
234
-
235
- - Do not add install flows that pipe remote scripts into a shell.
236
- - Keep package contents guarded by `hooks/verify-package.sh`.
237
- - Do not hardcode secrets, tokens, credentials, or private paths.
238
- - Pass shell variables into inline scripts through environment variables or argv, not by interpolating into source code.
239
-
240
- ## Verification
241
-
242
- Run the focused relevant checks before claiming work is complete. Release-prep changes should run:
243
-
244
- ```bash
245
- npm audit --audit-level=moderate
246
- npm run typecheck
247
- npm run build
248
- npm run verify:pack
249
- npm test
250
- npm pack --dry-run
251
- ```
252
- ````
253
-
254
- - [ ] **Step 3: Stop ignoring tracked `AGENTS.md`**
255
-
256
- Change `.gitignore` from:
257
-
258
- ```gitignore
259
- # Local session context (not shared)
260
- .claude/
261
- .wolf/
262
- .serena/
263
- CLAUDE.md
264
- AGENTS.md
265
- ```
266
-
267
- to:
268
-
269
- ```gitignore
270
- # Local session context (not shared)
271
- .claude/
272
- .wolf/
273
- .serena/
274
- CLAUDE.md
275
- ```
276
-
277
- - [ ] **Step 4: Run focused tests for new files**
278
-
279
- Run:
280
-
281
- ```bash
282
- npm test -- tests/test_package_structure.ts
283
- ```
284
-
285
- Expected: still FAIL until package metadata, release workflow, and hooks are updated.
286
-
287
- ---
288
-
289
- ### Task 3: Update User-Facing Install Docs
290
-
291
- **Files:**
292
- - Modify: `README.md:97-133`
293
- - Modify: `docs/OPENCODE_INSTALL.md`
294
- - Modify: `wiki/Installation.md`
295
-
296
- - [ ] **Step 1: Replace README install and quick start flow**
297
-
298
- Replace `README.md` lines 97-133 with:
299
-
300
- ````md
301
- ## Installation
302
-
303
- Recommended: add Auto Research to the `plugin` array in your global or project-level `opencode.json`:
304
-
305
- ```json
306
- {
307
- "plugin": ["opencode-autoresearch"]
308
- }
309
- ```
310
-
311
- Restart OpenCode, then run the setup wizard:
312
-
313
- ```text
314
- /autoresearch
315
- ```
316
-
317
- If you also want the CLI available on your shell `PATH`, install the npm package globally:
318
-
319
- ```bash
320
- npm install -g opencode-autoresearch
321
- opencode-autoresearch doctor
322
- ```
323
-
324
- For one-time CLI use without a global install:
325
-
326
- ```bash
327
- npx opencode-autoresearch doctor
328
- ```
329
-
330
- See [`.opencode/INSTALL.md`](.opencode/INSTALL.md) for detailed OpenCode install, update, and troubleshooting notes.
331
-
332
- ## Quick Start
333
-
334
- ```bash
335
- # 1. Add the plugin to opencode.json
336
- # { "plugin": ["opencode-autoresearch"] }
337
-
338
- # 2. Restart OpenCode
339
-
340
- # 3. Navigate to your project
341
- cd ~/Projects/my-project
342
-
343
- # 4. Start Auto Research in OpenCode
344
- /autoresearch
345
- ```
346
- ````
347
-
348
- - [ ] **Step 2: Replace `docs/OPENCODE_INSTALL.md`**
349
-
350
- Replace the file with content that includes the same primary plugin install, optional global CLI install, commands list, runtime artifacts table, update notes, and uninstall command:
351
-
352
- ````md
353
- # OpenCode Install
354
-
355
- ## Recommended: OpenCode Plugin Install
356
-
357
- Add Auto Research to the `plugin` array in your global or project-level `opencode.json`:
358
-
359
- ```json
360
- {
361
- "plugin": ["opencode-autoresearch"]
362
- }
363
- ```
364
-
365
- Restart OpenCode. OpenCode installs npm plugins automatically at startup.
366
-
367
- ## Verify Installation
368
-
369
- Start the setup wizard inside OpenCode:
370
-
371
- ```text
372
- /autoresearch
373
- ```
374
-
375
- ## Optional: Global CLI Install
376
-
377
-
378
- ```bash
379
- npm install -g opencode-autoresearch
380
- opencode-autoresearch doctor
381
- ```
382
-
383
- For one-time CLI use:
384
-
385
- ```bash
386
- npx opencode-autoresearch doctor
387
- ```
388
-
389
- ## OpenCode Commands
390
-
391
- | Command | Purpose |
392
- | --- | --- |
393
- | `/autoresearch` | Run the main improve-verify loop |
394
- | `/autoresearch:plan` | Planning workflow |
395
- | `/autoresearch:debug` | Debugging workflow |
396
- | `/autoresearch:fix` | Fix workflow |
397
- | `/autoresearch:learn` | Learning workflow |
398
- | `/autoresearch:predict` | Prediction workflow |
399
- | `/autoresearch:scenario` | Scenario expansion |
400
- | `/autoresearch:security` | Security review |
401
- | `/autoresearch:ship` | Ship-readiness workflow |
402
-
403
- ## Runtime Artifacts
404
-
405
- Artifacts are stored under the working directory:
406
-
407
- | Artifact | Purpose |
408
- | --- | --- |
409
- | `.autoresearch/state.json` | Current run state |
410
- | `.autoresearch/launch.json` | Background launch manifest |
411
- | `autoresearch-results.tsv` | Iteration log |
412
- | `autoresearch-report.md` | End-of-run report |
413
- | `autoresearch-memory.md` | Reusable memory |
414
-
415
- ## Updating
416
-
417
- Restart OpenCode after a new Auto Research package release is available. To pin a version:
418
-
419
- ```json
420
- {
421
- "plugin": ["opencode-autoresearch@3.3.2"]
422
- }
423
- ```
424
-
425
- ## Troubleshooting
426
-
427
- ### Plugin not loading
428
-
429
- 1. Verify `opencode.json` uses `"plugin": ["opencode-autoresearch"]`.
430
- 2. Restart OpenCode after editing config.
431
- 3. Check logs with `opencode run --print-logs "hello"`.
432
-
433
- ### CLI not found
434
-
435
- 1. Run `npm install -g opencode-autoresearch`.
436
- 2. Verify your npm global bin directory is on `PATH`.
437
- 3. Run `opencode-autoresearch doctor`.
438
-
439
- ## Uninstall CLI
440
-
441
- ```bash
442
- npm uninstall -g opencode-autoresearch
443
- ```
444
- ````
445
-
446
- - [ ] **Step 3: Replace `wiki/Installation.md`**
447
-
448
- Replace the file with a shorter mirror of the same flow:
449
-
450
- ````md
451
- # Installation
452
-
453
- ## Recommended: OpenCode Plugin Install
454
-
455
- Add Auto Research to the `plugin` array in your global or project-level `opencode.json`:
456
-
457
- ```json
458
- {
459
- "plugin": ["opencode-autoresearch"]
460
- }
461
- ```
462
-
463
- Restart OpenCode, then run:
464
-
465
- ```text
466
- /autoresearch
467
- ```
468
-
469
- ## Optional CLI Install
470
-
471
- ```bash
472
- npm install -g opencode-autoresearch
473
- opencode-autoresearch doctor
474
- ```
475
-
476
- ## OpenCode Commands
477
-
478
- - `/autoresearch` — Default improve-verify loop
479
- - `/autoresearch:plan` — Planning workflow
480
- - `/autoresearch:debug` — Debugging workflow
481
- - `/autoresearch:fix` — Fix workflow
482
- - `/autoresearch:learn` — Learning workflow
483
- - `/autoresearch:predict` — Prediction workflow
484
- - `/autoresearch:scenario` — Scenario expansion
485
- - `/autoresearch:security` — Security review
486
- - `/autoresearch:ship` — Ship-readiness workflow
487
-
488
- ## CLI Commands
489
-
490
- ```bash
491
- autoresearch init --goal "Improve reliability" --metric failures --direction lower --verify "npm test"
492
- autoresearch status
493
- autoresearch stop
494
- autoresearch resume
495
- autoresearch complete
496
- ```
497
-
498
- ## Runtime Artifacts
499
-
500
- - `.autoresearch/state.json` — Current run state
501
- - `.autoresearch/launch.json` — Background launch manifest
502
- - `autoresearch-results.tsv` — Iteration log
503
- - `autoresearch-report.md` — End-of-run report
504
- - `autoresearch-memory.md` — Reusable memory
505
-
506
- See [docs/OPENCODE_INSTALL.md](docs/OPENCODE_INSTALL.md) and [`.opencode/INSTALL.md`](.opencode/INSTALL.md) for full install details.
507
- ````
508
-
509
- - [ ] **Step 4: Run focused docs tests**
510
-
511
- Run:
512
-
513
- ```bash
514
- npm test -- tests/test_package_structure.ts
515
- ```
516
-
517
- Expected: still FAIL until package metadata, release workflow, and hooks are updated.
518
-
519
- ---
520
-
521
- ### Task 4: Harden Shell Hooks
522
-
523
- **Files:**
524
- - Modify: `hooks/status.sh`
525
- - Modify: `hooks/stop.sh`
526
-
527
- - [ ] **Step 1: Replace `hooks/status.sh` with env-safe Node input**
528
-
529
- Use this content:
530
-
531
- ```sh
532
- #!/bin/sh
533
- # Status hook for Auto Research
534
- # Prints current run status from the state file.
535
-
536
- set -e
537
-
538
- STATUS_FILE="${AUTORESEARCH_STATE:-.autoresearch/state.json}"
539
-
540
- if [ -f "$STATUS_FILE" ]; then
541
- AUTORESEARCH_STATUS_FILE="$STATUS_FILE" node --input-type=module -e '
542
- import { readFileSync } from "fs";
543
- const statusFile = process.env.AUTORESEARCH_STATUS_FILE;
544
- if (!statusFile) throw new Error("Missing AUTORESEARCH_STATUS_FILE");
545
- const s = JSON.parse(readFileSync(statusFile, "utf8"));
546
- console.log("Auto Research run: " + s.run_id);
547
- console.log("Status: " + s.status);
548
- console.log("Mode: " + s.mode);
549
- console.log("Goal: " + s.goal);
550
- console.log("Iterations: " + s.stats.total_iterations);
551
- console.log("Kept: " + s.stats.kept + " | Discarded: " + s.stats.discarded);
552
- if (s.flags.needs_human) console.log("NEEDS HUMAN");
553
- if (s.flags.stop_requested) console.log("STOP REQUESTED");
554
- ' 2>/dev/null || echo "No active run."
555
- else
556
- echo "No active run."
557
- fi
558
- ```
559
-
560
- - [ ] **Step 2: Replace `hooks/stop.sh` with env-safe Node input**
561
-
562
- Use this content:
563
-
564
- ```sh
565
- #!/bin/sh
566
- # Stop hook for Auto Research
567
- # Marks the background run as stopping if one is active.
568
-
569
- set -e
570
-
571
- STATUS_FILE="${AUTORESEARCH_STATE:-.autoresearch/state.json}"
572
-
573
- if [ -f "$STATUS_FILE" ]; then
574
- mode=$(AUTORESEARCH_STATUS_FILE="$STATUS_FILE" node --input-type=module -e '
575
- import { readFileSync } from "fs";
576
- const statusFile = process.env.AUTORESEARCH_STATUS_FILE;
577
- if (!statusFile) throw new Error("Missing AUTORESEARCH_STATUS_FILE");
578
- const s = JSON.parse(readFileSync(statusFile, "utf8"));
579
- console.log(s.mode || "");
580
- ' 2>/dev/null || true)
581
- if [ "$mode" = "background" ]; then
582
- AUTORESEARCH_STATUS_FILE="$STATUS_FILE" node --input-type=module -e '
583
- import { readFileSync, writeFileSync } from "fs";
584
- const statusFile = process.env.AUTORESEARCH_STATUS_FILE;
585
- if (!statusFile) throw new Error("Missing AUTORESEARCH_STATUS_FILE");
586
- const s = JSON.parse(readFileSync(statusFile, "utf8"));
587
- s.updated_at = new Date().toISOString();
588
- s.flags.stop_requested = true;
589
- s.flags.background_active = false;
590
- s.status = "stopping";
591
- writeFileSync(statusFile, JSON.stringify(s, null, 2) + "\n");
592
- console.log("Stop requested for run: " + s.run_id);
593
- ' 2>/dev/null || echo "Could not update state."
594
- else
595
- echo "Only background runs can be stopped."
596
- fi
597
- else
598
- echo "No active run."
599
- fi
600
- ```
601
-
602
- - [ ] **Step 3: Run focused hook tests**
603
-
604
- Run:
605
-
606
- ```bash
607
- npm test -- tests/test_package_structure.ts
608
- ```
609
-
610
- Expected: hook interpolation assertion passes; remaining failures are package/version/release metadata.
611
-
612
- ---
613
-
614
- ### Task 5: Align Package, Version, Verifier, and Release Workflow
615
-
616
- **Files:**
617
- - Modify: `VERSION`
618
- - Modify: `package.json`
619
- - Modify: `package-lock.json`
620
- - Modify: `src/constants.ts`
621
- - Modify: `.opencode-plugin/plugin.json`
622
- - Modify: `hooks/verify-package.sh`
623
- - Modify: `.github/workflows/release.yml`
624
-
625
- - [ ] **Step 1: Bump npm metadata without tagging**
626
-
627
- Run:
628
-
629
- ```bash
630
- npm version 3.3.2 --no-git-tag-version
631
- ```
632
-
633
- Expected: `package.json` and `package-lock.json` versions become `3.3.2` with no git tag created.
634
-
635
- - [ ] **Step 2: Align manual version surfaces**
636
-
637
- Set `VERSION` to:
638
-
639
- ```text
640
- 3.3.2
641
- ```
642
-
643
- Set `src/constants.ts` line 1 to:
644
-
645
- ```ts
646
- export const VERSION = "3.3.2";
647
- ```
648
-
649
- Set `.opencode-plugin/plugin.json` version to:
650
-
651
- ```json
652
- "version": "3.3.2"
653
- ```
654
-
655
- - [ ] **Step 3: Include `.opencode` in package files**
656
-
657
- Update `package.json` `files` to include `.opencode` near `.opencode-plugin`:
658
-
659
- ```json
660
- "files": [
661
- "dist",
662
- "hooks",
663
- "commands",
664
- "skills",
665
- "plugins",
666
- "docs",
667
- ".opencode",
668
- ".opencode-plugin",
669
- "AGENTS.md",
670
- "VERSION",
671
- "README.md",
672
- "LICENSE"
673
- ]
674
- ```
675
-
676
- - [ ] **Step 4: Update package verifier allowlist and required files**
677
-
678
- Change `hooks/verify-package.sh` allowlist and required files to:
679
-
680
- ```js
681
- const allowedRoots = new Set(["dist", "hooks", "commands", "skills", "plugins", "docs", ".opencode", ".opencode-plugin"]);
682
- const allowedFiles = new Set(["package.json", "README.md", "LICENSE", "AGENTS.md", "VERSION"]);
683
- const requiredFiles = [
684
- ".opencode/INSTALL.md",
685
- ".opencode-plugin/plugin.json",
686
- "AGENTS.md",
687
- "hooks/init.sh",
688
- "skills/autoresearch/SKILL.md",
689
- "commands/autoresearch.md",
690
- ];
691
- ```
692
-
693
- - [ ] **Step 5: Add the release test gate**
694
-
695
- Add this step to `.github/workflows/release.yml` after package verification and before extracting the changelog:
696
-
697
- ```yaml
698
- - name: Test
699
- run: npm test
700
- ```
701
-
702
- - [ ] **Step 6: Rebuild and run focused tests**
703
-
704
- Run:
705
-
706
- ```bash
707
- npm run build
708
- npm test -- tests/test_package_structure.ts tests/test_constants.ts
709
- ```
710
-
711
- Expected: PASS.
712
-
713
- ---
714
-
715
- ### Task 6: Update Release and Architecture Documentation
716
-
717
- **Files:**
718
- - Modify: `CHANGELOG.md`
719
- - Modify: `docs/ARCHITECTURE.md`
720
- - Modify: `docs/RELEASE.md`
721
-
722
- - [ ] **Step 1: Add changelog entry**
723
-
724
- Insert this section above `## [3.3.1]` in `CHANGELOG.md`:
725
-
726
- ```md
727
- ## [3.3.2] - 2026-05-03
728
-
729
- ### Added
730
- - **OpenCode install guide**: Added `.opencode/INSTALL.md` with native `opencode.json` plugin installation, CLI alternative, update notes, and troubleshooting.
731
- - **Agent guide**: Added tracked `AGENTS.md` with repository-specific development, security, and verification rules.
732
-
733
- ### Changed
734
- - **Installation docs**: Updated README, docs, and wiki install instructions to recommend OpenCode's native npm plugin flow first.
735
- - **Release pipeline**: Added the missing `npm test` gate to the release workflow and aligned release docs with trusted npm publishing.
736
- - **Package verification**: Required `.opencode/INSTALL.md` and `AGENTS.md` in package dry-run validation.
737
-
738
- ### Fixed
739
- - **Hook hardening**: Passed `AUTORESEARCH_STATE` into inline Node scripts through environment variables instead of interpolating it into JavaScript source.
740
- - **Version references**: Aligned architecture and release docs for v3.3.2.
741
- ```
742
-
743
- - [ ] **Step 2: Update architecture version and package layout**
744
-
745
- In `docs/ARCHITECTURE.md`, change the current reference line to:
746
-
747
- ```md
748
- > Current reference for v3.3.2.
749
- ```
750
-
751
- In the package layout block, add:
752
-
753
- ```text
754
- .opencode/INSTALL.md # OpenCode native plugin install guide
755
- AGENTS.md # Repository-specific agent guide
756
- ```
757
-
758
- - [ ] **Step 3: Update release process doc**
759
-
760
- In `docs/RELEASE.md`, align version examples to `3.3.2`, list `.opencode/INSTALL.md` in package contents, and make the version alignment sentence read:
761
-
762
- ```md
763
- `VERSION`, `package.json`, `package-lock.json`, `src/constants.ts`, and `.opencode-plugin/plugin.json` must all stay aligned. The `VERSION` file is the canonical source of truth.
764
- ```
765
-
766
- Update automated release bullets to include:
767
-
768
- ```md
769
- 1. Build and type-check
770
- 2. Verify package contents
771
- 3. Run tests
772
- 4. Create a GitHub Release with the CHANGELOG section
773
- 5. Publish to npm with provenance through trusted publishing
774
- ```
775
-
776
- - [ ] **Step 4: Run docs-focused tests**
777
-
778
- Run:
779
-
780
- ```bash
781
- npm test -- tests/test_package_structure.ts
782
- ```
783
-
784
- Expected: PASS.
785
-
786
- ---
787
-
788
- ### Task 7: Full Verification and Release Readiness Report
789
-
790
- **Files:**
791
- - No edits unless a verification command exposes a real defect.
792
-
793
- - [ ] **Step 1: Run dependency audit**
794
-
795
- Run:
796
-
797
- ```bash
798
- npm audit --audit-level=moderate
799
- ```
800
-
801
- Expected: `found 0 vulnerabilities`.
802
-
803
- - [ ] **Step 2: Run typecheck**
804
-
805
- Run:
806
-
807
- ```bash
808
- npm run typecheck
809
- ```
810
-
811
- Expected: exit code 0.
812
-
813
- - [ ] **Step 3: Run build**
814
-
815
- Run:
816
-
817
- ```bash
818
- npm run build
819
- ```
820
-
821
- Expected: exit code 0 and `dist/` regenerated.
822
-
823
- - [ ] **Step 4: Run package verification**
824
-
825
- Run:
826
-
827
- ```bash
828
- npm run verify:pack
829
- ```
830
-
831
- Expected: `Package dry-run verified ... files` and no allowlist violations.
832
-
833
- - [ ] **Step 5: Run full test suite**
834
-
835
- Run:
836
-
837
- ```bash
838
- npm test
839
- ```
840
-
841
- Expected: all Jest suites pass.
842
-
843
- - [ ] **Step 6: Preview package contents**
844
-
845
- Run:
846
-
847
- ```bash
848
- npm pack --dry-run
849
- ```
850
-
851
- Expected: package contents include `.opencode/INSTALL.md`, `AGENTS.md`, `README.md`, `VERSION`, `.opencode-plugin/plugin.json`, `commands/`, `skills/`, `hooks/`, `plugins/`, and `docs/`; package contents do not include `.autoresearch/`, `.claude/`, `.wolf/`, `.serena/`, `CLAUDE.md`, or `node_modules/`.
852
-
853
- - [ ] **Step 7: Report release boundary**
854
-
855
- Report the changed files, verification results, and remaining release actions. State that commit, tag, push, GitHub release creation, and npm publish were not performed because they require explicit user approval.