@awebai/oats 0.23.1 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/README.md +7 -4
  2. package/bin/oats-pi-sdk-host.mjs +17 -0
  3. package/bin/oats.mjs +442 -51
  4. package/capabilities/oats-okf/bin/oats-okf-binding.mjs +14 -0
  5. package/capabilities/oats-okf/bin/oats-okf.mjs +79 -11
  6. package/capabilities/oats-okf/lib/binding-wire.mjs +268 -0
  7. package/capabilities/oats-okf/lib/captured-worker.mjs +101 -0
  8. package/capabilities/oats-okf/lib/config.mjs +2 -1
  9. package/capabilities/oats-okf/lib/inspection.mjs +16 -1
  10. package/capabilities/oats-okf/lib/invocation-context.mjs +111 -0
  11. package/capabilities/oats-okf/lib/invocation-shape.mjs +135 -0
  12. package/capabilities/oats-okf/lib/io.mjs +1 -1
  13. package/capabilities/oats-okf/lib/portable-binding.mjs +199 -0
  14. package/capabilities/oats-okf/lib/source-contract.mjs +46 -0
  15. package/capabilities/oats-okf/lib/sources.mjs +123 -3
  16. package/capabilities/oats-okf/lib/stores.mjs +104 -25
  17. package/capabilities/oats-okf/lib/worker.mjs +69 -10
  18. package/capabilities/oats-okf/oats.json +35 -7
  19. package/capabilities/oats-okf/schemas/okf-portable-declaration.schema.json +87 -0
  20. package/capabilities/oats-okf/schemas/okf-portable-payload.schema.json +113 -0
  21. package/capabilities/oats-okf/skills/memory-harvest/SKILL.md +23 -5
  22. package/capabilities/oats-okf/skills/okf/SKILL.md +42 -1
  23. package/docs/artifact-approvals.schema.json +7 -0
  24. package/docs/capability-manifest.schema.json +37 -66
  25. package/docs/captured-invocation-context.schema.json +7 -0
  26. package/docs/captured-resolution.schema.json +7 -0
  27. package/docs/design/2026-09-14-artifact-retention-contract.md +190 -0
  28. package/docs/design/2026-09-14-portable-souls-and-git-workspaces.md +708 -0
  29. package/docs/design/2026-09-14-portable-souls-contract-amendments.md +85 -0
  30. package/docs/design/2026-09-14-portable-souls-explainer.md +750 -0
  31. package/docs/design/2026-09-15-captured-dispatch.md +127 -0
  32. package/docs/design/2026-09-15-captured-resolution-records.md +143 -0
  33. package/docs/design/2026-09-15-package-preparation.md +100 -0
  34. package/docs/design/2026-09-15-portable-data-contract.md +121 -0
  35. package/docs/design/2026-09-15-portable-declarations.md +189 -0
  36. package/docs/design/2026-09-15-portable-souls-handoff.md +150 -0
  37. package/docs/design/2026-09-15-portable-souls-implementation.md +417 -0
  38. package/docs/design/2026-09-15-selection-lock-and-approval.md +122 -0
  39. package/docs/design/2026-09-15-source-observation.md +119 -0
  40. package/docs/design/2026-09-16-captured-admission.md +77 -0
  41. package/docs/design/2026-09-16-captured-helper-dispatch.md +105 -0
  42. package/docs/design/2026-09-16-captured-launch-inputs.md +42 -0
  43. package/docs/design/2026-09-16-command-profile-preparation.md +86 -0
  44. package/docs/design/2026-09-16-fresh-install-first-rollout.md +47 -0
  45. package/docs/design/2026-09-16-fresh-operator-walkthrough.md +277 -0
  46. package/docs/design/2026-09-16-knowledge-capability-contract.md +61 -0
  47. package/docs/design/2026-09-16-messaging-capability-contract.md +59 -0
  48. package/docs/design/2026-09-16-portable-migration-evidence.md +156 -0
  49. package/docs/design/2026-09-16-portable-onboarding.md +177 -0
  50. package/docs/design/2026-09-16-prepare-request-transport.md +26 -0
  51. package/docs/design/2026-09-16-provider-binding-codecs.md +98 -0
  52. package/docs/design/2026-09-16-provider-binding-wire.md +247 -0
  53. package/docs/design/2026-09-17-capability-helper-input-contract.md +95 -0
  54. package/docs/design/2026-09-17-captured-backend-parity.md +53 -0
  55. package/docs/design/2026-09-17-captured-native-start.md +58 -0
  56. package/docs/design/2026-09-17-portable-boundary-hookup.md +19 -0
  57. package/docs/design/2026-09-17-portable-boundary-resources.md +52 -0
  58. package/docs/design/2026-09-17-public-captured-start.md +108 -0
  59. package/docs/design/2026-09-17-public-prepare-request.md +90 -0
  60. package/docs/design/2026-09-18-captured-pi-host.md +205 -0
  61. package/docs/design/2026-09-18-first-cut-release-checklist.md +131 -0
  62. package/docs/design/2026-09-18-herdr-protocol-compatibility.md +60 -0
  63. package/docs/desktop-cli-api.md +5 -2
  64. package/docs/execution-capsule.schema.json +108 -0
  65. package/docs/execution-targets.md +20 -7
  66. package/docs/oats-lock-v3.schema.json +7 -0
  67. package/docs/oats-member.schema.json +38 -0
  68. package/docs/oats-workspace.schema.json +68 -0
  69. package/docs/portable.schema.json +2512 -0
  70. package/docs/provider-check-input.schema.json +7 -0
  71. package/docs/release-notes/v0.23.2.md +49 -0
  72. package/docs/release-notes/v0.24.0.md +104 -0
  73. package/docs/schedules.md +126 -14
  74. package/docs/soul.schema.json +82 -0
  75. package/injects/oats-portable.md +17 -0
  76. package/injects/portable-instance-boundary.md +39 -0
  77. package/injects/portable-work-directory.md +29 -0
  78. package/lib/artifact-approvals.mjs +120 -0
  79. package/lib/artifact-tree.mjs +141 -0
  80. package/lib/capability-artifacts.mjs +179 -0
  81. package/lib/capability-execution.mjs +15 -0
  82. package/lib/capability-inputs.mjs +39 -0
  83. package/lib/capability-provenance.mjs +231 -0
  84. package/lib/captured-action-shape.mjs +21 -0
  85. package/lib/captured-admission-shape.mjs +20 -0
  86. package/lib/captured-binding-file.mjs +36 -0
  87. package/lib/captured-dispatch.mjs +66 -0
  88. package/lib/captured-instance-index.mjs +277 -0
  89. package/lib/captured-invocation-context.mjs +130 -0
  90. package/lib/captured-launch-request.mjs +46 -0
  91. package/lib/captured-operation-process.mjs +15 -0
  92. package/lib/captured-pi-custody.mjs +29 -0
  93. package/lib/captured-pi-host.mjs +167 -0
  94. package/lib/captured-pi-outcome.mjs +172 -0
  95. package/lib/captured-resolutions.mjs +275 -0
  96. package/lib/captured-scaffold.mjs +87 -0
  97. package/lib/captured-selector.mjs +28 -0
  98. package/lib/captured-session-backend.mjs +52 -0
  99. package/lib/captured-source-receipt-file.mjs +72 -0
  100. package/lib/config-data.mjs +104 -0
  101. package/lib/core.mjs +918 -562
  102. package/lib/errors.mjs +7 -0
  103. package/lib/helper-injection-policy.mjs +98 -0
  104. package/lib/herdr.mjs +18 -7
  105. package/lib/instruction-composition.mjs +31 -0
  106. package/lib/legacy-lock-codec.mjs +106 -0
  107. package/lib/manifest-settings.mjs +84 -0
  108. package/lib/package-closure.mjs +48 -0
  109. package/lib/package-materialization.mjs +83 -0
  110. package/lib/pi-sdk-host.mjs +229 -0
  111. package/lib/portable-artifacts.mjs +115 -0
  112. package/lib/portable-choices.mjs +82 -0
  113. package/lib/portable-composition.mjs +136 -0
  114. package/lib/portable-digest.mjs +105 -0
  115. package/lib/portable-files.mjs +26 -0
  116. package/lib/portable-identity.mjs +40 -0
  117. package/lib/portable-lock.mjs +117 -0
  118. package/lib/portable-migration-artifacts.mjs +135 -0
  119. package/lib/portable-migration-evidence.mjs +305 -0
  120. package/lib/portable-migration-store.mjs +199 -0
  121. package/lib/portable-migration.mjs +104 -0
  122. package/lib/portable-onboarding-acceptance.mjs +66 -0
  123. package/lib/portable-onboarding-request.mjs +49 -0
  124. package/lib/portable-onboarding.mjs +230 -0
  125. package/lib/portable-package-preparation.mjs +188 -0
  126. package/lib/portable-policy.mjs +44 -0
  127. package/lib/portable-shape.mjs +35 -0
  128. package/lib/portable-soul.mjs +38 -0
  129. package/lib/portable-state.mjs +80 -0
  130. package/lib/portable-values.mjs +181 -0
  131. package/lib/prepare-composition.mjs +151 -0
  132. package/lib/prepared-bindings.mjs +78 -0
  133. package/lib/prepared-resources.mjs +127 -0
  134. package/lib/provider-binding-broker.mjs +59 -0
  135. package/lib/provider-binding-wire.mjs +110 -0
  136. package/lib/provider-binding.mjs +22 -0
  137. package/lib/repository-observation.mjs +226 -0
  138. package/lib/resolution-shape.mjs +393 -0
  139. package/lib/schedule-capsule.mjs +206 -0
  140. package/lib/schedule.mjs +259 -38
  141. package/lib/servers.mjs +15 -0
  142. package/lib/soul-constraints.mjs +40 -0
  143. package/lib/source-projection.mjs +84 -0
  144. package/lib/source-spec.mjs +189 -0
  145. package/lib/workspace-definition.mjs +126 -0
  146. package/lib/workspace-discovery.mjs +146 -0
  147. package/package-catalog.json +1 -1
  148. package/package.json +3 -2
  149. package/packages/record/lib/capture-cc.mjs +14 -6
  150. package/packages/record/lib/formats.mjs +14 -3
  151. package/packages/record/lib/native-history.mjs +277 -7
  152. package/packages/record/lib/session-snapshot.mjs +25 -5
  153. package/packages/record/lib/sessions-for-home.mjs +30 -13
  154. package/skills/oats/SKILL.md +12 -7
  155. package/skills/oats-config/SKILL.md +12 -9
  156. package/skills/oats-packages/SKILL.md +12 -8
  157. package/skills/oats-portable/SKILL.md +116 -0
  158. package/skills/oats-portable-artifacts/SKILL.md +63 -0
  159. package/skills/oats-portable-setup/SKILL.md +69 -0
