@awebai/oats 0.22.19 → 0.23.1

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 (69) hide show
  1. package/README.md +54 -20
  2. package/bin/oats.mjs +24 -10
  3. package/capabilities/oats-okf/agents/memory-harvest/AGENTS.md +18 -24
  4. package/capabilities/oats-okf/agents/memory-harvest/soul.yaml +2 -2
  5. package/capabilities/oats-okf/bin/oats-okf.mjs +105 -517
  6. package/capabilities/oats-okf/injects/okf.md +32 -67
  7. package/capabilities/oats-okf/lib/config.mjs +112 -0
  8. package/capabilities/oats-okf/lib/inspection.mjs +96 -0
  9. package/capabilities/oats-okf/lib/io.mjs +103 -0
  10. package/capabilities/oats-okf/lib/migration.mjs +116 -0
  11. package/capabilities/oats-okf/lib/sources.mjs +238 -0
  12. package/capabilities/oats-okf/lib/stores.mjs +331 -0
  13. package/capabilities/oats-okf/lib/worker.mjs +352 -0
  14. package/capabilities/oats-okf/oats.json +23 -7
  15. package/capabilities/oats-okf/schemas/okf-base.schema.json +46 -0
  16. package/capabilities/oats-okf/schemas/okf-bindings.schema.json +112 -0
  17. package/capabilities/oats-okf/schemas/okf-soul.schema.json +37 -0
  18. package/capabilities/oats-okf/skills/memory-harvest/SKILL.md +263 -140
  19. package/capabilities/oats-okf/skills/okf/SKILL.md +13 -4
  20. package/docs/capabilities.md +14 -3
  21. package/docs/configuration.md +11 -1
  22. package/docs/design/2026-09-08-expert-assisted-deployment-proposal.md +558 -0
  23. package/docs/design/2026-09-13-knowledge-and-memory-direction.md +744 -0
  24. package/docs/design/2026-09-13-knowledge-implementation.md +127 -0
  25. package/docs/design/2026-09-13-knowledge-location-contract.md +340 -0
  26. package/docs/design/okf-mirror-provenance.md +105 -0
  27. package/docs/design/package-runtime-api.md +177 -3
  28. package/docs/desktop-cli-api.md +60 -11
  29. package/docs/execution-targets.md +16 -0
  30. package/docs/first-team-demo.md +6 -1
  31. package/docs/first-team.md +151 -115
  32. package/docs/integrations.md +42 -42
  33. package/docs/knowledge-capability-authoring.md +101 -0
  34. package/docs/knowledge-migration.md +138 -0
  35. package/docs/knowledge-reference/acceptance.md +108 -0
  36. package/docs/knowledge-reference/adoption.md +61 -0
  37. package/docs/knowledge-reference/harvester.md +107 -0
  38. package/docs/knowledge-reference/model.md +84 -0
  39. package/docs/knowledge-reference/package-craft.md +126 -0
  40. package/docs/knowledge-reference/provider-mapping.md +77 -0
  41. package/docs/knowledge-reference/reader-capture.md +87 -0
  42. package/docs/knowledge-theory.md +20 -6
  43. package/docs/knowledge.md +316 -129
  44. package/docs/layers.md +65 -69
  45. package/docs/migration-from-oas.md +7 -1
  46. package/docs/oats-config.schema.json +5 -2
  47. package/docs/packages.md +26 -2
  48. package/docs/release-notes/v0.23.0.md +93 -0
  49. package/docs/release-notes/v0.23.1.md +97 -0
  50. package/docs/schedules.md +42 -3
  51. package/docs/souls-and-instances.md +72 -49
  52. package/injects/work-directory.md +18 -0
  53. package/lib/core.mjs +279 -56
  54. package/lib/schedule.mjs +12 -2
  55. package/package-catalog.json +6 -1
  56. package/package.json +2 -2
  57. package/packages/record/README.md +19 -0
  58. package/packages/record/bin/capture.mjs +96 -48
  59. package/packages/record/bin/recall.mjs +17 -11
  60. package/packages/record/bin/record-native-start.mjs +11 -0
  61. package/packages/record/lib/capture-cc.mjs +82 -27
  62. package/packages/record/lib/capture-lock.mjs +15 -2
  63. package/packages/record/lib/formats.mjs +108 -21
  64. package/packages/record/lib/native-history.mjs +87 -0
  65. package/packages/record/lib/session-roots.mjs +90 -0
  66. package/packages/record/lib/session-snapshot.mjs +61 -0
  67. package/packages/record/lib/sessions-for-home.mjs +88 -56
  68. package/skills/oats/SKILL.md +3 -1
  69. package/capabilities/oats-okf/lib/harvest-branch.mjs +0 -43
