opencode-agent-orchestration-kit 1.0.32 → 1.0.37

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 (88) hide show
  1. package/README.md +73 -4
  2. package/SECURITY.md +7 -0
  3. package/docs/cli.md +100 -0
  4. package/docs/installation.md +25 -5
  5. package/docs/quickstart.md +1 -1
  6. package/docs/releases/v1.0.33.md +72 -0
  7. package/docs/releases/v1.0.34.md +59 -0
  8. package/docs/releases/v1.0.35.md +62 -0
  9. package/docs/releases/v1.0.36.md +58 -0
  10. package/docs/releases/v1.0.37.md +53 -0
  11. package/docs/security.md +4 -0
  12. package/docs/supply-chain.md +9 -5
  13. package/docs/threat-model.md +244 -0
  14. package/docs/use-cases/README.md +31 -0
  15. package/docs/use-cases/direct-label-change/README.md +76 -0
  16. package/docs/use-cases/direct-label-change/before/package.json +8 -0
  17. package/docs/use-cases/direct-label-change/before/src/settings-label.mjs +1 -0
  18. package/docs/use-cases/direct-label-change/before/test/settings-label.test.mjs +8 -0
  19. package/docs/use-cases/direct-label-change/case.json +118 -0
  20. package/docs/use-cases/direct-label-change/expected/package.json +8 -0
  21. package/docs/use-cases/direct-label-change/expected/src/settings-label.mjs +1 -0
  22. package/docs/use-cases/direct-label-change/expected/test/settings-label.test.mjs +8 -0
  23. package/docs/use-cases/feature-tag-normalizer/README.md +78 -0
  24. package/docs/use-cases/feature-tag-normalizer/before/package.json +8 -0
  25. package/docs/use-cases/feature-tag-normalizer/before/src/normalize-tags.mjs +3 -0
  26. package/docs/use-cases/feature-tag-normalizer/before/test/normalize-tags.test.mjs +13 -0
  27. package/docs/use-cases/feature-tag-normalizer/case.json +119 -0
  28. package/docs/use-cases/feature-tag-normalizer/expected/package.json +8 -0
  29. package/docs/use-cases/feature-tag-normalizer/expected/src/normalize-tags.mjs +14 -0
  30. package/docs/use-cases/feature-tag-normalizer/expected/test/normalize-tags.test.mjs +18 -0
  31. package/docs/workflows.md +6 -0
  32. package/opencode/agents/lead.md +11 -2
  33. package/opencode/agents/review_api.md +26 -9
  34. package/opencode/agents/review_coordinator.md +60 -68
  35. package/opencode/agents/review_quality.md +27 -11
  36. package/opencode/agents/review_security.md +26 -10
  37. package/opencode/agents/review_tests.md +26 -9
  38. package/opencode/agents/reviewer.md +95 -80
  39. package/opencode/commands/autonomous.md +75 -0
  40. package/opencode/commands/evolve.md +3 -1
  41. package/opencode/commands/feature.md +6 -2
  42. package/opencode/commands/loop.md +12 -8
  43. package/opencode/commands/review-orchestrated.md +26 -24
  44. package/opencode/commands/review-preflight.md +8 -7
  45. package/opencode/commands/review.md +27 -10
  46. package/opencode/docs/ai/harness/README.md +5 -0
  47. package/opencode/docs/ai/harness/agents.md +27 -3
  48. package/opencode/docs/ai/harness/checks.md +18 -0
  49. package/opencode/docs/ai/harness/commands.md +44 -0
  50. package/opencode/docs/ai/harness/orchestrated-review.md +8 -1
  51. package/opencode/docs/ai/harness/orchestration-contracts.json +924 -0
  52. package/opencode/package-lock.json +14 -8
  53. package/opencode/package.json +1 -0
  54. package/opencode/plugins/shell-export-guard.ts +23 -0
  55. package/opencode/scripts/adversarial-harness.test.mjs +5 -2
  56. package/opencode/scripts/check-harness.mjs +873 -18
  57. package/opencode/scripts/check-harness.test.mjs +562 -0
  58. package/opencode/scripts/loop-state.mjs +88 -14
  59. package/opencode/scripts/loop-state.test.mjs +82 -5
  60. package/opencode/scripts/review-orchestrated-prepare.mjs +18 -1
  61. package/opencode/scripts/review-orchestrated-prepare.test.mjs +49 -0
  62. package/opencode/scripts/shell-export-policy.d.mts +4 -0
  63. package/opencode/scripts/shell-export-policy.mjs +272 -0
  64. package/opencode/scripts/shell-export-policy.test.mjs +96 -0
  65. package/opencode/skills/code-review-and-quality/SKILL.md +63 -321
  66. package/opencode/skills/code-review-and-quality/references/profiles/backend-clean-ddd-cqrs.md +60 -0
  67. package/opencode/skills/code-review-and-quality/references/profiles/backend.md +54 -0
  68. package/opencode/skills/code-review-and-quality/references/profiles/frontend-clean-layered.md +60 -0
  69. package/opencode/skills/code-review-and-quality/references/profiles/frontend.md +62 -0
  70. package/opencode/skills/code-review-and-quality/references/review-policy.md +258 -0
  71. package/package.json +5 -2
  72. package/scripts/check-supply-chain.mjs +16 -2
  73. package/scripts/check-supply-chain.test.mjs +52 -1
  74. package/scripts/check-threat-model.mjs +421 -0
  75. package/scripts/check-threat-model.test.mjs +304 -0
  76. package/scripts/check-use-cases.mjs +501 -0
  77. package/scripts/check-use-cases.test.mjs +225 -0
  78. package/scripts/check.sh +55 -1
  79. package/scripts/install-smoke.sh +24 -1
  80. package/scripts/manage-installation.mjs +567 -25
  81. package/scripts/manage-installation.test.mjs +418 -0
  82. package/scripts/oak.mjs +246 -0
  83. package/scripts/oak.test.mjs +329 -0
  84. package/scripts/package-smoke.mjs +57 -0
  85. package/scripts/package-smoke.test.mjs +75 -2
  86. package/scripts/version.mjs +1 -0
  87. package/scripts/version.test.mjs +3 -2
  88. package/supply-chain.json +1 -0
