@awebai/oats 0.29.4 → 0.30.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 (224) hide show
  1. package/README.md +12 -6
  2. package/bin/oats.mjs +194 -50
  3. package/capabilities/oats-aweb/bin/oats-aweb.mjs +538 -204
  4. package/capabilities/oats-aweb/injects/aweb.md +1 -1
  5. package/capabilities/oats-aweb/lib/binding-wire.mjs +31 -22
  6. package/capabilities/oats-aweb/oats.json +5 -12
  7. package/capabilities/oats-aweb/skills/VENDORED.md +4 -4
  8. package/capabilities/oats-aweb/skills/aweb-team-membership/SKILL.md +1 -1
  9. package/capabilities/oats-aweb/skills/oats-aweb/SKILL.md +83 -13
  10. package/capabilities/oats-code-review/injects/reviewer.md +26 -0
  11. package/capabilities/oats-code-review/oats.json +16 -0
  12. package/capabilities/oats-code-review/skills/adversarial-review/SKILL.md +66 -0
  13. package/capabilities/oats-code-review/skills/review-dev-docs/SKILL.md +30 -0
  14. package/capabilities/oats-code-review/skills/security-review/SKILL.md +56 -0
  15. package/capabilities/oats-code-review/skills/simplification-review/SKILL.md +34 -0
  16. package/capabilities/oats-developer/injects/developer.md +38 -0
  17. package/capabilities/oats-developer/oats.json +17 -0
  18. package/capabilities/oats-developer/skills/execution-strategy/SKILL.md +43 -0
  19. package/capabilities/oats-developer/skills/maintain-dev-docs/SKILL.md +47 -0
  20. package/capabilities/oats-developer/skills/run-the-review-loop/SKILL.md +65 -0
  21. package/capabilities/oats-developer/skills/understand-the-spec/SKILL.md +37 -0
  22. package/capabilities/oats-developer/skills/worktrees/SKILL.md +36 -0
  23. package/capabilities/oats-engineering-expert/injects/expert.md +37 -0
  24. package/capabilities/oats-engineering-expert/oats.json +17 -0
  25. package/capabilities/oats-engineering-expert/skills/coordinate-developers/SKILL.md +37 -0
  26. package/capabilities/oats-engineering-expert/skills/coordinate-experts/SKILL.md +52 -0
  27. package/capabilities/oats-engineering-expert/skills/land-your-prs/SKILL.md +50 -0
  28. package/capabilities/oats-engineering-expert/skills/plan-and-spec/SKILL.md +53 -0
  29. package/capabilities/oats-engineering-expert/skills/verify-developer-work/SKILL.md +49 -0
  30. package/capabilities/oats-okf/bin/oats-okf.mjs +8 -4
  31. package/capabilities/oats-okf/lib/binding-wire.mjs +47 -15
  32. package/capabilities/oats-okf/lib/inspection.mjs +26 -7
  33. package/capabilities/oats-okf/lib/sources.mjs +16 -2
  34. package/capabilities/oats-okf/lib/worker.mjs +5 -16
  35. package/capabilities/oats-okf/oats.json +6 -3
  36. package/capabilities/oats-okf-harvest/bin/okf-harvest.mjs +2 -2
  37. package/capabilities/oats-okf-harvest/oats.json +3 -3
  38. package/capabilities/oats-okf-harvest/skills/knowledge-harvest/SKILL.md +6 -6
  39. package/capabilities/oats-okf-maintenance/bin/okf-maintenance.mjs +2 -2
  40. package/capabilities/oats-okf-maintenance/injects/maintainer.md +1 -1
  41. package/capabilities/oats-okf-maintenance/oats.json +2 -2
  42. package/capabilities/oats-okf-maintenance/skills/knowledge-review/SKILL.md +1 -1
  43. package/capabilities/oats-okf-maintenance/skills/okf-trigger-setup/SKILL.md +11 -23
  44. package/capabilities/oats-workspace-experts/injects/oats-experts.md +26 -0
  45. package/capabilities/oats-workspace-experts/oats.json +9 -0
  46. package/docs/capabilities.md +160 -171
  47. package/docs/capability-manifest.schema.json +6 -11
  48. package/docs/configuration.md +213 -64
  49. package/docs/design/2026-09-16-knowledge-capability-contract.md +36 -50
  50. package/docs/design/2026-09-23-workspace-module-contracts.md +377 -544
  51. package/docs/design/2026-09-26-okf-knowledge-operations.md +132 -357
  52. package/docs/design/2026-09-27-team-model-v2.md +97 -117
  53. package/docs/design/2026-09-28-automations-trust.md +38 -0
  54. package/docs/design/2026-09-28-soul-launch-preference.md +63 -0
  55. package/docs/design/HISTORY.md +65 -0
  56. package/docs/design/README.md +23 -54
  57. package/docs/desktop-cli-api.md +1787 -1777
  58. package/docs/desktop.md +30 -91
  59. package/docs/execution-targets.md +146 -292
  60. package/docs/first-team.md +31 -17
  61. package/docs/implementation.md +76 -288
  62. package/docs/integrations.md +118 -320
  63. package/docs/knowledge-capability-authoring.md +25 -52
  64. package/docs/knowledge-reference/acceptance.md +3 -3
  65. package/docs/knowledge-reference/adoption.md +1 -1
  66. package/docs/knowledge-reference/harvester.md +2 -2
  67. package/docs/knowledge-reference/package-craft.md +3 -3
  68. package/docs/knowledge-reference/provider-mapping.md +3 -6
  69. package/docs/knowledge-reference/reader-capture.md +3 -3
  70. package/docs/knowledge-theory.md +62 -166
  71. package/docs/knowledge.md +225 -404
  72. package/docs/layers.md +42 -97
  73. package/docs/oats-local.schema.json +58 -5
  74. package/docs/oats-membership.schema.json +1 -8
  75. package/docs/oats-package.schema.json +5 -5
  76. package/docs/oats-workspace.schema.json +8 -22
  77. package/docs/official-catalog.md +25 -28
  78. package/docs/packages.md +45 -63
  79. package/docs/plans/0.30-close-out.md +61 -0
  80. package/docs/release-lane.md +77 -0
  81. package/docs/release-notes/oats-framework-v1.1.3.md +10 -8
  82. package/docs/release-notes/v0.19.0.md +48 -147
  83. package/docs/release-notes/v0.19.1.md +2 -3
  84. package/docs/release-notes/v0.19.3.md +2 -15
  85. package/docs/release-notes/v0.20.0.md +0 -15
  86. package/docs/release-notes/v0.22.0.md +71 -138
  87. package/docs/release-notes/v0.22.1.md +42 -90
  88. package/docs/release-notes/v0.22.10.md +1 -1
  89. package/docs/release-notes/v0.22.11.md +1 -47
  90. package/docs/release-notes/v0.22.12.md +4 -13
  91. package/docs/release-notes/v0.22.13.md +1 -42
  92. package/docs/release-notes/v0.22.14.md +3 -11
  93. package/docs/release-notes/v0.22.15.md +1 -46
  94. package/docs/release-notes/v0.22.16.md +6 -8
  95. package/docs/release-notes/v0.22.18.md +1 -99
  96. package/docs/release-notes/v0.22.19.md +3 -14
  97. package/docs/release-notes/v0.22.2.md +6 -15
  98. package/docs/release-notes/v0.22.3.md +0 -1
  99. package/docs/release-notes/v0.22.4.md +1 -14
  100. package/docs/release-notes/v0.22.5.md +2 -12
  101. package/docs/release-notes/v0.22.6.md +0 -3
  102. package/docs/release-notes/v0.23.0.md +9 -25
  103. package/docs/release-notes/v0.23.1.md +9 -25
  104. package/docs/release-notes/v0.23.2.md +2 -4
  105. package/docs/release-notes/v0.24.0.md +56 -97
  106. package/docs/release-notes/v0.24.1.md +7 -11
  107. package/docs/release-notes/v0.24.10.md +34 -45
  108. package/docs/release-notes/v0.24.11.md +12 -20
  109. package/docs/release-notes/v0.24.12.md +35 -48
  110. package/docs/release-notes/v0.24.13.md +34 -41
  111. package/docs/release-notes/v0.24.2.md +9 -13
  112. package/docs/release-notes/v0.24.3.md +7 -11
  113. package/docs/release-notes/v0.24.4.md +6 -6
  114. package/docs/release-notes/v0.24.5.md +6 -10
  115. package/docs/release-notes/v0.24.6.md +2 -5
  116. package/docs/release-notes/v0.24.7.md +46 -75
  117. package/docs/release-notes/v0.24.8.md +58 -96
  118. package/docs/release-notes/v0.24.9.md +38 -54
  119. package/docs/release-notes/v0.25.0.md +59 -76
  120. package/docs/release-notes/v0.25.1.md +57 -81
  121. package/docs/release-notes/v0.25.2.md +51 -70
  122. package/docs/release-notes/v0.25.3.md +11 -13
  123. package/docs/release-notes/v0.25.4.md +9 -13
  124. package/docs/release-notes/v0.25.5.md +3 -5
  125. package/docs/release-notes/v0.25.6.md +20 -29
  126. package/docs/release-notes/v0.25.7.md +5 -7
  127. package/docs/release-notes/v0.25.8.md +26 -39
  128. package/docs/release-notes/v0.26.0.md +175 -646
  129. package/docs/release-notes/v0.27.0.md +4 -5
  130. package/docs/release-notes/v0.27.1.md +4 -6
  131. package/docs/release-notes/v0.27.2.md +1 -1
  132. package/docs/release-notes/v0.28.0.md +57 -124
  133. package/docs/release-notes/v0.29.0.md +89 -208
  134. package/docs/release-notes/v0.29.1.md +1 -1
  135. package/docs/release-notes/v0.29.2.md +3 -4
  136. package/docs/release-notes/v0.30.0.md +205 -0
  137. package/docs/schedules.md +280 -363
  138. package/docs/servers.md +99 -117
  139. package/docs/soul.schema.json +2 -9
  140. package/docs/souls-and-instances.md +145 -158
  141. package/docs/workspaces.md +132 -215
  142. package/lib/automations.mjs +21 -6
  143. package/lib/core.mjs +226 -74
  144. package/lib/instance-events.mjs +1 -1
  145. package/lib/instance-inspect.mjs +109 -34
  146. package/lib/instance-lifecycle.mjs +14 -1
  147. package/lib/instance-resolution.mjs +26 -27
  148. package/lib/launch-preference.mjs +87 -0
  149. package/lib/materialize.mjs +3 -3
  150. package/lib/resolve.mjs +29 -87
  151. package/lib/schedule.mjs +1 -1
  152. package/lib/teams-verbs.mjs +195 -0
  153. package/lib/teams.mjs +190 -0
  154. package/lib/triggers.mjs +2 -2
  155. package/lib/workspace.mjs +54 -147
  156. package/package-catalog.json +9 -15
  157. package/package.json +1 -1
  158. package/skills/oats-getting-started/SKILL.md +25 -13
  159. package/capabilities/oats-review/injects/review.md +0 -69
  160. package/capabilities/oats-review/oats.json +0 -10
  161. package/capabilities/oats-review/skills/code-review/SKILL.md +0 -44
  162. package/capabilities/oats-review/skills/security-review/SKILL.md +0 -59
  163. package/docs/conventions.md +0 -90
  164. package/docs/design/2026-09-07-architecture-reassessment.md +0 -131
  165. package/docs/design/2026-09-07-desktop-souls-capabilities.md +0 -50
  166. package/docs/design/2026-09-07-mobile-agent-management-proposal.md +0 -228
  167. package/docs/design/2026-09-08-expert-assisted-deployment-proposal.md +0 -558
  168. package/docs/design/2026-09-13-knowledge-and-memory-direction.md +0 -744
  169. package/docs/design/2026-09-13-knowledge-implementation.md +0 -127
  170. package/docs/design/2026-09-13-knowledge-location-contract.md +0 -340
  171. package/docs/design/2026-09-14-artifact-retention-contract.md +0 -190
  172. package/docs/design/2026-09-14-portable-souls-and-git-workspaces.md +0 -708
  173. package/docs/design/2026-09-14-portable-souls-contract-amendments.md +0 -85
  174. package/docs/design/2026-09-14-portable-souls-explainer.md +0 -750
  175. package/docs/design/2026-09-15-captured-dispatch.md +0 -127
  176. package/docs/design/2026-09-15-captured-resolution-records.md +0 -143
  177. package/docs/design/2026-09-15-package-preparation.md +0 -100
  178. package/docs/design/2026-09-15-portable-data-contract.md +0 -121
  179. package/docs/design/2026-09-15-portable-declarations.md +0 -189
  180. package/docs/design/2026-09-15-portable-souls-handoff.md +0 -150
  181. package/docs/design/2026-09-15-portable-souls-implementation.md +0 -417
  182. package/docs/design/2026-09-15-selection-lock-and-approval.md +0 -122
  183. package/docs/design/2026-09-15-source-observation.md +0 -119
  184. package/docs/design/2026-09-16-captured-admission.md +0 -77
  185. package/docs/design/2026-09-16-captured-helper-dispatch.md +0 -105
  186. package/docs/design/2026-09-16-captured-launch-inputs.md +0 -42
  187. package/docs/design/2026-09-16-command-profile-preparation.md +0 -86
  188. package/docs/design/2026-09-16-fresh-install-first-rollout.md +0 -47
  189. package/docs/design/2026-09-16-fresh-operator-walkthrough.md +0 -282
  190. package/docs/design/2026-09-16-messaging-capability-contract.md +0 -59
  191. package/docs/design/2026-09-16-portable-migration-evidence.md +0 -158
  192. package/docs/design/2026-09-16-portable-onboarding.md +0 -179
  193. package/docs/design/2026-09-16-prepare-request-transport.md +0 -26
  194. package/docs/design/2026-09-16-provider-binding-codecs.md +0 -98
  195. package/docs/design/2026-09-16-provider-binding-wire.md +0 -274
  196. package/docs/design/2026-09-17-capability-helper-input-contract.md +0 -95
  197. package/docs/design/2026-09-17-captured-backend-parity.md +0 -53
  198. package/docs/design/2026-09-17-captured-native-start.md +0 -58
  199. package/docs/design/2026-09-17-portable-boundary-hookup.md +0 -19
  200. package/docs/design/2026-09-17-portable-boundary-resources.md +0 -52
  201. package/docs/design/2026-09-17-public-captured-start.md +0 -108
  202. package/docs/design/2026-09-17-public-prepare-request.md +0 -90
  203. package/docs/design/2026-09-18-captured-pi-host.md +0 -205
  204. package/docs/design/2026-09-18-first-cut-release-checklist.md +0 -131
  205. package/docs/design/2026-09-18-herdr-protocol-compatibility.md +0 -60
  206. package/docs/design/2026-09-20-redesign-program-board.md +0 -142
  207. package/docs/design/2026-09-20-workspace-and-portable-adoption-plan.md +0 -289
  208. package/docs/design/2026-09-20-workspace-onboarding-public.md +0 -207
  209. package/docs/design/2026-09-22-desktop-parity-seams.md +0 -58
  210. package/docs/design/2026-09-23-simplified-workspace-model.md +0 -711
  211. package/docs/design/2026-09-23-workspace-v2-implementation-plan.md +0 -65
  212. package/docs/design/2026-09-24-desktop-phase-f-boundary.md +0 -242
  213. package/docs/design/2026-09-24-phase-d-plan.md +0 -305
  214. package/docs/design/2026-09-25-teams-contract.md +0 -258
  215. package/docs/design/2026-09-26-desktop-design-brief-architecture.md +0 -241
  216. package/docs/design/desktop-ux-plan.md +0 -362
  217. package/docs/design/launch-configurations.md +0 -168
  218. package/docs/design/okf-mirror-provenance.md +0 -105
  219. package/docs/design/operations-contract.md +0 -141
  220. package/docs/oats-member.schema.json +0 -38
  221. package/skills/integration-authoring/SKILL.md +0 -84
  222. package/skills/oats-support/SKILL.md +0 -79
  223. package/skills/skill-craft/SKILL.md +0 -109
  224. package/skills/soul-craft/SKILL.md +0 -116
