@mostra/cli 0.0.0-placeholder → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +17 -1
  3. package/dist/bin.d.ts +1 -0
  4. package/dist/bin.js +79 -0
  5. package/dist/bin.js.map +1 -0
  6. package/dist/bootstrap-DfEe_yPr.js +113 -0
  7. package/dist/bootstrap-DfEe_yPr.js.map +1 -0
  8. package/dist/exit-CBIf8nAU.js +79 -0
  9. package/dist/exit-CBIf8nAU.js.map +1 -0
  10. package/dist/flush-BCuWs0Zh.js +718 -0
  11. package/dist/flush-BCuWs0Zh.js.map +1 -0
  12. package/dist/index.d.ts +230 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +3 -0
  15. package/dist/reference/cli.md +977 -0
  16. package/dist/reference/diagnostics.json +1255 -0
  17. package/dist/reference/errors/MOSTRA_A11Y_MINOR.md +23 -0
  18. package/dist/reference/errors/MOSTRA_A11Y_SERIOUS.md +23 -0
  19. package/dist/reference/errors/MOSTRA_ACTION_CANCELLED.md +23 -0
  20. package/dist/reference/errors/MOSTRA_ACTION_EVENT_INVALID.md +23 -0
  21. package/dist/reference/errors/MOSTRA_ACTION_EXPORT_INVALID.md +23 -0
  22. package/dist/reference/errors/MOSTRA_ACTION_INTERRUPTED.md +23 -0
  23. package/dist/reference/errors/MOSTRA_ACTION_RUN_NOT_FOUND.md +23 -0
  24. package/dist/reference/errors/MOSTRA_ACTION_THREW.md +23 -0
  25. package/dist/reference/errors/MOSTRA_ACTION_TOO_LARGE.md +23 -0
  26. package/dist/reference/errors/MOSTRA_ACTION_UNKNOWN_FUNCTION.md +23 -0
  27. package/dist/reference/errors/MOSTRA_ACTION_UNSERIALIZABLE.md +23 -0
  28. package/dist/reference/errors/MOSTRA_ARTIFACT_DIR_NOT_EMPTY.md +23 -0
  29. package/dist/reference/errors/MOSTRA_ARTIFACT_ENTRY_AMBIGUOUS.md +23 -0
  30. package/dist/reference/errors/MOSTRA_ARTIFACT_NOT_FOUND.md +23 -0
  31. package/dist/reference/errors/MOSTRA_ARTIFACT_NO_ENTRY.md +23 -0
  32. package/dist/reference/errors/MOSTRA_ARTIFACT_NO_PAGE.md +23 -0
  33. package/dist/reference/errors/MOSTRA_ARTIFACT_SOURCE_MISSING.md +23 -0
  34. package/dist/reference/errors/MOSTRA_ARTIFACT_SOURCE_UNREADABLE.md +23 -0
  35. package/dist/reference/errors/MOSTRA_ARTIFACT_TEMPLATE_UNKNOWN.md +23 -0
  36. package/dist/reference/errors/MOSTRA_ARTIFACT_VERSION_COLLECTED.md +23 -0
  37. package/dist/reference/errors/MOSTRA_ARTIFACT_VERSION_NOT_FOUND.md +23 -0
  38. package/dist/reference/errors/MOSTRA_BUILD_CRASHED.md +23 -0
  39. package/dist/reference/errors/MOSTRA_BUILD_FAILED.md +23 -0
  40. package/dist/reference/errors/MOSTRA_BUILD_TIMEOUT.md +23 -0
  41. package/dist/reference/errors/MOSTRA_BUILD_UNRESOLVED.md +23 -0
  42. package/dist/reference/errors/MOSTRA_CLI_CONFIG_UNWRITABLE.md +23 -0
  43. package/dist/reference/errors/MOSTRA_CLI_UNKNOWN_COMMAND.md +23 -0
  44. package/dist/reference/errors/MOSTRA_CLI_USAGE.md +23 -0
  45. package/dist/reference/errors/MOSTRA_CONSOLE_ERROR.md +23 -0
  46. package/dist/reference/errors/MOSTRA_CONSOLE_WARNING.md +23 -0
  47. package/dist/reference/errors/MOSTRA_DEP_INSTALL_FAILED.md +23 -0
  48. package/dist/reference/errors/MOSTRA_DEP_MISSING.md +23 -0
  49. package/dist/reference/errors/MOSTRA_DEP_NOT_FOUND.md +23 -0
  50. package/dist/reference/errors/MOSTRA_DEP_OFFLINE.md +23 -0
  51. package/dist/reference/errors/MOSTRA_DEP_SPEC_INVALID.md +23 -0
  52. package/dist/reference/errors/MOSTRA_DEP_TIMEOUT.md +23 -0
  53. package/dist/reference/errors/MOSTRA_DEP_WARM_CONFLICT.md +23 -0
  54. package/dist/reference/errors/MOSTRA_ENV_BIND_FAILED.md +23 -0
  55. package/dist/reference/errors/MOSTRA_ENV_BROWSER_MISSING.md +23 -0
  56. package/dist/reference/errors/MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED.md +23 -0
  57. package/dist/reference/errors/MOSTRA_ENV_BUNDLE_INVALID.md +23 -0
  58. package/dist/reference/errors/MOSTRA_ENV_BUNDLE_UNAVAILABLE.md +23 -0
  59. package/dist/reference/errors/MOSTRA_ENV_NODE_UNSUPPORTED.md +23 -0
  60. package/dist/reference/errors/MOSTRA_ENV_PORT_TAKEN.md +23 -0
  61. package/dist/reference/errors/MOSTRA_ENV_RUNTIME_MISSING.md +23 -0
  62. package/dist/reference/errors/MOSTRA_ENV_SERVICE_FAILED.md +23 -0
  63. package/dist/reference/errors/MOSTRA_ENV_SHELL_MISSING.md +23 -0
  64. package/dist/reference/errors/MOSTRA_ENV_WARM_MISSING.md +23 -0
  65. package/dist/reference/errors/MOSTRA_FIELD_CONFLICT.md +23 -0
  66. package/dist/reference/errors/MOSTRA_FIELD_DUPLICATE_ID.md +23 -0
  67. package/dist/reference/errors/MOSTRA_FIELD_ID_INVALID.md +23 -0
  68. package/dist/reference/errors/MOSTRA_FIELD_ID_UNSTABLE.md +23 -0
  69. package/dist/reference/errors/MOSTRA_FIELD_MUTATION_ID_REUSED.md +23 -0
  70. package/dist/reference/errors/MOSTRA_FIELD_SHARED.md +23 -0
  71. package/dist/reference/errors/MOSTRA_FIELD_TOO_LARGE.md +23 -0
  72. package/dist/reference/errors/MOSTRA_FIELD_UNBOUND.md +23 -0
  73. package/dist/reference/errors/MOSTRA_HOME_DISK_FULL.md +23 -0
  74. package/dist/reference/errors/MOSTRA_HOME_GC_INCOMPLETE.md +23 -0
  75. package/dist/reference/errors/MOSTRA_HOME_GONE.md +23 -0
  76. package/dist/reference/errors/MOSTRA_HOME_INTEGRITY.md +23 -0
  77. package/dist/reference/errors/MOSTRA_HOME_LEDGER_UNREADABLE.md +23 -0
  78. package/dist/reference/errors/MOSTRA_HOME_LOCKED.md +23 -0
  79. package/dist/reference/errors/MOSTRA_HOME_MISMATCH.md +23 -0
  80. package/dist/reference/errors/MOSTRA_HOME_NOT_ALWAYS_ON.md +23 -0
  81. package/dist/reference/errors/MOSTRA_HOME_NOT_OWNED.md +23 -0
  82. package/dist/reference/errors/MOSTRA_HOME_SOCKET_TOO_LONG.md +23 -0
  83. package/dist/reference/errors/MOSTRA_HOME_TOO_NEW.md +23 -0
  84. package/dist/reference/errors/MOSTRA_HOST_CONNECTION_CLOSED.md +23 -0
  85. package/dist/reference/errors/MOSTRA_HOST_CURSOR_COMPACTED.md +23 -0
  86. package/dist/reference/errors/MOSTRA_HOST_INITIALIZE_ORDER.md +23 -0
  87. package/dist/reference/errors/MOSTRA_HOST_INTERNAL_ERROR.md +23 -0
  88. package/dist/reference/errors/MOSTRA_HOST_INVALID_PARAMS.md +23 -0
  89. package/dist/reference/errors/MOSTRA_HOST_MALFORMED.md +23 -0
  90. package/dist/reference/errors/MOSTRA_HOST_MESSAGE_TOO_LARGE.md +23 -0
  91. package/dist/reference/errors/MOSTRA_HOST_METHOD_UNKNOWN.md +23 -0
  92. package/dist/reference/errors/MOSTRA_HOST_NOTIFICATION_UNSUPPORTED.md +23 -0
  93. package/dist/reference/errors/MOSTRA_HOST_PORT_UNSUPPORTED.md +23 -0
  94. package/dist/reference/errors/MOSTRA_HOST_REQUEST_ID_REUSED.md +23 -0
  95. package/dist/reference/errors/MOSTRA_HOST_REVISION_UNSUPPORTED.md +23 -0
  96. package/dist/reference/errors/MOSTRA_HOST_SHUTDOWN_REFUSED.md +23 -0
  97. package/dist/reference/errors/MOSTRA_HOST_SUBSCRIPTION_UNKNOWN.md +23 -0
  98. package/dist/reference/errors/MOSTRA_HOST_TIMEOUT.md +23 -0
  99. package/dist/reference/errors/MOSTRA_HYGIENE_CONTENT_TYPE.md +23 -0
  100. package/dist/reference/errors/MOSTRA_HYGIENE_CSRF_MISSING.md +23 -0
  101. package/dist/reference/errors/MOSTRA_HYGIENE_HEADERS_TOO_LARGE.md +23 -0
  102. package/dist/reference/errors/MOSTRA_HYGIENE_HOST_REFUSED.md +23 -0
  103. package/dist/reference/errors/MOSTRA_HYGIENE_NOT_SERVED.md +23 -0
  104. package/dist/reference/errors/MOSTRA_HYGIENE_ORIGIN_REFUSED.md +23 -0
  105. package/dist/reference/errors/MOSTRA_HYGIENE_RATE_LIMITED.md +23 -0
  106. package/dist/reference/errors/MOSTRA_HYGIENE_REQUEST_MALFORMED.md +23 -0
  107. package/dist/reference/errors/MOSTRA_HYGIENE_SCOPE_DENIED.md +23 -0
  108. package/dist/reference/errors/MOSTRA_HYGIENE_SESSION_CONFLICT.md +23 -0
  109. package/dist/reference/errors/MOSTRA_HYGIENE_SESSION_MISSING.md +23 -0
  110. package/dist/reference/errors/MOSTRA_HYGIENE_TOKEN_INVALID.md +23 -0
  111. package/dist/reference/errors/MOSTRA_HYGIENE_TOKEN_REVOKED.md +23 -0
  112. package/dist/reference/errors/MOSTRA_LIVE_SOURCE_FAILED.md +23 -0
  113. package/dist/reference/errors/MOSTRA_LIVE_TOO_LARGE.md +23 -0
  114. package/dist/reference/errors/MOSTRA_MANIFEST_INVALID.md +23 -0
  115. package/dist/reference/errors/MOSTRA_MANIFEST_NOT_LITERAL.md +23 -0
  116. package/dist/reference/errors/MOSTRA_MANIFEST_UNKNOWN_KEY.md +23 -0
  117. package/dist/reference/errors/MOSTRA_NETWORK_EXTERNAL_FAILED.md +23 -0
  118. package/dist/reference/errors/MOSTRA_NETWORK_REQUEST_FAILED.md +23 -0
  119. package/dist/reference/errors/MOSTRA_PLATFORM_UNSUPPORTED.md +23 -0
  120. package/dist/reference/errors/MOSTRA_PUBLISH_ID_CONFLICT.md +23 -0
  121. package/dist/reference/errors/MOSTRA_PUBLISH_SOURCE_CHANGED.md +23 -0
  122. package/dist/reference/errors/MOSTRA_PUBLISH_VERIFY_FAILED.md +23 -0
  123. package/dist/reference/errors/MOSTRA_REGRESSION_ACTION_REMOVED.md +23 -0
  124. package/dist/reference/errors/MOSTRA_REGRESSION_ARIA.md +23 -0
  125. package/dist/reference/errors/MOSTRA_REGRESSION_FIELD_REMOVED.md +23 -0
  126. package/dist/reference/errors/MOSTRA_REGRESSION_LIVE_REMOVED.md +23 -0
  127. package/dist/reference/errors/MOSTRA_REGRESSION_PAGE_REMOVED.md +23 -0
  128. package/dist/reference/errors/MOSTRA_REGRESSION_PIXELS.md +23 -0
  129. package/dist/reference/errors/MOSTRA_RUNTIME_BLANK.md +23 -0
  130. package/dist/reference/errors/MOSTRA_RUNTIME_NOT_READY.md +23 -0
  131. package/dist/reference/errors/MOSTRA_RUNTIME_PAGE_ERROR.md +23 -0
  132. package/dist/reference/errors/MOSTRA_RUNTIME_WORKER_CRASHED.md +23 -0
  133. package/dist/reference/errors/MOSTRA_RUNTIME_WORKER_PARKED.md +23 -0
  134. package/dist/reference/errors/MOSTRA_SECRET_MISSING.md +23 -0
  135. package/dist/reference/errors/MOSTRA_SMOKE_BUDGET.md +23 -0
  136. package/dist/reference/errors/MOSTRA_SMOKE_NO_EFFECT.md +23 -0
  137. package/dist/reference/errors/MOSTRA_SUBMIT_ALREADY.md +23 -0
  138. package/dist/reference/errors/MOSTRA_SUBMIT_BLOCKED.md +23 -0
  139. package/dist/reference/errors/MOSTRA_SUBMIT_CHANNEL_DENIED.md +23 -0
  140. package/dist/reference/errors/MOSTRA_SUBMIT_NOT_FOUND.md +23 -0
  141. package/dist/reference/errors/MOSTRA_SUBMIT_POLICY_NONE.md +23 -0
  142. package/dist/reference/errors/MOSTRA_SUBMIT_REVISION_MOVED.md +23 -0
  143. package/dist/reference/errors/MOSTRA_SUBMIT_SIGNAL_INVALID.md +23 -0
  144. package/dist/reference/errors/MOSTRA_SUBMIT_VIEW_INVALID.md +23 -0
  145. package/dist/reference/errors/MOSTRA_TARGET_UNAVAILABLE.md +23 -0
  146. package/dist/reference/errors/MOSTRA_TYPE_ERROR.md +23 -0
  147. package/dist/reference/errors/MOSTRA_TYPE_UNTYPED_PACKAGE.md +23 -0
  148. package/dist/reference/errors/MOSTRA_VERIFY_ACTION_SKIPPED.md +23 -0
  149. package/dist/reference/errors/MOSTRA_VERIFY_BASELINE_MISSING.md +23 -0
  150. package/dist/reference/errors/MOSTRA_VERIFY_CRASHED.md +23 -0
  151. package/dist/reference/errors/MOSTRA_VERIFY_LIVE_FAILED.md +23 -0
  152. package/dist/reference/errors/MOSTRA_VERIFY_NO_BASELINE.md +23 -0
  153. package/dist/reference/errors/MOSTRA_VERIFY_SECRET_MISSING.md +23 -0
  154. package/dist/reference/errors/MOSTRA_VERIFY_SKIP_CONSEQUENCE.md +23 -0
  155. package/dist/reference/errors/MOSTRA_VERIFY_TIMEOUT.md +23 -0
  156. package/dist/reference/telemetry.md +82 -0
  157. package/dist/run-D1gRM6Bm.js +2 -0
  158. package/dist/run-Du266XjI.js +3824 -0
  159. package/dist/run-Du266XjI.js.map +1 -0
  160. package/dist/telemetry/flush-main.d.ts +1 -0
  161. package/dist/telemetry/flush-main.js +14 -0
  162. package/dist/telemetry/flush-main.js.map +1 -0
  163. package/package.json +62 -4
  164. package/src/bin.ts +70 -0
  165. package/src/bootstrap.ts +156 -0
  166. package/src/browser.ts +186 -0
  167. package/src/client.ts +313 -0
  168. package/src/command.ts +147 -0
  169. package/src/commands/admin.ts +791 -0
  170. package/src/commands/authoring.ts +244 -0
  171. package/src/commands/dev.ts +106 -0
  172. package/src/commands/index.ts +71 -0
  173. package/src/commands/interaction.ts +288 -0
  174. package/src/commands/shared.ts +71 -0
  175. package/src/commands/viewing.ts +153 -0
  176. package/src/docs.ts +111 -0
  177. package/src/exit.ts +89 -0
  178. package/src/help.ts +170 -0
  179. package/src/home.ts +111 -0
  180. package/src/index.ts +23 -0
  181. package/src/node-gate.ts +15 -0
  182. package/src/parse.ts +246 -0
  183. package/src/run.ts +387 -0
  184. package/src/telemetry/decision.ts +101 -0
  185. package/src/telemetry/events.ts +147 -0
  186. package/src/telemetry/flush-main.ts +13 -0
  187. package/src/telemetry/flush.ts +143 -0
  188. package/src/telemetry/harness.ts +39 -0
  189. package/src/telemetry/index.ts +318 -0
  190. package/src/telemetry/store.ts +379 -0
  191. package/src/telemetry/timezone.ts +72 -0
  192. package/src/telemetry/words.ts +87 -0
  193. package/src/telemetry/zone-sets.ts +182 -0
  194. package/src/telemetry/zones.generated.ts +720 -0
  195. package/src/version.ts +43 -0
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_FIELD_TOO_LARGE
3
+ severity: error
4
+ phase: runtime
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_FIELD_TOO_LARGE
10
+
11
+ Field value too large. Severity: error. Phase: runtime.
12
+
13
+ ## What it means
14
+
15
+ A field value is at most 1 MiB of JSON and a draft or artifact state at most 16 MiB in all (DATA_MODEL §5). This write would pass one of those limits, so Mostra refused it whole: nothing was truncated, and the page keeps the value locally.
16
+
17
+ ## How to fix it
18
+
19
+ Split the value across several fields under one dotted prefix (`report.part1`, `report.part2`); they nest again in results.
20
+
21
+ ## Hint
22
+
23
+ Split large data across fields, keeping each value under 1 MiB and the whole document under 16 MiB.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_FIELD_UNBOUND
3
+ severity: hint
4
+ phase: smoke
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_FIELD_UNBOUND
10
+
11
+ Input not bound to a field. Severity: hint. Phase: smoke.
12
+
13
+ ## What it means
14
+
15
+ Verify's smoke test typed into an input and the page saved nothing: the input isn't bound to a field, so what a viewer types there is lost on reload and isn't part of a submission. A search box or a filter may be meant that way.
16
+
17
+ ## How to fix it
18
+
19
+ Use `const [value, setValue] = useField("<id>", "")` for the input's value, or leave it if it isn't meant to persist.
20
+
21
+ ## Hint
22
+
23
+ Bind the input with `useField` (or a kit input with an `id`) if its value should be saved and submitted.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOME_DISK_FULL
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOME_DISK_FULL
10
+
11
+ Disk full. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ A ledger write failed because the disk holding the home is full. The transaction was rolled back, so nothing partial was saved and nothing that was acknowledged earlier is lost. Viewers keep unsaved edits in their browser until a retry succeeds.
16
+
17
+ ## How to fix it
18
+
19
+ Free space on that disk (`mostra gc` removes unreferenced versions; build caches can be deleted), then retry the operation. Retries with the same request or mutation ID are safe.
20
+
21
+ ## Hint
22
+
23
+ Free space on the disk that holds the Mostra home, then retry.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOME_GC_INCOMPLETE
3
+ severity: warning
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOME_GC_INCOMPLETE
10
+
11
+ gc didn't finish a step. Severity: warning. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ `mostra gc` removes what nothing references in steps: version files, source snapshots, lock layouts, the package store, verify's caches and, when asked, events. One step failed (the message names it and why), so it left that step's files in place. Everything an earlier step removed is listed in the result, and the versions it collected stay collected. The home is consistent: what gc left is still recorded as there.
16
+
17
+ ## How to fix it
18
+
19
+ Run `mostra gc` again; a failure that repeats names its cause in the message (for example, a file the user can't remove).
20
+
21
+ ## Hint
22
+
23
+ Run `mostra gc` again: what this run removed is in its result, and the next run picks up what it left.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOME_GONE
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOME_GONE
10
+
11
+ Home directory removed. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ The instance's home directory disappeared or was replaced while the instance was running. Writing anywhere else could split the home's data, so the instance stops accepting requests, stops its child processes and exits.
16
+
17
+ ## How to fix it
18
+
19
+ Put the home back (or choose a new one with `--home` or `MOSTRA_HOME`) and start Mostra again. Clients reconnect and retry their requests by ID.
20
+
21
+ ## Hint
22
+
23
+ Restore or recreate the home directory, then start Mostra again.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOME_INTEGRITY
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOME_INTEGRITY
10
+
11
+ Stored version or file damaged. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ Mostra checks stored versions, source snapshots and blobs against their recorded content digests before using them. This code means a stored object is missing or its content changed after it was written, for example after a disk error or a manual edit inside the home. The message names the object.
16
+
17
+ ## How to fix it
18
+
19
+ Leave files inside the home unchanged. To repair a version, publish the same source again: Mostra rebuilds the version's directory and puts it back under the same version ID, and the artifact keeps its version number. If the source has changed since, the publish makes a new version and the damaged one stays as it is; its source snapshot in the home holds the original files. `mostra doctor` lists other damaged objects.
20
+
21
+ ## Hint
22
+
23
+ Publish the version's source again to rebuild a damaged version in place, and run `mostra doctor` for other damaged objects.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOME_LEDGER_UNREADABLE
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOME_LEDGER_UNREADABLE
10
+
11
+ Ledger can't be read. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ The ledger (`store/ledger.sqlite` in the home) holds drafts, submissions, events and the rest of the home's interaction data. Mostra reports this code when the file can't be opened, isn't a SQLite database, isn't a Mostra ledger, or fails SQLite's integrity check. Mostra never replaces an existing ledger with an empty one.
16
+
17
+ ## How to fix it
18
+
19
+ Stop every Mostra process for this home. Copy `store/ledger.sqlite` somewhere safe, then restore the newest `store/ledger.sqlite.bak-<from>-<to>` in its place, or move the damaged file aside to start an empty ledger. Versions, sources and blobs in the home are untouched either way.
20
+
21
+ ## Hint
22
+
23
+ Restore the ledger from the latest `ledger.sqlite.bak-*` backup in the home's `store/` directory, or move the damaged file aside.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOME_LOCKED
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOME_LOCKED
10
+
11
+ Home in use by another instance. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ One Mostra instance owns a home at a time. It holds an exclusive lock on the home's ledger, and the operating system releases that lock when the process exits. Mostra reports this code in two cases: `mostra host` was started for a home another instance already owns, or a starter found the owner but couldn't reach its control socket. The message names the owner's process ID.
16
+
17
+ ## How to fix it
18
+
19
+ To share the running instance, attach to it: start the client with the same home (`MOSTRA_HOME` or `--home`) instead of starting a second instance. To replace it, stop it with `mostra daemon stop`, or end the process named in the message, and start again. A host that needs its own instance gives it its own home.
20
+
21
+ ## Hint
22
+
23
+ Use the instance that already owns this home, or stop it (`mostra daemon stop`, or end the process named in the message) and start again.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOME_MISMATCH
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOME_MISMATCH
10
+
11
+ Instance serves a different home. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ A client sent `home.path` in `mostra/initialize`, and it names a different home from the one the instance locked at start-up. The home is chosen when the instance starts (`--home`, then `MOSTRA_HOME`, then the platform default), so `home.path` is a check: it stops a client from writing to a home it didn't mean.
16
+
17
+ ## How to fix it
18
+
19
+ Start the instance with `--home` set to the home the client expects, or connect to the socket of the instance that serves it. Leave `home.path` out to accept whichever home the instance serves.
20
+
21
+ ## Hint
22
+
23
+ Connect to the instance for the home you expect, or start it with `--home` set to that home.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOME_NOT_ALWAYS_ON
3
+ severity: warning
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOME_NOT_ALWAYS_ON
10
+
11
+ Long-lived artifacts without an always-on daemon. Severity: warning. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ The home has artifacts with submission policy `none`, which are meant to stay open (dashboards, task managers, D63), but no login service runs its daemon. Without one, the daemon exits after 30 idle minutes and their links stop answering until a command starts it again.
16
+
17
+ ## How to fix it
18
+
19
+ Run `mostra daemon install`. It registers a launchd or systemd user service that keeps the home's daemon running; `mostra daemon uninstall` removes it.
20
+
21
+ ## Hint
22
+
23
+ Run `mostra daemon install` so the home's daemon runs as a login service and these artifacts answer at any hour.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOME_NOT_OWNED
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOME_NOT_OWNED
10
+
11
+ Directory not owned by you. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ Mostra keeps secrets, answers and its ledger in the home, and its control socket in a runtime directory, so it uses only directories that belong to the user running it. It reports this code when the home or the runtime directory is owned by another user, or when the path exists but isn't a directory. Mostra changes nothing in that case.
16
+
17
+ ## How to fix it
18
+
19
+ Point Mostra at a directory you own: `--home <dir>` or `MOSTRA_HOME` for the home, `MOSTRA_RUNTIME_DIR` for the runtime directory. If the directory should be yours, change its owner with `chown`. Mostra tightens a directory you own to mode 0700 by itself.
20
+
21
+ ## Hint
22
+
23
+ Choose a home you own with `--home` or `MOSTRA_HOME`, or give the directory named in the message back to your user with `chown`.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOME_SOCKET_TOO_LONG
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOME_SOCKET_TOO_LONG
10
+
11
+ Control socket path too long. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ Clients reach an instance through a Unix socket in a per-user runtime directory. The operating system limits a socket path to 103 bytes on macOS and 107 on Linux, and the path Mostra computed is longer, usually because the home directory's path is long. Mostra stops instead of using a different place that clients couldn't find.
16
+
17
+ ## How to fix it
18
+
19
+ Set `MOSTRA_RUNTIME_DIR` to a short directory you own, such as `/tmp/mostra-$USER`, in the environment of every Mostra client and host that uses this home. Mostra creates it with mode 0700 and re-creates its socket if a temporary-file cleanup removes it.
20
+
21
+ ## Hint
22
+
23
+ Set `MOSTRA_RUNTIME_DIR` to a short directory you own, for example `/tmp/mostra-$USER`, and start again.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOME_TOO_NEW
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOME_TOO_NEW
10
+
11
+ Home written by a newer Mostra. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ A newer Mostra migrated this home's ledger to a schema version this runtime doesn't know. Reading it could misinterpret or lose data, so this runtime refuses to open it. The message names the schema version and the release that wrote it.
16
+
17
+ ## How to fix it
18
+
19
+ Upgrade the runtime (or the host or CLI that bundles it) to at least the release named in the message. Mostra never migrates a ledger backwards; to keep an older release, give it a separate home with `--home` or `MOSTRA_HOME`.
20
+
21
+ ## Hint
22
+
23
+ Run a Mostra release at least as new as the one named in the message, or use another home with `--home`.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_CONNECTION_CLOSED
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_CONNECTION_CLOSED
10
+
11
+ Connection closed. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ The connection to the other side closed before a response arrived, for example because the instance exited or restarted. The request may or may not have taken effect.
16
+
17
+ ## How to fix it
18
+
19
+ Reconnect and send `mostra/initialize` again, then retry the request with the same request ID. Mutating methods are idempotent by request ID, so a retry never applies twice.
20
+
21
+ ## Hint
22
+
23
+ Reconnect, then retry the request with the same request ID.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_CURSOR_COMPACTED
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_CURSOR_COMPACTED
10
+
11
+ Events compacted. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ Events before a cursor were compacted on request (`mostra gc --compact-events`, DATA_MODEL §4): an artifact's old events were replaced by one `artifact.compacted` event that summarizes them. A reader asking for events after an earlier cursor would miss some, and Mostra never leaves a silent gap.
16
+
17
+ ## How to fix it
18
+
19
+ Read again with `after` set to the cursor the message names: the next event is the `artifact.compacted` summary. Rebuild what you track from it and continue as usual.
20
+
21
+ ## Hint
22
+
23
+ Read from the cursor in the message to receive the compaction summary, then continue from there.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_INITIALIZE_ORDER
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_INITIALIZE_ORDER
10
+
11
+ Initialize first, and only once. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ Every connection starts with `mostra/initialize`, which agrees the protocol revision and registers the client's ports. The instance received another request before it, or a second `mostra/initialize` on the same connection.
16
+
17
+ ## How to fix it
18
+
19
+ Send `mostra/initialize` first and wait for its result before any other request. To renegotiate, open a new connection.
20
+
21
+ ## Hint
22
+
23
+ Send `mostra/initialize` as the first request on the connection, and only once.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_INTERNAL_ERROR
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_INTERNAL_ERROR
10
+
11
+ Unexpected failure in the instance. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ The instance failed while handling the request, for a reason that isn't one of its known conditions. Durable state is unaffected: a request is acknowledged only after its ledger transaction commits. The details are in the instance's log (`logs/supervisor.log` in the home), not in the response.
16
+
17
+ ## How to fix it
18
+
19
+ Retry the request with the same request ID; retries are idempotent. If the failure repeats, report it with the relevant lines of `logs/supervisor.log`.
20
+
21
+ ## Hint
22
+
23
+ Retry the request with the same request ID; if it fails again, report it with the instance's log.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_INVALID_PARAMS
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_INVALID_PARAMS
10
+
11
+ Invalid method params. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ The request's `params` don't match the method's published schema: a required field is missing, a value has the wrong type, or a value is outside its allowed range. The message names the first problem found.
16
+
17
+ ## How to fix it
18
+
19
+ Compare the request with the method's schema in `@mostra/protocol` (or the published JSON Schema) and correct the field named in the message.
20
+
21
+ ## Hint
22
+
23
+ Fix the params named in the message so they match the method's schema.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_MALFORMED
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_MALFORMED
10
+
11
+ Malformed protocol message. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ Every message on a Mostra connection is one line of JSON with one JSON-RPC 2.0 object. This code means a line wasn't valid JSON, wasn't a JSON-RPC 2.0 request or response, or was a batch (a JSON array), which revision `2026-10-10` doesn't accept. A client also reports it when a response doesn't match the method's result schema.
16
+
17
+ ## How to fix it
18
+
19
+ Encode one request per line with `"jsonrpc": "2.0"`, a `method`, an `id` for requests, and `params` as an object. Send several requests as separate lines instead of a batch.
20
+
21
+ ## Hint
22
+
23
+ Send each message as one line of JSON holding a single JSON-RPC 2.0 request or notification.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_MESSAGE_TOO_LARGE
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_MESSAGE_TOO_LARGE
10
+
11
+ Message too large for the protocol. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ One host-protocol message is one line of JSON, and a line holds at most 64 Mi characters (`MAX_LINE_LENGTH`), so neither side buffers without bound. Mostra checks every message before it writes it: an answer that would be longer is replaced by this error, and a delivery whose envelope would be longer is recorded as undeliverable instead of being sent and retried forever.
16
+
17
+ ## How to fix it
18
+
19
+ Read less per request (`events/read` with a smaller `limit`, `results/get` for one submission), and keep artifacts' values within the field and document limits.
20
+
21
+ ## Hint
22
+
23
+ Ask for less at once: a specific submission, fewer events, or smaller values.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_METHOD_UNKNOWN
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_METHOD_UNKNOWN
10
+
11
+ Unknown protocol method. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ The instance doesn't serve the method that was called. Either the name is misspelled, or the client is newer than the instance and calls a method the instance's release doesn't have.
16
+
17
+ ## How to fix it
18
+
19
+ Check the method name against INTERFACES §6, and against `capabilities.methods` in the `mostra/initialize` result, which lists every method this instance serves. Upgrade the instance if the client needs a newer method.
20
+
21
+ ## Hint
22
+
23
+ Call only the methods listed in `capabilities.methods` of the `mostra/initialize` result.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_NOTIFICATION_UNSUPPORTED
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_NOTIFICATION_UNSUPPORTED
10
+
11
+ Notification not accepted. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ Mostra sends a client only the notifications it listed in `mostra/initialize` (D84). This method would send one the client didn't list, such as `events/notify` for `events/subscribe`.
16
+
17
+ ## How to fix it
18
+
19
+ Reconnect and initialize with `capabilities: { notifications: ["events/notify"] }`, or poll with `events/read` instead.
20
+
21
+ ## Hint
22
+
23
+ List the notification in `capabilities.notifications` when you initialize.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_PORT_UNSUPPORTED
3
+ severity: warning
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_PORT_UNSUPPORTED
10
+
11
+ Port not supported by this instance. Severity: warning. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ The client registered a port this instance doesn't call, so registering it has no effect. The port may be reserved for a later release (such as `ai`), or the client may be newer than the instance. The session continues without the port, and Mostra uses its standalone behavior instead.
16
+
17
+ ## How to fix it
18
+
19
+ Register only the ports listed in `capabilities.ports` of the `mostra/initialize` result. If the host needs the port, upgrade the instance to a release that supports it.
20
+
21
+ ## Hint
22
+
23
+ Leave the port out of `mostra/initialize`, or run a Mostra release that lists it in `capabilities.ports`.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_REQUEST_ID_REUSED
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_REQUEST_ID_REUSED
10
+
11
+ A requestId was reused with other parameters. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ A mutating method recorded its result under this `requestId` for different parameters. Replaying that result would answer a request nobody made (a link for another artifact or with other scopes, another source's publish), so the instance refuses (H-03). Retries with the same parameters still return the recorded result.
16
+
17
+ ## How to fix it
18
+
19
+ Generate a fresh `requestId` for every new request, and reuse one only to retry the same request after a timeout or a lost connection.
20
+
21
+ ## Hint
22
+
23
+ Send a new `requestId` for a new request; repeat the exact parameters only to retry one.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_REVISION_UNSUPPORTED
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_REVISION_UNSUPPORTED
10
+
11
+ No common host protocol revision. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ A client and a Mostra instance agree on a host protocol revision when they connect (`mostra/initialize`). The client offers the revisions it speaks, and the instance picks the newest one it also supports. This code means the two lists have nothing in common, usually because the client and the running daemon come from Mostra releases far apart.
16
+
17
+ ## How to fix it
18
+
19
+ Restart the daemon so it runs the same release as the client: `mostra daemon restart`. Durable state survives the restart, and open views reconnect. A host that embeds Mostra updates its pinned Mostra runtime or its host library until both support a common revision.
20
+
21
+ ## Hint
22
+
23
+ Run the client and the instance from the same Mostra release, for example with `mostra daemon restart`.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_SHUTDOWN_REFUSED
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_SHUTDOWN_REFUSED
10
+
11
+ Only the spawning host can stop this instance. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ An instance started by a host over stdio (`mostra host`) lives as long as that host's connection, so only the host may stop it with `mostra/shutdown`. A client that attached through the home's socket asked it to stop. A daemon (`mostra daemon`) accepts `mostra/shutdown` from every attached client (D87).
16
+
17
+ ## How to fix it
18
+
19
+ Close your own connection when you are done. To stop the instance, stop the host that spawned it, or have the host send `mostra/shutdown` or close its stdio.
20
+
21
+ ## Hint
22
+
23
+ Ask the host that started this instance to stop it, or end the connection you opened instead.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_SUBSCRIPTION_UNKNOWN
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_SUBSCRIPTION_UNKNOWN
10
+
11
+ Unknown subscription. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ The subscription ID belongs to no subscription on this connection: it was never created here, was ended with `events/unsubscribe`, or belonged to a connection that closed. Subscriptions live as long as their connection; a named subscriber's acknowledged cursor outlives it.
16
+
17
+ ## How to fix it
18
+
19
+ Call `events/subscribe` again on this connection. With the same `name`, delivery resumes after the last acknowledged cursor.
20
+
21
+ ## Hint
22
+
23
+ Subscribe again with `events/subscribe`, then use the ID it returns.