@@ -1,5 +1,13 @@
1
1
  # Command Contracts
2
2
 
3
+ The mechanical relationships described here are also declared in
4
+ `docs/ai/harness/orchestration-contracts.json`: root agent, workflow entrypoint,
5
+ stage order, barriers, retries, completion authority, and minimum evidence.
6
+ The checker selects the exact private or public inventory profile and compares
7
+ the JSON with frontmatter, the routing corpus, and these narrative anchors. The
8
+ JSON neither executes workflows nor generates Markdown; frontmatter remains
9
+ the effective configuration and this page retains operational nuance.
10
+
3
11
  ## Free-form Message
4
12
 
5
13
  Contract: `lead` router -> appropriate agent.
@@ -166,6 +174,27 @@ Criteria:
166
174
  - No auto-merge, scheduling, write-enabled MCP connectors, parallel execution,
167
175
  or implicit worktree creation.
168
176
 
177
+ ## `/autonomous`
178
+
179
+ Contract: explicit invocation -> `developer -> reviewer -> developer (state sync)`.
180
+
181
+ `/autonomous <objective>` authorizes one local task without another human gate
182
+ per iteration. It requires durable state, deterministic validation, new evidence
183
+ for retries, and reviewer-only closure. Before starting, `lead` sets a
184
+ task-specific planned iteration budget from 1 to 6; six remains the hard safety
185
+ ceiling rather than a target. Final reviewer approval stops the cycle
186
+ immediately. An explicit schema migration requires renewed human approval
187
+ before `oak state resume`; earlier approval cannot be reused. It permits at
188
+ most the planned iteration budget and stops on success, no progress, repeated failure, impossible validation, budget,
189
+ protected changes, scope expansion, or sensitive paths. It forbids scheduling,
190
+ parallelism, worktrees, network, write MCP, commit, push, merge, deploy, and
191
+ publication; `/loop` retains its human gate and three-iteration bound.
192
+
193
+ Use installed `oak state --root .` so consumer repositories do not need to
194
+ contain the runtime. `lead` invokes `reviewer` only as a `task` subagent. A
195
+ durable reviewer session-id/identity/`APPROVE` attestation is required before
196
+ the loop can record `completed`; `opencode run --agent reviewer` is not valid.
197
+
169
198
  ## `/mvp-spec`
170
199
 
171
200
  Contract: `scoper -> researcher -> scoper synthesis -> specifier`.
@@ -335,6 +364,15 @@ Criteria:
335
364
 
336
365
  Contract: `reviewer`.
337
366
 
367
+ - Runs read-only as a direct command and returns `review_stage: final`.
368
+ - Uses the canonical core policy plus generic backend/frontend profiles that
369
+ match the changed surface.
370
+ - Strict Clean/DDD/hexagonal/CQRS or layered profiles require an explicit task
371
+ or repository declaration; directory layout is not sufficient evidence.
372
+ - Only introduced or worsened defects can block. Pre-existing debt is reported
373
+ as a non-blocking observation.
374
+ - The real diff and original evidence are primary; a developer summary is not.
375
+
338
376
  Criteria:
339
377
 
340
378
  - Review `git diff`, active spec, and available evidence.
@@ -350,6 +388,7 @@ Criteria:
350
388
  - Creates `manifest.json`, `shared-review-context.md`, `patches/`, and
351
389
  `findings/` with `scripts/review-orchestrated-prepare.mjs`.
352
390
  - Runs no AI reviewer or subagent and never claims that AI review occurred.
391
+ - Returns `review_stage: preflight` and `verdict: not_run`.
353
392
  - Reports level, risk flags, considered and filtered files, recommended
354
393
  reviewers, budgets, and workspace state.
355
394
  - `--retain` preserves artifacts; otherwise the workspace is cleaned.
@@ -359,6 +398,11 @@ Criteria:
359
398
  Contract: opt-in `review_coordinator`. It does not replace or make `/review`
360
399
  more expensive.
361
400
 
401
+ This flow is evidence preparation and partial analysis only. Preflight returns
402
+ `review_stage: preflight`; AI modes return `review_stage: partial`; every mode
403
+ returns `verdict: not_run`. Only the general `reviewer` may issue a final
404
+ verdict.
405
+
362
406
  Criteria:
363
407
 
364
408
  - Default and `--dry-run` behavior is preflight only.
@@ -2,7 +2,14 @@
2
2
 
3
3
  `/review-preflight` and `/review-orchestrated` provide a local, opt-in,
4
4
  versionable flow for deterministic diff preparation and optional AI review.
5
- They do not replace `/review` or change its inexpensive existing contract.
5
+ They do not replace `/review` or its final-review authority.
6
+
7
+ The canonical stage contract is explicit: deterministic preparation emits
8
+ `review_stage: preflight`; optional focused analysis emits
9
+ `review_stage: partial`; both emit `verdict: not_run`. Only the general
10
+ `reviewer` can consolidate the real diff and original evidence into a final
11
+ verdict. Specialist findings follow the same causality policy: only introduced
12
+ or worsened problems may block, while pre-existing debt is observational.
6
13
 
7
14
  The recommended daily path is `/review-preflight`: it creates inspectable
8
15
  artifacts and summarizes risk without running AI reviewers. Here,