opencode-agent-orchestration-kit 1.0.45 → 1.1.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.
Files changed (105) hide show
  1. package/CONTRIBUTING.md +0 -1
  2. package/NOTICE.md +1 -5
  3. package/README.md +37 -49
  4. package/compatibility.json +7 -0
  5. package/docs/cli.md +69 -1
  6. package/docs/commands.md +1 -1
  7. package/docs/comparison.md +3 -3
  8. package/docs/compatibility.md +33 -14
  9. package/docs/installation.md +2 -0
  10. package/docs/models.md +1 -1
  11. package/docs/open-design.md +2 -0
  12. package/docs/opencode-v2.md +190 -0
  13. package/docs/releases/v1.1.0.md +91 -0
  14. package/docs/supply-chain.md +4 -7
  15. package/docs/threat-model.md +16 -6
  16. package/docs/troubleshooting.md +7 -4
  17. package/docs/workflows.md +27 -4
  18. package/opencode/AGENTS.md +18 -10
  19. package/opencode/agents/designer.md +1 -1
  20. package/opencode/agents/developer.md +60 -6
  21. package/opencode/agents/lead.md +19 -9
  22. package/opencode/agents/reviewer.md +7 -0
  23. package/opencode/agents/scoper.md +1 -0
  24. package/opencode/agents/specifier.md +1 -0
  25. package/opencode/commands/autonomous.md +175 -24
  26. package/opencode/docs/ai/evolution/README.md +5 -4
  27. package/opencode/docs/ai/evolution/benchmarks/adversarial-scenarios.jsonl +3 -0
  28. package/opencode/docs/ai/evolution/session-sources.md +12 -0
  29. package/opencode/docs/ai/harness/agents.md +8 -6
  30. package/opencode/docs/ai/harness/checks.md +3 -2
  31. package/opencode/docs/ai/harness/commands.md +7 -4
  32. package/opencode/docs/ai/harness/skill_registry.json +107 -1
  33. package/opencode/docs/ai/harness/skill_registry.md +5 -0
  34. package/opencode/docs/ai/specs/mission-runtime.md +9 -0
  35. package/opencode/opencode.json +0 -1
  36. package/opencode/plugins/mission-runtime.test.mjs +15 -3
  37. package/opencode/plugins/mission-runtime.ts +11 -39
  38. package/opencode/plugins/oak-tui/server.ts +8 -0
  39. package/opencode/plugins/oak-tui/tui.tsx +81 -0
  40. package/opencode/plugins/open-design.ts +12 -0
  41. package/opencode/plugins/shell-export-guard.ts +13 -23
  42. package/opencode/plugins/token-tree-usage.tsx +4 -1
  43. package/opencode/runtime/v1/mission-runtime.ts +73 -0
  44. package/opencode/runtime/v1/shell-export-guard.ts +9 -0
  45. package/opencode/runtime/v2/mission-events.d.mts +13 -0
  46. package/opencode/runtime/v2/mission-events.mjs +64 -0
  47. package/opencode/runtime/v2/mission-events.test.mjs +120 -0
  48. package/opencode/runtime/v2/mission-runtime.ts +26 -0
  49. package/opencode/runtime/v2/open-design.ts +17 -0
  50. package/opencode/runtime/v2/shell-export-guard.ts +8 -0
  51. package/opencode/runtime/v2/token-usage.d.mts +15 -0
  52. package/opencode/runtime/v2/token-usage.mjs +35 -0
  53. package/opencode/runtime/v2/token-usage.test.mjs +30 -0
  54. package/opencode/scripts/adversarial-harness.test.mjs +50 -1
  55. package/opencode/scripts/check-harness.mjs +142 -33
  56. package/opencode/scripts/check-harness.test.mjs +81 -8
  57. package/opencode/scripts/collect-session-evidence.mjs +57 -39
  58. package/opencode/scripts/collect-session-evidence.test.mjs +164 -0
  59. package/opencode/scripts/deliver.d.mts +37 -0
  60. package/opencode/scripts/deliver.mjs +204 -0
  61. package/opencode/scripts/deliver.test.mjs +245 -0
  62. package/opencode/scripts/loop-state.mjs +50 -1
  63. package/opencode/scripts/loop-state.test.mjs +33 -0
  64. package/opencode/scripts/mission-runtime.test.mjs +1 -1
  65. package/opencode/scripts/mission-status.test.mjs +2 -0
  66. package/opencode/scripts/runtime-permission-policy.mjs +1 -1
  67. package/opencode/scripts/runtime-permission-policy.test.mjs +3 -2
  68. package/opencode/scripts/session-sources.d.mts +6 -0
  69. package/opencode/scripts/session-sources.mjs +49 -0
  70. package/opencode/scripts/shell-export-guard-core.d.mts +2 -0
  71. package/opencode/scripts/shell-export-guard-core.mjs +21 -0
  72. package/opencode/scripts/shell-export-guard-core.test.mjs +43 -0
  73. package/opencode/scripts/task-run.d.mts +63 -0
  74. package/opencode/scripts/task-run.mjs +224 -0
  75. package/opencode/scripts/task-run.test.mjs +178 -0
  76. package/opencode/skills/debugging-and-error-recovery/SKILL.md +20 -0
  77. package/opencode/skills/oak-adversarial-review/SKILL.md +138 -0
  78. package/opencode/skills/oak-commit/SKILL.md +69 -0
  79. package/opencode/skills/oak-enrich-task/SKILL.md +109 -0
  80. package/opencode/skills/oak-runtime-verification/SKILL.md +103 -0
  81. package/opencode/skills/oak-update-docs/SKILL.md +54 -0
  82. package/opencode/tools/open-design-tools.d.mts +17 -0
  83. package/opencode/tools/open-design-tools.mjs +254 -0
  84. package/opencode/tools/open_design.ts +26 -259
  85. package/package.json +4 -3
  86. package/scripts/benchmark-tool-paths.mjs +1 -1
  87. package/scripts/check-compatibility.mjs +58 -4
  88. package/scripts/check-compatibility.test.mjs +159 -11
  89. package/scripts/check-public-boundary.mjs +3 -0
  90. package/scripts/check-supply-chain.mjs +24 -57
  91. package/scripts/check-supply-chain.test.mjs +37 -35
  92. package/scripts/check.sh +42 -7
  93. package/scripts/manage-installation.mjs +34 -20
  94. package/scripts/manage-installation.test.mjs +29 -0
  95. package/scripts/oak.mjs +72 -2
  96. package/scripts/oak.test.mjs +69 -1
  97. package/scripts/open-design-http.test.mjs +1 -1
  98. package/scripts/open-design-tools.test.mjs +49 -0
  99. package/scripts/opencode-compat-smoke.sh +45 -4
  100. package/scripts/opencode-v2-smoke.mjs +197 -0
  101. package/scripts/opencode-v2-smoke.test.mjs +59 -0
  102. package/scripts/package-smoke.test.mjs +3 -3
  103. package/scripts/version.test.mjs +2 -2
  104. package/supply-chain.json +0 -4
  105. package/docs/superpowers.md +0 -41
