arcane-os 0.3.0 → 0.3.2

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 (153) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +86 -117
  3. package/bin/arcane-test.mjs +170 -46
  4. package/browser-runtime/ai/browser-speech-artifacts.mjs +887 -909
  5. package/browser-runtime/ai/browser-speech-providers.mjs +96 -152
  6. package/browser-runtime/ai/browser-wasm-llm-provider.mjs +627 -819
  7. package/browser-runtime/ai/browser-wasm.mjs +24 -35
  8. package/browser-runtime/ai/browser-wllama-runtime.mjs +64 -316
  9. package/browser-runtime/ai/model-controller.mjs +584 -181
  10. package/browser-runtime/ai/speech-worker-client.mjs +8 -146
  11. package/browser-runtime/ai/speech-worker-runtime.mjs +643 -363
  12. package/browser-runtime/dom-event-instrumentation.mjs +55 -147
  13. package/browser-runtime/event-manager.mjs +239 -624
  14. package/package.json +5 -6
  15. package/runtime/arcane/components/app-bar.html +3 -15
  16. package/runtime/arcane/components/assistant-panel.html +10 -10
  17. package/runtime/arcane/components/calculator.html +1 -1
  18. package/runtime/arcane/components/chat.html +1359 -135
  19. package/runtime/arcane/components/conversation-view.html +2 -2
  20. package/runtime/arcane/components/document-inspector.html +11 -17
  21. package/runtime/arcane/components/file-manager.html +13 -56
  22. package/runtime/arcane/components/markdown-document.html +82 -281
  23. package/runtime/arcane/components/markdown-editor.html +7 -10
  24. package/runtime/arcane/components/media-embed.html +6 -6
  25. package/runtime/arcane/components/screen-capture.html +4 -4
  26. package/runtime/arcane/components/source-explanation.html +2 -2
  27. package/runtime/arcane/components/speech.html +112 -68
  28. package/runtime/arcane/components/terminal-workspace.html +4 -4
  29. package/runtime/arcane/components/theme-editor.html +1 -1
  30. package/runtime/arcane/components/unified-inbox.html +2 -2
  31. package/runtime/arcane/components/voice-transcription.html +31 -21
  32. package/runtime/arcane/entities/Calculation.js +2 -3
  33. package/runtime/arcane/entities/Chat.js +228 -43
  34. package/runtime/arcane/entities/Preference.js +3 -5
  35. package/runtime/arcane/entities/Weather.js +5 -5
  36. package/runtime/arcane/modules/AI.js +1050 -427
  37. package/runtime/arcane/modules/AIProviderRuntime.js +658 -363
  38. package/runtime/arcane/modules/AIResponseLength.js +9 -19
  39. package/runtime/arcane/modules/AIRuntimeState.js +109 -72
  40. package/runtime/arcane/modules/ArcaneNavigationPolicy.js +45 -32
  41. package/runtime/arcane/modules/BrowserTestSuite.js +78 -122
  42. package/runtime/arcane/modules/CalculatorEngine.js +9 -9
  43. package/runtime/arcane/modules/CommunicationAppController.js +3 -7
  44. package/runtime/arcane/modules/ComponentContracts.js +30 -32
  45. package/runtime/arcane/modules/ConfiguredAIChatSession.js +281 -230
  46. package/runtime/arcane/modules/ConversationActionItems.js +26 -59
  47. package/runtime/arcane/modules/ConversationClosingReport.js +34 -61
  48. package/runtime/arcane/modules/ConversationTimebox.js +27 -15
  49. package/runtime/arcane/modules/DBOPFSDocumentLibrary.js +152 -344
  50. package/runtime/arcane/modules/DocumentLexicalSearch.js +25 -91
  51. package/runtime/arcane/modules/HTMLImport.js +54 -1
  52. package/runtime/arcane/modules/IsolatedModelQuestionRunner.js +40 -203
  53. package/runtime/arcane/modules/LocalAIReadiness.js +40 -60
  54. package/runtime/arcane/modules/LocalAIReadinessController.js +15 -13
  55. package/runtime/arcane/modules/MD.js +1 -45
  56. package/runtime/arcane/modules/Mail.js +51 -103
  57. package/runtime/arcane/modules/MailOutbox.mjs +95 -193
  58. package/runtime/arcane/modules/MailTransport.mjs +36 -57
  59. package/runtime/arcane/modules/ModelDefinition.js +22 -106
  60. package/runtime/arcane/modules/OpenMeteoWeatherProvider.js +39 -101
  61. package/runtime/arcane/modules/PersistentAIChatSession.js +281 -18
  62. package/runtime/arcane/modules/PreferenceStore.js +102 -30
  63. package/runtime/arcane/modules/RiskSignalAnalyzer.js +8 -9
  64. package/runtime/arcane/modules/ScopedOPFSCache.js +7 -42
  65. package/runtime/arcane/modules/ScreenCapture.js +175 -128
  66. package/runtime/arcane/modules/SpeechPlayback.js +46 -149
  67. package/runtime/arcane/modules/StaticDocumentCatalog.js +173 -407
  68. package/runtime/arcane/modules/ToolCallRouter.js +25 -12
  69. package/runtime/arcane/modules/YouTubeMedia.js +6 -5
  70. package/schemas/arcane-app-bundle.schema.json +13 -78
  71. package/schemas/arcane-app.schema.json +9 -25
  72. package/schemas/arcane-lock.schema.json +18 -151
  73. package/schemas/arcane-package.schema.json +2 -16
  74. package/schemas/native-build-plan.schema.json +119 -122
  75. package/src/app-descriptor.mjs +75 -132
  76. package/src/application-tests.mjs +200 -0
  77. package/src/cli/main.mjs +27 -46
  78. package/src/constants.mjs +3 -4
  79. package/src/dev-server.mjs +30 -324
  80. package/src/doctor.mjs +92 -154
  81. package/src/dom-event-instrumentation.mjs +55 -147
  82. package/src/errors.mjs +2 -3
  83. package/src/event-manager.mjs +239 -624
  84. package/src/event-queue.mjs +3 -3
  85. package/src/import-map.mjs +273 -1028
  86. package/src/index.mjs +14 -16
  87. package/src/installed-sdk-runtime.mjs +40 -62
  88. package/src/integrated-provider-loader.mjs +53 -382
  89. package/src/mail-api.mjs +0 -2
  90. package/src/mail-server.mjs +224 -580
  91. package/src/mail.mjs +4 -10
  92. package/src/native-plan.mjs +163 -598
  93. package/src/native-provider-loader.mjs +104 -1063
  94. package/src/packager/core.mjs +485 -3229
  95. package/src/process.mjs +5 -10
  96. package/src/release-bundle.mjs +292 -2405
  97. package/src/runtime.mjs +76 -396
  98. package/src/scaffold.mjs +30 -80
  99. package/src/sdk-browser-runtime.mjs +70 -626
  100. package/src/source-server.mjs +588 -0
  101. package/src/targets/index.mjs +78 -188
  102. package/src/templates/workspace-template.mjs +19 -135
  103. package/src/testing-loader.mjs +164 -0
  104. package/src/testing.mjs +1 -1
  105. package/src/toolchain.mjs +131 -544
  106. package/src/update-check.mjs +26 -64
  107. package/src/workspace-operation-lock.mjs +139 -430
  108. package/src/workspace-runtime.mjs +112 -779
  109. package/src/workspace.mjs +40 -302
  110. package/browser-runtime/ARCANE_SDK_BROWSER_RELEASE.json +0 -218
  111. package/browser-runtime/ai/ARCANE_AI_BROWSER_SPEECH_COMPONENTS.json +0 -203
  112. package/browser-runtime/ai/ARCANE_AI_BROWSER_WASM_COMPONENTS.json +0 -80
  113. package/browser-runtime/ai/internal/sha256.mjs +0 -166
  114. package/docs/architecture.md +0 -344
  115. package/docs/compatibility.md +0 -36
  116. package/docs/event-manager.md +0 -294
  117. package/docs/platform-targets.md +0 -108
  118. package/docs/publishing.md +0 -201
  119. package/docs/reference/README.md +0 -187
  120. package/docs/reference/ai/browser-speech-package-authority.json +0 -835
  121. package/docs/reference/ai/browser-speech.md +0 -1252
  122. package/docs/reference/ai/browser-wasm.md +0 -530
  123. package/docs/reference/arcane-ollama.md +0 -288
  124. package/docs/reference/availability-and-normalization.md +0 -183
  125. package/docs/reference/behavioral-testing.md +0 -133
  126. package/docs/reference/cli.md +0 -779
  127. package/docs/reference/core/README.md +0 -62
  128. package/docs/reference/core/arcane-ai-contracts.md +0 -907
  129. package/docs/reference/core/arcane-api.md +0 -601
  130. package/docs/reference/core/arcane-entities.md +0 -65
  131. package/docs/reference/core/arcane-events.md +0 -134
  132. package/docs/reference/core/ollama-module.md +0 -181
  133. package/docs/reference/core/reference/arcane-api/ai-and-ollama.md +0 -1909
  134. package/docs/reference/core/reference/arcane-api/applications-terminal-capabilities.md +0 -1057
  135. package/docs/reference/core/reference/arcane-api/core-and-events.md +0 -320
  136. package/docs/reference/core/reference/arcane-api/filesystem-storage-preferences-appearance.md +0 -610
  137. package/docs/reference/core/reference/arcane-api/namespaces.md +0 -1157
  138. package/docs/reference/core/reference/arcane-api/platform-installation-users-system.md +0 -1423
  139. package/docs/reference/core/reference/arcane-api/session-provisioning-diagnostics-development.md +0 -315
  140. package/docs/reference/event-manager.md +0 -1511
  141. package/docs/reference/inventory/package-api.json +0 -3284
  142. package/docs/reference/inventory/runtime-components.json +0 -1011
  143. package/docs/reference/inventory/runtime-entities.json +0 -26
  144. package/docs/reference/inventory/runtime-modules.json +0 -1431
  145. package/docs/reference/mail.md +0 -316
  146. package/docs/reference/protocols.md +0 -677
  147. package/docs/reference/runtime-components.md +0 -1366
  148. package/docs/reference/runtime-entities.md +0 -303
  149. package/docs/reference/runtime-modules.md +0 -2960
  150. package/docs/reference/sdk-api.md +0 -6694
  151. package/docs/roadmap.md +0 -79
  152. package/docs/work-amplification.md +0 -129
  153. package/runtime/ARCANE_RUNTIME_RELEASE.json +0 -826
