opencode-agent-orchestration-kit 1.0.32 → 1.0.33

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 (62) hide show
  1. package/README.md +33 -2
  2. package/SECURITY.md +7 -0
  3. package/docker/open-design/data/app.sqlite +0 -0
  4. package/docker/open-design/data/app.sqlite-shm +0 -0
  5. package/docker/open-design/data/app.sqlite-wal +0 -0
  6. package/docker/open-design/opencode-auth/log/2026-05-02T105802.log +17 -0
  7. package/docker/open-design/opencode-auth/log/2026-05-04T102127.log +16 -0
  8. package/docker/open-design/opencode-auth/opencode.db +0 -0
  9. package/docker/open-design/opencode-auth/opencode.db-shm +0 -0
  10. package/docker/open-design/opencode-auth/opencode.db-wal +0 -0
  11. package/docs/cli.md +72 -0
  12. package/docs/installation.md +25 -5
  13. package/docs/quickstart.md +1 -1
  14. package/docs/releases/v1.0.33.md +72 -0
  15. package/docs/security.md +4 -0
  16. package/docs/supply-chain.md +9 -5
  17. package/docs/threat-model.md +244 -0
  18. package/docs/use-cases/README.md +31 -0
  19. package/docs/use-cases/direct-label-change/README.md +76 -0
  20. package/docs/use-cases/direct-label-change/before/package.json +8 -0
  21. package/docs/use-cases/direct-label-change/before/src/settings-label.mjs +1 -0
  22. package/docs/use-cases/direct-label-change/before/test/settings-label.test.mjs +8 -0
  23. package/docs/use-cases/direct-label-change/case.json +118 -0
  24. package/docs/use-cases/direct-label-change/expected/package.json +8 -0
  25. package/docs/use-cases/direct-label-change/expected/src/settings-label.mjs +1 -0
  26. package/docs/use-cases/direct-label-change/expected/test/settings-label.test.mjs +8 -0
  27. package/docs/use-cases/feature-tag-normalizer/README.md +78 -0
  28. package/docs/use-cases/feature-tag-normalizer/before/package.json +8 -0
  29. package/docs/use-cases/feature-tag-normalizer/before/src/normalize-tags.mjs +3 -0
  30. package/docs/use-cases/feature-tag-normalizer/before/test/normalize-tags.test.mjs +13 -0
  31. package/docs/use-cases/feature-tag-normalizer/case.json +119 -0
  32. package/docs/use-cases/feature-tag-normalizer/expected/package.json +8 -0
  33. package/docs/use-cases/feature-tag-normalizer/expected/src/normalize-tags.mjs +14 -0
  34. package/docs/use-cases/feature-tag-normalizer/expected/test/normalize-tags.test.mjs +18 -0
  35. package/docs/workflows.md +6 -0
  36. package/opencode/docs/ai/harness/README.md +2 -0
  37. package/opencode/docs/ai/harness/agents.md +7 -0
  38. package/opencode/docs/ai/harness/checks.md +9 -0
  39. package/opencode/docs/ai/harness/commands.md +8 -0
  40. package/opencode/docs/ai/harness/orchestration-contracts.json +891 -0
  41. package/opencode/package-lock.json +14 -8
  42. package/opencode/package.json +1 -0
  43. package/opencode/scripts/check-harness.mjs +634 -10
  44. package/opencode/scripts/check-harness.test.mjs +380 -0
  45. package/package.json +4 -1
  46. package/scripts/check-supply-chain.mjs +11 -1
  47. package/scripts/check-supply-chain.test.mjs +47 -0
  48. package/scripts/check-threat-model.mjs +421 -0
  49. package/scripts/check-threat-model.test.mjs +304 -0
  50. package/scripts/check-use-cases.mjs +501 -0
  51. package/scripts/check-use-cases.test.mjs +225 -0
  52. package/scripts/check.sh +51 -1
  53. package/scripts/install-smoke.sh +24 -1
  54. package/scripts/manage-installation.mjs +567 -25
  55. package/scripts/manage-installation.test.mjs +418 -0
  56. package/scripts/oak.mjs +200 -0
  57. package/scripts/oak.test.mjs +277 -0
  58. package/scripts/package-smoke.mjs +57 -0
  59. package/scripts/package-smoke.test.mjs +75 -2
  60. package/scripts/version.mjs +1 -0
  61. package/scripts/version.test.mjs +3 -2
  62. package/supply-chain.json +1 -0