@@ -0,0 +1,91 @@
1
+ # v1.1.0 - Safe lifecycle and canonical release identity
2
+
3
+ This minor release replaces the Superpowers plugin with OAK's own process
4
+ skills, takes `/autonomous` all the way to an open pull request, and makes the
5
+ harness load on OpenCode 2 as well as OpenCode 1 from the same installation.
6
+ OpenCode 1 (`>=1.14.41 <2.0.0`) remains the supported line; OpenCode 2
7
+ (`>=2.0.18 <3.0.0`) is supported experimentally.
8
+
9
+ ## Highlights
10
+
11
+ - **No external plugins.** Superpowers is removed. The starter `opencode.json`
12
+ declares no `plugin` key, and the supply-chain, compatibility and smoke
13
+ checks require that.
14
+ - **First-party process skills,** wired into the agents that own each phase:
15
+ `oak-enrich-task` (lead, scoper, specifier), `oak-adversarial-review`
16
+ (reviewer), `oak-runtime-verification`, `oak-update-docs` and `oak-commit`
17
+ (developer). The `oak-` prefix keeps them from colliding with same-named
18
+ skills in global skill directories.
19
+ - **`/autonomous` ends at an open pull request.** It enriches the task, opens a
20
+ branch, plans, runs the loop, closes it and delivers through `oak deliver`,
21
+ with a closed list of stop reasons. It never merges, deploys, releases or
22
+ publishes.
23
+ - **`oak deliver pr|checks`** is the only push and pull-request path. It
24
+ refuses unless the loop is completed with a matching reviewer attestation,
25
+ the branch is not the default branch, the tree is clean and the branch is
26
+ ahead of its base. It never force-pushes and has no merge action.
27
+ - **`oak state attest-review`** is implemented: a loop cannot record
28
+ `completed` without a reviewer `APPROVE` bound to the approved contract.
29
+ - **`oak run`** keeps an optional task-run context. The mission runtime links
30
+ each session to it, and `collect-session-evidence --run` tags execution
31
+ trees with the run.
32
+ - **Developer git rules:** `developer` may branch, stage explicit paths and
33
+ commit; bulk staging, hook bypass, push, `gh`, merge, `reset --hard` and
34
+ branch deletion are denied.
35
+ - **OpenCode 2 (experimental).** Every plugin entry serves both runtimes. On
36
+ OpenCode 2 the shell export guard, the `open_design_*` tools, the task-run
37
+ session links, the token sidebar and the mission toasts all work. The
38
+ session evidence collector reads OpenCode 2 databases, and `oak doctor`
39
+ reports `info` for an OpenCode 2 release inside the experimental range.
40
+ OpenCode-1-only code is isolated so it can be deleted when OpenCode 1 is
41
+ retired; see `docs/opencode-v2.md`.
42
+ - **Smokes that prove plugins load.** The OpenCode 1 default smoke now imports
43
+ every plugin file with the Bun runtime embedded in the OpenCode binary, and a
44
+ new non-blocking OpenCode 2 workflow checks that every OAK plugin is active.
45
+
46
+ ## Installation or upgrade
47
+
48
+ Install or upgrade the published CLI package:
49
+
50
+ ```bash
51
+ npm install --global opencode-agent-orchestration-kit@1.1.0
52
+ oak version
53
+ oak install --dry-run
54
+ oak install
55
+ ```
56
+
57
+ The npm installation exposes the CLIs but does not mutate OpenCode
58
+ configuration. `oak install` remains a separate, explicit operation.
59
+
60
+ ## Migration
61
+
62
+ - Superpowers is no longer installed with the harness. If you relied on it
63
+ outside OAK, install it yourself.
64
+ - The process skills are named `oak-*`. Custom prompts or local overrides that
65
+ referenced the unprefixed names from the development branch must follow the
66
+ rename.
67
+ - To try OpenCode 2, read `docs/opencode-v2.md` first. Both lines share the
68
+ config directory and the database; going from OpenCode 1 to OpenCode 2 and
69
+ back works, but OpenCode 1 cannot open a database that OpenCode 2 created
70
+ from scratch.
71
+
72
+ ## Validation performed
73
+
74
+ The public contract check, unit and script suite, typechecks for OpenCode 1
75
+ and OpenCode 2, compatibility, supply-chain and threat-model checks,
76
+ installation smoke and package smoke passed. Runtime smokes passed on OpenCode
77
+ 1.14.41 and 1.18.4 (core and default) and on OpenCode 2.0.18 (core and
78
+ default) and `latest`. Manual sessions with a real model on OpenCode 1.18.4 and
79
+ 2.0.18 are recorded in `docs/opencode-v2.md`. GitHub Actions Check was green on
80
+ every merged pull request before the release tag.
81
+
82
+ ## Public safety boundary
83
+
84
+ The public release excludes private OpenCode and Pi configuration, local
85
+ providers and MCP wiring, credentials, authentication files, provider URLs,
86
+ raw transcripts, private evidence, absolute machine-local paths, and runtime
87
+ state. The session measurements behind these changes stayed private: no model
88
+ names, session identifiers, or local database paths reached this repository.
89
+
90
+ Boundary statement: no private config, no credentials, no provider URLs, no
91
+ raw transcripts, no machine-local paths.
@@ -8,7 +8,6 @@ the immutable identifier consumed by the repository.
8
8
  <!-- supply-chain-pins:start -->
