opencode-agent-orchestration-kit 1.0.41 → 1.0.43

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 (36) hide show
  1. package/README.md +119 -11
  2. package/docs/commands.md +2 -0
  3. package/docs/comparison.md +137 -0
  4. package/docs/distribution/awesome-opencode-submission.md +51 -0
  5. package/docs/installation.md +20 -0
  6. package/docs/models.md +10 -2
  7. package/docs/releases/v1.0.28.md +1 -2
  8. package/docs/releases/v1.0.29.md +1 -2
  9. package/docs/releases/v1.0.42.md +51 -0
  10. package/docs/releases/v1.0.43.md +67 -0
  11. package/opencode/agents/developer.md +8 -0
  12. package/opencode/agents/lead.md +40 -13
  13. package/opencode/agents/reviewer.md +22 -0
  14. package/opencode/docs/ai/evolution/benchmarks/replay-fixtures-red.jsonl +2 -0
  15. package/opencode/docs/ai/evolution/benchmarks/router-scenarios-red.jsonl +2 -0
  16. package/opencode/docs/ai/harness/agents.md +50 -0
  17. package/opencode/docs/ai/harness/playbooks/lead-ahe-flow.md +43 -0
  18. package/opencode/package-lock.json +27 -24
  19. package/opencode/scripts/check-harness.mjs +5 -1
  20. package/opencode/scripts/collect-session-evidence.mjs +197 -9
  21. package/opencode/scripts/collect-session-evidence.test.mjs +151 -0
  22. package/opencode/scripts/replay-routing.test.mjs +58 -0
  23. package/package.json +24 -1
  24. package/scripts/benchmark-tool-paths.mjs +1 -1
  25. package/scripts/check-public-boundary.mjs +1 -0
  26. package/scripts/package-smoke.test.mjs +2 -2
  27. package/scripts/version.test.mjs +2 -2
  28. package/docker/open-design/data/app.sqlite +0 -0
  29. package/docker/open-design/data/app.sqlite-shm +0 -0
  30. package/docker/open-design/data/app.sqlite-wal +0 -0
  31. package/docker/open-design/opencode-auth/log/2026-05-02T105802.log +0 -17
  32. package/docker/open-design/opencode-auth/log/2026-05-04T102127.log +0 -16
  33. package/docker/open-design/opencode-auth/opencode.db +0 -0
  34. package/docker/open-design/opencode-auth/opencode.db-shm +0 -0
  35. package/docker/open-design/opencode-auth/opencode.db-wal +0 -0
  36. package/docs/synology.md +0 -30
@@ -577,3 +577,154 @@ test("streamSqliteJson rejects on sqlite3 runtime error (non-zero exit)", async
577
577
  assert.notEqual(result.status, 0);
578
578
  assert.match(result.stderr, /sqlite3 runtime error|session/);
579
579
  });
