@awebai/oats 0.23.0 → 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 (37) hide show
  1. package/README.md +48 -18
  2. package/capabilities/oats-okf/agents/memory-harvest/AGENTS.md +18 -24
  3. package/capabilities/oats-okf/agents/memory-harvest/soul.yaml +2 -2
  4. package/capabilities/oats-okf/bin/oats-okf.mjs +105 -517
  5. package/capabilities/oats-okf/injects/okf.md +32 -67
  6. package/capabilities/oats-okf/lib/config.mjs +112 -0
  7. package/capabilities/oats-okf/lib/inspection.mjs +96 -0
  8. package/capabilities/oats-okf/lib/io.mjs +103 -0
  9. package/capabilities/oats-okf/lib/migration.mjs +116 -0
  10. package/capabilities/oats-okf/lib/sources.mjs +238 -0
  11. package/capabilities/oats-okf/lib/stores.mjs +331 -0
  12. package/capabilities/oats-okf/lib/worker.mjs +352 -0
  13. package/capabilities/oats-okf/oats.json +23 -7
  14. package/capabilities/oats-okf/schemas/okf-base.schema.json +46 -0
  15. package/capabilities/oats-okf/schemas/okf-bindings.schema.json +112 -0
  16. package/capabilities/oats-okf/schemas/okf-soul.schema.json +37 -0
  17. package/capabilities/oats-okf/skills/memory-harvest/SKILL.md +263 -140
  18. package/capabilities/oats-okf/skills/okf/SKILL.md +13 -4
  19. package/docs/capabilities.md +14 -3
  20. package/docs/configuration.md +11 -1
  21. package/docs/design/okf-mirror-provenance.md +105 -0
  22. package/docs/desktop-cli-api.md +59 -10
  23. package/docs/first-team-demo.md +6 -1
  24. package/docs/first-team.md +151 -115
  25. package/docs/integrations.md +42 -42
  26. package/docs/knowledge-capability-authoring.md +10 -7
  27. package/docs/knowledge-migration.md +138 -0
  28. package/docs/knowledge.md +316 -129
  29. package/docs/layers.md +57 -62
  30. package/docs/migration-from-oas.md +7 -1
  31. package/docs/packages.md +26 -2
  32. package/docs/release-notes/v0.23.1.md +97 -0
  33. package/docs/schedules.md +42 -3
  34. package/docs/souls-and-instances.md +55 -48
  35. package/package-catalog.json +6 -1
  36. package/package.json +1 -1
  37. package/capabilities/oats-okf/lib/harvest-branch.mjs +0 -43
package/docs/packages.md CHANGED
@@ -391,12 +391,14 @@ for it.
391
391
  ### Catalog shape
392
392
 
393
393
  The official catalog is data (`package-catalog.json`, or the file named by
394
- `OATS_PACKAGE_CATALOG`):
394
+ `OATS_PACKAGE_CATALOG`). The v0.23.1 integration selects these already-published
395
+ sources; installing a kernel does not advance existing package locks:
395
396
 
