@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
package/docs/layers.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  Status: contracts on paper (migration step 2 of
4
4
  [the 2026-09-03 architecture proposal](2026-09-03-architecture-proposal.md)).
5
- Every section says what is **shipped** today and what is **proposed**. A
5
+ Sections distinguish **shipped**, **prepared** and **proposed** behavior.
6
+ The knowledge section describes the prepared OKF v2 integration; its release
7
+ gates are explicit in [v0.23.1 notes](release-notes/v0.23.1.md). A
6
8
  proposed clause describes the contract the kernel will be refactored toward;
7
9
  it is not a claim about current behavior, and the shipped documents
8
10
  ([souls and instances](souls-and-instances.md),
@@ -127,65 +129,58 @@ kernel's code has no branch that names either.
127
129
 
128
130
  ## The knowledge contract
129
131
 
130
- **Shipped.** The `knowledge` slot. The bundled implementation is `oats.okf`:
131
- an OKF bundle under `soul/knowledge/`, per-instance `STATE.md`, `log.md`, and
132
- `notes/`, the `okf` and `memory-harvest` skills, and `oats okf harvest`, which
133
- spawns the capability-defined `memory-harvest` soul attached to the source
134
- instance's work tree. `knowledge: none` is valid and yields no memory files
135
- and no harvest.
136
-
137
- **Contract.** Two sides.
138
-
139
- *Read.* An instance can find and consult organizational knowledge,
140
- index-first and selectively, and is told how by the implementation's injected
141
- block and skill. Prior decisions, lessons, and playbooks in scope are binding
142
- context; re-deriving what the soul already knows is a bug. **Proposed:** the
143
- scope of what an instance may read is decided by its soul type, which needs
144
- `OATS_SOUL_TYPE` (step 7) before an implementation can act on it.
145
-
146
- *Write.* A permitted soul (a harvester type) can promote into the store. The
147
- format is the implementation's. Delivery matches the soul's custody: a commit
148
- on the instance's branch for repository-resident souls, a pull request to
149
- the soul's home repository for workspace-mode souls, direct edits for local
150
- souls.
151
-
152
- *Custody, shipped.* Delivery custody is keyed by where the soul resides: a
153
- commit on the instance's branch for repository-resident souls, a pull request
154
- to the soul's home repository for workspace-mode souls, direct edits for local
155
- souls. That is the only custody the kernel and `oats.okf` implement today.
156
-
157
- *Custody scoping, proposed.* The requirement is that repository-specific
158
- facts never move into a broader scope by default and that a cross-repository
159
- soul never reads another repository's specifics. The design that meets it
160
- belongs to the knowledge package, not the kernel. Custody layers (soul-shared,
161
- workspace overlay, repository overlay) are one candidate; scoping by soul
162
- type plus residency is another. Nothing here is settled or shipped.
163
-
164
- *Promotion doctrine.* What the write side accepts is a decision, not a
165
- format question. The line is decision versus description. Descriptions of
166
- how the code fits together go stale and compete with the code; the write
167
- side rejects them. Decisions, what was chosen, what was rejected, and why,
168
- cannot be derived from code and are accepted, as are inspiration genealogy
169
- ("took this from X, rejected Y because Z"), process lessons, and maintained,
170
- timestamped, superseded-on-change slow state about an area. Slow state is
171
- accepted only with its maintenance discipline: a named owner and an
172
- update-on-change rule; a slow-state concept nobody maintains is
173
- indistinguishable from residue and is rejected as such. Task residue
174
- (pull-request numbers, half-done plans, point-in-time environment facts) dies
175
- with the instance. One home per decision; split-brain comes from copies. The
176
- homing rule: architecture facts that several roles need go in repository-
177
- visible docs and souls point to them; craft decisions scoped to one role go
178
- in that role's soul; product direction goes in the steward's bundle,
179
- consulted and never copied. For non-coding specialists none of their
180
- knowledge is re-derivable from a repository, so those souls are almost pure
181
- knowledge. See [knowledge theory](knowledge-theory.md) for the derivation.
182
-
183
- **Proposed.** The harvester's input widens from the agent's own notes to the
184
- capture contract (below), so lessons reach the soul even when an agent wrote
185
- no notes; the promotion doctrine is unchanged, only the input channel widens.
186
-
187
- **Test.** A plain-Markdown or wiki-backed implementation beside `oats.okf`,
188
- each with its own harvester; a soul's `AGENTS.md` unchanged between them.
132
+ **Shipped kernel contract.** Zero or one knowledge capability per soul,
133
+ selected under `capabilities.layers.knowledge`. `none` creates no
134
+ provider memory or harvest flow and does not delete existing state. The kernel
135
+ owns neither the format nor a mandatory promotion doctrine.
136
+
137
+ **Prepared reference implementation: oats.okf 2.0.0 / framework v0.23.1.**
138
+ All accepted knowledge is external. Explicit bindings name Git or non-Git
139
+ bases; `soul/okf.json` declares stable ownership and read references, while
140
+ `okf-base.json` identifies accepted nodes. Missing configuration or knowledge
141
+ fails working-source spawn, never creates an empty substitute.
142
+
143
+ *Read.* Sources consult immutable accepted views, index-first and selectively.
144
+ Prior rationale should be consulted rather than re-derived. OKF's `owns` routes
145
+ responsibility and `reads` chooses starting context: neither is an ACL, and all
146
+ configured bases are discoverable/readable. Cannot-write is instruction, not an
147
+ OS sandbox. A directory publication journal blocks fresh views; Git readers see
148
+ only the accepted branch, not an open PR.
149
+
150
+ *Capture and judgment.* Working agents capture state/log/notes; durable source
151
+ custody also copies full native record windows through the public CLI. A separate
152
+ worker judges from frozen input without needing the source home, worktree or
153
+ model. Source retirement waits for certified capture, not a model or GitHub.
154
+ Workers use independent `directory` execution and never edit source notes or
155
+ soul skills. Existing hooks and per-source command schedules supply this flow;
156
+ the proposed generic `harvest` event above is not implemented or required.
157
+
158
+ *Delivery custody.* Knowledge placement, not soul residency or work mode,
159
+ determines delivery. All Git bases use verified PR-only delivery with separate
160
+ merge-visible acceptance. Genuine non-Git directories use cooperative locks,
161
+ baseline comparison, journalled publication and validated receipts, without Git
162
+ or gh. There is no direct Git fallback and no cross-base distributed transaction.
163
+ Source descriptors, proposals and processing/delivery/acceptance receipts outlive
164
+ source retirement. Inspection can show matching live Markdown plus durable
165
+ receipts; missing/reused homes cannot supply live memory for an old source.
166
+
167
+ *Reference promotion doctrine.* OKF accepts durable behavior-changing judgment
168
+ that is not recoverable merely by reading code: rationale, rejected alternatives,
169
+ discovered limits and maintained slow state. It rejects code descriptions, task
170
+ residue, secrets and verbatim third-party messages. Human-accepted decisions keep
171
+ acceptance evidence; maintained state needs an owner and freshness discipline.
172
+ One canonical concept is preferable to copied claims. These are the default
173
+ capability's choices, not a compulsory judge for every knowledge implementation.
174
+
175
+ See [the runtime guide](knowledge.md) and [v1 migration](knowledge-migration.md)
176
+ for current commands and constraints. The [reference theory](knowledge-theory.md)
177
+ and [authoring curriculum](knowledge-capability-authoring.md) are optional;
178
+ capabilities may adopt, adapt or replace them and own their complete runtime.
179
+
180
+ **Test.** OKF's Git and directory providers exercise independent custody within
181
+ one capability. A second knowledge capability with a different model remains a
182
+ separate replaceability test; two OKF providers do not prove that test by
183
+ renaming them as two integrations.
189
184
 
190
185
  ## The tasks contract
191
186
 
@@ -260,8 +255,8 @@ them.
260
255
  `packages/record` captures Claude Code, Pi, and Codex transcripts plus aw
261
256
  client logs. It skips sources matched by the local record's ignore list. It
262
257
  stores captured turns in an append-only, content-addressed record with a search
263
- index (`oats setup`, `oats capture`, `oats recall`). It is not a capability and
264
- no lifecycle hook knows about it.
258
+ index (`oats setup`, `oats capture`, `oats recall`). It is not a capability. A knowledge capability may consume source-targeted
259
+ capture/recall through the supported CLI boundary, as OKF v2 does.
265
260
 
266
261
  **Contract.** The format of ephemeral state. Two kinds satisfy it: an agent's
267
262
  own notes (its report of what mattered, today created by the knowledge
@@ -340,21 +335,22 @@ bundle.
340
335
 
341
336
  ## The work target contract
342
337
 
343
- **Shipped.** Four modes decide what `<instance-home>/work` is and what
338
+ **Shipped.** Five modes decide what `<instance-home>/work` is and what
344
339
  discipline the instance follows: `worktree` (an isolated branch), `checkout`
345
- (the shared current branch), `attached` (another instance's tree), and
346
- `workspace` (the whole team scope, read-only). A config may run a setup
347
- script inside each fresh worktree. Retirement preserves ordinary work,
340
+ (the shared current branch), `attached` (another instance's tree),
341
+ `workspace` (the whole team scope, read-only), plus explicit `directory`
342
+ (instance-owned non-Git execution for independent workers). A config may run a
343
+ setup script inside each fresh worktree. Retirement preserves ordinary work,
348
344
  quarantines incomplete cleanup, and never removes a shared tree. The
349
345
  generated instructions state the home/work boundary before the mode block.
350
346
 
351
347
  **Contract.** The work target is a parameter of instantiation independent of
352
348
  where the soul is stored. Each mode is a module that prepares the view,
353
349
  states its discipline, and knows how to retire it safely, with the
354
- retirement baseline and inspection alongside. The four modes stay exactly as
355
- they are.
350
+ retirement baseline and inspection alongside. The four Git/context modes retain
351
+ their existing semantics; directory execution never acts as an implicit fallback.
356
352
 
357
- **Proposed.** A fifth target, `none`, for instances that operate on nothing
353
+ **Proposed.** An additional target, `none`, for instances that operate on nothing
358
354
  (a mail-only agent). It replaces no mode.
359
355
 
360
356
  **Test.** An instance of one soul spawned with each target, the same soul
@@ -11,6 +11,12 @@ kernel does not read `oas-*` configuration names or `oas.*` capability IDs.
11
11
  An unchanged agent-directory layout can make an old scope look familiar
12
12
  while its knowledge and messaging configuration remains unmigrated.
13
13
 
14
+ > **Separate knowledge cutover:** OAS/package name migration does not migrate
15
+ > soul knowledge, source memory or v1 watermarks to OKF v2. If the selected
16
+ > catalog update acquires OKF 2.0.0, plan [knowledge preservation and cutover](knowledge-migration.md)
17
+ > before activation/spawn. The v2 integration is [prepared](release-notes/v0.23.1.md),
18
+ > not a claim that those dependencies or any deployment have already changed.
19
+
14
20
  ## Upgrade one scope
15
21
 
16
22
  Finish or preserve active work before changing a daily-use deployment.
@@ -83,4 +89,4 @@ requirement to wait for OATS publication.
83
89
 
84
90
  See the [0.22.0 release notes](release-notes/v0.22.0.md) for the rename,
85
91
  package versions, and compatibility changes, and the
86
- [first-team qualification](first-team-demo.md) for current operating evidence.
92
+ [first-team qualification](first-team-demo.md) for historical v1 operating evidence.
@@ -63,7 +63,8 @@
63
63
  {
64
64
  "type": "object",
65
65
  "properties": {
66
- "setup": { "type": "string", "description": "Env-bootstrap command run inside each new worktree after creation (path relative to this config's directory)." }
66
+ "setup": { "type": "string", "description": "Env-bootstrap command run inside each new worktree after creation (path relative to this config's directory). Only worktree mode runs setup." },
67
+ "retirement-disposable": { "type": "array", "items": { "type": "string" }, "description": "Relative disposable roots for worktree retirement. Directory mode has no disposable exemptions." }
67
68
  },
68
69
  "additionalProperties": false
69
70
  }
@@ -160,7 +161,9 @@
160
161
  "properties": {
161
162
  "worktree": { "$ref": "#/$defs/workMode" },
162
163
  "checkout": { "$ref": "#/$defs/workMode" },
163
- "attached": { "$ref": "#/$defs/workMode" }
164
+ "attached": { "$ref": "#/$defs/workMode" },
165
+ "workspace": { "$ref": "#/$defs/workMode" },
166
+ "directory": { "$ref": "#/$defs/workMode" }
164
167
  },
165
168
  "additionalProperties": false
166
169
  }
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,93 @@
1
+ # OATS v0.23.0
2
+
3
+ This is the prerequisite kernel release for capability-owned external knowledge
4
+ and independent harvesting. It adds generic directory work and more reliable
5
+ record capture; it does **not** migrate existing knowledge or select a new
6
+ knowledge integration. The bundled `oats.okf` and official catalog pin remain
7
+ **1.6.1**. OKF 2.0 is a separate, subsequent capability release; no new catalog
8
+ pin or bundled v2 runtime is included here.
9
+
10
+ ## Independent directory work
11
+
12
+ `work: directory` creates an instance-owned ordinary `work/` directory. It does
13
+ not require a Git repository, branch, worktree, or fabricated commit. Existing
14
+ Git work modes retain their semantics. A capability can use directory workers
15
+ for non-Git knowledge custody without making its storage model a kernel policy.
16
+
17
+ Directory lifecycle checks reject a replaced, missing or symlinked work root
18
+ before launch, and preserve retryable cleanup obligations when compensation
19
+ cannot finish. Hooks receive the running kernel's CLI path. Generic scheduled
20
+ commands no longer inherit another instance's source identity.
21
+
22
+ ## Evidence capture and recall
23
+
24
+ Record capture distinguishes completed work from skipped, held, incomplete and
25
+ failed attempts. Capture verifies attributed native transcript identity,
26
+ honors native storage roots and recorded launch environments, and includes
27
+ supported nested Claude subagent transcripts. Uncertain discovery, unreadable
28
+ or replaced sources, incomplete tails and lock failures are not certified as
29
+ complete evidence. Large piped recall responses drain stdout before exiting.
30
+ Managed starts now preserve independent, execution-time native record-location
31
+ history, so a later observer's environment cannot silently redirect capture.
32
+ History survives retirement and is not a knowledge bundle. Older or standalone
33
+ sessions without that authority fail closed on `capture --home`; an operator
34
+ can explicitly use `oats capture --current-roots --home <home>` to inventory the
35
+ currently configured roots, but that does not certify all historical locations.
36
+
37
+ These are evidence-preservation guarantees, not a claim that a model has learned
38
+ from the captured records.
39
+
40
+ ## Optional knowledge-theory authoring resources
41
+
42
+ `oats.knowledge-theory` 1.0.0 is an optional **Git-distributed OATS package**
43
+ in this repository's self-contained `oats-package/` subtree. It exports
44
+ `knowledge-theory-expert` and the `knowledge-capability-authoring` skill with
45
+ the complete local reference curriculum. The kernel npm tarball ships public
46
+ docs and the CLI, but **excludes** this optional payload entirely. npm omits
47
+ symlinks; a partial copy without the canonical source alias is not a supported
48
+ package. Acquisition does not synthesize aliases or relax integrity semantics.
49
+
50
+ After this immutable tag is published, acquire through the normal Git package
51
+ route and explicitly opt in for an author soul:
52
+
53
+ ```bash
54
+ oats install git:github.com/awebai/oats@v0.23.0 --dir /path/to/scope
55
+ oats use oats.knowledge-theory --soul <author-soul> --dir /path/to/scope
56
+ ```
57
+
58
+ The default Git package root is `oats-package/`; acquisition locks the resolved
59
+ commit and alone activates nothing. An official catalog pin can follow only
60
+ after the immutable tag exists. No unpublished theory catalog pin is shipped
61
+ in this prerequisite release.
62
+
63
+ The package has no knowledge-layer binding, mandatory injection, runtime hook,
64
+ command or dependency on OKF. Authors may adopt, adapt or replace the reference
65
+ model. Each selected knowledge capability owns its runtime, reader/capture,
66
+ judgment and delivery instructions. The first external-knowledge design covers
67
+ Git PR delivery and non-Git directory custody; no framework ACL layer is added.
68
+
69
+ Canonical references are published under
70
+ [the authoring guide](../knowledge-capability-authoring.md) and
71
+ [the reference model](../knowledge-reference/model.md), with byte-identical
72
+ copies in the Git-packaged skill. Installed instances read those local copies,
73
+ not a source checkout or mutable network documentation. Git transport preserves
74
+ the tracked source `CLAUDE.md -> AGENTS.md`; generated instances receive their
75
+ own canonical alias through the unchanged normal composition path.
76
+
77
+ ## Packaging and compatibility
78
+
79
+ Kernel, Pi adapter and Desktop versions are aligned at 0.23.0, including both
80
+ lockfiles. Desktop still uses CLI API v1; its accepted kernel band is widened
81
+ to `>=0.22.0 <0.24.0`, retaining support for released 0.22.x kernels.
82
+
83
+ Local, CI and runnerless release checks share the recursive JavaScript
84
+ inventory, including capability libraries, record and optional package scripts.
85
+ Validation checks the optional theory manifests and canonical curriculum parity.
86
+ Pack checks require public docs and reject any optional package bytes in the
87
+ npm kernel. The installed kernel acquires an exact, self-contained Git fixture
88
+ through direct and catalog routes, checks its tracked source alias, then removes
89
+ the fixture checkout. Probes verify local reference closure, alternative-theory
90
+ isolation, discovery, scaffold and retirement in Git and directory scopes without
91
+ launching models. Publication
92
+ remains gated on the exact tag's build/test/smoke results and Desktop artifacts;
93
+ already-versioned candidates remain safe with `--allow-same-version`.
@@ -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.