9
9
  | Surface | Reviewed label | Immutable identifier |
10
10
  |---|---|---|
11
- | Superpowers | v6.1.1 | `d884ae04edebef577e82ff7c4e143debd0bbec99` |
12
11
  | actions/checkout | v6 | `d23441a48e516b6c34aea4fa41551a30e30af803` |
13
12
  | actions/setup-node | v6 | `249970729cb0ef3589644e2896645e5dc5ba9c38` |
14
13
  | Open Design | reviewed commit | `1592beb96134f9d49b8a90dc6a359b94a69af57e` |
@@ -46,10 +45,10 @@ an install command; do not blindly run the kit's frozen-install command there.
46
45
 
47
46
  The release-blocking core smoke removes external plugins and the local token
48
47
  plugin and runs without the Open Design service or Impeccable. The separate
49
- default-config smoke proves that the packed starter configuration loads with
50
- the reviewed Superpowers commit. Superpowers, Open Design, Impeccable, and the
51
- token plugin remain experimental; default smoke evidence does not promote
52
- them into the supported core contract.
48
+ default-config smoke proves that the packed starter configuration loads
49
+ without external plugins. Open Design, Impeccable, and the token plugin remain
50
+ experimental; default smoke evidence does not promote them into the supported
51
+ core contract.
53
52
 
54
53
  The Open Design image fixes the Node image digest, Open Design commit, pnpm
55
54
  version, JavaScript lockfile, and OpenCode CLI version. It does not guarantee a
@@ -66,8 +65,6 @@ normal check fetches or rewrites a pin.
66
65
 
67
66
  For each surface, also record:
68
67
 
69
- - Superpowers: tag and peeled commit evidence; update starter config and every
70
- active copy-paste example; run core and default smokes.
71
68
  - `actions/checkout`: the full commit behind the reviewed release; update all
72
69
  blocking and canary uses while retaining the release comment.
73
70
  - `actions/setup-node`: the full commit behind the reviewed release; update all
@@ -112,8 +112,8 @@ shell command from acting with the privileges of the user account.
112
112
  | npm registry and package metadata | TB-006 | Exact dependency versions, lockfile integrity, dependency audit, signature audit, and package smoke reduce drift; registry compromise remains possible |
113
113
  | Git repositories and external references | TB-006 | Immutable commit pins and supply-chain checks reject unsupported mutable references |
114
114
  | GitHub Actions | TB-006 | Third-party actions are pinned and checked; the CI host and pinned upstream remain trusted dependencies |
115
+ | Git remote push and pull-request API | TB-003<br>TB-006 | Only `oak deliver` pushes (never forced, never the default branch) and opens pull requests after a reviewer attestation bound to the approved contract; merge is not implemented |
115
116
  | OpenCode plugin runtime | TB-003<br>TB-006 | Plugin dependencies are scoped and pinned; optional plugin behavior remains partly experimental |
116
- | Superpowers upstream plugin | TB-006 | The installation contract uses a reviewed immutable Git reference and explicit approval for changes |
117
117
  | Open Design service and container | TB-003<br>TB-006 | Documentation recommends local or authenticated network exposure; the service can execute agents and write workspace files |
118
118
  | Agent web access | TB-003<br>TB-006 | Frontmatter asks, allows, or denies web tools per role; fetched content remains untrusted |
119
119
  | MCP, memory, models, and tool output | TB-003<br>TB-006 | Persistent memory is a hint rather than truth; no general content-isolation guarantee exists |
@@ -125,6 +125,7 @@ shell command from acting with the privileges of the user account.
125
125
  |---|---|---|---|---|
126
126
  | `.oak` manifest, journal, backups, rollback, and lock | Lifecycle manager and operator | May contain ownership metadata and copies of replaced private bytes | Created and updated transactionally; backups support rollback; uninstall follows ownership | No-follow checks, target containment, restrictive backup modes, journal recovery, and exclusive lock; retention is operator-managed |
127
127
  | `.opencode/loops` snapshots, histories, and locks | Loop state tool and operator | Approved contract, progress, hashes, and execution history | Initialized, resumed, appended, repaired, migrated, and released through the loop-state tool | Contract hashes, append-only validation, idempotent action IDs, locks, and symlink containment |
128
+ | `.opencode/runs` active run and events | Task-run tool, mission-runtime plugin, and operator | Run identity, branch, counts and enums only | Started per task, appended by workers, removed on close after the summary is written | Slug, type, key and symbolic-value validation; control-character stripping; regular-file and symlink containment for run files and the summary; corrupt files fail with `run_corrupt` |
128
129
  | `.opencode/handoffs` | Harness workflow and operator | Durable human approval and task context | Written at approval boundaries and read when work resumes | Approval status is explicit; filesystem access by other local processes remains possible |
129
130
  | AHE raw and session evidence | Evaluator, debugger, and operator | Potentially contains prompts, paths, code, tool output, or secrets | Collected privately, analyzed, and reduced into publishable artifacts | Sanitization and private/raw boundary are policy controls; retention and deletion depend on the operator |
130
131
  | Review temporary workspace | Review preparation scripts | Patch content, filenames, findings, and metadata | Created for deterministic review preparation and cleaned after use | Safe path handling, patch delimiters, size budgets, timeouts, and network-restricted review roles |
@@ -162,12 +163,12 @@ eliminate the documented abuse. No row is accepted on behalf of the maintainer.
162
163
  | TM-002 | Hostile instructions in repository documentation | AC-002 | A-001<br>A-002<br>A-004 | TB-002<br>TB-003 | A repository document attempts to override active instructions or expand authority | high | Loaded instruction files remain authoritative while ordinary repository documents are treated as data | test:opencode/scripts/adversarial-harness.test.mjs repo-doc-is-data<br>check:opencode/AGENTS.md instruction precedence | partially-mitigated | Natural-language separation depends on model and runtime behavior | maintainer | Instruction-loading or prompt hierarchy change |