396
397
  ```json
397
398
  {
398
399
  "packages": {
399
- "oats.okf": { "url": "https://github.com/awebai/oats-okf.git", "ref": "v1.4.1", "path": "oats-package" },
400
+ "oats.okf": { "url": "https://github.com/awebai/oats-okf.git", "ref": "v2.0.0", "path": "oats-package" },
401
+ "oats.knowledge-theory": { "url": "https://github.com/awebai/oats.git", "ref": "v0.23.0", "path": "oats-package" },
400
402
  "oats.dev": { "url": "https://github.com/awebai/oats-dev.git", "ref": "v1.0.0", "path": "oats-package" }
401
403
  },
402
404
  "capabilities": { "oats.review": "oats.dev" }
@@ -412,6 +414,28 @@ Existing v1 locks and artifacts remain supported until you run guided migration.
412
414
  reads; identity mappings need no entry. An alias value may also be spelled
413
415
  `{ "package": "<id>" }`.
414
416
 
417
+ ### OKF v2 and optional theory distribution
418
+
419
+ The standalone OKF package exports only `oats-package/capabilities/oats-okf/`.
420
+ Use its catalog Git payload after [release gates](release-notes/v0.23.1.md) pass.
421
+ The framework's bundled npm mirror is not a self-contained distribution:
422
+ npm drops the source worker soul's `CLAUDE.md -> AGENTS.md`. It must not be
423
+ advertised as a complete local package or repaired after acquisition to evade
424
+ integrity checks. Git transport preserves the canonical source alias.
425
+
426
+ The optional `oats.knowledge-theory` package is a separate Git payload in this
427
+ repository's `oats-package/`, excluded from the kernel npm tarball. The catalog
428
+ entry selects published framework v0.23.0, which contains package 1.0.0.
429
+ The source reference patch 1.0.1 is separately available through an explicit
430
+ v0.23.1 Git source after that framework tag is published. It supplies an authoring skill and
431
+ `knowledge-theory-expert`, not a default knowledge-layer binding, runtime judge
432
+ or OKF dependency. Acquiring it does not activate it.
433
+
434
+ Updating OKF v1 to v2 is a breaking capability change. Preserve existing
435
+ knowledge and source state/cursors, explicitly bind/provision external owners,
436
+ accept provider delivery and perform deliberate cutover. Kernel package/lock
437
+ migration does none of this. See [knowledge migration](knowledge-migration.md).
438
+
415
439
  ## Doctor
416
440
 
417
441
  `oats doctor` reports, in addition to its capability diagnostics:
@@ -0,0 +1,97 @@
1
+ # OATS v0.23.1 — external OKF v2 integration
2
+
3
+ This patch integrates the published **oats.okf 2.0.0** Git package, tagged at
4
+ `4b6d861ce44e5662303e150cc85095d0eb00d7e7`, following the published OATS 0.23.0
5
+ prerequisite. The checked-in mirror records verified remote tag/object and
6
+ payload provenance. Updating OATS alone does not change existing exact locks,
7
+ activate capabilities, migrate knowledge or install a host timer.
8
+
9
+ ## External OKF v2 integration
10
+
11
+ The framework mirror follows the standalone package's **only exported
12
+ capability**, `oats-package/capabilities/oats-okf/`. OATS >=0.23.0 supplies the
13
+ generic directory-work and public capture/recall/CLI boundaries; OKF uses no
14
+ private kernel imports. V0.23.1 prepares the framework catalog for OKF 2.0.0,
15
+ without changing an existing deployment's exact lock or activation.
16
+
17
+ This is a **breaking capability upgrade**, independently versioned from the
18
+ framework patch:
19
+
20
+ - Explicit absolute `bindings-file` settings, external Git/directory bases,
21
+ `soul/okf.json` owner declarations and accepted `okf-base.json` node metadata.
22
+ - Index-first immutable reader views, with an instructional no-write boundary,
23
+ not an OS sandbox or new ACL. `owns` routes responsibility and `reads` selects
24
+ starting context; every configured base remains discoverable/readable.
25
+ - Durable per-source notes **and full record windows**, frozen destinations,
26
+ independent directory workers and source jobs that survive home retirement.
27
+ Final capture must certify custody before the source home can disappear.
28
+ - Git delivery is PR-only, with verified native commit/push/PR receipts and
29
+ separate merge-visible acceptance. Plain-directory delivery uses cooperative
30
+ locks, baseline comparison, a recoverable publication journal and validated
31
+ receipts, without Git/gh. Multi-base delivery is not a distributed transaction.
32
+ - Working agents capture; service workers judge. No automatic edits to soul
33
+ skills, direct accepted-base edits by readers or attached source-branch
34
+ promotion commits.
35
+
36
+ ## Inspection and complete pipe output
37
+
38
+ The v2 inspection surface restores labeled live `STATE.md`, `log.md` and sorted
39
+ Markdown notes alongside durable processing receipts. Home-pointer and instance
40
+ identity checks prevent a retired, missing, reused or unverified home from
41
+ supplying another source's live documents. `liveMemory` reports availability,
42
+ reason and observation time; durable bindings, registered view receipts and
43
+ scheduler diagnostics remain available independently.
44
+
45
+ Inspection keeps its explicit **256 KiB per-document preview**, with
46
+ `truncated`/original `bytes` metadata. The complete JSON envelope drains stdout,
47
+ including large documents and receipts. Provider `read` returns full Markdown;
48
+ record transport retains full returned evidence, not an inspection preview.
49
+ Descriptor-selected `read`/`refresh` always writes new immutable views under
50
+ source state, never the invoking repository or a deleted/replacement home.
51
+
52
+ Regression qualification must retain behavioral coverage, including large
53
+ piped documents, live identity failures, durable inspection after disappearance,
54
+ external view placement and full native record backlog. Scaffold tests establish
55
+ layout/custody, not that a model learned.
56
+
57
+ ## Git distribution, not an npm payload shortcut
58
+
59
+ Users acquire `oats.okf` through the catalog's exact Git payload and explicitly
60
+ review/trust executable surfaces. The npm bundled mirror is **not a
61
+ self-contained Git distribution**: npm omits the worker soul's tracked
62
+ `CLAUDE.md -> AGENTS.md` symlink. Do not synthesize source aliases, weaken
63
+ integrity rules or advertise copying that mirror as a complete package.
64
+
65
+ The optional `oats.knowledge-theory` catalog entry uses the already published
66
+ **v0.23.0** source (package 1.0.0), avoiding a forward reference to an unpublished
67
+ tag. The current Git source additionally contains the 1.0.1 authoring-reference
68
+ patch, available through an explicit v0.23.1 Git source after publication.
69
+ Its payload stays in the repository's `oats-package/` Git subtree,
70
+ not the kernel npm tarball. It exports authoring resources and
71
+ `knowledge-theory-expert`, without a knowledge-layer binding, mandatory runtime
72
+ injection or OKF dependency. Canonical references and copied local curriculum
73
+ must stay synchronized. Acquisition alone activates nothing.
74
+
75
+ ## Migration and verification
76
+
77
+ Follow [the v1 preservation and cutover guide](../knowledge-migration.md):
78
+ inventory active writers, preserve legacy knowledge/state/cursors, provision
79
+ empty owned nodes, stage and deliver through the provider, confirm acceptance,
80
+ then deliberately cut over owner declarations and existing sources. Old
81
+ watermarks are evidence, not v2 processing proof. No automatic migration deletes
82
+ legacy material or leaves a knowledge symlink in the soul.
83
+
84
+ Qualification includes the standalone suite against the actual published
85
+ minimum kernel, strict byte/mode/symlink mirror verification, framework regression
86
+ and installed-tarball Git acquisition probes. Iterative independent review
87
+ covered custody, interrupted publication, source retirement and rejected-PR
88
+ recovery. Separate real Pi learning after source/transcript deletion and actual
89
+ GitHub PR merge/reconciliation/fresh-view acceptance were verified; scripted
90
+ transport and model-learning evidence are kept distinct.
91
+
92
+ The normal tag-driven release still gates npm publication on all tests and
93
+ Desktop build/smoke legs. Live deployment and explicit knowledge cutover remain
94
+ separate operations, not side effects of package acquisition.
95
+
96
+ See [knowledge runtime documentation](../knowledge.md) for settings, lifecycle,
97
+ commands, custody and recovery boundaries.
package/docs/schedules.md CHANGED
@@ -44,9 +44,10 @@ and no queue.
44
44
  - **command** `{id, enabled, cron, tz, kind: "command", cwd, argv}` — runs
45
45
  an oats-only argv (`argv[0]` is `oats`, no shell) in `cwd`, which must be
46
46
  inside the workspace. The runner parses the command's envelope and tracks
47
- any instance it names, so `["oats", "okf", "harvest"]` run in a source
48
- instance's home is followed until the harvester it spawned is gone.
49
- Command return is not task completion.
47
+ any instance it names. A provider can return an independent worker launched
48
+ from durable context; the job follows that worker until its home is gone.
49
+ Command return is not task completion. Avoid binding durable work to a
50
+ disposable source-home cwd; see [OKF v2 source jobs](#okf-v2-source-jobs).
50
51
  - **wake** `{id, enabled, cron, tz, kind: "wake", home, message}` — every
51
52
  due minute inspects the instance at `home` through its session receipts.
52
53
  Running: `message` is delivered once with `session input`. Not running
@@ -150,3 +151,41 @@ saves a wake job `wake-<instance>` bound to the new home after the spawn
150
151
  succeeded. If the spawn succeeds but the save fails, the spawn result still
151
152
  carries the full instance receipt, plus `wakeScheduleError` and a warning;
152
153
  the instance is neither hidden nor spawned again.
154
+
155
+ ## OKF v2 source jobs
156
+
157
+ The [prepared OKF v2 runtime](knowledge.md) registers **one command job per
158
+ source**, not a fleet sweep or a home-bound operation job. It runs from stable
159
+ deployment context with argv equivalent to:
160
+
161
+ ```text
162
+ oats okf run-source --source /absolute/state/sources/UUID/source.json --soul domain-expert --json
163
+ ```
164
+
165
+ The descriptor and captured evidence live outside the disposable source.
166
+ Registration (including explicit harvest after source migration) idempotently
167
+ creates/verifies the definition; setup failures are reported for retry. A
168
+ pre-existing disabled job is not silently re-enabled. Command execution clears
169
+ invoking-instance identity and still passes normal capability activation/trust
170
+ gates after source retirement.
171
+
172
+ No timer is installed by registering a source or its job. An operator can
173
+ inspect or explicitly install one from deployment context:
174
+
175
+ ```bash
176
+ oats okf inspect --source /absolute/state/sources/UUID/source.json --soul domain-expert --json
177
+ oats okf setup --source /absolute/state/sources/UUID/source.json --soul domain-expert --json
178
+ # Explicit host change; never part of a scaffold-only test:
179
+ oats okf setup --source /absolute/state/sources/UUID/source.json --install-host --soul domain-expert --json
180
+ # Definition-only disable; does not stop a worker or reconcile an executing job:
181
+ oats okf setup --source /absolute/state/sources/UUID/source.json --disable --soul domain-expert --json
182
+ ```
183
+
184
+ Retirement captures/enqueues final evidence and does not synchronously remove
185
+ its job under the scheduler's host lock or wait for a model/GitHub. A drained
186
+ retired source returns empty; disable its job explicitly when appropriate.
187
+ Source no-launch guards prevent automatic model starts, and final capture of
188
+ a no-launch source disables its automatic processing. `inspect` distinguishes
189
+ job definition from actual timer activity; an absent or inactive timer is not
190
+ reported as enabled automation. The scheduler's launch/liveness receipts do not
191
+ replace OKF's processing, delivery and merge-visible acceptance receipts.
@@ -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:
@@ -31,15 +31,16 @@ A soul is durable and committed. It is the part you review, improve, and keep.
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
@@ -289,10 +294,10 @@ Rules:
289
294
  - Read freely across member repos; **never edit or commit inside them** —
290
295
  route changes to the owning repo's agents or the human.
291
296
  - No git state operations in any member repo.
292
- - The one exception is the soul's own home repo: knowledge promotion writes
293
- there via the knowledge layer's harvest, **as a PR on a branch**, never a
294
- direct push (the OKF integration does this automatically for
295
- 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.
296
301
 
297
302
  Spawning workspace mode requires a declared boundary (a `team:` block or a
298
303
  workspace-scope config); the instance records no branch — the workspace is
@@ -370,8 +375,8 @@ Default layout:
370
375
  ```