580
+
581
+ test("execution trees expose phase-0 telemetry with paired handoff timestamps and turn correlation", async () => {
582
+ const tmp = makeTempDir();
583
+ try {
584
+ const dbPath = path.join(tmp, "opencode.db");
585
+ createFixtureDb(dbPath);
586
+
587
+ const tree = await collectExecutionTreeByRoot(dbPath, "ses_root_1");
588
+
589
+ const telemetry = tree.telemetry;
590
+ assert.ok(telemetry, "tree must carry phase-0 telemetry");
591
+ assert.equal(telemetry.method_version, 1);
592
+ assert.deepEqual(telemetry.request_turns, [
593
+ { turn_id: "ses_root_1:t1", t_start: 1000 },
594
+ ]);
595
+
596
+ assert.equal(telemetry.handoffs.length, 2);
597
+ const [handoffOne, handoffTwo] = telemetry.handoffs;
598
+ assert.deepEqual(handoffOne, {
599
+ sequence: 1,
600
+ agent: "researcher",
601
+ session_id: "ses_child_1",
602
+ request_turn_id: "ses_root_1:t1",
603
+ t_handoff_start: 1000,
604
+ t_handoff_end: 1100,
605
+ gap_ms: 100,
606
+ t_spawn: 1100,
607
+ t_complete: 2100,
608
+ });
609
+ // paired spawn -> completion of predecessor; overlap shows up as negative gap
610
+ assert.deepEqual(handoffTwo, {
611
+ sequence: 2,
612
+ agent: "reviewer",
613
+ session_id: "ses_grandchild_1",
614
+ request_turn_id: "ses_root_1:t1",
615
+ t_handoff_start: 2100,
616
+ t_handoff_end: 1150,
617
+ gap_ms: -950,
618
+ t_spawn: 1150,
619
+ t_complete: 2200,
620
+ });
621
+
622
+ assert.deepEqual(telemetry.diff_size, {
623
+ available: false,
624
+ files_changed: null,
625
+ insertions: null,
626
+ deletions: null,
627
+ captured_at: "collection",
628
+ });
629
+ assert.equal(telemetry.review_skipped_reason, null);
630
+ } finally {
631
+ fs.rmSync(tmp, { recursive: true, force: true });
632
+ }
633
+ });
634
+
635
+ test("phase-0 telemetry maps spawns to the latest root user turn", async () => {
636
+ const tmp = makeTempDir();
637
+ try {
638
+ const dbPath = path.join(tmp, "opencode.db");
639
+ createFixtureDb(dbPath);
640
+ run("sqlite3", [
641
+ dbPath,
642
+ `
643
+ insert into message (id, session_id, time_created, time_updated, data) values
644
+ ('msg_user_root_1b', 'ses_root_1', 1500, 1500, '{"role":"user","time":{"created":1500}}'),
645
+ ('msg_user_child_2', 'ses_child_1', 1600, 1600, '{"role":"user","time":{"created":1600}}');
646
+ insert into part (id, message_id, session_id, time_created, time_updated, data) values
647
+ ('prt_user_root_1b', 'msg_user_root_1b', 'ses_root_1', 1500, 1500, '{"type":"text","text":"Follow-up request on the harness issue."}'),
648
+ ('prt_user_child_2', 'msg_user_child_2', 'ses_child_1', 1600, 1600, '{"type":"text","text":"Second research pass."}');
649
+ insert into session (
650
+ id, project_id, parent_id, slug, directory, title, version, time_created, time_updated, path, agent, model, cost, tokens_input, tokens_output, tokens_reasoning, tokens_cache_read, tokens_cache_write
651
+ ) values (
652
+ 'ses_child_2', 'proj_1', 'ses_root_1', 'bold-otter', '/tmp/repo', 'Research follow-up (@researcher subagent)', '1.15.12', 1700, 1900, '', 'researcher',
653
+ '{"id":"synthetic-model","providerID":"synthetic-provider","variant":"synthetic-variant"}', 0.1, 10, 5, 0, 0, 0
654
+ );
655
+ `,
656
+ ]);
657
+
658
+ const tree = await collectExecutionTreeByRoot(dbPath, "ses_root_1");
659
+
660
+ assert.deepEqual(tree.telemetry.request_turns, [
661
+ { turn_id: "ses_root_1:t1", t_start: 1000 },
662
+ { turn_id: "ses_root_1:t2", t_start: 1500 },
663
+ ]);
664
+ const bySession = new Map(
665
+ tree.telemetry.handoffs.map((handoff) => [handoff.session_id, handoff]),
666
+ );
667
+ assert.equal(bySession.get("ses_child_1").request_turn_id, "ses_root_1:t1");
668
+ assert.equal(bySession.get("ses_grandchild_1").request_turn_id, "ses_root_1:t1");
669
+ assert.equal(bySession.get("ses_child_2").request_turn_id, "ses_root_1:t2");
670
+ } finally {
671
+ fs.rmSync(tmp, { recursive: true, force: true });
672
+ }
673
+ });
674
+
675
+ test("phase-0 telemetry captures enum-valid review_skipped_reason and rejects unknown tokens", async () => {
676
+ const tmp = makeTempDir();
677
+ try {
678
+ const dbPath = path.join(tmp, "opencode.db");
679
+ createFixtureDb(dbPath);
680
+ run("sqlite3", [
681
+ dbPath,
682
+ `update part set data = json_object('type','text','text','Closed with review skipped. review_skipped_reason: small_gate_pass')
683
+ where id = 'prt_assistant_root_1';`,
684
+ ]);
685
+
686
+ const tree = await collectExecutionTreeByRoot(dbPath, "ses_root_1");
687
+ assert.equal(tree.telemetry.review_skipped_reason, "small_gate_pass");
688
+
689
+ run("sqlite3", [
690
+ dbPath,
691
+ `update part set data = json_object('type','text','text','review_skipped_reason: because_i_said_so')
692
+ where id = 'prt_assistant_root_1';`,
693
+ ]);
694
+ const rejectTree = await collectExecutionTreeByRoot(dbPath, "ses_root_1");
695
+ assert.equal(rejectTree.telemetry.review_skipped_reason, null);
696
+ } finally {
697
+ fs.rmSync(tmp, { recursive: true, force: true });
698
+ }
699
+ });
700
+
701
+ test("phase-0 telemetry measures diff size for a real local git repo", async () => {
702
+ const tmp = makeTempDir();
703
+ try {
704
+ const repoDir = path.join(tmp, "repo");
705
+ fs.mkdirSync(repoDir, { recursive: true });
706
+ run("git", ["init", "-q", repoDir]);
707
+ run("git", ["-C", repoDir, "config", "user.email", "test@example.invalid"]);
708
+ run("git", ["-C", repoDir, "config", "user.name", "Test"]);
709
+ fs.writeFileSync(path.join(repoDir, "a.txt"), "one\n");
710
+ run("git", ["-C", repoDir, "add", "."]);
711
+ run("git", ["-C", repoDir, "commit", "-qm", "base"]);
712
+ fs.writeFileSync(path.join(repoDir, "a.txt"), "one\ntwo\nthree\n");
713
+ fs.writeFileSync(path.join(repoDir, "b.txt"), "new\n");
714
+
715
+ const dbPath = path.join(tmp, "opencode.db");
716
+ createFixtureDb(dbPath);
717
+ run("sqlite3", [dbPath, `update session set directory = '${repoDir}' where id in ('ses_root_1','ses_child_1','ses_grandchild_1');`]);
718
+
719
+ const tree = await collectExecutionTreeByRoot(dbPath, "ses_root_1");
720
+ assert.deepEqual(tree.telemetry.diff_size, {
721
+ available: true,
722
+ files_changed: 2,
723
+ insertions: 2,
724
+ deletions: 0,
725
+ captured_at: "collection",
726
+ });
727
+ } finally {
728
+ fs.rmSync(tmp, { recursive: true, force: true });
729
+ }
730
+ });
@@ -6,6 +6,7 @@ import path from "node:path";
6
6
  import { spawnSync } from "node:child_process";
