space-data-module-sdk 0.8.15 → 0.8.16

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 (116) hide show
  1. package/docs/_shell/consumer-assets.html +5 -0
  2. package/docs/browser-wasmedge-isomorphic.html +261 -0
  3. package/docs/byo-wasm-quickstart.html +226 -0
  4. package/docs/byo-wasm-quickstart.md +204 -0
  5. package/docs/conformance.html +156 -0
  6. package/docs/emception-shared-memory-verdict.md +209 -0
  7. package/docs/events-abi.html +313 -0
  8. package/docs/events-abi.md +530 -0
  9. package/docs/families/analytics.html +178 -0
  10. package/docs/families/analytics.md +104 -0
  11. package/docs/families/attitude.html +157 -0
  12. package/docs/families/attitude.md +36 -0
  13. package/docs/families/behavior.html +157 -0
  14. package/docs/families/behavior.md +36 -0
  15. package/docs/families/breakup.html +157 -0
  16. package/docs/families/breakup.md +36 -0
  17. package/docs/families/conjunction.html +186 -0
  18. package/docs/families/conjunction.md +121 -0
  19. package/docs/families/data-source.html +318 -0
  20. package/docs/families/effects.html +157 -0
  21. package/docs/families/effects.md +36 -0
  22. package/docs/families/environment.html +170 -0
  23. package/docs/families/environment.md +73 -0
  24. package/docs/families/estimation.html +190 -0
  25. package/docs/families/estimation.md +128 -0
  26. package/docs/families/gnc.html +157 -0
  27. package/docs/families/gnc.md +36 -0
  28. package/docs/families/maneuver.html +209 -0
  29. package/docs/families/maneuver.md +206 -0
  30. package/docs/families/obstruction.html +191 -0
  31. package/docs/families/obstruction.md +96 -0
  32. package/docs/families/propagator.html +333 -0
  33. package/docs/families/propulsion.html +157 -0
  34. package/docs/families/propulsion.md +36 -0
  35. package/docs/families/reentry.html +157 -0
  36. package/docs/families/reentry.md +36 -0
  37. package/docs/families/rf.html +193 -0
  38. package/docs/families/rf.md +136 -0
  39. package/docs/families/scheduler.html +157 -0
  40. package/docs/families/scheduler.md +36 -0
  41. package/docs/families/sensor.html +157 -0
  42. package/docs/families/sensor.md +36 -0
  43. package/docs/families/signature.html +157 -0
  44. package/docs/families/signature.md +36 -0
  45. package/docs/flatsql-host-contract.html +176 -0
  46. package/docs/flatsql-streaming-standard.html +375 -0
  47. package/docs/gpu-module-abi.html +233 -0
  48. package/docs/harness-family-matrix.md +135 -0
  49. package/docs/index.html +216 -85
  50. package/docs/isomorphic-pthreads.html +228 -0
  51. package/docs/isomorphic-pthreads.md +84 -0
  52. package/docs/isomorphic-sdn-runtime-plan.html +274 -0
  53. package/docs/language-runtime-matrix.html +182 -0
  54. package/docs/llms.txt +86 -0
  55. package/docs/module-bundle-runtime-plan.html +146 -0
  56. package/docs/module-publication-standard.html +503 -0
  57. package/docs/node-red-default-node-parity.html +201 -0
  58. package/docs/propagator-abi.md +45 -12
  59. package/docs/protect-and-sign.html +181 -0
  60. package/docs/protect-and-sign.md +120 -0
  61. package/docs/protocol-installation.html +296 -0
  62. package/docs/publication-submission.html +158 -0
  63. package/docs/publication-submission.md +78 -0
  64. package/docs/secrets-capability.html +206 -0
  65. package/docs/styles.css +860 -167
  66. package/docs/testing-harness.html +408 -0
  67. package/docs/tri-runtime-parity-gate.html +182 -0
  68. package/docs/tri-runtime-parity.html +203 -0
  69. package/include/orbpro/orbpro_event_runner.h +951 -0
  70. package/include/orbpro/orbpro_events_abi.h +565 -0
  71. package/include/orbpro/orbpro_propagator_abi.h +17 -0
  72. package/package.json +11 -4
  73. package/schemas/orbpro/Events.fbs +501 -0
  74. package/schemas/orbpro/Propagator.fbs +72 -9
  75. package/schemas/orbpro/reference-frame-crosswalk.json +108 -0
  76. package/schemas/orbpro/reference-frame.lock.json +98 -0
  77. package/src/browser.js +13 -0
  78. package/src/generated/orbpro/events-abi.js +206 -0
  79. package/src/generated/orbpro/events-abi.ts +319 -0
  80. package/src/generated/orbpro/propagator/reference-frame.js +17 -0
  81. package/src/generated/orbpro/propagator/reference-frame.ts +91 -1
  82. package/src/generated/orbpro/propagator-abi.js +17 -0
  83. package/src/generated/orbpro/propagator-abi.ts +17 -0
  84. package/src/generated/spacedatastandards/plg/CCT.d.ts +94 -0
  85. package/src/generated/spacedatastandards/plg/CCT.d.ts.map +1 -0
  86. package/src/generated/spacedatastandards/plg/CCT.js +208 -0
  87. package/src/generated/spacedatastandards/plg/CCT.ts +281 -0
  88. package/src/generated/spacedatastandards/plg/CCTCategory.d.ts +98 -0
  89. package/src/generated/spacedatastandards/plg/CCTCategory.d.ts.map +1 -0
  90. package/src/generated/spacedatastandards/plg/CCTCategory.js +177 -0
  91. package/src/generated/spacedatastandards/plg/CCTCategory.ts +269 -0
  92. package/src/generated/spacedatastandards/plg/CCTCategoryRollup.d.ts +54 -0
  93. package/src/generated/spacedatastandards/plg/CCTCategoryRollup.d.ts.map +1 -0
  94. package/src/generated/spacedatastandards/plg/CCTCategoryRollup.js +106 -0
  95. package/src/generated/spacedatastandards/plg/CCTCategoryRollup.ts +144 -0
  96. package/src/generated/spacedatastandards/plg/PLG.d.ts +46 -2
  97. package/src/generated/spacedatastandards/plg/PLG.d.ts.map +1 -1
  98. package/src/generated/spacedatastandards/plg/PLG.js +78 -5
  99. package/src/generated/spacedatastandards/plg/PLG.ts +90 -5
  100. package/src/generated/spacedatastandards/plg/capabilityClass.d.ts +181 -0
  101. package/src/generated/spacedatastandards/plg/capabilityClass.d.ts.map +1 -0
  102. package/src/generated/spacedatastandards/plg/capabilityClass.js +183 -0
  103. package/src/generated/spacedatastandards/plg/capabilityClass.ts +208 -0
  104. package/src/generated/spacedatastandards/plg/main.d.ts +4 -0
  105. package/src/generated/spacedatastandards/plg/main.d.ts.map +1 -1
  106. package/src/generated/spacedatastandards/plg/main.js +4 -0
  107. package/src/generated/spacedatastandards/plg/main.ts +4 -0
  108. package/src/generated/spacedatastandards/plg/pluginCategory.d.ts +40 -2
  109. package/src/generated/spacedatastandards/plg/pluginCategory.d.ts.map +1 -1
  110. package/src/generated/spacedatastandards/plg/pluginCategory.js +40 -2
  111. package/src/generated/spacedatastandards/plg/pluginCategory.ts +40 -2
  112. package/src/host/browserModuleHarness.js +8 -0
  113. package/src/host/wasiThreadHost.js +189 -14
  114. package/src/index.d.ts +18 -1
  115. package/src/transport/index.js +16 -0
  116. package/src/transport/records.js +1015 -3