@@ -14,7 +14,7 @@ A soul is durable and committed. It is the part you review, improve, and keep.
14
14
  AGENTS.md # canonical operating doc
15
15
  CLAUDE.md → AGENTS.md
16
16
  skills/ # skills specific to this expert
17
- knowledge/ # optional, created by the knowledge integration
17
+ okf.json # OKF v2 owner/owns/reads declaration, when selected
18
18
  ```
19
19
 
20
20
  `soul.yaml` keys:
@@ -25,21 +25,22 @@ A soul is durable and committed. It is the part you review, improve, and keep.
25
25
  | `kind` | `persistent` for committed agents, `local` for full local souls under `local-agents/` (legacy `tmp` reads as `local`). |
26
26
  | `description` | Short role description. |
27
27
  | `repo` | Target repo, absolute or relative to the agents root's parent. |
28
- | `work` | `worktree` or `checkout`. |
28
+ | `work` | `worktree`, `checkout`, `attached`, `workspace`, or `directory`. |
29
29
  | `runtime` | `pi` or `claude` — the harness new instances launch on; a spawn can override with `--runtime`. For `claude`, the binary is `claude` unless a local-only `oats-claude-config` file (closest one walking up from the repo; one line naming the binary, e.g. `claude-personal`) selects another — a personal machine preference for account selection, never committed. With the aweb messaging integration active, claude sessions get the `aweb-channel` plugin wired at spawn for real-time push events. |
30
30
  | `model` | Optional default model — a `provider/id[:thinking]` pattern or a comma-separated preference list (`github-copilot/x:high, anthropic/x:high`); at spawn the first entry whose provider/model is available wins (pi models probed via `pi --list-models`). For the `claude` runtime the value is translated to what the claude CLI accepts: `anthropic/<id>[:thinking]` becomes the bare `<id>`, aliases and bare `claude-*` ids pass through, other providers' entries are dropped, and nothing usable falls back to claude's own default. A spawn can override it. |
31
31
  | `launch-config` | Optional default launch configuration for new instances (a name declared under `launch-configs:` in the scope's config; see docs/design/launch-configurations.md). `oats spawn --launch-config <name|none>` overrides it; `oats soul set --launch-config <name>` / `--no-launch-config` edit it. |
32
32
 
33
33
  A soul is model-agnostic as an artifact. Its files are plain operating docs,
34
- skills, and knowledge. `model` is only the default choice for new instances,
35
- not part of the expert's identity.
34
+ skills and capability-owned declarations. `model` is only the default choice
35
+ for new instances, not part of the expert's identity.
36
36
 
37
37
  A soul never runs by itself. It is incarnated as an instance. Editing a soul
38
38
  is a code change.
39
39
 
40
- Today the core soul artifacts are `AGENTS.md`, `skills/`, and any knowledge
41
- bundle the knowledge integration creates. Future integrations may add other
42
- expert-specific artifacts, such as Claude Code-like rule files or
40
+ Core soul artifacts are `AGENTS.md` and `skills/`, plus any declarations the
41
+ selected knowledge integration needs. OKF v2 stores knowledge externally, not
42
+ in a soul bundle; see [knowledge](knowledge.md) for its prepared version scope.
43
+ Future integrations may add expert-specific artifacts such as rule files or
43
44
  runtime-specific guidance, while keeping `AGENTS.md` canonical.
44
45
 
45
46
  ## Instance anatomy
@@ -73,13 +74,14 @@ collide because they are local runtime state, not shared soul state.
73
74
  STATE.md, log.md, notes/ # optional, from the knowledge integration
74
75
  ```