7
7
  import test from "node:test";
8
8
  import { fileURLToPath } from "node:url";
9
+ import { evaluateReplay } from "./replay-routing.mjs";
9
10
 
10
11
  const scriptDir = path.dirname(fileURLToPath(import.meta.url));
11
12
  const root = path.dirname(scriptDir);
@@ -18,6 +19,14 @@ const fixturesPath = path.join(
18
19
  root,
19
20
  "docs/ai/evolution/benchmarks/replay-fixtures.jsonl",
20
21
  );
22
+ const redCorpusPath = path.join(
23
+ root,
24
+ "docs/ai/evolution/benchmarks/router-scenarios-red.jsonl",
25
+ );
26
+ const redFixturesPath = path.join(
27
+ root,
28
+ "docs/ai/evolution/benchmarks/replay-fixtures-red.jsonl",
29
+ );
21
30
  const coverageChannels = [
22
31
  "session_events",
23
32
  "skill_events",
@@ -1452,3 +1461,52 @@ test("missing stop evidence is inconclusive", () => {
1452
1461
  });
1453
1462
  });
1454
1463
  });
1464
+
1465
+ test("phase-0 red fixtures fail deterministically with the natural routing symptoms", () => {
1466
+ const scenarios = readJsonl(redCorpusPath);
1467
+ const fixtures = readJsonl(redFixturesPath);
1468
+ assert.deepEqual(
1469
+ fixtures.map((fixture) => fixture.scenario_id).sort(),
1470
+ scenarios.map((scenario) => scenario.id).sort(),
1471
+ );
1472
+
1473
+ const report = evaluateReplay({
1474
+ scenarios,
1475
+ observations: fixtures,
1476
+ mode: "deterministic",
1477
+ });
1478
+ // Intentional red-pending regression net: these fail until the small-gate
1479
+ // fast path changes real routing; the classic corpus stays all-green.
1480
+ assert.equal(report.operational_status, "ok");
1481
+ assert.equal(report.status, "fail");
1482
+
1483
+ const byId = new Map(
1484
+ report.scenario_results.map((result) => [result.scenario_id, result]),
1485
+ );
1486
+ const copyTrivial = byId.get("freeform-tiny-copy-trivial");
1487
+ assert.ok(copyTrivial, "missing copy-trivial red scenario");
1488
+ assert.equal(copyTrivial.status, "fail");
1489
+ const copyFails = new Map(
1490
+ copyTrivial.assertions
1491
+ .filter((assertion) => assertion.status === "fail")
1492
+ .map((assertion) => [assertion.id, assertion]),
1493
+ );
1494
+ assert.equal(copyFails.get("forbidden-agents")?.reason_code, "forbidden-agent-observed");
1495
+ assert.deepEqual(copyFails.get("forbidden-agents")?.evidence_sequences, [5]);
1496
+ assert.equal(copyFails.get("review-policy")?.reason_code, "reviewer-forbidden");
1497
+ assert.deepEqual(copyFails.get("delegation-budget")?.reason_code, "delegation-budget-exceeded");
1498
+
1499
+ const seedPipeline = byId.get("freeform-tiny-toy-single-file-full-pipeline");
1500
+ assert.ok(seedPipeline, "missing toy single-file full-pipeline red scenario");
1501
+ assert.equal(seedPipeline.status, "fail");
1502
+ const seedForbidden = seedPipeline.assertions.find(
1503
+ (assertion) => assertion.id === "forbidden-agents",
1504
+ );
1505
+ assert.equal(seedForbidden?.status, "fail");
1506
+ assert.deepEqual(seedForbidden?.evidence_sequences, [2, 4, 9]);
1507
+ const seedReviewPolicy = seedPipeline.assertions.find(
1508
+ (assertion) => assertion.id === "review-policy",
1509
+ );
1510
+ assert.equal(seedReviewPolicy?.status, "fail");
1511
+ assert.equal(seedReviewPolicy?.reason_code, "reviewer-forbidden");
1512
+ });
package/package.json CHANGED
@@ -1,7 +1,30 @@
1
1
  {
2
2
  "name": "opencode-agent-orchestration-kit",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "private": false,
5
+ "description": "Open-source multi-agent orchestration harness for OpenCode with specialized agents, durable workflows, review gates, and reproducible software-engineering processes.",
6
+ "keywords": [
7
+ "opencode",
8
+ "opencode-orchestrator",
9
+ "agent-orchestration",
10
+ "multi-agent",
11
+ "multi-agent-orchestration",
12
+ "coding-agents",
13
+ "coding-agent-orchestration",
14
+ "ai-agents",
15
+ "agent-harness",
16
+ "agentic-development",
17
+ "developer-tools"
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit.git"
22
+ },
23
+ "homepage": "https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit#readme",
24
+ "bugs": {
25
+ "url": "https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit/issues"
26
+ },
27
+ "author": "jcarlosrodicio",
5
28
  "license": "Apache-2.0",
6
29
  "type": "module",
7
30
  "bin": {
@@ -143,7 +143,7 @@ async function benchmarkFixture(fixture, iterations, temporaryRoot) {
143
143
  const result = await createInstallationManager({
144
144
  sourceRoot: fixture.sourceRoot,
145
145
  repositoryRoot: fixture.root,
146
- versionProvider: () => "1.0.41",
146
+ versionProvider: () => "1.0.43",
147
147
  }).run("install", { targetRoot });
148
148
  if (result.exitCode !== 0) throw invalid(`installation benchmark failed for ${fixture.id}`);
149
149
  } finally {
@@ -21,6 +21,7 @@ const REQUIRED_FILES = [
21
21
  // from fragments so this scanner does not trip over its own rules.
22
22
  const PRIVATE_MARKERS = [
23
23
  ["/", "Users", "/"].join(""),
24
+ ["juancan", "as"].join(""),
24
25
  ["synology", ".", "me"].join(""),
25
26
  ["auth", ".", "json"].join(""),
26
27
  ["OPENAI", "_", "API", "_", "KEY"].join(""),
@@ -17,7 +17,7 @@ import {
17
17
 
18
18
  const ROOT = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
19
19
  const HASH = "a".repeat(64);
20
- const BASENAME = "opencode-agent-orchestration-kit-1.0.41.tgz";
20
+ const BASENAME = "opencode-agent-orchestration-kit-1.0.43.tgz";
21
21
  const REQUIRED = [
22
22
  "package/package.json",
23
23
  "package/supply-chain.json",
@@ -210,7 +210,7 @@ test("smokeTarball validates both archive listings before extraction", async ()
210
210
  await assert.rejects(
211
211
  smokeTarball({
212
212
  repositoryRoot: ROOT,
213
- tarball: "/public/opencode-agent-orchestration-kit-1.0.41.tgz",
213
+ tarball: "/public/opencode-agent-orchestration-kit-1.0.43.tgz",
214
214
  captureTarball(_source, destination) {
215
215
  fs.writeFileSync(destination, "fixture");
216
216
  return { size: 1 };
@@ -109,7 +109,7 @@ test("[V004] direct version entrypoints are exact and mutation-free", (t) => {
109
109
  for (const args of [["scripts/version.mjs"], ["scripts/manage-installation.mjs", "--version"]]) {
110
110
  const result = run(process.execPath, args, { HOME: home });
111
111
  assert.equal(result.status, 0, result.stderr);
112
- assert.equal(result.stdout, "opencode-agent-orchestration-kit 1.0.41\n");
112
+ assert.equal(result.stdout, "opencode-agent-orchestration-kit 1.0.43\n");
113
113
  assert.equal(fs.existsSync(target), false);
114
114
  }
115
115
  });
@@ -118,7 +118,7 @@ test("[V005] all lifecycle wrappers expose the canonical version", () => {
118
118
  for (const wrapper of ["install.sh", "upgrade.sh", "doctor.sh", "uninstall.sh", "rollback.sh"]) {
119
119
  const result = run(path.join(REPOSITORY_ROOT, wrapper), ["--version"]);
120
120
  assert.equal(result.status, 0, `${wrapper}: ${result.stderr}`);
121
- assert.equal(result.stdout, "opencode-agent-orchestration-kit 1.0.41\n", wrapper);
121
+ assert.equal(result.stdout, "opencode-agent-orchestration-kit 1.0.43\n", wrapper);
122
122
  }
123
123
  });
124
124
 
Binary file
File without changes
@@ -1,17 +0,0 @@
1
- INFO 2026-05-02T10:58:02 +270ms service=default version=1.14.31 args=["models"] process_role=main run_id=a2a78294-b4d4-488d-99c7-9b9e1f6ba68f opencode
2
- INFO 2026-05-02T10:58:02 +0ms service=db path=/home/opencode/.local/share/opencode/opencode.db opening database
3
- INFO 2026-05-02T10:58:02 +5ms service=db count=14 mode=bundled applying migrations
4
- INFO 2026-05-02T10:58:02 +11ms service=json-migration storage directory does not exist, skipping migration
5
- INFO 2026-05-02T10:58:02 +1ms service=default directory=/app/open-design creating instance
6
- INFO 2026-05-02T10:58:02 +3ms service=project directory=/app/open-design fromDirectory
7
- INFO 2026-05-02T10:58:02 +56ms service=file init
8
- INFO 2026-05-02T10:58:02 +41ms service=provider status=started state
9
- INFO 2026-05-02T10:58:02 +8ms service=config path=/home/opencode/.config/opencode/config.json loading
10
- INFO 2026-05-02T10:58:02 +1ms service=config path=/home/opencode/.config/opencode/opencode.json loading
11
- INFO 2026-05-02T10:58:02 +5ms service=config path=/home/opencode/.config/opencode/opencode.jsonc loading
12
- INFO 2026-05-02T10:58:02 +3ms service=config path=/home/opencode/.config/opencode/opencode.json loading
13
- INFO 2026-05-02T10:58:02 +1ms service=config path=/home/opencode/.config/opencode/opencode.jsonc loading
14
- ERROR 2026-05-02T10:58:02 +13ms service=default name=PlatformError message=Unknown: FileSystem.writeFile (/home/opencode/.config/opencode/.gitignore) cause=Error: EROFS: read-only file system, open '/home/opencode/.config/opencode/.gitignore' stack=Error
15
- at LA (/$bunfs/root/chunk-2jj9v4nh.js:71:4213)
16
- at <anonymous> (/$bunfs/root/chunk-jtzgjw2e.js:709:10709)
17
- at processTicksAndRejections (native:7:39) fatal
@@ -1,16 +0,0 @@
1
- INFO 2026-05-04T10:21:27 +675ms service=default version=1.14.31 args=["models"] process_role=main run_id=094c93b3-d70c-4527-8e21-87d24f443d76 opencode
2
- INFO 2026-05-04T10:21:27 +2ms service=default directory=/app/open-design creating instance
3
- INFO 2026-05-04T10:21:27 +13ms service=project directory=/app/open-design fromDirectory
4
- INFO 2026-05-04T10:21:28 +980ms service=db path=/home/opencode/.local/share/opencode/opencode.db opening database
5
- INFO 2026-05-04T10:21:28 +209ms service=db count=14 mode=bundled applying migrations
6
- INFO 2026-05-04T10:21:28 +124ms service=file init
7
- INFO 2026-05-04T10:21:29 +393ms service=provider status=started state
8
- INFO 2026-05-04T10:21:29 +24ms service=config path=/home/opencode/.config/opencode/config.json loading
9
- INFO 2026-05-04T10:21:29 +20ms service=config path=/home/opencode/.config/opencode/opencode.json loading
10
- INFO 2026-05-04T10:21:29 +42ms service=config path=/home/opencode/.config/opencode/opencode.jsonc loading
11
- INFO 2026-05-04T10:21:29 +204ms service=config path=/home/opencode/.config/opencode/opencode.json loading
12
- INFO 2026-05-04T10:21:29 +46ms service=config path=/home/opencode/.config/opencode/opencode.jsonc loading
13
- ERROR 2026-05-04T10:21:29 +119ms service=default name=PlatformError message=Unknown: FileSystem.writeFile (/home/opencode/.config/opencode/.gitignore) cause=Error: EROFS: read-only file system, open '/home/opencode/.config/opencode/.gitignore' stack=Error
14
- at LA (/$bunfs/root/chunk-2jj9v4nh.js:71:4213)
15
- at <anonymous> (/$bunfs/root/chunk-jtzgjw2e.js:709:10709)
16
- at processTicksAndRejections (native:7:39) fatal
File without changes
package/docs/synology.md DELETED
@@ -1,30 +0,0 @@
1
- # Synology Deployment
2
-
3
- Use Container Manager or Docker Compose.
4
-
5
- Recommended setup:
6
-
7
- 1. Build the image from `docker/open-design`.
8
- 2. Keep volumes for `data` and `opencode-auth` outside git.
9
- 3. Map port `7456` only on trusted LAN unless protected.
10
- 4. Configure Synology reverse proxy with HTTPS if exposing beyond localhost.
11
- 5. Protect public access with VPN, Tailscale, WireGuard, or authentication.
12
-
13
- The Dockerfile pins Open Design and OpenCode CLI build inputs. To update them,
14
- build with explicit args instead of editing to a floating branch or `latest`:
15
-
16
- ```bash
17
- docker compose build \
18
- --build-arg OPEN_DESIGN_REF=<commit-sha> \
19
- --build-arg OPENCODE_AI_VERSION=<version>
20
- docker compose up -d
21
- ```
22
-
23
- Useful operations:
24
-
25
- ```bash
26
- docker compose logs -f
27
- docker compose restart
28
- docker compose pull
29
- docker compose up -d --build
30
- ```