163
164
  | TM-003 | Hostile web, tool, MCP, model, or memory content | AC-004 | A-001<br>A-002<br>A-003<br>A-004 | TB-003<br>TB-006 | External output injects instructions, false facts, or malicious payloads into an agent decision | high | Network access is role-scoped and memory is explicitly a hint rather than truth | check:opencode/scripts/check-harness.mjs permission contracts<br>limitation:no general isolation of external content | partially-mitigated | Allowed external content can influence agents and tools | maintainer | New MCP, model, tool, plugin, or web-enabled role |
164
165
  | TM-004 | Unauthorized write, delegation, or confused deputy | AC-002<br>AC-004 | A-001<br>A-002<br>A-004 | TB-001<br>TB-003 | A less-authorized input induces a more-authorized agent or delegated task to perform an effect | high | Closed orchestration contracts, task allowlists, edit permissions, workflow barriers, and completion authority are checked | check:opencode/scripts/check-harness.mjs orchestration contracts<br>limitation:delegated authority is enforced as policy, not capability tokens | partially-mitigated | Authority context can be misunderstood across natural-language handoffs | maintainer | Agent, delegation, routing, or approval contract change |
165
- | TM-005 | Shell allowlist or wrapper bypass | AC-002<br>AC-003 | A-002<br>A-003<br>A-004 | TB-003 | An allowed wrapper or command pattern carries arguments that produce an unreviewed effect | high | Shell defaults to ask and wrapper arguments remain gated by declared patterns | test:opencode/scripts/adversarial-harness.test.mjs rtk-wrapper-needs-approval<br>check:opencode/scripts/check-harness.mjs shell permission contracts | partially-mitigated | Correctness depends on OpenCode matcher and shell semantics | maintainer | Shell matcher, wrapper, or allowlist change |
166
+ | TM-005 | Shell allowlist or wrapper bypass | AC-002<br>AC-003 | A-002<br>A-003<br>A-004 | TB-003 | An allowed wrapper or command pattern carries arguments that produce an unreviewed effect | high | Shell defaults to ask and wrapper arguments remain gated by declared patterns | test:opencode/scripts/adversarial-harness.test.mjs rtk-wrapper-needs-approval<br>check:opencode/scripts/check-harness.mjs shell permission contracts<br>check:opencode/scripts/check-harness.mjs developer git permissions | partially-mitigated | Correctness depends on OpenCode matcher and shell semantics | maintainer | Shell matcher, wrapper, or allowlist change |
166
167
  | TM-006 | Network exfiltration during agent or review work | AC-002<br>AC-004 | A-002<br>A-003<br>A-007 | TB-003<br>TB-006 | Readable workspace or evidence data is sent through an allowed network tool | high | Focused reviewers deny network and other roles ask or allow it explicitly; review policy treats secret-like data as sensitive | test:opencode/scripts/adversarial-harness.test.mjs review-network-not-allowed<br>check:opencode/scripts/check-harness.mjs reviewer network permissions | partially-mitigated | Network-enabled agents can expose data they are already authorized to read | maintainer | Network permission, review role, or tool change |
167
168
  | TM-007 | Filesystem escape by symlink, traversal, or race | AC-002<br>AC-005 | A-002<br>A-003<br>A-006 | TB-004<br>TB-005<br>TB-009 | A managed path resolves outside the intended root or changes between validation and use | high | Lifecycle and state tools reject external symlinks, unsafe relative paths, and uncontained targets; locks reduce races | test:opencode/scripts/adversarial-harness.test.mjs external-symlink-rejected<br>test:opencode/scripts/adversarial-harness.test.mjs path-traversal-rejected<br>test:scripts/manage-installation.test.mjs containment cases | partially-mitigated | OS-level races and compromised local processes cannot be eliminated by path checks alone | maintainer | Filesystem, archive, target-resolution, or temporary-file change |
168
169
  | TM-008 | Hostile filenames, control characters, or archive paths | AC-002<br>AC-003 | A-002<br>A-007<br>A-008 | TB-002<br>TB-004<br>TB-009 | A filename corrupts a review payload, escapes an archive root, or changes command interpretation | high | Review path validation rejects control characters and package smoke rejects unsafe archive names and entry types | test:opencode/scripts/adversarial-harness.test.mjs control-filename-rejected<br>test:scripts/package-smoke.test.mjs archive validation | partially-mitigated | Filesystem and tool-specific filename semantics vary by platform | maintainer | Review path, archive, tar, or platform-support change |
169
170
  | TM-009 | Approval or durable-state tampering, corruption, or replay | AC-002<br>AC-005 | A-001<br>A-005 | TB-001<br>TB-009 | Stored approval is altered, an event is repeated, or a stale contract resumes as current authority | high | Approved-contract hashes, append-only validation, idempotent action IDs, journals, locks, and explicit approval status detect key mutations | test:opencode/scripts/adversarial-harness.test.mjs approval-hash-is-immutable<br>test:opencode/scripts/adversarial-harness.test.mjs repeated-event-rejected<br>test:opencode/scripts/loop-state.test.mjs durable-state cases | partially-mitigated | A process with the user's filesystem privileges can alter or delete state and force recovery | maintainer | Handoff, loop schema, hash, journal, lock, or resume change |
