opencode-agent-orchestration-kit 1.0.27

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 (236) hide show
  1. package/.github/CODEOWNERS +1 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.yml +65 -0
  3. package/.github/ISSUE_TEMPLATE/config.yml +11 -0
  4. package/.github/ISSUE_TEMPLATE/documentation.yml +22 -0
  5. package/.github/ISSUE_TEMPLATE/feature_request.yml +43 -0
  6. package/.github/PULL_REQUEST_TEMPLATE.md +25 -0
  7. package/.github/workflows/check.yml +47 -0
  8. package/CODE_OF_CONDUCT.md +24 -0
  9. package/CONTRIBUTING.md +52 -0
  10. package/LICENSE +201 -0
  11. package/NOTICE.md +23 -0
  12. package/README.md +806 -0
  13. package/SECURITY.md +17 -0
  14. package/docker/open-design/.env.example +6 -0
  15. package/docker/open-design/Dockerfile +50 -0
  16. package/docker/open-design/docker-compose.yml +18 -0
  17. package/docker/open-design/opencode-od/agents/od-worker.md +22 -0
  18. package/docker/open-design/opencode-od/opencode.json +24 -0
  19. package/docs/agents.md +21 -0
  20. package/docs/commands.md +16 -0
  21. package/docs/configuration.md +30 -0
  22. package/docs/docker-open-design.md +42 -0
  23. package/docs/impeccable.md +18 -0
  24. package/docs/installation.md +176 -0
  25. package/docs/models.md +17 -0
  26. package/docs/open-design.md +25 -0
  27. package/docs/quickstart.md +74 -0
  28. package/docs/releases/v1.0.10.md +46 -0
  29. package/docs/releases/v1.0.14.md +39 -0
  30. package/docs/releases/v1.0.27.md +66 -0
  31. package/docs/security.md +8 -0
  32. package/docs/superpowers/plans/2026-07-20-safe-installation-lifecycle.md +779 -0
  33. package/docs/superpowers/plans/2026-07-20-version-identity-and-releases.md +590 -0
  34. package/docs/superpowers/specs/2026-07-20-safe-installation-lifecycle-design.md +1350 -0
  35. package/docs/superpowers/specs/2026-07-20-version-identity-and-releases-design.md +557 -0
  36. package/docs/superpowers.md +34 -0
  37. package/docs/synology.md +30 -0
  38. package/docs/troubleshooting.md +54 -0
  39. package/docs/workflows.md +44 -0
  40. package/doctor.sh +5 -0
  41. package/env.example +15 -0
  42. package/install.sh +5 -0
  43. package/opencode/AGENTS.md +104 -0
  44. package/opencode/agents/debugger.md +41 -0
  45. package/opencode/agents/designer.md +93 -0
  46. package/opencode/agents/developer.md +180 -0
  47. package/opencode/agents/evaluator.md +35 -0
  48. package/opencode/agents/evolver.md +31 -0
  49. package/opencode/agents/lead.md +251 -0
  50. package/opencode/agents/researcher.md +76 -0
  51. package/opencode/agents/review_api.md +34 -0
  52. package/opencode/agents/review_coordinator.md +111 -0
  53. package/opencode/agents/review_quality.md +35 -0
  54. package/opencode/agents/review_security.md +35 -0
  55. package/opencode/agents/review_tests.md +37 -0
  56. package/opencode/agents/reviewer.md +116 -0
  57. package/opencode/agents/scoper.md +75 -0
  58. package/opencode/agents/specifier.md +116 -0
  59. package/opencode/commands/code-simplify.md +36 -0
  60. package/opencode/commands/design.md +27 -0
  61. package/opencode/commands/evolve.md +165 -0
  62. package/opencode/commands/feature.md +67 -0
  63. package/opencode/commands/implement.md +11 -0
  64. package/opencode/commands/init.md +34 -0
  65. package/opencode/commands/loop.md +145 -0
  66. package/opencode/commands/mvp-spec.md +20 -0
  67. package/opencode/commands/plan.md +74 -0
  68. package/opencode/commands/research.md +12 -0
  69. package/opencode/commands/review-orchestrated.md +47 -0
  70. package/opencode/commands/review-preflight.md +26 -0
  71. package/opencode/commands/review.md +18 -0
  72. package/opencode/commands/scope.md +36 -0
  73. package/opencode/commands/spec.md +12 -0
  74. package/opencode/commands/test.md +40 -0
  75. package/opencode/docs/ai/evolution/README.md +135 -0
  76. package/opencode/docs/ai/evolution/benchmarks/manual-scenarios.md +123 -0
  77. package/opencode/docs/ai/evolution/benchmarks/router-scenarios.jsonl +8 -0
  78. package/opencode/docs/ai/evolution/evolution_history.md +83 -0
  79. package/opencode/docs/ai/evolution/mechanisms.jsonl +7 -0
  80. package/opencode/docs/ai/evolution/rejected_mechanisms.jsonl +2 -0
  81. package/opencode/docs/ai/evolution/runs/README.md +15 -0
  82. package/opencode/docs/ai/evolution/runs/iteration-001-sidecar/analysis/overview.md +12 -0
  83. package/opencode/docs/ai/evolution/runs/iteration-001-sidecar/change_evaluation.json +108 -0
  84. package/opencode/docs/ai/evolution/runs/iteration-001-sidecar/change_manifest.json +52 -0
  85. package/opencode/docs/ai/evolution/runs/iteration-001-sidecar/evaluation.md +19 -0
  86. package/opencode/docs/ai/evolution/runs/iteration-001-sidecar/post_evaluation.md +12 -0
  87. package/opencode/docs/ai/evolution/runs/iteration-002-feature-flow-fix/analysis/overview.md +7 -0
  88. package/opencode/docs/ai/evolution/runs/iteration-002-feature-flow-fix/change_evaluation.json +31 -0
  89. package/opencode/docs/ai/evolution/runs/iteration-002-feature-flow-fix/evaluation.md +19 -0
  90. package/opencode/docs/ai/evolution/runs/iteration-003-agent-readable-harness/analysis/overview.md +13 -0
  91. package/opencode/docs/ai/evolution/runs/iteration-003-agent-readable-harness/change_evaluation.json +66 -0
  92. package/opencode/docs/ai/evolution/runs/iteration-003-agent-readable-harness/change_manifest.json +82 -0
  93. package/opencode/docs/ai/evolution/runs/iteration-003-agent-readable-harness/evaluation.md +20 -0
  94. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/analysis/detail/ahe-run-lifecycle-validator.md +40 -0
  95. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/analysis/detail/evolve-evaluation-only-contract.md +15 -0
  96. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/analysis/detail/open-design-tool-contract.md +14 -0
  97. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/analysis/detail/slash-command-contract-coverage.md +40 -0
  98. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/analysis/overview.md +17 -0
  99. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/analysis/pre_apply_approval.md +15 -0
  100. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/change_evaluation.json +252 -0
  101. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/change_manifest.json +210 -0
  102. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/evaluation.md +25 -0
  103. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/post_apply_evaluation.md +15 -0
  104. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/post_manifest_evaluation.md +14 -0
  105. package/opencode/docs/ai/evolution/runs/iteration-004-orchestration-audit/pre_apply_evaluation.md +15 -0
  106. package/opencode/docs/ai/evolution/runs/iteration-005-harness-orchestration-audit/analysis/overview.md +13 -0
  107. package/opencode/docs/ai/evolution/runs/iteration-005-harness-orchestration-audit/change_evaluation.json +14 -0
  108. package/opencode/docs/ai/evolution/runs/iteration-005-harness-orchestration-audit/change_manifest.json +30 -0
  109. package/opencode/docs/ai/evolution/runs/iteration-005-harness-orchestration-audit/evaluation.md +25 -0
  110. package/opencode/docs/ai/evolution/runs/iteration-006-lead-delegation-audit/analysis/overview.md +13 -0
  111. package/opencode/docs/ai/evolution/runs/iteration-006-lead-delegation-audit/change_evaluation.json +14 -0
  112. package/opencode/docs/ai/evolution/runs/iteration-006-lead-delegation-audit/change_manifest.json +29 -0
  113. package/opencode/docs/ai/evolution/runs/iteration-006-lead-delegation-audit/evaluation.md +18 -0
  114. package/opencode/docs/ai/evolution/runs/iteration-007-agent-skills-integration/analysis/overview.md +13 -0
  115. package/opencode/docs/ai/evolution/runs/iteration-007-agent-skills-integration/change_evaluation.json +14 -0
  116. package/opencode/docs/ai/evolution/runs/iteration-007-agent-skills-integration/change_manifest.json +34 -0
  117. package/opencode/docs/ai/evolution/runs/iteration-007-agent-skills-integration/evaluation.md +17 -0
  118. package/opencode/docs/ai/evolution/runs/iteration-008-lead-readonly-shell-permissions/analysis/overview.md +13 -0
  119. package/opencode/docs/ai/evolution/runs/iteration-008-lead-readonly-shell-permissions/change_evaluation.json +12 -0
  120. package/opencode/docs/ai/evolution/runs/iteration-008-lead-readonly-shell-permissions/change_manifest.json +28 -0
  121. package/opencode/docs/ai/evolution/runs/iteration-008-lead-readonly-shell-permissions/evaluation.md +17 -0
  122. package/opencode/docs/ai/evolution/runs/iteration-009-lead-developer-ownership-loop/analysis/overview.md +9 -0
  123. package/opencode/docs/ai/evolution/runs/iteration-009-lead-developer-ownership-loop/change_evaluation.json +14 -0
  124. package/opencode/docs/ai/evolution/runs/iteration-009-lead-developer-ownership-loop/change_manifest.json +31 -0
  125. package/opencode/docs/ai/evolution/runs/iteration-009-lead-developer-ownership-loop/evaluation.md +18 -0
  126. package/opencode/docs/ai/evolution/runs/iteration-010-token-plugin-sidebar-content/analysis/overview.md +12 -0
  127. package/opencode/docs/ai/evolution/runs/iteration-010-token-plugin-sidebar-content/change_evaluation.json +14 -0
  128. package/opencode/docs/ai/evolution/runs/iteration-010-token-plugin-sidebar-content/change_manifest.json +31 -0
  129. package/opencode/docs/ai/evolution/runs/iteration-010-token-plugin-sidebar-content/evaluation.md +17 -0
  130. package/opencode/docs/ai/evolution/runs/iteration-011-lead-cd-which-permissions/analysis/overview.md +10 -0
  131. package/opencode/docs/ai/evolution/runs/iteration-011-lead-cd-which-permissions/change_evaluation.json +14 -0
  132. package/opencode/docs/ai/evolution/runs/iteration-011-lead-cd-which-permissions/change_manifest.json +30 -0
  133. package/opencode/docs/ai/evolution/runs/iteration-011-lead-cd-which-permissions/evaluation.md +17 -0
  134. package/opencode/docs/ai/evolution/runs/iteration-012-lead-shell-allowlist-boundaries/analysis/overview.md +25 -0
  135. package/opencode/docs/ai/evolution/runs/iteration-012-lead-shell-allowlist-boundaries/change_evaluation.json +28 -0
  136. package/opencode/docs/ai/evolution/runs/iteration-012-lead-shell-allowlist-boundaries/change_manifest.json +31 -0
  137. package/opencode/docs/ai/evolution/runs/iteration-012-lead-shell-allowlist-boundaries/evaluation.md +22 -0
  138. package/opencode/docs/ai/evolution/runs/iteration-013-doc-gardening-mechanical-checks/analysis/overview.md +27 -0
  139. package/opencode/docs/ai/evolution/runs/iteration-013-doc-gardening-mechanical-checks/change_evaluation.json +32 -0
  140. package/opencode/docs/ai/evolution/runs/iteration-013-doc-gardening-mechanical-checks/change_manifest.json +49 -0
  141. package/opencode/docs/ai/evolution/runs/iteration-013-doc-gardening-mechanical-checks/evaluation.md +92 -0
  142. package/opencode/docs/ai/evolution/runs/iteration-014-harness-baseline/analysis/detail/token-vs-semantic.md +31 -0
  143. package/opencode/docs/ai/evolution/runs/iteration-014-harness-baseline/analysis/overview.md +14 -0
  144. package/opencode/docs/ai/evolution/runs/iteration-014-harness-baseline/evaluation.md +36 -0
  145. package/opencode/docs/ai/evolution/runs/iteration-015-semantic-checker/analysis/overview.md +13 -0
  146. package/opencode/docs/ai/evolution/runs/iteration-015-semantic-checker/change_evaluation.json +31 -0
  147. package/opencode/docs/ai/evolution/runs/iteration-015-semantic-checker/change_manifest.json +47 -0
  148. package/opencode/docs/ai/evolution/runs/iteration-015-semantic-checker/evaluation.md +27 -0
  149. package/opencode/docs/ai/evolution/runs/iteration-016-contract-prompt-alignment/analysis/overview.md +32 -0
  150. package/opencode/docs/ai/evolution/runs/iteration-016-contract-prompt-alignment/change_evaluation.json +31 -0
  151. package/opencode/docs/ai/evolution/runs/iteration-016-contract-prompt-alignment/change_manifest.json +35 -0
  152. package/opencode/docs/ai/evolution/runs/iteration-016-contract-prompt-alignment/evaluation.md +31 -0
  153. package/opencode/docs/ai/evolution/runs/iteration-017-ahe-cycle/analysis/detail/pattern-1-feature-sidecar-false-positive.md +51 -0
  154. package/opencode/docs/ai/evolution/runs/iteration-017-ahe-cycle/analysis/detail/pattern-2-checker-time-budget.md +52 -0
  155. package/opencode/docs/ai/evolution/runs/iteration-017-ahe-cycle/analysis/overview.md +99 -0
  156. package/opencode/docs/ai/evolution/runs/iteration-017-ahe-cycle/change_evaluation.json +61 -0
  157. package/opencode/docs/ai/evolution/runs/iteration-017-ahe-cycle/change_manifest.json +61 -0
  158. package/opencode/docs/ai/evolution/runs/iteration-017-ahe-cycle/evaluation.md +448 -0
  159. package/opencode/docs/ai/evolution/runs/iteration-018-free-message-routing-audit/analysis/detail/intake-gray-zone.md +65 -0
  160. package/opencode/docs/ai/evolution/runs/iteration-018-free-message-routing-audit/analysis/overview.md +172 -0
  161. package/opencode/docs/ai/evolution/runs/iteration-018-free-message-routing-audit/evaluation.md +226 -0
  162. package/opencode/docs/ai/evolution/runs/iteration-019-handoff-routing-audit/analysis/detail/plan-only-gray-zone.md +62 -0
  163. package/opencode/docs/ai/evolution/runs/iteration-019-handoff-routing-audit/analysis/overview.md +167 -0
  164. package/opencode/docs/ai/evolution/runs/iteration-019-handoff-routing-audit/evaluation.md +163 -0
  165. package/opencode/docs/ai/evolution/runs/iteration-020-loop-engineering-command/analysis/overview.md +42 -0
  166. package/opencode/docs/ai/evolution/runs/iteration-020-loop-engineering-command/change_evaluation.json +46 -0
  167. package/opencode/docs/ai/evolution/runs/iteration-020-loop-engineering-command/change_manifest.json +57 -0
  168. package/opencode/docs/ai/evolution/runs/iteration-020-loop-engineering-command/evaluation.md +48 -0
  169. package/opencode/docs/ai/evolution/runs/iteration-021/analysis/detail/contract-vs-runtime-gap.md +163 -0
  170. package/opencode/docs/ai/evolution/runs/iteration-021/analysis/detail/evidence-collection-blocker.md +134 -0
  171. package/opencode/docs/ai/evolution/runs/iteration-021/analysis/overview.md +111 -0
  172. package/opencode/docs/ai/evolution/runs/iteration-021/change_evaluation.json +52 -0
  173. package/opencode/docs/ai/evolution/runs/iteration-021/change_manifest.json +50 -0
  174. package/opencode/docs/ai/evolution/runs/iteration-021/evaluation.md +46 -0
  175. package/opencode/docs/ai/evolution/runs/iteration-021/manifest-justification.md +48 -0
  176. package/opencode/docs/ai/evolution/session-sources.md +91 -0
  177. package/opencode/docs/ai/harness/README.md +32 -0
  178. package/opencode/docs/ai/harness/agents.md +148 -0
  179. package/opencode/docs/ai/harness/checks.md +119 -0
  180. package/opencode/docs/ai/harness/commands.md +391 -0
  181. package/opencode/docs/ai/harness/evidence.md +85 -0
  182. package/opencode/docs/ai/harness/init-detection-rules.md +160 -0
  183. package/opencode/docs/ai/harness/orchestrated-review.md +131 -0
  184. package/opencode/docs/ai/harness/skill-metadata-schema.md +198 -0
  185. package/opencode/docs/ai/harness/skill-resolution.md +202 -0
  186. package/opencode/docs/ai/harness/skill_registry.json +443 -0
  187. package/opencode/docs/ai/harness/skill_registry.md +43 -0
  188. package/opencode/docs/ai/project-context-template.md +53 -0
  189. package/opencode/opencode.json +38 -0
  190. package/opencode/package-lock.json +1717 -0
  191. package/opencode/package.json +11 -0
  192. package/opencode/plugins/token-tree-usage.tsx +206 -0
  193. package/opencode/references/performance-checklist.md +153 -0
  194. package/opencode/references/security-checklist.md +134 -0
  195. package/opencode/references/testing-patterns.md +236 -0
  196. package/opencode/scripts/check-harness.mjs +1572 -0
  197. package/opencode/scripts/check-harness.test.mjs +820 -0
  198. package/opencode/scripts/collect-session-evidence.mjs +612 -0
  199. package/opencode/scripts/collect-session-evidence.test.mjs +443 -0
  200. package/opencode/scripts/preflight-audit.mjs +497 -0
  201. package/opencode/scripts/preflight-audit.test.mjs +363 -0
  202. package/opencode/scripts/project-capability-snapshot.mjs +407 -0
  203. package/opencode/scripts/project-capability-snapshot.test.mjs +382 -0
  204. package/opencode/scripts/review-orchestrated-prepare.mjs +547 -0
  205. package/opencode/scripts/review-orchestrated-prepare.test.mjs +516 -0
  206. package/opencode/scripts/skill-resolver.mjs +585 -0
  207. package/opencode/scripts/skill-resolver.test.mjs +781 -0
  208. package/opencode/scripts/update-skill-registry.mjs +380 -0
  209. package/opencode/skills/api-and-interface-design/SKILL.md +315 -0
  210. package/opencode/skills/autonomous-loops/SKILL.md +312 -0
  211. package/opencode/skills/code-review-and-quality/SKILL.md +365 -0
  212. package/opencode/skills/code-simplification/SKILL.md +345 -0
  213. package/opencode/skills/context-engineering/SKILL.md +252 -0
  214. package/opencode/skills/debugging-and-error-recovery/SKILL.md +316 -0
  215. package/opencode/skills/documentation-and-adrs/SKILL.md +298 -0
  216. package/opencode/skills/doubt-driven-development/SKILL.md +168 -0
  217. package/opencode/skills/iterative-retrieval/SKILL.md +232 -0
  218. package/opencode/skills/open-design/SKILL.md +123 -0
  219. package/opencode/skills/performance-optimization/SKILL.md +365 -0
  220. package/opencode/skills/security-and-hardening/SKILL.md +369 -0
  221. package/opencode/skills/source-driven-development/SKILL.md +210 -0
  222. package/opencode/skills/test-driven-development/SKILL.md +406 -0
  223. package/opencode/skills/using-agent-skills/SKILL.md +194 -0
  224. package/opencode/skills/verification-loop/SKILL.md +162 -0
  225. package/opencode/tools/open_design.ts +361 -0
  226. package/opencode/tui.json +5 -0
  227. package/package.json +20 -0
  228. package/rollback.sh +5 -0
  229. package/scripts/check.sh +184 -0
  230. package/scripts/install-smoke.sh +111 -0
  231. package/scripts/manage-installation.mjs +1498 -0
  232. package/scripts/manage-installation.test.mjs +1936 -0
  233. package/scripts/version.mjs +197 -0
  234. package/scripts/version.test.mjs +195 -0
  235. package/uninstall.sh +5 -0
  236. package/upgrade.sh +5 -0