75
76
 
76
- Why some knowledge belongs in the soul (incarnation-invariant) and some in
77
- the instance (this task, this branch, now) — regardless of which integration
78
- or format you use — is covered in [knowledge theory](knowledge-theory.md).
77
+ Why durable expertise must be incarnation-invariant while task state is local
78
+ to this branch and moment is covered in [knowledge theory](knowledge-theory.md).
79
+ This distinction does not require knowledge bytes to live in the soul.
79
80
 
80
- The kernel does not define memory files. If the config resolves `knowledge:
81
- okf`, the okf integration creates `STATE.md`, `log.md`, and `notes/`. If the
82
- config resolves `knowledge: none`, those files do not exist.
81
+ The kernel does not define memory files. With `oats.okf` selected under
82
+ `capabilities.layers.knowledge`, v2 creates `STATE.md`, `log.md`, `notes/` and an
83
+ immutable external-knowledge snapshot. `knowledge: none` creates none of these;
84
+ it does not erase pre-existing memory.
83
85
 
84
86
  ## Lifecycle
85
87
 
@@ -94,7 +96,10 @@ own home and tools.
94
96
 
95
97
  Examples of spawn hooks:
96
98
 
97
- - `oats-okf` creates episodic memory files.
99
+ - `oats.okf` v2 requires explicit bindings and owner declarations, validates
100
+ accepted bases, creates episodic files and an immutable reader view, and
101
+ registers a durable source plus its per-source schedule definition. Missing
102
+ knowledge is an error, not permission to bootstrap an empty substitute.
98
103
  - `oats-aweb` mints a messaging identity.
99
104
 
100
105
  ### Work
@@ -103,29 +108,26 @@ The instance works in `./work`. With oats-okf it also keeps `STATE.md` current,
103
108
  appends milestones to `log.md`, and captures non-obvious insights in
104
109
  `notes/`.
105
110
 
106
- After committing with pending notes, the instance runs `oats okf harvest`
107
- (its okf briefing says so). oats-okf spawns a memory-harvest agent attached to
108
- the same work tree. The harvester promotes, merges, or drops notes, commits a
109
- `memory-harvest:` change, deletes processed notes, and retires itself. This is
110
- how long-lived instances feed their souls while still alive.
111
-
112
- Instances that write few notes still feed their souls. With no notes pending,
113
- `oats okf harvest` asks the turn record for the instance's own captured
114
- sessions (the transcripts whose working directory is the instance home), and
115
- spawns the harvester on the turns captured since the last harvest, bounded by
116
- exact turn ids. The harvester extracts candidates from them, judges each under
117
- the same promotion bar as a note, and once its judgement is complete writes the
118
- watermark `.okf-harvest-record.json` in the instance home, whether or not it
119
- promoted anything; only a failed harvest leaves the watermark alone, so the same
120
- window is read again. `oats okf harvest --from-record` consults the record even
121
- when notes are pending. Windows are sized to one tool-output read (60 turns
122
- or 96 KB of JSON by default; okf settings `record-window-turns` and
123
- `record-window-bytes`), so a long backlog drains over several harvests, each
124
- advancing the watermark only over what was read; the package prepares the next
125
- watermark as `.okf-harvest-record.next.json` and the harvester's delivery is
126
- one rename, so an abandoned harvest leaves that file beside the current one.
127
- oats.okf 1.5.0 requires kernel 0.22.2 (the `capture --home` and `recall --json`
128
- surfaces); the compatibility floor refuses to activate it on an older kernel.
111
+ It reads accepted external knowledge through `./knowledge/view.json` and
112
+ `./knowledge/bases/<alias>/`, index-first. It never writes accepted knowledge;
113
+ this is instruction, not an OS sandbox. `oats okf read`/`refresh` obtains a new
114
+ accepted view while old snapshots remain stable. Git PRs are unread as accepted
115
+ knowledge until their merge is visible; pending directory publication blocks
116
+ fresh reads rather than exposing partial bytes.
117
+
118
+ An independent worker judges durable **notes and full record windows**, not only
119
+ notes or a watermark left in the live home. V2 working-agent instructions do not
120
+ require after-commit harvesting. Each source has a command job rooted in durable
121
+ deployment context; the operator may also request `oats okf harvest`. Timer
122
+ installation is explicit, and no-launch sources cannot schedule model launches.
123
+
124
+ Workers use their own `work: directory`, never the source branch or an attached
125
+ worktree. Validated Git output goes through real PR delivery; non-Git output
126
+ uses recoverable directory publication. Workers leave live notes and soul skills
127
+ untouched. Captured, processed, delivered and accepted are distinct receipts;
128
+ spawning a worker is not successful learning. See [knowledge](knowledge.md) for
129
+ inspection, completion and recovery, and [migration](knowledge-migration.md) for
130
+ preserving v1 bundles and source cursors before owner/source cutover.
129
131
 