@@ -1,16 +1,20 @@
1
1
  ---
2
2
  name: oats-packages
3
3
  description: >-
4
- How to acquire, lock, restore, trust, update, remove, and migrate OATS
5
- distribution packages with the oats CLI. Use for package sources (git/local/
6
- official catalog), oats-lock.json v2, all-or-nothing scope migration, exact restore,
7
- per-capability executable trust, runtime dependency closures, or package
8
- doctor failures. Triggers: "install a package", "oats install", "oats list",
9
- "oats update", "oats remove", "oats migrate", "oats trust", "lockfileVersion",
10
- "integrity drift", "package won't restore".
4
+ Use only for legacy uncaptured OATS package acquisition and mutable installed
5
+ store operations: oats install/update/remove, lock v1/v2, restore, migration,
6
+ and legacy trust. Triggers: "legacy package", "uncaptured oats install",
7
+ "oats-lock v2", or "legacy migration". For retained artifact-set/resolution
8
+ approval and diagnostics, load oats-portable-artifacts instead.
11
9
  ---
12
10
 
13
- # OATS distribution packages
11
+ # Legacy uncaptured OATS distribution packages
12
+
13
+ > **Legacy-only procedure.** The mutable installed store and lock v1/v2 flows
14
+ > below prepare uncaptured deployments. They are not authority for an existing
15
+ > captured resolution. Use **oats-portable-artifacts** for exact retained
16
+ > inspection/approval; never restore or advance captured code through today's
17
+ > lock or installed capability directory.
14
18
 