170
- | TM-010 | Secret leakage in patches, reviews, or sanitization | AC-002<br>AC-006 | A-003<br>A-007<br>A-010 | TB-002<br>TB-007<br>TB-008 | Secret-like content reaches a review payload, evidence artifact, commit, or public package | high | Secret-risk classification, evidence sanitization rules, public leak scan, and package forbidden-state checks reduce exposure | test:opencode/scripts/adversarial-harness.test.mjs credential-canary-stays-local<br>check:scripts/check.sh public leak scan<br>test:scripts/package-smoke.test.mjs forbidden state | partially-mitigated | Pattern checks cannot identify every secret or semantic disclosure | maintainer | Evidence, review, leak-pattern, package-content, or publication change |
171
+ | TM-010 | Secret leakage in patches, reviews, or sanitization | AC-002<br>AC-006 | A-003<br>A-007<br>A-010 | TB-002<br>TB-007<br>TB-008 | Secret-like content reaches a review payload, evidence artifact, commit, or public package | high | Secret-risk classification, evidence sanitization rules, public leak scan, package forbidden-state checks, and the `oak-commit` skill's review of the staged diff before committing reduce exposure | test:opencode/scripts/adversarial-harness.test.mjs credential-canary-stays-local<br>check:scripts/check.sh public leak scan<br>test:scripts/package-smoke.test.mjs forbidden state | partially-mitigated | Pattern checks cannot identify every secret or semantic disclosure | maintainer | Evidence, review, leak-pattern, package-content, or publication change |
171
172
  | TM-011 | Raw session or evidence disclosure | AC-004<br>AC-006 | A-003<br>A-007<br>A-009<br>A-010 | TB-007<br>TB-008 | Raw prompts, tool output, logs, or transcripts are copied into a public artifact | high | Raw evidence is private by contract and public artifacts must be sanitized and minimized | check:opencode/docs/ai/harness/evidence.md evidence boundary<br>limitation:sanitization retains human review and cannot prove all semantic data is removed | partially-mitigated | Accidental copying or incomplete redaction remains possible | maintainer | Evidence collector, sanitizer, report, or sync workflow change |
172
173
  | TM-012 | Sensitive bytes retained in backups or persistent state | AC-005<br>AC-006 | A-003<br>A-006<br>A-009 | TB-005<br>TB-009 | Replaced private files survive in backups, histories, logs, or plugin caches longer than expected | medium | Lifecycle backups use restrictive modes and managed cleanup follows explicit ownership | test:scripts/manage-installation.test.mjs backup and rollback cases<br>limitation:operator controls host access and retention | partially-mitigated | Restrictive permissions do not erase data or protect against the same user account | maintainer | Backup, retention, uninstall, logging, or cache change |
173
174
  | TM-013 | Malicious or mutable dependency, action, plugin, or external reference | AC-003<br>AC-004 | A-002<br>A-003<br>A-008 | TB-004<br>TB-006 | A changed upstream reference or compromised package executes with developer privileges | high | Exact pins, immutable Git references, lock integrity, checksums, audits, and explicit approval are checked | test:opencode/scripts/adversarial-harness.test.mjs unpinned-ref-needs-approval<br>test:scripts/check-supply-chain.test.mjs pin mutations<br>check:scripts/check-supply-chain.mjs | partially-mitigated | An authentic pinned upstream or registry account can still be compromised | maintainer | Dependency, action, plugin, registry, pin, or override change |
@@ -178,11 +179,12 @@ eliminate the documented abuse. No row is accepted on behalf of the maintainer.
178
179
  | TM-018 | Resource exhaustion from patches, loops, tools, or subprocesses | AC-002<br>AC-004 | A-002<br>A-005<br>A-007<br>A-009 | TB-002<br>TB-003<br>TB-009 | Oversized input, repeated iteration, or a hanging process consumes time, memory, disk, or model budget | medium | Review preparation uses budgets and timeouts; loop invocation has an iteration cap | test:scripts/review-orchestrated-prepare.test.mjs budget and timeout cases<br>check:opencode/scripts/check-harness.mjs loop iteration contract<br>limitation:no system-wide resource quota | partially-mitigated | Allowed processes and external services can still exhaust host resources | maintainer | Budget, timeout, loop, subprocess, or input-size change |
179
180
  | TM-019 | Poisoned memory, MCP data, or reused evidence | AC-004 | A-001<br>A-004<br>A-007<br>A-009 | TB-003<br>TB-006<br>TB-007 | Stale or malicious remembered content is treated as current truth and changes a decision | high | Persistent memory is documented as a hint and important decisions require verification against current repository state | check:opencode/AGENTS.md memory-as-hint rule<br>limitation:no provenance enforcement for every external memory or MCP response | partially-mitigated | Plausible poisoned context can still bias reasoning before verification | maintainer | Memory, MCP, evidence-reuse, retrieval, or provenance change |
180
181
  | TM-020 | Private material crosses public sync or release boundary | AC-006 | A-003<br>A-007<br>A-010 | TB-007<br>TB-008 | Private configuration, service wiring, paths, raw evidence, or credentials enter a public diff or package | high | Deliberate file selection, public translation, leak scans, package file allow/deny checks, diff review, and separate commit/release gates constrain the boundary | check:scripts/check.sh public leak scan<br>test:scripts/package-smoke.test.mjs forbidden package state<br>limitation:semantic privacy review remains human | partially-mitigated | Novel identifiers or sensitive prose can evade mechanical patterns | maintainer | Sync skill, leak scan, package files, documentation, commit, or release change |
182
+ | TM-021 | Autonomous delivery pushes or proposes the wrong content or target | AC-002<br>AC-004 | A-001<br>A-002<br>A-005 | TB-003<br>TB-006 | An unattended run pushes to the default branch, force-pushes, opens a PR without an approving review, or leaks a local path in the PR body | high | `oak deliver` requires a completed loop, a matching reviewer attestation, a plain non-default branch name pushed through an explicit `HEAD:refs/heads/<branch>` refspec, a clean tree and a safe body copied privately for `gh`; developer bash denies the common forms of direct push, `gh`, bulk staging and hook bypass as defense in depth | test:opencode/scripts/deliver.test.mjs refusal cases<br>test:opencode/scripts/adversarial-harness.test.mjs deliver-default-branch-refused<br>check:opencode/scripts/check-harness.mjs developer git permissions | partially-mitigated | Wildcard bash rules cannot cover every argument form or shell wrapper, so remote branch protection stays the load-bearing control; the attestation is recorded by the workflow itself and binds the approved contract, not a commit; a process with the user's credentials can still push outside OAK | maintainer | Delivery, permission, attestation, or forge integration change |
181
183
 
182
184
  ## Adversarial traceability
183
185
 
184
- The public adversarial corpus remains unchanged. Each scenario maps exactly once
185
- to its primary risk and to the existing executable defense suite.
186
+ Each scenario in the public adversarial corpus maps exactly once to its primary
187
+ risk and to the existing executable defense suite.
186
188
 
