@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/knowledge.md CHANGED
@@ -1,139 +1,326 @@
1
1
  # Knowledge — layer 2
2
2
 
3
- Specialization is accumulated judgment. A specialist remembers what worked,
4
- what failed, what was decided, and which procedures are worth repeating.
3
+ Specialization is accumulated judgment: decisions and rationale, rejected
4
+ alternatives, discovered limits, and maintained context that changes what a
5
+ future instance does. It is not a second description of the code.
5
6
 
6
- OATS treats knowledge as a pluggable layer. The kernel does not choose a
7
- memory format. The default integration, `oats-okf`, uses markdown OKF bundles
8
- for soul knowledge and simple files for instance state.
7
+ OATS keeps knowledge pluggable. The kernel supplies lifecycle, configuration,
8
+ trusted command dispatch and independent execution; each knowledge capability
9
+ owns its format, reader/capture instructions, judgment and delivery. The
10
+ [reference theory](knowledge-theory.md) and [authoring guide](knowledge-capability-authoring.md)
11
+ are optional author resources, not mandatory runtime policy.
9
12
 
10
- > **Status and relationship to the turn record (2026-08-21).** This layer is
11
- > current and stays. It is the *semantic* memory of an agent team — reviewed,
12
- > de-indexicalized truths that travel with the soul — and is distinct from the
13
- > *episodic* memory provided by the turn record (`packages/record`: every
14
- > session captured verbatim, automatically). Today the harvester's input is
15
- > `notes/*.md`, the working agent's own in-session notes; the planned upgrade
16
- > (epic `aweb-abfz`) feeds the harvester from the captured record as well, so
17
- > lessons reach the soul even when an agent wrote no notes and never ran
18
- > harvest. The judgment machinery described here — the promotion bar, the
19
- > capture/judge split, the routing between knowledge and skills — is unchanged
20
- > by that upgrade; only the input channel widens.
13
+ > **Version scope:** this guide describes published **oats.okf 2.0.0**, requiring
14
+ > the published OATS >=0.23.0 kernel. Framework v0.23.1 integrates its catalog
15
+ > and mirror; publishing packages does not activate or deploy them automatically.
16
+ > See [release notes](release-notes/v0.23.1.md).
17
+ > V1 soul-contained knowledge needs [explicit migration](knowledge-migration.md).
21
18
 
22
- ## What the kernel does not own
19
+ ## What lives where
23
20
 
24
- The kernel is memory-agnostic. It provides lifecycle events:
25
-
26
- - `soul-scaffold`
27
- - `spawn`
28
- - `retire`
29
-
30
- A knowledge integration decides what to do with those events. If config
31
- resolves `knowledge: none`, the kernel creates no `STATE.md`, no `notes/`, no
32
- knowledge bundle, and no harvest flow.
33
-
34
- The ideas behind any of this — what belongs in a soul vs an instance,
35
- capture vs judgment, consolidation stages — are format-independent and live
36
- in [knowledge theory](knowledge-theory.md).
37
-
38
- ## The default: oats-okf
39
-
40
- With `knowledge: okf`, the integration creates two memory spaces.
41
-
42
- | Space | Files | Purpose |
43
- |---|---|---|
44
- | Soul memory | `soul/knowledge/` | Long-term OKF bundle: lessons, decisions, playbooks, references, role-grown sections. |
45
- | Instance memory | `STATE.md`, `log.md`, `notes/` | Current task state, dated history, and captured insights. |
46
-
47
- The instance does not promote its own notes. It captures them, and after
48
- committing with pending notes it runs `oats okf harvest` (its okf injection
49
- carries this instruction), which spawns a **memory-harvest** agent. That
50
- harvester judges the notes and updates the soul; the delivery matches the
51
- soul's custody — a commit on the instance's branch for repo-resident souls,
52
- a PR to the soul's home repo for workspace-mode souls, and **direct edits
53
- with no commit** for local souls (their `local-agents/` home is
54
- uncommitted by contract). Then it retires.
55
-
56
- ## Capture and judgment
57
-
58
- OATS splits memory work into two roles.
59
-
60
- **The working instance captures.** It keeps `STATE.md` current, appends
61
- milestones to `log.md`, and writes every non-obvious insight to `notes/`.
62
- It does not decide whether an insight is "important enough" for the soul.
63
- Capture should be cheap and in-flow.
64
-
65
- **The memory-harvest agent judges.** It reads pending notes and applies the
66
- promotion bar:
67
-
68
- > Promote only what is durable and would change what a future instance of
69
- > this soul does.
70
-
71
- For each note it chooses one outcome:
72
-
73
- | Outcome | Meaning |
21
+ | Surface | Purpose |
74
22
  |---|---|