@@ -1,288 +0,0 @@
1
- # Arcane Ollama
2
-
3
- Arcane Ollama lets an admitted application use local Ollama without knowing the
4
- service port, service account, model directory, host process, or native
5
- transport. Application code imports one browser module and calls one API:
6
-
7
- ```javascript
8
- import ollama from '/arcane/modules/Ollama.js';
9
-
10
- const reply = await ollama.chatText({
11
- model: 'arcane:latest',
12
- messages: [{role: 'user', content: 'Summarize this record.'}]
13
- });
14
-
15
- console.log(reply);
16
- ```
17
-
18
- The module never connects directly to `localhost:11434`. It delegates to the
19
- capability-gated `globalThis.Arcane.ollama` bridge. Core binds application
20
- identity, checks the exact method and package-owned model policy, admits native
21
- resources, and calls the managed ArcaneOllama service.
22
-
23
- This npm package exposes the synchronized browser client only. It does not
24
- bundle, install, start, or grant an Arcane Core or ArcaneOllama service. Every
25
- native call therefore requires a separately installed, compatible Arcane host,
26
- an app-scoped admitted Core session, the required capabilities, and a service
27
- that is ready under native policy. Import success alone proves none of those
28
- conditions.
29
-
30
- ## What developers can do
31
-
32
- | Capability | Preferred call | Result style |
33
- | --- | --- | --- |
34
- | Check whether the admitted service answers | `ollama.readiness()` | Arcane-normalized frozen readiness snapshot |
35
- | Generate text | `ollama.generateText(request)` | Arcane helper string |
36
- | Chat and return only assistant text | `ollama.chatText(request)` | Arcane helper string |
37
- | Use full generation/chat/tool/provider fields | `ollama.generate()` / `ollama.chat()` | Bounded Ollama provider-native envelope |
38
- | Create embeddings | `ollama.embed()` | Bounded Ollama provider-native envelope |
39
- | Read raw version/model/running/show inventory | `version()`, `models()`, `list()`, `running()`, `show()` | Provider-native diagnostic envelope |
40
- | Unload one model | `ollama.unload(model)` | Translates to generate with `prompt: ""` and `keep_alive: 0` |
41
- | Read managed selection/runtime/service settings | `selection()`, `settings()`, `serviceSettings()` | Arcane-managed snapshot; some service fields are platform-dependent |
42
- | Change managed selection/runtime/service settings | `select()`, `saveSettings()`, `saveServiceSettings()` | Arcane-managed result plus operation receipt |
43
- | Run admitted raw model mutations | `pull()`, `push()`, `create()`, `copy()`, `delete()` | Policy-bound provider-native result; several calls are intentionally denied to ordinary apps |
44
- | Create an Arcane-managed brain alias | `createBrain()` | Arcane-managed model/default result plus operation receipt |
45
-
46
- ## Fast start
47
-
48
- ### 1. Feature-detect the module
49
-
50
- ```javascript
51
- import ollama from '/arcane/modules/Ollama.js';
52
-
53
- const readiness = await ollama.readiness();
54
-
55
- if (!readiness.ready) {
56
- console.info('Local AI is unavailable:', readiness.errorCode);
57
- }
58
- ```
59
-
60
- `readiness()` catches a failed `version()` call and returns a frozen object:
61
-
62
- ```text
63
- { ready: boolean, version: string|null, errorCode: string|null }
64
- ```
65
-
66
- It is a connectivity convenience, not model admission or inference readiness.
67
- Use `Arcane.localAI.status()` when the application needs the package-filtered
68
- runnable model catalog.
69
-
70
- ### 2. Read admitted models
71
-
72
- ```javascript
73
- const access = await globalThis.Arcane.capabilities.list();
74
-
75
- if (!access.methods.includes('localAI.status')) {
76
- throw new Error('This application is not admitted for local AI.');
77
- }
78
-
79
- const status = await globalThis.Arcane.localAI.status();
80
- console.table(status.models.ollama);
81
- ```
82
-
83
- Populate product UI from this filtered catalog. `ollama.models()` is the raw
84
- diagnostic inventory for admitted Settings, Shell, or Terminal journeys; it is
85
- not the application's package-admitted model list.
86
-
87
- ### 3. Stream a chat response
88
-
89
- ```javascript
90
- let text = '';
91
-
92
- const final = await ollama.chat({
93
- model: 'arcane:latest',
94
- messages: [{role: 'user', content: 'Explain the evidence.'}]
95
- }, {
96
- onChunk(chunk) {
97
- text += chunk.message?.content ?? '';
98
- },
99
- signal: AbortSignal.timeout(60_000)
100
- });
101
-
102
- console.log(text, final.done);
103
- ```
104
-
105
- Arcane correlates chunks to the originating request. The final promise resolves
106
- with Ollama's final bounded chunk/envelope.
107
-
108
- ## Complete module API
109
-
110
- `/arcane/modules/Ollama.js` exports the `Ollama` class, a frozen `ollama`
111
- singleton, and that singleton as the default export. It also installs the
112
- non-writable `globalThis.arcaneOllama` convenience and emits
113
- `arcane-ollama-ready`. The pinned class defines exactly 24 public methods: the
114
- 20 bridge delegates below and the four normalized helpers that follow.
115
-
116
- ### Raw bridge methods
117
-
118
- | Module method | Delegation | Capability/use | Detailed Core guide |
119
- | --- | --- | --- | --- |
120
- | `version()` | `Arcane.ollama.version()` | Raw service version diagnostic. | [version](core/reference/arcane-api/ai-and-ollama.md#arcaneollamaversion) |
121
- | `models()` | `Arcane.ollama.models()` | Raw installed-model diagnostic. | [models](core/reference/arcane-api/ai-and-ollama.md#arcaneollamamodels) |
122
- | `list()` | Calls `Arcane.ollama.models()` | Module alias for `models()`; it does not call the bridge's separate `list` alias. | [list](core/reference/arcane-api/ai-and-ollama.md#arcaneollamalist) |
123
- | `running()` | `Arcane.ollama.running()` | Raw resident-model diagnostic. | [running](core/reference/arcane-api/ai-and-ollama.md#arcaneollamarunning) |
124
- | `show(model, options)` | `Arcane.ollama.show(...)` | Raw bounded model metadata. | [show](core/reference/arcane-api/ai-and-ollama.md#arcaneollamashow) |
125
- | `generate(request, options)` | `Arcane.ollama.generate(...)` | Admitted generation; optional chunk callback/signal/timeout. | [generate](core/reference/arcane-api/ai-and-ollama.md#arcaneollamagenerate) |
126
- | `chat(request, options)` | `Arcane.ollama.chat(...)` | Admitted chat/tools; optional chunk callback/signal/timeout. | [chat](core/reference/arcane-api/ai-and-ollama.md#arcaneollamachat) |
127
- | `embed(request)` | `Arcane.ollama.embed(...)` | Admitted embeddings. | [embed](core/reference/arcane-api/ai-and-ollama.md#arcaneollamaembed) |
128
- | `pull(model, options, streamOptions)` | `Arcane.ollama.pull(...)` | Managed/policy-bound pull; denied to ordinary raw app flow. | [pull](core/reference/arcane-api/ai-and-ollama.md#arcaneollamapull) |
129
- | `push(model, options, streamOptions)` | `Arcane.ollama.push(...)` | Raw push is policy-restricted/denied where documented. | [push](core/reference/arcane-api/ai-and-ollama.md#arcaneollamapush) |
130
- | `create(request, options)` | `Arcane.ollama.create(...)` | Exact package-owned verified definition only. | [create](core/reference/arcane-api/ai-and-ollama.md#arcaneollamacreate) |
131
- | `copy(source, destination)` | `Arcane.ollama.copy(...)` | Intentionally denied to applications; managed selection owns aliases. | [copy](core/reference/arcane-api/ai-and-ollama.md#arcaneollamacopy) |
132
- | `delete(model)` | `Arcane.ollama.delete(...)` | Destructive exact package-owned verified model deletion. | [delete](core/reference/arcane-api/ai-and-ollama.md#arcaneollamadelete) |
133
- | `selection()` | `Arcane.ollama.selection()` | Reads managed model preference/effective state. | [selection](core/reference/arcane-api/ai-and-ollama.md#arcaneollamaselection) |
134
- | `select(preference)` | `Arcane.ollama.select(...)` | Runs managed size-selection/download/alias workflow. | [select](core/reference/arcane-api/ai-and-ollama.md#arcaneollamaselect) |
135
- | `settings()` | `Arcane.ollama.settings()` | Reads managed runtime/provider settings. | [settings](core/reference/arcane-api/ai-and-ollama.md#arcaneollamasettings) |
136
- | `saveSettings(settings)` | `Arcane.ollama.saveSettings(...)` | Saves runtime-owned default/load/context settings. | [saveSettings](core/reference/arcane-api/ai-and-ollama.md#arcaneollamasavesettings) |
137
- | `createBrain(definition)` | `Arcane.ollama.createBrain(...)` | Creates a managed `arcane-<slug>:latest` alias. | [createBrain](core/reference/arcane-api/ai-and-ollama.md#arcaneollamacreatebrain) |
138
- | `serviceSettings()` | `Arcane.ollama.serviceSettings()` | Reads host-level Ollama service configuration/support. | [serviceSettings](core/reference/arcane-api/ai-and-ollama.md#arcaneollamaservicesettings) |
139
- | `saveServiceSettings(settings)` | `Arcane.ollama.saveServiceSettings(...)` | Applies privileged machine-wide service settings/restart. | [saveServiceSettings](core/reference/arcane-api/ai-and-ollama.md#arcaneollamasaveservicesettings) |
140
-
141
- ### Normalized helper methods
142
-
143
- ## `ollama.readiness()`
144
-
145
- ### Overview
146
-
147
- Calls `version()` and converts success/failure into a frozen readiness snapshot.
148
- It never throws for service unavailability.
149
-
150
- ### Return value
151
-
152
- `{ready:true, version, errorCode:null}` on success, or
153
- `{ready:false, version:null, errorCode}` on failure. A string version and an
154
- object `{version}` are both accepted.
155
-
156
- ### Example
157
-
158
- ```javascript
159
- const {ready, version, errorCode} = await ollama.readiness();
160
- console.log(ready ? version : errorCode);
161
- ```
162
-
163
- ## `ollama.generateText()`
164
-
165
- ### Overview
166
-
167
- Calls `generate()` and coerces the final envelope's `response` field to a
168
- string with `String(response?.response || '')`. Valid Ollama responses document
169
- `response` as a string. If an out-of-contract response supplies a truthy
170
- nonstring, the helper stringifies it; a missing, null, undefined, or other
171
- falsy nonstring value becomes an empty string.
172
-
173
- ### Example
174
-
175
- ```javascript
176
- const text = await ollama.generateText({
177
- model: 'arcane:latest',
178
- prompt: 'Write one sentence.'
179
- });
180
- ```
181
-
182
- ## `ollama.chatText()`
183
-
184
- ### Overview
185
-
186
- Calls `chat()` and coerces the final envelope's `message.content` field to a
187
- string with `String(response?.message?.content || '')`. Valid Ollama responses
188
- document `message.content` as a string. If an out-of-contract response supplies
189
- a truthy nonstring, the helper stringifies it; a missing, null, undefined, or
190
- other falsy nonstring value becomes an empty string. Use `chat()` when tool
191
- calls, metrics, context, or optional provider fields matter.
192
-
193
- ### Example
194
-
195
- ```javascript
196
- const text = await ollama.chatText({
197
- model: 'arcane:latest',
198
- messages: [{role: 'user', content: 'Hello'}]
199
- });
200
- ```
201
-
202
- ## `ollama.unload()`
203
-
204
- ### Overview
205
-
206
- Translates `unload(model)` to:
207
-
208
- ```javascript
209
- ollama.generate({model, prompt: '', keep_alive: 0});
210
- ```
211
-
212
- It returns the raw final generation envelope. It is a convenience request, not
213
- a proof that no other admitted client reloaded the model concurrently.
214
-
215
- ### Example
216
-
217
- ```javascript
218
- async function unloadAfterTheUserChooses(model) {
219
- return ollama.unload(model);
220
- }
221
- ```
222
-
223
- ## Availability matrix
224
-
225
- | Host | Inference | Raw inventory | Managed model/settings mutation | Notes |
226
- | --- | --- | --- | --- | --- |
227
- | Microsoft NT desktop Core | Yes when `ai.inference` is admitted | Settings/Shell/Terminal with `ai.models.read` | Admitted Settings/Shell journeys with management capabilities and privilege where required | Full managed ArcaneOllama service path. |
228
- | Linux desktop Core | Yes when admitted | Admitted diagnostics | Managed workflows where implemented; administrator-owned service settings can return manual/unsupported guidance | Same application API, different host/service implementation. |
229
- | Android WebView | Narrow admitted chat/inference projection for configured user-managed loopback | No general desktop raw inventory | No desktop model/service management | `managedLocalAI` remains false; listener reachability is not management authority. |
230
- | Development HTTP bridge | Only when connected to an admitted Core-backed development host | Host/method dependent | Host/method dependent; never production authority | Development transport, not a standalone-browser upgrade. |
231
- | Standalone browser | No Arcane Ollama | No | No | `ARCANE_OLLAMA_UNAVAILABLE`. |
232
- | Cloud/OpenAI | Not through `Arcane.ollama` | No | No | Use an explicitly selected `AI.js` cloud profile; no automatic fallback. |
233
-
234
- ## Capabilities and policy
235
-
236
- - `ai.inference` admits package-filtered local generation, chat, and embeddings.
237
- - `ai.models.read` admits raw model diagnostics only to authorized system apps.
238
- - `ai.models.manage` admits policy-bound managed model lifecycle operations.
239
- - `ai.settings.manage` admits Settings-owned runtime/service configuration.
240
- - `ai.models.unverified.inference` is an explicit inference-only exception for
241
- already installed, hardware-admitted unverified models when the package says
242
- `verified_only:false`; it does not admit model mutation.
243
-
244
- The method allowlist is necessary but not sufficient. Exact package-owned model
245
- definitions, reserved aliases, native resources, platform support, installed
246
- state, and exclusive mutation policy remain authoritative.
247
-
248
- ## Raw versus normalized behavior
249
-
250
- The module intentionally has two levels:
251
-
252
- | Boundary | Normalized by Arcane | Intentionally preserved |
253
- | --- | --- | --- |
254
- | Missing bridge | Throws coded `ARCANE_OLLAMA_UNAVAILABLE`. | Nothing reaches a provider. |
255
- | Core call | Promise settlement, capability/policy errors, request limits, diagnostics, stream ids/chunks. | Bounded Ollama success fields and optional provider detail. |
256
- | `readiness()` | Frozen Boolean/version/error-code snapshot. | Provider error detail is reduced to `errorCode`. |
257
- | `generateText()` / `chatText()` | Uses `String(value || '')`: documented string values pass through, truthy nonstrings stringify, and falsy nonstrings become empty. | Tool calls, timings, context, and other fields are discarded. |
258
- | `unload()` | Stable translation to `keep_alive:0`. | Final generation envelope remains provider-native. |
259
-
260
- ## Streaming, cancellation, and uncertain mutation state
261
-
262
- `generate`, `chat`, `pull`, `push`, and `create` accept stream controls through
263
- the bridge forms documented on their detailed pages. Core cooperatively cancels
264
- admitted inference methods where documented. For pull, push, create, selection,
265
- settings, or service mutation, abort/timeout/page teardown can stop renderer
266
- observation without proving host work rolled back.
267
-
268
- After an uncertain model mutation, refresh the relevant raw inventory,
269
- `selection()`, `settings()`, `serviceSettings()`, or `localAI.status()` before
270
- retrying. Do not stack a second mutation merely because the renderer timed out.
271
-
272
- ## Behavioral testing
273
-
274
- The SDK behavior suite uses an explicit fake `Arcane.ollama` to prove:
275
-
276
- - every wrapper forwards the exact argument objects and provider-native result;
277
- - stream options and signals are not rewritten;
278
- - bridge absence throws `ARCANE_OLLAMA_UNAVAILABLE` before provider work;
279
- - `readiness()` returns frozen success/failure snapshots;
280
- - `generateText()` and `chatText()` use the pinned `String(value || '')`
281
- behavior: truthy nonstrings stringify and falsy nonstrings become empty;
282
- - `unload()` sends exactly `{model, prompt: "", keep_alive: 0}`.
283
-
284
- Those tests prove the shipped renderer module. Live Core dispatch, cancellation,
285
- ArcaneOllama health, real model pulls, GPU admission, service restart, and
286
- rollback remain Arcane OS host/integration evidence.
287
-
288
- Deep implementation path: [Arcane Ollama protocol](protocols.md#arcane-ollama-protocol-path).
@@ -1,183 +0,0 @@
1
- # Availability and normalization
2
-
3
- Use this page to choose an API by capability. The compact labels tell you where
4
- it runs; the [protocol guide](protocols.md) contains the implementation detail.
5
-
6
- ## Availability labels
7
-
8
- | Label | Meaning |
9
- | --- | --- |
10
- | **Node** | Runs in the SDK's supported Node.js process. It is not a renderer API. |
11
- | **Browser** | Uses standard browser APIs and can run without a native host when its own dependencies are available. |
12
- | **Native** | Requires an admitted `globalThis.Arcane` host method or a native target provider. |
13
- | **Cloud** | Calls a remote provider over HTTPS and needs provider configuration and network policy. |
14
- | **Cross-host** | Keeps one application contract usable across supported hosts. Execution may stay in-process, use a registered provider, or cross a documented Arcane WebView2, WebKitGTK, Android WebView, or development HTTP transport. |
15
- | **Provider-native** | Intentionally returns the underlying provider's bounded envelope instead of an Arcane-normalized entity. |
16
-
17
- “Available” never means “authorized.” App grants, method allowlists, host
18
- policy, package-owned model policy, platform support, and dependency readiness
19
- are independent checks.
20
-
21
- The current native host/target matrix covers Microsoft NT, Linux, and Android
22
- where listed. It exposes no macOS target or Core host contract in this SDK
23
- version; WebKitGTK availability must not be generalized to macOS.
24
-
25
- ## Capability-first matrix
26
-
27
- | What the developer wants to do | Preferred surface | Availability | Normalization |
28
- | --- | --- | --- | --- |
29
- | Scaffold, inspect, test, package, bundle, build, verify, or run an app | `arcane` CLI or `arcane-os` package functions | **Node**; native targets invoke one explicit provider | CLI events and SDK errors/results are normalized by versioned SDK contracts. Native artifact receipts remain target-specific inside a common receipt lifecycle. |
30
- | Publish application events or review a bounded event history | `arcane-os/event-manager` | **Node** and **Browser**; optional DOM capture needs a browser DOM or compatible host | Live listeners receive original arguments. Recorded payloads and metadata become bounded, redacted, deeply frozen `arcane-event-stack/1` snapshots. The stack format is local diagnostic data, not a host transport. |
31
- | Build browser UI and app-local behavior | `/arcane/modules/*.js`, shared entities, and components | **Browser**; many modules also run inside every native renderer | Pure modules own their result contracts. Modules that call `Arcane` inherit the bridge boundary described below. |
32
- | Select and observe independent LLM/STT/TTS roles | `/arcane/modules/AIProviderRuntime.js` and `AIRuntimeState.js` | **Cross-host** controller/state; registered providers retain their own host requirements | Required/projected provider members, closed route/configuration records, and validated authority/status fields; per-role lifecycle, cancellation, stream cleanup, sticky state, and startup barriers are normalized. `localOnly` fails closed and creates no fallback. |
33
- | Run a caller-selected local LLM entirely in a browser renderer | `arcane-os/ai/browser-wasm` through `createArcaneAI()` | **Browser** only; secure context, WebAssembly, OPFS/DBOPFS, WebGPU, requested full offload, and admitted adapter/buffer/queue/fence evidence are required; no CPU fallback | The facade normalizes multi-model lifecycle, status, security precedence, effective-check disclosure, streaming, cancellation, and structural tool-call visibility. Model sources are canonical ordered file descriptors; licenses and model choice remain application policy. |
34
- | Run caller-selected Whisper or Kokoro in a browser renderer | `arcane-os/ai/browser-speech` registered with `AIProviderRuntime` | **Browser** only; DBOPFS, Web Locks, Workers, Fetch/object URLs, and a caller-supplied self-contained runtime/model closure are required | STT/TTS use independent provider/2 lifecycle and status. Immutable artifact authority, manifest-last cache, strict offline admission, cancellation, Worker teardown, and request/result shapes are normalized. No runtime/model bytes or cloud fallback are supplied. |
35
- | Preserve bounded chat history and memory | `/arcane/modules/PersistentAIChatSession.js` | **Browser / native WebView** with ChatEntity/DBOPFS and a configured chat function | Existing DBOPFS names and memory semantics are preserved. Live-context commit is atomic; durable persistence is explicit and coherent across user/assistant/tool turns. |
36
- | Search an app-owned document corpus for explicit chat context | `/arcane/modules/DBOPFSDocumentLibrary.js` | **Browser** or compatible injected DBOPFS adapter | Generation/manifest completion, bounded lexical search, partial read failures, and untrusted context labels are normalized. Construction does not search; an explicitly wired context builder performs bounded retrieval for each prepared chat send. |
37
- | Read host identity, capabilities, storage, preferences, appearance, or platform state | `globalThis.Arcane` | **Cross-host** where the method is implemented and admitted | Promise behavior and `Arcane.Error` are normalized. Result fields are normalized unless the method explicitly documents a platform-dependent snapshot. |
38
- | Use local AI without coupling app code to Ollama HTTP | `Arcane.localAI`, `Arcane.ai`, or `/arcane/modules/Ollama.js` | Primarily **Native**; Android exposes a narrower admitted inference projection | Admission, errors, and managed-operation events are normalized. Direct Ollama response envelopes remain **Provider-native**. |
39
- | Use OpenAI from the renderer profile | `/arcane/modules/AI.js` | **Cloud** from an allowed browser/native renderer | High-level AI chat/text behavior is normalized by the module; raw provider diagnostics and some response detail remain provider-specific. No automatic cloud fallback is inferred from local failure. |
40
- | Use local or cloud speech through one application helper | `/arcane/modules/AI.js` and `Arcane.speech` | **Browser**, **Native**, or **Cloud**, depending on the selected speech profile | The helper normalizes application-facing audio/text behavior; native and cloud request/response plumbing differs below that boundary. |
41
- | Inspect or manage raw Ollama models | `Arcane.ollama` or `/arcane/modules/Ollama.js` | **Native** desktop Core for management; narrower Android inference only | Wrapper method names, errors, streaming correlation, and admission are Arcane-controlled. Direct Ollama success envelopes are intentionally provider-native. |
42
- | Use native terminal, installation, user, provisioning, or machine controls | matching `Arcane.*` namespace | **Native** and app/capability restricted | Calls and errors use the common bridge contract. Platform results can be host-specific and are marked in the method guide. |
43
-
44
- ## The normalized application path
45
-
46
- For ordinary cross-platform application code:
47
-
48
- ```javascript
49
- const runtime = globalThis.Arcane?.runtime?.current?.();
50
-
51
- if (!runtime?.connected) {
52
- throw new Error('Open this application through an Arcane host.');
53
- }
54
-
55
- const access = await globalThis.Arcane.capabilities.list();
56
-
57
- if (!access.methods.includes('localAI.status')) {
58
- throw new Error('This application is not admitted for local AI.');
59
- }
60
-
61
- const status = await globalThis.Arcane.localAI.status();
62
- console.log(status.ready, status.models);
63
- ```
64
-
65
- This code does not select WebView2, WebKitGTK, or an HTTP bridge. It calls one
66
- Arcane API. The host chooses its transport, and Core applies the bound
67
- application identity and method policy.
68
-
69
- ## Normalization levels
70
-
71
- ### Fully SDK-normalized
72
-
73
- The Node toolchain uses `ArcaneError`, stable SDK error codes, structured
74
- `arcane-cli-events/1` records, normalized target descriptors, and authenticated
75
- receipt objects. Platform providers can add bounded target detail but cannot
76
- silently substitute a different target or artifact kind.
77
-
78
- The central EventManager is also host-neutral JavaScript. Its synchronous live
79
- bus preserves listener argument identity, while its optional history owns a
80
- separate diagnostic normalization boundary: snapshots are bounded, redacted,
81
- deeply frozen, and strictly importable as `arcane-event-stack/1`. DOM
82
- instrumentation adds browser diagnostics only; it does not replay browser
83
- state. See [EventManager and time-travel review](event-manager.md).
84
-
85
- ### Browser-local provider adapter
86
-
87
- [`arcane-os/ai/browser-wasm`](ai/browser-wasm.md) exposes the same
88
- provider-neutral lifecycle used by `createArcaneAI()`, while its packaged
89
- Wllama engine and caller-supplied model run inside the browser. This
90
- surface does not require an Arcane Core method grant because it does not call a
91
- Core host. Browser Fetch, CORS, storage policy, secure-context behavior, and
92
- resource limits still apply.
93
-
94
- The shipped `0.3.0` runtime requires WebGPU and has no CPU fallback. A successful
95
- load requests full GPU offload (`gpuLayers: 99999`) and admits actual adapter,
96
- full-offload, buffer, queue, and settled-fence evidence. `navigator.gpu`
97
- presence by itself is not readiness. The provider emits the instrumented
98
- `arcane.ai.browser-wasm.webgpu.adapter.selected` capability event only after
99
- admitted adapter selection evidence.
100
-
101
- `localOnly:true` describes inference after load; it does not promise that load
102
- is offline. A normal cache miss downloads from the exact caller-supplied HTTPS
103
- URL. App, provider/model-binding, and load-operation options use
104
- `{security:{secure?:boolean, checks?:{byteLength?:boolean, sha256?:boolean}}}`.
105
- Fields resolve independently from load operation to provider/model binding to
106
- app configuration to the SDK default `secure:false`; omitted fields inherit.
107
- The resolved `secure` value supplies the default for both checks, and an
108
- explicit per-check boolean overrides that default.
109
-
110
- An enabled check requires and verifies its matching descriptor field. A
111
- disabled byte-length check permits `bytes` to be absent and never compares an
112
- expected size, although the actual downloaded or cached byte count is always
113
- recorded for storage and progress metadata. A disabled SHA-256 check permits
114
- `sha256` to be absent and performs no hash or digest-only reread. Status reports
115
- the effective checks and distinguishes unchecked integrity from successful
116
- verification of the enabled checks. Only enabled checks fail closed, while
117
- successful Wllama model loading remains mandatory. `load({offline:true})` permits only a compatible
118
- cache entry and otherwise rejects with `ARCANE_AI_MODEL_OFFLINE_MISS`. Tool
119
- calls are result data for application review and dispatch; the SDK never
120
- executes them.
121
-
122
- [`arcane-os/ai/browser-speech`](ai/browser-speech.md) implements the sibling
123
- `stt` and `tts` provider/2 roles. Each caller-authenticated Whisper or Kokoro
124
- provider has its own load, use, cancellation, unload, dispose, cache, Worker,
125
- status, and error state. The SDK supplies neither speech adapter runtime bytes
126
- nor model/voice bytes; every immutable file is application-owned and admitted
127
- through an SDK-created authority and DBOPFS artifact store.
128
-
129
- The projected [`AIProviderRuntime`](runtime-modules.md#aiproviderruntimejs)
130
- normalizes those browser providers and can admit an externally supplied native
131
- or cloud provider/2 adapter. `AI.js` also supplies compatibility adapters for
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,
134
- model, or speech-runtime authority, and those adapters never probe, select,
135
- download, or fall back. The sticky
136
- [`AIRuntimeState`](runtime-modules.md#airuntimestatejs) surface keeps
137
- application UI independent of transport. A selected route remains explicit:
138
- browser failure is not permission to invoke Core or cloud.
139
-
140
- ### Arcane bridge-normalized
141
-
142
- Core-backed calls return promises and reject with `Arcane.Error`. Transport
143
- selection, request correlation, JSON framing, capability denial, diagnostics,
144
- and public operation events are normalized at the bridge. Method data contracts
145
- remain authoritative; a method that documents platform-dependent fields is not
146
- silently widened into a fictional common shape.
147
-
148
- ### Helper-normalized
149
-
150
- Renderer helpers can deliberately collapse provider detail. For example,
151
- `ollama.chatText()` returns a string extracted from the final chat envelope and
152
- `ollama.generateText()` returns a string extracted from the final generation
153
- envelope. `ollama.readiness()` returns a frozen `{ready, version, errorCode}`
154
- snapshot.
155
-
156
- ### Provider-native within an Arcane boundary
157
-
158
- Direct `Arcane.ollama.chat()`, `generate()`, `show()`, `embed()`, and lifecycle
159
- methods return bounded Ollama-compatible envelopes. Arcane still owns admission,
160
- limits, error normalization, chunk correlation, and host transport, but it does
161
- not rename every provider response field. Feature-detect optional Ollama fields
162
- and use the high-level helpers when an application needs a smaller common
163
- contract.
164
-
165
- ### Platform-dependent by design
166
-
167
- Host service settings, machine evidence, permissions, installation state, and
168
- native build artifacts can differ between Microsoft NT, Linux, Android, and a
169
- development browser. Those methods provide a stable outer contract and mark
170
- platform-specific fields or unsupported states. `supported: false` is a valid
171
- result where documented; it is not permission to bypass the host from renderer
172
- code.
173
-
174
- ## No implicit protocol or provider fallback
175
-
176
- Arcane can expose the same method over different host transports, but it does
177
- not reinterpret a failed native call as authorization to send data to a cloud
178
- provider. Provider selection is explicit application/user profile state. A
179
- remote or development HTTP bridge transports an admitted Arcane call; it is not
180
- an automatic OpenAI fallback and does not turn a standalone browser into a
181
- native host.
182
-
183
- Deep details: [protocol selection and host boundaries](protocols.md).
@@ -1,133 +0,0 @@
1
- # Behavioral testing
2
-
3
- Reference completeness and runtime behavior are different gates. The SDK uses
4
- both.
5
-
6
- Completeness is bidirectional: implementation additions require documentation,
7
- and documentation keys that no longer exist fail just as visibly.
8
-
9
- ## Fast contract path
10
-
11
- ```bash
12
- npm run test:unit
13
- npm run test:functional
14
- ```
15
-
16
- Unit coverage verifies schemas, descriptors, target contracts, error behavior,
17
- and public reference inventories. Functional coverage exercises CLI parsing and
18
- output, the development server, runtime verification, packaging, scaffolding,
19
- events, and the generated documentation/site contract.
20
-
21
- ## Full development gate
22
-
23
- ```bash
24
- npm run check
25
- ```
26
-
27
- The full check validates source policy and the exact synchronized runtime
28
- manifest, then runs the non-overlapping unit, functional, integration, and
29
- regression sets. It remains development evidence; it is not native artifact or
30
- release acceptance.
31
-
32
- ## Behavioral coverage model
33
-
34
- | Surface | Minimum behavior proved locally | Heavier evidence boundary |
35
- | --- | --- | --- |
36
- | Package entrypoints | Every declared JavaScript export imports; documented names match; constants and synchronous validators preserve their public contracts. | None for import itself. Operations that invoke tools use the matching boundary below. |
37
- | Canonical events, EventManager, and event stacks | One branded/versioned `globalThis.arcaneEvents` per realm, fail-closed collision admission, duplicate-module reuse, declared source ownership, canonical/source delivery order, frozen occurrence metadata, exact cancellation, AbortSignal cleanup, disposable subscriptions, source teardown/re-registration, observational listener failure, EventTarget compatibility, one-way DOM projection, deprecated state-free `aiRuntimeEvents`, live isolated-bus pub/sub, nested causation, immutable/redacted stacks, strict import, bounded overflow, seek, playback, and DOM privacy/lifecycle. | Real user journeys and browser layout belong in a browser harness; an occurrence, EventTarget/DOM projection, or event-stack review never proves that external side effects stopped, completed, or can be replayed. |
38
- | CLI | Commands parse, acknowledge, select one scope, produce normalized human/JSON/NDJSON output, propagate cancellation/failure, and reject invalid cardinality. | Native build/run requires the selected real provider and host. |
39
- | Browser runtime modules | Every shipped ESM module parses and its export inventory matches the catalog; pure helpers run focused success/error cases. | DOM, OPFS, media, and Web Component journeys use a browser harness. |
40
- | Provider-neutral AI runtime and chat/speech activation | Provider/2 registration, closed three-role configuration, opt-in STT startup, legacy Cloud/Core speech readiness, independent LLM/STT/TTS load/unload/status, latest-request-wins settlement, owned STT signals, TTS mute lifecycle, route-owned voice defaults, sticky-state-only readiness for both speech components, shared selected-unloaded activation request/cancellation/error behavior, fail-closed programmatic voice recording, public transcript-replacement supersession of late transcribe/save/complete settlement, `AI.fetchSTT` callback-position compatibility, stale-callback suppression, and absence of silent provider fallback are exercised against bounded providers and host callbacks. | Real model/runtime admission remains the selected provider's evidence boundary; provider-promise settlement, state, an abort signal, or an activation event does not by itself prove underlying provider work stopped or native, cloud, or browser-model availability. |
41
- | Browser-WASM local AI | The exact exported namespace, canonical ordered `{id, files:[{name?,url,bytes?,sha256?},...]}` descriptor plus its one-file compatibility input, fieldwise app/provider/load security precedence, default-unchecked and secure-check paths, observed-byte persistence, honest capability/status reasons, provider/facade lifecycle, lazy/manual policy, successful Wllama-load requirement, abort normalization, and structural-only tool behavior run with bounded deterministic providers. | An optional explicit `secure:true` verification may install the packed SDK into a real Chrome app, load authenticated Wllama 3.6.0 JS/WASM assets, perform a cold exact-length/SHA-256 model install, real inference, in-flight cancellation, unload, and verified offline reuse. That heavyweight hardening proof is not an ordinary publication gate or an implicit model download. |
42
- | Browser speech | Caller-owned Whisper/Kokoro authority, independent STT/TTS routes, ordinary direct upstream runtime/model authority, explicit `secure:true` graph admission, manifest-last DBOPFS cache, strict offline admission, independent Worker lifecycle, pre-Worker versus in-Worker cancellation, Blob/File STT conversion, WAV TTS conversion, and no cloud fallback are exercised with bounded synthetic artifacts and adapters. | A real runtime/model/voice download and actual transcription or synthesis use the application's selected upstream packages/providers, browser media support, and explicit user action. Optional strict graph evidence remains scoped to `secure:true`. |
43
- | Persistent chat and document context | Atomic in-memory/history commit, explicit per-turn persistence, single structural tool-call sequencing, bounded bootstrap/search/context, caller-source `evaluate()` budgets, cancellation, and reject versus `preserve-readable` partial coverage are exercised with app-scoped adapters. | Live Core/provider inference and durable browser storage remain separate authorities; tests never treat a fake chat function or in-memory adapter as host/storage proof. |
44
- | Core bridge docs | Canonical namespace/method/event/entity inventories match their one-per-member guides and required sections. | Live Core conformance belongs in Arcane OS because Core implementation is not shipped as SDK source. |
45
- | Arcane Ollama wrapper | Missing-host error, method forwarding, text/readiness normalization, unload request, and stream-option forwarding run against a deterministic fake `Arcane.ollama`. | Real managed-service, model download/create, GPU/resource admission, and service restart require an admitted Arcane host. |
46
- | Native providers | Plan/provider protocol, explicit target, receipt authentication, artifact reader, and unavailable-path honesty are tested with bounded fixtures. | Exact Windows, Linux, or Android artifact verification and launch must run on that actual platform/architecture. |
47
-
48
- ## Executable examples
49
-
50
- Examples should be safe to run repeatedly and should stop at the last boundary
51
- they can honestly prove. Documentation examples that would download a model,
52
- restart a service, create a user, install software, log out, delete a model, or
53
- launch an external resource define a function but do not invoke it.
54
-
55
- Behavior tests replace real authority with an explicit fake only for the public
56
- client contract. They must assert the exact request sent to the fake and the
57
- normalized result returned to the application. A fake provider never counts as
58
- native host, artifact, installation, or model-service evidence.
59
-
60
- The browser-WASM guide follows the same rule: it shows exact model authority
61
- and wiring, but leaves the download/load call behind an explicit user action.
62
- Focused contracts cover the plain security shape and fieldwise precedence from
63
- load operation to provider/model binding to app configuration to SDK default
64
- `secure:false`. They prove that omitted values inherit, the resolved `secure`
65
- value defaults both checks, and explicit per-check booleans override that
66
- default.
67
-
68
- The default path proves actual bytes are counted and persisted and Wllama
69
- confirms a loaded model without requiring descriptor `bytes` or `sha256`.
70
- Disabled byte-length checks never compare an expected count; disabled SHA-256
71
- checks never instantiate hashing or reread a multi-gigabyte file solely for a
72
- digest. Enabled-check cases prove the matching descriptor field is required and
73
- fail closed on mismatch. Status cases distinguish effective checks, per-check
74
- outcomes, and unchecked versus enabled-check-verified integrity. The authoritative
75
- browser contract separately proves the enabled secure path hashes stored and
76
- cached bytes, `AbortSignal` settles as `ARCANE_AI_REQUEST_ABORTED`, and tool-call
77
- arguments are surfaced without invoking application handlers. Model license
78
- metadata is never treated as runtime admission evidence.
79
-
80
- ## Host and normalization cases
81
-
82
- Cross-host APIs should cover at least these cases at their owning layer:
83
-
84
- 1. standalone browser with no `Arcane` host;
85
- 2. development HTTP transport with normalized request/error settlement;
86
- 3. native transport with capability admitted;
87
- 4. native transport with method or capability denied;
88
- 5. platform-dependent `supported: false` result where documented;
89
- 6. provider-native success envelope passed through unchanged;
90
- 7. helper-normalized text/readiness result;
91
- 8. stream chunk correlation and late/foreign chunk rejection;
92
- 9. abort or timeout behavior, including whether host work can continue;
93
- 10. explicit provider selection with no implicit local-to-cloud fallback.
94
-
95
- Central-event changes additionally cover the exact retention boundary:
96
- `maxEvents` ordinary records plus one terminal
97
- `TIME_TRAVEL_OVERFLOW_EVENT`, recording disabled, DOM observation stopped,
98
- continued unrecorded live delivery, rejection when re-enabling before
99
- `clearHistory()`, and strict acceptance of only a terminal overflow marker.
100
- DOM cases assert that private values, credentials, sensitive attributes, URLs,
101
- and markup remain redacted under every capture-option combination.
102
-
103
- The focused singleton contract also owns these cases in
104
- `test/event-manager.test.mjs`: global property/brand/protocol/API descriptor
105
- admission; same-object reuse across duplicate module URLs and package
106
- entrypoints; exact `subscribe(type,handler,{once,signal})` behavior; idempotent
107
- `unsubscribe()`/`unsubscribe.dispose()`; one active
108
- `createSource(owner,{source,eventTypes,onListenerError})` handle; immutable
109
- `arcane-event-occurrence/1` values and privacy separation; synchronous
110
- cancellation; dispatch-safe removal and reentry; final source disposal;
111
- EventTarget deduplication/admission; one-way `CustomEvent` projection; and
112
- nonrecursive listener-error publication. Runtime behavior tests own the
113
- `aiRuntimeEvents` compatibility view and each migrated module/component's
114
- instance-scoped projection and cleanup. Reference-completeness tests own the
115
- public export names and exact focused-guide coverage.
116
-
117
- Canonical event publication itself is deliberately synchronous and
118
- observational. Tests must not await listener return values or present
119
- `arcaneEvents` as backpressure. Promise settlement, async callback failure, and
120
- ordered delivery belong to the operation promise or `createEventQueue()` test
121
- that owns that work. Abort-driven listener removal proves cleanup only; it does
122
- not prove already-started host, provider, worker, or queue work stopped.
123
-
124
- ## Test ownership
125
-
126
- The SDK owns the singleton authority, its per-realm source adapters, package and
127
- managed-browser projections, focused event/source/DOM contracts, runtime
128
- compatibility views, package, CLI, synchronized renderer, documentation, and
129
- injected provider-boundary behavior. Arcane OS owns live Core dispatch, native host
130
- bridges, capability policy, host service adapters, and real ArcaneOllama
131
- integration. A change that crosses both repositories needs focused tests at both
132
- owners; copying a Core test into this package would not make the SDK the Core
133
- implementation owner.