@@ -0,0 +1,119 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "feature-tag-normalizer",
4
+ "objective": "Add a dependency-free normalizeTags function with tests for its complete public contract.",
5
+ "prompt": "Add normalizeTags(values): trim and lowercase values, remove empty entries and duplicates, preserve first occurrence order, do not mutate the input, add tests, and keep the public API minimal.",
6
+ "workflow": "feature",
7
+ "observation": {
8
+ "date": "2026-07-25",
9
+ "opencode_version": "1.18.4",
10
+ "same_model_selection": true,
11
+ "model_provider_identity": "omitted"
12
+ },
13
+ "fixture": {
14
+ "before": "before",
15
+ "expected": "expected",
16
+ "validation": [
17
+ "npm test",
18
+ "git diff --check"
19
+ ]
20
+ },
21
+ "variants": [
22
+ {
23
+ "id": "harness",
24
+ "command": [
25
+ "opencode",
26
+ "run",
27
+ "--command",
28
+ "feature",
29
+ "--format",
30
+ "json",
31
+ "--thinking",
32
+ "--dir",
33
+ "<case-dir>",
34
+ "Add normalizeTags(values): trim and lowercase values, remove empty entries and duplicates, preserve first occurrence order, do not mutate the input, add tests, and keep the public API minimal."
35
+ ],
36
+ "expected_agents": [
37
+ "lead",
38
+ "specifier",
39
+ "developer",
40
+ "reviewer"
41
+ ],
42
+ "observed_agents": [],
43
+ "human_interventions": [],
44
+ "top_level_invocations": 1,
45
+ "correction_cycles": 0,
46
+ "validation_results": [
47
+ {
48
+ "command": "npm test",
49
+ "status": "pass"
50
+ },
51
+ {
52
+ "command": "git diff --check",
53
+ "status": "pass"
54
+ }
55
+ ],
56
+ "tokens": {
57
+ "status": "unavailable",
58
+ "value": null,
59
+ "reason": "No reliable aggregate token evidence in the sanitized report."
60
+ },
61
+ "result": "fail",
62
+ "limitations": [
63
+ "No portable agent identity was emitted.",
64
+ "Two shell actions were rejected by the permission policy and the repository remained unchanged."
65
+ ]
66
+ },
67
+ {
68
+ "id": "reduced",
69
+ "command": [
70
+ "opencode",
71
+ "run",
72
+ "--agent",
73
+ "developer",
74
+ "--format",
75
+ "json",
76
+ "--thinking",
77
+ "--dir",
78
+ "<case-dir>",
79
+ "Add normalizeTags(values): trim and lowercase values, remove empty entries and duplicates, preserve first occurrence order, do not mutate the input, add tests, and keep the public API minimal."
80
+ ],
81
+ "expected_agents": [
82
+ "developer"
83
+ ],
84
+ "observed_agents": [],
85
+ "human_interventions": [],
86
+ "top_level_invocations": 1,
87
+ "correction_cycles": 0,
88
+ "validation_results": [
89
+ {
90
+ "command": "npm test",
91
+ "status": "pass"
92
+ },
93
+ {
94
+ "command": "git diff --check",
95
+ "status": "pass"
96
+ }
97
+ ],
98
+ "tokens": {
99
+ "status": "unavailable",
100
+ "value": null,
101
+ "reason": "No reliable aggregate token evidence in the sanitized report."
102
+ },
103
+ "result": "fail",
104
+ "limitations": [
105
+ "The selected primary agent identity was not emitted in portable evidence.",
106
+ "One shell action was rejected by the permission policy and the repository remained unchanged."
107
+ ]
108
+ }
109
+ ],
110
+ "comparison": {
111
+ "outcome": "Observed in these runs, both variants left the initial repository unchanged; its baseline tests passed, but neither result matched expected.",
112
+ "orchestration": "Observed in these runs, the harness encountered two permission rejections and the reduced variant encountered one; neither emitted a portable agent identity, correction cycle, or human intervention.",
113
+ "evidence": "live_smoke",
114
+ "limitations": [
115
+ "One run per variant is observational evidence, not a benchmark.",
116
+ "Reliable aggregate token totals and complete agent identity were unavailable."
117
+ ]
118
+ }
119
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "oak-use-case-feature-tag-normalizer",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "test": "node --test"
7
+ }
8
+ }
@@ -0,0 +1,14 @@
1
+ export function normalizeTags(values) {
2
+ const normalized = [];
3
+ const seen = new Set();
4
+
5
+ for (const value of values) {
6
+ const tag = value.trim().toLowerCase();
7
+ if (tag && !seen.has(tag)) {
8
+ seen.add(tag);
9
+ normalized.push(tag);
10
+ }
11
+ }
12
+
13
+ return normalized;
14
+ }
@@ -0,0 +1,18 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+
4
+ import { normalizeTags } from "../src/normalize-tags.mjs";
5
+
6
+ test("normalizes values and preserves first occurrence order", () => {
7
+ const input = [" Alpha ", "beta", "", "ALPHA", " Beta ", "gamma"];
8
+
9
+ assert.deepEqual(normalizeTags(input), ["alpha", "beta", "gamma"]);
10
+ });
11
+
12
+ test("does not mutate the input", () => {
13
+ const input = [" Alpha ", "beta"];
14
+
15
+ normalizeTags(input);
16
+
17
+ assert.deepEqual(input, [" Alpha ", "beta"]);
18
+ });
package/docs/workflows.md CHANGED
@@ -57,3 +57,9 @@ Harness-evolution evidence is classified in `opencode/docs/ai/harness/evidence.m
57
57
  - `transcript_replay`: `opencode run --format json --thinking` execution.
58
58
  - `live_smoke`: real repo, app, browser, or runtime check.
59
59
  - `manual_oracle`: documented human judgment.
60
+
61
+ ## Reproducible use cases
62
+
63
+ Two synthetic [end-to-end cases](use-cases/README.md) compare the harness with
64
+ a reduced direct-developer flow. They are observations from isolated opt-in
65
+ runs, not a statistical benchmark, and never include raw session evidence.
@@ -11,6 +11,8 @@ here.
11
11
  - `evidence.md`: evidence types and required threshold by change type.
12
12
  - `checks.md`: local validation and lightweight doc gardening.
13
13
  - `skill_registry.md`: generated skill index for selective `lead` handoffs.
14
+ - [Kit-wide threat model](../../../../docs/threat-model.md): assets, trust
15
+ boundaries, abuse cases, controls, evidence, and residual risks.
14
16
  - `docs/ai/evolution/`: AHE history, benchmarks, manifests, and attribution.
15
17
 
16
18
  ## Principles
@@ -1,5 +1,12 @@
1
1
  # Agent Contracts
2
2
 
3
+ `docs/ai/harness/orchestration-contracts.json` declares the portable agent
4
+ inventory, mode, semantic write authority, and delegation relationships that
5
+ the checker can compare mechanically. Agent frontmatter remains the effective
6
+ OpenCode configuration; this document retains explanations, exceptions, and
7
+ expectations outside the schema. Version 1 validates both surfaces but does not
8
+ generate or modify frontmatter.
9
+
3
10
  ## Usage Matrix
4
11
 
5
12
  | Agent | Use when | Do not use when | Expected evidence |
@@ -18,6 +18,15 @@ For all bundled script tests from this public repository, run:
18
18
  npm run unit-and-script-tests
19
19
  ```