187
189
  | Scenario ID | Risk ID | Evidence |
188
190
  |---|---|---|
@@ -197,6 +199,9 @@ to its primary risk and to the existing executable defense suite.
197
199
  | credential-canary-stays-local | TM-010 | test:opencode/scripts/adversarial-harness.test.mjs |
198
200
  | unpinned-ref-needs-approval | TM-013 | test:opencode/scripts/adversarial-harness.test.mjs |
199
201
  | repeated-event-rejected | TM-009 | test:opencode/scripts/adversarial-harness.test.mjs |
202
+ | deliver-default-branch-refused | TM-021 | test:opencode/scripts/adversarial-harness.test.mjs |
203
+ | deliver-without-attestation-refused | TM-021 | test:opencode/scripts/adversarial-harness.test.mjs |
204
+ | deliver-private-path-body-refused | TM-021 | test:opencode/scripts/adversarial-harness.test.mjs |
200
205
 
201
206
  ## Residual risks and assumptions
202
207
 
@@ -208,7 +213,12 @@ to its primary risk and to the existing executable defense suite.
208
213
  - Delegation can create confused-deputy behavior because authority is conveyed
209
214
  through policy and natural-language context rather than capability tokens.
210
215
  - Shell safety depends on the real OpenCode matcher, wrapper, and shell
211
- semantics.
216
+ semantics. Developer git denies narrow common forms only; protect the
217
+ default branch on the remote.
218
+ - The reviewer attestation is written by the workflow's state-sync step with
219
+ the reviewer session id it was given. It binds the approved contract hash, not
220
+ a commit, so commits made after approval (such as a reviewed CI fix) are
221
+ delivered under the same attestation.
212
222
  - Experimental plugins are outside some core installation and runtime
213
223
  guarantees.
214
224
  - Open Design can execute agent CLIs and write workspace files; authentication
@@ -28,10 +28,6 @@ Prefer HTTPS. Browser secure-context rules can block APIs on plain HTTP remote h
28
28
 
29
29
  Use system package manager jq, or avoid jq in scripts. This kit's checks do not require jq.
30
30
 
31
- ## using-superpowers loads by accident
32
-
33
- Check plugin config and agent skill permissions. Designer intentionally denies Superpowers.
34
-
35
31
  ## designer cannot see open-design
36
32
 
37
33
  Verify `opencode/skills/open-design/SKILL.md` exists and `OPEN_DESIGN_URL` is set.
@@ -40,6 +36,13 @@ Verify `opencode/skills/open-design/SKILL.md` exists and `OPEN_DESIGN_URL` is se
40
36
 
41
37
  It should not. `open_design.ts` must not expose URL arguments and must read only `OPEN_DESIGN_URL`.
42
38
 
39
+ ## Plugin shows as failed on OpenCode 2
40
+
41
+ Run `opencode plugin list`. A plugin listed with the ID `-` failed to load.
42
+ For details, run `opencode api plugin.list`, find the entry whose
43
+ `source.path` matches, and read its `state`. Right after the server starts,
44
+ the list can be empty until plugins activate; run the command again.
45
+
43
46
  ## Docker permissions
44
47
 
45
48
  Ensure mounted directories are writable by the container user.
package/docs/workflows.md CHANGED
@@ -30,6 +30,30 @@ No design, implementation, or review.
30
30
 
31
31
  Designer reads product/design docs, optionally uses Impeccable, then creates or runs an Open Design project.
32
32
 
33
+ ## Autonomous
34
+
35
+ `enrich -> branch -> plan -> developer -> reviewer -> developer (state sync) -> close -> deliver -> CI`
36
+
37
+ One explicit invocation runs the whole task without human gates:
38
+
39
+ 1. `oak-enrich-task` turns the objective into a specification and sorts its open
40
+ questions into decided and blocking.
41
+ 2. `developer` creates a `<type>/<slug>` feature branch and opens a task run
42
+ with `oak run start`.
43
+ 3. The plan is self-reviewed and logged in `docs/ai/runs/<date>-<slug>/autonomy.md`.
44
+ 4. The cycle repeats within a one-to-six iteration budget: a focused change,
45
+ deterministic validation, `oak-runtime-verification` when there is a runtime
46
+ surface, `oak-update-docs`, and a fresh `reviewer` subagent applying
47
+ `oak-adversarial-review`.
48
+ 5. After approval, `oak state attest-review`, `oak state record --status
49
+ completed`, and `oak run close` write the attestation and the run summary.
50
+ 6. `developer` commits with `oak-commit` and runs `oak deliver pr`.
51
+ 7. CI is polled with `oak deliver checks` and every failing job is classified;
52
+ a failure caused by the change gets at most two reviewed fixes.
53
+
54
+ It ends at the open pull request and never merges. Any of its seven stop
55
+ reasons stops the run before delivery, with a numbered list of questions.
56
+
33
57
  ## AHE
34
58
 
35
59
  `evaluator -> debugger -> evolver -> lead approval -> developer -> evaluator -> debugger -> reviewer`
@@ -39,10 +63,9 @@ Only for improving the harness itself.
39
63
  ## Core and default release evidence
40
64
 
41
65
  The release-blocking core smoke loads an isolated configuration without
42
- Superpowers, the token plugin, an Open Design service, or Impeccable at both
43
- supported OpenCode boundaries. A separate default-config smoke loads the
44
- packed starter at the stable boundary with the full reviewed Superpowers
45
- commit. The latter proves the default can load; it does not make optional
66
+ the token plugin, an Open Design service, or Impeccable at both supported
67
+ OpenCode boundaries. A separate default-config smoke loads the packed starter,
68
+ which declares no external plugins, at the stable boundary. The latter proves the default can load; it does not make optional
46
69
  integrations part of the supported core contract or promote them from
47
70
  experimental.
48
71
 
@@ -68,19 +68,20 @@ See `docs/ai/harness/commands.md` for command contracts.
68
68
  - Use local skills as checklists when they fit; do not use them as an excuse to
69
69
  add mandatory phases to simple changes.
70
70
 
71
- ## Superpowers discipline
71
+ ## Process skills
72
72
 