@@ -0,0 +1,5 @@
1
+ <!-- SDN_CONSUMER_ASSETS_START -->
2
+ <link rel="stylesheet" href="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.c3f68d1cfd88478f10d836a5e829d1dfc6a10157972cf0f7d4d319d0636f2cc4.css" integrity="sha384-fICuhN4I9xqOK1F5vGGzl26opuO+xQIvTZXMSV76lWTBiQ6AfzztMGLLDw8yRT8i" crossorigin="anonymous">
3
+ <script defer src="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.f611e7e151a3b5c38384272f8894a4c6634f0a29bf925b0e02e0e27f8db0bfff.js" integrity="sha384-R+QqsKoWJIS7iWrtPmgJ49DVnb1hSGjZokupbLInJd1PLp8RwQhtF/hnaerc33ci" crossorigin="anonymous" data-sdn-wallet-public-client="v1"></script>
4
+ <script defer src="https://static.spacedatanetwork.org/assets/sdn-stack-nav/1.0.0/sdn-stack-nav.52fde607eee38ffa116188201f50258ed50bd18c9f06c1af9678f763147a8fe5.js" integrity="sha384-dgeojhJ8vTszHXIbv7O7nZcEzqD10oUYYJjBmPrV7+kLQEUlXLQD4ek5Q7HOFiO5" crossorigin="anonymous" data-nav-style-url="https://static.spacedatanetwork.org/assets/sdn-stack-nav/1.0.0/sdn-stack-nav.36a36359ce18322185e9ff179f88175bab67d5ad84a14d9c08a54f2ff27267e7.css" data-nav-style-integrity="sha384-c4M8Fg+kYaeOYYtJVr7jJsde24IhSWkWaRyAOHEZU9jozhRck089aw+mnHwxymds" data-wallet-client-url="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.f611e7e151a3b5c38384272f8894a4c6634f0a29bf925b0e02e0e27f8db0bfff.js" data-wallet-client-integrity="sha384-R+QqsKoWJIS7iWrtPmgJ49DVnb1hSGjZokupbLInJd1PLp8RwQhtF/hnaerc33ci" data-wallet-style-url="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.c3f68d1cfd88478f10d836a5e829d1dfc6a10157972cf0f7d4d319d0636f2cc4.css" data-wallet-style-integrity="sha384-fICuhN4I9xqOK1F5vGGzl26opuO+xQIvTZXMSV76lWTBiQ6AfzztMGLLDw8yRT8i" data-wallet-client-id="sdn-module-sdk-pages-v1" data-wallet-callback-uri="https://digitalarsenal.github.io/space-data-module-sdk/wallet-callback.html" data-wallet-registry-sha256="e1ce6fe903c9700484a8a87d96581c8cad97063dabf63030b4518a31a3bdaa93"></script>
5
+ <!-- SDN_CONSUMER_ASSETS_END -->
@@ -0,0 +1,261 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <meta name="description" content="Use this profile when you want one compiled .wasm artifact that can be loaded" />
7
+ <title>Browser / WasmEdge isomorphism — Space Data Module SDK</title>
8
+ <link rel="stylesheet" href="./styles.css" />
9
+ <!-- SDN_CONSUMER_ASSETS_START -->
10
+ <link rel="stylesheet" href="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.c3f68d1cfd88478f10d836a5e829d1dfc6a10157972cf0f7d4d319d0636f2cc4.css" integrity="sha384-fICuhN4I9xqOK1F5vGGzl26opuO+xQIvTZXMSV76lWTBiQ6AfzztMGLLDw8yRT8i" crossorigin="anonymous">
11
+ <script defer src="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.f611e7e151a3b5c38384272f8894a4c6634f0a29bf925b0e02e0e27f8db0bfff.js" integrity="sha384-R+QqsKoWJIS7iWrtPmgJ49DVnb1hSGjZokupbLInJd1PLp8RwQhtF/hnaerc33ci" crossorigin="anonymous" data-sdn-wallet-public-client="v1"></script>
12
+ <script defer src="https://static.spacedatanetwork.org/assets/sdn-stack-nav/1.0.0/sdn-stack-nav.52fde607eee38ffa116188201f50258ed50bd18c9f06c1af9678f763147a8fe5.js" integrity="sha384-dgeojhJ8vTszHXIbv7O7nZcEzqD10oUYYJjBmPrV7+kLQEUlXLQD4ek5Q7HOFiO5" crossorigin="anonymous" data-nav-style-url="https://static.spacedatanetwork.org/assets/sdn-stack-nav/1.0.0/sdn-stack-nav.36a36359ce18322185e9ff179f88175bab67d5ad84a14d9c08a54f2ff27267e7.css" data-nav-style-integrity="sha384-c4M8Fg+kYaeOYYtJVr7jJsde24IhSWkWaRyAOHEZU9jozhRck089aw+mnHwxymds" data-wallet-client-url="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.f611e7e151a3b5c38384272f8894a4c6634f0a29bf925b0e02e0e27f8db0bfff.js" data-wallet-client-integrity="sha384-R+QqsKoWJIS7iWrtPmgJ49DVnb1hSGjZokupbLInJd1PLp8RwQhtF/hnaerc33ci" data-wallet-style-url="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.c3f68d1cfd88478f10d836a5e829d1dfc6a10157972cf0f7d4d319d0636f2cc4.css" data-wallet-style-integrity="sha384-fICuhN4I9xqOK1F5vGGzl26opuO+xQIvTZXMSV76lWTBiQ6AfzztMGLLDw8yRT8i" data-wallet-client-id="sdn-module-sdk-pages-v1" data-wallet-callback-uri="https://digitalarsenal.github.io/space-data-module-sdk/wallet-callback.html" data-wallet-registry-sha256="e1ce6fe903c9700484a8a87d96581c8cad97063dabf63030b4518a31a3bdaa93"></script>
13
+ <!-- SDN_CONSUMER_ASSETS_END -->
14
+ </head>
15
+ <body>
16
+ <a class="skip-link" href="#main">Skip to content</a>
17
+ <sdn-stack-nav active="module-sdk"></sdn-stack-nav>
18
+ <header class="site-header">
19
+ <a class="site-brand" href="./">Space Data Module SDK</a>
20
+ <nav class="header-links" aria-label="Site">
21
+ <a href="./byo-wasm-quickstart.html">Quickstart</a>
22
+ <a href="./conformance.html">Conformance</a>
23
+ <a href="https://github.com/DigitalArsenal/space-data-module-sdk">GitHub</a>
24
+ <a class="stack-button" href="#stack">Stack</a>
25
+ </nav>
26
+ </header>
27
+ <div class="shell">
28
+ <nav class="sidebar" id="sidebar" aria-label="Documentation">
29
+ <h2>Start here</h2><ul>
30
+ <li><a href="./index.html"><span>Harness family matrix</span></a></li>
31
+ <li><a href="./byo-wasm-quickstart.html"><span>BYO-wasm quickstart</span></a></li>
32
+ <li><a href="./conformance.html"><span>Conformance kit</span></a></li>
33
+ <li><a href="./protect-and-sign.html"><span>Protect and sign</span></a></li>
34
+ <li><a href="./publication-submission.html"><span>Publication and listing</span></a></li>
35
+ </ul>
36
+ <h2>Dynamics</h2><ul>
37
+ <li><a href="./families/propagator.html"><span>Propagator</span><span class="tag tag-shipped">shipped</span></a></li>
38
+ <li><a href="./families/maneuver.html"><span>Maneuver</span><span class="tag tag-experimental">experimental</span></a></li>
39
+ <li><a href="./families/propulsion.html"><span>Propulsion</span><span class="tag tag-planned">planned</span></a></li>
40
+ <li><a href="./families/attitude.html"><span>Attitude</span><span class="tag tag-planned">planned</span></a></li>
41
+ <li><a href="./families/gnc.html"><span>GNC</span><span class="tag tag-planned">planned</span></a></li>
42
+ </ul>
43
+ <h2>Environment and interaction</h2><ul>
44
+ <li><a href="./families/rf.html"><span>RF</span><span class="tag tag-designed">designed</span></a></li>
45
+ <li><a href="./families/sensor.html"><span>Sensor</span><span class="tag tag-planned">planned</span></a></li>
46
+ <li><a href="./families/signature.html"><span>Signature</span><span class="tag tag-planned">planned</span></a></li>
47
+ <li><a href="./families/environment.html"><span>Environment</span><span class="tag tag-planned">planned</span></a></li>
48
+ <li><a href="./families/obstruction.html"><span>Obstruction</span><span class="tag tag-designed">designed</span></a></li>
49
+ </ul>
50
+ <h2>Event physics</h2><ul>
51
+ <li><a href="./families/breakup.html"><span>Breakup</span><span class="tag tag-planned">planned</span></a></li>
52
+ <li><a href="./families/reentry.html"><span>Reentry</span><span class="tag tag-planned">planned</span></a></li>
53
+ <li><a href="./families/conjunction.html"><span>Conjunction</span><span class="tag tag-designed">designed</span></a></li>
54
+ <li><a href="./families/effects.html"><span>Effects</span><span class="tag tag-planned">planned</span></a></li>
55
+ </ul>
56
+ <h2>Estimation, data and logic</h2><ul>
57
+ <li><a href="./families/estimation.html"><span>Estimation</span><span class="tag tag-experimental">experimental</span></a></li>
58
+ <li><a href="./families/data-source.html"><span>Data source</span><span class="tag tag-shipped">shipped</span></a></li>
59
+ <li><a href="./families/analytics.html"><span>Analytics</span><span class="tag tag-experimental">experimental</span></a></li>
60
+ <li><a href="./families/scheduler.html"><span>Scheduler</span><span class="tag tag-planned">planned</span></a></li>
61
+ <li><a href="./families/behavior.html"><span>Behavior</span><span class="tag tag-planned">planned</span></a></li>
62
+ </ul>
63
+ <h2>Runtime contract</h2><ul>
64
+ <li><a href="./events-abi.html"><span>Event locator ABI</span></a></li>
65
+ <li><a href="./module-publication-standard.html"><span>Module publication standard</span></a></li>
66
+ <li><a href="./browser-wasmedge-isomorphic.html" aria-current="page"><span>Browser / WasmEdge isomorphism</span></a></li>
67
+ <li><a href="./isomorphic-pthreads.html"><span>Isomorphic pthreads</span></a></li>
68
+ <li><a href="./tri-runtime-parity.html"><span>Tri-runtime parity</span></a></li>
69
+ <li><a href="./tri-runtime-parity-gate.html"><span>Tri-runtime parity gate</span></a></li>
70
+ <li><a href="./testing-harness.html"><span>Testing harness</span></a></li>
71
+ <li><a href="./language-runtime-matrix.html"><span>Language and runtime matrix</span></a></li>
72
+ </ul>
73
+ <h2>Host surfaces</h2><ul>
74
+ <li><a href="./flatsql-host-contract.html"><span>FlatSQL host contract</span></a></li>
75
+ <li><a href="./flatsql-streaming-standard.html"><span>FlatSQL streaming standard</span></a></li>
76
+ <li><a href="./secrets-capability.html"><span>Credential lanes</span></a></li>
77
+ <li><a href="./protocol-installation.html"><span>Protocol installation</span></a></li>
78
+ <li><a href="./gpu-module-abi.html"><span>GPU module ABI</span></a></li>
79
+ <li><a href="./module-bundle-runtime-plan.html"><span>Module bundle runtime</span></a></li>
80
+ <li><a href="./isomorphic-sdn-runtime-plan.html"><span>Isomorphic SDN runtime</span></a></li>
81
+ <li><a href="./node-red-default-node-parity.html"><span>Node-RED node parity</span></a></li>
82
+ </ul>
83
+ </nav>
84
+ <main class="doc" id="main">
85
+ <h1>Browser / WasmEdge isomorphism</h1>
86
+ <p>Use this profile when you want one compiled <code>.wasm</code> artifact that can be loaded unchanged in:</p>
87
+ <ul>
88
+ <li>the browser harness</li>
89
+ <li>the WasmEdge command/runtime harness</li>
90
+ </ul>
91
+ <h2 id="canonical-build-rule"><a class="anchor" href="#canonical-build-rule" aria-hidden="true">#</a>Canonical Build Rule</h2>
92
+ <p>Declare:</p>
93
+ <div class="codeblock"><div class="codeblock-head">json</div><pre><code>{
94
+ &quot;runtimeTargets&quot;: [&quot;browser&quot;, &quot;wasmedge&quot;]
95
+ }</code></pre></div>
96
+ <p>That target pair now defaults to the shared <code>single-thread</code> artifact profile.</p>
97
+ <p>The compiler logic lives in <code>src/compiler/compileModule.js</code>.</p>
98
+ <p>The practical effect is:</p>
99
+ <ul>
100
+ <li><code>[&quot;wasmedge&quot;]</code> keeps the higher-capability WasmEdge pthread default</li>
101
+ <li><code>[&quot;browser&quot;, &quot;wasmedge&quot;]</code> chooses the portable single-thread artifact instead</li>
102
+ </ul>
103
+ <p>Use the pure <code>[&quot;wasmedge&quot;]</code> target when you want maximum WasmEdge-native guest capability and do not need browser loading from the same binary.</p>
104
+ <h3 id="pthreads-variant-shared-memory-isomorphic-threading"><a class="anchor" href="#pthreads-variant-shared-memory-isomorphic-threading" aria-hidden="true">#</a>Pthreads variant (shared-memory, isomorphic threading)</h3>
105
+ <p>When a module needs real guest threads (the <code>emscripten-pthreads</code> thread model, default for <code>[&quot;wasmedge&quot;]</code>), the SDK compiles it through the <strong>wasi-threads</strong> toolchain (<code>clang --target=wasm32-wasip1-threads -pthread</code>), <strong>not</strong> Emscripten <code>-pthread</code> (which emits a browser-only Web-Worker build that cannot thread under WasmEdge). It <strong>enforces</strong> the wasi-threads link flags and <strong>validates the emitted <code>.wasm</code></strong> — the artifact must import <code>wasi.thread-spawn</code>, export <code>wasi_thread_start</code>, be a shared-memory/atomics wasm, and carry no Emscripten worker hooks, or the compile is rejected. That guardrail is documented in <a href="./isomorphic-pthreads.html"><code>docs/isomorphic-pthreads.md</code></a>. This present document covers the portable <code>single-thread</code> loading profile; read the pthreads doc before shipping a threaded WasmEdge artifact.</p>
106
+ <h2 id="cross-origin-isolation-is-required-for-any-wasi-threadswasi-sequential-guest"><a class="anchor" href="#cross-origin-isolation-is-required-for-any-wasi-threadswasi-sequential-guest" aria-hidden="true">#</a>Cross-Origin Isolation Is Required For Any wasi-threads/wasi-sequential Guest</h2>
107
+ <p><strong>Settled policy</strong> (<code>module-sdk-target-forces-sab-coop-coep</code>, arbitrated 2026-07-28, closed 2026-08-06): a host serving a module built through the <code>wasm32-wasip1-threads</code> toolchain — the <code>emscripten-pthreads</code> (real threading) model <strong>or</strong> the <code>wasi-sequential</code> model — to a browser MUST serve that page cross-origin isolated (<code>Cross-Origin-Opener-Policy: same-origin</code> + <code>Cross-Origin-Embedder-Policy: require-corp</code>, or the equivalent). There is no build-flag escape hatch:</p>
108
+ <ul>
109
+ <li><code>--target=wasm32-wasip1-threads</code> with <strong>zero</strong> feature flags still emits <code>+atomics</code> — the triple implies atomics.</li>
110
+ <li>A driver-default link on that triple declares a <strong>shared</strong> memory (limits flags <code>0x03</code>) with no <code>--shared-memory</code>/<code>--import-memory</code> on the link line.</li>
111
+ <li><code>--no-shared-memory</code> is not a wasm-ld flag. Nothing in <code>compileModule.js</code> can produce an unshared artifact on this triple. See the guardrail chain in <code>src/compiler/pthreadArtifactGuard.js</code> (<code>assertSequentialArtifact</code>) and <a href="./isomorphic-pthreads.html"><code>docs/isomorphic-pthreads.md</code></a>.</li>
112
+ </ul>
113
+ <p>This means an inherently-sequential guest (<code>wasi-sequential</code>, no real threading) still needs a shared-memory instantiation — same as a real threaded guest — because it shares the same compiled triple. The portable <strong><code>single-thread</code></strong> profile this document otherwise covers (Emscripten/ emception, the <code>[&quot;browser&quot;]</code> / <code>[&quot;browser&quot;,&quot;wasmedge&quot;]</code> default: no shared memory, no atomics) is the one exception and needs <strong>no</strong> cross-origin isolation. Check which profile a guest actually uses — <code>runtimeTargets</code> alone does not tell you; an explicit <code>threadModel</code> does — before assuming either way.</p>
114
+ <p><strong>How production achieves it today</strong> (both patterns are live and <code>crossOriginIsolated</code>-verified, not hypothetical):</p>
115
+ <ol>
116
+ <li><strong>Native headers</strong>, when the host directly fronts the origin (e.g. a Caddy-fronted droplet): set <code>Cross-Origin-Opener-Policy: same-origin</code> and <code>Cross-Origin-Embedder-Policy: require-corp</code> at the web server, which survives a CDN in front of it.</li>
117
+ <li><strong>A COI service worker</strong>, when the host is a static CDN that cannot set custom response headers (GitHub Pages is the concrete case: Pages sends no COOP/COEP at all). The worker intercepts navigation/asset fetches and re-serves them with the isolation headers injected, then the page does one capped self-heal reload. Reference implementation: <code>coi-serviceworker.js</code> + <code>coi-bootstrap.js</code> in the <code>spaceaware-ui</code> (<code>sdn-js</code>) and OrbPro Pages surfaces — verified live via <code>window.crossOriginIsolated === true</code> and <code>typeof SharedArrayBuffer !== &quot;undefined&quot;</code> in a real browser, per <code>deployment/topology.json</code>. Do not invent a second shim; port that one.</li>
118
+ </ol>
119
+ <p>Either path additionally constrains <strong>every other subresource</strong> the page loads to be CORP/CORS-clean under <code>require-corp</code> — third-party embeds, fonts, tiles, imagery all have to cooperate. This is exactly the surface the standing &quot;node UIs load ZERO external-origin bytes&quot; law removes as a concern for the surfaces that already follow it; a new module-serving surface that does NOT yet follow that law has to solve subresource compatibility separately, before COI, not after.</p>
120
+ <p><strong>The guardrail, concretely</strong>: verify <code>crossOriginIsolated</code>/<code>SharedArrayBuffer</code> with a real browser (<code>live-verify.mjs</code>-style, not a raw <code>curl -I</code> — a service-worker-injected header is invisible to a plain HTTP request) as part of standing up ANY new surface that serves a <code>wasi-threads</code>/<code>wasi-sequential</code> artifact, before assuming module instantiation works. A silent regression here fails as an instantiation error in the browser console, not a build error — there is currently no automated CI check for it; add one alongside the new surface's own verify tooling rather than assuming this document is enough.</p>
121
+ <h2 id="canonical-module-repo-layout"><a class="anchor" href="#canonical-module-repo-layout" aria-hidden="true">#</a>Canonical Module Repo Layout</h2>
122
+ <p>Module repos should publish the shared compiled artifact under a stable runtime path, not a plugin-named filename:</p>
123
+ <ul>
124
+ <li>required: <code>dist/isomorphic/module.wasm</code></li>
125
+ </ul>
126
+ <p>If a repo also ships a browser-specific adapter, place it under:</p>
127
+ <ul>
128
+ <li>optional: <code>dist/browser/module.js</code></li>
129
+ <li>optional: <code>dist/browser/module.wasm</code></li>
130
+ </ul>
131
+ <p>That keeps the artifact name stable across repos and lets runtime intent live in the path rather than in the filename.</p>
132
+ <h2 id="toolchain-options"><a class="anchor" href="#toolchain-options" aria-hidden="true">#</a>Toolchain Options</h2>
133
+ <p>The recommended browser-side build selector for module repos is:</p>
134
+ <ul>
135
+ <li><code>SDN_WASM_TOOLCHAIN=local-emsdk</code>: default. Build with a repo-local <code>deps/emsdk</code> checkout and avoid Homebrew or any other machine-global Emscripten install.</li>
136
+ <li><code>SDN_WASM_TOOLCHAIN=sdn-emception</code>: optional SDK-first path for repos that use <code>compileModuleFromSource(...)</code> or an SDK-driven build script to emit the shared <code>dist/isomorphic/module.wasm</code> artifact.</li>
137
+ <li><code>SDN_WASM_TOOLCHAIN=path</code>: explicit escape hatch when a repo intentionally wants to use a preinstalled Emscripten toolchain from <code>PATH</code>.</li>
138
+ </ul>
139
+ <p>The isomorphic contract is the compiled wasm path, not the browser wrapper. A repo can publish only <code>dist/isomorphic/module.wasm</code> and still satisfy the browser/WasmEdge shared-artifact requirement when it loads through the SDK harnesses.</p>
140
+ <h2 id="loader-entry-points"><a class="anchor" href="#loader-entry-points" aria-hidden="true">#</a>Loader Entry Points</h2>
141
+ <p>The supported browser/WasmEdge entry points are:</p>
142
+ <ul>
143
+ <li>browser entry bundle: <code>src/browser.js</code></li>
144
+ <li>isomorphic loader: <code>src/host/isomorphicLoader.js</code></li>
145
+ <li>browser harness: <code>src/host/browserModuleHarness.js</code></li>
146
+ <li>browser WASI shim: <code>src/host/wasiShim.js</code></li>
147
+ <li>browser edge shims: <code>src/host/browserEdgeShims.js</code></li>
148
+ <li>browser host adapter: <code>src/host/browserHost.js</code></li>
149
+ </ul>
150
+ <p>On the server path, <code>loadModule(...)</code> now chooses the raw WasmEdge command harness automatically for standalone artifacts with <code>_start</code>. The <code>--serve-plugin-invoke</code> runner protocol remains available for explicit runtime-host / runner-backed flows.</p>
151
+ <h2 id="what-the-browser-shims-cover"><a class="anchor" href="#what-the-browser-shims-cover" aria-hidden="true">#</a>What The Browser Shims Cover</h2>
152
+ <p>The browser edge shims map host capabilities onto browser-native surfaces:</p>
153
+ <ul>
154
+ <li><code>filesystem</code>: in-memory virtual filesystem with <code>resolvePath</code>, <code>readFile</code>, <code>writeFile</code>, <code>appendFile</code>, <code>deleteFile</code>, <code>mkdir</code>, <code>readdir</code>, <code>stat</code>, <code>rename</code></li>
155
+ <li><code>http</code>: <code>fetch</code></li>
156
+ <li><code>websocket</code>: browser <code>WebSocket</code></li>
157
+ <li><code>network</code>: async browser-host dispatch that routes to the available transport adapters</li>
158
+ <li><code>ipfs</code>, <code>protocol_handle</code>, <code>protocol_dial</code>: async browser-host adapters that can be supplied by the embedding runtime</li>
159
+ <li><code>clock</code>, <code>random</code>, <code>timers</code>, <code>schedule_cron</code>, <code>context_*</code>, <code>crypto_*</code>: browser-native implementations in the browser host adapter</li>
160
+ </ul>
161
+ <p>These are host shims, not raw WasmEdge socket imports. When an embedding host needs to override the reference behavior, pass <code>capabilityAdapters</code> keyed by the canonical capability ids. That same generic async capability boundary is shared by <code>BrowserHost</code>, <code>NodeHost</code>, <code>createRuntimeHost()</code>, <code>loadModule(...)</code>, and <code>createBrowserModuleHarness(...)</code>.</p>
162
+ <h2 id="current-boundary"><a class="anchor" href="#current-boundary" aria-hidden="true">#</a>Current Boundary</h2>
163
+ <p>One binary can load in both browser and WasmEdge today when it stays within the shared profile:</p>
164
+ <ul>
165
+ <li>standalone WASI imports</li>
166
+ <li>optional sync <code>space_data_module_host</code> imports</li>
167
+ <li>command invoke surfaces through <code>_start</code> on WasmEdge and direct or command invoke surfaces in the browser harness</li>
168
+ <li>no Emscripten pthread imports</li>
169
+ </ul>
170
+ <p>Not browser-portable from the same raw guest binary:</p>
171
+ <ul>
172
+ <li>WasmEdge-native socket/TLS extension imports</li>
173
+ <li>pthread-oriented <code>env.*</code> imports</li>
174
+ <li>raw guest async hostcalls that need a broader ABI than the current sync <code>space_data_module_host</code> bridge</li>
175
+ </ul>
176
+ <p>Today’s portable split is:</p>
177
+ <ul>
178
+ <li>the guest-visible <code>space_data_module_host</code> import remains a sync-only subset for sync-safe operations</li>
179
+ <li>the host and harness APIs can still await filesystem, network, IPFS, and protocol adapters through the generic async capability boundary in both browser and Node-hosted test/runtime flows</li>
180
+ </ul>
181
+ <p>For browser-hosted networking and IPFS/protocol work, use the browser edge shims or host-delegated adapters instead of relying on raw WasmEdge socket extensions.</p>
182
+ <h2 id="checked-in-demo"><a class="anchor" href="#checked-in-demo" aria-hidden="true">#</a>Checked-In Demo</h2>
183
+ <p>The canonical example is:</p>
184
+ <ul>
185
+ <li><code>examples/isomorphic-loader/README.md</code></li>
186
+ </ul>
187
+ <p>That example includes:</p>
188
+ <ul>
189
+ <li>manifest: <code>examples/isomorphic-loader/manifest.json</code></li>
190
+ <li>guest source: <code>examples/isomorphic-loader/module.c</code></li>
191
+ <li>build script: <code>examples/isomorphic-loader/build-demo.mjs</code></li>
192
+ <li>browser loader: <code>examples/isomorphic-loader/browser-demo.mjs</code></li>
193
+ <li>browser page: <code>examples/isomorphic-loader/browser-demo.html</code></li>
194
+ <li>WasmEdge loader: <code>examples/isomorphic-loader/wasmedge-demo.mjs</code></li>
195
+ </ul>
196
+ <p>Both demos load the same generated artifact:</p>
197
+ <ul>
198
+ <li><code>examples/isomorphic-loader/generated/dist/isomorphic/module.wasm</code></li>
199
+ </ul>
200
+ <h2 id="streaming-into-the-same-artifact"><a class="anchor" href="#streaming-into-the-same-artifact" aria-hidden="true">#</a>Streaming Into The Same Artifact</h2>
201
+ <p>If that shared artifact owns resident state, such as an SDN module that imports <code>flatsql</code> internally, stream raw FlatBuffer frames into the live instance with <code>createModuleFlatBufferStreamPump(...)</code>.</p>
202
+ <p>Use:</p>
203
+ <ul>
204
+ <li>a persistent <code>direct</code> browser harness for browser-resident state</li>
205
+ <li>a persistent runtime-backed harness on the server/WasmEdge side</li>
206
+ <li>chunked size-prefixed FlatBuffer stream input</li>
207
+ <li>many small invokes, not one monolithic invoke envelope</li>
208
+ </ul>
209
+ <p>That path is documented in <code>docs/flatsql-streaming-standard.md</code>.</p>
210
+
211
+ <p class="doc-footer">
212
+ Source of truth for this page:
213
+ <code>docs/browser-wasmedge-isomorphic.md</code>. Regenerate with
214
+ <code>npm run build:docs</code>.
215
+ </p>
216
+ </main>
217
+ <nav class="rail" aria-label="On this page"><h2>On this page</h2><ul><li><a class="depth-2" href="#canonical-build-rule">Canonical Build Rule</a></li>
218
+ <li><a class="depth-3" href="#pthreads-variant-shared-memory-isomorphic-threading">Pthreads variant (shared-memory, isomorphic threading)</a></li>
219
+ <li><a class="depth-2" href="#cross-origin-isolation-is-required-for-any-wasi-threadswasi-sequential-guest">Cross-Origin Isolation Is Required For Any wasi-threads/wasi-sequential Guest</a></li>
220
+ <li><a class="depth-2" href="#canonical-module-repo-layout">Canonical Module Repo Layout</a></li>
221
+ <li><a class="depth-2" href="#toolchain-options">Toolchain Options</a></li>
222
+ <li><a class="depth-2" href="#loader-entry-points">Loader Entry Points</a></li>
223
+ <li><a class="depth-2" href="#what-the-browser-shims-cover">What The Browser Shims Cover</a></li>
224
+ <li><a class="depth-2" href="#current-boundary">Current Boundary</a></li>
225
+ <li><a class="depth-2" href="#checked-in-demo">Checked-In Demo</a></li>
226
+ <li><a class="depth-2" href="#streaming-into-the-same-artifact">Streaming Into The Same Artifact</a></li></ul></nav>
227
+ </div>
228
+ <section id="stack" class="section" aria-labelledby="stack-title">
229
+ <div class="section-head">
230
+ <p class="eyebrow">SDN Stack</p>
231
+ <h2 id="stack-title">Connected sites</h2>
232
+ </div>
233
+ <div class="link-list">
234
+ <a href="https://spacedatastandards.org/">
235
+ <span>Standards</span>
236
+ <small>Canonical schemas, record contracts, and generated bindings.</small>
237
+ </a>
238
+ <a href="https://digitalarsenal.github.io/flatbuffers/">
239
+ <span>FlatBuffers</span>
240
+ <small>Binary encoding, schema tooling, and runtime documentation.</small>
241
+ </a>
242
+ <a href="https://digitalarsenal.github.io/flatsql/">
243
+ <span>FlatSQL</span>
244
+ <small>SQL-style queries over FlatBuffer-backed datasets and streams.</small>
245
+ </a>
246
+ <a href="https://spacedatanetwork.org/">
247
+ <span>SDN</span>
248
+ <small>Distributed publication, discovery, delivery, and marketplace infrastructure.</small>
249
+ </a>
250
+ <a href="https://digitalarsenal.github.io/space-data-module-sdk/" class="active">
251
+ <span>Module SDK</span>
252
+ <small>WASM module packaging, validation, and host compatibility tooling.</small>
253
+ </a>
254
+ </div>
255
+ </section>
256
+ <footer class="site-footer">
257
+ Space Data Module SDK — Apache-2.0. Every ABI page renders a Markdown
258
+ source in <code>docs/</code>; edit the Markdown, never the HTML.
259
+ </footer>
260
+ </body>
261
+ </html>
@@ -0,0 +1,226 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <meta name="description" content="Bring your own WebAssembly. This is the vendor path: you compile your existing" />
7
+ <title>BYO-wasm quickstart — Space Data Module SDK</title>
8
+ <link rel="stylesheet" href="./styles.css" />
9
+ <!-- SDN_CONSUMER_ASSETS_START -->
10
+ <link rel="stylesheet" href="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.c3f68d1cfd88478f10d836a5e829d1dfc6a10157972cf0f7d4d319d0636f2cc4.css" integrity="sha384-fICuhN4I9xqOK1F5vGGzl26opuO+xQIvTZXMSV76lWTBiQ6AfzztMGLLDw8yRT8i" crossorigin="anonymous">
11
+ <script defer src="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.f611e7e151a3b5c38384272f8894a4c6634f0a29bf925b0e02e0e27f8db0bfff.js" integrity="sha384-R+QqsKoWJIS7iWrtPmgJ49DVnb1hSGjZokupbLInJd1PLp8RwQhtF/hnaerc33ci" crossorigin="anonymous" data-sdn-wallet-public-client="v1"></script>
12
+ <script defer src="https://static.spacedatanetwork.org/assets/sdn-stack-nav/1.0.0/sdn-stack-nav.52fde607eee38ffa116188201f50258ed50bd18c9f06c1af9678f763147a8fe5.js" integrity="sha384-dgeojhJ8vTszHXIbv7O7nZcEzqD10oUYYJjBmPrV7+kLQEUlXLQD4ek5Q7HOFiO5" crossorigin="anonymous" data-nav-style-url="https://static.spacedatanetwork.org/assets/sdn-stack-nav/1.0.0/sdn-stack-nav.36a36359ce18322185e9ff179f88175bab67d5ad84a14d9c08a54f2ff27267e7.css" data-nav-style-integrity="sha384-c4M8Fg+kYaeOYYtJVr7jJsde24IhSWkWaRyAOHEZU9jozhRck089aw+mnHwxymds" data-wallet-client-url="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.f611e7e151a3b5c38384272f8894a4c6634f0a29bf925b0e02e0e27f8db0bfff.js" data-wallet-client-integrity="sha384-R+QqsKoWJIS7iWrtPmgJ49DVnb1hSGjZokupbLInJd1PLp8RwQhtF/hnaerc33ci" data-wallet-style-url="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.c3f68d1cfd88478f10d836a5e829d1dfc6a10157972cf0f7d4d319d0636f2cc4.css" data-wallet-style-integrity="sha384-fICuhN4I9xqOK1F5vGGzl26opuO+xQIvTZXMSV76lWTBiQ6AfzztMGLLDw8yRT8i" data-wallet-client-id="sdn-module-sdk-pages-v1" data-wallet-callback-uri="https://digitalarsenal.github.io/space-data-module-sdk/wallet-callback.html" data-wallet-registry-sha256="e1ce6fe903c9700484a8a87d96581c8cad97063dabf63030b4518a31a3bdaa93"></script>
13
+ <!-- SDN_CONSUMER_ASSETS_END -->
14
+ </head>
15
+ <body>
16
+ <a class="skip-link" href="#main">Skip to content</a>
17
+ <sdn-stack-nav active="module-sdk"></sdn-stack-nav>
18
+ <header class="site-header">
19
+ <a class="site-brand" href="./">Space Data Module SDK</a>
20
+ <nav class="header-links" aria-label="Site">
21
+ <a href="./byo-wasm-quickstart.html">Quickstart</a>
22
+ <a href="./conformance.html">Conformance</a>
23
+ <a href="https://github.com/DigitalArsenal/space-data-module-sdk">GitHub</a>
24
+ <a class="stack-button" href="#stack">Stack</a>
25
+ </nav>
26
+ </header>
27
+ <div class="shell">
28
+ <nav class="sidebar" id="sidebar" aria-label="Documentation">
29
+ <h2>Start here</h2><ul>
30
+ <li><a href="./index.html"><span>Harness family matrix</span></a></li>
31
+ <li><a href="./byo-wasm-quickstart.html" aria-current="page"><span>BYO-wasm quickstart</span></a></li>
32
+ <li><a href="./conformance.html"><span>Conformance kit</span></a></li>
33
+ <li><a href="./protect-and-sign.html"><span>Protect and sign</span></a></li>
34
+ <li><a href="./publication-submission.html"><span>Publication and listing</span></a></li>
35
+ </ul>
36
+ <h2>Dynamics</h2><ul>
37
+ <li><a href="./families/propagator.html"><span>Propagator</span><span class="tag tag-shipped">shipped</span></a></li>
38
+ <li><a href="./families/maneuver.html"><span>Maneuver</span><span class="tag tag-experimental">experimental</span></a></li>
39
+ <li><a href="./families/propulsion.html"><span>Propulsion</span><span class="tag tag-planned">planned</span></a></li>
40
+ <li><a href="./families/attitude.html"><span>Attitude</span><span class="tag tag-planned">planned</span></a></li>
41
+ <li><a href="./families/gnc.html"><span>GNC</span><span class="tag tag-planned">planned</span></a></li>
42
+ </ul>
43
+ <h2>Environment and interaction</h2><ul>
44
+ <li><a href="./families/rf.html"><span>RF</span><span class="tag tag-designed">designed</span></a></li>
45
+ <li><a href="./families/sensor.html"><span>Sensor</span><span class="tag tag-planned">planned</span></a></li>
46
+ <li><a href="./families/signature.html"><span>Signature</span><span class="tag tag-planned">planned</span></a></li>
47
+ <li><a href="./families/environment.html"><span>Environment</span><span class="tag tag-planned">planned</span></a></li>
48
+ <li><a href="./families/obstruction.html"><span>Obstruction</span><span class="tag tag-designed">designed</span></a></li>
49
+ </ul>
50
+ <h2>Event physics</h2><ul>
51
+ <li><a href="./families/breakup.html"><span>Breakup</span><span class="tag tag-planned">planned</span></a></li>
52
+ <li><a href="./families/reentry.html"><span>Reentry</span><span class="tag tag-planned">planned</span></a></li>
53
+ <li><a href="./families/conjunction.html"><span>Conjunction</span><span class="tag tag-designed">designed</span></a></li>
54
+ <li><a href="./families/effects.html"><span>Effects</span><span class="tag tag-planned">planned</span></a></li>
55
+ </ul>
56
+ <h2>Estimation, data and logic</h2><ul>
57
+ <li><a href="./families/estimation.html"><span>Estimation</span><span class="tag tag-experimental">experimental</span></a></li>
58
+ <li><a href="./families/data-source.html"><span>Data source</span><span class="tag tag-shipped">shipped</span></a></li>
59
+ <li><a href="./families/analytics.html"><span>Analytics</span><span class="tag tag-experimental">experimental</span></a></li>
60
+ <li><a href="./families/scheduler.html"><span>Scheduler</span><span class="tag tag-planned">planned</span></a></li>
61
+ <li><a href="./families/behavior.html"><span>Behavior</span><span class="tag tag-planned">planned</span></a></li>
62
+ </ul>
63
+ <h2>Runtime contract</h2><ul>
64
+ <li><a href="./events-abi.html"><span>Event locator ABI</span></a></li>
65
+ <li><a href="./module-publication-standard.html"><span>Module publication standard</span></a></li>
66
+ <li><a href="./browser-wasmedge-isomorphic.html"><span>Browser / WasmEdge isomorphism</span></a></li>
67
+ <li><a href="./isomorphic-pthreads.html"><span>Isomorphic pthreads</span></a></li>
68
+ <li><a href="./tri-runtime-parity.html"><span>Tri-runtime parity</span></a></li>
69
+ <li><a href="./tri-runtime-parity-gate.html"><span>Tri-runtime parity gate</span></a></li>
70
+ <li><a href="./testing-harness.html"><span>Testing harness</span></a></li>
71
+ <li><a href="./language-runtime-matrix.html"><span>Language and runtime matrix</span></a></li>
72
+ </ul>
73
+ <h2>Host surfaces</h2><ul>
74
+ <li><a href="./flatsql-host-contract.html"><span>FlatSQL host contract</span></a></li>
75
+ <li><a href="./flatsql-streaming-standard.html"><span>FlatSQL streaming standard</span></a></li>
76
+ <li><a href="./secrets-capability.html"><span>Credential lanes</span></a></li>
77
+ <li><a href="./protocol-installation.html"><span>Protocol installation</span></a></li>
78
+ <li><a href="./gpu-module-abi.html"><span>GPU module ABI</span></a></li>
79
+ <li><a href="./module-bundle-runtime-plan.html"><span>Module bundle runtime</span></a></li>
80
+ <li><a href="./isomorphic-sdn-runtime-plan.html"><span>Isomorphic SDN runtime</span></a></li>
81
+ <li><a href="./node-red-default-node-parity.html"><span>Node-RED node parity</span></a></li>
82
+ </ul>
83
+ </nav>
84
+ <main class="doc" id="main">
85
+ <h1>BYO-wasm quickstart</h1>
86
+ <p>Bring your own WebAssembly. This is the vendor path: you compile your existing C or C++ with your own build system, against the pinned toolchain and the family ABI header, and hand the SDK a finished <code>module.wasm</code>. You do not need access to any private repository, and you do not have to route your source through the SDK's own compiler.</p>
87
+ <p>If you would rather have the SDK drive the compiler for you, the <code>space-data-module compile</code> command exists and applies the same toolchain resolution described below. The BYO lane is the supported path for a vendor with an established build.</p>
88
+ <h2 id="1-the-toolchain-pin"><a class="anchor" href="#1-the-toolchain-pin" aria-hidden="true">#</a>1. The toolchain pin</h2>
89
+ <p>This is the only sanctioned toolchain for a guest module, and it is not negotiable:</p>
90
+ <blockquote><p>Compile guest modules with <code>clang --target=wasm32-wasip1-threads</code> (WASI SDK, pinned by the repository's CI workflows). This is the ONLY sanctioned toolchain for <code>module.wasm</code>. <code>emcc -pthread</code> is FORBIDDEN for module compilation: Emscripten's pthread model is browser-only and cannot thread under WasmEdge, which breaks tri-runtime isomorphism (see <a href="./isomorphic-pthreads.html">Isomorphic pthreads</a>). Modules must be EH-free. <code>flowcc</code> composes a runtime from prebuilt objects; it is not a WASI rebuild step.</p></blockquote>
91
+ <p>The template headers carry the same one-line doctrine: <code>Build: clang --target=wasm32-wasip1-threads (never emcc -pthread)</code>.</p>
92
+ <h3 id="toolchain-triples"><a class="anchor" href="#toolchain-triples" aria-hidden="true">#</a>Toolchain triples</h3>
93
+ <div class="table-wrap"><table><thead><tr><th>Purpose</th><th>Value</th></tr></thead><tbody><tr><td>Compile target</td><td><code>wasm32-wasip1-threads</code></td></tr><tr><td>Sysroot triple (threads libc / libc++)</td><td><code>wasm32-wasip1-threads</code></td></tr><tr><td>Resource-dir triple (compiler-rt builtins)</td><td><code>wasm32-unknown-wasip1-threads</code></td></tr><tr><td>Default drivers on <code>PATH</code></td><td><code>wasm32-wasi-clang</code>, <code>wasm32-wasi-clang++</code></td></tr></tbody></table></div>
94
+ <p>The SDK resolves the sysroot by looking for <code>lib/wasm32-wasip1-threads/libc.a</code> under, in order, <code>/opt/homebrew/share/wasi-sysroot</code>, <code>/usr/local/share/wasi-sysroot</code>, <code>/opt/wasi-sdk/share/wasi-sysroot</code>, and versioned Homebrew cellar paths. It resolves the resource directory by looking for <code>lib/wasm32-unknown-wasip1-threads/libclang_rt.builtins.a</code> under <code>/opt/homebrew/share/wasi-runtimes</code>, <code>/usr/local/share/wasi-runtimes</code>, and the versioned cellar equivalents.</p>
95
+ <p>If nothing is found the SDK tells you exactly this:</p>
96
+ <blockquote><p>Install a wasi-sdk / wasi-libc+wasi-runtimes toolchain with the wasm32-wasip1-threads target (e.g. <code>brew install wasi-libc wasi-runtimes</code> or a wasi-sdk release), or set the <code>SDN_WASI_*</code> env overrides.</p></blockquote>
97
+ <h3 id="environment-overrides"><a class="anchor" href="#environment-overrides" aria-hidden="true">#</a>Environment overrides</h3>
98
+ <p>Set these when your toolchain lives somewhere else — for example inside your own container image:</p>
99
+ <div class="table-wrap"><table><thead><tr><th>Variable</th><th>Overrides</th></tr></thead><tbody><tr><td><code>SDN_WASI_CLANG</code></td><td>C driver binary</td></tr><tr><td><code>SDN_WASI_CLANGXX</code></td><td>C++ driver binary</td></tr><tr><td><code>SDN_WASI_TARGET</code></td><td>Compile target triple</td></tr><tr><td><code>SDN_WASI_SYSROOT</code></td><td>Sysroot path</td></tr><tr><td><code>SDN_WASI_RESOURCE_DIR</code></td><td>compiler-rt resource directory</td></tr></tbody></table></div>
100
+ <h2 id="2-the-flag-set"><a class="anchor" href="#2-the-flag-set" aria-hidden="true">#</a>2. The flag set</h2>
101
+ <p>Object files are compiled with atomics, no exceptions, and threads:</p>
102
+ <div class="codeblock"><div class="codeblock-head">sh</div><pre><code>wasm32-wasi-clang++ \
103
+ --target=wasm32-wasip1-threads \
104
+ --sysroot=&quot;$WASI_SYSROOT&quot; \
105
+ -resource-dir=&quot;$WASI_RESOURCE_DIR&quot; \
106
+ -matomics -fno-exceptions -pthread \
107
+ -O2 -c src/my_module.cpp -o build/my_module.o</code></pre></div>
108
+ <p>The link step adds the shared-memory and imported-memory contract:</p>
109
+ <div class="codeblock"><div class="codeblock-head">sh</div><pre><code>wasm32-wasi-clang++ \
110
+ --target=wasm32-wasip1-threads \
111
+ --sysroot=&quot;$WASI_SYSROOT&quot; \
112
+ -resource-dir=&quot;$WASI_RESOURCE_DIR&quot; \
113
+ -pthread -matomics -mbulk-memory \
114
+ -Wl,--import-memory -Wl,--shared-memory -Wl,--max-memory=2147483648 \
115
+ -O2 build/*.o -o dist/isomorphic/module.wasm</code></pre></div>
116
+ <p><code>-pthread -matomics -mbulk-memory -Wl,--import-memory -Wl,--shared-memory -Wl,--max-memory=2147483648</code> is the enforced flag set. A module linked without it will not satisfy the parity gate.</p>
117
+ <h3 id="multi-translation-unit-builds"><a class="anchor" href="#multi-translation-unit-builds" aria-hidden="true">#</a>Multi-translation-unit builds</h3>
118
+ <p>Nothing about the contract is single-file. Compile every translation unit with the object-file flags above and link them in one step. A minimal <code>Makefile</code>:</p>
119
+ <div class="codeblock"><div class="codeblock-head">make</div><pre><code>WASI_SYSROOT ?= /opt/homebrew/share/wasi-sysroot
120
+ WASI_RESOURCE_DIR ?= /opt/homebrew/share/wasi-runtimes
121
+ CXX := wasm32-wasi-clang++
122
+
123
+ TARGET_FLAGS := --target=wasm32-wasip1-threads \
124
+ --sysroot=$(WASI_SYSROOT) \
125
+ -resource-dir=$(WASI_RESOURCE_DIR)
126
+ CXXFLAGS := $(TARGET_FLAGS) -matomics -fno-exceptions -pthread -O2 -Iinclude
127
+ LDFLAGS := $(TARGET_FLAGS) -pthread -matomics -mbulk-memory \
128
+ -Wl,--import-memory -Wl,--shared-memory \
129
+ -Wl,--max-memory=2147483648 -O2
130
+
131
+ SRCS := $(wildcard src/*.cpp)
132
+ OBJS := $(SRCS:src/%.cpp=build/%.o)
133
+
134
+ dist/isomorphic/module.wasm: $(OBJS)
135
+ @mkdir -p $(dir $@)
136
+ $(CXX) $(LDFLAGS) $(OBJS) -o $@
137
+
138
+ build/%.o: src/%.cpp
139
+ @mkdir -p build
140
+ $(CXX) $(CXXFLAGS) -c $&lt; -o $@
141
+
142
+ clean:
143
+ rm -rf build dist</code></pre></div>
144
+ <p>Constraints that bite in practice:</p>
145
+ <ul>
146
+ <li><strong>EH-free.</strong> Compile with <code>-fno-exceptions</code>. Do not throw across the ABI boundary; return a named negative error code instead.</li>
147
+ <li><strong>No <code>emcc</code>.</strong> Not for one translation unit, not for a dependency, not &quot;temporarily for the browser build&quot;. One artifact serves every runtime.</li>
148
+ <li><strong>No host-specific imports.</strong> The parity gate classifies your import set against the declared host contract and fails on a forbidden import class.</li>
149
+ </ul>
150
+ <h2 id="3-implement-the-family-abi"><a class="anchor" href="#3-implement-the-family-abi" aria-hidden="true">#</a>3. Implement the family ABI</h2>
151
+ <p>Pick your family from the <a href="./index.html">harness family matrix</a> and implement exactly the export set that family's page names. Include the family's generated ABI header from the SDK — do not hand-write the struct layouts, because the headers carry <code>_Static_assert</code> size and offset locks that are the whole point of the generated wire contract.</p>
152
+ <div class="codeblock"><div class="codeblock-head">cpp</div><pre><code>#include &lt;orbpro/orbpro_propagator_abi.h&gt;</code></pre></div>
153
+ <p>The SDK ships the headers under <code>include/</code> and exports them through the package (<code>space-data-module-sdk/include/*</code>), so a vendor consuming the SDK from npm gets the same bytes the generator produced.</p>
154
+ <h2 id="4-declare-the-manifest"><a class="anchor" href="#4-declare-the-manifest" aria-hidden="true">#</a>4. Declare the manifest</h2>
155
+ <p>A module carries an embedded manifest declaring its plugin id, family, invoke surface, runtime targets, methods, ports, and the standards record types it consumes and emits. See the <a href="./module-publication-standard.html">module publication standard</a> for the record layout and <a href="./conformance.html">conformance</a> for what is checked.</p>
156
+ <blockquote><p><strong>Status: still being built.</strong> There is no tool today that stamps a manifest onto a binary produced by a foreign toolchain. Manifest normalization and codecs exist for modules authored inside the SDK's own build path, but a <code>manifest inject</code> verb for a BYO binary does not exist yet — it is Sprint 1 of the third-party integration program. Until it lands, a BYO vendor supplies the manifest JSON alongside the artifact and the manifest is attached for them.</p></blockquote>
157
+ <h2 id="5-prove-it-then-ship-it"><a class="anchor" href="#5-prove-it-then-ship-it" aria-hidden="true">#</a>5. Prove it, then ship it</h2>
158
+ <div class="codeblock"><div class="codeblock-head">sh</div><pre><code># ABI conformance for your family
159
+ space-data-module conformance propagator --artifact ./dist/isomorphic/module.wasm
160
+
161
+ # tri-runtime parity: browser + WasmEdge + Docker WasmEdge, byte-identical
162
+ space-data-module parity \
163
+ --wasm ./dist/isomorphic/module.wasm \
164
+ --fixture ./fixtures/parity/basic.json \
165
+ --lanes browser,wasmedge,docker-wasmedge</code></pre></div>
166
+ <p>Then continue with <a href="./conformance.html">Conformance kit</a>, <a href="./protect-and-sign.html">Protect and sign</a>, and <a href="./publication-submission.html">Publication and listing</a>.</p>
167
+ <h2 id="honest-gaps-in-this-lane"><a class="anchor" href="#honest-gaps-in-this-lane" aria-hidden="true">#</a>Honest gaps in this lane</h2>
168
+ <p>These are checked statements about the SDK today, not future tense for its own sake:</p>
169
+ <ul>
170
+ <li>The toolchain flags and triples above are real and enforced, but they are applied by the SDK's internal compiler resolver. The <code>Makefile</code> on this page is a documented recipe assembled from those enforced values; the repository does not yet ship a <code>Makefile</code>, <code>CMakeLists.txt</code> or <code>build.sh</code> template for a hand-rolled multi-TU build.</li>
171
+ <li><code>conformance --self-test</code> currently accepts only the <code>propagator</code> family. Any other family argument raises an unknown-family error.</li>
172
+ <li>Manifest injection for foreign-compiled binaries does not exist yet.</li>
173
+ <li>There is no self-serve listing submission command yet. See <a href="./publication-submission.html">Publication and listing</a>.</li>
174
+ </ul>
175
+ <p>An escorted pilot is possible today: a vendor delivers a BYO artifact and the gates are run and the module listed by hand. The program above is what makes that self-serve.</p>
176
+
177
+ <p class="doc-footer">
178
+ Source of truth for this page:
179
+ <code>docs/byo-wasm-quickstart.md</code>. Regenerate with
180
+ <code>npm run build:docs</code>.
181
+ </p>
182
+ </main>
183
+ <nav class="rail" aria-label="On this page"><h2>On this page</h2><ul><li><a class="depth-2" href="#1-the-toolchain-pin">1. The toolchain pin</a></li>
184
+ <li><a class="depth-3" href="#toolchain-triples">Toolchain triples</a></li>
185
+ <li><a class="depth-3" href="#environment-overrides">Environment overrides</a></li>
186
+ <li><a class="depth-2" href="#2-the-flag-set">2. The flag set</a></li>
187
+ <li><a class="depth-3" href="#multi-translation-unit-builds">Multi-translation-unit builds</a></li>
188
+ <li><a class="depth-2" href="#3-implement-the-family-abi">3. Implement the family ABI</a></li>
189
+ <li><a class="depth-2" href="#4-declare-the-manifest">4. Declare the manifest</a></li>
190
+ <li><a class="depth-2" href="#5-prove-it-then-ship-it">5. Prove it, then ship it</a></li>
191
+ <li><a class="depth-2" href="#honest-gaps-in-this-lane">Honest gaps in this lane</a></li></ul></nav>
192
+ </div>
193
+ <section id="stack" class="section" aria-labelledby="stack-title">
194
+ <div class="section-head">
195
+ <p class="eyebrow">SDN Stack</p>
196
+ <h2 id="stack-title">Connected sites</h2>
197
+ </div>
198
+ <div class="link-list">
199
+ <a href="https://spacedatastandards.org/">
200
+ <span>Standards</span>
201
+ <small>Canonical schemas, record contracts, and generated bindings.</small>
202
+ </a>
203
+ <a href="https://digitalarsenal.github.io/flatbuffers/">
204
+ <span>FlatBuffers</span>
205
+ <small>Binary encoding, schema tooling, and runtime documentation.</small>
206
+ </a>
207
+ <a href="https://digitalarsenal.github.io/flatsql/">
208
+ <span>FlatSQL</span>
209
+ <small>SQL-style queries over FlatBuffer-backed datasets and streams.</small>
210
+ </a>
211
+ <a href="https://spacedatanetwork.org/">
212
+ <span>SDN</span>
213
+ <small>Distributed publication, discovery, delivery, and marketplace infrastructure.</small>
214
+ </a>
215
+ <a href="https://digitalarsenal.github.io/space-data-module-sdk/" class="active">
216
+ <span>Module SDK</span>
217
+ <small>WASM module packaging, validation, and host compatibility tooling.</small>
218
+ </a>
219
+ </div>
220
+ </section>
221
+ <footer class="site-footer">
222
+ Space Data Module SDK — Apache-2.0. Every ABI page renders a Markdown
223
+ source in <code>docs/</code>; edit the Markdown, never the HTML.
224
+ </footer>
225
+ </body>
226
+ </html>