@@ -0,0 +1,590 @@
1
+ # Version Identity and Release Contract 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:** Establish `package.json` version `1.0.27` as the kit's single editable identity, propagate it through installation state and lifecycle commands, and reject release/tag/version drift mechanically.
6
+
7
+ **Architecture:** Add a dependency-free version module for strict stable-version parsing, comparison, canonical package reads, release-note checks, and explicit tag validation. Inject that canonical reader into the existing installation manager so manifests, doctor, upgrade, rollback, and recovery remain testable without duplicating the version. Keep release publication manual and preserve the Slice 1.2 transaction model.
8
+
9
+ **Tech Stack:** Node.js 24 ESM, `node:test`, Bash wrappers/smoke scripts, JSON manifests, GitHub Actions YAML, Markdown.
10
+
11
+ ---
12
+
13
+ ## Preconditions and execution constraints
14
+
15
+ Approved spec: `docs/superpowers/specs/2026-07-20-version-identity-and-releases-design.md`.
16
+
17
+ The public branch already contains local commit `948b488` for Slices 1.1 and
18
+ 1.2 and is ahead of `origin/master`. The approved Slice 1.3 spec and this plan
19
+ are intentionally uncommitted. Do not create a worktree from `HEAD`: it would
20
+ omit both documents and separate implementation from the unpublished Slice 1.2
21
+ baseline it extends.
22
+
23
+ The user previously required inline execution and public consolidation only at
24
+ the end. That overrides this skill's usual per-task commit cadence:
25
+
26
+ - work in the current public checkout;
27
+ - do not stage with `git add .` or `git add -A`;
28
+ - do not create intermediate commits;
29
+ - use checkboxes and test evidence as checkpoints;
30
+ - after final review, stage the exact public-safe file list and create one local
31
+ commit;
32
+ - do not push, tag, or create a release.
33
+
34
+ The private OpenCode configuration checkout is out of scope and must remain
35
+ clean. Never copy private configuration, providers, MCP wiring,
36
+ credentials, sessions, transcripts, memories, databases, endpoints, or machine
37
+ paths into the public repository.
38
+
39
+ Before editing:
40
+
41
+ - [ ] `git status --short --branch` shows only this approved spec and plan.
42
+ - [ ] `git log -1 --oneline` is `948b488 feat: add safe installation lifecycle`.
43
+ - [ ] `npm run check` passes 245 tests.
44
+ - [ ] `git diff --check` passes.
45
+
46
+ ## File responsibility map
47
+
48
+ ### Create
49
+
50
+ - `scripts/version.mjs` — strict version parser/comparator, canonical package
51
+ reader, repository contract checker, CLI output, and explicit tag check.
52
+ - `scripts/version.test.mjs` — module, repository contract, workflow, and
53
+ `V001–V027` uniqueness tests.
54
+ - `docs/releases/v1.0.27.md` — release-ready notes for the unpublished release.
55
+ - `docs/superpowers/specs/2026-07-20-version-identity-and-releases-design.md`
56
+ — approved public contract, already untracked when execution begins.
57
+ - `docs/superpowers/plans/2026-07-20-version-identity-and-releases.md` — this
58
+ reviewed public plan, also already untracked when execution begins.
59
+
60
+ ### Modify
61
+
62
+ - `package.json` — canonical version and `check:version`.
63
+ - `scripts/manage-installation.mjs` — injected version provider, required
64
+ manifest field, `--version`, version-aware lifecycle behavior.
65
+ - `scripts/manage-installation.test.mjs` — fixtures and `V012–V027` scenarios.
66
+ - `scripts/check.sh` — required files and version contract invocation.
67
+ - `scripts/install-smoke.sh` — version-bearing lifecycle assertions.
68
+ - `.github/workflows/check.yml` — tag trigger and tag-only validation.
69
+ - `README.md`, `docs/installation.md`, `docs/quickstart.md` — public contract.
70
+
71
+ ### Preserve unless a failing test proves otherwise
72
+
73
+ - The five shell wrappers: their pass-through already supports `--version`.
74
+ - `opencode/package.json`: dependency manifest, not a version source.
75
+ - Historical `docs/releases/*`: no backfill.
76
+
77
+ ## Test-ID contract
78
+
79
+ Keep `[S001]` through `[S136]` exactly once. Add `[V001]` through `[V027]`
80
+ exactly once across the two root test files. An unlabelled meta-test in
81
+ `scripts/version.test.mjs` reads both files and asserts the exact sorted V list;
82
+ the meta-test has no V label to avoid recursive counting.
83
+
84
+ ---
85
+
86
+ ### Task 1: Strict canonical version module
87
+
88
+ **Files:**
89
+ - Create: `scripts/version.mjs`
90
+ - Create: `scripts/version.test.mjs`
91
+ - Modify: `package.json:3`
92
+
93
+ - [ ] **Step 1: Write RED tests `[V001]–[V003]`**
94
+
95
+ Test canonical `1.0.27`; reject `v1.0.27`, leading zeroes, missing components,
96
+ prerelease, metadata, whitespace, negative/unsafe components; prove numeric
97
+ ordering `1.9.9 < 1.10.0`. Use temporary repository fixtures and require exact
98
+ package name `opencode-agent-orchestration-kit`.
99
+
100
+ Import the intended interface:
101
+
102
+ ```js
103
+ import {
104
+ compareStableVersions,
105
+ formatVersion,
106
+ parseStableVersion,
107
+ readCanonicalVersion,
108
+ } from "./version.mjs";
109
+ ```
110
+
111
+ - [ ] **Step 2: Verify RED**
112
+
113
+ Run `node --test --test-name-pattern='V001|V002|V003' scripts/version.test.mjs`.
114
+ Expected: FAIL because the module/exports do not exist.
115
+
116
+ - [ ] **Step 3: Implement the minimal pure functions**
117
+
118
+ ```js
119
+ export function parseStableVersion(value) { /* strict MAJOR.MINOR.PATCH */ }
120
+ export function compareStableVersions(left, right) { /* numeric comparison */ }
121
+ export function readCanonicalVersion(repositoryRoot, fsOps = fs) { /* package */ }
122
+ export function formatVersion(version) {
123
+ return `opencode-agent-orchestration-kit ${version}`;
124
+ }
125
+ ```
126
+
127
+ Reject non-safe integers. Read a regular, non-symlink root `package.json` through
128
+ an injected filesystem object. Never inspect Git or the network.
129
+
130
+ - [ ] **Step 4: Change root package version to `1.0.27`**
131
+
132
+ Do not add a version to `opencode/package.json`.
133
+
134
+ - [ ] **Step 5: Verify GREEN**
135
+
136
+ Run the focused test command and `npm run check:quick`. Expected: 3 focused
137
+ tests pass and existing contract checks remain green.
138
+
139
+ ### Task 2: Version-bearing manifest schema
140
+
141
+ **Files:**
142
+ - Modify: `scripts/manage-installation.mjs:218-288,532-581,865-901`
143
+ - Modify: `scripts/manage-installation.test.mjs:57-169`
144
+
145
+ - [ ] **Step 1: Update fixtures and write RED `[V012]–[V015]`**
146
+
147
+ Add `kit_version: "1.0.27"` to `validManifest()`. Make `managerFixture()` inject
148
+ a provider returning `1.0.27`, and make `planFixture()` pass the same explicit
149
+ `kitVersion` into pure planning options. Test initial install persistence
150
+ (`V012`); install dry-run reports the source identity while leaving the target
151
+ absent (`V013`); invalid/missing manifest versions (`V014`); and digest change
152
+ when only version changes (`V015`).
153
+
154
+ - [ ] **Step 2: Verify RED**
155
+
156
+ Run `node --test --test-name-pattern='V012|V013|V014|V015' scripts/manage-installation.test.mjs`.
157
+ Expected: FAIL because generated manifests omit or reject the new field.
158
+
159
+ - [ ] **Step 3: Require the field without duplicating identity**
160
+
161
+ Import `parseStableVersion`, add `kit_version` to `MANIFEST_KEYS`, validate it,
162
+ and include it in `makeNextManifest`. Pass the value through `buildPlan` options.
163
+ Extend `createInstallationManager` with an injected `versionProvider`; do not
164
+ add a literal `KIT_VERSION` constant.
165
+
166
+ - [ ] **Step 4: Preserve the field in snapshots**
167
+
168
+ Do not add a transaction-level version. Existing complete previous/next
169
+ manifest snapshots and canonical digests must carry it.
170
+
171
+ - [ ] **Step 5: Verify GREEN and regression safety**
172
+
173
+ Run the focused command, then `node --test scripts/manage-installation.test.mjs`.
174
+ Expected: all manager tests pass and all S IDs remain unique.
175
+
176
+ ### Task 3: Exact mutation-free `--version`
177
+
178
+ **Files:**
179
+ - Modify: `scripts/version.mjs`
180
+ - Modify: `scripts/version.test.mjs`
181
+ - Modify: `scripts/manage-installation.mjs:1326-1381`
182
+ - Test unchanged: all five shell wrappers
183
+
184
+ - [ ] **Step 1: Write RED `[V004]–[V006]`**
185
+
186
+ Require exact direct-manager output, identical output from every wrapper, zero
187
+ target writes, and exit two when `--version` is combined with any other flag.
188
+
189
+ - [ ] **Step 2: Verify RED**
190
+
191
+ Run `node --test --test-name-pattern='V004|V005|V006' scripts/version.test.mjs`.
192
+ Expected: FAIL as an unknown command/argument.
193
+
194
+ - [ ] **Step 3: Wire the provider once**
195
+
196
+ Production `main()` derives the repository root from the existing source root
197
+ and creates `() => readCanonicalVersion(repositoryRoot)`. Recognize sole direct
198
+ `--version` and sole wrapper `<command> --version` before target resolution.
199
+ Print `formatVersion(version)` plus one newline. Never inventory source, inspect
200
+ target, lock, or mutate state.
201
+
202
+ - [ ] **Step 4: Add `node scripts/version.mjs` CLI output**
203
+
204
+ Use an entrypoint guard so importing the module has no side effects.
205
+
206
+ - [ ] **Step 5: Verify GREEN**
207
+
208
+ Run the focused test and `bash -n` on all wrappers. Expected: PASS; wrappers
209
+ remain executable and unchanged.
210
+
211
+ ### Task 4: Version-aware upgrade planning
212
+
213
+ **Files:**
214
+ - Modify: `scripts/manage-installation.mjs:532-680,1210-1324`
215
+ - Modify: `scripts/manage-installation.test.mjs`
216
+
217
+ - [ ] **Step 1: Write RED `[V016]–[V019]`**
218
+
219
+ Test: higher source version creates a manifest-only upgrade even with unchanged
220
+ payload files; equal version/payload is no-op; equal version/different payload
221
+ blocks as `same-version-different-payload`; lower source blocks as
222
+ `source-older`. On blockers assert target, manifest, lock, journal, and rollback
223
+ bytes are unchanged.
224
+
225
+ - [ ] **Step 2: Verify RED**
226
+
227
+ Run `node --test --test-name-pattern='V016|V017|V018|V019' scripts/manage-installation.test.mjs`.
228
+ Expected: FAIL because planning ignores version order.
229
+
230
+ - [ ] **Step 3: Add one pure version gate**
231
+
232
+ Receive source version, previous manifest, and current source payload digest;
233
+ return `upgrade-available`, `current`, `same-version-different-payload`, or
234
+ `source-older`. Reuse `compareStableVersions`. Evaluate before target bootstrap
235
+ or lock acquisition. A greater version sets `hasWork` even with zero file ops.
236
+
237
+ - [ ] **Step 4: Preserve command boundaries**
238
+
239
+ Apply the gate to upgrade. Initial install uses the canonical version; uninstall
240
+ uses validated installed state. Add no downgrade/force flag.
241
+
242
+ - [ ] **Step 5: Verify GREEN**
243
+
244
+ Run the focused command plus matching existing `S001`, `S008`, `S009`, `S092`.
245
+ Expected: PASS.
246
+
247
+ ### Task 5: Deterministic doctor taxonomy
248
+
249
+ **Files:**
250
+ - Modify: `scripts/manage-installation.mjs:1142-1190,1326-1381`
251
+ - Modify: `scripts/manage-installation.test.mjs`
252
+
253
+ - [ ] **Step 1: Write RED `[V021]` and `[V022]`**
254
+
255
+ Table-test `current`, `upgrade-available`, `source-older`,
256
+ `same-version-different-payload`, and `invalid-version-state`. Separately prove
257
+ manifest absence yields `not-installed`, source `1.0.27`, installed null;
258
+ present corrupt/version-invalid manifest yields exit two and never
259
+ `not-installed`.
260
+
261
+ Assert additive fields `sourceVersion`, `installedVersion`, `versionState` and
262
+ preservation of existing safe report keys.
263
+
264
+ - [ ] **Step 2: Verify RED**
265
+
266
+ Run `node --test --test-name-pattern='V021|V022' scripts/manage-installation.test.mjs`.
267
+ Expected: FAIL because doctor has no version fields.
268
+
269
+ - [ ] **Step 3: Compose reports without weakening fail-closed behavior**
270
+
271
+ Add the three fields to valid/absent reports. Catch only enough validation
272
+ failure to classify a present invalid manifest or canonical source safely; use
273
+ null only for the side that cannot supply a valid version. Never echo raw JSON
274
+ or package contents. Filesystem failures that prevent a safe report retain the
275
+ generic exit-two path and must not become `not-installed`.
276
+
277
+ - [ ] **Step 4: Preserve existing finding precedence**
278
+
279
+ Version `current` does not override locks, active transactions, ownership drift,
280
+ preserved warnings, or rollback residue. Add concise ordinary doctor output;
281
+ leave ACK output unchanged.
282
+
283
+ - [ ] **Step 5: Verify GREEN and regressions**
284
+
285
+ Run the focused tests plus `S021`, `S044`, `S080`, `S093`, `S108`. Expected:
286
+ PASS.
287
+
288
+ ### Task 6: Acknowledgement, rollback, and recovery identity
289
+
290
+ **Files:**
291
+ - Modify: `scripts/manage-installation.mjs:902-1140,1191-1269`
292
+ - Modify: `scripts/manage-installation.test.mjs`
293
+
294
+ - [ ] **Step 1: Write RED `[V020]`, `[V023]–[V027]`**
295
+
296
+ Prove: ACK cannot bypass a newer source transition; upgrade snapshots record the
297
+ new version; rollback restores the old version; initial-install rollback restores
298
+ manifest absence; interrupted recovery uses journal versions even if the current
299
+ provider changes; corrupt version state cannot bypass locks, ownership, digest,
300
+ conflict, or recovery checks.
301
+
302
+ - [ ] **Step 2: Verify RED**
303
+
304
+ Run `node --test --test-name-pattern='V020|V023|V024|V025|V026|V027' scripts/manage-installation.test.mjs`.
305
+ Expected: version assertions fail.
306
+
307
+ - [ ] **Step 3: Preserve snapshot identity**
308
+
309
+ Commit, rollback, and recovery use only versions stored in complete previous and
310
+ next manifests. Never replace a recovered snapshot version with the current
311
+ provider. Existing canonical manifest digest checks cover version-only
312
+ corruption.
313
+
314
+ - [ ] **Step 4: Gate acknowledgement narrowly**
315
+
316
+ When source and installed versions differ, return action required before ACK
317
+ authorization or mutation. Normal upgrade remains possible because Slice 1.2
318
+ treats preserved merge warnings as non-blocking; after upgrade, ACK can operate
319
+ at the current version.
320
+
321
+ - [ ] **Step 5: Verify GREEN and crash regressions**
322
+
323
+ Run the V-focused command plus `S012`, `S016`, `S029`, `S030`, `S045`, `S050`,
324
+ `S051`, `S099`, `S100`, `S133`. Expected: PASS.
325
+
326
+ ### Task 7: Release-note and repository drift checker
327
+
328
+ **Files:**
329
+ - Modify: `scripts/version.mjs`
330
+ - Modify: `scripts/version.test.mjs`
331
+ - Create: `docs/releases/v1.0.27.md`
332
+ - Modify: `package.json:7-17`
333
+ - Modify: `scripts/check.sh:7-67`
334
+
335
+ - [ ] **Step 1: Write RED `[V007]–[V011]`**
336
+
337
+ Using temp fixture repos, test current note path/heading, missing/wrong note,
338
+ historical gaps allowed, matching/mismatching/malformed tag, and repository-local
339
+ check without tag context. `[V008]` must also prove each allowlisted competing
340
+ declaration fails: root `VERSION`, `opencode/package.json.version`, and a stable
341
+ literal added to each operational source class. Never rewrite the real package
342
+ or depend on local tags.
343
+
344
+ - [ ] **Step 2: Verify RED**
345
+
346
+ Run `node --test --test-name-pattern='V007|V008|V009|V010|V011' scripts/version.test.mjs`.
347
+ Expected: FAIL because check modes do not exist.
348
+
349
+ - [ ] **Step 3: Implement explicit modes**
350
+
351
+ Support:
352
+
353
+ ```bash
354
+ node scripts/version.mjs --check
355
+ node scripts/version.mjs --check-tag v1.0.27
356
+ ```
357
+
358
+ `--check` validates root package identity, exactly the current note filename and
359
+ first heading, and mechanical single-source rules through the exported API:
360
+
361
+ ```js
362
+ export function checkVersionContract(options) { /* returns validated identity */ }
363
+ ```
364
+
365
+ `options` supplies `repositoryRoot` and an injectable filesystem. The checker
366
+ uses this explicit allowlist:
367
+
368
+ - root `VERSION` must be absent;
369
+ - `opencode/package.json` must not contain a `version` key;
370
+ - `scripts/version.mjs`, `scripts/manage-installation.mjs`, the five wrappers,
371
+ `scripts/check.sh`, and `.github/workflows/check.yml` must not contain a
372
+ concrete stable-version literal outside the root package consumer path;
373
+ - current release notes and behavioral tests are intentional consumers and are
374
+ excluded from duplicate-declaration scanning.
375
+
376
+ This catches a future operational `KIT_VERSION = "1.0.27"` or equivalent hard
377
+ coding while permitting dependency, schema, fixture, smoke, and historical
378
+ documentation versions on their declared surfaces. The scan is allowlisted and
379
+ does not grep arbitrary prose. It does not require `.git`, inspect historical
380
+ tags, or use the network. `--check` calls `checkVersionContract`; `--check-tag`
381
+ accepts exactly one supplied tag after the same contract passes.
382
+
383
+ - [ ] **Step 4: Write release-ready 1.0.27 notes**
384
+
385
+ Heading:
386
+
387
+ ```markdown
388
+ # v1.0.27 - Safe lifecycle and canonical release identity
389
+ ```
390
+
391
+ Describe the actual unpublished delta since v1.0.26: complete CI, safe
392
+ manifest-owned lifecycle, canonical release identity, legacy-install migration,
393
+ validation, and public exclusions. Never claim remote availability or an
394
+ already-created tag/release.
395
+
396
+ - [ ] **Step 5: Integrate package and fast checks**
397
+
398
+ Add `"check:version": "node scripts/version.mjs --check"`. Invoke it once from
399
+ the fast contractual path. Require the module, test, and current release note in
400
+ `scripts/check.sh`. Leave `unit-and-script-tests` unchanged because its glob
401
+ already includes the new test.
402
+
403
+ - [ ] **Step 6: Add the V-ID meta-test**
404
+
405
+ Read both test files and assert the extracted list is exactly `V001–V027`, once
406
+ each. Retain a separate S-ID verification at final validation.
407
+
408
+ - [ ] **Step 7: Verify GREEN**
409
+
410
+ ```bash
411
+ node --test scripts/version.test.mjs
412
+ npm run check:version
413
+ npm run check:quick
414
+ ```
415
+
416
+ Expected: PASS.
417
+
418
+ ### Task 8: Tag-aware CI without publication
419
+
420
+ **Files:**
421
+ - Modify: `.github/workflows/check.yml:3-41`
422
+ - Modify: `scripts/version.test.mjs`
423
+
424
+ - [ ] **Step 1: Extend `[V010]`/`[V011]` with RED workflow assertions**
425
+
426
+ Assert tag pushes matching `v*`; a tag-only `--check-tag` step receiving
427
+ `GITHUB_REF_NAME`; preserved PR/master triggers and differentiated CI steps; no
428
+ tag/release creation, push command, or write permission.
429
+
430
+ - [ ] **Step 2: Verify RED**
431
+
432
+ Run `node --test --test-name-pattern='V010|V011' scripts/version.test.mjs`.
433
+ Expected: FAIL on current branch-only workflow.
434
+
435
+ - [ ] **Step 3: Add tag trigger and validation**
436
+
437
+ Keep:
438
+
439
+ ```yaml
440
+ push:
441
+ branches:
442
+ - master
443
+ tags:
444
+ - "v*"
445
+ ```
446
+
447
+ After Node setup, add a step guarded by
448
+ `startsWith(github.ref, 'refs/tags/')` that passes only `GITHUB_REF_NAME` to
449
+ `--check-tag`. Preserve contract, unit/script, `npm ci`, audit, typecheck, and
450
+ smoke as separate steps. Add no write permission or release action.
451
+
452
+ - [ ] **Step 4: Simulate correct and incorrect tags**
453
+
454
+ ```bash
455
+ node scripts/version.mjs --check-tag v1.0.27
456
+ node scripts/version.mjs --check-tag v1.0.26
457
+ ```
458
+
459
+ Expected: first zero; second exit two with concise mismatch. Record the second
460
+ as expected failure-path evidence.
461
+
462
+ - [ ] **Step 5: Verify GREEN workflow tests**
463
+
464
+ Run the focused V010/V011 command. Expected: PASS.
465
+
466
+ ### Task 9: Smoke lifecycle and public documentation
467
+
468
+ **Files:**
469
+ - Modify: `scripts/install-smoke.sh:18-54`
470
+ - Modify: `README.md:320-390,535-555,740-765`
471
+ - Modify: `docs/installation.md`
472
+ - Modify: `docs/quickstart.md:60-70`
473
+
474
+ - [ ] **Step 1: Extend smoke assertions**
475
+
476
+ After install, use Node rather than `jq` to assert the active manifest and both
477
+ manifest snapshots inside `.oak/rollback/transaction.json` contain the expected
478
+ `kit_version` values. Assert all wrapper version lines. After
479
+ uninstall/rollback, assert the restored manifest still contains 1.0.27 and final
480
+ doctor succeeds.
481
+
482
+ - [ ] **Step 2: Run smoke before docs**
483
+
484
+ Run `npm run installation-smoke`. Expected: `installation smoke ok`. Fix only
485
+ Slice 1.3 lifecycle regressions.
486
+
487
+ - [ ] **Step 3: Update installation docs**
488
+
489
+ Document `kit_version` versus `schema_version`, version commands, six doctor
490
+ states/null semantics, higher/equal/lower upgrade rules, same-version payload
491
+ blocker, experimental manifest repair, and legacy dry-run/force migration. Do
492
+ not authorize automatic `.oak` deletion; require backup and exact-path review.
493
+
494
+ - [ ] **Step 4: Update README and quickstart**
495
+
496
+ Keep the dynamic latest-release badge. Add canonical/version-check commands,
497
+ manual tag validation, and explicit publication boundary. Do not claim 1.0.27
498
+ is remotely available.
499
+
500
+ - [ ] **Step 5: Validate documentation boundary**
501
+
502
+ Run `npm run check:quick`, `git diff --check`, and `bash scripts/check.sh`.
503
+ Expected: PASS and no public leak findings.
504
+
505
+ ### Task 10: Full verification, independent review, and local consolidation
506
+
507
+ **Files:**
508
+ - Verify every intended file above.
509
+ - Do not touch private config.
510
+
511
+ - [ ] **Step 1: Run focused suites and exact ID checks**
512
+
513
+ ```bash
514
+ node --test scripts/version.test.mjs
515
+ node --test scripts/manage-installation.test.mjs
516
+ node -e 'const fs=require("fs");const files=["scripts/version.test.mjs","scripts/manage-installation.test.mjs"];const text=files.map(f=>fs.readFileSync(f,"utf8")).join("\n");for(const prefix of ["S","V"]){const end=prefix==="S"?136:27;const re=new RegExp(`\\[${prefix}(\\d{3})\\]`,"g");const ids=[...text.matchAll(re)].map(m=>m[1]);const counts=new Map();for(const id of ids)counts.set(id,(counts.get(id)||0)+1);const bad=[];for(let i=1;i<=end;i++){const id=String(i).padStart(3,"0");if(counts.get(id)!==1)bad.push([`${prefix}${id}`,counts.get(id)||0]);}if(ids.length!==end||bad.length){console.error({prefix,count:ids.length,bad});process.exit(1);}}console.log("scenario ids unique");'
517
+ ```
518
+
519
+ Expected: both suites pass; exactly 136 S IDs and 27 V IDs.
520
+
521
+ - [ ] **Step 2: Run complete release readiness**
522
+
523
+ ```bash
524
+ npm run check:version
525
+ npm run check
526
+ node scripts/version.mjs --check-tag v1.0.27
527
+ set +e
528
+ node scripts/version.mjs --check-tag v1.0.26
529
+ mismatch_status=$?
530
+ set -e
531
+ test "$mismatch_status" -eq 2
532
+ npm run check:release
533
+ bash -n install.sh upgrade.sh doctor.sh uninstall.sh rollback.sh scripts/check.sh scripts/install-smoke.sh
534
+ git diff --check
535
+ ```
536
+
537
+ Expected: the matching tag passes; the mismatched tag exits exactly two and the
538
+ explicit status assertion passes; every remaining command passes. Audit may
539
+ report the known three low transitive
540
+ vulnerabilities while passing the configured moderate threshold; do not force a
541
+ breaking dependency change in this slice.
542
+
543
+ - [ ] **Step 3: Inspect exact scope and public leak boundary**
544
+
545
+ Apply `opencode-public-sync`: inspect `git diff --stat`, `git status --short`,
546
+ and the intended public diff for private paths, providers/MCPs, credentials, raw
547
+ evidence, endpoints, or machine identifiers. Explain intentional generic docs
548
+ hits; remove every unintended hit.
549
+
550
+ - [ ] **Step 4: Request one independent implementation review**
551
+
552
+ Provide the approved spec, this plan, full diff, and evidence. Require explicit
553
+ review of canonical-source non-duplication; invalid-manifest doctor fail-closed
554
+ behavior; version-only digest/recovery integrity; blockers before writes;
555
+ mutation-free wrapper output; tag CI without publication; and leak safety.
556
+
557
+ Fix only Critical/Important Slice 1.3 findings, rerun focused/full checks, and
558
+ repeat review once. Surface a third blocked loop to the user.
559
+
560
+ - [ ] **Step 5: Consolidate locally after review passes**
561
+
562
+ Stage each intended file explicitly—never `.` or `-A`—and create one local
563
+ public commit:
564
+
565
+ The exact staged set includes the approved Slice 1.3 spec and this reviewed plan
566
+ alongside every implementation, test, workflow, release-note, smoke, and public
567
+ documentation file listed in the responsibility map. They are intentional
568
+ public artifacts, not leftovers. Do not stage ignored `.DS_Store` or any file
569
+ outside that enumerated set.
570
+
571
+ ```bash
572
+ git commit -m "feat: add canonical version and release contract"
573
+ ```
574
+
575
+ Verify the public branch is clean and ahead of origin. Do not push, tag, create
576
+ a GitHub Release, or publish npm.
577
+
578
+ ## Final handoff evidence
579
+
580
+ Report:
581
+
582
+ - canonical version and exact version output;
583
+ - local public commit hash and unchanged private checkout;
584
+ - focused/full test counts and scenario-ID uniqueness;
585
+ - matching tag success plus expected mismatch evidence;
586
+ - independent-review verdict and audit residuals;
587
+ - explicit confirmation that no push, tag, GitHub Release, or npm publication
588
+ occurred;
589
+ - next recommendation: Slice 1.4 compatibility matrix, only after separate
590
+ approval.