73
- This kit enables the upstream Superpowers OpenCode plugin. Use it as operational
74
- discipline when applicable:
73
+ OAK ships its own process skills. Each belongs to the agent that owns the phase:
75
74
 
76
- - brainstorming for ambiguous feature intent;
77
- - writing-plans before complex implementation;
78
- - test-driven-development for behavior changes when feasible;
79
- - systematic-debugging when a bug or failure is not understood;
80
- - verification-before-completion before claiming completion;
81
- - requesting-code-review and receiving-code-review for review loops.
75
+ - `test-driven-development` and `debugging-and-error-recovery` — `developer`.
76
+ - `oak-enrich-task` at Intake for vague requests — `lead`, `scoper`, `specifier`.
77
+ - `oak-adversarial-review` for every final review — `reviewer`.
78
+ - `oak-runtime-verification` before the final review of a change with a runtime
79
+ surface — `developer`.
80
+ - `oak-update-docs` before closeout when the change made documentation stale, and
81
+ `oak-commit` only when the human asks or at `/autonomous` delivery — `developer`.
82
+ Pushing and pull requests go through `oak deliver` only.
82
83
 
83
- User instructions and the local repo `AGENTS.md` take precedence.
84
+ User instructions and the local repository `AGENTS.md` take precedence.
84
85
 
85
86
  ## Observability
86
87
 
@@ -108,3 +109,10 @@ To change agents, commands, skills, tools, or global rules:
108
109
 
109
110
  Real rollback requires git. If the harness is not versioned, do not promise
110
111
  automatic rollback.
112
+
113
+ ## Tool names across OpenCode versions
114
+
115
+ OpenCode 2 renames two tools that these instructions mention: `task` is
116
+ `subagent`, and `bash` is `shell`. Every rule that names the OpenCode 1 tool
117
+ applies to its OpenCode 2 name as well.
118
+ <!-- oak:v1-only: when OpenCode 1 is retired, rewrite the prompts to the OpenCode 2 names and delete this section. -->
@@ -61,7 +61,7 @@ If either document is missing:
61
61
  3. Do not create final Open Design output until there is enough product and design context.
62
62
  4. Then load `open-design`.
63
63
 
64
- Do not use Superpowers or any other skill. This agent is intentionally limited to `open-design` and `impeccable`.
64
+ Do not use process skills. This agent is intentionally limited to `open-design` and `impeccable`.
65
65
 
66
66
  ## Open Design flow
67
67
 
@@ -22,6 +22,52 @@ permission:
22
22
  "pnpm run lint*": allow
23
23
  "npm run typecheck*": allow
24
24
  "pnpm run typecheck*": allow
25
+ "git switch -c *": allow
26
+ "git add *": allow
27
+ "git commit -m *": allow
28
+ "oak run *": allow
29
+ "oak deliver *": allow
30
+ "git add -A*": deny
31
+ "git add --all*": deny
32
+ "git add -u*": deny
33
+ "git add --update*": deny
34
+ "git add .": deny
35
+ "git add . *": deny
36
+ "git add -?A*": deny
37
+ "git add -?u*": deny
38
+ "git add -?f*": deny
39
+ "git add --a*": deny
40
+ "git add --u*": deny
41
+ "git add --f*": deny
42
+ "git add * -A*": deny
43
+ "git add * .": deny
44
+ "git add ./": deny
45
+ "git add ./ *": deny
46
+ "git add :/*": deny
47
+ "git add -f*": deny
48
+ "git add * -f*": deny
49
+ "git add *--force*": deny
50
+ "git commit * -a*": deny
51
+ "git commit *--all*": deny
52
+ "git commit * -n*": deny
53
+ "git commit *--no-v*": deny
54
+ "git commit -a*": deny
55
+ "git commit -n*": deny
56
+ "git commit *--am*": deny
57
+ "git commit * -?a*": deny
58
+ "git commit * -?n*": deny
59
+ "git commit * .": deny
60
+ "git commit * -- *": deny
61
+ "git push*": deny
62
+ "gh *": deny
63
+ "git merge*": deny
64
+ "git reset --hard*": deny
65
+ "git -C *": deny
66
+ "git -c *": deny
67
+ "rm *.opencode*": deny
68
+ "git branch -d*": deny
69
+ "git branch -D*": deny
70
+ "git branch --delete*": deny
25
71
  webfetch: ask
26
72
  websearch: ask
27
73
  todowrite: allow
@@ -30,11 +76,14 @@ permission:
30
76
  "*": deny
31
77
  "api-and-interface-design": allow
32
78
  "code-simplification": allow
79
+ "oak-commit": allow
33
80
  "debugging-and-error-recovery": allow
34
81
  "documentation-and-adrs": allow
82
+ "oak-runtime-verification": allow
35
83
  "security-and-hardening": allow
36
84
  "source-driven-development": allow
37
85
  "test-driven-development": allow
86
+ "oak-update-docs": allow
38
87
  ---
39
88
 
40
89
 
@@ -93,13 +142,17 @@ If your handoff prompt contains a `Skill Resolution` block:
93
142
  - If you need an unlisted skill, include explicit justification in your `skill_resolution` output.
94
143
  - If no `Skill Resolution` block is present, fall back to the global `<available_skills>` list.
95
144
 
96
- ## Superpowers discipline
145
+ ## Process skills
97
146
 
98
- Use Superpowers when applicable:
99
-
100
- - `superpowers/test-driven-development` for behavior changes when tests are feasible.
101
- - `superpowers/systematic-debugging` when a failure is not understood.
102
- - `superpowers/verification-before-completion` before claiming completion.
147
+ - `test-driven-development` for behavior changes when tests are feasible.
148
+ - `debugging-and-error-recovery` when a failure is not understood; classify it
149
+ before retrying (see that skill).
150
+ - `oak-runtime-verification` after validation passes and before the final review,
151
+ whenever the change has a runtime surface.
152
+ - `oak-update-docs` before closeout whenever the change made documentation stale.
153
+ - `oak-commit` only when the human asks, or at `/autonomous` delivery. Never stage
154
+ with `-A`/`.`, never bypass hooks; pushing and pull requests go through
155
+ `oak deliver` only.
103
156
 