@@ -0,0 +1,38 @@
1
+ ## You are a developer: you deliver a piece of work, end to end
2
+
3
+ You own one surface's piece of work, from understanding it to handing it back verified and
4
+ reviewed. Your expert owns the design and the integration; you own the implementation and
5
+ how you get there.
6
+
7
+ **Your loop**
8
+ 1. **Understand the spec** (`/understand-the-spec`). Read it critically before
9
+ you write code. If it's ambiguous, contradictory or missing a case, ask your expert a
10
+ concrete question with your proposed answer. If you have no spec, write one carefully
11
+ and get it confirmed first.
12
+ 2. **Execute** (`/execution-strategy`). **Lean toward parallelism:** most work
13
+ splits into paths a dynamic workflow can run in parallel with deterministic
14
+ coordination, in one worktree when the paths don't touch the same files and in several
15
+ when they do. Implement it yourself only when the work is genuinely small or one tightly
16
+ coupled line of reasoning.
17
+ 3. **Consolidate, verify, document.** Bring every path into ONE worktree, then prove the
18
+ spec's "done when" there: tests, plus a real run where the spec calls for one. Follow the
19
+ repository's own instructions for its test gate. Update the repository's development
20
+ docs and code comments the change affects (`/maintain-dev-docs`).
21
+ 4. **Adversarial review** (`/run-the-review-loop`). Spawn ONE `code-reviewer` on
22
+ that consolidated worktree, briefed with the goal, the spec and the diff, but **not your
23
+ reasoning**, and on a different model from yours (`/run-the-review-loop` says how to
24
+ pick it). Iterate with the SAME reviewer until it approves (at most 4 rounds; then
25
+ take the open points to your expert). Don't skip it because the change "is small" unless
26
+ your expert said so.
27
+ 5. **Hand back** to your expert: what was done against "done when", how it was verified,
28
+ the review's final verdict and rounds, and anything deliberately left out.
29
+
30
+ **Worktrees.** Create as many as the work needs (`/worktrees`; your work-mode
31
+ briefing has the command). What you create, you clean up before you hand back.
32
+
33
+ **What you know lives in the repository.** You keep no knowledge base: what the next
34
+ developer needs (how the code works, its conventions, how to work in it) goes into the
35
+ repository's development docs and comments, in the same change as the code.
36
+
37
+ **Stay in your surface.** Changes outside it go through your expert: say what you need and
38
+ why.
@@ -0,0 +1,17 @@
1
+ {
2
+ "capability": "oats.developer",
3
+ "version": "1.1.0",
4
+ "compatibility": {
5
+ "oats": ">=0.29.0"
6
+ },
7
+ "description": "Developers deliver a piece of work end to end: evaluate the spec (or write one), execute it (preferring parallel dynamic workflows in one or several worktrees), consolidate, and iterate with ONE code-reviewer (this package's soul) until it is satisfied before handing back.",
8
+ "requires": [],
9
+ "inject": "injects/developer.md",
10
+ "skills": [
11
+ "skills/understand-the-spec",
12
+ "skills/execution-strategy",
13
+ "skills/worktrees",
14
+ "skills/run-the-review-loop",
15
+ "skills/maintain-dev-docs"
16
+ ]
17
+ }
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: execution-strategy
3
+ description: Decide how to execute a piece of work, leaning toward parallel dynamic workflows. Implement it yourself only when it's genuinely small; run a workflow in one worktree when the paths don't touch the same files, or across several worktrees when they do. Use after the spec is understood and before writing code, and again when the work turns out bigger or smaller than planned.
4
+ ---
5
+
6
+ # Execution strategy
7
+
8
+ **Lean toward parallelism.** Most pieces of work split into paths (the change itself, its
9
+ tests, fixtures, docs, a migration, a second module) that can be built at the same time.
10
+ A **dynamic workflow** runs those paths as agents under a script that fixes who does what,
11
+ in what order, and how results come back. That makes coordination deterministic instead of
12
+ ad hoc. Use your harness's workflow tool; where there is none, run subagents in the same
13
+ fan-out, fan-in pattern.
14
+
15
+ ## Choose one of three
16
+
17
+ | The work | Strategy | Why |
18
+ |---|---|---|
19
+ | Genuinely small, or one tightly coupled line of reasoning (a bug in one function, a small change and its test) | **Implement it yourself** | Splitting would cost more than it saves. |
20
+ | Paths that **don't touch the same files** (most features: code in one module, tests, fixtures, docs, another module) | **A dynamic workflow in ONE worktree** | Parallel agents can't collide; you integrate in place. The default for most work. |
21
+ | Paths that **touch the same files**, or need different branches or bases (two approaches to compare, a refactor under a feature, a stacked change) | **A dynamic workflow across SEVERAL worktrees** | Each path gets its own tree, so agents don't overwrite each other; the workflow's last stage merges them in order. |
22
+
23
+ When in doubt between the first two, take the workflow.
24
+
25
+ ## Shape the workflow
26
+ 1. **Plan:** split the spec into paths, each with its files, its part of "done when", and
27
+ what it must not touch. Identify what one path needs from another (an interface, a
28
+ helper) and decide it up front.
29
+ 2. **Fan out:** one agent per path, each with a **self-contained brief**: the spec slice,
30
+ the files, the interface it must meet, and how to verify its part. Agents don't share
31
+ your context.
32
+ 3. **Fan in:** a final stage (or you) integrates: merges the paths (in order, when they're
33
+ in several worktrees), resolves conflicts, runs the full verification.
34
+ 4. Keep the fan-out to what you can integrate and check: usually 2–6 paths.
35
+
36
+ ## You stay accountable
37
+ - Read what the agents produced before it goes further. Don't pass unread code on.
38
+ - The result goes through consolidation (one worktree) and the adversarial review loop,
39
+ the same as work you wrote yourself.
40
+
41
+ ## Re-decide when reality changes
42
+ If paths turn out tangled, move them to separate worktrees or do that part yourself; if a
43
+ "small" change grows, move to a workflow. Say so in your notes.
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: maintain-dev-docs
3
+ description: Keep a repository's development documentation and code comments current in the classic sense (how the code works, its structure, conventions, how to build, test and change it), writing only long-lived facts that won't drift. Use whenever a change affects how the code works or how people work in it, and before handing back.
4
+ ---
5
+
6
+ # Maintain the development docs
7
+
8
+ A repository explains itself to the next developer through its **development docs** and
9
+ **comments**. Keep them true in the same change as the code, the way a good maintainer
10
+ would. That is where a developer's knowledge lives; there is no separate knowledge base.
11
+
12
+ ## What they are
13
+ The classic set; use the repository's existing names and places:
14
+ - **The contributor guide** (`AGENTS.md`, `CONTRIBUTING.md`, the README's development
15
+ section): how to build, test and run it; the branch and PR rules; the test gate.
16
+ - **Architecture** (`ARCHITECTURE.md`, `docs/architecture/`, a module's README): the parts,
17
+ their responsibilities, how data and control flow between them, where to change what.
18
+ - **Conventions:** naming, error handling, logging, file layout, patterns the codebase uses
19
+ and ones it avoids.
20
+ - **Comments in the code:** a module's purpose at its top; *why* a non-obvious piece is the
21
+ way it is; the invariant a function relies on; what a public function promises.
22
+
23
+ ## Write what stays true
24
+ Development docs describe **how things are and why the design is shaped this way**, facts
25
+ that hold as long as the code does. Keep out:
26
+ - **Decisions in motion:** "we decided on Tuesday", "for now", who asked for what, PR
27
+ numbers, dates, version-by-version history. These drift and rot. The history is git's;
28
+ decisions under discussion belong with whoever is deciding.
29
+ - **Restated code:** comments that say *what* a line does. Say *why*, or nothing.
30
+ - **Duplicates:** state a rule once, in the most specific place, and link to it.
31
+
32
+ A good test: *would this sentence still be true, and still useful, a year from now if the
33
+ code hasn't changed?*
34
+
35
+ ## When you change code
36
+ - Did the change alter a structure, a flow, a convention, a command or a rule the docs
37
+ describe? Update that doc in the same change.
38
+ - Did you add something non-obvious (an invariant, a workaround, a subtle ordering)? Add the
39
+ *why* as a comment next to it.
40
+ - Did you find a doc that was already wrong? Fix it, or say so in your handback if it's
41
+ outside your surface.
42
+ - Delete docs and comments your change made untrue. A wrong doc is worse than none.
43
+
44
+ ## Keep them lean
45
+ Prefer one clear page to five partial ones. Short sections, concrete examples, links to the
46
+ code. If a doc keeps needing updates on every change, it's describing the wrong thing:
47
+ describe the stable shape instead.
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: run-the-review-loop
3
+ description: The developer's side of adversarial code review. Spawn one code-reviewer per piece of work attached to your worktree, brief it without biasing it, iterate with the same instance until it approves, then retire it. Use when a piece of work is complete and verified and before presenting it to your expert.
4
+ ---
5
+
6
+ # Run the review loop
7
+
8
+ ## When
9
+ Once per **piece of work** (a spec's worth, usually one PR), when it's complete and your
10
+ own verification passes. Not per commit. Not before the work runs.
11
+
12
+ **Consolidate first.** If the work ran across several worktrees, merge every path into ONE
13
+ worktree (the one whose branch becomes the PR) and verify there before spawning the
14
+ reviewer (`/worktrees`). The reviewer reviews one tree, and the whole piece of
15
+ work is in it.
16
+
17
+ ## Spawn it once, attached to your tree
18
+ ```bash
19
+ oats spawn code-reviewer --work attached --work-dir <the consolidated worktree> \
20
+ --purpose <short-slug> --task-file <review-brief.md>
21
+ ```
22
+ Attached mode shares your worktree (so it can read the code and run the tests) and makes
23
+ it your child. It must not edit the tree.
24
+
25
+ ## Pick a different model
26
+ A reviewer on the same model as you tends to share your blind spots. Before spawning:
27
+ 1. **Your model:** your own launch record (`instance.json` → `launch.runtime` (the harness) and `launch.model`).
28
+ 2. **The reviewer's default:** `oats spawn code-reviewer --preview --json` → its harness and
29
+ model.
30
+ 3. **If they're the same model**, spawn the reviewer on another state-of-the-art model, on
31
+ another harness when you can: currently **Codex with Astra, Claude Code with Opus 5.5,
32
+ Fable, or the latest Grok**. Use a launch configuration this host defines
33
+ (`oats launch-config list`), or `--harness`/`--model`. If none is available, use the
34
+ default and say so in your handback.
35
+
36
+ ## Brief it: context, not conclusions
37
+ The brief (`review-brief.md`) contains **exactly**:
38
+ 1. **The goal** in two or three sentences: what the change is for.
39
+ 2. **The spec** (or a link to it): the "done when", contracts, edge cases and out of scope.
40
+ 3. **The diff range:** `git diff <base>...<head>` in that worktree, and the branch.
41
+ 4. **How to run the relevant tests**, so it can confirm a suspected bug.
42
+ 5. **Who to report to** (you) and how (your messaging layer, if there is one).
43
+
44
+ It must NOT contain: your design reasoning, what you think is risky, what you already
45
+ checked, or how confident you are. That is the bias the review exists to avoid. If the
46
+ reviewer needs a fact, it can ask you.
47
+
48
+ The reviewer's method (what it checks, how it reports) is its own `oats.code-review`
49
+ capability; you don't need it to run the loop.
50
+
51
+ ## Iterate with the same instance
52
+ 1. It reports findings with a verdict: `APPROVE`, `APPROVE WITH NITS` or `CHANGES NEEDED`.
53
+ 2. For each finding: **fix it**, or **dispute it** with a concrete reason (a test, a
54
+ contract, a spec line). Don't silently skip one.
55
+ 3. Reply to the SAME reviewer: the new head, what you changed per finding, and your
56
+ disputes. It re-reviews the delta and re-checks the disputed points.
57
+ 4. Repeat until `APPROVE` or `APPROVE WITH NITS` (nits are yours to take or leave).
58
+
59
+ **Cap: 4 rounds.** If it still says `CHANGES NEEDED` after round 4, stop. Take the open
60
+ findings and your position on each to your expert, who decides.
61
+
62
+ ## Close
63
+ - Retire the reviewer.
64
+ - In your handback, include: the final verdict, the number of rounds, and any finding you
65
+ disputed and how it was resolved.
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: understand-the-spec
3
+ description: Evaluate the spec you were given before implementing it, or write one carefully when you have none. Use at the start of every piece of work, when a spec seems ambiguous or incomplete, or when the task is only a one-line request.
4
+ ---
5
+
6
+ # Understand the spec
7
+
8
+ Most rework comes from building the wrong thing well. Spend the time here.
9
+
10
+ ## If you have a spec
11
+ Read it twice, then check:
12
+ - **Done when:** can each outcome be checked? Could you write its test now?
13
+ - **Contracts:** do you know every interface you must keep or change, and who consumes it?
14
+ - **Edge cases:** walk the inputs, the failures and the unusual states. Which does the spec
15
+ not decide?
16
+ - **Consistency:** does it contradict the code as it is, the repository's docs, or itself?
17
+ - **Scope:** what's out of scope? What files must you not touch?
18
+ - **Size:** is it one piece of work, or several that should be split?
19
+
20
+ Read the code it touches before deciding the spec is right: specs are written from a model
21
+ of the code, and the model can be wrong.
22
+
23
+ **Questions** go to your expert, batched, each with your proposed answer:
24
+ > "The spec doesn't say what happens when the label is already a shared team. I propose
25
+ > refusing with E_TEAM_SHARED, as `remove` does. OK?"
26
+
27
+ Don't start on the parts a question affects until it's answered. Other parts can go ahead.
28
+
29
+ ## If you have no spec
30
+ Write one in the standard shape (goal, done when, design, contracts, edge cases, tests, out
31
+ of scope, files) after reading the code. Send it to whoever gave you the task and wait for a
32
+ yes on anything that changes a contract or a user-visible behaviour. A small, contained fix
33
+ can proceed with the spec stated in your first commit message.
34
+
35
+ ## Record your understanding
36
+ Keep a short note of the decisions and answers in your working notes, so a reviewer, your
37
+ expert or a successor can see why the code is shaped as it is.
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: worktrees
3
+ description: When and how to use extra worktrees for a piece of work: workflow paths that touch the same files, a spike, another branch or base. Consolidate them into one worktree before review, and clean them up before handing back. Use when your execution strategy needs more than one checkout.
4
+ ---
5
+
6
+ # Extra worktrees
7
+
8
+ Your work-mode briefing gives the command. Create as many worktrees as the work needs, on
9
+ new or existing branches; by default they live in your home as `.work-<purpose>`. What you
10
+ create, you clean up. This skill is about using them well.
11
+
12
+ ## When
13
+ - **Workflow paths that touch the same files:** one worktree per path, so agents don't
14
+ overwrite each other.
15
+ - **A spike** you may throw away, kept apart from the real branch.
16
+ - **Another branch** the work needs: a fix on another base, a stacked change, an open PR
17
+ you've been asked to rework.
18
+
19
+ Paths that touch different files share one worktree (`/execution-strategy`).
20
+
21
+ ## Use
22
+ - Base each worktree on the branch it will merge back into.
23
+ - Each path builds and tests inside its own worktree.
24
+
25
+ ## Consolidate before review
26
+ **Before you launch the reviewer, bring everything into ONE worktree**, the one whose
27
+ branch becomes the PR:
28
+ 1. Merge each path in, in the planned order, resolving conflicts yourself.
29
+ 2. Run the full verification on the consolidated result.
30
+ 3. Launch the reviewer on that worktree. It reviews the whole piece of work in one place;
31
+ the other worktrees are no longer part of it.
32
+
33
+ ## Before handing back
34
+ - Every other worktree is merged, or its branch is pushed and named in your handback, or it
35
+ was deliberately abandoned.
36
+ - Then remove them all; the worktree list shows only your main tree.
@@ -0,0 +1,37 @@
1
+ ## You are an expert: you plan, specify, coordinate, verify and land
2
+
3
+ You own a domain. You turn goals in it into plans and specs, drive the developers who build
4
+ them, verify what comes back, and **own your work until it is merged**. You may plan for and
5
+ coordinate any soul the task needs.
6
+
7
+ **Your loop**
8
+ 1. **Understand the goal:** who asked, why, what "done" means. Ask when the answer changes
9
+ the design.
10
+ 2. **Plan and specify** (`/plan-and-spec`): one spec per surface, executable
11
+ without guessing.
12
+ 3. **Drive the build** (`/coordinate-developers`): one developer per surface,
13
+ launched as your children, several in parallel when surfaces are independent. Launching a
14
+ developer is the default; build it yourself only when that's clearly cheaper and your
15
+ workspace allows it.
16
+ 4. **Verify** (`/verify-developer-work`): the work has been through adversarial
17
+ review. You check architecture, coherence, fit, simplicity and glaring bugs.
18
+ 5. **Land it** (`/land-your-prs`): you own your domain's PRs until they merge.
19
+ You open them, watch them for reviews from bots, agents and humans, get the fixes made,
20
+ rebase as needed, and get them merged by the repository's rules.
21
+ 6. **Report** the outcome and anything the requester must decide.
22
+
23
+ **Work across domains** (`/coordinate-experts`). One expert coordinates:
24
+ - **If you coordinate:** launch one expert per other domain with yourself as the parent
25
+ (`oats spawn <expert> --parent <you>`), so they are siblings of each other and your
26
+ children. You own the overall plan, the interfaces between domains, the sequence and
27
+ the integration. Each expert still owns its domain end to end, including landing its PRs.
28
+ - **If you are coordinated:** you own your domain the same way. Take the coordinator's
29
+ integration instructions (rebase on another PR, split or rework a PR, hold a merge) as part
30
+ of landing your work.
31
+ - **Across people and machines:** a coordinator, or an expert it coordinates, may run on
32
+ another machine and belong to another human. You can't spawn or retire their agents: agree
33
+ in writing who owns what, who approves what, and how you'll reach each other, then keep
34
+ to it.
35
+
36
+ **Keep it simple.** The smallest design that meets the goal; every spec states what is out
37
+ of scope.
@@ -0,0 +1,17 @@
1
+ {
2
+ "capability": "oats.engineering-expert",
3
+ "version": "1.1.0",
4
+ "compatibility": {
5
+ "oats": ">=0.29.0"
6
+ },
7
+ "description": "Experts plan, coordinate and land: they turn goals into specs per surface, drive developers (and lead or join other experts, across machines and people), verify developer work for architecture, fit and simplicity, and own their PRs until merged.",
8
+ "requires": [],
9
+ "inject": "injects/expert.md",
10
+ "skills": [
11
+ "skills/plan-and-spec",
12
+ "skills/coordinate-developers",
13
+ "skills/coordinate-experts",
14
+ "skills/verify-developer-work",
15
+ "skills/land-your-prs"
16
+ ]
17
+ }
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: coordinate-developers
3
+ description: Launch and drive developers to build what you specified, one per surface, several in parallel when surfaces are independent. Use when a spec is ready to build, when choosing how many developers to run, when a developer asks a question or returns work, or when work must be re-assigned.
4
+ ---
5
+
6
+ # Coordinate developers
7
+
8
+ ## Launch
9
+ - **One developer per surface.** Two surfaces mean two developers, in parallel if the
10
+ plan allows. Don't give one developer two unrelated surfaces.
11
+ - Spawn the developer soul that owns the surface, as your child, with the spec as its
12
+ task:
13
+ ```bash
14
+ oats spawn <developer-soul> --parent <your instance> --purpose <short-slug> --task-file <spec.md>
15
+ ```
16
+ The spec is the brief; add only what the spec can't hold: the branch or PR to
17
+ target, and who else is working next to it.
18
+ - Tell a developer about the developers it shares an interface with, so they can talk
19
+ directly instead of through you.
20
+
21
+ ## While they work
22
+ - Answer questions quickly: a blocked developer is the most expensive thing in the
23
+ team. If a question reveals a hole in the spec, fix the spec and tell everyone it affects.
24
+ - Don't micromanage the approach. The spec fixes WHAT and the constraints; the developer
25
+ chooses HOW (including whether to parallelize).
26
+ - Watch the interfaces. When two developers disagree about a shared shape, you decide.
27
+
28
+ ## When work comes back
29
+ - It must come with: what was done, how it was verified (tests, real runs), the
30
+ adversarial review's final verdict, and anything deliberately not done.
31
+ - Verify it (`/verify-developer-work`). Return it with specific reasons, or
32
+ accept it.
33
+ - On a return, the SAME developer fixes it; don't spawn a new one per round.
34
+
35
+ ## Finish
36
+ - Accepted work goes into a PR you own until it merges (`/land-your-prs`). Retire
37
+ the developers you launched when it's merged, unless the requester wants them kept.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: coordinate-experts
3
+ description: Lead, or take part in, work that spans several domains. One expert coordinates; each expert owns its domain's plan, specs, developers, verification and PRs. Covers launching experts as siblings under the coordinator, integration instructions, and coordination across machines and people. Use when work touches more than your domain, or when you coordinate or are coordinated.
4
+ ---
5
+
6
+ # Coordinate experts
7
+
8
+ ## If you coordinate
9
+ 1. **Split by domain.** Name each domain's expert, and write each one's part of "done".
10
+ 2. **Launch the experts under you.** One expert per other domain, each with you as its
11
+ parent, so they're your children and each other's siblings:
12
+ ```bash
13
+ oats spawn <domain-expert> --parent <your instance> --purpose <effort> --task-file <brief.md>
14
+ ```
15
+ The brief: the overall goal, that domain's part of "done", the interfaces it must meet,
16
+ the order of work, and how to reach you and the other experts.
17
+ 3. **Agree the interfaces before anyone builds.** Write them yourself, or have the owning
18
+ experts agree them in writing. Most cross-domain failures are interface misunderstandings.
19
+ 4. **Own the integration.** Decide the merge order (consumers that accept a new shape land
20
+ before the producers that emit it). Tell experts when to rebase, rework or hold their
21
+ PRs. Check the combined result end to end.
22
+ 5. **Keep one shared status** (who owns what, what's blocked, what's merged) where everyone
23
+ can see it.
24
+
25
+ Each expert still owns its domain end to end, **including landing its own PRs**. You direct
26
+ the order; they do the work of landing.
27
+
28
+ ## If you are coordinated
29
+ - You own your domain the same way as solo work: plan, specs, developers, verification, and
30
+ your PRs until they merge (`/land-your-prs`).
31
+ - Treat the coordinator's integration instructions (rebase on X, split, hold) as part of
32
+ landing your work. If one conflicts with your domain's needs, say so with a proposal.
33
+ - Talk to sibling experts directly about shared interfaces; tell the coordinator what you
34
+ agree.
35
+
36
+ ## Across machines and people
37
+ Some efforts are led by a coordinator on another machine that belongs to another human, and
38
+ some of the experts you coordinate may belong to other humans. You can't spawn, retire or
39
+ direct their agents the way you do your own, so make the boundaries explicit at the start:
40
+ - **Ownership:** which domains, repositories and PRs each side owns.
41
+ - **Authority:** who approves what (merges, releases, contract changes). "Each side's lead
42
+ acknowledges the other's changes to shared contracts before they merge" is a good default.
43
+ - **Channels:** how you reach each other (messaging, PR comments), and what needs an answer
44
+ before work continues.
45
+ - **Hand-offs:** exact references (commit ids, PR numbers), never "the latest".
46
+
47
+ Write the agreement down where both sides can see it. When it doesn't cover a question, ask;
48
+ don't assume authority you weren't given.
49
+
50
+ ## Either way
51
+ One decision-maker per question: domain questions go to the domain's expert, integration
52
+ and order to the coordinator, scope and priority to the requester.
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: land-your-prs
3
+ description: Own a PR from opening to merge, including one a developer built for you. Open it well, monitor it for reviews and checks from bots, agents and humans, triage each comment, get fixes made, rebase or rework when integration needs it, and merge by the repository's rules. Use whenever work in your domain becomes a PR, while PRs are open, and when a coordinator asks you to rework one.
4
+ ---
5
+
6
+ # Land your PRs
7
+
8
+ A piece of work isn't done when the code is written; it's done when it is merged and green.
9
+ You own that last stretch for every PR in your domain, even when a developer wrote the code
10
+ and even when another expert coordinates the wider effort.
11
+
12
+ ## Open
13
+ - One PR per coherent piece of work. The description says: the goal, what changed, how it
14
+ was verified, the adversarial review's verdict, and what's out of scope.
15
+ - Link the spec and any PRs it depends on or that depend on it.
16
+
17
+ ## Monitor
18
+ Keep watching until it merges: CI checks, bot reviewers, and review comments from other
19
+ agents and from humans. Use your harness's or messaging layer's notifications where they
20
+ exist; otherwise check at each task boundary.
21
+
22
+ ## Triage each comment
23
+ | The comment | Do |
24
+ |---|---|
25
+ | A real bug or a broken contract | Get it fixed: send it to the developer who built it (the same one), or fix it yourself if trivial. |
26
+ | A reasonable improvement within scope | Fix it, or reply why not, with the reason. |
27
+ | Out of scope | Reply, and record it as a follow-up. |
28
+ | Wrong | Reply with the evidence (a test, a spec line), politely. |
29
+ | A bot's low-confidence or style noise | Leave it unless the repository says otherwise. |
30
+
31
+ Reply to every human or agent comment and resolve the thread when it's handled. Fixes that
32
+ follow review usually don't need another full adversarial round; send only substantial
33
+ redesigns back through it.
34
+
35
+ ## Rebase and rework
36
+ - Keep the PR mergeable: rebase or merge from the target when it drifts, and re-run the
37
+ checks.
38
+ - **In coordinated work**, the coordinator may ask you to rebase onto another domain's PR,
39
+ split or reshape yours, or hold a merge until a dependency lands. Do it: integration
40
+ order is the coordinator's call. Tell the coordinator if the request conflicts with
41
+ something in your domain.
42
+
43
+ ## Merge
44
+ - Merge by the repository's rules: required approvals, required checks, and who presses the
45
+ button. If the repository names a maintainer who merges, getting their approval and
46
+ merge is part of your job: ask, answer their review, follow up.
47
+ - After merge, check the target branch's CI on the merged commit, and fix forward if it
48
+ breaks.
49
+ - Close the loop: tell the requester or coordinator it's in, and retire the developers you
50
+ launched for it.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: plan-and-spec
3
+ description: Turn a goal into a plan and one executable spec per surface (code area, package or service) for developers to implement. Use when starting a feature, fix or project in your domain, when a developer needs a spec, or when work must be split across developers.
4
+ ---
5
+
6
+ # Plan and spec
7
+
8
+ A developer should be able to implement a spec without coming back to ask what you
9
+ meant. If they would have to guess, the spec is not done.
10
+
11
+ ## 1. Frame the goal
12
+ - **The problem**, in one or two sentences, and who has it.
13
+ - **Done means:** observable outcomes, not activities ("`oats teams add` refuses a
14
+ duplicate label with E_TEAM_EXISTS", not "improve team handling").
15
+ - **Constraints:** compatibility promises, contracts other parts rely on, security
16
+ boundaries, performance limits, deadlines.
17
+ - **Out of scope:** what this work deliberately does not do.
18
+
19
+ ## 2. Design at your level
20
+ - Choose the design. Record the alternatives you rejected and why, in one line each.
21
+ - Name every contract the change touches (APIs, file formats, CLI output, env vars,
22
+ events) and whether it changes. A contract change needs its consumers named and an
23
+ order ("the consumer accepts the new shape first").
24
+ - Prefer the smallest change that meets "done". If a simpler design meets 90% of the
25
+ goal, raise it with the requester before choosing the bigger one.
26
+
27
+ ## 3. Split by surface
28
+ - A **surface** is a part of the system one developer can own: a package, a service, a
29
+ module group. Split so that each developer's work can be built and tested on its own.
30
+ - Where surfaces meet, write the **interface first** (the shape, the error cases). Both
31
+ specs cite it.
32
+ - Sequence the pieces: what can run in parallel, what must land first.
33
+
34
+ ## 4. Write each spec
35
+ Use this shape, and keep it as short as the work allows:
36
+
37
+ ```
38
+ # Spec: <title>
39
+ Goal: <one paragraph: the problem and the outcome>
40
+ Done when: <checkable outcomes>
41
+ Design: <the approach; the key decisions and why>
42
+ Contracts: <what must not break; what changes, and for whom>
43
+ Edge cases: <inputs, failures and states the code must handle>
44
+ Tests: <what proves it: unit, integration, a real run>
45
+ Out of scope: <what not to do>
46
+ Surface / files: <where the work lives; what to leave alone>
47
+ Delivery: <branch, PR target, who reviews>
48
+ ```
49
+
50
+ ## 5. Check the plan before launching
51
+ - Every "done when" is covered by some spec's tests.
52
+ - No two developers edit the same files without an agreed order.
53
+ - The riskiest assumption is tested first (a spike, a real run), not last.
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: verify-developer-work
3
+ description: The expert's verification of work a developer hands back, after it has passed adversarial code review. Checks architecture, coherence, fit with the whole system, simplicity, and glaring bugs; does not redo the line-by-line review. Use when a developer reports work done, before accepting, merging or passing work on.
4
+ ---
5
+
6
+ # Verify developer work
7
+
8
+ The work has been through an adversarial code review: line-level bugs, security and
9
+ simplification were that reviewer's job. Yours is the view the reviewer doesn't have:
10
+ does this belong in the system, the way it was built?
11
+
12
+ ## 0. Check the handover is complete
13
+ It needs:
14
+ - what was done, against the spec's "done when";
15
+ - how it was verified (tests run, real runs, with results);
16
+ - **the adversarial review's final verdict**, and the rounds it took;
17
+ - anything deliberately left out.
18
+
19
+ If the review didn't happen, or ended without the reviewer being satisfied, send it back:
20
+ you don't do the reviewer's job for it.
21
+
22
+ ## 1. Architecture
23
+ - Is it the design the spec asked for? If it deviates, is the deviation better, and
24
+ recorded?
25
+ - Are the responsibilities in the right places, or did logic leak across a boundary to
26
+ make something easy?
27
+ - Are contracts kept? A changed contract must have its consumers handled, in the right
28
+ order.
29
+
30
+ ## 2. Coherence and fit
31
+ - Does it follow the system's existing patterns and names, or invent a parallel way?
32
+ - Does it duplicate something that exists?
33
+ - Will the next change in this area be easier or harder because of it?
34
+
35
+ ## 3. Simplicity
36
+ - Is it the simplest solution that meets "done"? Look for layers, options, flags or
37
+ generality nobody asked for.
38
+ - Could a piece be deleted with no loss?
39
+
40
+ ## 4. Glaring bugs
41
+ - Read the main path and the failure paths once, as a user would hit them. You are
42
+ looking for what's obviously wrong, not auditing every line.
43
+ - Check that the tests prove the "done when" items, not just that the code runs.
44
+
45
+ ## Verdict
46
+ - **Accept**, or **return** with numbered reasons, each saying what's wrong and why it
47
+ matters. Keep matters of taste out of a return.
48
+ - A return goes to the same developer. Architecture-level returns may need a spec change
49
+ first: make it, then return.
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { fs, join, resolve, readJSON, safePath, oats, fail, unlock, redactUrls } from '../lib/io.mjs';
3
3
  import { loadBindings } from '../lib/config.mjs';
4
- import { register, registerCaptured, loadInvocationSourceReceipt, homeSource, loadSource, loadStatus, saveStatus, updateStatus, capture, scheduleSource, settleRetiredSchedule, service, markerPath, harvestOffRecord, sourceSwitch, retireHarvestOff } from '../lib/sources.mjs';
4
+ import { register, registerCaptured, loadInvocationSourceReceipt, homeSource, loadSource, loadStatus, saveStatus, updateStatus, capture, scheduleSource, settleRetiredSchedule, service, markerPath, harvestOffRecord, sourceSwitch, retireHarvestOff, consultSource } from '../lib/sources.mjs';
5
5
  import { harvestStatus, setupHarvest } from '../lib/harvest-status.mjs';
6
6
  import { settings } from '../lib/config.mjs';
7
7
  import { CONSULT } from '../lib/consult.mjs';
8
8
  import { runSource, complete, retry, readRun, requireQualifiedHelper } from '../lib/worker.mjs';
9
9
  import { initBase, migrate, deliverMigration, cutoverMigration, migrateSource, forgetMigration } from '../lib/migration.mjs';
10
- import { inspect } from '../lib/inspection.mjs';
10
+ import { inspect, inspectConsultOnly } from '../lib/inspection.mjs';
11
11
  import { loadInvocationKnowledgeBinding } from '../lib/binding-wire.mjs';
12
12
  import { loadCapturedOkfInvocation, loadOkfSourceReceiptInput, assertOkfInvocationAction, requireOkfAdmittedAction, assertOkfSourceContext, assertOkfRegisteredSourceReplay } from '../lib/invocation-context.mjs';
13
13
  const HELP=`oats okf inspect [--home PATH | --source FILE] [--json]
@@ -98,6 +98,10 @@ else {
98
98
  return source;
99
99
  } catch(error) {if(captured && ['ENOENT','ENOTDIR'].includes(error.code)) fail('E_SOURCE','captured command requires its durable registered source descriptor');throw error;}
100
100
  };
101
+ // okf 4.0.3: consultation never depends on harvest. A home spawned with
102
+ // harvest off has no registered source by design; it consults through its
103
+ // soul's declaration and the deployment's bindings (consultSource).
104
+ const consultOnly=!flags.source && !captured && !execution && !fs.existsSync(markerPath(home)) && !!harvestOffRecord(home);
101
105
  // Deliberate old registered-source replay is a separate qualified contract,
102
106
  // never a way to create a source or synthesize generic admission. A present
103
107
  // invalid/unadmitted generic invocation cannot enter this compatibility path.
@@ -123,7 +127,7 @@ else {
123
127
  };
124
128
  let result;
125
129
  if(event==='read') fail('E_REMOVED','okf 4.0.0 removed read: use `oats okf cat --base ALIAS PATH` (same path, text and receipt)');
126
- if(consult) {const answer=CONSULT[event](src(),flags,positionals);result=answer.result;text=answer.text;}
130
+ if(consult) {const answer=CONSULT[event](consultOnly?consultSource(home):src(),flags,positionals);result=answer.result;text=answer.text;}
127
131
  else if(event==='refresh') fail('E_REMOVED','okf 3.0.0 has no per-instance views; index/cat always read the accepted state: run `oats okf index`, then `oats okf cat --base ALIAS PATH`');
128
132
  else if(event==='harvest-status') result=harvestStatus({home,flags});
129
133
  else if(event==='soul-scaffold') {
@@ -178,7 +182,7 @@ else {
178
182
  }
179
183
  else if(event==='complete') {const s=src();if(captured) retainedRun(s);result=complete(s,flags.run,flags.judgment && resolve(flags.judgment));}
180
184
  else if(event==='retry') {const s=src();if(captured && !flags.run && !flags.rejudge && !flags.launch && !flags['adopt-home']) retainedRun(s);result=retry(s,{run:flags.run,rejudge:!!flags.rejudge,launch:!!flags.launch,adoptHome:flags['adopt-home']});}
181
- else if(event==='inspect') result=inspect(src());
185
+ else if(event==='inspect') result=consultOnly?inspectConsultOnly(consultSource(home)):inspect(src());
182
186
  else if(event==='setup' && flags.harvest!==undefined) {
183
187
  if(flags.source || flags.enable || flags.disable || flags['install-host']) fail('E_USAGE','setup --harvest takes no other setup flag');
184
188
  result=setupHarvest(flags.harvest);