20
20
 
21
+ Slice 3.3 adds `docs/ai/harness/orchestration-contracts.json` as the portable
22
+ authority for mechanical relationships between agents, commands, workflows,
23
+ barriers, retries, and evidence. The checker selects exactly one inventory
24
+ profile (`private` or `public`), then cross-checks the contract with
25
+ frontmatter, the routing corpus, and narrative documentation. Frontmatter
26
+ remains the effective OpenCode configuration, while Markdown retains rules
27
+ that do not belong in the schema. Version 1 validates only; it does not
28
+ generate or rewrite agents, commands, or docs.
29
+
21
30
  The normal local check combines both paths:
22
31
 
23
32
  ```bash
@@ -1,5 +1,13 @@
1
1
  # Command Contracts
2
2
 
3
+ The mechanical relationships described here are also declared in
4
+ `docs/ai/harness/orchestration-contracts.json`: root agent, workflow entrypoint,
5
+ stage order, barriers, retries, completion authority, and minimum evidence.
6
+ The checker selects the exact private or public inventory profile and compares
7
+ the JSON with frontmatter, the routing corpus, and these narrative anchors. The
8
+ JSON neither executes workflows nor generates Markdown; frontmatter remains
9
+ the effective configuration and this page retains operational nuance.
10
+
3
11
  ## Free-form Message
4
12
 
5
13
  Contract: `lead` router -> appropriate agent.