104
157
  ## Feedback loop
105
158
 
@@ -170,6 +223,7 @@ Before closeout, also add a `Verification Envelope`:
170
223
  - `results`: relevant result for each command.
171
224
  - `not_run`: validations not run and why.
172
225
  - `evidence`: paths, outputs, or observable checks reviewed.
226
+ - `runtime_verification`: surface, verdict and report location from `oak-runtime-verification`; `surface: none` needs a one-line reason.
173
227
 
174
228
  ## Output
175
229
 
@@ -93,7 +93,10 @@ For lightweight shell inspection, respect the exact allowlist boundary:
93
93
 
94
94
  Routing decision:
95
95
 
96
- - `developer`: small, clear, localized, verifiable change.
96
+ - `developer`: small, clear, localized, verifiable change. Clear means the
97
+ request states the observable outcome. A target that is only a judgment word
98
+ ("better", "improve", "handle properly") is not clear: load `oak-enrich-task`
99
+ first and ask its blocking open questions before routing.
97
100
  - `researcher`: technical/product uncertainty, APIs, libraries, architecture, risks, or need for real evidence before deciding.
98
101
  - `designer`: UX/UI, visual design, layout, brand, interaction, or visual criteria.
99
102
  - `specifier`: enough context exists, but the work still needs tasks, acceptance criteria, or a validation plan.
@@ -135,6 +138,10 @@ When using persistent memory, recollections, or MCP context, treat them as hints
135
138
  (`memory-as-hint`), not a source of truth. Verify against current
136
139
  repository/artifact state before they affect routing or delegation decisions.
137
140
 
141
+ When a delegation fails, is rejected, or returns without a result, run
142
+ `git status` before you report, and say what actually changed. Never report
143
+ "nothing changed" from the delegation result alone.
144
+
138
145
  If you choose direct mode, invoke `developer` with:
139
146
 
140
147
  - concrete objective;
@@ -238,7 +245,7 @@ because of the count. On-demand AHE templates:
238
245
 
239
246
  Use explicit phase barriers:
240
247
 
241
- 1. Intake and ambiguity check.
248
+ 1. Intake and ambiguity check (`oak-enrich-task` when the request lacks acceptance criteria, affected files or non-functional requirements).
242
249
  2. Discovery: research and/or design.
243
250
  3. Lead synthesis.
244
251
  4. Specification.
@@ -266,6 +273,7 @@ Do not skip phases unless the work is genuinely trivial or you explicitly routed
266
273
  reason enum. When review proceeds, give it the objective, non-goals,
267
274
  task/spec, diff base, and original evidence; a developer summary is not a
268
275
  substitute.
276
+ - Before a final review of a change with a runtime surface, require the developer's `runtime_verification` verdict; `could_not_be_verified` is reported, never treated as `works_as_specified`.
269
277
  - If `reviewer` returns `verdict: needs_changes`, synthesize the blocking
270
278
  findings, send a bounded correction task to `developer`, then invoke
271
279
  `reviewer` again. If it returns `blocked`, obtain the missing evidence or
@@ -276,16 +284,18 @@ Do not skip phases unless the work is genuinely trivial or you explicitly routed
276
284
  - Do not insert `evaluator`, `debugger`, or `evolver` as mandatory feature phases.
277
285
  - Never invoke `evolver` for normal app features.
278
286
 
279
- ## Superpowers usage
287
+ ## Process skills
280
288
 
281
- Use Superpowers skills when they fit the work:
289
+ OAK's own process skills carry the discipline for each phase. Route them to the
290
+ agent that owns the phase; never load them into an agent that does not own it.
282
291
 
283
- - `superpowers/brainstorming` for unclear product intent.
284
- - `superpowers/writing-plans` for complex implementation plans.
285
- - `superpowers/systematic-debugging` for failures without root cause.
286
- - `superpowers/verification-before-completion` before claiming completion.
292
+ - `debugging-and-error-recovery` for failures without a root cause (developer).
293
+ - `test-driven-development` for behavior changes (developer).
294
+ - `oak-enrich-task` at Intake for vague requests (lead, scoper, specifier).
295
+ - `oak-runtime-verification` before the final review of a change with a runtime surface (developer).
287
296
 
288
- Keep this additive. Do not let Superpowers override explicit user instructions or repository-local rules.
297
+ These skills are additive. Explicit user instructions and the repository's own
298
+ `AGENTS.md` win over them.
289
299
 
290
300
  ## Synthesis before spec
291
301
 
@@ -28,6 +28,7 @@ permission:
28
28
  external_directory: deny
29
29
  skill:
30
30
  "*": deny
31
+ "oak-adversarial-review": allow
31
32
  "code-review-and-quality": allow
32
33
  "code-simplification": allow
33
34
  "debugging-and-error-recovery": allow
@@ -62,6 +63,12 @@ Clean Architecture, DDD, hexagonal, CQRS, or layered profiles only when the
62
63
  task, applicable repository instructions, ADR, specification, or architecture
63
64
  documentation explicitly declares them. Directory layout alone is not enough.
64
65
 
66
+ For every `review_stage: final`, also load `oak-adversarial-review` and apply its
67
+ four stages before writing findings. Its coverage line opens the output, its
68
+ findings keep the canonical fields above, and its verdict maps to the canonical
69
+ verdict as that skill defines. Do not read the developer's summary, the run
70
+ events or an autonomy log before forming your own view; read them last.
71
+
65
72
  Before deciding:
66
73
 
67
74
  1. Confirm the objective, non-goals, success criteria, diff base, and applicable
@@ -21,6 +21,7 @@ permission:
21
21
  external_directory: deny
22
22
  skill:
23
23
  "*": deny
24
+ "oak-enrich-task": allow
24
25
  task:
25
26
  "*": deny
26
27
  researcher: allow
@@ -18,6 +18,7 @@ permission:
18
18
  "*": deny
19
19
  "api-and-interface-design": allow
20
20
  "documentation-and-adrs": allow
21
+ "oak-enrich-task": allow
21
22
  "security-and-hardening": allow
22
23
  "test-driven-development": allow
23
24
  external_directory: deny