arcane-os 0.3.0 → 0.3.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.
@@ -242,11 +242,14 @@ ignores it and uses module-captured native Blob URL creation, revocation, and
242
242
  fetch so a caller cannot substitute the executable materialization boundary.
243
243
 
244
244
  For a graph, `prepare(graph,{signal,onProgress,offline=false,security})` follows
245
- the shared model-security flag and requires explicit `secure:true`. The graph is
246
- the opt-in strict path: it enables byte-length, SHA-256, and undeclared-
247
- capability enforcement. Ordinary warn-first operation uses the direct
248
- `model`/`runtime` authority described below and does not construct or admit an
249
- artifact graph.
245
+ the shared model-security flag. Its default `secure:false` path retains the
246
+ selected graph, scans and rewrites its declared module edges, and reports
247
+ unchecked or partially checked admission without enabling optional strict
248
+ capability isolation. Explicit `secure:true` defaults byte-length and SHA-256
249
+ checks on and adds strict Worker isolation. Either mode rejects malformed graph
250
+ records, unreadable Fetch responses, media-type mismatches, structurally
251
+ unmaterializable runtime modules, failed object-URL readback, and every enabled
252
+ byte-length or SHA-256 mismatch.
250
253
 
251
254
  ### Cold admission
252
255
 
@@ -261,24 +264,27 @@ artifact graph.
261
264
  HTTPS URL without credentials or a fragment and require its canonical origin
262
265
  to occur in that file's declared final-origin inventory.
263
266
  5. Require the response Content-Type to equal `sourceMediaType` (which defaults
264
- to `mediaType`), then stream exact byte-length and SHA-256 verification into
265
- DBOPFS.
266
- 6. Reopen and rehash every persisted file.
267
+ to `mediaType`), then stream into DBOPFS while applying each enabled
268
+ byte-length or SHA-256 check. `secure:true` enables both checks by default;
269
+ `secure:false` leaves both disabled unless the caller selects them.
270
+ 6. Reopen every persisted file and repeat only the enabled byte-length or
271
+ SHA-256 checks.
267
272
  7. Decode and scan every runtime JavaScript file and prove exact edge/transform
268
273
  closure.
269
274
  8. Persist `arcane.ai.browser-speech.authenticated-artifact-graph.v1` only
270
275
  after every file and the complete runtime graph pass.
271
276
 
272
- The returned admission is
273
- `artifact-graph-network-dbopfs-verified`. A failure before manifest completion
274
- removes the graph's incomplete records.
277
+ The returned admission is `artifact-graph-network-dbopfs-verified`,
278
+ `artifact-graph-network-dbopfs-partially-checked`, or
279
+ `artifact-graph-network-dbopfs-unchecked` according to the effective checks. A
280
+ failure before manifest completion removes the graph's incomplete records.
275
281
 
276
282
  `redirectFinalOrigins` admits only a final origin, not a final path, query, or
277
283
  signed/expiring URL. The browser may follow such an implementation-specific
278
284
  final URL, but that URL is neither persisted nor accepted as source, revision,
279
- signature, graph identity, or future download authority. Trust remains bound to
280
- the immutable starting `sourceUrl` and the exact authenticated length and
281
- SHA-256 of the received bytes.
285
+ signature, graph identity, or future download authority. The graph remains
286
+ bound to its immutable starting `sourceUrl`; selected length and SHA-256 checks
287
+ apply only when enabled and are reported honestly by the admission status.
282
288
 
283
289
  Browser Fetch exposes the final CORS response, not an inspectable list of every
284
290
  intermediate redirect hop. The SDK therefore cannot authenticate intermediate
@@ -291,13 +297,17 @@ than this redirect opt-in.
291
297
  ### Warm and offline admission
292
298
 
293
299
  A warm prepare requires the exact manifest authority and file count, reopens
294
- every DBOPFS record, checks the manifest's observed bytes and declared SHA-256,
295
- rehashes every file, and rescans the runtime graph before returning
296
- `artifact-graph-dbopfs-cache-verified`.
300
+ every DBOPFS record, checks the manifest's observed byte count and declared
301
+ descriptor identity, repeats the enabled byte-length or SHA-256 checks, and
302
+ rescans the runtime graph. It returns the corresponding
303
+ `artifact-graph-dbopfs-cache-verified`,
304
+ `artifact-graph-dbopfs-cache-partially-checked`, or
305
+ `artifact-graph-dbopfs-cache-unchecked` status.
297
306
 
298
307
  `offline:true` runs the same cache verification and never calls the source
299
308
  fetch function. It returns
300
- `artifact-graph-offline-dbopfs-cache-verified`, or rejects with code
309
+ `artifact-graph-offline-dbopfs-cache-{verified|partially-checked|unchecked}`,
310
+ or rejects with code
301
311
  `ARCANE_AI_ARTIFACT_GRAPH_OFFLINE_CACHE_MISS` and reason
302
312
  `artifact-graph-offline-cache-miss`. There is no network repair, runtime CDN,
303
313
  private Cache Storage fallback, or partial-cache admission.