371
376
 
372
377
  `local-agents/` sits BESIDE `agents/` at the scope level and holds **full local
373
- souls**: complete souls (memory, skills, knowledge, instances) that are not
374
- 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
375
380
  is created on first use, and when the scope is a git repo the kernel adds
376
381
  `local-agents/` to its `.gitignore` automatically. A scope with only
377
382
  `local-agents/` is fully operable: people can use OATS with local agents alone.
@@ -382,7 +387,9 @@ for compatibility.
382
387
  Instances of a local soul receive a `local-soul` briefing: work and commits
383
388
  are normal, but soul updates are plain file edits (nothing to commit), and
384
389
  durability is the machine's — promote the soul to `agents/` when it starts to
385
- 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.
386
393
 
387
394
  Alternative agents-root layouts are planned but not built. Today the default
388
395
  layout is the only implemented layout.
@@ -2,7 +2,7 @@
2
2
  "packages": {
3
3
  "oats.okf": {
4
4
  "url": "https://github.com/awebai/oats-okf.git",
5
- "ref": "v1.6.1",
5
+ "ref": "v2.0.0",
6
6
  "path": "oats-package"
7
7
  },
8
8
  "oats.aweb": {
@@ -29,6 +29,11 @@
29
29
  "url": "https://github.com/awebai/oats-dev.git",
30
30
  "ref": "v1.0.0",
31
31
  "path": "oats-package"
32
+ },
33
+ "oats.knowledge-theory": {
34
+ "url": "https://github.com/awebai/oats.git",
35
+ "ref": "v0.23.0",
36
+ "path": "oats-package"
32
37
  }
33
38
  },