130
132
  ### Spawning and coordinating with other agents
131
133
 
@@ -171,8 +173,11 @@ task layer can provide shared work state while messaging provides conversation.
171
173
  ### Retire
172
174
 
173
175
  Retirement runs active capability retire hooks in reverse spawn order before the home disappears. The aweb
174
- integration self-deletes the instance identity here. For oats-okf, retirement
175
- is a knowledge no-op because harvest already happens after commits.
176
+ integration self-deletes the instance identity here. OKF v2 performs final
177
+ notes-and-record capture into durable external custody. An incomplete or
178
+ uncertified capture retains the home for retry. Successful retirement enqueues
179
+ evidence but never waits for a model or GitHub: independent processing and
180
+ source-targeted inspection continue after the home disappears.
176
181
 
177
182
  `oats retire <instance> --self` lets an instance retire itself when the human
178
183
  or briefing says it is done. A live runtime cannot give a stable final
@@ -206,7 +211,8 @@ instructions state first (`injects/instance-boundary.md`):
206
211
  extent the mode below permits.
207
212
  - The home's `soul` link is to be treated as read-only: writes through it bypass
208
213
  the branch and review path. Durable soul edits go through tracked paths under
209
- `work/`, or through the harvester when the soul lives outside the repo.
214
+ `work/` under the applicable review rules. OKF v2 harvest edits external
215
+ owned knowledge, not canonical soul files or skills.
210
216
 
211
217
  Agents move between the two as the task needs; the boundary is what each
212
218
  directory is for, not a place to settle in.
@@ -247,8 +253,7 @@ Rules:
247
253
  `work/` points at **another instance's work tree** — same branch, same
