@awebai/oats 0.23.2 → 0.24.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.
- package/README.md +224 -391
- package/bin/oats-pi-sdk-host.mjs +17 -0
- package/bin/oats.mjs +470 -51
- package/capabilities/oats-okf/bin/oats-okf-binding.mjs +14 -0
- package/capabilities/oats-okf/bin/oats-okf.mjs +79 -11
- package/capabilities/oats-okf/lib/binding-wire.mjs +268 -0
- package/capabilities/oats-okf/lib/captured-worker.mjs +109 -0
- package/capabilities/oats-okf/lib/config.mjs +2 -1
- package/capabilities/oats-okf/lib/inspection.mjs +16 -1
- package/capabilities/oats-okf/lib/invocation-context.mjs +111 -0
- package/capabilities/oats-okf/lib/invocation-shape.mjs +135 -0
- package/capabilities/oats-okf/lib/io.mjs +1 -1
- package/capabilities/oats-okf/lib/portable-binding.mjs +199 -0
- package/capabilities/oats-okf/lib/source-contract.mjs +46 -0
- package/capabilities/oats-okf/lib/sources.mjs +123 -3
- package/capabilities/oats-okf/lib/stores.mjs +104 -25
- package/capabilities/oats-okf/lib/worker.mjs +69 -10
- package/capabilities/oats-okf/oats.json +35 -7
- package/capabilities/oats-okf/schemas/okf-portable-declaration.schema.json +87 -0
- package/capabilities/oats-okf/schemas/okf-portable-payload.schema.json +113 -0
- package/capabilities/oats-okf/skills/memory-harvest/SKILL.md +23 -5
- package/capabilities/oats-okf/skills/okf/SKILL.md +42 -1
- package/docs/artifact-approvals.schema.json +7 -0
- package/docs/capabilities.md +4 -0
- package/docs/capability-manifest.schema.json +37 -66
- package/docs/captured-invocation-context.schema.json +7 -0
- package/docs/captured-resolution.schema.json +7 -0
- package/docs/design/2026-09-14-artifact-retention-contract.md +190 -0
- package/docs/design/2026-09-14-portable-souls-and-git-workspaces.md +708 -0
- package/docs/design/2026-09-14-portable-souls-contract-amendments.md +85 -0
- package/docs/design/2026-09-14-portable-souls-explainer.md +750 -0
- package/docs/design/2026-09-15-captured-dispatch.md +127 -0
- package/docs/design/2026-09-15-captured-resolution-records.md +143 -0
- package/docs/design/2026-09-15-package-preparation.md +100 -0
- package/docs/design/2026-09-15-portable-data-contract.md +121 -0
- package/docs/design/2026-09-15-portable-declarations.md +189 -0
- package/docs/design/2026-09-15-portable-souls-handoff.md +150 -0
- package/docs/design/2026-09-15-portable-souls-implementation.md +417 -0
- package/docs/design/2026-09-15-selection-lock-and-approval.md +122 -0
- package/docs/design/2026-09-15-source-observation.md +119 -0
- package/docs/design/2026-09-16-captured-admission.md +77 -0
- package/docs/design/2026-09-16-captured-helper-dispatch.md +105 -0
- package/docs/design/2026-09-16-captured-launch-inputs.md +42 -0
- package/docs/design/2026-09-16-command-profile-preparation.md +86 -0
- package/docs/design/2026-09-16-fresh-install-first-rollout.md +47 -0
- package/docs/design/2026-09-16-fresh-operator-walkthrough.md +277 -0
- package/docs/design/2026-09-16-knowledge-capability-contract.md +61 -0
- package/docs/design/2026-09-16-messaging-capability-contract.md +59 -0
- package/docs/design/2026-09-16-portable-migration-evidence.md +156 -0
- package/docs/design/2026-09-16-portable-onboarding.md +177 -0
- package/docs/design/2026-09-16-prepare-request-transport.md +26 -0
- package/docs/design/2026-09-16-provider-binding-codecs.md +98 -0
- package/docs/design/2026-09-16-provider-binding-wire.md +247 -0
- package/docs/design/2026-09-17-capability-helper-input-contract.md +95 -0
- package/docs/design/2026-09-17-captured-backend-parity.md +53 -0
- package/docs/design/2026-09-17-captured-native-start.md +58 -0
- package/docs/design/2026-09-17-portable-boundary-hookup.md +19 -0
- package/docs/design/2026-09-17-portable-boundary-resources.md +52 -0
- package/docs/design/2026-09-17-public-captured-start.md +108 -0
- package/docs/design/2026-09-17-public-prepare-request.md +90 -0
- package/docs/design/2026-09-18-captured-pi-host.md +205 -0
- package/docs/design/2026-09-18-first-cut-release-checklist.md +131 -0
- package/docs/design/2026-09-18-herdr-protocol-compatibility.md +60 -0
- package/docs/design/2026-09-20-redesign-program-board.md +70 -0
- package/docs/design/2026-09-20-workspace-and-portable-adoption-plan.md +287 -0
- package/docs/design/2026-09-20-workspace-onboarding-public.md +124 -0
- package/docs/design/README.md +42 -0
- package/docs/desktop-cli-api.md +5 -2
- package/docs/execution-capsule.schema.json +108 -0
- package/docs/execution-targets.md +20 -7
- package/docs/first-team.md +1 -1
- package/docs/knowledge-theory.md +353 -111
- package/docs/knowledge.md +10 -1
- package/docs/layers.md +89 -354
- package/docs/oats-lock-v3.schema.json +7 -0
- package/docs/oats-member.schema.json +38 -0
- package/docs/oats-workspace.schema.json +68 -0
- package/docs/official-marketplace.md +79 -0
- package/docs/packages.md +4 -0
- package/docs/portable.schema.json +2512 -0
- package/docs/provider-check-input.schema.json +7 -0
- package/docs/release-notes/v0.24.0.md +104 -0
- package/docs/release-notes/v0.24.1.md +17 -0
- package/docs/schedules.md +126 -14
- package/docs/soul.schema.json +82 -0
- package/docs/souls-and-instances.md +20 -7
- package/docs/workspace-adoption.md +285 -0
- package/docs/workspaces.md +154 -0
- package/injects/oats-portable.md +16 -0
- package/injects/portable-instance-boundary.md +39 -0
- package/injects/portable-work-directory.md +29 -0
- package/lib/artifact-approvals.mjs +120 -0
- package/lib/artifact-tree.mjs +141 -0
- package/lib/capability-artifacts.mjs +179 -0
- package/lib/capability-execution.mjs +15 -0
- package/lib/capability-inputs.mjs +39 -0
- package/lib/capability-provenance.mjs +231 -0
- package/lib/captured-action-shape.mjs +21 -0
- package/lib/captured-admission-shape.mjs +20 -0
- package/lib/captured-binding-file.mjs +36 -0
- package/lib/captured-dispatch.mjs +66 -0
- package/lib/captured-instance-index.mjs +277 -0
- package/lib/captured-invocation-context.mjs +130 -0
- package/lib/captured-launch-request.mjs +46 -0
- package/lib/captured-operation-process.mjs +15 -0
- package/lib/captured-pi-custody.mjs +29 -0
- package/lib/captured-pi-host.mjs +167 -0
- package/lib/captured-pi-outcome.mjs +172 -0
- package/lib/captured-resolutions.mjs +275 -0
- package/lib/captured-scaffold.mjs +87 -0
- package/lib/captured-selector.mjs +28 -0
- package/lib/captured-session-backend.mjs +52 -0
- package/lib/captured-source-receipt-file.mjs +72 -0
- package/lib/config-data.mjs +104 -0
- package/lib/core.mjs +961 -566
- package/lib/errors.mjs +7 -0
- package/lib/helper-injection-policy.mjs +98 -0
- package/lib/herdr.mjs +18 -7
- package/lib/instruction-composition.mjs +31 -0
- package/lib/legacy-lock-codec.mjs +106 -0
- package/lib/manifest-settings.mjs +84 -0
- package/lib/package-closure.mjs +48 -0
- package/lib/package-materialization.mjs +83 -0
- package/lib/pi-sdk-host.mjs +229 -0
- package/lib/portable-artifacts.mjs +115 -0
- package/lib/portable-choices.mjs +82 -0
- package/lib/portable-composition.mjs +136 -0
- package/lib/portable-digest.mjs +105 -0
- package/lib/portable-files.mjs +26 -0
- package/lib/portable-identity.mjs +40 -0
- package/lib/portable-lock.mjs +117 -0
- package/lib/portable-migration-artifacts.mjs +135 -0
- package/lib/portable-migration-evidence.mjs +305 -0
- package/lib/portable-migration-store.mjs +199 -0
- package/lib/portable-migration.mjs +104 -0
- package/lib/portable-onboarding-acceptance.mjs +66 -0
- package/lib/portable-onboarding-request.mjs +49 -0
- package/lib/portable-onboarding.mjs +249 -0
- package/lib/portable-package-preparation.mjs +188 -0
- package/lib/portable-policy.mjs +44 -0
- package/lib/portable-shape.mjs +35 -0
- package/lib/portable-soul.mjs +38 -0
- package/lib/portable-state.mjs +80 -0
- package/lib/portable-values.mjs +181 -0
- package/lib/prepare-composition.mjs +151 -0
- package/lib/prepared-bindings.mjs +78 -0
- package/lib/prepared-resources.mjs +127 -0
- package/lib/provider-binding-broker.mjs +59 -0
- package/lib/provider-binding-wire.mjs +110 -0
- package/lib/provider-binding.mjs +22 -0
- package/lib/repository-observation.mjs +226 -0
- package/lib/resolution-shape.mjs +393 -0
- package/lib/schedule-capsule.mjs +206 -0
- package/lib/schedule.mjs +259 -38
- package/lib/servers.mjs +15 -0
- package/lib/soul-constraints.mjs +40 -0
- package/lib/source-projection.mjs +84 -0
- package/lib/source-spec.mjs +189 -0
- package/lib/workspace-definition.mjs +126 -0
- package/lib/workspace-discovery.mjs +146 -0
- package/package-catalog.json +2 -1
- package/package.json +3 -2
- package/packages/record/lib/capture-cc.mjs +14 -6
- package/packages/record/lib/formats.mjs +14 -3
- package/packages/record/lib/native-history.mjs +277 -7
- package/packages/record/lib/session-snapshot.mjs +25 -5
- package/packages/record/lib/sessions-for-home.mjs +30 -13
- package/skills/oats/SKILL.md +12 -7
- package/skills/oats-config/SKILL.md +11 -9
- package/skills/oats-packages/SKILL.md +12 -8
- package/skills/oats-portable/SKILL.md +115 -0
- package/skills/oats-portable-artifacts/SKILL.md +63 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Retained capability artifacts and captured resolutions
|
|
2
|
+
|
|
3
|
+
14 September 2026. Portable Souls implementation foundation, task `aweb-abiu`.
|
|
4
|
+
|
|
5
|
+
Package updates currently replace `.agents/capabilities/installed/<id>`.
|
|
6
|
+
Instance metadata records commands and resource paths into that mutable store.
|
|
7
|
+
Keeping a command string does not keep the implementation that string invokes.
|
|
8
|
+
|
|
9
|
+
This first patch adds **retention primitives only**, in
|
|
10
|
+
`lib/capability-artifacts.mjs`. It does not change the installer, lock schema,
|
|
11
|
+
instance launch, scheduler or lifecycle dispatch. Existing instances are not
|
|
12
|
+
protected from package updates by this patch. The following integration contract
|
|
13
|
+
must be reviewed before those consumers change.
|
|
14
|
+
|
|
15
|
+
## Responsibilities
|
|
16
|
+
|
|
17
|
+
- Acquisition resolves sources and materializes a package's declared resources.
|
|
18
|
+
- Retention publishes a verified capability tree under its exact integrity.
|
|
19
|
+
- Resolution selects one artifact per capability ID and records effective inputs.
|
|
20
|
+
- Approval authorizes the selected executable revision, independently of retention.
|
|
21
|
+
- Dispatch uses the captured resolution, including for retirement and queued work.
|
|
22
|
+
|
|
23
|
+
No soul, workspace, team or knowledge schema belongs in the storage primitive.
|
|
24
|
+
There is no new resolver or background service. The artifact includes materialized
|
|
25
|
+
runtime dependencies and its existing `.oats-installation.json` provenance.
|
|
26
|
+
|
|
27
|
+
## Storage API implemented in this patch
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
<deployment>/.agents/capabilities/artifacts/
|
|
31
|
+
.gitignore # managed file containing *
|
|
32
|
+
<capability-id>/
|
|
33
|
+
sha256-<full digest>/ # one retained capability tree
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`retainCapabilityArtifact(scope, sourceDir, capabilityId, lock)` accepts a
|
|
37
|
+
materialized capability and its captured package/capability lock maps. It checks
|
|
38
|
+
the locked integrity and generated provenance before publication and verifies
|
|
39
|
+
the copied tree again before renaming it into place. It returns the capability
|
|
40
|
+
ID, integrity, canonical local directory and `retained` or `kept` status.
|
|
41
|
+
|
|
42
|
+
`verifyRetainedCapability(scope, capabilityId, lock)` verifies the exact stored
|
|
43
|
+
revision against the captured provenance. It does not consult the scope's current
|
|
44
|
+
lock, source checkout, catalog, network or approval state.
|
|
45
|
+
|
|
46
|
+
An absent scope, store or revision reports `artifact-not-found`. A present but
|
|
47
|
+
invalid tree/store or a digest/provenance mismatch is a different refusal. Callers
|
|
48
|
+
can therefore distinguish missing inputs from damaged retained state without
|
|
49
|
+
parsing filesystem error messages. A damaged entry is never silently repaired.
|
|
50
|
+
|
|
51
|
+
`retainedCapabilityDir(scope, capabilityId, integrity)` computes the lexical path
|
|
52
|
+
after checking the ID and full digest. Computing a path is not verification.
|
|
53
|
+
|
|
54
|
+
Both publication and verification reject broken or escaping symlinks. Absolute
|
|
55
|
+
symlinks back into the original source are rejected too: that source may later
|
|
56
|
+
disappear. Internal relative symlinks retain their spelling. The source directory
|
|
57
|
+
is copied with the package engine's catchable copy routine, not linked or moved.
|
|
58
|
+
File permissions are preserved; this uses the existing artifact digest format,
|
|
59
|
+
which hashes file bytes and symlink targets, not Unix mode bits.
|
|
60
|
+
At the consumer-migration boundary, introduce a versioned digest covering file
|
|
61
|
+
bytes, symlink targets and each regular file's executable flag, normalized from
|
|
62
|
+
the owner-execute bit (`(mode & 0o100) !== 0`). Apply the same digest rule to Git
|
|
63
|
+
and local-path sources. Group/other execute bits depend on the acquiring user's
|
|
64
|
+
umask and are not part of artifact identity. This models execution by the
|
|
65
|
+
deployment operator who owns the materialized files; it is not a guarantee for
|
|
66
|
+
arbitrary other operating-system principals.
|
|
67
|
+
Keep the old format explicitly verifiable for pre-migration evidence; never
|
|
68
|
+
reinterpret an old digest as covering modes. Other mode bits remain outside
|
|
69
|
+
identity. Do not rewrite modes during retention or infer executable entrypoints
|
|
70
|
+
by parsing free-form command/hook strings. This format change is not implemented
|
|
71
|
+
by the current primitive.
|
|
72
|
+
|
|
73
|
+
An existing revision is verified and reused. A damaged existing tree is an error,
|
|
74
|
+
never an invitation to overwrite it. Publishing another revision leaves the first
|
|
75
|
+
alone. Same-filesystem staging and rename avoid partially published trees; normal
|
|
76
|
+
errors remove staging. Concurrent publication of an already present valid revision
|
|
77
|
+
may reuse it after verification. A process crash can leave dot-prefixed staging
|
|
78
|
+
for later explicit cleanup; it is never a selectable artifact. This is not a
|
|
79
|
+
power-loss durability or hostile-host isolation guarantee.
|
|
80
|
+
|
|
81
|
+
Retention creates its managed ignore before any payload. It does not change the
|
|
82
|
+
scope's config, current lock, approval flags or authored capability directories.
|
|
83
|
+
Empty store directories/ignore metadata may remain after failure. No artifact
|
|
84
|
+
garbage collection is implemented: conservative retention is intentional.
|
|
85
|
+
|
|
86
|
+
## Resolution and lock integration proposed next
|
|
87
|
+
|
|
88
|
+
Use a versioned per-instance resolution record, with a separate identifier from
|
|
89
|
+
runtime/session identity. It needs:
|
|
90
|
+
|
|
91
|
+
- Exact source soul reference and retained source revision.
|
|
92
|
+
- One selected artifact reference per capability ID, plus package provenance
|
|
93
|
+
sufficient to verify and, where possible, restore that artifact.
|
|
94
|
+
- Effective non-secret configuration, default/override provenance and binding
|
|
95
|
+
references, not secrets or a promise to freeze membership and credentials.
|
|
96
|
+
- Every managed helper, command/hook and runtime resource required for later
|
|
97
|
+
dispatch. Resource references resolve against retained artifact roots.
|
|
98
|
+
|
|
99
|
+
The following contract decisions incorporate the external expert's review:
|
|
100
|
+
|
|
101
|
+
- Imported and member-repository souls produce the same record shape: upstream
|
|
102
|
+
soul identity, exact retained source revision and adopter-local alias. Keep the
|
|
103
|
+
canonical repository and exported path in the source reference; the local alias
|
|
104
|
+
is not a global identity.
|
|
105
|
+
- Retain soul source artifacts separately from capability artifacts, under the
|
|
106
|
+
deployment, keyed by qualified source identity and content digest. Do not encode
|
|
107
|
+
a soul as a capability helper. A shared leaf module may implement the tree-copy,
|
|
108
|
+
digest and publication mechanics, with different provenance validation for each
|
|
109
|
+
kind. Retain all declared source resources needed after preparation, not just
|
|
110
|
+
`soul.yaml` or a symlink into the author's checkout.
|
|
111
|
+
Source retention inherits the same typed absence, invalid-shape and integrity
|
|
112
|
+
refusals, including never silently repairing a damaged retained tree.
|
|
113
|
+
- Store captured resolutions independently of instance homes so queued work can
|
|
114
|
+
retain a reference after its originating home is removed. Each instance and
|
|
115
|
+
independent execution references its exact resolution; conservative retention
|
|
116
|
+
applies to both source trees and resolution records.
|
|
117
|
+
- Record provenance per effective choice: a soul requirement/default, workspace
|
|
118
|
+
default, import-entry adoption default or explicit operator choice. Preserve the
|
|
119
|
+
hard constraints as well as the selected values.
|
|
120
|
+
- Record resolved non-secret provider bindings with separate credential references.
|
|
121
|
+
The default knowledge provider's payload includes store-qualified read nodes and
|
|
122
|
+
owned-node destinations. The kernel envelope does not require other knowledge
|
|
123
|
+
providers to implement OKF's owns/reads model.
|
|
124
|
+
- Record the responsible human/private-team key and chosen wider-team references
|
|
125
|
+
for messaging-enabled instances. These capture the choice, not immutable live
|
|
126
|
+
membership or permission to read earlier conversations.
|
|
127
|
+
- Existing-instance migration records `reconstructed`, `partial` or `unknown`
|
|
128
|
+
status with evidence and unresolved inputs. A partial or unknown record cannot
|
|
129
|
+
pass for a complete captured resolution in CLI or Desktop readiness.
|
|
130
|
+
|
|
131
|
+
The scope is an explicit deployment directory. A standalone repository or an
|
|
132
|
+
isolated user-data deployment uses the same store and APIs; no workspace Git
|
|
133
|
+
repository or parent-directory discovery is required by retention.
|
|
134
|
+
|
|
135
|
+
The deployment lock records current choices for new preparation. A captured
|
|
136
|
+
resolution is the authority for its instance or queued work; it must not look up
|
|
137
|
+
an older package row by ID in today's lock and accidentally acquire a new one.
|
|
138
|
+
The wire schema/version is not chosen by this retention patch. Current lock
|
|
139
|
+
objects are inputs for verification, not an implicit new persistent lock format.
|
|
140
|
+
|
|
141
|
+
Preparation publishes all needed artifacts, then commits the complete resolution
|
|
142
|
+
before launching anything. A failed preparation may leave unreferenced valid
|
|
143
|
+
artifacts; it must not leave a selectable partial resolution. Choosing or approving
|
|
144
|
+
a newer artifact is a separate operation. No artifact's presence grants approval.
|
|
145
|
+
|
|
146
|
+
Independent queued work retains the resolution it will execute, even after the
|
|
147
|
+
originating instance or source soul has been removed. Recurring schedules must
|
|
148
|
+
state whether they capture a composition or explicitly prepare a new one on a
|
|
149
|
+
future tick; an already queued execution cannot silently advance either way.
|
|
150
|
+
The proposed default is to capture the composition; re-preparation on later ticks
|
|
151
|
+
is an explicit policy. Messaging-disabled jobs do not acquire a private team.
|
|
152
|
+
|
|
153
|
+
## Consumer migration
|
|
154
|
+
|
|
155
|
+
This is one coordinated change, not a permanent pair of resolution engines:
|
|
156
|
+
|
|
157
|
+
1. Add the explicit lock/resolution schema and store migration. Verify the current
|
|
158
|
+
flat artifacts before retaining them. Do not re-fetch a moving source and
|
|
159
|
+
claim those bytes reconstruct an overwritten historical revision.
|
|
160
|
+
2. Wire acquisition/preparation to retained artifacts. Ensure selected source
|
|
161
|
+
revisions are consistent across the transaction; preserve normal trust gates.
|
|
162
|
+
3. Capture references for new instances and independent work. Route generated
|
|
163
|
+
commands, runtime packages, capability helpers, launch/retire hooks and recovery
|
|
164
|
+
through the captured resolution, including after source deletion.
|
|
165
|
+
4. Migrate existing instance/queued-work records only where their exact managed
|
|
166
|
+
inputs can be established. Report unresolved historical inputs explicitly;
|
|
167
|
+
preserve running sessions and let their owners choose the restart boundary.
|
|
168
|
+
5. Remove mutable-store lookups from captured consumers. Update diagnostics and
|
|
169
|
+
removal behavior to retain referenced revisions. Add collection only later if
|
|
170
|
+
actual storage use justifies it.
|
|
171
|
+
|
|
172
|
+
The compatibility boundary includes `core.mjs` acquisition, restoration, trust,
|
|
173
|
+
discovery, spawn, launch and retirement; package diagnostics and CLI paths; and
|
|
174
|
+
the scheduler/operation callers. Each is a consumer to check, not a reason to
|
|
175
|
+
create another config parser. Before wiring core consumers, extract the shared
|
|
176
|
+
artifact helpers into a narrow leaf module: `core.mjs` must not acquire a circular dependency on the retention module
|
|
177
|
+
that currently consumes its helpers. Keep policy and lifecycle logic out of the
|
|
178
|
+
shared leaf module.
|
|
179
|
+
|
|
180
|
+
## Evidence and limits
|
|
181
|
+
|
|
182
|
+
The focused tests use the real package engine to install A, retain it, update to
|
|
183
|
+
B and retain B. Both execute their own test payload after removing the original
|
|
184
|
+
source, flat install and current lock. Further tests cover idempotent retention,
|
|
185
|
+
digest/provenance rejection, no silent repair, contained symlinks, and Git ignores.
|
|
186
|
+
No model harnesses or GUI processes are started.
|
|
187
|
+
|
|
188
|
+
This proves the storage prerequisite. It does **not** yet prove a running instance
|
|
189
|
+
or queued job dispatches A while new work uses B. That acceptance test belongs to
|
|
190
|
+
the consumer migration, with executable trust and recovery exercised end to end.
|