34
39
  "capabilities": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awebai/oats",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "description": "OATS (Open Agent Team Specification) — durable souls, disposable instances, targetable capability packages, and the runtime-neutral oats CLI/kernel.",
5
5
  "keywords": [
6
6
  "agents",
@@ -1,43 +0,0 @@
1
- // A workspace-mode harvest delivers its promotion as a PR from a branch named
2
- // memory-harvest/<slug> in the soul's repository. After that PR merges, the
3
- // local branch may still exist and the next harvest's spawn would refuse it.
4
- // A branch fully merged into the base is stale and is deleted before the
5
- // spawn; an unmerged one is the previous harvester's unfinished work and the
6
- // harvest refuses with the exact remedy instead of touching it.
7
- import { execFileSync } from "node:child_process";
8
-
9
- /** Single-quote shell escaping for the operator remedy: the repo path may hold spaces or shell metacharacters. */
10
- export function shellQuote(s) { return "'" + String(s).replace(/'/g, "'\\''") + "'"; }
11
-
12
- function git(repo, args) {
13
- return execFileSync("git", ["-C", repo, ...args], { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim();
14
- }
15
-
16
- /** The repository's base branch: origin/HEAD's target when known, else main, else master. */
17
- export function baseBranchOf(repo) {
18
- try { const ref = git(repo, ["symbolic-ref", "--quiet", "refs/remotes/origin/HEAD"]); if (ref) return ref.replace(/^refs\/remotes\//, ""); } catch { /* no origin/HEAD */ }
19
- for (const b of ["origin/main", "main", "origin/master", "master"]) {
20
- try { git(repo, ["rev-parse", "--verify", "--quiet", b]); return b; } catch { /* next */ }
21
- }
22
- return undefined;
23
- }
24
-
25
- /** Returns { action: "absent" | "deleted", base } or throws E_HARVEST_BRANCH_EXISTS. */
26
- export function reclaimHarvestBranch(repo, branch) {
27
- try { git(repo, ["rev-parse", "--verify", "--quiet", `refs/heads/${branch}`]); }
28
- catch { return { action: "absent" }; }
29
- const base = baseBranchOf(repo);
30
- let merged = false;
31
- if (base) { try { git(repo, ["merge-base", "--is-ancestor", branch, base]); merged = true; } catch { merged = false; } }
32
- if (!merged) {
33
- const err = new Error(`branch ${branch} already exists in ${repo} and is not merged into ${base || "any base branch"}: a previous harvest's promotion is unfinished — review and merge or delete it (git -C ${shellQuote(repo)} branch -D ${shellQuote(branch)}) before harvesting again`);
34
- err.code = "E_HARVEST_BRANCH_EXISTS";
35
- throw err;
36
- }
37
- // -D, not -d: the merge check above is against the BASE (origin/main when
38
- // present). `branch -d` re-checks against the branch's upstream or the
39
- // current HEAD instead, so with the soul's local main behind origin/main a
40
- // branch fully merged upstream would still be refused as "not fully merged".
41
- git(repo, ["branch", "-D", branch]);
42
- return { action: "deleted", base };
43
- }