248
254
  uncommitted state. Spawning attached requires `workDir` (the owning
249
255
  instance's `<home>/work`); it is usually a spawn-time choice for service
250
- agents (the memory-harvest agent uses it so its promotion commit lands on
251
- the source instance's branch), but a soul whose role is always-attached
256
+ agents such as reviewers, but a soul whose role is always-attached
252
257
  service work may declare it as identity too.
253
258
 
254
259
  Attached agents are guests: never switch branches or rewrite history, touch
@@ -256,6 +261,22 @@ only what the briefing names, keep commits small and attributable. Retiring
256
261
  an attached instance never removes the shared tree. The packaged
257
262
  `work-attached` instruction source carries this discipline into each generated instance AGENTS.md.
258
263
 
264
+ ### `directory` — independent execution
265
+
266
+ `work/` is a new instance-owned directory, not a Git repo or a link to a source.
267
+ Use it explicitly for capability workers that need private execution space
268
+ without Git. `repo` (or `--repo`) supplies configuration context only and may be
269
+ an ordinary directory; without it, the deployment scope is used. An
270
+ `oats-config.yaml` below laptop scope supports package-only deployments before
271
+ any local souls exist. No implicit fallback changes the other modes.
272
+
273
+ `--work-dir` and `--branch` are rejected. Canonical instructions, skill
274
+ composition, provider trust and runtime preflight still apply. No worktree setup
275
+ runs. Retirement preserves nonempty work in verified recovery storage beside the
276
+ home (`workRecovery.path/work`) before deleting it, including files created by
277
+ hooks; directory work has no disposable-root exemptions. The work-root cannot be
278
+ exchanged for a symlink. Recovery does not replace the worker's delivery protocol.
279
+
259
280
  ### `workspace` — cross-repo coordinator
260
281
 
261
282
  `work/` is a symlink to the **whole workspace** (the team scope declared by
@@ -273,10 +294,10 @@ Rules:
273
294
  - Read freely across member repos; **never edit or commit inside them** —
274
295
  route changes to the owning repo's agents or the human.
275
296
  - No git state operations in any member repo.
276
- - The one exception is the soul's own home repo: knowledge promotion writes
277
- there via the knowledge layer's harvest, **as a PR on a branch**, never a
278
- direct push (the OKF integration does this automatically for
279
- workspace-mode instances).
297
+ - Knowledge promotion follows the selected capability's custody protocol,
298
+ never direct edits through the workspace view. In OKF v2 an independent
299
+ worker publishes external knowledge through PRs for every Git base,
300
+ irrespective of the source's work mode or the soul's repository.
280
301
 
281
302
  Spawning workspace mode requires a declared boundary (a `team:` block or a
282
303
  workspace-scope config); the instance records no branch — the workspace is
@@ -354,8 +375,8 @@ Default layout:
354
375
  ```
355
376
 
356
377
  `local-agents/` sits BESIDE `agents/` at the scope level and holds **full local
357
- souls**: complete souls (memory, skills, knowledge, instances) that are not
358
- committed to the repo. `oats create <name> --local` creates one — the directory
378
+ souls**: complete definitions with instructions, skills, capability declarations
379
+ and instances, not committed to the repo. `oats create <name> --local` creates one — the directory
359
380
  is created on first use, and when the scope is a git repo the kernel adds
360
381
  `local-agents/` to its `.gitignore` automatically. A scope with only
361
382
  `local-agents/` is fully operable: people can use OATS with local agents alone.
@@ -366,7 +387,9 @@ for compatibility.
366
387
  Instances of a local soul receive a `local-soul` briefing: work and commits
367
388
  are normal, but soul updates are plain file edits (nothing to commit), and
368
389
  durability is the machine's — promote the soul to `agents/` when it starts to
369
- matter beyond one machine.
390
+ matter beyond one machine. That concerns soul artifacts, not a knowledge
391
+ provider's custody: a local soul using OKF v2 still reads external bases and
392
+ uses PR-only delivery for any Git base.
370
393
 
371
394
  Alternative agents-root layouts are planned but not built. Today the default
372
395
  layout is the only implemented layout.
@@ -0,0 +1,18 @@
1
+ ## Work mode: directory
2
+
3
+ Your `./work` is an **instance-owned execution directory**. It is not a Git
4
+ worktree, a checkout, or a link to the source instance or deployment context.
5
+ The context recorded as `repo` supplies configuration; it grants no permission
6
+ to edit that directory.
7
+
8
+ - Do task work inside `./work`. No Git repository or branch is created for you;
9
+ do not initialize a fake repository to satisfy a workflow. Git might discover
10
+ a containing repository; that does not authorize work in the containing tree.
11
+ - Access external inputs and destinations only as explicitly authorized by the
12
+ task and active capabilities. This mode does not impose a storage provider or
13
+ a publication protocol.
14
+ - Keep canonical instructions in the instance's `AGENTS.md`; `CLAUDE.md` is its
15
+ compatibility symlink. Run OATS lifecycle/capability commands from home.
16
+ - Retirement removes the execution directory only after nonempty work has a
17
+ verified copy in the reported recovery storage beside the home. Recovery is
18
+ not publication: deliver your results through the task's own protocol first.