@@ -305,7 +315,8 @@ private Cache Storage fallback, or partial-cache admission.
305
315
  The manifest authority binds each file's `sourceMediaType` and
306
316
  `redirectFinalOrigins` through the graph identity. A valid warm or offline
307
317
  admission does not resolve the starting URL again, follow a redirect, or reuse a
308
- prior final URL; it authenticates only the complete cached bytes and graph.
318
+ prior final URL; it admits only the complete cached records and graph under the
319
+ selected checks.
309
320
 
310
321
  After every cold, warm, or offline admission, the store materializes a fresh
311
322
  set of unique native `blob:` URLs. Each URL is fetched back with omitted
@@ -324,9 +335,10 @@ Successful graph preparation returns:
324
335
  cache, // the exact graph admission value
325
336
  artifactGraphId,
326
337
  artifactGraphAdmission,
338
+ warnings, // frozen runtime-inspection warnings
327
339
  runtime: {
328
340
  ...normalizedRuntime,
329
- files, edges, transforms,
341
+ files, edges, transforms, warnings,
330
342
  guardCapability,
331
343
  artifactGraphId,
332
344
  artifactGraphAdmission
@@ -340,31 +352,40 @@ Successful graph preparation returns:
340
352
  does not delete the caller-owned DBOPFS cache. `remove(graph)` is the explicit
341
353
  cache-deletion operation.
342
354
 
343
- ## Authenticated Worker host
355
+ ## Graph Worker host
344
356
 
345
- Graph loading creates one dedicated Worker for the selected role. Its first
346
- load envelope transfers a new private `MessagePort`; all graph responses,
347
- progress, cancellation settlement, and later operations stay on that port.
348
- Graph loading rejects if `MessageChannel`/`MessagePort` is unavailable, if a
349
- legacy global transport was already selected, or if the Worker receives a graph
350
- load without the private port. The published single-module compatibility path
351
- continues to use the original Worker-global message transport.
357
+ Graph loading creates one dedicated Worker for the selected role. With explicit
358
+ `secure:true`, its first load envelope transfers a new private `MessagePort`;
359
+ all graph responses, progress, cancellation settlement, and later operations
360
+ stay on that port. Strict loading rejects if `MessageChannel`/`MessagePort` is
361
+ unavailable, if a Worker-global transport was already selected, or if the
362
+ Worker receives a strict graph load without the private port. Default
363
+ `secure:false` graph loading uses the ordinary Worker-global message transport,
364
+ as does the published single-module compatibility path.
352
365
 
353
- Before importing the entrypoint, the graph Worker installs these fail-closed
354
- boundaries:
366
+ Before importing the entrypoint in either mode, the graph Worker installs the
367
+ functional graph boundary:
355
368
 
356
369
  - exact graph routes map declared source URLs, runtime aliases, and materialized
357
- URLs to already authenticated object URLs;
370
+ URLs to the selected materialized object URLs;
358
371
  - the ephemeral guard capability must match at every rewritten call;
359
- - global `fetch` rejects unless the scanned source was rewritten to one
360
- declared fetch edge;
361
- - global Cache Storage `open` and `match` reject unless the scanned
362
- `caches.open(...)` was rewritten to one exact declared cache-open edge; its
363
- returned read-only cache serves only `targetPaths`, while `put`, `add`, and
364
- `addAll` reject, so DBOPFS remains the sole durable store;
372
+ - each rewritten fetch, cache-open, import, and child-Worker edge resolves
373
+ through its declared graph route and local materialized bytes;
374
+ - the returned graph cache facade serves only declared `targetPaths`, while
375
+ `put`, `add`, and `addAll` reject, so DBOPFS remains the graph's sole durable
376
+ store;
365
377
  - a `typed-array-constructor` rewrite returns only the intrinsic constructor of
366
- a verified typed-array receiver; an own or non-intrinsic `constructor`
378
+ a typed-array receiver; an own or non-intrinsic `constructor`
367
379
  rejects;
380
+ - an admitted child module Worker is created through the SDK's role Worker,
381
+ receives the graph configuration, installs the same guard, and imports only
382
+ its declared materialized target.
383
+
384
+ Explicit `secure:true` additionally installs these strict isolation controls:
385
+
386
+ - raw global `fetch` rejects unless scanned source was rewritten to one
387
+ declared fetch edge, and raw Cache Storage access is replaced by the graph
388
+ facade;
368
389
  - the `Function`, `AsyncFunction`, `GeneratorFunction`, and
369
390
  `AsyncGeneratorFunction` prototype constructor escape is replaced before
370
391
  import, and string callbacks to `setTimeout` or `setInterval` reject;
@@ -372,15 +393,13 @@ boundaries:
372
393
  - raw `BroadcastChannel`, `EventSource`, `Function`, `RTCPeerConnection`,
373
394
  `ShadowRealm`, `SharedWorker`, `WebSocket`, `WebSocketStream`, `WebTransport`,
374
395
  `Worker`, `XMLHttpRequest`, `eval`, and `importScripts` capabilities are
375
- denied; and
376
- - an admitted child module Worker is created through the SDK's role Worker,
377
- receives the authenticated graph configuration, installs the same guard, and
378
- imports only its declared materialized target.
396
+ denied.
379
397
 
380
- An immutable `sourceUrl` may be an explicitly caller-selected HTTPS origin,
381
- but runtime execution cannot escalate to that or another network origin. Its
382
- declared request is answered from authenticated local object bytes, and any
383
- other request or import edge rejects.
398
+ An immutable `sourceUrl` may be an explicitly caller-selected HTTPS origin.
399
+ Every rewritten declared request is answered from local object bytes and an
400
+ undeclared transformed edge rejects. Explicit `secure:true` additionally
401
+ prevents raw runtime access from escalating to that or another network origin;
402
+ default warn-first mode does not make that isolation claim.
384
403
 
385
404
  ### ONNX Runtime Web configuration
386
405
 
@@ -393,15 +412,17 @@ The Worker accepts only the two mechanically verified namespace shapes:
393
412
  `kokoro-env-wasm-paths-assignment-rejected`.
394
413
  - Transformers: `namespace.env.backends.onnx.wasm.wasmPaths = {mjs,wasm}`.
395
414
  The Worker also requires the verified outer `env` fields, sets
396
- `allowLocalModels:false`, `allowRemoteModels:true`, `useBrowserCache:false`,
397
- and `useFSCache:false`. With no admitted `cacheOpens` edge named exactly
398
- `transformers-cache`, it assigns `useCustomCache:false` and `customCache:null`.
399
- With exactly one such edge it assigns `useCustomCache:true` and the
400
- target-limited read-only graph facade; more than one rejects as ambiguous.
401
- Only a caller-declared STT `numThreads` is assigned. The
415
+ `allowLocalModels:false` and `allowRemoteModels:true`. In explicit
416
+ `secure:true`, it additionally sets `useBrowserCache:false` and
417
+ `useFSCache:false`; with no admitted `cacheOpens` edge named exactly
418
+ `transformers-cache`, it assigns `useCustomCache:false` and `customCache:null`,
419
+ while exactly one such edge selects the target-limited read-only graph
420
+ facade. Default `secure:false` leaves those optional upstream cache settings
421
+ unchanged. More than one declared Transformers cache edge rejects as
422
+ ambiguous in either mode. Only a caller-declared STT `numThreads` is assigned. The
402
423
  `allowRemoteModels` value permits the audited library code path to issue its
403
- declared request; the graph guard still prevents network access and serves
404
- only exact local graph routes.
424
+ declared request; the rewritten graph edge still serves its selected local
425
+ route. Strict mode separately prevents unrewritten network access.
405
426
 
406
427
  For Transformers, the exact missing-field reasons are
407
428
  `transformers-env-backends-onnx-wasm-unavailable`,
@@ -472,10 +493,10 @@ createBrowserKokoroProvider({
472
493
  } = {})
473
494
  ```
474
495
 
475
- `graph` is mutually exclusive with the legacy `model`/`runtime` options and may
476
- load only when effective security explicitly selects `secure:true`. Both
477
- constructors require an SDK-created DBOPFS speech store and return one frozen
478
- `arcane-ai-provider/2` object:
496
+ `graph` is mutually exclusive with the legacy `model`/`runtime` options. It may
497
+ load under default `secure:false` warn-first operation or explicit
498
+ `secure:true` strict operation. Both constructors require an SDK-created
499
+ DBOPFS speech store and return one frozen `arcane-ai-provider/2` object:
479
500
 
480
501
  ```text
481
502
  {
@@ -485,7 +506,8 @@ constructors require an SDK-created DBOPFS speech store and return one frozen
485
506
  ```
486
507
 
487
508
  `localOnly` must remain `true`. `offline:true` makes every later explicit load
488
- use strict offline graph/cache admission; it does not trigger a load itself.
509
+ use the selected offline graph/cache admission policy; it does not trigger a
510
+ load itself.
489
511
 
490
512
  `catalog()` exposes only the caller's selected model/runtime/files. A graph
491
513
  catalog also reports `artifactGraphId`, caller dtype, exact sample rate, and the
@@ -574,6 +596,9 @@ Provider `status()` returns:
574
596
  generation,
575
597
  errorCode,
576
598
  cache,
599
+ security,
600
+ integrity,
601
+ warnings,
577
602
  artifactGraphId,
578
603
  artifactGraphAdmission
579
604
  }
@@ -595,6 +620,20 @@ The provider states are exactly `unloaded`, `loading`, `ready`, `unloading`,
595
620
  synthesis request; load, unload, and dispose remain visible through `state` and
596
621
  `activeOperation`. `cache` is `null`, a graph admission value, or the legacy
597
622
  `installed`/`cached` value. Graph identity and admission are otherwise `null`.
623
+ `security` reports the effective `secure`, `byteLength`, and `sha256` choices.
624
+ `integrity.state` is `unchecked` when no integrity check is enabled, `pending`
625
+ while enabled checks have not completed, `verified` only after every enabled
626
+ check passes, and `failed` when an enabled verification attempt rejects. This
627
+ verification outcome is independent of later Worker initialization and remains
628
+ visible after a failed or unloaded provider. Default `secure:false` status
629
+ includes the frozen warning code
630
+ `browser-speech-warn-first-secure-mode-disabled` without blocking upstream
631
+ package, provider, model, voice, fetch, cache, or Worker behavior. Graph runtime
632
+ inspection warnings are deduplicated into the same frozen status array. The
633
+ high-level AI runtime owns the single configuration warning event; providers
634
+ and Workers do not create a competing event source. Strict byte admission,
635
+ private transport, and capability isolation remain exclusive to explicit
636
+ `secure:true`.
598
637
 
599
638
  Provider-owned lifecycle reasons are:
600
639
 
@@ -1217,19 +1256,23 @@ advanced strict-control option; it is not required for normal speech use.
1217
1256
  - The SDK redistributes no speech runtime, model, voice, third-party license,
1218
1257
  or corresponding-source payload. Explicit `load()` resolves them from the
1219
1258
  caller-selected npm/package/provider authorities.
1220
- - Default direct-authority operation is warn-first and preserves ordinary
1221
- upstream fetch/cache behavior. An artifact graph is admitted only when
1222
- `secure:true` explicitly opts into strict graph/file verification and
1223
- capability isolation.
1224
- - Every graph byte is caller-selected, immutable, exact-length, SHA-256 bound,
1225
- revision bound, media-type bound, license-declaration bound, and reachable
1226
- through one closed graph identity.
1259
+ - Default direct-authority and graph operation is warn-first and preserves
1260
+ ordinary upstream Worker capabilities. `secure:true` explicitly opts into
1261
+ strict graph/file verification, private transport, and capability isolation.
1262
+ - Every graph descriptor is caller-selected and binds immutable source,
1263
+ declared length, SHA-256, revision, media type, license declaration, and
1264
+ closed graph identity. Runtime status calls the bytes `verified` only when
1265
+ both byte checks actually complete; warn-first can honestly report
1266
+ `partially-checked` or `unchecked`.
1227
1267
  - Redirects are rejected by default. An undeclared redirect, an undeclared or
1228
1268
  non-HTTPS final origin, a mutable starting source authority, an ambiguous
1229
- path/route, an undeclared code/data edge, a raw network transport, a cache
1230
- write, or an incomplete offline closure fails closed.
1231
- - DBOPFS is the sole durable artifact store; the Worker sees only authenticated
1232
- local object bytes and an exact read-only cache facade.
1269
+ path/route, an undeclared transformed code/data edge, a graph-cache write, or
1270
+ an incomplete offline closure fails closed. Explicit `secure:true` also
1271
+ rejects raw network and other undeclared Worker capabilities.
1272
+ - DBOPFS is the graph's sole SDK-owned durable artifact store. Declared graph
1273
+ routes resolve to local object bytes and an exact read-only cache facade;
1274
+ default warn-first mode does not claim to deny every ordinary upstream
1275
+ browser capability.
1233
1276
  - Runtime/model/sample-rate/default-voice/voice inventory and optional
1234
1277
  Transformers thread count remain caller authority. No hardware heuristic,
1235
1278
  hidden fallback, startup download, native/Core call, or cloud retry is added.
@@ -9,7 +9,7 @@ page is the focused local-browser path beneath the normalized AI decision
9
9
  guide.
10
10
 
11
11
  The wiring example assumes a scaffolded or materialized Arcane application
12
- with SDK `0.3.0`'s runtime tree and generated browser import map.
12
+ with SDK `0.3.1`'s runtime tree and generated browser import map.
13
13
  `arcane/DBOPFS` is a managed browser-map specifier, not an npm package export.
14
14
  See [browser runtime delivery](../protocols.md#browser-runtime-delivery) before
15
15
  using the example in a custom host or bundler.
@@ -91,7 +91,7 @@ surface does not require an Arcane Core method grant because it does not call a
91
91
  Core host. Browser Fetch, CORS, storage policy, secure-context behavior, and
92
92
  resource limits still apply.
93
93
 
94
- The shipped `0.3.0` runtime requires WebGPU and has no CPU fallback. A successful
94
+ The shipped `0.3.1` runtime requires WebGPU and has no CPU fallback. A successful
95
95
  load requests full GPU offload (`gpuLayers: 99999`) and admits actual adapter,
96
96
  full-offload, buffer, queue, and settled-fence evidence. `navigator.gpu`
97
97
  presence by itself is not readiness. The provider emits the instrumented
@@ -130,7 +130,7 @@ The projected [`AIProviderRuntime`](runtime-modules.md#aiproviderruntimejs)
130
130
  normalizes those browser providers and can admit an externally supplied native
131
131
  or cloud provider/2 adapter. `AI.js` also supplies compatibility adapters for
132
132
  an already-selected legacy OpenAI route, Ollama route, or admitted Core speech
133
- route. SDK `0.3.0` publishes no privileged Core implementation, credential,
133
+ route. SDK `0.3.1` publishes no privileged Core implementation, credential,
134
134
  model, or speech-runtime authority, and those adapters never probe, select,
135
135
  download, or fall back. The sticky
136
136
  [`AIRuntimeState`](runtime-modules.md#airuntimestatejs) surface keeps
@@ -197,7 +197,7 @@ identical executable alias.
197
197
  The generated artifact is
198
198
  `apps/<id>/modules/arcane.importmap.json`. Its exact JSON is also installed in
199
199
  the app entry as `<script type="importmap" data-arcane-import-map>` before
200
- module loading. In SDK `0.3.0`, the complete physical-v1 runtime derives its
200
+ module loading. In SDK `0.3.1`, the complete physical-v1 runtime derives its
201
201
  entries from the installed runtime and browser-runtime inventories and
202
202
  intentionally has no package-root mapping. The command receipt remains
203
203
  authoritative for the exact map written to the selected application; no fixed
@@ -9,7 +9,7 @@ They are not TypeScript declarations.
9
9
 
10
10
  ## Portable SDK AI and Core AI
11
11
 
12
- The SDK `0.3.0` has two related but separate normalized boundaries:
12
+ The SDK `0.3.1` has two related but separate normalized boundaries:
13
13
 
14
14
  | Boundary | Use | Host |
15
15
  |---|---|---|
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "sdkVersion": "0.3.0",
3
+ "sdkVersion": "0.3.1",
4
4
  "environment": {
5
5
  "runtime": "Node.js for Node entrypoints; browser for browser-only entrypoints",
6
6
  "minimumVersion": "22.23.2 for Node entrypoints",
@@ -5,7 +5,7 @@
5
5
  "repository": "https://github.com/TheWizardNexus/arcane-os-sdk.git",
6
6
  "commit": "75b01e7ddcd751f7970d8c1aaf18bfff05b706b7",
7
7
  "path": "runtime/arcane/components",
8
- "sdkVersion": "0.3.0",
8
+ "sdkVersion": "0.3.1",
9
9
  "legacyProjection": {
10
10
  "repository": "https://github.com/TheWizardNexus/ARCANE-OS.git",
11
11
  "commit": "c540014afe69f14cf5ae60493b7295f36dbcec64",
@@ -5,7 +5,7 @@
5
5
  "repository": "https://github.com/TheWizardNexus/arcane-os-sdk.git",
6
6
  "commit": "9c4ec2213af98cbc53fca073a799435a89c6650f",
7
7
  "path": "runtime/arcane",
8
- "sdkVersion": "0.3.0",
8
+ "sdkVersion": "0.3.1",
9
9
  "legacyProjection": {
10
10
  "repository": "https://github.com/TheWizardNexus/ARCANE-OS.git",
11
11
  "commit": "c540014afe69f14cf5ae60493b7295f36dbcec64",
@@ -22,7 +22,7 @@ plaintext fallback.
22
22
 
23
23
  ## Public npm import
24
24
 
25
- The 0.3.0 portable programmatic contract is one subpath:
25
+ The 0.3.1 portable programmatic contract is one subpath:
26
26
 
27
27
  ```javascript
28
28
  import Mail,{
@@ -55,6 +55,48 @@ same app-scoped operation, not three import-map formats. There is no exported
55
55
  `importMapApplication()` function, `generateImportMap()` function, or
56
56
  `arcane-os/import-map` package subpath.
57
57
 
58
+ ## Installed SDK runtime materialization
59
+
60
+ `materializeInstalledSdkRuntime()` is the Node entrypoint for refreshing one
61
+ external workspace's checked-in `arcane/` projection from its one exact
62
+ installed SDK declaration. Import the function through the dependency key that
63
+ the workspace actually declares: `arcane-os` for the canonical package name or,
64
+ for example, `arcane-sdk` for the exact `npm:arcane-os@<version>` alias. No
65
+ application- or Arcane OS-local copier owns this operation.
66
+
67
+ The operation resolves that declaration again while holding the shared
68
+ workspace-operation lock, authenticates the physical package plus its runtime
69
+ and browser-runtime receipts, derives the destination inventory dynamically,
70
+ and returns one of three statuses:
71
+
72
+ - `created` when no prior `arcane/` projection or persistent receipt existed;
73
+ - `reused` only after the current process reauthenticates the recorded physical
74
+ package, both source receipts, and every destination byte;
75
+ - `refreshed` when a safe legacy projection or an authenticated older generation
76
+ is replaced.
77
+
78
+ Each committed generation writes the canonical workspace-local receipt
79
+ `.arcane/installed-sdk-runtime.json`. Its
80
+ `arcane-installed-sdk-runtime-projection` schema binds a UUID generation, the
81
+ workspace location identity, declared dependency name/group/specifier and
82
+ package source, physical package location/name/version/identity, both source
83
+ receipt identities and content hashes, and the exact projected path/byte/hash
84
+ inventory. The file is durable evidence, not standalone authority: a later
85
+ process must authenticate it against the current physical package, freshly
86
+ issued source receipts, and the complete destination tree before reporting
87
+ `reused`.
88
+
89
+ Creation and refresh write and authenticate a complete staging tree and staged
90
+ receipt before the commit boundary. Refresh moves the prior tree and receipt to
91
+ owned backups, installs the new pair without invoking callbacks or observing
92
+ cancellation inside that bounded commit, and restores the prior pair if commit
93
+ or post-commit verification fails. Cancellation remains effective through the
94
+ last pre-commit check; after commit begins the operation finishes verification
95
+ or rollback. Successful whole-tree replacement removes bytes absent from the
96
+ new dynamic inventory. Symbolic links, non-files, malformed receipts, receipt
97
+ tampering, unsafe paths, and corrupt selected source bytes remain errors rather
98
+ than refresh inputs.
99
+
58
100
  ## Central events and time-travel data
59
101
 
60
102
  `arcane-os/event-manager` is host-neutral JavaScript. Its live event path is
@@ -104,12 +146,12 @@ import ollama from 'arcane/Ollama';
104
146
  ```
105
147
 
106
148
  The authenticated physical-v1 tree lives entirely beneath `arcane/`. SDK
107
- `0.3.0` projects it from two canonical release receipts:
149
+ `0.3.1` projects it from two canonical release receipts:
108
150
 
109
151
  | Canonical receipt | Source authority and protocol | Receipt inventory |
110
152
  | --- | --- | --- |
111
- | `runtime/ARCANE_RUNTIME_RELEASE.json` | `sdk-canonical`; `arcane/1`; builder `arcane-sdk-runtime-v1` | 161 files; 4,159,000 bytes; content SHA-256 `5dab0c9cadd9e5ca97f90ab63ce755940318198d5b1efc0b7b666de4075302e9` |
112
- | `browser-runtime/ARCANE_SDK_BROWSER_RELEASE.json` | `arcane-os-sdk`; `arcane-sdk-browser-runtime/1`; builder `arcane-sdk-browser-runtime-v1` | 26 files; 9,548,478 bytes; content SHA-256 `0d41531e9a2d6ce97a357eeeebde5fbac8af59639a52f4f682717097b13dc6dc` |
153
+ | `runtime/ARCANE_RUNTIME_RELEASE.json` | `sdk-canonical`; `arcane/1`; builder `arcane-sdk-runtime-v1` | 161 files; 4,161,715 bytes; content SHA-256 `9ed39694d9f286e0994404a82fb6002c3ba48be0d085a6b68d51c7facc17c56f` |
154
+ | `browser-runtime/ARCANE_SDK_BROWSER_RELEASE.json` | `arcane-os-sdk`; `arcane-sdk-browser-runtime/1`; builder `arcane-sdk-browser-runtime-v1` | 26 files; 9,554,968 bytes; content SHA-256 `1493497265c330507abed847e52e65dc2ce22c15efaf5646ed7ae544b107ad6f` |
113
155
 
114
156
  The runtime receipt is the current byte authority. Its Arcane OS
115
157
  `c540014afe69f14cf5ae60493b7295f36dbcec64` / bundle `0.8.12` record is
@@ -123,7 +165,7 @@ versions from aliasing one another.
123
165
 
124
166
  Those two receipt inventories contain 187 entries in total. That sum is a
125
167
  release-inventory fact, not an import-map entry count and not an assertion about
126
- one maintained example. The `0.3.0` map deterministically roots every admitted
168
+ one maintained example. The `0.3.1` map deterministically roots every admitted
127
169
  top-level runtime ESM plus the authenticated SDK browser roots, then follows
128
170
  those roots for runtime entities and dependency compatibility. Application
129
171
  source imports do not select a fixed entry count. Its public operation receipt is the
@@ -188,8 +230,8 @@ authority with exactly `dependencyName`, `packageSource`,
188
230
  `canonicalPackageRoot`, `packageName`, `packageVersion`, `runtimeRoot`,
189
231
  `browserRuntimeRoot`, `runtimeManifest`, and `browserRuntimeManifest`. A
190
232
  workspace may use the canonical dependency name or one exact npm alias such as
191
- `npm:arcane-os@0.3.0`; the physical package manifest must still identify
192
- exactly as `arcane-os@0.3.0`. Canonical-plus-alias duplicates, multiple aliases,
233
+ `npm:arcane-os@0.3.1`; the physical package manifest must still identify
234
+ exactly as `arcane-os@0.3.1`. Canonical-plus-alias duplicates, multiple aliases,
193
235
  links/junctions, indirect package roots, or version drift fail closed.
194
236
 
195
237
  The imported module can be pure browser logic, standard-Web-API logic, or a
@@ -225,19 +267,19 @@ heartbeat is event telemetry only and never regenerates browser state.
225
267
  </details>
226
268
 
227
269
  <details>
228
- <summary>SDK 0.3.0 browser-runtime admission and exact receipt fields</summary>
270
+ <summary>SDK 0.3.1 browser-runtime admission and exact receipt fields</summary>
229
271
 
230
272
  `arcane.lock.json.sdkBrowserRuntime` persists the trusted manifest path,
231
273
  `manifestSha256`, `contentSha256`, `builder`, `sdkVersion`, and `source` record.
232
- For SDK `0.3.0`, the manifest itself records:
274
+ For SDK `0.3.1`, the manifest itself records:
233
275
 
234
276
  ```text
235
277
  manifest: node_modules/arcane-os/browser-runtime/ARCANE_SDK_BROWSER_RELEASE.json
236
278
  fileCount: 26
237
- totalBytes: 9548478
238
- contentSha256: 0d41531e9a2d6ce97a357eeeebde5fbac8af59639a52f4f682717097b13dc6dc
279
+ totalBytes: 9554968
280
+ contentSha256: 1493497265c330507abed847e52e65dc2ce22c15efaf5646ed7ae544b107ad6f
239
281
  builder: arcane-sdk-browser-runtime-v1
240
- sdkVersion: 0.3.0
282
+ sdkVersion: 0.3.1
241
283
  source.protocol: arcane-sdk-browser-runtime/1
242
284
  source.browserEntry: arcane-os/event-manager
243
285
  ```
@@ -263,7 +305,7 @@ Application code should select a normalized role, not an internal protocol.
263
305
  The exported
264
306
  [`getAIProviderRuntime()` singleton](runtime-modules.md#aiproviderruntimejs)
265
307
  comes from authenticated runtime bytes and owns independent `llm`, `stt`, and
266
- `tts` selections. SDK `0.3.0` ships browser-WASM LLM and browser
308
+ `tts` selections. SDK `0.3.1` ships browser-WASM LLM and browser
267
309
  speech provider/2 adapters and also adapts selected legacy OpenAI LLM/STT/TTS,
268
310
  Core-backed Ollama LLM, and admitted Core speech STT/TTS routes into provider/2;
269
311
  other native, Core, or cloud routes require an externally supplied compatible
@@ -300,7 +342,7 @@ compatible completed cache, otherwise it rejects with
300
342
  `ARCANE_AI_MODEL_OFFLINE_MISS`. Unload releases the active Wllama session but
301
343
  does not silently delete the app-owned cache.
302
344
 
303
- SDK `0.3.0` requires WebGPU. Load requests full offload with exactly 99,999 GPU
345
+ SDK `0.3.1` requires WebGPU. Load requests full offload with exactly 99,999 GPU
304
346
  layers and admits the model only after observing an adapter, full layer offload,
305
347
  buffer and queue work, and a settled fence. `navigator.gpu` presence alone is
306
348
  not readiness. There is no CPU fallback, partial-offload success mode, or
@@ -495,6 +495,11 @@ removes that role and requires its exact non-null expected provider. The method
495
495
  provider registration, routes, selection, readiness, generation, sticky state,
496
496
  owned lifecycle work, and TTS mute state. `replaceSpeechProviders(value)` keeps
497
497
  the existing atomic two-role boundary for a coordinated STT/TTS replacement.
498
+ Either replacement may hydrate an exact selected-but-unregistered speech route
499
+ whose saved locality is still `null`, but only when provider id, model id, and
500
+ every pending route agree with the replacement. Registration and route
501
+ publication remain one commit; a mismatched, already registered, local-only,
502
+ busy, or partially divergent selection rejects without changing either role.
498
503
 
499
504
  `start(options)` waits for prior speech-state and role unload work, applies the
500
505
  requested initial mute state, and returns the `startAIRuntime()` control handle
@@ -1424,7 +1429,7 @@ source body as implicit authority, and never persists a caller-owned body.
1424
1429
  **Browser or compatible host with an injected DBOPFS adapter.** The adapter
1425
1430
  keeps the existing `get`, `set`, `getAllKeys`, and `delete` method names; Node
1426
1431
  can use the same class only through an explicitly imported runtime module and a
1427
- compatible storage adapter; SDK `0.3.0` publishes no Node package subpath or
1432
+ compatible storage adapter; SDK `0.3.1` publishes no Node package subpath or
1428
1433
  Node storage implementation for it. Bootstrap uses a bounded concurrent
1429
1434
  generation, commits its manifest last, cleans partial data on failure, and
1430
1435
  rejects case-colliding IDs. Search
@@ -17,7 +17,7 @@ This table is the Node `package.json#exports` map: it defines package
17
17
  entrypoints for SDK/tooling code. It is distinct from the generated browser
18
18
  import map that resolves application-facing `arcane/*` modules and the focused
19
19
  EventManager entry. See [browser runtime delivery](protocols.md#browser-runtime-delivery)
20
- for the installed-inventory-derived physical-runtime contract in SDK `0.3.0`.
20
+ for the installed-inventory-derived physical-runtime contract in SDK `0.3.1`.
21
21
 
22
22
  | Specifier | Purpose |
23
23
  | --- | --- |
@@ -849,7 +849,7 @@ same deterministic map. The package root also contains the public
849
849
  {
850
850
  schemaVersion: 1,
851
851
  kind: 'arcane-app-runtime-projection',
852
- sdkVersion: '0.3.0',
852
+ sdkVersion: '0.3.1',
853
853
  pathPrefix: 'arcane/',
854
854
  fileCount,
855
855
  totalBytes,
@@ -1404,24 +1404,28 @@ async function useloadRuntimeRelease(...arguments_) {
1404
1404
 
1405
1405
  ### Overview
1406
1406
 
1407
- Verifies the workspace's exact installed SDK runtime and browser runtime, then materializes their dynamic inventories.
1407
+ Verifies the workspace's exact installed SDK runtime and browser runtime, then creates, reuses, or transactionally refreshes their dynamic projection.
1408
1408
 
1409
1409
  ### Signature and result
1410
1410
 
1411
1411
  ```text
1412
- async materializeInstalledSdkRuntime({workspaceRoot,sdkPackageSource,signal,onEvent}={})
1412
+ async materializeInstalledSdkRuntime({workspaceRoot,sdkPackageSource,workspaceOperationLease,signal,onEvent}={})
1413
1413
  ```
1414
1414
 
1415
- Import it from `arcane-os`. It resolves the workspace's exact installed SDK declaration, verifies both physical runtime receipts, materializes the authenticated runtime projection, and returns a frozen result containing the installation and all three receipts. Cancellation and progress remain caller-owned through `signal` and `onEvent`.
1415
+ Import it through the exact dependency key declared by the workspace: normally `arcane-os`, or the alias name such as `arcane-sdk` when the declaration is `npm:arcane-os@<version>`. It resolves that declaration under the shared workspace-operation lock, verifies both physical runtime receipts, and creates or refreshes the complete projection by staged whole-tree replacement. The frozen result includes `status` (`created`, `reused`, or `refreshed`), `generation`, `receiptPath`, `persistentReceipt`, `cleanupWarnings`, the installed-package authority, and all three process-local verification receipts.
1416
+
1417
+ The canonical `.arcane/installed-sdk-runtime.json` receipt binds the physical package and exact destination inventory. A later process reauthenticates that receipt against the current installed package, freshly issued source receipts, and all destination bytes before returning `reused`; the JSON file alone grants no authority. Refresh prunes bytes absent from the new inventory and restores the prior tree and receipt on commit or post-commit verification failure. `signal` and `onEvent` remain caller-owned before commit. Once the bounded commit starts, it completes verification or rollback without observing cancellation or invoking callbacks.
1416
1418
 
1417
1419
  ### Availability and normalization
1418
1420
 
1419
- **Node.** Canonical workspace and installed-package identity, verified runtime receipts, and a frozen materialization result. Deep protocol: [Installed SDK runtime materialization](protocols.md).
1421
+ **Node.** Canonical workspace and installed-package identity, verified runtime receipts, a persistent reauthenticatable generation receipt, and a frozen materialization result. Deep protocol: [Installed SDK runtime materialization](protocols.md#installed-sdk-runtime-materialization).
1420
1422
 
1421
1423
  ### Example
1422
1424
 
1423
1425
  ```javascript
1424
1426
  import {materializeInstalledSdkRuntime} from 'arcane-os';
1427
+ // If package.json declares the SDK under the arcane-sdk alias, import from
1428
+ // 'arcane-sdk' instead.
1425
1429
 
1426
1430
  const result=await materializeInstalledSdkRuntime({workspaceRoot});
1427
1431
  ```
@@ -2759,7 +2763,7 @@ The import-map operation also reports the stable operation-specific strings
2759
2763
  `ARCANE_IMPORT_MAP_COLLISION`; package assembly can additionally report
2760
2764
  `ARCANE_IMPORT_MAP_CLEANUP_FAILED`. They are normalized `ArcaneError.code`
2761
2765
  values, but are not properties added to this frozen general registry in SDK
2762
- `0.3.0`.
2766
+ `0.3.1`.
2763
2767
 
2764
2768
  ### Value and import
2765
2769
 
@@ -3425,7 +3429,7 @@ workspace it additionally returns the exact installed package authority:
3425
3429
  packageSource,
3426
3430
  canonicalPackageRoot,
3427
3431
  packageName: 'arcane-os',
3428
- packageVersion: '0.3.0',
3432
+ packageVersion: '0.3.1',
3429
3433
  runtimeRoot,
3430
3434
  browserRuntimeRoot,
3431
3435
  runtimeManifest,
@@ -3435,9 +3439,9 @@ workspace it additionally returns the exact installed package authority:
3435
3439
  ```
3436
3440
 
3437
3441
  The dependency can be named `arcane-os` or be one exact npm alias for
3438
- `npm:arcane-os@0.3.0`. The selected installation must still be one direct,
3442
+ `npm:arcane-os@0.3.1`. The selected installation must still be one direct,
3439
3443
  physical, non-link package directory whose manifest identifies exactly as
3440
- `arcane-os@0.3.0`; duplicate canonical/alias declarations fail closed.
3444
+ `arcane-os@0.3.1`; duplicate canonical/alias declarations fail closed.
3441
3445
  `allowMissingManagedImportMap` is an internal packaging/development seam. An
3442
3446
  ordinary caller should leave it `false`.
3443
3447
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arcane-os",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Arcane OS JavaScript SDK, project-local CLI, browser runtime, and repository-portable application packager.",
5
5
  "type": "module",
6
6
  "main": "./src/index.mjs",