75
- | Promote | Move it into the right soul knowledge section, or into a soul skill if it is procedural. |
76
- | Merge | Fold it into an existing concept or skill. |
77
- | Drop | Delete it and log why it failed the bar. |
78
-
79
- This separation keeps working agents from overthinking memory, and gives
80
- promotion the deliberate attention it deserves.
81
-
82
- ## Why instance memory and soul memory differ
83
-
84
- Instance memory is indexical. It talks about this task, this branch, this
85
- moment, this blocker. That is why it lives in `STATE.md`, `log.md`, and
86
- `notes/`.
87
-
88
- Soul memory must be incarnation-invariant. It should remain true for future
89
- instances, future models, and future sessions. A future instance should be
90
- able to read a concept and act differently because of it.
91
-
92
- Harvest is the conversion between the two. Notes are where an instance tries
93
- to phrase what it learned without "I, here, now". The harvester checks
94
- whether that conversion succeeded.
95
-
96
- ## OKF concept types
97
-
98
- OKF itself does not prescribe one vocabulary. OATS conventions use these
99
- common types:
100
-
101
- | Type | Usual home | Meaning |
102
- |---|---|---|
103
- | `Instance State` | `STATE.md` | Current working state. Rewritten, not superseded. |
104
- | `Finding` | `notes/` | A captured observation whose durability is unproven. |
105
- | `Lesson` | Soul knowledge | A durable behavior-changing conclusion. |
106
- | `Decision` | `notes/` or soul knowledge | A decision and its rationale. Task-local decisions stay in `STATE.md` or `log.md`. |
107
- | `Playbook` | Soul knowledge or soul skills | Repeatable steps. Procedure-shaped notes usually become skills. |
108
- | `Reference` | Soul knowledge | External truth or stable internal reference. |
109
-
110
- Souls start with core knowledge sections:
111
-
112
- - `lessons/`
113
- - `decisions/`
114
- - `playbooks/`
115
- - `references/`
116
-
117
- Souls can grow role-specific sections such as `architecture/`, `codebase/`, or
118
- `roadmap/`. Add a section when future instances of that soul need to navigate
119
- that kind of knowledge.
120
-
121
- ## What a working instance should do
122
-
123
- As you work:
124
-
125
- 1. Keep `STATE.md` accurate. A fresh session should be able to resume from
126
- its `# Next` section.
127
- 2. Append dated milestones and decisions to `log.md`.
128
- 3. Write non-obvious insights to `notes/` as one concept per file.
129
- 4. Before every commit, bring memory up to date.
130
- 5. Commit, then run `oats okf harvest` to send your notes to the soul.
131
-
132
- Do not hold back a note because you are unsure it is soul-grade. Capture
133
- first. The harvester judges.
23
+ | `soul/AGENTS.md`, `soul/skills/` | Curated specialist identity and procedures, reviewed as soul artifacts. |
24
+ | `soul/okf.json` | Stable owner ID and external `owns`/`reads` node references; no knowledge bytes. |
25
+ | External accepted bases | Durable OKF knowledge, either Git PR-only or a recoverable plain directory. |
26
+ | Instance `knowledge/` | Immutable accepted reader snapshot with `view.json` and `bases/<alias>/`. |
27
+ | Instance `STATE.md`, `log.md`, `notes/` | Rewritable task state, append-only milestones and captured insights. |
28
+ | External `stateDir` | Durable per-source evidence, frozen descriptors, runs, proposals and receipts. |
29
+ | Worker `work/` | Independent directory execution with staged bases and explicit judgment. |
30
+
31
+ The turn record is episodic evidence, not accepted expertise. OKF captures both
32
+ notes **and** attributed record content, then judges them separately from capture.
33
+ V2 never automatically edits soul skills; a procedure candidate may become an
34
+ external Playbook for separate human review.
35
+
36
+ ## Acquire, bind and provision explicitly
37
+
38
+ The authoritative distribution is [awebai/oats-okf](https://github.com/awebai/oats-okf),
39
+ whose `oats-package/oats-package.json` exports exactly
40
+ `oats-package/capabilities/oats-okf/`. The framework's `capabilities/oats-okf/`
41
+ is a bundled mirror, **not a self-contained Git distribution in the npm
42
+ artifact**: npm drops the source worker's `CLAUDE.md -> AGENTS.md` symlink.
43
+ Acquire the catalog Git payload; do not install a copied npm mirror as a local
44
+ package or repair missing aliases in installed artifacts.
45
+
46
+ With a released OATS >=0.23.0 kernel, acquire published OKF 2.0.0 from the
47
+ intended deployment configuration context in an operator shell without inherited
48
+ instance identity (an explicit `--soul` does not override an invoking instance's
49
+ saved settings). The explicit Git source works before and after the v0.23.1
50
+ framework catalog integration:
51
+
52
+ ```bash
53
+ oats install git:github.com/awebai/oats-okf@v2.0.0
54
+ oats trust oats.okf
55
+ oats use oats.okf --soul domain-expert --settings bindings-file=/absolute/config/okf-bindings.json
56
+ oats doctor --soul domain-expert --json
57
+ ```
58
+
59
+ Acquisition activates nothing. An existing lock remains exact until an explicit
60
+ `oats update oats.okf`; v1 operators must plan migration before that update.
61
+ Executable changes need review and renewed trust. Target only configured source
62
+ souls; the service worker need not itself receive the knowledge layer.
63
+
64
+ ### Bindings document
65
+
66
+ `bindings-file` must be an **absolute path**. Its capability-owned JSON is not a
67
+ new kernel configuration schema. Paths inside it resolve relative to the file's
68
+ directory, not the current working directory:
69
+
70
+ ```json
71
+ {
72
+ "version": 1,
73
+ "stateDir": "../durable-okf-state",
74
+ "cron": "*/15 * * * *",
75
+ "tz": "UTC",
76
+ "bases": {
77
+ "project": {
78
+ "id": "project-knowledge",
79
+ "kind": "git",
80
+ "repository": "https://github.com/example/project.git",
81
+ "root": "knowledge",
82
+ "acceptedBranch": "main",
83
+ "pr": {"repository": "example/project"}
84
+ },
85
+ "team": {
86
+ "id": "team-knowledge",
87
+ "kind": "directory",
88
+ "path": "../team-knowledge"
89
+ }
90
+ }
91
+ }
92
+ ```
93
+
94
+ - Git supports HTTPS, SSH and durable local repositories. `root: "."` selects
95
+ a dedicated knowledge repository. Initial PR delivery uses same-repository
96
+ branches with native `git`, `gh` and ordinary operator credentials. There is
97
+ no fork-routing or direct-write fallback.
98
+ - Directory custody needs no Git, `gh`, `.git` or fabricated repository.
99
+ A directory inside **any Git working tree**, even ignored, is rejected:
100
+ relabeling Git custody cannot bypass review.
101
+ - Use physical, non-symlinked, nonoverlapping paths. Keep state outside bases and
102
+ source homes/worktrees; keep the bindings file outside state and bases. Local
103
+ Git locators must not be disposable linked worktrees. Directory lock/journal
104
+ artifacts also must not overlap state, sources or another base.
105
+ - Settings are `bindings-file`, `harvest-runtime` (`pi`, `claude`, `codex`,
106
+ default `pi`), and optional `harvest-model`. Choose an installed, authenticated
107
+ worker runtime independently of the source; omitted models use that runtime's
108
+ configured default. V1 record-window settings are not v2 settings.
109
+
110
+ ### Owner and base descriptors
111
+
112
+ Each persistent soul declares `soul/okf.json`:
113
+
114
+ ```json
115
+ {"version":1,"owner":"domain-expert-stable-id","owns":["project/expert"],"reads":["project/steward","team/operations"]}
116
+ ```
117
+
118
+ The accepted project base declares `okf-base.json`:
119
+
120
+ ```json
121
+ {"version":1,"id":"project-knowledge","nodes":{"expert":{"path":"expert","owner":"domain-expert-stable-id"},"steward":{"path":"steward","owner":"steward-stable-id"}}}
122
+ ```
123
+
124
+ The team base similarly declares its ID and `operations` node. Nodes are
125
+ nonoverlapping subdirectories with an `index.md` and `log.md`; each has one stable
126
+ owner. Base roots have their own index and append-only log. Stable owner IDs must
127
+ not ambiguously identify different souls within one state namespace.
128
+
129
+ `owns` means responsibility and write routing; `reads` means initial context.
130
+ **Neither is an ACL.** All configured bases are discoverable/readable. Missing
131
+ bindings, owner declarations, base metadata or indexes fail required spawn rather
132
+ than silently bootstrapping empty knowledge.
133
+
134
+ Provisioning is an explicit operator action. Prepare node-map files (the
135
+ `nodes` object above, without its wrapper), then:
136
+
137
+ ```bash
138
+ # New directory base: refuses an existing destination.
139
+ oats okf init --base team --nodes /absolute/config/team-nodes.json --confirm --soul domain-expert --json
140
+ # Git: writes an operator proposal, never pushes or claims acceptance.
141
+ oats okf init --base project --nodes /absolute/config/project-nodes.json --output /absolute/new-bundle-stage --soul domain-expert --json
142
+ ```
143
+
144
+ Put the Git proposal at the configured root in an operator-owned checkout and
145
+ review/merge it through a PR before spawning working sources. Existing ownership
146
+ changes require an explicit reviewed operator change, not harvest. The standalone
147
+ capability includes JSON Schemas; filesystem containment, ownership and full OKF
148
+ validation remain additional runtime checks.
149
+
150
+ ## Working-agent reads and capture
151
+
152
+ At session start, after compaction and on resume, read `STATE.md` and the relevant
153
+ knowledge indexes. `knowledge/view.json` identifies each base's relative path,
154
+ digest and Git accepted head. Content lives under `knowledge/bases/<alias>/`.
155
+ Follow relevant links only; do not bulk-load bases. A link `/expert/decision.md`
156
+ is rooted in **that base**, not filesystem `/`. Consult prior decisions before
157
+ re-deriving them and cite base/node/concept paths.
158
+
159
+ **Working agents never write accepted knowledge or soul knowledge.** This is an
160
+ instruction boundary, not an OS sandbox; tools still have the operator's access.
161
+ Snapshots are immutable by protocol, not live mounts. For current accepted text:
162
+
163
+ ```bash
164
+ # From the source home:
165
+ oats okf read --base project --path expert/index.md --json
166
+ oats okf refresh --json
167
+ # From the deployment context, even after source retirement:
168
+ oats okf read --source /absolute/state/sources/UUID/source.json --base project --path expert/index.md --soul domain-expert --json
169
+ oats okf refresh --source /absolute/state/sources/UUID/source.json --soul domain-expert --json
170
+ ```
171
+
172
+ Home-selected commands create a new `knowledge-view-<uuid>/` in that home.
173
+ **Every `--source` read/refresh** places its view under
174
+ `<stateDir>/sources/<source-id>/views/`, even while the source is live. It never
175
+ writes a cache into the invoking repository, a retired home or a replacement
176
+ home. Results identify the actual path and provider receipts. Choose `--home`
177
+ or `--source`, not both. `read` returns full Markdown text; it has no preview cap.
178
+
179
+ A Git PR is not accepted until its merge is visible on the accepted branch.
180
+ Directory reads hold the cooperative publication lock while copying; a pending
181
+ journal blocks fresh views, not existing snapshots. All bases and references
182
+ validate before a view is published. Old views remain available; there is no
183
+ automatic garbage collection.
184
+
185
+ Working agents keep state current, append milestones and capture non-obvious
186
+ insights as Markdown notes with provenance. They are not instructed to run a
187
+ harvest after commits or taught worker mechanics. Capture should be cheap;
188
+ importance is the independent judge's decision.
189
+
190
+ ## Durable evidence and retirement
191
+
192
+ Required spawn registers a random source ID outside the home; the home retains
193
+ only a pointer. The durable descriptor freezes bindings, owner destinations,
194
+ source role and allowlisted provenance, not credentials or wholesale launch
195
+ metadata. State includes:
196
+
197
+ ```text
198
+ <stateDir>/owners.json
199
+ <stateDir>/sources/<uuid>/source.json
200
+ <stateDir>/sources/<uuid>/status.json
201
+ <stateDir>/sources/<uuid>/inputs/<hash>.json
202
+ <stateDir>/sources/<uuid>/runs/<uuid>/
203
+ <stateDir>/sources/<uuid>/views/
204
+ <stateDir>/migrations/<uuid>/
205
+ ```
206
+
207
+ Every capture includes content-versioned **notes AND record**. Changed live notes
208
+ remain untouched. Through the supported `OATS_CLI_BIN` boundary, capture uses
209
+ native `capture --home`, then `recall --ids-only` byte metadata to plan bounded
210
+ windows before fetching full text. Full returned record text is copied into
211
+ custody, not saved as commands that still need the source home. Privacy-excluded
212
+ sessions remain excluded; raw excluded transcripts are not copied.
213
+
214
+ Final capture drains the visible backlog before certifying custody. The capture
215
+ budget is 85 seconds; timeouts, holds, skips, malformed/incomplete records or a
216
+ single turn over 1 MiB fail closed and retain the source home for retry rather
217
+ than truncate evidence. A genuinely empty record is reported honestly.
218
+ Retirement captures/enqueues; **it does not wait for a model or GitHub**.
219
+ After successful custody transfer the home may disappear while judgment and
220
+ publication continue. Unexpected disappearance leaves existing evidence usable
221
+ but reports `finalCaptureUncertified`, not fictitious final capture success.
222
+ Durable evidence has no automatic deletion.
223
+
224
+ One scheduler **command job per source** runs from stable deployment context,
225
+ using the durable descriptor and source soul selector. Dispatch remains activation
226
+ and trust gated after retirement, without inheriting another instance's identity.
227
+ Registration idempotently creates/verifies the job; setup failures are retryable,
228
+ and disabled jobs are not silently re-enabled. No host timer is installed without
229
+ explicit operator consent. See [schedules](schedules.md#okf-v2-source-jobs).
230
+
231
+ ## Independent judgment and delivery
232
+
233
+ A worker uses **`work: directory`**, never an attached source tree. It stages
234
+ `work/bases/<alias>/` independently of the source branch, runtime and lifetime.
235
+ It reads durable `input.json` and `staging.json`, edits only owned staged nodes
236
+ and allowed navigation, and writes `judgment.json`. A scaffold-only request
237
+ stops before any model launch. Service agents do not register/capture themselves;
238
+ no-launch sources cannot cause scheduled model launches.
239
+
240
+ OKF's two-part promotion test is: would a future instance act differently, **and**
241
+ could it not discover this by reading the repository? Decisions and rationale,
242
+ rejected alternatives, discovered limits and owned/freshness-marked slow state
243
+ qualify. Code descriptions, task residue, secrets and verbatim third-party
244
+ messages do not. Preserve explicit human acceptance evidence instead of
245
+ re-judging accepted decisions. These are OKF choices, not kernel-wide doctrine.
246
+
247
+ Each input gets `promote`, `merge` or `drop`, a reason and actual concept paths.
248
+ Concepts cite input hashes and record turn IDs. Completion validates ownership,
249
+ base navigation/history, full OKF conformance, baseline, provenance and explicit
250
+ judgment; credential-shaped output checks do not replace human/model judgment.
251
+ Deleting a staged concept requires an explicit removal reason. Workers never
252
+ edit live notes, accepted bases or soul skills themselves.
253
+
254
+ | Provider | Successful delivery |
255
+ |---|---|
256
+ | Git | Verified content delta, real commit/push and same-repository PR through native `git`/`gh`. No force push, source-branch commit or direct fallback. Merge-visible acceptance is separate from PR delivery. |
257
+ | Directory | Durable proposal, cooperative base lock, baseline comparison, publication journal, file-by-file atomic replacement and full validation/digest receipt. Pending publication blocks fresh reads. No Git dependency. |
258
+
259
+ Directory recovery is single-host cooperative recovery, not a distributed
260
+ transaction. Multiple destinations can be partially delivered with separate
261
+ receipts. Inputs are processed only when required destinations resolve. All-drop
262
+ or no-change judgment can be successful without inventing a PR. Enqueue, worker
263
+ spawn and command exit alone are not successful learning.
264
+
265
+ ## Inspection and operator commands
266
+
267
+ Run home-local commands from that source home. For cross-source or retired-source
268
+ commands, use the durable deployment context in a clean operator shell without
269
+ another instance's `OATS_*`/`PI_*` identity; select the configured source soul.
270
+
271
+ ```bash
272
+ # Read-only; no capture, refresh, scheduling or worker launch:
273
+ oats okf inspect --home /absolute/instance-home --json
274
+ oats operation run knowledge:inspect --home /absolute/instance-home --json
275
+ # Durable source selection after the home disappears:
276
+ oats okf inspect --source /absolute/state/sources/UUID/source.json --soul domain-expert --json
277
+ # Explicit manual request; --no-launch still captures and creates a worker scaffold:
278
+ oats okf harvest --no-launch --json
279
+ oats okf run-source --source /absolute/state/sources/UUID/source.json --manual --no-launch --soul domain-expert --json
280
+ ```
281
+
282
+ `inspect` reports frozen `owns`, `reads`, `bases`, the registered `acceptedView`
283
+ (not a fresh accepted-branch read), durable capture/processing/delivery/acceptance
284
+ receipts and scheduler health. `status.lastCapture` is the last attempt, not
285
+ proof the source is still present.
286
+
287
+ For a **live identity-matching source**, `documents` includes labeled Markdown:
288
+ `Working state (STATE.md)`, `Log (log.md)` and sorted `Pending note: <name>`
289
+ entries, including nested notes. Missing documents are omitted. A
290
+ `Durable processing receipts` text document follows. `liveMemory` supplies
291
+ `available`, `reason` and `observedAt`. Retired, missing, reused or unverified
292
+ homes expose only durable documents, with an explicit reason. Inspection checks
293
+ the source pointer and any instance metadata before and after reading; it rejects
294
+ unsafe live files/symlinks/hard links instead of returning a partial success.
295
+ Unsafe home identity withholds live memory but retains durable inspection. This
296
+ is a best-effort live observation, not a locked multi-file snapshot.
297
+
298
+ Inspection retains the **explicit 256 KiB per-document preview cap**. Larger
299
+ documents report `truncated: true` and original `bytes`; smaller documents are
300
+ byte-exact. The **whole JSON envelope drains through stdout**, even with large
301
+ receipts or multiple Markdown documents. Do not confuse this labeled preview
302
+ with evidence capture or `read`: those preserve full returned text.
303
+
304
+ Completion uses the worker's generated, safely quoted command:
305
+
306
+ ```bash
307
+ oats okf complete --source /absolute/state/sources/UUID/source.json --run RUN_UUID --judgment /absolute/worker/work/judgment.json --soul domain-expert --json
308
+ oats okf retry --source /absolute/state/sources/UUID/source.json --soul domain-expert --json
309
+ ```
310
+
311
+ Retry preserves uncertain delivery. `--launch` explicitly starts a ready worker;
312
+ `--rejudge` preserves old proposals and refreshes only outstanding destinations,
313
+ never redelivering settled ones. A pending directory journal must recover, not
314
+ be removed to force rejudgment. After a PR merges, repeat `complete` for the
315
+ same source/run without `--judgment` to reconcile acceptance. If launch status
316
+ is unknown, inspect the worker session before retrying. See the
317
+ [standalone runtime guide](https://github.com/awebai/oats-okf#independent-worker-and-completion)
318
+ for exact recovery, adoption and lock-release procedures.
134
319
 
135
320
  ## Without a knowledge integration
136
321
 
137
- `knowledge: none` is valid. The agent gets no OATS memory files, no memory
138
- briefing, no harvest agent, and no OKF skills. It may still use whatever
139
- memory conventions the repo or harness already provides.
322
+ `capabilities.layers.knowledge: none` is valid. The kernel creates no OKF state,
323
+ notes, bundle or harvest flow. Other capabilities may adopt, adapt or replace
324
+ the reference model; they do not inherit OKF's directories or judge. Native
325
+ record capture remains a separate surface. Selecting `none` is not a data
326
+ migration and does not erase existing memory.