15
19
  A **package** is the install/update/review unit: one git repo (or local dir)
16
20
  with an `oats-package.json` exporting one or more **capabilities** (the
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: oats-portable
3
+ description: >-
4
+ Use when operating a newly prepared captured OATS instance, invoking an exact
5
+ retained command or provider operation, inspecting its immutable composition,
6
+ creating an explicit fresh scaffold, or starting its captured native session.
7
+ Triggers: "captured OATS",
8
+ "portable soul", "resolution ID", "exact retained command", "fresh captured
9
+ spawn". Do not use for legacy config-chain deployments.
10
+ ---
11
+
12
+ # Operating a captured OATS instance
13
+
14
+ A captured instance executes one immutable managed composition identified by an
15
+ explicit deployment and resolution. Its source soul, adopter alias, capability
16
+ artifacts, settings, provider bindings, curriculum, helpers, and executable
17
+ resources come from that record—not from the current checkout or config chain.
18
+ Credentials, provider readiness, memberships, knowledge contents, the work target,
19
+ and host tools remain separately checked mutable inputs.
20
+
21
+ ## Authority checklist
22
+
23
+ 1. Read `instance.json.executionBinding` for the exact deployment and resolution.
24
+ 2. Pass both selectors together. Never infer either from cwd, a source path, a
25
+ package lock, an OS user, or another instance.
26
+ 3. If the record, retained resource, approval, binding, or host requirement is
27
+ missing or invalid, stop. Do not retry through an unqualified legacy command.
28
+ 4. Treat `responsibleHuman: null` only as explicit messaging-disabled state. It
29
+ is not an anonymous human or a private-team identity.
30
+
31
+ ## Implemented commands
32
+
33
+ ```bash
34
+ oats inspect --deployment <absolute-deployment> --resolution <sha256-id> --json
35
+ oats inspect --deployment <absolute-deployment> --resolution <sha256-id> --composition --json
36
+ oats <namespace> <command> --deployment <absolute-deployment> --resolution <sha256-id> -- [provider-args]
37
+ oats operation run <knowledge|messaging|tasks>:<name> \
38
+ --deployment <absolute-deployment> --resolution <sha256-id> \
39
+ [--home <absolute-instance-home>] [--arg name=value ...] --json
40
+ ```
41
+
42
+ For capability helpers, inspect the source's captured helper map and resolve one
43
+ exact key before selecting a helper record:
44
+
45
+ ```bash
46
+ oats inspect --deployment <source-deployment> --resolution <source-id> \
47
+ --helper <exact-map-key> --composition --json
48
+ ```
49
+
50
+ Keep `sourceExecutionBinding` for provider completion commands and the returned
51
+ `executionBinding` for the helper. Do not complete through a worker's inherited
52
+ selector or use legacy helper-name discovery. Helper inspection is not worker
53
+ launch; use the staged public start below and retain its actual dispatch result.
54
+
55
+ A fresh captured directory scaffold is available only with explicit placement
56
+ and no launch:
57
+
58
+ ```bash
59
+ oats spawn <captured-subject> \
60
+ --deployment <absolute-deployment> --resolution <sha256-id> \
61
+ --home <absolute-new-home> --no-launch --json
62
+ ```
63
+
64
+ The subject must match the retained soul alias or helper name. The home must be
65
+ new and its parent physical. This command materializes retained instructions and
66
+ skills, creates owned directory work, and runs captured spawn hooks. It does not
67
+ select a work repository, launch a model, or infer a team.
68
+
69
+ ## Start the owned captured home
70
+
71
+ After the explicit scaffold/hooks stage, start using the same retained authority:
72
+
73
+ ```bash
74
+ oats session start --deployment <absolute-deployment> --resolution <sha256-id> \
75
+ --home <owned-home> --request <absolute-native-request-json> --json
76
+ ```
77
+
78
+ The native request is a closed object, for example:
79
+
80
+ ```json
81
+ {"schemaVersion":1,"backend":{"backend":"tmux","binary":"/absolute/tmux","socket":"/absolute/socket","session":"captured"},"task":"Explicit task"}
82
+ ```
83
+
84
+ For Herdr, replace only `backend` with
85
+ `{"backend":"herdr","binary":"/absolute/herdr","socket":"/absolute/herdr.sock","protocol":20}`.
86
+ Use an explicit existing operator-managed socket; this route never starts a
87
+ Herdr daemon or falls back to tmux. Actual workspace/pane/terminal IDs arrive in
88
+ the receipt after allocation, never from caller naming. API discovery advertises
89
+ `oats.captured-session@2` with both backends and `readiness:not-checked`.
90
+
91
+ Runtime/model/yolo come from the capture, never this request. Optional
92
+ `stopGraceMs` is bounded 1–300000. No env/io/credential/provider/config fields.
93
+ For an already scaffolded helper, pass the SOURCE selectors and add
94
+ `--helper <exact-map-key>`; the home must match the returned dedicated helper
95
+ binding. This revalidates the edge, not just a helper name.
96
+
97
+ Use `session restart` for a distinct restart request in the same incarnation.
98
+ Once stored, task/backend can be omitted to use owned values. Use
99
+ `--retry-intent <saved-executionId>` only for an explicit replay/retry of that
100
+ same logical request. An unknown Herdr allocation must remain held under its
101
+ saved intent; never repeat workspace creation or guess its IDs from a label.
102
+ Preserve `error.details.nativeCustody` and the indexed
103
+ pending identity on uncertainty; never allocate another home/ID to disguise it.
104
+ `dispatchAccepted` means native dispatch, not task completion/model health or
105
+ privacy. A completed receipt replay may return `replayed:true` instead.
106
+
107
+ ## Current refusal boundary
108
+
109
+ Captured wake/retire, unqualified managed runtime packages/contributions, extra
110
+ native arguments, non-directory work targets and backends other than tmux/Herdr
111
+ still refuse. Do not strip selectors or call legacy forms as a workaround. A scaffold marked `spawn-failed-cleanup-required`
112
+ may contain external hook effects; preserve it and escalate rather than deleting
113
+ it. A scaffold marked `spawned-launch-pending` is not a running instance.
114
+
115
+ Use **oats-portable-setup** for preparation and context choices. Use
116
+ **oats-portable-artifacts** for exact approval and retained A/B diagnostics.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: oats-portable-artifacts
3
+ description: >-
4
+ Use when inspecting or approving exact retained artifacts for a portable OATS
5
+ composition, reviewing approval-required preparation, comparing retained A/B
6
+ revisions, or diagnosing missing and damaged captured resources. Triggers:
7
+ "artifact set", "captured approval", "available unapproved", "retained
8
+ resolution", "source deleted". Do not use legacy mutable installed-store trust
9
+ as captured execution authority.
10
+ ---
11
+
12
+ # Captured artifacts and approvals
13
+
14
+ Retention, selection, and approval are distinct:
15
+
16
+ - Retention keeps exact source, capability, and resource trees.
17
+ - A captured resolution selects one immutable managed composition.
18
+ - Approval authorizes an exact executable capability artifact revision.
19
+ - Current provider/credential/host readiness is checked again per action.
20
+
21
+ Artifact presence is never approval. A newer available artifact does not replace
22
+ an existing captured instance's artifact, and "available" does not mean latest,
23
+ approved, or selected.
24
+
25
+ ## Implemented inspection and approval
26
+
27
+ Inspect one exact record without executing capability code:
28
+
29
+ ```bash
30
+ oats inspect --deployment <absolute-deployment> --resolution <sha256-id> --json
31
+ oats inspect --deployment <absolute-deployment> --resolution <sha256-id> --composition --json
32
+ ```
33
+
34
+ Approve a capability already selected by a complete captured record:
35
+
36
+ ```bash
37
+ oats trust <capability-id> \
38
+ --deployment <absolute-deployment> --resolution <sha256-id> --json
39
+ ```
40
+
41
+ When preparation cannot complete because provider codec execution itself needs
42
+ approval, approve the exact prospective artifact set:
43
+
44
+ ```bash
45
+ oats trust <capability-id> \
46
+ --deployment <absolute-deployment> --artifact-set <sha256-id> --json
47
+ ```
48
+
49
+ Both selectors are explicit local deployment addresses. Never look up a captured
50
+ artifact by capability ID in today's lock, current installed directory, catalog,
51
+ or source checkout.
52
+
53
+ ## Failure posture
54
+
55
+ - Missing retained input and damaged retained input are different failures.
56
+ - Damaged state is never repaired during dispatch.
57
+ - Approval cannot cross integrity formats or revisions.
58
+ - Source/config deletion must not change an existing record's selected bytes.
59
+ - Partial or unknown historical evidence is inspectable but never executable.
60
+ - No unattended approval, background refresh, or automatic advancement exists.
61
+
62
+ Use **oats-portable-setup** to create a new preparation transaction. Use
63
+ **oats-portable** to invoke the resulting exact record.
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: oats-portable-setup
3
+ description: >-
4
+ Use when preparing a source-complete portable soul for a fresh deployment,
5
+ selecting a workspace-advertised import, or reasoning about source,
6
+ deployment, work target, team, adoption, and provider-binding inputs. Triggers:
7
+ "oats prepare", "portable setup", "import soul by reference", "fresh OATS
8
+ deployment". Do not use legacy oats-config.yaml cascading as portable policy.
9
+ ---
10
+
11
+ # Preparing portable souls
12
+
13
+ Portable preparation has two policy authorities and one resolver:
14
+
15
+ 1. The soul supplies intrinsic hard requirements and rebindable defaults.
16
+ 2. The workspace supplies admission, workspace defaults, imports/adoption,
17
+ stores, team references, and catalogs.
18
+ 3. Explicit operator choices may rebind defaults and bindings but cannot erase
19
+ hard requirements.
20
+
21
+ There is no repository-default tier and no agent-type precedence in this model.
22
+ A package source, soul source, deployment/install location, work target, and team
23
+ membership are separate facts. Never derive one from another.
24
+
25
+ ## Implemented preparation
26
+
27
+ Prepare an explicit source export by reference:
28
+
29
+ ```bash
30
+ oats prepare \
31
+ --dir <absolute-deployment> \
32
+ --source <git-repository> --revision <selector> \
33
+ --export <exported-soul-path> --alias <local-alias> \
34
+ [--work directory] --json
35
+ ```
36
+
37
+ Prepare an alias advertised by an explicit workspace:
38
+
39
+ ```bash
40
+ oats prepare \
41
+ --dir <absolute-deployment> \
42
+ --workspace <git-repository> [--workspace-revision <selector>] \
43
+ --alias <advertised-alias> [--work directory] --json
44
+ ```
45
+
46
+ Preparation resolves one source observation, retains the required source and
47
+ software trees, resolves provider-owned nonsecret bindings through the same
48
+ choice engine, prepares dedicated compatible helpers, and publishes a complete
49
+ record before returning a resolution. It does not launch, enroll identities,
50
+ create teams, approve executables, or infer a publisher workspace.
51
+
52
+ ## Read the result correctly
53
+
54
+ - `resolution: null` means no executable captured record was published.
55
+ - `needs-configuration` identifies missing bindings/provider inputs; do not fill
56
+ them from current config.
57
+ - `approval-required` can accompany a complete retained record; approval remains
58
+ a separate explicit action.
59
+ - `responsibleHuman: null` means messaging is explicitly disabled.
60
+ - Helper-authored software, knowledge, team, or resource policy currently
61
+ requires dedicated preparation and refuses instead of inheriting the parent.
62
+
63
+ ## Not yet a public input
64
+
65
+ An explicit standalone context key, onboarding inspection facade, non-directory
66
+ work-target placement/setup, and managed launch/runtime capture are still being
67
+ integrated. Do not invent flags or derive a standalone key from a path, username,
68
+ source alias, or machine identity. A workspace context and standalone context are
69
+ mutually exclusive.