@almadar/core 10.129.0 → 11.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/behavior-package.d.ts +49 -11
  2. package/dist/behavior-package.js +1 -1
  3. package/dist/{orbital-CkFdDS9f.d.ts → builders-BdgbY7Th.d.ts} +5828 -6917
  4. package/dist/builders.d.ts +6 -6
  5. package/dist/builders.js +7 -6
  6. package/dist/{bus-CcbB__oo.d.ts → bus-C0hFDNFR.d.ts} +262 -354
  7. package/dist/chunk-347APWFM.js +286 -0
  8. package/dist/chunk-347APWFM.js.map +1 -0
  9. package/dist/chunk-5WQ3U7NJ.js +2363 -0
  10. package/dist/chunk-5WQ3U7NJ.js.map +1 -0
  11. package/dist/chunk-5YTPYMPZ.js +99 -0
  12. package/dist/chunk-5YTPYMPZ.js.map +1 -0
  13. package/dist/chunk-66Q5VX2F.js +3810 -0
  14. package/dist/chunk-66Q5VX2F.js.map +1 -0
  15. package/dist/chunk-7GHJU5WI.js +39 -0
  16. package/dist/chunk-7GHJU5WI.js.map +1 -0
  17. package/dist/chunk-B4MNHGBP.js +8 -0
  18. package/dist/chunk-B4MNHGBP.js.map +1 -0
  19. package/dist/chunk-E4T2MQAV.js +24 -0
  20. package/dist/chunk-E4T2MQAV.js.map +1 -0
  21. package/dist/chunk-ENOCKYGA.js +412 -0
  22. package/dist/chunk-ENOCKYGA.js.map +1 -0
  23. package/dist/chunk-FGT5OS2Y.js +918 -0
  24. package/dist/chunk-FGT5OS2Y.js.map +1 -0
  25. package/dist/chunk-GF7KCLNR.js +3284 -0
  26. package/dist/chunk-GF7KCLNR.js.map +1 -0
  27. package/dist/chunk-PNGFWLHD.js +1567 -0
  28. package/dist/chunk-PNGFWLHD.js.map +1 -0
  29. package/dist/{chunk-X4SC7FGF.js → chunk-RGACZEYC.js} +99 -96
  30. package/dist/chunk-RGACZEYC.js.map +1 -0
  31. package/dist/{chunk-RYPVOI6H.js → chunk-SNZYN7UA.js} +2541 -433
  32. package/dist/{chunk-RYPVOI6H.js.map → chunk-SNZYN7UA.js.map} +1 -1
  33. package/dist/{chunk-KDMV222Q.js → chunk-TDNQT3M3.js} +304 -373
  34. package/dist/chunk-TDNQT3M3.js.map +1 -0
  35. package/dist/chunk-VG7BRFUD.js +152 -0
  36. package/dist/chunk-VG7BRFUD.js.map +1 -0
  37. package/dist/chunk-Z7BI7DE7.js +1293 -0
  38. package/dist/chunk-Z7BI7DE7.js.map +1 -0
  39. package/dist/{domain-Dz3jP-UM.d.ts → domain-Cpmja5ak.d.ts} +55 -55
  40. package/dist/{effect-CiEVLsZz.d.ts → effect-DZaXwSAz.d.ts} +283 -453
  41. package/dist/{effect-result-Bebwu9yT.d.ts → effect-result-1HpXgeBc.d.ts} +656 -851
  42. package/dist/{expression-D0Fs0riG.d.ts → expression-DirYKz-f.d.ts} +5 -13
  43. package/dist/factory/index.d.ts +7 -144
  44. package/dist/factory/index.js +8 -8
  45. package/dist/factory-runtime/index.d.ts +7 -6
  46. package/dist/factory-runtime/index.js +527 -8
  47. package/dist/factory-runtime/index.js.map +1 -1
  48. package/dist/fixtures.d.ts +9 -11
  49. package/dist/fixtures.js +12 -8
  50. package/dist/fixtures.js.map +1 -1
  51. package/dist/i18n/index.d.ts +15 -19
  52. package/dist/i18n/index.js +2 -1
  53. package/dist/{index-BC-Jycqj.d.ts → index-D7SxwNdv.d.ts} +34 -734
  54. package/dist/index.d.ts +92 -247
  55. package/dist/index.js +322 -986
  56. package/dist/index.js.map +1 -1
  57. package/dist/kernel-wire.d.ts +3 -3
  58. package/dist/kernel-wire.js +3 -79
  59. package/dist/kernel-wire.js.map +1 -1
  60. package/dist/language/constructs.json +22 -2
  61. package/dist/language/program-types.json +203 -22
  62. package/dist/language/protocols.json +46 -0
  63. package/dist/language/ui-vocabulary.json +1697 -0
  64. package/dist/language/validation-codes.json +1222 -1212
  65. package/dist/language/vocabulary.json +44 -8
  66. package/dist/language-data.d.ts +7 -4
  67. package/dist/language-data.js +20 -14
  68. package/dist/language-data.js.map +1 -1
  69. package/dist/patterns/component-mapping.json +11 -1
  70. package/dist/patterns/definitions.d.ts +2 -2
  71. package/dist/patterns/definitions.js +1 -1
  72. package/dist/patterns/event-contracts.json +1 -15
  73. package/dist/patterns/game-font-families.json +13 -0
  74. package/dist/patterns/index.d.ts +24 -120
  75. package/dist/patterns/index.js +3 -3
  76. package/dist/patterns/pattern-tile-geometry.json +1065 -0
  77. package/dist/patterns/patterns-registry.json +2539 -431
  78. package/dist/patterns/registry.json +2539 -431
  79. package/dist/trait-sRjIivFq.d.ts +3519 -0
  80. package/dist/types/index.d.ts +9 -10
  81. package/dist/types/index.js +11 -5
  82. package/dist/{types-DGwrltUF.d.ts → types-C6_yPMpn.d.ts} +3 -3
  83. package/fixtures/events-wire/client-effects-by-trait/response.json +0 -18
  84. package/fixtures/events-wire/client-effects-provenance/response.json +0 -18
  85. package/fixtures/events-wire/effect-results-every-kind/response.json +2 -27
  86. package/fixtures/events-wire/navigate-1/response.json +8 -5
  87. package/fixtures/events-wire/navigate-2/response.json +11 -8
  88. package/fixtures/events-wire/navigate-3/response.json +14 -11
  89. package/fixtures/events-wire/navigate-back/response.json +7 -4
  90. package/fixtures/events-wire/render-ui-3/response.json +12 -9
  91. package/fixtures/events-wire/render-ui-clear/response.json +0 -7
  92. package/fixtures/events-wire/sse-stream/response.json +0 -20
  93. package/fixtures/events-wire/sse-stream/stream.json +0 -20
  94. package/fixtures/events-wire/stateless-traits/response.json +14 -5
  95. package/fixtures/kernel-wire/golden/basic-entity.json +1687 -0
  96. package/fixtures/kernel-wire/golden/entity-rerender.json +743 -0
  97. package/fixtures/kernel-wire/golden/rollback.json +793 -0
  98. package/fixtures/kernel-wire/golden/tick-counter.json +1538 -0
  99. package/fixtures/kernel-wire/golden/two-orbital-chore.json +847 -0
  100. package/fixtures/kernel-wire/golden/two-orbital-task.json +457 -0
  101. package/fixtures/kernel-wire/played-step.json +136 -0
  102. package/fixtures/kernel-wire/scripts/basic-entity.json +28 -0
  103. package/fixtures/kernel-wire/scripts/entity-rerender.json +13 -0
  104. package/fixtures/kernel-wire/scripts/rollback.json +53 -0
  105. package/fixtures/kernel-wire/scripts/tick-counter.json +26 -0
  106. package/fixtures/kernel-wire/scripts/two-orbital-chore.json +9 -0
  107. package/fixtures/kernel-wire/scripts/two-orbital-task.json +9 -0
  108. package/package.json +28 -19
  109. package/dist/builders-DmZE5By0.d.ts +0 -2663
  110. package/dist/chunk-45I2O4SJ.js +0 -4646
  111. package/dist/chunk-45I2O4SJ.js.map +0 -1
  112. package/dist/chunk-6LR43Z5E.js +0 -3061
  113. package/dist/chunk-6LR43Z5E.js.map +0 -1
  114. package/dist/chunk-GIUA3NUJ.js +0 -809
  115. package/dist/chunk-GIUA3NUJ.js.map +0 -1
  116. package/dist/chunk-GTY53NS5.js +0 -1908
  117. package/dist/chunk-GTY53NS5.js.map +0 -1
  118. package/dist/chunk-JOHDVS6J.js +0 -1614
  119. package/dist/chunk-JOHDVS6J.js.map +0 -1
  120. package/dist/chunk-KDMV222Q.js.map +0 -1
  121. package/dist/chunk-QRHJUS3D.js +0 -23
  122. package/dist/chunk-QRHJUS3D.js.map +0 -1
  123. package/dist/chunk-QUOTJULD.js +0 -4009
  124. package/dist/chunk-QUOTJULD.js.map +0 -1
  125. package/dist/chunk-V5VNGRVU.js +0 -66
  126. package/dist/chunk-V5VNGRVU.js.map +0 -1
  127. package/dist/chunk-X4SC7FGF.js.map +0 -1
  128. package/dist/entityAccess-BPSz1i2n.d.ts +0 -80
  129. package/dist/mock/index.d.ts +0 -153
  130. package/dist/mock/index.js +0 -190
  131. package/dist/mock/index.js.map +0 -1
  132. package/dist/schema-T5RT5s6H.d.ts +0 -282
  133. package/dist/state-machine/index.d.ts +0 -359
  134. package/dist/state-machine/index.js +0 -3
  135. package/dist/state-machine/index.js.map +0 -1
@@ -0,0 +1,3284 @@
1
+ import { OrbitalSchemaSchema, SourceDeclarationMetadataSchema } from './chunk-PNGFWLHD.js';
2
+ import { FieldValueSchema, EntityRowSchema, SERVER_REPORTED_EFFECTS } from './chunk-FGT5OS2Y.js';
3
+ import { EventPayloadValueSchema, EventPayloadSchema } from './chunk-347APWFM.js';
4
+ import { JsonValueSchema, isJsonObject } from './chunk-7GHJU5WI.js';
5
+ import { z } from 'zod';
6
+
7
+ // src/types/observability.ts
8
+ var CALL_KINDS = ["client", "server", "db", "queue", "external"];
9
+ var LOG_SEVERITIES = ["DEBUG", "INFO", "WARNING", "ERROR"];
10
+ function isCallKind(value) {
11
+ return typeof value === "string" && CALL_KINDS.some((k) => k === value);
12
+ }
13
+ function isSeverity(value) {
14
+ return typeof value === "string" && LOG_SEVERITIES.some((s) => s === value);
15
+ }
16
+ function optionalString(value) {
17
+ return value === void 0 || typeof value === "string";
18
+ }
19
+ function isCallRecord(value) {
20
+ if (value === void 0 || !isJsonObject(value)) return false;
21
+ const { kind, service, op, durationMs, ok, error } = value;
22
+ if (!isCallKind(kind) || typeof service !== "string" || typeof op !== "string") return false;
23
+ if (typeof durationMs !== "number" || !Number.isFinite(durationMs) || durationMs < 0) return false;
24
+ if (typeof ok !== "boolean" || !optionalString(error)) return false;
25
+ return !(ok && error !== void 0);
26
+ }
27
+ function isStructuredLogEntry(value) {
28
+ if (!isJsonObject(value)) return false;
29
+ const { severity, time, namespace, message, data, call, appId, deploymentCommit } = value;
30
+ if (!isSeverity(severity) || typeof time !== "string" || typeof namespace !== "string" || typeof message !== "string") return false;
31
+ if (data !== void 0 && !isJsonObject(data)) return false;
32
+ if (call !== void 0 && !isCallRecord(call)) return false;
33
+ return optionalString(appId) && optionalString(deploymentCommit);
34
+ }
35
+ var BindingSchema = z.string().refine(
36
+ (val) => {
37
+ if (!val.startsWith("@")) return false;
38
+ const parts = val.slice(1).split(".");
39
+ if (parts.length === 0 || parts[0] === "") return false;
40
+ return parts.every((part) => /^[\p{L}_][\p{L}0-9_]*$/u.test(part));
41
+ },
42
+ { message: "Invalid binding format. Must be @name or @name.path.to.field" }
43
+ );
44
+ var BINDING_DOCS = {
45
+ entity: {
46
+ description: "Reference to the linked entity for this trait",
47
+ examples: ["@entity.health", "@entity.x", "@entity.status"],
48
+ requiresPath: true
49
+ },
50
+ payload: {
51
+ description: "Reference to the event payload data",
52
+ examples: ["@payload.amount", "@payload.targetId", "@payload.action"],
53
+ requiresPath: true
54
+ },
55
+ state: {
56
+ description: "Current state machine state name",
57
+ examples: ["@state"],
58
+ requiresPath: false
59
+ },
60
+ now: {
61
+ description: "Current timestamp in milliseconds",
62
+ examples: ["@now"],
63
+ requiresPath: false
64
+ },
65
+ config: {
66
+ description: "Trait configuration values",
67
+ examples: ["@config.apiEndpoint", "@config.theme"],
68
+ requiresPath: true
69
+ },
70
+ computed: {
71
+ description: "Computed/calculated values",
72
+ examples: ["@computed.total", "@computed.isValid"],
73
+ requiresPath: true
74
+ },
75
+ trait: {
76
+ description: "Trait context data",
77
+ examples: ["@trait.name", "@trait.category"],
78
+ requiresPath: true
79
+ },
80
+ user: {
81
+ description: "Authenticated user / agent context for ownership and role-based gating",
82
+ examples: ["@user.id", "@user.role"],
83
+ requiresPath: true
84
+ },
85
+ callsitePayload: {
86
+ description: "Call-site-captured event payload \u2014 emitted by the compiler's inline-trait hoisting when an extracted render block captured @payload; resolved at the composing effect by the runtime BindingResolver",
87
+ examples: ["@callsitePayload.error", "@callsitePayload.row"],
88
+ requiresPath: true
89
+ },
90
+ pages: {
91
+ description: "Render-resolved schema sigil \u2014 the host orbital's pages as a NavItem[] array (href = page.path, label = page.name). Substituted from the OrbitalSchema before codegen; never survives as a live binding.",
92
+ examples: ["@pages"],
93
+ requiresPath: false
94
+ },
95
+ currentTheme: {
96
+ description: "Render-resolved schema sigil \u2014 the host orbital's active data-theme key, derived from Orbital.theme. Substituted from the OrbitalSchema before codegen; never survives as a live binding.",
97
+ examples: ["@currentTheme"],
98
+ requiresPath: false
99
+ },
100
+ locale: {
101
+ description: "The active locale code (`en`, `ar`, `sl`, \u2026) \u2014 the locale whose catalog `i18n/t` reads, set by the host from the route.",
102
+ examples: ["@locale"],
103
+ requiresPath: false
104
+ },
105
+ event: {
106
+ description: "The delivery being processed: { event, payload, source } \u2014 for a listens delivery the source emit, with its BusEventSource envelope (Runtime Spec Clause 5.5)",
107
+ examples: ["@event.event", "@event.payload.n", "@event.source.trait", "@event.source.tick"],
108
+ requiresPath: false
109
+ },
110
+ prevEvents: {
111
+ description: "The deliveries this trait already received in this dispatch, in order, each shaped like @event",
112
+ examples: ["@prevEvents"],
113
+ requiresPath: false
114
+ },
115
+ prevStates: {
116
+ description: "The states this trait left in this dispatch, in order",
117
+ examples: ["@prevStates"],
118
+ requiresPath: false
119
+ },
120
+ fromState: {
121
+ description: "The transition's source state",
122
+ examples: ["@fromState"],
123
+ requiresPath: false
124
+ },
125
+ toState: {
126
+ description: "The transition's target state (null in a listens `when`, where no transition is chosen yet)",
127
+ examples: ["@toState"],
128
+ requiresPath: false
129
+ }
130
+ };
131
+ var BINDING_CONTEXT_RULES = {
132
+ guard: {
133
+ allowed: ["entity", "payload", "state", "now", "config", "user", "event", "prevEvents", "prevStates", "fromState", "toState"],
134
+ description: `Guards can read the delivery being processed and this dispatch's log (@event, @prevEvents, @prevStates) and the transition's ends (@fromState, @toState; Runtime Spec Clause 5.5). Guards can access entity fields, event payload, current state, time, the call-site trait config (@config.X), and the authenticated user context (@user.id, @user.role) for ownership / role gates. Config access lets atoms write mode-aware guards \u2014 e.g. std-modal's OPEN can require @payload.row only when @config.mode equals "edit", letting create-mode legitimately fire OPEN with no row. Like effects, @config.X is substituted at molecule/organism inline time with the literal call-site value; at atom-scope validate, @config is allowed-but-unresolved.`
135
+ },
136
+ effect: {
137
+ allowed: ["entity", "payload", "state", "now", "trait", "config", "user", "callsitePayload", "pages", "currentTheme", "locale", "event", "prevEvents", "prevStates", "fromState", "toState"],
138
+ description: "Effects can access and modify entity fields, use payload data, embed another trait's live frame via @trait.X inside render-ui children, read trait config values (@config.X) for atoms parameterized by their call-site, and read the authenticated user context (@user.id, @user.role). At molecule/organism inline time, @config.X is substituted with the literal value from the call-site config block; at atom-scope validate, @config is allowed-but-unresolved. @callsitePayload.X is the call-site-captured event payload emitted by the compiler's inline-trait hoisting (a hoisted render block that captured @payload); it is resolved at the composing effect by the runtime BindingResolver."
139
+ },
140
+ tick: {
141
+ allowed: ["entity", "state", "now", "config", "user"],
142
+ description: "Ticks can access entity fields, current state, time, trait config (@config.X) for parameterized atoms, and the authenticated user context (@user.id, @user.role). Same substitution semantics as guards/effects."
143
+ }
144
+ };
145
+ var RENDER_BINDING_MARKER = "$renderBinding";
146
+ function isRenderBindingMarker(value) {
147
+ return typeof value === "object" && value !== null && !Array.isArray(value) && RENDER_BINDING_MARKER in value && value[RENDER_BINDING_MARKER] === true;
148
+ }
149
+ var ENTITY_BINDING_RE = /@entity(?=[.\[\]]|$)/;
150
+ var PAYLOAD_BINDING_RE = /@(?:callsitePayload|payload)(?=[.\[\]]|$)/;
151
+ function containsEntityBinding(value) {
152
+ if (typeof value === "string") return ENTITY_BINDING_RE.test(value);
153
+ if (Array.isArray(value)) return value.some(containsEntityBinding);
154
+ if (value !== null && typeof value === "object") {
155
+ if (isRenderBindingMarker(value)) return true;
156
+ return Object.values(value).some(containsEntityBinding);
157
+ }
158
+ return false;
159
+ }
160
+ function containsPayloadBinding(value) {
161
+ if (typeof value === "string") return PAYLOAD_BINDING_RE.test(value);
162
+ if (Array.isArray(value)) return value.some(containsPayloadBinding);
163
+ if (value !== null && typeof value === "object") {
164
+ return Object.values(value).some(containsPayloadBinding);
165
+ }
166
+ return false;
167
+ }
168
+ function validateBindingInContext(binding, context) {
169
+ const rules = BINDING_CONTEXT_RULES[context];
170
+ if (binding.type === "core") {
171
+ if (!rules.allowed.includes(binding.root)) {
172
+ return `Binding @${binding.root} is not allowed in ${context} context. Allowed: ${rules.allowed.join(", ")}`;
173
+ }
174
+ }
175
+ return null;
176
+ }
177
+ function getBindingExamples(context) {
178
+ const rules = BINDING_CONTEXT_RULES[context];
179
+ const examples = [];
180
+ for (const binding of rules.allowed) {
181
+ const doc = BINDING_DOCS[binding];
182
+ examples.push(...doc.examples);
183
+ }
184
+ examples.push("@GameConfig.gravity", "@Filter.searchTerm");
185
+ return examples;
186
+ }
187
+ var CompareOpSchema = z.enum(["==", "!=", "<", "<=", ">", ">="]);
188
+ var RowPredicateSchema = z.lazy(
189
+ () => z.discriminatedUnion("kind", [
190
+ z.object({ kind: z.literal("compare"), field: z.string(), op: CompareOpSchema, value: FieldValueSchema }),
191
+ z.object({ kind: z.literal("member"), field: z.string(), values: z.array(FieldValueSchema) }),
192
+ z.object({ kind: z.literal("hasElement"), field: z.string(), value: FieldValueSchema }),
193
+ z.object({ kind: z.literal("contains"), field: z.string(), text: z.string(), caseSensitive: z.boolean() }),
194
+ z.object({ kind: z.literal("isNull"), field: z.string(), isNull: z.boolean() }),
195
+ z.object({ kind: z.literal("all"), of: z.array(RowPredicateSchema) }),
196
+ z.object({ kind: z.literal("any"), of: z.array(RowPredicateSchema) }),
197
+ z.object({ kind: z.literal("not"), of: RowPredicateSchema }),
198
+ z.object({ kind: z.literal("const"), value: z.boolean() })
199
+ ])
200
+ );
201
+ var RowQuerySchema = z.object({
202
+ policy: RowPredicateSchema.optional(),
203
+ filter: RowPredicateSchema.optional(),
204
+ order: z.object({ field: z.string(), direction: z.enum(["asc", "desc"]) }).optional(),
205
+ offset: z.number().int().nonnegative().optional(),
206
+ limit: z.number().int().nonnegative().optional(),
207
+ total: z.enum(["exact", "none"]).optional(),
208
+ nearest: z.object({ field: z.string(), vector: z.array(z.number()), k: z.number().int().positive() }).optional()
209
+ });
210
+ var RowIdPageSchema = z.object({
211
+ ids: z.array(z.string()),
212
+ total: z.number().int().nonnegative()
213
+ });
214
+ var RowWriteOpSchema = z.discriminatedUnion("kind", [
215
+ z.object({ kind: z.literal("create"), entityType: z.string(), data: EntityRowSchema }),
216
+ z.object({ kind: z.literal("upsert"), entityType: z.string(), data: EntityRowSchema }),
217
+ z.object({ kind: z.literal("update"), entityType: z.string(), id: z.string(), data: EntityRowSchema, guard: RowPredicateSchema.optional() }),
218
+ z.object({ kind: z.literal("delete"), entityType: z.string(), id: z.string(), guard: RowPredicateSchema.optional() }),
219
+ z.object({ kind: z.literal("rekey"), entityType: z.string(), id: z.string(), newId: z.string().min(1), guard: RowPredicateSchema.optional() })
220
+ ]);
221
+ var RowWriteOutcomeSchema = z.discriminatedUnion("kind", [
222
+ z.object({ kind: z.literal("created"), row: EntityRowSchema }),
223
+ z.object({ kind: z.literal("updated"), row: EntityRowSchema, before: EntityRowSchema.optional() }),
224
+ z.object({ kind: z.literal("deleted"), before: EntityRowSchema.optional() }),
225
+ z.object({ kind: z.literal("not-found") }),
226
+ z.object({ kind: z.literal("duplicate-id") }),
227
+ z.object({ kind: z.literal("refused") }),
228
+ z.object({ kind: z.literal("failed"), message: z.string() }),
229
+ z.object({ kind: z.literal("rolled-back") })
230
+ ]);
231
+ var RowWriteBatchSchema = z.object({
232
+ ops: z.array(RowWriteOpSchema),
233
+ onFailure: z.enum(["atomic", "stop"])
234
+ });
235
+ var LeafKindSchema = z.enum(["compare", "member", "hasElement", "contains", "isNull"]);
236
+ var CombinatorSchema = z.enum(["all", "any", "not"]);
237
+ var RowOperatorSchema = z.enum(["==", "!=", "<", "<=", ">", ">=", "member", "hasElement", "contains"]);
238
+ var RowValueKindSchema = z.enum(["string", "number", "boolean", "date", "null"]);
239
+ var RowCommitSchema = z.object({
240
+ entityType: z.string(),
241
+ id: z.string(),
242
+ expected: EntityRowSchema.nullable(),
243
+ write: z.discriminatedUnion("kind", [
244
+ z.object({ kind: z.literal("keep") }),
245
+ z.object({ kind: z.literal("put"), row: EntityRowSchema }),
246
+ z.object({ kind: z.literal("delete") })
247
+ ])
248
+ });
249
+ var QueryCapabilitiesSchema = z.object({
250
+ leaves: z.array(LeafKindSchema),
251
+ combinators: z.array(CombinatorSchema),
252
+ compareOps: z.array(CompareOpSchema),
253
+ operatorValueKinds: z.array(z.object({ operator: RowOperatorSchema, valueKinds: z.array(RowValueKindSchema) })).optional(),
254
+ orderableFields: z.discriminatedUnion("kind", [
255
+ z.object({ kind: z.literal("every-field") }),
256
+ z.object({ kind: z.literal("listed"), fields: z.array(z.string()) })
257
+ ]),
258
+ window: z.boolean(),
259
+ exactTotal: z.boolean(),
260
+ idsOnly: z.boolean().optional(),
261
+ nearest: z.boolean().optional()
262
+ });
263
+ var WriteCapabilitiesSchema = z.object({
264
+ guards: z.object({ leaves: z.array(LeafKindSchema), combinators: z.array(CombinatorSchema), compareOps: z.array(CompareOpSchema) }),
265
+ conditional: z.boolean(),
266
+ returnsRow: z.boolean(),
267
+ stopRuns: z.boolean(),
268
+ atomicBatch: z.boolean(),
269
+ rekey: z.boolean().optional(),
270
+ commitRows: z.boolean().optional()
271
+ });
272
+ var RowQueryPageSchema = z.object({
273
+ rows: z.array(EntityRowSchema),
274
+ total: z.number().int().nonnegative()
275
+ });
276
+ function isMissing(value) {
277
+ return value === null || value === void 0;
278
+ }
279
+ function comparable(value) {
280
+ return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
281
+ }
282
+ function codePointOrder(a, b) {
283
+ const x = Array.from(a);
284
+ const y = Array.from(b);
285
+ const n = Math.min(x.length, y.length);
286
+ for (let i = 0; i < n; i++) {
287
+ const cx = x[i].codePointAt(0) ?? 0;
288
+ const cy = y[i].codePointAt(0) ?? 0;
289
+ if (cx !== cy) return cx < cy ? -1 : 1;
290
+ }
291
+ return x.length === y.length ? 0 : x.length < y.length ? -1 : 1;
292
+ }
293
+ function orderValues(a, b) {
294
+ if (typeof a === "string" && typeof b === "string") return codePointOrder(a, b);
295
+ if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
296
+ if (typeof a === "boolean" && typeof b === "boolean") return a === b ? 0 : a ? 1 : -1;
297
+ return null;
298
+ }
299
+ function sameValue(a, b) {
300
+ return a === b;
301
+ }
302
+ function compareLeaf(value, op) {
303
+ const target = op.value;
304
+ if (isMissing(value)) return op.op === "!=" && !isMissing(target);
305
+ switch (op.op) {
306
+ case "==":
307
+ return sameValue(value, target);
308
+ case "!=":
309
+ return !sameValue(value, target);
310
+ default: {
311
+ if (!comparable(value) || !comparable(target)) return false;
312
+ const c = orderValues(value, target);
313
+ if (c === null) return false;
314
+ if (op.op === "<") return c < 0;
315
+ if (op.op === "<=") return c <= 0;
316
+ if (op.op === ">") return c > 0;
317
+ return c >= 0;
318
+ }
319
+ }
320
+ }
321
+ function foldCase(text) {
322
+ return text.toUpperCase().toLowerCase();
323
+ }
324
+ var memberLookups = /* @__PURE__ */ new WeakMap();
325
+ function memberLookup(predicate) {
326
+ const cached = memberLookups.get(predicate);
327
+ if (cached !== void 0) return cached;
328
+ const lookup = new Set(predicate.values);
329
+ memberLookups.set(predicate, lookup);
330
+ return lookup;
331
+ }
332
+ function rowMatchesPredicate(row, predicate) {
333
+ switch (predicate.kind) {
334
+ case "const":
335
+ return predicate.value;
336
+ case "all":
337
+ return predicate.of.every((p) => rowMatchesPredicate(row, p));
338
+ case "any":
339
+ return predicate.of.some((p) => rowMatchesPredicate(row, p));
340
+ case "not":
341
+ return !rowMatchesPredicate(row, predicate.of);
342
+ case "compare":
343
+ return compareLeaf(row[predicate.field], predicate);
344
+ case "isNull":
345
+ return isMissing(row[predicate.field]) === predicate.isNull;
346
+ case "member": {
347
+ const value = row[predicate.field];
348
+ if (isMissing(value)) return false;
349
+ const lookup = memberLookup(predicate);
350
+ return !Number.isNaN(value) && lookup.has(value);
351
+ }
352
+ case "hasElement": {
353
+ const value = row[predicate.field];
354
+ return Array.isArray(value) && value.some((v) => sameValue(v, predicate.value));
355
+ }
356
+ case "contains": {
357
+ const value = row[predicate.field];
358
+ if (typeof value !== "string") return false;
359
+ return predicate.caseSensitive ? value.includes(predicate.text) : foldCase(value).includes(foldCase(predicate.text));
360
+ }
361
+ }
362
+ }
363
+ function rowIdOf(row) {
364
+ return typeof row.id === "string" ? row.id : null;
365
+ }
366
+ function runRowWrite(rows, op) {
367
+ if (op.kind === "rekey") return { rows: [...rows], outcome: { kind: "failed", message: "rekey is unsupported by this store" } };
368
+ if (op.kind === "create") {
369
+ const id = rowIdOf(op.data);
370
+ if (id === null) return { rows: [...rows], outcome: { kind: "failed", message: "create needs a string id" } };
371
+ if (rows.some((r) => r.id === id)) return { rows: [...rows], outcome: { kind: "duplicate-id" } };
372
+ const row2 = { ...op.data };
373
+ return { rows: [...rows, row2], outcome: { kind: "created", row: row2 } };
374
+ }
375
+ if (op.kind === "upsert") {
376
+ const id = rowIdOf(op.data);
377
+ if (id === null) return { rows: [...rows], outcome: { kind: "failed", message: "upsert needs a string id" } };
378
+ const index2 = rows.findIndex((r) => r.id === id);
379
+ if (index2 < 0) {
380
+ const row3 = { ...op.data };
381
+ return { rows: [...rows, row3], outcome: { kind: "created", row: row3 } };
382
+ }
383
+ const kept = rows[index2].createdAt;
384
+ const row2 = kept === void 0 ? { ...op.data } : { ...op.data, createdAt: kept };
385
+ return { rows: rows.map((r, i) => i === index2 ? row2 : r), outcome: { kind: "updated", row: row2 } };
386
+ }
387
+ const index = rows.findIndex((r) => r.id === op.id);
388
+ if (index < 0) return { rows: [...rows], outcome: { kind: "not-found" } };
389
+ const before = rows[index];
390
+ if (op.guard !== void 0 && !rowMatchesPredicate(before, op.guard)) return { rows: [...rows], outcome: { kind: "refused" } };
391
+ const guarded = op.guard !== void 0 ? { before } : {};
392
+ if (op.kind === "delete") {
393
+ return { rows: rows.filter((_, i) => i !== index), outcome: { kind: "deleted", ...guarded } };
394
+ }
395
+ const row = { ...before, ...op.data, id: op.id };
396
+ return { rows: rows.map((r, i) => i === index ? row : r), outcome: { kind: "updated", row, ...guarded } };
397
+ }
398
+ var FULL_QUERY_CAPABILITIES = {
399
+ leaves: ["compare", "member", "hasElement", "contains", "isNull"],
400
+ combinators: ["all", "any", "not"],
401
+ compareOps: ["==", "!=", "<", "<=", ">", ">="]};
402
+ var FULL_WRITE_CAPABILITIES = {
403
+ guards: { leaves: FULL_QUERY_CAPABILITIES.leaves, combinators: FULL_QUERY_CAPABILITIES.combinators, compareOps: FULL_QUERY_CAPABILITIES.compareOps },
404
+ conditional: true,
405
+ returnsRow: true,
406
+ stopRuns: true,
407
+ atomicBatch: true
408
+ };
409
+ var QueryDeclinedError = class extends Error {
410
+ constructor(reason, message) {
411
+ super(message ?? `query declined: ${reason}`);
412
+ this.name = "QueryDeclinedError";
413
+ this.reason = reason;
414
+ }
415
+ };
416
+ var WriteDeclinedError = class extends Error {
417
+ constructor(reason, message) {
418
+ super(message ?? `write declined: ${reason}`);
419
+ this.name = "WriteDeclinedError";
420
+ this.reason = reason;
421
+ }
422
+ };
423
+
424
+ // src/types/row-set.ts
425
+ var RowSetRefSchema = z.object({
426
+ entityType: z.string(),
427
+ ids: z.array(z.string()),
428
+ total: z.number().int().nonnegative(),
429
+ query: RowQuerySchema
430
+ });
431
+ var ROW_SET_MARKER = "$rowSet";
432
+ function rowSetMarker(ref) {
433
+ return { [ROW_SET_MARKER]: true, ref };
434
+ }
435
+ function isRowSetMarker(value) {
436
+ return typeof value === "object" && value !== null && !Array.isArray(value) && ROW_SET_MARKER in value && value[ROW_SET_MARKER] === true && "ref" in value && RowSetRefSchema.safeParse(value.ref).success;
437
+ }
438
+ var BINDING_ROOTS = [
439
+ "entity",
440
+ "payload",
441
+ "state",
442
+ "now",
443
+ "config",
444
+ "trait",
445
+ "user",
446
+ "callsitePayload",
447
+ "pages",
448
+ "currentTheme",
449
+ "locale",
450
+ "event",
451
+ "prevEvents",
452
+ "prevStates",
453
+ "fromState",
454
+ "toState",
455
+ "fromEntity",
456
+ "other"
457
+ ];
458
+ var KNOWN_ROOTS = new Set(BINDING_ROOTS.filter((r) => r !== "other"));
459
+ function toBindingRoot(root) {
460
+ return KNOWN_ROOTS.has(root) ? root : "other";
461
+ }
462
+ var TRAIT_REF_PATTERN = /^@trait\.[A-Z][a-zA-Z0-9]*$/;
463
+ function isTraitFieldRef(value) {
464
+ return typeof value === "string" && TRAIT_REF_PATTERN.test(value);
465
+ }
466
+ var TraitFieldRefSchema = z.string().regex(TRAIT_REF_PATTERN, "expected `@trait.<TraitName>` reference");
467
+ var ClaimSchema = z.object({ name: z.string(), value: JsonValueSchema });
468
+ var ViewerSchema = z.object({
469
+ id: z.string(),
470
+ email: z.string().nullish(),
471
+ name: z.string().nullish(),
472
+ role: z.string().optional(),
473
+ permissions: z.array(z.string()).optional(),
474
+ claims: z.array(ClaimSchema)
475
+ });
476
+ var ANONYMOUS_USER = {
477
+ id: "anonymous",
478
+ role: "anonymous",
479
+ permissions: []
480
+ };
481
+ var RawUserClaimsSchema = z.object({
482
+ id: z.string().optional(),
483
+ uid: z.string().optional(),
484
+ email: z.string().nullable().optional(),
485
+ name: z.string().nullable().optional(),
486
+ displayName: z.string().nullable().optional(),
487
+ role: z.string().nullable().optional(),
488
+ permissions: z.array(z.string()).nullable().optional()
489
+ }).catchall(FieldValueSchema);
490
+ var NONE_WHEN_NULL_CLAIM_KEYS = ["role", "permissions"];
491
+ var DERIVED_CLAIM_KEYS = ["id", "name", "displayName", "email"];
492
+ function normalizeUserContext(claims) {
493
+ if (!claims) return void 0;
494
+ const id = claims.id ?? claims.uid;
495
+ if (typeof id !== "string" || id.length === 0) return void 0;
496
+ const user = { id };
497
+ for (const [key, value] of Object.entries(claims)) {
498
+ if (value === void 0 || DERIVED_CLAIM_KEYS.includes(key)) continue;
499
+ if (value === null && NONE_WHEN_NULL_CLAIM_KEYS.includes(key)) continue;
500
+ user[key] = value;
501
+ }
502
+ const name = claims.name ?? claims.displayName;
503
+ if (typeof name === "string" && name.length > 0) user.name = name;
504
+ if (typeof claims.email === "string" && claims.email.length > 0) user.email = claims.email;
505
+ return user;
506
+ }
507
+ function personaFromIdentityRow(row) {
508
+ const id = row["id"];
509
+ if (typeof id !== "string" || id.length === 0) return void 0;
510
+ const persona = { id };
511
+ for (const [key, value] of Object.entries(row)) {
512
+ if (key === "id" || value === void 0) continue;
513
+ persona[key] = value;
514
+ }
515
+ return persona;
516
+ }
517
+ function findPersonaInRoster(roster, idOrRole) {
518
+ return roster.find((p) => p.id === idOrRole) ?? roster.find((p) => p.role === idOrRole);
519
+ }
520
+ function resolvePersonaSpec(spec, roster) {
521
+ const raw = spec.trim();
522
+ if (!raw.startsWith("{")) {
523
+ const declared = findPersonaInRoster(roster, raw);
524
+ if (!declared) {
525
+ const known = roster.map((p) => `${p.id}/${p.role ?? "-"}`).join(", ");
526
+ throw new Error(
527
+ `Persona "${raw}" is not a declared persona id or role. ` + (roster.length > 0 ? `Known: ${known}` : "This app declares no [identity] entity, so only the JSON persona form is accepted.")
528
+ );
529
+ }
530
+ return declared;
531
+ }
532
+ let claims;
533
+ try {
534
+ claims = JSON.parse(raw);
535
+ } catch {
536
+ throw new Error(`Persona is not valid JSON: ${raw}`);
537
+ }
538
+ const user = normalizeUserContext(claims);
539
+ if (!user) {
540
+ throw new Error(`Persona needs an "id" (or "uid"): ${raw}`);
541
+ }
542
+ return user;
543
+ }
544
+
545
+ // src/types/agent.ts
546
+ function isSessionHistoryEntry(value) {
547
+ if (typeof value !== "object" || value === null) return false;
548
+ return "role" in value && typeof value.role === "string" && "content" in value && typeof value.content === "string" && "timestamp" in value && typeof value.timestamp === "number";
549
+ }
550
+
551
+ // src/types/plan.ts
552
+ function isPlanSnapshot(value) {
553
+ if (typeof value !== "object" || value === null) return false;
554
+ const statuses = ["proposed", "confirmed", "built", "failed"];
555
+ return "schemaVersion" in value && value.schemaVersion === 1 && "status" in value && statuses.some((s) => s === value.status) && "builtAt" in value && typeof value.builtAt === "string" && "orbitals" in value && Array.isArray(value.orbitals) && "renames" in value && Array.isArray(value.renames) && "deletedOrbitals" in value && Array.isArray(value.deletedOrbitals);
556
+ }
557
+ var PatternTypeSchema = z.string();
558
+
559
+ // src/types/changeset.ts
560
+ var SEMANTIC_CHANGE_KINDS = [
561
+ "orbital-added",
562
+ "orbital-removed",
563
+ "entity-fields-changed",
564
+ "trait-added",
565
+ "trait-removed",
566
+ "trait-config-changed",
567
+ "state-machine-changed",
568
+ "guard-changed",
569
+ "effect-changed",
570
+ "render-ui-changed",
571
+ "event-wiring-changed",
572
+ "page-changed",
573
+ "theme-changed",
574
+ "behavior-composed"
575
+ ];
576
+
577
+ // src/service-types.ts
578
+ function createTypedEventBus(bus) {
579
+ return {
580
+ emit(event, payload) {
581
+ bus.emit(event, payload);
582
+ },
583
+ on(event, handler) {
584
+ return bus.on(event, handler);
585
+ }
586
+ };
587
+ }
588
+ function createLazyService(factory) {
589
+ let instance = null;
590
+ return {
591
+ get() {
592
+ if (instance === null) {
593
+ instance = factory();
594
+ }
595
+ return instance;
596
+ },
597
+ reset() {
598
+ instance = null;
599
+ }
600
+ };
601
+ }
602
+
603
+ // src/row-predicate.ts
604
+ function parseFetchOrder(orderBy) {
605
+ if (typeof orderBy !== "string" || orderBy === "") return void 0;
606
+ const [field, direction] = orderBy.split(":");
607
+ const dir = direction === "desc" ? "desc" : "asc";
608
+ return { field, direction: dir };
609
+ }
610
+
611
+ // src/types/visit-key.ts
612
+ function isPayloadList(value) {
613
+ return Array.isArray(value);
614
+ }
615
+ function canonicalJson(value) {
616
+ if (value === void 0 || value === null) return "null";
617
+ if (isPayloadList(value)) return `[${value.map((item) => canonicalJson(item)).join(",")}]`;
618
+ if (typeof value === "object") {
619
+ const fields = Object.keys(value).sort().map((k) => `${JSON.stringify(k)}:${canonicalJson(value[k])}`);
620
+ return `{${fields.join(",")}}`;
621
+ }
622
+ return JSON.stringify(value);
623
+ }
624
+ function dispatchVisitKey(trait, event, from, payload, frame) {
625
+ return `${trait}\0${event}\0${from}\0${canonicalJson(payload)}\0${canonicalJson(frame)}`;
626
+ }
627
+ var COMPOSITE = /* @__PURE__ */ Symbol("composite");
628
+ function canonicalLeaf(value) {
629
+ if (value === void 0 || value === null) return null;
630
+ if (typeof value === "number") return Number.isFinite(value) ? value : null;
631
+ if (typeof value === "object") return COMPOSITE;
632
+ return value;
633
+ }
634
+ function sameCanonical(a, b) {
635
+ if (a === b) return true;
636
+ const leafA = canonicalLeaf(a);
637
+ const leafB = canonicalLeaf(b);
638
+ if (leafA !== COMPOSITE || leafB !== COMPOSITE) return leafA === leafB;
639
+ if (isPayloadList(a) || isPayloadList(b)) {
640
+ if (!isPayloadList(a) || !isPayloadList(b) || a.length !== b.length) return false;
641
+ return a.every((item, i) => sameCanonical(item, b[i]));
642
+ }
643
+ if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) return false;
644
+ const keysA = Object.keys(a);
645
+ const keysB = Object.keys(b);
646
+ return keysA.length === keysB.length && keysA.every((k) => k in b && sameCanonical(a[k], b[k]));
647
+ }
648
+ var DispatchVisits = class {
649
+ constructor() {
650
+ this.steps = /* @__PURE__ */ new Map();
651
+ }
652
+ has(trait, event, from, payload, frame) {
653
+ const seen = this.steps.get(`${trait}\0${event}\0${from}`);
654
+ return seen !== void 0 && seen.some((v) => sameCanonical(v.payload, payload) && sameCanonical(v.frame, frame));
655
+ }
656
+ add(trait, event, from, payload, frame) {
657
+ if (this.has(trait, event, from, payload, frame)) return;
658
+ const step = `${trait}\0${event}\0${from}`;
659
+ const visit = {
660
+ payload: payload === void 0 || payload === null ? null : { ...payload },
661
+ frame: frame === null ? null : { ...frame }
662
+ };
663
+ const seen = this.steps.get(step);
664
+ if (seen === void 0) this.steps.set(step, [visit]);
665
+ else seen.push(visit);
666
+ }
667
+ };
668
+
669
+ // src/types/guard-holds.ts
670
+ function guardHolds(check, onError) {
671
+ try {
672
+ return check();
673
+ } catch (error) {
674
+ onError(error instanceof Error ? error : new Error(String(error)));
675
+ return false;
676
+ }
677
+ }
678
+ var ServerBatchSummarySchema = z.object({
679
+ operations: z.array(EntityRowSchema),
680
+ completedCount: z.number(),
681
+ totalCount: z.number()
682
+ });
683
+ var ServerEffectResultSchema = z.object({
684
+ effect: z.union([z.enum(SERVER_REPORTED_EFFECTS), z.literal("substrate")]),
685
+ action: z.string().optional(),
686
+ entityType: z.string().optional(),
687
+ name: z.custom((v) => typeof v === "string" && /^[^/]+\/.+$/.test(v)).optional(),
688
+ data: z.union([EntityRowSchema, ServerBatchSummarySchema, EventPayloadValueSchema]).optional(),
689
+ success: z.boolean(),
690
+ denied: z.literal(true).optional(),
691
+ error: z.string().optional(),
692
+ code: z.enum(["not-found", "no-row-key", "duplicate-id", "denied", "derived-failed"]).optional(),
693
+ target: z.string().optional(),
694
+ routed: z.string().optional()
695
+ });
696
+
697
+ // src/types/verification-ids.json
698
+ var verification_ids_default = {
699
+ actionPrefix: "action-",
700
+ overflowKey: "overflow",
701
+ gestureEventProps: {
702
+ longPressEvent: "long-press",
703
+ swipeLeftEvent: "swipe-left",
704
+ swipeRightEvent: "swipe-right"
705
+ },
706
+ nativeIdPrefix: {
707
+ pattern: "pattern-",
708
+ row: "row-",
709
+ field: "field-",
710
+ slot: "slot-"
711
+ },
712
+ nativeIdSeparator: " "
713
+ };
714
+
715
+ // src/types/verification.ts
716
+ var PATTERN_PROP_TYPE_ERROR_TESTID = "pattern-prop-type-error";
717
+ var TRAIT_MOUNT_ERROR_TESTID = "trait-mount-error";
718
+ var EMPTY_STATE_MARKER = "data-empty-state";
719
+ var LOADING_STATE_MARKER = "data-loading-state";
720
+ var VERIFICATION_DOM_ATTRS = {
721
+ pattern: "data-pattern",
722
+ rowId: "data-row-id",
723
+ entityRow: "data-entity-row",
724
+ entityId: "data-entity-id",
725
+ fieldName: "data-field-name",
726
+ event: "data-event"
727
+ };
728
+ var ACTION_TESTID_PREFIX = verification_ids_default.actionPrefix;
729
+ var ACTION_OVERFLOW_TESTID = `${ACTION_TESTID_PREFIX}${verification_ids_default.overflowKey}`;
730
+ var FORM_PATTERN = "form-section";
731
+ function actionTestId(eventKey) {
732
+ return `${ACTION_TESTID_PREFIX}${eventKey}`;
733
+ }
734
+ function actionTestIdMatches(testId, event) {
735
+ if (!testId.startsWith(ACTION_TESTID_PREFIX)) return false;
736
+ const key = testId.slice(ACTION_TESTID_PREFIX.length);
737
+ return key === event || key.endsWith(`.${event}`);
738
+ }
739
+ var GESTURES = ["tap", "long-press", "swipe-left", "swipe-right"];
740
+ function gestureOf(name) {
741
+ const gesture = GESTURES.find((g) => g !== "tap" && g === name);
742
+ if (gesture === void 0) throw new Error(`verification-ids.json names an unknown gesture "${name}"`);
743
+ return gesture;
744
+ }
745
+ var GESTURE_EVENT_PROPS = Object.fromEntries(
746
+ Object.entries(verification_ids_default.gestureEventProps).map(([prop, gesture]) => [prop, gestureOf(gesture)])
747
+ );
748
+ function gestureActionTestId(eventKey, gesture) {
749
+ return gesture === "tap" ? actionTestId(eventKey) : `${ACTION_TESTID_PREFIX}${gesture}:${eventKey}`;
750
+ }
751
+ function gestureOfActionTestId(testId, event) {
752
+ if (!testId.startsWith(ACTION_TESTID_PREFIX)) return null;
753
+ const rest = testId.slice(ACTION_TESTID_PREFIX.length);
754
+ const colon = rest.indexOf(":");
755
+ const gesture = colon < 0 ? "tap" : GESTURES.find((g) => g !== "tap" && g === rest.slice(0, colon));
756
+ if (gesture === void 0) return null;
757
+ const key = colon < 0 ? rest : rest.slice(colon + 1);
758
+ return key === event || key.endsWith(`.${event}`) ? gesture : null;
759
+ }
760
+ var NATIVE_ID_PREFIX = verification_ids_default.nativeIdPrefix;
761
+ var NATIVE_ID_SEPARATOR = verification_ids_default.nativeIdSeparator;
762
+ function nativeIds(...ids) {
763
+ return ids.filter((id) => id !== "").join(NATIVE_ID_SEPARATOR);
764
+ }
765
+ function splitNativeIds(identifier) {
766
+ return identifier.split(NATIVE_ID_SEPARATOR).filter((id) => id !== "");
767
+ }
768
+ function nativePatternId(name) {
769
+ return `${NATIVE_ID_PREFIX.pattern}${name}`;
770
+ }
771
+ function nativeRowId(id) {
772
+ return `${NATIVE_ID_PREFIX.row}${id}`;
773
+ }
774
+ function nativeFieldId(name) {
775
+ return `${NATIVE_ID_PREFIX.field}${name}`;
776
+ }
777
+ function nativeSlotId(name) {
778
+ return `${NATIVE_ID_PREFIX.slot}${name}`;
779
+ }
780
+
781
+ // src/generated/language/validation-codes.json
782
+ var validation_codes_default = [
783
+ {
784
+ code: "ORB_T_MISSING_RENDER_UI",
785
+ category: "trait",
786
+ description: "Interaction trait missing render_ui effects"
787
+ },
788
+ {
789
+ code: "ORB_T_BEHAVIOR_REF_UNRESOLVED",
790
+ category: "trait",
791
+ description: "A trait-value literal (`<spec>.traits.<Trait>`) whose behavior or trait does not resolve against the installed behavior packages."
792
+ },
793
+ {
794
+ code: "ORB_T_BEHAVIOR_REF_NOT_LITERAL",
795
+ category: "trait",
796
+ description: "A `behavior/ref` whose argument is computed at run time: a behavior from data must arrive as a `behavior` value, never re-parsed from text."
797
+ },
798
+ {
799
+ code: "ORB_T_UNQUOTE_OUTSIDE_QUASIQUOTE",
800
+ category: "trait",
801
+ description: 'An `["unquote", \u2026]` call outside a quasiquote body in an `.orb` input.'
802
+ },
803
+ {
804
+ code: "ORB_T_EVENT_REF_UNRESOLVED",
805
+ category: "trait",
806
+ description: "An event-typed config value addresses a trait the program does not have."
807
+ },
808
+ {
809
+ code: "ORB_T_EVENT_REF_NOT_EXTERNAL_INPUT",
810
+ category: "trait",
811
+ description: "An event-typed config value addresses an event its trait does not declare as an external input."
812
+ },
813
+ {
814
+ code: "ORB_T_CONFIG_SHAPE_MISMATCH",
815
+ category: "trait",
816
+ description: "Config field's default value doesn't match its declared structural shape (array vs scalar, object vs string, missing required, etc.). Fires after the typed-config carriers (`items` / `properties` / `values`) make the declared shape concrete enough to check against."
817
+ },
818
+ {
819
+ code: "ORB_T_TYPE_UNKNOWN",
820
+ category: "trait",
821
+ description: "A type reference names no declared type, entity or primitive"
822
+ },
823
+ {
824
+ code: "ORB_T_TYPE_CYCLE",
825
+ category: "trait",
826
+ description: "A type composition chain refers back to itself"
827
+ },
828
+ {
829
+ code: "ORB_T_TYPE_KIND_MISMATCH",
830
+ category: "trait",
831
+ description: "Composed types do not share a kind (all Entity, all Trait, \u2026)"
832
+ },
833
+ {
834
+ code: "ORB_T_TYPE_COMPOSITION_CONFLICT",
835
+ category: "trait",
836
+ description: "A field is declared in more than one composed entity"
837
+ },
838
+ {
839
+ code: "ORB_T_TYPE_ANNOTATION_MISMATCH",
840
+ category: "trait",
841
+ description: "A type body does not match its `::` type annotation"
842
+ },
843
+ {
844
+ code: "ORB_T_TYPE_UNKNOWN_PARAM",
845
+ category: "trait",
846
+ description: "A type alias body uses a type parameter the alias does not declare"
847
+ },
848
+ {
849
+ code: "ORB_T_TYPE_WRONG_ARG_COUNT",
850
+ category: "trait",
851
+ description: "A type alias is applied with the wrong number of type arguments"
852
+ },
853
+ {
854
+ code: "ORB_T_EVENT_TYPE_WRONG_KIND",
855
+ category: "trait",
856
+ description: "An `emits` entry names a declared type that is not an Event type"
857
+ },
858
+ {
859
+ code: "ORB_P_UNKNOWN_PROTOCOL",
860
+ category: "page",
861
+ description: "A page names a protocol that is no row of the protocol table"
862
+ },
863
+ {
864
+ code: "ORB_P_ENDPOINT_GRANT_MISSING",
865
+ category: "page",
866
+ description: "An `http` endpoint has no covering `net` listen grant"
867
+ },
868
+ {
869
+ code: "ORB_P_ADDRESS_INVALID",
870
+ category: "page",
871
+ description: "A protocol page's address does not type-check against the protocol's address record"
872
+ },
873
+ {
874
+ code: "ORB_RUI_INVALID_ROW_ROUTE",
875
+ category: "render_ui",
876
+ description: "A data-grid/data-list row action `navigatesTo` is neither a literal path nor a quoted single-row lambda."
877
+ },
878
+ {
879
+ code: "ORB_RUI_UNKNOWN_ITEM_ACTION_PROP",
880
+ category: "render_ui",
881
+ description: "Unknown itemAction prop (e.g., hallucinated 'condition')"
882
+ },
883
+ {
884
+ code: "ORB_RUI_BINDING_TYPE_MISMATCH",
885
+ category: "render_ui",
886
+ description: "L2.1 keystone: render-ui prop bound to a `@payload.X` / `@entity.X` / `@config.X` / SExpression operator whose resolved type doesn't match any of the prop's declared `types` in the patterns registry. Distinct from `RenderUIPropTypeMismatch` (literal-only); this rule uses the F3 binding resolver to walk through bindings and SExpression operator return types (sharpened by F2's `returnSemantics` for input-dependent operators). Gap #6 in `docs/Almadar_Std_Verification.md`."
887
+ },
888
+ {
889
+ code: "ORB_RUI_EVENT_BINDING_PAYLOAD_MISMATCH",
890
+ category: "render_ui",
891
+ description: "L2.2: render-ui prop with `kind: \"event-ref\"` or `kind: \"callback\"` bound to an event-name string whose declared payload schema in the trait's `emits {}` block doesn't match the component's documented bus emit shape (registry's `emitPayloadSchema` for event-ref props; `callbackArgs` for callback props). Gap #32 in `docs/Almadar_Std_Verification.md`."
892
+ },
893
+ {
894
+ code: "ORB_CANCEL_CALL_NO_KEYED_CALL",
895
+ category: "effect",
896
+ description: "the app runs `cancel-call` but no `call-service` anywhere carries a `key`"
897
+ },
898
+ {
899
+ code: "ORB_CANCEL_CALL_KEY_NEVER_CALLED",
900
+ category: "effect",
901
+ description: "`--final`: a `cancel-call` on a `CallKey` (or a list of them) in a finished program where no keyed call has a `CallKey`-typed `key:`, so nothing the program runs is named by a key made with `as`"
902
+ },
903
+ {
904
+ code: "ORB_PAGE_FACTS_UNREQUESTED_READ",
905
+ category: "effect",
906
+ description: "an event reads a page fact the `browser/page-facts` call did not request"
907
+ },
908
+ {
909
+ code: "ORB_TAB_REQUEST_REFUSED",
910
+ category: "effect",
911
+ description: "a literal `browser/tab-*` request whose keys the op declares but whose values the kernel's tab-call parser refuses"
912
+ },
913
+ {
914
+ code: "ORB_X_DISPATCH_MIXED_RESIDENCE",
915
+ category: "effect",
916
+ description: "one dispatch's delegated effects reach browser-stored rows and server work"
917
+ },
918
+ {
919
+ code: "ORB_EFF_SLOT_CONFLICT",
920
+ category: "effect",
921
+ description: "Multiple render_ui effects targeting same slot"
922
+ },
923
+ {
924
+ code: "ORB_EFF_NOTIFY_RETIRED",
925
+ category: "effect",
926
+ description: "`notify` is sugar for `render-ui toast { type: alert, \u2026 }`, desugared at `.lolo` lowering (owner ruling 2026-09-11) \u2014 the `.orb` IR never carries a `notify` effect kind. A `notify` tuple reaching L2 means a hand-authored `.orb` or a registry not yet re-emitted."
927
+ },
928
+ {
929
+ code: "ORB_EMIT_DECLARED_BUT_UNFIRED",
930
+ category: "effect",
931
+ description: "Trait declares an event in its `emits[]` block but no transition fires it via `(emit X)` or operator emit-config success/failure. Usually a copy-paste leftover or a stale declaration after a rename; gap #2 defense in `docs/Almadar_Std_Verification.md`."
932
+ },
933
+ {
934
+ code: "ORB_EFF_MISSING_REQUIRED_EMIT",
935
+ category: "effect",
936
+ description: "Operator declares `requiresEmitSuccess: true` in canonical-operators.json but the effect call site is missing the trailing options object or its `emit.success` event key. Applies to fetch / persist / call-service by default; any future operator can opt in via the same JSON flag."
937
+ },
938
+ {
939
+ code: "SEXPR_ARITY_MISMATCH",
940
+ category: "sexpr",
941
+ description: "Wrong number of arguments for operator"
942
+ },
943
+ {
944
+ code: "SEXPR_LAMBDA_ARG_POSITION",
945
+ category: "sexpr",
946
+ description: "A `(fn \u2026)` form in an argument position the operator does not take its lambda in \u2014 decidable wrong argument order, e.g. `(array/reduce arr (fn \u2026) init)`"
947
+ },
948
+ {
949
+ code: "SEXPR_EFFECT_IN_GUARD",
950
+ category: "sexpr",
951
+ description: "Effect operator used in guard context"
952
+ },
953
+ {
954
+ code: "ORB_X_UNRESOLVED_PATTERN_FIELD_REF",
955
+ category: "cross",
956
+ description: "A pattern prop tagged `kind: 'field-ref'` (scalar) or `itemKind: 'field-ref'` (array element) carries a value that does not resolve to any field on the linked entity. Error severity. See Phase 3.2/3.3 in docs/Almadar_Agent_Behaviors_Plan.md."
957
+ },
958
+ {
959
+ code: "ORB_CONFIG_FIELD_REF_UNKNOWN",
960
+ category: "binding",
961
+ description: "A `field @entity` config knob names something that is not a field of the trait's bound entity"
962
+ },
963
+ {
964
+ code: "ORB_CONFIG_FIELD_REF_TYPE_MISMATCH",
965
+ category: "binding",
966
+ description: "A `field @entity T` config knob names a field whose type is not `T`"
967
+ },
968
+ {
969
+ code: "ORB_BINDING_INVALID_PATH",
970
+ category: "binding",
971
+ description: "Invalid binding path"
972
+ },
973
+ {
974
+ code: "ORB_X_SET_VALUE_TYPE_MISMATCH",
975
+ category: "effect",
976
+ description: "`(set @entity.X ?payloadField)` writes a payload field whose declared type does not match the target entity field's declared type. The lolo crate catches this at author time for `.lolo`; this is the raw-`.orb` defense-in-depth backstop. Payload field types are sourced from the trait's `emits[].payload_schema` and `listens` payload metadata."
977
+ },
978
+ {
979
+ code: "ORB_X_SET_RETURN_TYPE_MISMATCH",
980
+ category: "effect",
981
+ description: "`(set @entity.X (op \u2026))` assigns an operator/expression value whose inferred result type is incompatible with the target field's declared type (e.g. `(set @entity.count (str/concat \u2026))` into a `number` field). The value's type is inferred *through* the S-expression via the canonical operator `return_semantics` lattice; an unknowable result (`Json`) never rejects (Gap G-LOLO-SET-OP-RETURN)."
982
+ },
983
+ {
984
+ code: "ORB_X_COMPARISON_OPERAND_TYPE_MISMATCH",
985
+ category: "effect",
986
+ description: "An ordering comparison (`<`, `<=`, `>`, `>=`) whose operands infer to a number on one side and a string on the other. The JS runtime coerces, the compiled TypeScript does not typecheck, and Rust compares kinds \u2014 the paths disagree. Convert one side so both are the same kind."
987
+ },
988
+ {
989
+ code: "ORB_X_OPERATOR_ARG_TYPE_MISMATCH",
990
+ category: "effect",
991
+ description: 'An operator argument whose static type contradicts the type the operator table declares for its position \u2014 `(str/upper @entity.count)` with `count: number`, `(+ "a" 1)`. Both evaluators raise the same typed mismatch at run time (D-12), so the program can never do what it says.'
992
+ },
993
+ {
994
+ code: "ORB_OBJECT_PATH_UNDECLARED",
995
+ category: "effect",
996
+ description: "A literal path read through `object/get` (or another `key-of` operator) names a segment its first argument's declared type does not have: an empty segment, a record field the record does not declare, a non-numeric segment on a list or tuple, or a segment past a scalar. A Map takes any non-empty key segment. The read could only ever answer null or its default; a default does not excuse it. To read a key that contains a dot, escape the dot (`a\\.b`) or read the map with `object/pick`."
997
+ },
998
+ {
999
+ code: "ORB_X_OPERATOR_ARG_UNDETERMINED",
1000
+ category: "effect",
1001
+ description: "A value handed to an operator has no determined type \u2014 an unresolved expression, an expression value, json, a loose union, a list whose items share no type \u2014 so it cannot be checked against the type the operator declares (or, at a type variable, what the variable stands for and the type of the result are unknown). Narrow it with `(as value T)` (checked, null on a misfit), or give it a real type (a declared payload or entity shape, a named union alias for a list of differently-shaped items)."
1002
+ },
1003
+ {
1004
+ code: "ORB_X_ORDERING_OPTIONAL_OPERAND",
1005
+ category: "effect",
1006
+ description: "An ordering comparison (`<`, `<=`, `>`, `>=`) over an operand that can be missing or null \u2014 an optional entity field with no default, an optional payload field \u2014 that the program neither guards with a presence check (`(and (validate/required x) (< x 3))`, an `if`/`when` on presence) nor declares a default for. Both evaluators read a missing value as below any number; every push-down store fails the comparison, so the meaning is the program's to state."
1007
+ },
1008
+ {
1009
+ code: "ORB_X_OPERATOR_NULL_OPERAND",
1010
+ category: "effect",
1011
+ description: "An operand that can be missing or null \u2014 an optional entity field with no default, an optional payload field \u2014 handed to a position the kernel raises on when it is null (`rejectsNull` in the operator table), with no presence check or default in front of it. The program says what a missing value means: a guard, a default, or a required field."
1012
+ },
1013
+ {
1014
+ code: "ORB_X_OPERATOR_OPTION_NEWER",
1015
+ category: "effect",
1016
+ description: "A call states an operator option that the installed operator table introduces in an orb release newer than the one running (`optionSince`), so this orb would refuse or ignore it at the host. Upgrade orb, or drop the option."
1017
+ },
1018
+ {
1019
+ code: "ORB_X_SET_REQUIRED_FIELD_FROM_OPTIONAL_KNOB",
1020
+ category: "effect",
1021
+ description: "`(set @entity.X @config.<knob>)` where the value is STILL the literal `@config.<knob>` token post-inline (no default resolved it, no call-site override supplied one) and `X` is a REQUIRED entity field. The emitter has nothing honest to assign \u2014 a required TS slot gets `undefined`. Give the knob a default or make the field optional."
1022
+ },
1023
+ {
1024
+ code: "ORB_EMIT_PAYLOAD_MISSING_REQUIRED",
1025
+ category: "binding",
1026
+ description: "`(emit EVT {...})` literal payload is missing a field the event's declared payload marks as required. Error severity."
1027
+ },
1028
+ {
1029
+ code: "ORB_EMIT_PAYLOAD_EXTRA_FIELD",
1030
+ category: "binding",
1031
+ description: "`(emit EVT {...})` literal carries a field that is not declared on the event's payload schema. Error severity."
1032
+ },
1033
+ {
1034
+ code: "ORB_EMIT_PAYLOAD_FIELD_TYPE_MISMATCH",
1035
+ category: "binding",
1036
+ description: "`(emit EVT {...})` literal provides a value whose primitive type does not match the declared `PayloadField.field_type`. Error severity."
1037
+ },
1038
+ {
1039
+ code: "ORB_EMIT_REPEATS_IDENTICALLY",
1040
+ category: "binding",
1041
+ description: "An `emit` repeats an earlier one of the same transition identically: the dispatch loop collapses the second."
1042
+ },
1043
+ {
1044
+ code: "ORB_X_ENTITY_PROP_CONTRACT",
1045
+ category: "render_ui",
1046
+ description: "A render-ui pattern prop typed `EntityWith<K>` declares required entity fields (`requiredFields` in the registry), but the bound entity does not provide them and no remap/field-map supplies them. The component would render blank rows. Remap-aware (runs post-inline). Error severity."
1047
+ },
1048
+ {
1049
+ code: "ORB_EMIT_PAYLOAD_NOT_PRODUCED",
1050
+ category: "binding",
1051
+ description: "**The payload invariant.** An event's declared payload type IS its access path: declaring `Survey` means the payload is the row (read `?name`); declaring `{ row : Survey }` means read `?row.name`. This fires when an event declares a field that the effect firing it does not actually emit \u2014 so every read of that field is `undefined` at runtime, even though `orb validate` and `orb verify` otherwise pass. Checked as width subtyping (`declared \u2286 produced`): declaring FEWER fields than are emitted is legal, declaring one that is never emitted is not. Replaces the narrower `EmitSuccessPayloadWrapped` (persist-only) and `EmitSuccessPayloadReturnMismatch` (empty-payload-only) checks. Error severity."
1052
+ },
1053
+ {
1054
+ code: "ORB_EFFECT_IN_LAMBDA",
1055
+ category: "binding",
1056
+ description: "An effect (`emit`, `persist`, `set`, `notify`, \u2026) inside the `fn` body of a collection operator: a lambda is evaluated for its value, an effect there never runs. Error severity."
1057
+ },
1058
+ {
1059
+ code: "CIRCUIT_DEAD_END_COMPONENT",
1060
+ category: "circuit",
1061
+ description: "Interactive component missing itemActions"
1062
+ },
1063
+ {
1064
+ code: "ORB_GEN_INVALID_REFERENCE",
1065
+ category: "generic",
1066
+ description: "Generic invalid reference format"
1067
+ },
1068
+ {
1069
+ code: "ORB_GEN_MISSING_FIELD",
1070
+ category: "generic",
1071
+ description: "Generic missing required field"
1072
+ },
1073
+ {
1074
+ code: "ORB_GEN_DUPLICATE",
1075
+ category: "generic",
1076
+ description: "Generic duplicate entity/item"
1077
+ },
1078
+ {
1079
+ code: "CIRCUIT_ACTION_COMPONENT_MISMATCH",
1080
+ category: "circuit",
1081
+ description: "An item action is used on a component type that does not support that action"
1082
+ },
1083
+ {
1084
+ code: "CIRCUIT_DEAD_END_STATE",
1085
+ category: "circuit",
1086
+ description: "A state has no outgoing transitions, so it is a dead end"
1087
+ },
1088
+ {
1089
+ code: "CIRCUIT_DEAD_HANDLER",
1090
+ category: "circuit",
1091
+ description: "An item action fires an event into a state where no transition handles that event"
1092
+ },
1093
+ {
1094
+ code: "CIRCUIT_DUPLICATE_EVENT",
1095
+ category: "circuit",
1096
+ description: "The same event is emitted by more than one action within a single render-ui effect"
1097
+ },
1098
+ {
1099
+ code: "CIRCUIT_MODAL_EXIT_INCOMPLETE",
1100
+ category: "circuit",
1101
+ description: "A transition leaving a modal state does not close the modal overlay it opened"
1102
+ },
1103
+ {
1104
+ code: "CIRCUIT_NO_OVERLAY_EXIT",
1105
+ category: "circuit",
1106
+ description: "A state renders into an overlay slot but has no exit transition, leaving users stuck"
1107
+ },
1108
+ {
1109
+ code: "CIRCUIT_ORPHAN_EVENT",
1110
+ category: "circuit",
1111
+ description: "An action or emit raises an event that has no transition handler"
1112
+ },
1113
+ {
1114
+ code: "CIRCUIT_UNREACHABLE_STATE",
1115
+ category: "circuit",
1116
+ description: "A state has no incoming transitions and cannot be reached"
1117
+ },
1118
+ {
1119
+ code: "LINT_NODE_UNCHECKED",
1120
+ category: "lint",
1121
+ description: "A lint rule met a schema node of an unexpected shape and could not check it"
1122
+ },
1123
+ {
1124
+ code: "ORB_A11Y_UNNAMED",
1125
+ category: "a11y",
1126
+ description: "A render-ui control has no accessible name, so screen readers announce it as unlabeled"
1127
+ },
1128
+ {
1129
+ code: "ORB_ASSET_INLINE_URL",
1130
+ category: "asset",
1131
+ description: "A literal http(s) url sits in the config defaults or seed rows of an orbital that composes std-asset-pack."
1132
+ },
1133
+ {
1134
+ code: "ORB_AUTH_GUARD_CLIENT_ONLY",
1135
+ category: "auth",
1136
+ description: "A transition guards on @user but its trait dispatches client-only, so the UI transition advances before the server evaluates the guard"
1137
+ },
1138
+ {
1139
+ code: "ORB_BEACON_OPTION_UNKNOWN",
1140
+ category: "beacon",
1141
+ description: "A browser beacon request carries an option key that is not a known beacon request key"
1142
+ },
1143
+ {
1144
+ code: "ORB_BEACON_TEXT_REQUIRED",
1145
+ category: "browser",
1146
+ description: "browser/beacon needs a request carrying a text field"
1147
+ },
1148
+ {
1149
+ code: "ORB_BEACON_URL_NOT_ABSOLUTE",
1150
+ category: "browser",
1151
+ description: "A browser beacon effect targets a URL that is not an absolute http(s) URL"
1152
+ },
1153
+ {
1154
+ code: "ORB_BINDING_DISPATCH_ROOT_IN_TICK",
1155
+ category: "binding",
1156
+ description: "A dispatch-only binding root is read inside a tick, where a firing has no delivery"
1157
+ },
1158
+ {
1159
+ code: "ORB_BINDING_EMBED_READS_ARM_WRITE",
1160
+ category: "binding",
1161
+ description: "A transition writes a value and renders a child that reads it on mount, so the child shows the stale value"
1162
+ },
1163
+ {
1164
+ code: "ORB_BINDING_ENTITY_FIELD_NEVER_SET",
1165
+ category: "binding",
1166
+ description: "A trait reads an entity binding field but no transition ever sets it, so it stays undefined"
1167
+ },
1168
+ {
1169
+ code: "ORB_BINDING_ENTITY_FIELD_NOT_FOUND",
1170
+ category: "binding",
1171
+ description: "An @entity binding names a field that the linked entity does not declare"
1172
+ },
1173
+ {
1174
+ code: "ORB_BINDING_EVENT_INVALID_PATH",
1175
+ category: "binding",
1176
+ description: "An @event binding path does not follow the shape of the delivery record"
1177
+ },
1178
+ {
1179
+ code: "ORB_BINDING_FROM_ENTITY_OUTSIDE_ENSURES",
1180
+ category: "binding",
1181
+ description: "@fromEntity is the row before a transition and may only be used inside an @ensures"
1182
+ },
1183
+ {
1184
+ code: "ORB_BINDING_INVALID_FORMAT",
1185
+ category: "binding",
1186
+ description: "A binding string is not in a valid binding format"
1187
+ },
1188
+ {
1189
+ code: "ORB_BINDING_NOW_NO_PATH",
1190
+ category: "binding",
1191
+ description: "The @now binding is given a path, but it returns the current timestamp directly"
1192
+ },
1193
+ {
1194
+ code: "ORB_BINDING_PAYLOAD_FIELD_UNDECLARED",
1195
+ category: "binding",
1196
+ description: "A @payload binding reads a field that the triggering event does not declare in its payload"
1197
+ },
1198
+ {
1199
+ code: "ORB_BINDING_PAYLOAD_IN_TICK",
1200
+ category: "binding",
1201
+ description: "A binding reads @payload inside a tick, where a firing has no delivery"
1202
+ },
1203
+ {
1204
+ code: "ORB_BINDING_PERSIST_ROW_ID_NEVER_SET",
1205
+ category: "binding",
1206
+ description: "A persist update or delete runs on an event but no transition sets the row id, so the write never touches a row"
1207
+ },
1208
+ {
1209
+ code: "ORB_BINDING_ROOT_NO_PATH",
1210
+ category: "binding",
1211
+ description: "A binding root that takes no path is written with a path"
1212
+ },
1213
+ {
1214
+ code: "ORB_BINDING_SET_TARGET_MISSING_PATH",
1215
+ category: "binding",
1216
+ description: "A set effect targets a binding root without a field path"
1217
+ },
1218
+ {
1219
+ code: "ORB_BINDING_STATE_NO_PATH",
1220
+ category: "binding",
1221
+ description: "A binding root that returns a bare value, such as @state, is given a path"
1222
+ },
1223
+ {
1224
+ code: "ORB_BINDING_TRAIT_CYCLE",
1225
+ category: "binding",
1226
+ description: "A cycle exists in @trait references"
1227
+ },
1228
+ {
1229
+ code: "ORB_BINDING_TRAIT_INVALID_FORMAT",
1230
+ category: "binding",
1231
+ description: "A trait binding or trait-typed config default is not a valid trait reference"
1232
+ },
1233
+ {
1234
+ code: "ORB_BINDING_TRAIT_INVALID_POSITION",
1235
+ category: "binding",
1236
+ description: "A @trait binding appears in a position other than a children array or a node-typed prop"
1237
+ },
1238
+ {
1239
+ code: "ORB_BINDING_TRAIT_MISSING_NAME",
1240
+ category: "binding",
1241
+ description: "A @trait binding does not name the trait it refers to"
1242
+ },
1243
+ {
1244
+ code: "ORB_BINDING_TRAIT_OUTSIDE_RENDER_UI",
1245
+ category: "binding",
1246
+ description: "An @trait binding appears outside a render-ui effect, where it is the only place trait references are allowed"
1247
+ },
1248
+ {
1249
+ code: "ORB_BINDING_TRAIT_SELF_REFERENCE",
1250
+ category: "binding",
1251
+ description: "A trait references itself through a trait binding"
1252
+ },
1253
+ {
1254
+ code: "ORB_BINDING_TRAIT_UNKNOWN",
1255
+ category: "binding",
1256
+ description: "A @trait binding references a trait that is not declared in this orbital"
1257
+ },
1258
+ {
1259
+ code: "ORB_BINDING_UNKNOWN_ENTITY",
1260
+ category: "binding",
1261
+ description: "A binding refers to an entity that is not declared in the program"
1262
+ },
1263
+ {
1264
+ code: "ORB_BINDING_UNKNOWN_ROOT",
1265
+ category: "binding",
1266
+ description: "A binding names a root the context does not provide"
1267
+ },
1268
+ {
1269
+ code: "ORB_CALL_KEY_UNUSED",
1270
+ category: "effect",
1271
+ description: "A literal (as 'k' CallKey) names a key that no keyed call in the program runs under"
1272
+ },
1273
+ {
1274
+ code: "ORB_CALL_SERVICE_CANCELLED_WITHOUT_KEY",
1275
+ category: "call_service",
1276
+ description: "A call-service declares emit.cancelled but has no key, so nothing can cancel an unkeyed call"
1277
+ },
1278
+ {
1279
+ code: "ORB_CALL_SERVICE_KEY_DUPLICATE",
1280
+ category: "effect",
1281
+ description: "Two call-service effects in one transition use the same key"
1282
+ },
1283
+ {
1284
+ code: "ORB_CALL_SERVICE_KEY_TYPE",
1285
+ category: "call_service",
1286
+ description: "A keyed call-service effect has a key that is not a non-empty string"
1287
+ },
1288
+ {
1289
+ code: "ORB_CALL_SERVICE_RESULT_HAS_KEY",
1290
+ category: "effect",
1291
+ description: "A keyed call-service returns a record that already has a key field, so the call key would collide with it"
1292
+ },
1293
+ {
1294
+ code: "ORB_CIRCUIT_ASYNC_RESULT_DEAF_TARGET",
1295
+ category: "circuit",
1296
+ description: "A transition declares async result events but its target state has no arm handling them, so the requester cannot hear its own result"
1297
+ },
1298
+ {
1299
+ code: "ORB_CIRCUIT_DEAD_BODILESS_ACTION",
1300
+ category: "circuit",
1301
+ description: "A transition changes state but carries no effects, so the screen keeps its paint and affordances routed to it are dead"
1302
+ },
1303
+ {
1304
+ code: "ORB_CIRCUIT_FAILURE_ARM_MISSING",
1305
+ category: "circuit",
1306
+ description: "A transition starting an asynchronous client call has no failure arm to handle its error"
1307
+ },
1308
+ {
1309
+ code: "ORB_CIRCUIT_FAILURE_ARM_RENDERS_NOTHING",
1310
+ category: "circuit",
1311
+ description: "A state handles a failure event but its arm neither renders nor emits a declared event, so the failure reaches no one"
1312
+ },
1313
+ {
1314
+ code: "ORB_CIRCUIT_INIT_UNCOVERED_STATE",
1315
+ category: "circuit",
1316
+ description: "A page trait handles INIT in its initial state but not in another reachable state, so revisiting the page from there does nothing"
1317
+ },
1318
+ {
1319
+ code: "ORB_CIRCUIT_LIFECYCLE_EMIT_UNDELIVERED",
1320
+ category: "circuit",
1321
+ description: "A transition emits a lifecycle event that the event bus never delivers"
1322
+ },
1323
+ {
1324
+ code: "ORB_CIRCUIT_MODAL_SHELL_CLOSE_DEAF",
1325
+ category: "circuit",
1326
+ description: "A state mounting an overlay-slot pattern has no CLOSE or CANCEL transition to dismiss it"
1327
+ },
1328
+ {
1329
+ code: "ORB_CIRCUIT_OWN_EMIT_UNREACHABLE",
1330
+ category: "circuit",
1331
+ description: "A transition emits an event its own trait handles only from other states, so the same-trait cascade never delivers it from the target state"
1332
+ },
1333
+ {
1334
+ code: "ORB_CIRCUIT_SELF_EMIT_LOOP",
1335
+ category: "circuit",
1336
+ description: "A transition re-emits its own trigger event with a constant payload and a same-event arm is reachable, so it loops forever"
1337
+ },
1338
+ {
1339
+ code: "ORB_CIRCUIT_SELF_OVERLAY_IN_SHELL",
1340
+ category: "circuit",
1341
+ description: "A self-overlaying pattern is rendered inside an overlay slot payload, stacking two overlay chromes"
1342
+ },
1343
+ {
1344
+ code: "ORB_CIRCUIT_VIEWER_STRANDED",
1345
+ category: "circuit",
1346
+ description: "A page's content owner repaints its region on a user-triggered event with a body that offers no way on"
1347
+ },
1348
+ {
1349
+ code: "ORB_COMPOSED_STATE_UNREACHABLE",
1350
+ category: "circuit",
1351
+ description: "A composed trait can never enter some states because nothing in the program sends the events that enter them"
1352
+ },
1353
+ {
1354
+ code: "ORB_COMPOSED_TRANSITION_UNREACHABLE",
1355
+ category: "composed",
1356
+ description: "A composed trait handles events that nothing in the program ever sends"
1357
+ },
1358
+ {
1359
+ code: "ORB_COMPUTED_KEY_DOT_PATH",
1360
+ category: "lint",
1361
+ description: "object/set, object/get or object/has on a Map field with a str/concat key containing a literal dot: the key is read as a dot path, so the value nests instead of being one map entry"
1362
+ },
1363
+ {
1364
+ code: "ORB_CONFIG_DANGLING_REF",
1365
+ category: "binding",
1366
+ description: "An @config key is not declared by any config schema reachable from the trait chain"
1367
+ },
1368
+ {
1369
+ code: "ORB_CONTROL_NO_CONSEQUENCE",
1370
+ category: "emit",
1371
+ description: "A rendered control fires an event whose handlers change nothing the app or the viewer can observe."
1372
+ },
1373
+ {
1374
+ code: "ORB_CONTROL_VALUE_DISCARDED",
1375
+ category: "circuit",
1376
+ description: "A composed trait's rendered control fires an event carrying a value that no other trait hears and whose own handling reads none of it: the value the user entered is discarded (a form submission nothing keeps)."
1377
+ },
1378
+ {
1379
+ code: "ORB_CREDENTIAL_REQUEST_INVALID",
1380
+ category: "credential",
1381
+ description: "A credential request host effect carries options other than the ones it declares"
1382
+ },
1383
+ {
1384
+ code: "ORB_DERIVED_FIELD_WRITTEN",
1385
+ category: "entity_mutation",
1386
+ description: "A set or persist writes an @derived field that the kernel computes on every write"
1387
+ },
1388
+ {
1389
+ code: "ORB_EFFECT_OPTION_DROPPED",
1390
+ category: "effect",
1391
+ description: "An effect carries options that depend on a key echo, but the effect has no key so the options are dropped"
1392
+ },
1393
+ {
1394
+ code: "ORB_EFF_CALL_SERVICE_MISSING_ACTION",
1395
+ category: "effect",
1396
+ description: "A call-service effect has no string action"
1397
+ },
1398
+ {
1399
+ code: "ORB_EFF_CALL_SERVICE_MISSING_PARAM",
1400
+ category: "effect",
1401
+ description: "A call-service effect omits a parameter the service action requires"
1402
+ },
1403
+ {
1404
+ code: "ORB_EFF_CALL_SERVICE_MISSING_SERVICE",
1405
+ category: "effect",
1406
+ description: "A call_service effect is missing its service name or action"
1407
+ },
1408
+ {
1409
+ code: "ORB_EFF_CALL_SERVICE_PARAM_TYPE",
1410
+ category: "effect",
1411
+ description: "A call-service parameter has a value whose type does not match the type the service action declares"
1412
+ },
1413
+ {
1414
+ code: "ORB_EFF_CALL_SERVICE_UNKNOWN_PARAM",
1415
+ category: "effect",
1416
+ description: "A call-service passes a param that the service action does not declare"
1417
+ },
1418
+ {
1419
+ code: "ORB_EFF_CALL_SERVICE_UNKNOWN_SERVICE",
1420
+ category: "effect",
1421
+ description: "A call-service effect names a service that is not a registered integrator or declared service"
1422
+ },
1423
+ {
1424
+ code: "ORB_EFF_EMIT_INVALID_NAME",
1425
+ category: "effect",
1426
+ description: "The event name inside an emit effect is not a valid string event name"
1427
+ },
1428
+ {
1429
+ code: "ORB_EFF_EMIT_KEY_INVALID",
1430
+ category: "effect",
1431
+ description: "An emit config carries a key that the operator does not support"
1432
+ },
1433
+ {
1434
+ code: "ORB_EFF_EMIT_UNDECLARED_EVENT",
1435
+ category: "effect",
1436
+ description: "An event named in emit is not declared in the trait's emits array"
1437
+ },
1438
+ {
1439
+ code: "ORB_EFF_FETCH_BY_ID_PAYLOAD_LIST",
1440
+ category: "effect",
1441
+ description: "A fetch by id effect takes its id from a payload that is a list rather than a single value"
1442
+ },
1443
+ {
1444
+ code: "ORB_EFF_FETCH_INVALID_ENTITY",
1445
+ category: "effect",
1446
+ description: "A fetch effect is missing an entity name or references an invalid entity"
1447
+ },
1448
+ {
1449
+ code: "ORB_EFF_FETCH_INVALID_INCLUDE",
1450
+ category: "effect",
1451
+ description: "A fetch includes a relation that the fetched entity has no relation field for"
1452
+ },
1453
+ {
1454
+ code: "ORB_EFF_FETCH_INVALID_OPTION",
1455
+ category: "effect",
1456
+ description: "A fetch deliver option is not one of the allowed values rows or ids"
1457
+ },
1458
+ {
1459
+ code: "ORB_EFF_MISSING_FETCH_FOR_ENTITY",
1460
+ category: "effect",
1461
+ description: "A render-ui references an entity but no fetch effect for it exists in this or any predecessor transition"
1462
+ },
1463
+ {
1464
+ code: "ORB_EFF_NAVIGATE_MISSING_PAYLOAD",
1465
+ category: "effect",
1466
+ description: "A navigate effect omits a payload field the target page requires for its INIT event"
1467
+ },
1468
+ {
1469
+ code: "ORB_EFF_NAVIGATE_TARGET_UNREACHABLE",
1470
+ category: "effect",
1471
+ description: "A navigate target path does not resolve to any declared page"
1472
+ },
1473
+ {
1474
+ code: "ORB_EFF_PROGRAM_EVAL_FAILURE_MISSING",
1475
+ category: "effect",
1476
+ description: "program/eval carries no emit.failure event, so validator errors would be dropped"
1477
+ },
1478
+ {
1479
+ code: "ORB_EFF_RETIRED_FORM",
1480
+ category: "effect",
1481
+ description: "An effect is written in a retired object form instead of the array form"
1482
+ },
1483
+ {
1484
+ code: "ORB_EFF_SET_INVALID_BINDING",
1485
+ category: "effect",
1486
+ description: "A set effect is missing its binding or its value"
1487
+ },
1488
+ {
1489
+ code: "ORB_EFF_SET_PAYLOAD_NOT_ALLOWED",
1490
+ category: "effect",
1491
+ description: "A set effect targets @payload, which is read-only; it should target @entity"
1492
+ },
1493
+ {
1494
+ code: "ORB_EFF_UNKNOWN_TYPE",
1495
+ category: "effect",
1496
+ description: "An effect has an unknown type or is malformed"
1497
+ },
1498
+ {
1499
+ code: "ORB_EFF_UNSIGNED_NOT_ENV_GUARDED",
1500
+ category: "effect",
1501
+ description: "A jws/verify call with a literal allowUnsigned true sits in a transition that is not env-guarded"
1502
+ },
1503
+ {
1504
+ code: "ORB_EMBED_CONFIG_FORWARD_MULTI_REFERRER",
1505
+ category: "embed",
1506
+ description: "A trait that forwards @config is embedded by more than one referrer, so the forwarded value is ambiguous"
1507
+ },
1508
+ {
1509
+ code: "ORB_EMIT_CONFIG_REF_INVALID",
1510
+ category: "effect",
1511
+ description: "An emit config reference is invalid"
1512
+ },
1513
+ {
1514
+ code: "ORB_EMIT_CONTROL_UNHANDLED",
1515
+ category: "emit",
1516
+ description: "A rendered control fires an event nothing handles or routes."
1517
+ },
1518
+ {
1519
+ code: "ORB_EMIT_UNROUTED_TO_HANDLER",
1520
+ category: "trait_event",
1521
+ description: "A trait emits an event another trait has an arm for, but no declared listens route delivers it"
1522
+ },
1523
+ {
1524
+ code: "ORB_ENTITY_INTRINSIC_FIELD_PERSISTED",
1525
+ category: "entity_mutation",
1526
+ description: "A persist data literal names an @intrinsic field, which is trait-owned view-state and never a persisted column"
1527
+ },
1528
+ {
1529
+ code: "ORB_ENTITY_OWNER_COLUMN_UNSCOPED",
1530
+ category: "entity",
1531
+ description: "An entity declares owner columns but has no access policy scoping rows to the owner"
1532
+ },
1533
+ {
1534
+ code: "ORB_ENTITY_SPLIT_MUTATION",
1535
+ category: "entity_mutation",
1536
+ description: "A runtime entity is mutated by several traits on isolated per-trait copies while another trait reads a field it never writes"
1537
+ },
1538
+ {
1539
+ code: "ORB_E_DUPLICATE_FIELD",
1540
+ category: "entity",
1541
+ description: "An entity declares the same field name more than once"
1542
+ },
1543
+ {
1544
+ code: "ORB_E_EMPTY_ENUM_VALUES",
1545
+ category: "entity",
1546
+ description: "An enum field declares no values"
1547
+ },
1548
+ {
1549
+ code: "ORB_E_IDENTITY_LOCAL",
1550
+ category: "entity",
1551
+ description: "An identity entity is declared as browser-stored, but the viewer directory is never browser-resident"
1552
+ },
1553
+ {
1554
+ code: "ORB_E_INSTANCE_INVALID",
1555
+ category: "entity",
1556
+ description: "An entity instance row sets a key that is not a field of the entity"
1557
+ },
1558
+ {
1559
+ code: "ORB_E_INVALID_FIELD_NAME",
1560
+ category: "entity",
1561
+ description: "An entity field or entity name is empty or not in the required naming form"
1562
+ },
1563
+ {
1564
+ code: "ORB_E_INVALID_FIELD_TYPE",
1565
+ category: "entity",
1566
+ description: "An entity field declares a type that is not a valid field type"
1567
+ },
1568
+ {
1569
+ code: "ORB_E_INVALID_RELATION",
1570
+ category: "entity",
1571
+ description: "A relation field is missing its relation configuration or points at an entity that does not exist"
1572
+ },
1573
+ {
1574
+ code: "ORB_E_LITERAL_UNION_DEFAULT_MISMATCH",
1575
+ category: "entity",
1576
+ description: "A field default is not one of the values of its declared literal union"
1577
+ },
1578
+ {
1579
+ code: "ORB_E_LOCALE_INSTANCES_INCOMPLETE",
1580
+ category: "entity",
1581
+ description: "An entity writes rows per locale but has no default instances block for its default locale"
1582
+ },
1583
+ {
1584
+ code: "ORB_E_LOCALE_INSTANCES_NOT_LOCAL",
1585
+ category: "entity",
1586
+ description: "An entity writes rows per locale but its rows are not browser-stored, so every viewer shares them"
1587
+ },
1588
+ {
1589
+ code: "ORB_E_LOCALE_INSTANCES_UNKNOWN_LOCALE",
1590
+ category: "entity",
1591
+ description: "An entity writes locale instances for a locale that is not among the declared locales"
1592
+ },
1593
+ {
1594
+ code: "ORB_E_LOCAL_REQUIRES_PERSISTENT",
1595
+ category: "entity",
1596
+ description: "A runtime entity declares a browser storage location, which only applies to persistent entities"
1597
+ },
1598
+ {
1599
+ code: "ORB_E_MERGED_FIELD_UNREFERENCED",
1600
+ category: "entity",
1601
+ description: "A field merged into an entity is never read, written, fetch-included or persisted by any trait of the orbital"
1602
+ },
1603
+ {
1604
+ code: "ORB_E_MISSING_COLLECTION",
1605
+ category: "entity",
1606
+ description: "A persistent entity does not declare a collection name"
1607
+ },
1608
+ {
1609
+ code: "ORB_E_MISSING_NAME",
1610
+ category: "entity",
1611
+ description: "An entity is missing its required name"
1612
+ },
1613
+ {
1614
+ code: "ORB_E_MOCK_NOT_IN_ENUM",
1615
+ category: "entity",
1616
+ description: "Mock candidate values are not values of the enum field they belong to"
1617
+ },
1618
+ {
1619
+ code: "ORB_E_NO_FIELDS",
1620
+ category: "entity",
1621
+ description: "An entity declares no fields and must have at least one"
1622
+ },
1623
+ {
1624
+ code: "ORB_E_SEMANTIC_VALUE_INVALID",
1625
+ category: "entity",
1626
+ description: "A semantically typed field has a default value that is invalid for its kind, such as an empty string"
1627
+ },
1628
+ {
1629
+ code: "ORB_FETCH_DELIVER_IDS_ENTITY_REFS",
1630
+ category: "fetch",
1631
+ description: "A fetch using deliver ids also asks for included relations, but ids delivers no rows to carry them"
1632
+ },
1633
+ {
1634
+ code: "ORB_FETCH_DELIVER_IDS_NO_SUCCESS",
1635
+ category: "effect",
1636
+ description: "A fetch with deliver ids has no emit.success, so nothing carries the reference"
1637
+ },
1638
+ {
1639
+ code: "ORB_FETCH_DELIVER_IDS_ROWS_READ",
1640
+ category: "effect",
1641
+ description: "A fetch with deliver ids delivers a row-set reference as the success event's data; any use other than passing it whole as a render-ui prop value reads rows that were never delivered"
1642
+ },
1643
+ {
1644
+ code: "ORB_FETCH_NEEDS_COMPOSITE_INDEX",
1645
+ category: "effect",
1646
+ description: "A fetch query needs a composite index that the store driver does not create and no index declaration covers"
1647
+ },
1648
+ {
1649
+ code: "ORB_FETCH_TOTAL_NONE_READ",
1650
+ category: "effect",
1651
+ description: "A fetch with total none skips the count, so the success event's totalCount is never set and may not be read"
1652
+ },
1653
+ {
1654
+ code: "ORB_FETCH_UNINDEXED",
1655
+ category: "query",
1656
+ description: "A fetch filter cannot be pushed down by the store driver and no @index covers it, so the kernel scans every row"
1657
+ },
1658
+ {
1659
+ code: "ORB_GEN_INVALID_VALUE",
1660
+ category: "generic",
1661
+ description: "A value is invalid for the position it is written in"
1662
+ },
1663
+ {
1664
+ code: "ORB_GUARD_ON_FRAME_FIELD_AUTHORIZES",
1665
+ category: "guard",
1666
+ description: "A guard reads an intrinsic frame field of an entity to authorize, but intrinsic fields are not trustworthy for access"
1667
+ },
1668
+ {
1669
+ code: "ORB_GUEST_VIEW_NOT_CLIENT",
1670
+ category: "trait",
1671
+ description: "A trait that does not run on the client paints a guest-view, so the kernel cannot route a click inside the guest"
1672
+ },
1673
+ {
1674
+ code: "ORB_HOST_EFFECT_ARITY",
1675
+ category: "effect",
1676
+ description: "A host effect is called with the wrong number of arguments"
1677
+ },
1678
+ {
1679
+ code: "ORB_HOST_EFFECT_OPTION_UNKNOWN",
1680
+ category: "host_effect",
1681
+ description: "A host effect is given an option outside the set of options it accepts"
1682
+ },
1683
+ {
1684
+ code: "ORB_HTTP_EGRESS_ENTRY_INVALID",
1685
+ category: "http",
1686
+ description: "An egress allowlist entry is not of the form scheme://host[:port]"
1687
+ },
1688
+ {
1689
+ code: "ORB_HTTP_EGRESS_UNDECLARED",
1690
+ category: "http",
1691
+ description: "An outbound request targets an origin that is not declared in the program egress list"
1692
+ },
1693
+ {
1694
+ code: "ORB_HTTP_ORIGIN_NOT_STATIC",
1695
+ category: "http",
1696
+ description: "An http origin is not a string literal or a url-typed config knob, so egress cannot be checked"
1697
+ },
1698
+ {
1699
+ code: "ORB_ID_AUTHORED_WITHOUT_LEDGER",
1700
+ category: "id",
1701
+ description: "An id is authored in source without a matching ledger entry, so it is replaced on load"
1702
+ },
1703
+ {
1704
+ code: "ORB_ID_DUPLICATE_EVENT_ID",
1705
+ category: "id",
1706
+ description: "An event id is declared by more than one trait, but ids must be document-unique"
1707
+ },
1708
+ {
1709
+ code: "ORB_ID_KIND_MISMATCH",
1710
+ category: "id",
1711
+ description: "An id of one kind is used in a position that requires an id of a different kind"
1712
+ },
1713
+ {
1714
+ code: "ORB_ID_LEDGER_ORPHAN",
1715
+ category: "id",
1716
+ description: "An id ledger row is carried by no node in the schema and is stale"
1717
+ },
1718
+ {
1719
+ code: "ORB_ID_NAME_MISMATCH",
1720
+ category: "id",
1721
+ description: "A name in the source disagrees with the current name the ledger records for the same id"
1722
+ },
1723
+ {
1724
+ code: "ORB_ID_UNKNOWN_REF",
1725
+ category: "id",
1726
+ description: "An id reference matches no arena node or ledger entry"
1727
+ },
1728
+ {
1729
+ code: "ORB_INBOUND_ANSWER_FOREIGN",
1730
+ category: "inbound",
1731
+ description: "A trait other than an inbound handler emits the handler's answer event, so the answer never reaches the caller"
1732
+ },
1733
+ {
1734
+ code: "ORB_INBOUND_ANSWER_UNDECLARED",
1735
+ category: "inbound",
1736
+ description: "An inbound hook event answers with an event the trait does not declare in emits"
1737
+ },
1738
+ {
1739
+ code: "ORB_INBOUND_DUPLICATE",
1740
+ category: "inbound",
1741
+ description: "An inbound hook has more than one handler"
1742
+ },
1743
+ {
1744
+ code: "ORB_INBOUND_ENTRY_INVALID",
1745
+ category: "inbound",
1746
+ description: "An inbound entry is not a valid hook name"
1747
+ },
1748
+ {
1749
+ code: "ORB_INBOUND_UNDECLARED",
1750
+ category: "inbound",
1751
+ description: "An event handles an inbound hook that the program's inbound block does not declare"
1752
+ },
1753
+ {
1754
+ code: "ORB_INBOUND_VERIFY_INVALID",
1755
+ category: "inbound",
1756
+ description: "An inbound hook verifies a header against a credential, but the header is not a lower-case header name or the credential is not a credential name"
1757
+ },
1758
+ {
1759
+ code: "ORB_INDEX_PATH_DUPLICATE",
1760
+ category: "index",
1761
+ description: "The same index path, with the same ordering, is declared more than once on an entity"
1762
+ },
1763
+ {
1764
+ code: "ORB_INDEX_PATH_INVALID",
1765
+ category: "entity",
1766
+ description: "An index path names a field that the entity does not declare"
1767
+ },
1768
+ {
1769
+ code: "ORB_JSON_ROUNDTRIP",
1770
+ category: "lint",
1771
+ description: "json/parse re-parses what json/stringify just serialized; a stringify\u2192parse round trip launders a value's type past the checker (owner hard rule, CLAUDE.md). Narrow with `as`."
1772
+ },
1773
+ {
1774
+ code: "ORB_LINT_FINDING_CODE_UNDECLARED",
1775
+ category: "lint",
1776
+ description: "A lint rule names a finding code that its declared codes record does not carry."
1777
+ },
1778
+ {
1779
+ code: "ORB_LINT_INDEX_MISSING",
1780
+ category: "lint",
1781
+ description: "The lint input arrived without a shared program fact the rule reads (the structural index, sites, units, embeds or entities), so the rule cannot check the program"
1782
+ },
1783
+ {
1784
+ code: "ORB_LINT_INPUT_UNREAD",
1785
+ category: "lint",
1786
+ description: "A lint input file could not be read or lowered, so the lint rules did not run"
1787
+ },
1788
+ {
1789
+ code: "ORB_LINT_LANGUAGE_FACTS_UNREAD",
1790
+ category: "lint",
1791
+ description: "The installed language facts could not be read, so the lint rule could not check what it needs"
1792
+ },
1793
+ {
1794
+ code: "ORB_LINT_OPERATOR_SHAPES_UNREAD",
1795
+ category: "lint",
1796
+ description: "The installed operator table could not be read or does not match the operator shape type, so a lint cannot run"
1797
+ },
1798
+ {
1799
+ code: "ORB_LINT_RULE_COUNT_MISMATCH",
1800
+ category: "lint",
1801
+ description: "A lint engine's rules or programOnlyRules names differ from the rule names its routed rule traits answer LINT_FOUND with"
1802
+ },
1803
+ {
1804
+ code: "ORB_LINT_RULE_FAILED",
1805
+ category: "lint",
1806
+ description: "A lint rule met an input its own preconditions exclude and could not check it"
1807
+ },
1808
+ {
1809
+ code: "ORB_LINT_SERVICE_REGISTRY_UNREAD",
1810
+ category: "lint",
1811
+ description: "The installed services registry could not be read, so call-service services cannot be checked"
1812
+ },
1813
+ {
1814
+ code: "ORB_LINT_UI_VOCAB_UNREAD",
1815
+ category: "lint",
1816
+ description: "The installed @almadar/core declares no readable UI vocabulary, so a UI lint check cannot run"
1817
+ },
1818
+ {
1819
+ code: "ORB_LISTEN_REDUNDANT_EMBED_ROUTE",
1820
+ category: "listen",
1821
+ description: "A listens route is redundant because the embedded trait already receives that event"
1822
+ },
1823
+ {
1824
+ code: "ORB_LISTEN_ROUTE_STARVES_REQUIRED_FIELD",
1825
+ category: "trait_event",
1826
+ description: "A listens route requires a payload field that the source event contract never produces"
1827
+ },
1828
+ {
1829
+ code: "ORB_LISTEN_WILDCARD_UNKEYED",
1830
+ category: "trait_event",
1831
+ description: "A wildcard listens route hears every caller's event but its guard never reads the call key in the payload"
1832
+ },
1833
+ {
1834
+ code: "ORB_MEM_ALIAS",
1835
+ category: "mem",
1836
+ description: "An exclusive borrow of a block while another borrow of it is live, or a borrow while an exclusive one is live"
1837
+ },
1838
+ {
1839
+ code: "ORB_MEM_DOUBLE_FREE",
1840
+ category: "mem",
1841
+ description: "A handle is freed, dropped or released a second time on some path"
1842
+ },
1843
+ {
1844
+ code: "ORB_MEM_LEAK",
1845
+ category: "mem",
1846
+ description: "An arena reaches a resting state on some path without being dropped"
1847
+ },
1848
+ {
1849
+ code: "ORB_MEM_USE_AFTER_FREE",
1850
+ category: "mem",
1851
+ description: "A mem/ call takes a handle after it was freed, dropped or released on some path"
1852
+ },
1853
+ {
1854
+ code: "ORB_NAV_TARGET_UNDECLARED",
1855
+ category: "page",
1856
+ description: "A navigation target stated as a literal path (a navigate effect, a navItems or link href, a navigatesTo) names no page the finished program declares"
1857
+ },
1858
+ {
1859
+ code: "ORB_OAUTH_CLIENT_INVALID",
1860
+ category: "oauth",
1861
+ description: "An OAuth client block uses a key that is not a valid OAuth client key"
1862
+ },
1863
+ {
1864
+ code: "ORB_OAUTH_OPTION_UNKNOWN",
1865
+ category: "oauth",
1866
+ description: "An oauth-authorize call passes an option that is not recognized"
1867
+ },
1868
+ {
1869
+ code: "ORB_OAUTH_PROVIDER_UNKNOWN",
1870
+ category: "oauth",
1871
+ description: "The OAuth clients map is keyed by something other than a known provider tag"
1872
+ },
1873
+ {
1874
+ code: "ORB_ON_DEVICE_EFFECT_ON_SERVER",
1875
+ category: "browser",
1876
+ description: "An on-device model effect runs in a background tick on the server, which has no on-device model"
1877
+ },
1878
+ {
1879
+ code: "ORB_ON_DEVICE_SCHEMA_INVALID",
1880
+ category: "browser",
1881
+ description: "A browser prompt response schema is not valid JSON Schema text describing a JSON object"
1882
+ },
1883
+ {
1884
+ code: "ORB_OP_INVALID_TIME_UNIT",
1885
+ category: "operator",
1886
+ description: "A time operator is given a unit that is not an accepted time unit"
1887
+ },
1888
+ {
1889
+ code: "ORB_OS_EGRESS_SCHEME_UNUSED",
1890
+ category: "os",
1891
+ description: "An egress entry whose scheme (redis, rediss, postgres, postgresql) no operator or fetch uses since the TCP protocol-target grants were retired; its net-grant replacement is named"
1892
+ },
1893
+ {
1894
+ code: "ORB_OS_GRANT_ENTRY_INVALID",
1895
+ category: "os",
1896
+ description: "A declared grant entry that can match nothing"
1897
+ },
1898
+ {
1899
+ code: "ORB_OS_GRANT_MISSING",
1900
+ category: "os",
1901
+ description: "An os/ call that the grants of its orbital (app level plus its own) do not cover"
1902
+ },
1903
+ {
1904
+ code: "ORB_OS_GRANT_UNUSED",
1905
+ category: "os",
1906
+ description: "A granted entry that no os/ call of the orbital (or of the program, at app level) uses; a warning"
1907
+ },
1908
+ {
1909
+ code: "ORB_OS_TARGET_NOT_STATIC",
1910
+ category: "os",
1911
+ description: "An os/ call target that is computed, so its grant cannot be checked at build time"
1912
+ },
1913
+ {
1914
+ code: "ORB_O_CONFIG_DEAD_KNOB",
1915
+ category: "orbital",
1916
+ description: "A declared app-level config knob is not forwarded by any trait config default, so it has no effect"
1917
+ },
1918
+ {
1919
+ code: "ORB_O_CONFIG_UNKNOWN_KEY",
1920
+ category: "orbital_ref",
1921
+ description: "A call-site config key matches no config knob declared by the upstream orbital"
1922
+ },
1923
+ {
1924
+ code: "ORB_O_DUPLICATE_NAME",
1925
+ category: "orbital",
1926
+ description: "Two or more orbitals in a program share the same name"
1927
+ },
1928
+ {
1929
+ code: "ORB_O_DUPLICATE_USE_ALIAS",
1930
+ category: "orbital",
1931
+ description: "Two uses imports share the same alias"
1932
+ },
1933
+ {
1934
+ code: "ORB_O_ENTITY_EXPECT_AMBIGUOUS",
1935
+ category: "orbital_ref",
1936
+ description: "An entity an imported orbital expects of a sibling is provided by several sibling imports and no entities entry binds it"
1937
+ },
1938
+ {
1939
+ code: "ORB_O_ENTITY_PERSISTENCE_LOCKED",
1940
+ category: "orbital",
1941
+ description: "An entity persistence or collection override on an orbital reference has no effect because the primary entity locks it"
1942
+ },
1943
+ {
1944
+ code: "ORB_O_ENTITY_TARGET_UNKNOWN",
1945
+ category: "orbital_ref",
1946
+ description: "An entities value names no entity the consumer schema declares"
1947
+ },
1948
+ {
1949
+ code: "ORB_O_ENTITY_UNKNOWN_KEY",
1950
+ category: "orbital_ref",
1951
+ description: "An entities key names no entity in the upstream out-of-orbital closure"
1952
+ },
1953
+ {
1954
+ code: "ORB_O_ENTITY_UNMAPPED",
1955
+ category: "orbital_ref",
1956
+ description: "A kept trait, relation or page references an out-of-orbital entity that entities {} never maps"
1957
+ },
1958
+ {
1959
+ code: "ORB_O_EXTEND_FIELD_COLLISION",
1960
+ category: "orbital_ref",
1961
+ description: "An extend field collides with a field already declared on the upstream primary entity"
1962
+ },
1963
+ {
1964
+ code: "ORB_O_EXTEND_FIELD_UNREAD",
1965
+ category: "orbital",
1966
+ description: "A field added by an extend block is never read, set, rendered or forwarded by a config knob"
1967
+ },
1968
+ {
1969
+ code: "ORB_O_FIELD_RENAME_UNAPPLIED",
1970
+ category: "orbital_ref",
1971
+ description: "A fields rename left the pre-rename field name in a config default position the rewrite does not reach"
1972
+ },
1973
+ {
1974
+ code: "ORB_O_MOCK_UNKNOWN_FIELD",
1975
+ category: "orbital",
1976
+ description: "A mock block names a field the entity materialized from the referenced orbital does not declare"
1977
+ },
1978
+ {
1979
+ code: "ORB_O_OMIT_EMBEDDED_TRAIT",
1980
+ category: "orbital",
1981
+ description: "An orbital reference omits a trait that another kept trait embeds"
1982
+ },
1983
+ {
1984
+ code: "ORB_O_PAGE_UNKNOWN_PATH",
1985
+ category: "orbital_ref",
1986
+ description: "A pages or mounts key names a page path that the upstream orbital does not declare"
1987
+ },
1988
+ {
1989
+ code: "ORB_O_RETYPE_FIELD_CONFLICT",
1990
+ category: "orbital",
1991
+ description: "A field is both retyped and added by extend in the same orbital reference"
1992
+ },
1993
+ {
1994
+ code: "ORB_O_RETYPE_UNKNOWN_FIELD",
1995
+ category: "orbital",
1996
+ description: "A retype block names a field the entity materialized from the referenced orbital does not declare"
1997
+ },
1998
+ {
1999
+ code: "ORB_O_ROLE_TARGET_NOT_MEMBER",
2000
+ category: "orbital_ref",
2001
+ description: "A roles target is not a member of the consumer roster field vocabulary"
2002
+ },
2003
+ {
2004
+ code: "ORB_O_ROLE_UNKNOWN_UPSTREAM",
2005
+ category: "orbital_ref",
2006
+ description: "A roles key names no value in any upstream identity field vocabulary"
2007
+ },
2008
+ {
2009
+ code: "ORB_O_TRAITS_OMITTED_TRAIT",
2010
+ category: "orbital",
2011
+ description: "A traits override names a trait that omit or only drops from the imported orbital"
2012
+ },
2013
+ {
2014
+ code: "ORB_O_TRAITS_UNKNOWN_TRAIT",
2015
+ category: "orbital_ref",
2016
+ description: "A traits key names a trait that the upstream orbital does not have"
2017
+ },
2018
+ {
2019
+ code: "ORB_PAGE_AMBIGUOUS_CONTENT_OWNER",
2020
+ category: "page",
2021
+ description: "Several traits each render a content body into the main slot and none composes the others, so the page has no single content owner"
2022
+ },
2023
+ {
2024
+ code: "ORB_PAGE_CONTROL_OUTSIDE_SHELL",
2025
+ category: "page",
2026
+ description: "A trait paints a control into the main slot of a page whose shell shows another trait as its content, and nothing there embeds it"
2027
+ },
2028
+ {
2029
+ code: "ORB_PAGE_FACTS_FIELD_INVALID",
2030
+ category: "page",
2031
+ description: "A browser/page-facts effect declares no facts"
2032
+ },
2033
+ {
2034
+ code: "ORB_PAGE_NOT_FOUND_DUPLICATE",
2035
+ category: "page",
2036
+ description: "A program declares more than one [notFound] page."
2037
+ },
2038
+ {
2039
+ code: "ORB_PAGE_NOT_FOUND_MISSING",
2040
+ category: "page",
2041
+ description: "A program with route pages declares no [notFound] page."
2042
+ },
2043
+ {
2044
+ code: "ORB_PAGE_SECOND_CONTENT_BODY",
2045
+ category: "page",
2046
+ description: "More than one trait on a page renders a content body into the main slot"
2047
+ },
2048
+ {
2049
+ code: "ORB_PAGE_UNREACHABLE",
2050
+ category: "page",
2051
+ description: "A page is declared but appears in no link, navItems entry or navigate effect"
2052
+ },
2053
+ {
2054
+ code: "ORB_PERSIST_BATCH_BAD_OP",
2055
+ category: "persist",
2056
+ description: "A persist batch contains an operation that is not valid in a batch"
2057
+ },
2058
+ {
2059
+ code: "ORB_PERSIST_BATCH_MIXED_PLACEMENT",
2060
+ category: "persist",
2061
+ description: "A persist batch writes both browser-stored and server-stored entities in one effect, which no single executor can hold"
2062
+ },
2063
+ {
2064
+ code: "ORB_PERSIST_BATCH_OPS_NOT_ARRAY",
2065
+ category: "persist",
2066
+ description: "A persist batch operations expression is missing or not array-typed"
2067
+ },
2068
+ {
2069
+ code: "ORB_PERSIST_CREATE_LITERAL_ID",
2070
+ category: "persist",
2071
+ description: "A persist create names a literal id, so a second run fails with a duplicate id"
2072
+ },
2073
+ {
2074
+ code: "ORB_PERSIST_CREATE_MISSING_POLICY_FIELD",
2075
+ category: "persist",
2076
+ description: "A persist create data literal omits a field its entity's create access policy compares, so the row can never satisfy the policy"
2077
+ },
2078
+ {
2079
+ code: "ORB_PERSIST_ID_NOT_A_PATH",
2080
+ category: "persist",
2081
+ description: "A persist effect names its row id with an expression instead of a binding path or literal id, so no row key resolves"
2082
+ },
2083
+ {
2084
+ code: "ORB_PERSIST_WHERE_NOT_A_PREDICATE",
2085
+ category: "persist",
2086
+ description: "A persist where clause is not a valid row predicate"
2087
+ },
2088
+ {
2089
+ code: "ORB_PLACEMENT_ORBITAL_DUPLICATE",
2090
+ category: "placement",
2091
+ description: "An orbital is placed more than once in the deployment"
2092
+ },
2093
+ {
2094
+ code: "ORB_PLACEMENT_ORBITAL_UNKNOWN",
2095
+ category: "placement",
2096
+ description: "A deployment unit lists an orbital name that is not an orbital of the program"
2097
+ },
2098
+ {
2099
+ code: "ORB_PLACEMENT_ORBITAL_UNPLACED",
2100
+ category: "placement",
2101
+ description: "A deployment is declared but an orbital belongs to none of its units"
2102
+ },
2103
+ {
2104
+ code: "ORB_PLACEMENT_UNIT_EMPTY",
2105
+ category: "placement",
2106
+ description: "A deployment unit lists no orbital"
2107
+ },
2108
+ {
2109
+ code: "ORB_P_AUTH_NO_SIGN_IN",
2110
+ category: "page",
2111
+ description: "A page requires authenticated access but the app declares no signIn route"
2112
+ },
2113
+ {
2114
+ code: "ORB_P_DUPLICATE_PATH",
2115
+ category: "page",
2116
+ description: "Two pages declare the same path after normalization"
2117
+ },
2118
+ {
2119
+ code: "ORB_P_EMPTY_TRAITS",
2120
+ category: "page",
2121
+ description: "A page declares an empty traits array"
2122
+ },
2123
+ {
2124
+ code: "ORB_P_HOST_RESERVED_ROUTE",
2125
+ category: "page",
2126
+ description: "A page is declared on the host's reserved sign-in route"
2127
+ },
2128
+ {
2129
+ code: "ORB_P_INDEX_PARAM_ROUTE",
2130
+ category: "page",
2131
+ description: "A parameter-route page is marked indexing index although its concrete URLs are not declared"
2132
+ },
2133
+ {
2134
+ code: "ORB_P_INDEX_REQUIRES_PUBLIC",
2135
+ category: "page",
2136
+ description: "A page declares indexing: index but lacks the public access it requires"
2137
+ },
2138
+ {
2139
+ code: "ORB_P_INVALID_PATH",
2140
+ category: "page",
2141
+ description: "A page or navigate path does not start with a slash"
2142
+ },
2143
+ {
2144
+ code: "ORB_P_INVALID_TRAIT_REF",
2145
+ category: "page",
2146
+ description: "A page's inline trait reference has no name"
2147
+ },
2148
+ {
2149
+ code: "ORB_P_INVALID_VIEW_TYPE",
2150
+ category: "page",
2151
+ description: "A page declares a view type that is not a valid view type"
2152
+ },
2153
+ {
2154
+ code: "ORB_P_MISSING_NAME",
2155
+ category: "page",
2156
+ description: "A page does not declare a name"
2157
+ },
2158
+ {
2159
+ code: "ORB_P_MISSING_PATH",
2160
+ category: "page",
2161
+ description: "A page is missing its required path"
2162
+ },
2163
+ {
2164
+ code: "ORB_P_MISSING_TRAITS",
2165
+ category: "page",
2166
+ description: "A page has no traits array for trait-driven UI"
2167
+ },
2168
+ {
2169
+ code: "ORB_P_SIGN_IN_UNKNOWN_ROUTE",
2170
+ category: "page",
2171
+ description: "The app's signIn route names a path that is no page of the app"
2172
+ },
2173
+ {
2174
+ code: "ORB_P_TRANSLATION_DUPLICATE_LOCALE",
2175
+ category: "page",
2176
+ description: "A translation group holds more than one page in the same locale"
2177
+ },
2178
+ {
2179
+ code: "ORB_RANDOM_BYTES_COUNT",
2180
+ category: "random",
2181
+ description: "A random-bytes count argument is outside the allowed integer range"
2182
+ },
2183
+ {
2184
+ code: "ORB_RENDER_ACTION_LIFECYCLE_EVENT",
2185
+ category: "render_ui",
2186
+ description: "A rendered pattern prop targets a lifecycle event that the bus never delivers"
2187
+ },
2188
+ {
2189
+ code: "ORB_RENDER_GROUPBY_ENUM_COLUMN_GAP",
2190
+ category: "render_ui",
2191
+ description: "A groupBy column set omits enum values of the field, so rows with those values match no column and disappear"
2192
+ },
2193
+ {
2194
+ code: "ORB_RENDER_ORBITAL_VALUE_EMBEDDED",
2195
+ category: "render_ui",
2196
+ description: "A render-ui embeds an orbital value, but only trait values can be rendered"
2197
+ },
2198
+ {
2199
+ code: "ORB_RENDER_UNBOUND_TRAIT_KNOB_EMBEDDED",
2200
+ category: "render_ui",
2201
+ description: "A render-ui embeds a trait-typed value that may be unbound without a guard, so it renders nothing"
2202
+ },
2203
+ {
2204
+ code: "ORB_RUI_CHILD_NOT_DRAWABLE",
2205
+ category: "render_ui",
2206
+ description: "A non-drawable child is composed under a canvas draw-host, which paints only neutral drawable descriptors"
2207
+ },
2208
+ {
2209
+ code: "ORB_RUI_ELEMENT_SHAPE_MISMATCH",
2210
+ category: "render_ui",
2211
+ description: "An element of a pattern prop is missing a field required by the pattern's element shape"
2212
+ },
2213
+ {
2214
+ code: "ORB_RUI_FORM_FIELD_INTRINSIC",
2215
+ category: "render_ui",
2216
+ description: "A form pattern offers an input for an intrinsic entity field, which is never persisted so the input is discarded"
2217
+ },
2218
+ {
2219
+ code: "ORB_RUI_INVALID_FIELD_PATH",
2220
+ category: "render_ui",
2221
+ description: "A nested field path references an invalid relation or field"
2222
+ },
2223
+ {
2224
+ code: "ORB_RUI_INVALID_ITEM_ACTION",
2225
+ category: "render_ui",
2226
+ description: "An itemAction configuration on a rendered pattern is invalid"
2227
+ },
2228
+ {
2229
+ code: "ORB_RUI_INVALID_PATTERN",
2230
+ category: "render_ui",
2231
+ description: "A render-ui pattern type is not in the pattern registry"
2232
+ },
2233
+ {
2234
+ code: "ORB_RUI_INVALID_PROP",
2235
+ category: "render_ui",
2236
+ description: "A render-ui pattern is given a prop that the pattern does not define"
2237
+ },
2238
+ {
2239
+ code: "ORB_RUI_INVALID_SLOT",
2240
+ category: "render_ui",
2241
+ description: "A render-ui effect targets an invalid slot"
2242
+ },
2243
+ {
2244
+ code: "ORB_RUI_MISSING_ACTION",
2245
+ category: "render_ui",
2246
+ description: "A render-ui pattern that needs an interaction target has no action, onClick, event or href"
2247
+ },
2248
+ {
2249
+ code: "ORB_RUI_MISSING_PATTERN_TYPE",
2250
+ category: "render_ui",
2251
+ description: "A render-ui pattern has no type property"
2252
+ },
2253
+ {
2254
+ code: "ORB_RUI_MISSING_REQUIRED_PROP",
2255
+ category: "render_ui",
2256
+ description: "A render-ui pattern is missing a prop that the pattern requires"
2257
+ },
2258
+ {
2259
+ code: "ORB_RUI_PROP_TYPE_MISMATCH",
2260
+ category: "render_ui",
2261
+ description: "A render-ui pattern prop has a value that is not one of its allowed values"
2262
+ },
2263
+ {
2264
+ code: "ORB_RUI_RENDERABLE_IN_GENERIC_FIELD",
2265
+ category: "render_ui",
2266
+ description: "A render-ui pattern literal is passed to a field not typed node, hiding renderable content from render-ui checks"
2267
+ },
2268
+ {
2269
+ code: "ORB_SET_COLUMN_WITHOUT_ROW",
2270
+ category: "entity_mutation",
2271
+ description: "A set writes an entity column with no row in scope and no persist create or update that could land it"
2272
+ },
2273
+ {
2274
+ code: "ORB_SHARED_ENTITY_FIELD_CONFLICT",
2275
+ category: "entity_mutation",
2276
+ description: "A field of a shared entity is written by more than one trait"
2277
+ },
2278
+ {
2279
+ code: "ORB_SHARED_ENTITY_RENDER_AUTHORITY",
2280
+ category: "entity_mutation",
2281
+ description: "A shared entity is render-ui-read by more than one trait, but only one render authority is allowed per entity and slot"
2282
+ },
2283
+ {
2284
+ code: "ORB_SLOT_CONTENTION",
2285
+ category: "slot",
2286
+ description: "Multiple traits on a page render into the same slot"
2287
+ },
2288
+ {
2289
+ code: "ORB_SLOT_CONTENTION_RUNTIME",
2290
+ category: "slot",
2291
+ description: "Several traits render to the same slot in the same state, so they contend for it"
2292
+ },
2293
+ {
2294
+ code: "ORB_SLOT_CONTENTION_TICK",
2295
+ category: "slot",
2296
+ description: "Several traits on a page render into the same slot from ticks, so their output contends"
2297
+ },
2298
+ {
2299
+ code: "ORB_SLOT_INVALID_NESTING",
2300
+ category: "slot",
2301
+ description: "A slot is nested in an invalid way"
2302
+ },
2303
+ {
2304
+ code: "ORB_SLOT_MAIN_NOT_COVERED",
2305
+ category: "slot",
2306
+ description: "No trait on a page renders anything into the main slot"
2307
+ },
2308
+ {
2309
+ code: "ORB_STORE_DRIVER_CONTRACT",
2310
+ category: "store",
2311
+ description: "A store driver has no trait handling one or more verbs required by the row-store driver contract"
2312
+ },
2313
+ {
2314
+ code: "ORB_STORE_DRIVER_NOT_CONDITIONAL",
2315
+ category: "store",
2316
+ description: "A conditional persist op is bound to a store driver that cannot execute conditional writes"
2317
+ },
2318
+ {
2319
+ code: "ORB_STORE_ON_NON_PERSISTENT",
2320
+ category: "store",
2321
+ description: "An entity binds a store but its rows live in no store"
2322
+ },
2323
+ {
2324
+ code: "ORB_STORE_UNKNOWN_ORBITAL",
2325
+ category: "store",
2326
+ description: "A store binding names an orbital that is not part of the program"
2327
+ },
2328
+ {
2329
+ code: "ORB_STORE_VERB_OUTSIDE_SEAM",
2330
+ category: "store",
2331
+ description: "A trait emits a row-store verb directly, but a store driver may be asked only by the store seam"
2332
+ },
2333
+ {
2334
+ code: "ORB_S_ACCESS_POLICY_INVALID_BINDING",
2335
+ category: "schema",
2336
+ description: "An access directive uses a binding other than the ones legal there"
2337
+ },
2338
+ {
2339
+ code: "ORB_S_ACCESS_POLICY_REQUIRES_IDENTITY",
2340
+ category: "schema",
2341
+ description: "An access directive reads @user but the program declares no identity entity"
2342
+ },
2343
+ {
2344
+ code: "ORB_S_ACCESS_POLICY_UNKNOWN_ENTITY_FIELD",
2345
+ category: "schema",
2346
+ description: "An access policy references a name that is not a field of its entity, so it resolves to null and denies everyone"
2347
+ },
2348
+ {
2349
+ code: "ORB_S_COLLECTION_POLICY_CONFLICT",
2350
+ category: "schema",
2351
+ description: "Entities bound to the same collection declare different access directives"
2352
+ },
2353
+ {
2354
+ code: "ORB_S_EMPTY_VERSION",
2355
+ category: "schema",
2356
+ description: "The schema version is empty"
2357
+ },
2358
+ {
2359
+ code: "ORB_S_EXPECTATION_FIELD_UNDECLARED",
2360
+ category: "schema",
2361
+ description: "An effect persists a field that the orbital's expects entity shape does not declare"
2362
+ },
2363
+ {
2364
+ code: "ORB_S_EXPECTATION_PROVIDER_MISMATCH",
2365
+ category: "schema",
2366
+ description: "An expectation requires a field to be marked as a key but the providing entity declares it without that mark"
2367
+ },
2368
+ {
2369
+ code: "ORB_S_EXPECTATION_UNSATISFIED",
2370
+ category: "schema",
2371
+ description: "An orbital expects an entity, trait, event, or config default that nothing in the program provides"
2372
+ },
2373
+ {
2374
+ code: "ORB_S_EXPECTED_FIELD_NOT_PROVIDED",
2375
+ category: "schema",
2376
+ description: "A rebound entity does not provide a field that the trait expects it to have"
2377
+ },
2378
+ {
2379
+ code: "ORB_S_EXPECTED_FIELD_TYPE_MISMATCH",
2380
+ category: "schema",
2381
+ description: "The provider has the expected field or knob but with an incompatible type"
2382
+ },
2383
+ {
2384
+ code: "ORB_S_IDENTITY_NOT_UNIQUE",
2385
+ category: "schema",
2386
+ description: "More than one entity is tagged identity, making every @user field reference ambiguous"
2387
+ },
2388
+ {
2389
+ code: "ORB_S_INVARIANT_UNPROVED",
2390
+ category: "spec",
2391
+ description: "A spec proposition the prover cannot decide, so the program is not shown to keep it"
2392
+ },
2393
+ {
2394
+ code: "ORB_S_INVARIANT_VIOLATED",
2395
+ category: "spec",
2396
+ description: "A spec proposition (invariant, holds, ensures) is broken by a write, with a counterexample the evaluator confirms"
2397
+ },
2398
+ {
2399
+ code: "ORB_S_MISSING_NAME",
2400
+ category: "schema",
2401
+ description: "The schema does not declare a name"
2402
+ },
2403
+ {
2404
+ code: "ORB_S_NO_ORBITALS",
2405
+ category: "schema",
2406
+ description: "The schema declares no orbitals"
2407
+ },
2408
+ {
2409
+ code: "ORB_S_OWNER_FIELD_NOT_IDENTITY_TYPED",
2410
+ category: "schema",
2411
+ description: "An access directive compares a field to @user.id but the field is not a relation to the identity entity"
2412
+ },
2413
+ {
2414
+ code: "ORB_S_ROLE_LITERAL_NOT_MEMBER",
2415
+ category: "schema",
2416
+ description: "A literal compared against an @user field with a closed vocabulary is not a member of that vocabulary, so the branch can never be taken"
2417
+ },
2418
+ {
2419
+ code: "ORB_S_SHARED_WITHOUT_PERSISTENCE_MODE",
2420
+ category: "schema",
2421
+ description: "A shared entity declares no persistence mode, and none may be inferred"
2422
+ },
2423
+ {
2424
+ code: "ORB_S_UNKNOWN_IDENTITY_FIELD",
2425
+ category: "schema",
2426
+ description: "A read of a field of the signed-in user names a field the declared identity entity does not have"
2427
+ },
2428
+ {
2429
+ code: "ORB_TAB_EFFECT_ON_SERVER",
2430
+ category: "tab",
2431
+ description: "A browser tab effect is used in a transition that runs on the server, which holds no tabs"
2432
+ },
2433
+ {
2434
+ code: "ORB_TAB_REQUEST_INVALID",
2435
+ category: "browser",
2436
+ description: "A browser/tab request is not an object of the operation's closed keys or has refused literal values"
2437
+ },
2438
+ {
2439
+ code: "ORB_THEME_PIN_CONTRADICTS_APP",
2440
+ category: "theme",
2441
+ description: "An orbital pins a theme that differs from the theme the app declares at app level"
2442
+ },
2443
+ {
2444
+ code: "ORB_THEME_UNDECLARED",
2445
+ category: "theme",
2446
+ description: "A frame is shown in a literal theme that the program does not declare, so no stylesheet ships for it"
2447
+ },
2448
+ {
2449
+ code: "ORB_TICK_ASYNC_EFFECT",
2450
+ category: "tick",
2451
+ description: "A tick calls a server-async operator, which ticks cannot run"
2452
+ },
2453
+ {
2454
+ code: "ORB_TICK_REQUIRES_RUNTIME",
2455
+ category: "trait",
2456
+ description: "A non-cron tick mutates a persistent entity, which should usually be runtime"
2457
+ },
2458
+ {
2459
+ code: "ORB_T_CLIENT_TICK_NOT_LOCAL",
2460
+ category: "trait",
2461
+ description: "A trait writes a frame entity ticked on the client but declares no dispatch mode, so a server step overwrites the live frame"
2462
+ },
2463
+ {
2464
+ code: "ORB_T_CLIENT_TICK_SERVER_EFFECT",
2465
+ category: "trait",
2466
+ description: "A tick that runs in the browser has effects that reach the server, and nothing replays a tick there"
2467
+ },
2468
+ {
2469
+ code: "ORB_T_CONFIG_MISSING_REQUIRED_KEY",
2470
+ category: "trait",
2471
+ description: "A trait reference does not supply a config knob that the referenced trait declares as required"
2472
+ },
2473
+ {
2474
+ code: "ORB_T_CONFIG_OBJECT_ARRAY_FORBIDDEN",
2475
+ category: "trait",
2476
+ description: "A config field uses a banned bare object or array type instead of a named struct alias"
2477
+ },
2478
+ {
2479
+ code: "ORB_T_CONFIG_TIER_INVALID",
2480
+ category: "trait",
2481
+ description: "A config field declares a tier value outside domain, policy, infra, presentation and internal"
2482
+ },
2483
+ {
2484
+ code: "ORB_T_CONFIG_UNKNOWN_CALL_SITE_KEY",
2485
+ category: "trait",
2486
+ description: "A call-site config key matches no config knob declared on the referenced trait"
2487
+ },
2488
+ {
2489
+ code: "ORB_T_DUPLICATE_NAME",
2490
+ category: "trait",
2491
+ description: "The same trait name is defined in more than one orbital"
2492
+ },
2493
+ {
2494
+ code: "ORB_T_DUPLICATE_STATE",
2495
+ category: "trait",
2496
+ description: "A trait declares the same state name more than once"
2497
+ },
2498
+ {
2499
+ code: "ORB_T_DUPLICATE_TRANSITION",
2500
+ category: "trait",
2501
+ description: "Two transitions share the same source state and event without guards"
2502
+ },
2503
+ {
2504
+ code: "ORB_T_EMPTY_EVENT_NAME",
2505
+ category: "trait",
2506
+ description: "An event name is empty"
2507
+ },
2508
+ {
2509
+ code: "ORB_T_ENDPOINT_TRAIT_RENDERS",
2510
+ category: "trait",
2511
+ description: "A trait mounted only on protocol endpoints renders UI, which endpoints cannot show"
2512
+ },
2513
+ {
2514
+ code: "ORB_T_ENTITY_NAME_SHADOWS_TRAIT_UNION",
2515
+ category: "trait",
2516
+ description: "An entity name collides with a trait's generated state union type"
2517
+ },
2518
+ {
2519
+ code: "ORB_T_ENTITY_NOT_REBINDABLE",
2520
+ category: "trait",
2521
+ description: "A trait is bound to an entity it cannot be rebound to"
2522
+ },
2523
+ {
2524
+ code: "ORB_T_EVENT_RENAME_UNKNOWN_KEY",
2525
+ category: "trait",
2526
+ description: "An events rename key names no event declared by the referenced trait"
2527
+ },
2528
+ {
2529
+ code: "ORB_T_EVT_EXTERNAL_MISSING_PAYLOAD",
2530
+ category: "trait",
2531
+ description: "An external event does not declare a typed payload"
2532
+ },
2533
+ {
2534
+ code: "ORB_T_EVT_INVALID_NAME",
2535
+ category: "trait",
2536
+ description: "An event name is not a valid UPPER_SNAKE_CASE identifier"
2537
+ },
2538
+ {
2539
+ code: "ORB_T_EVT_UNDECLARED",
2540
+ category: "trait",
2541
+ description: "An event is emitted but not declared in the trait's emits array"
2542
+ },
2543
+ {
2544
+ code: "ORB_T_EXTERNAL_INPUT_NOT_RESTING",
2545
+ category: "trait",
2546
+ description: "An external input is not accepted from the trait's initial state"
2547
+ },
2548
+ {
2549
+ code: "ORB_T_GENERIC_TYPE_DEPRECATED",
2550
+ category: "trait",
2551
+ description: "A declaration uses a generic type such as bare json, object without properties, or any, which the language no longer allows"
2552
+ },
2553
+ {
2554
+ code: "ORB_T_INIT_MISSING_FETCH",
2555
+ category: "trait",
2556
+ description: "No trait fetches a persistent entity on INIT, so interaction traits read data nothing loads"
2557
+ },
2558
+ {
2559
+ code: "ORB_T_INVALID_EVENT_DEFAULT",
2560
+ category: "trait",
2561
+ description: "A config field typed event holds a value that is not a valid event name or member of the trait's event set"
2562
+ },
2563
+ {
2564
+ code: "ORB_T_INVALID_FORMAT",
2565
+ category: "trait",
2566
+ description: "A trait reference has neither a ref nor a name property"
2567
+ },
2568
+ {
2569
+ code: "ORB_T_INVALID_PATTERN_DEFAULT",
2570
+ category: "trait",
2571
+ description: "A pattern-typed config knob has a default that is not a known pattern type"
2572
+ },
2573
+ {
2574
+ code: "ORB_T_INVALID_SLOT_DEFAULT",
2575
+ category: "trait",
2576
+ description: "A slot-typed config field has a default that is not a valid slot"
2577
+ },
2578
+ {
2579
+ code: "ORB_T_INVALID_TRANSITION",
2580
+ category: "trait",
2581
+ description: "A transition references a source or target state that does not exist"
2582
+ },
2583
+ {
2584
+ code: "ORB_T_LOCAL_ON_NON_SHARED_PERSISTENT",
2585
+ category: "trait",
2586
+ description: "A client-dispatch trait is linked to an entity that is neither shared nor client-resident, hiding server-gated writes behind optimism"
2587
+ },
2588
+ {
2589
+ code: "ORB_T_LOCAL_TRAIT_TOUCHES_SERVER",
2590
+ category: "trait",
2591
+ description: "A client trait transition guards on or touches server-only state"
2592
+ },
2593
+ {
2594
+ code: "ORB_T_MISSING_INIT_TRANSITION",
2595
+ category: "trait",
2596
+ description: "A route trait has no INIT transition on its initial state"
2597
+ },
2598
+ {
2599
+ code: "ORB_T_MULTIPLE_INITIAL_STATES",
2600
+ category: "trait",
2601
+ description: "A trait state machine declares more than one initial state"
2602
+ },
2603
+ {
2604
+ code: "ORB_T_NO_INITIAL_STATE",
2605
+ category: "trait",
2606
+ description: "A state machine declares no states and so has no initial state"
2607
+ },
2608
+ {
2609
+ code: "ORB_T_REBIND_MISSING_FIELDS",
2610
+ category: "trait",
2611
+ description: "A trait is rebound to an entity that lacks fields the trait requires"
2612
+ },
2613
+ {
2614
+ code: "ORB_T_REBIND_TARGET_UNRESOLVED",
2615
+ category: "trait",
2616
+ description: "A trait rebind target cannot be resolved"
2617
+ },
2618
+ {
2619
+ code: "ORB_T_SECRET_DEFAULT_NOT_STRING",
2620
+ category: "trait",
2621
+ description: "A config field typed secret does not default to a string credential reference"
2622
+ },
2623
+ {
2624
+ code: "ORB_T_STATE_UNREACHABLE",
2625
+ category: "trait",
2626
+ description: "A state is unreachable from the initial state through any transition path"
2627
+ },
2628
+ {
2629
+ code: "ORB_T_TRAIT_ON_ROUTE_AND_ENDPOINT",
2630
+ category: "trait",
2631
+ description: "A trait is mounted on both a route page and a protocol endpoint"
2632
+ },
2633
+ {
2634
+ code: "ORB_T_TRAIT_UNMOUNTED",
2635
+ category: "trait",
2636
+ description: "A trait owns a state machine but is listed on no page and reached by no embed"
2637
+ },
2638
+ {
2639
+ code: "ORB_T_UNDEFINED_EVENT",
2640
+ category: "trait",
2641
+ description: "A transition uses an event that is not defined in the trait's events array"
2642
+ },
2643
+ {
2644
+ code: "ORB_T_UNDEFINED_TRAIT",
2645
+ category: "trait",
2646
+ description: "A trait reference does not give a trait name"
2647
+ },
2648
+ {
2649
+ code: "ORB_T_UNRESOLVED_TYPE_PARAM",
2650
+ category: "trait",
2651
+ description: "A declaration uses a type variable that no trait parameter binds"
2652
+ },
2653
+ {
2654
+ code: "ORB_UI_ICON_EMPTY",
2655
+ category: "icon",
2656
+ description: "An icon name is empty"
2657
+ },
2658
+ {
2659
+ code: "ORB_UI_ICON_INVALID_FORMAT",
2660
+ category: "icon",
2661
+ description: "An icon name has an invalid format"
2662
+ },
2663
+ {
2664
+ code: "ORB_UI_ICON_NOT_FOUND",
2665
+ category: "icon",
2666
+ description: "An icon name does not exist in the icon set"
2667
+ },
2668
+ {
2669
+ code: "ORB_U_CONFIG_UNKNOWN_KEY",
2670
+ category: "uses",
2671
+ description: "A uses config override names a knob the imported behavior app-level config never declared"
2672
+ },
2673
+ {
2674
+ code: "ORB_W_LOOP_INVARIANT_PARSE",
2675
+ category: "lint",
2676
+ description: "A parse inside a lambda re-parses the same value for every element and should be bound once outside"
2677
+ },
2678
+ {
2679
+ code: "ORB_X_CIRCULAR_DEPENDENCY",
2680
+ category: "cross",
2681
+ description: "Traits form a circular event dependency"
2682
+ },
2683
+ {
2684
+ code: "ORB_X_CROSS_EMITTER_DECLARED_PAYLOAD_MISMATCH",
2685
+ category: "cross",
2686
+ description: "An event declared by several emitters has conflicting payload fields across them"
2687
+ },
2688
+ {
2689
+ code: "ORB_X_DUPLICATE_ENTITY",
2690
+ category: "cross",
2691
+ description: "The same entity name is defined in more than one orbital"
2692
+ },
2693
+ {
2694
+ code: "ORB_X_DUPLICATE_TRAIT_ID",
2695
+ category: "cross",
2696
+ description: "Two or more traits carry the same trait id, so listens match each other's emits"
2697
+ },
2698
+ {
2699
+ code: "ORB_X_ENUM_VALUE_NOT_MEMBER",
2700
+ category: "cross",
2701
+ description: "A set effect assigns a string literal that is not a declared member of the target field's enum"
2702
+ },
2703
+ {
2704
+ code: "ORB_X_FILTER_FIELD_NEVER_WRITTEN",
2705
+ category: "cross",
2706
+ description: "A fetch filters on a field that no persist create or update of that entity supplies, so it always returns empty"
2707
+ },
2708
+ {
2709
+ code: "ORB_X_LISTEN_PER_ENTITY",
2710
+ category: "trait_event",
2711
+ description: "A trait that listens per a key does not link a [runtime] entity declaring an id : string field"
2712
+ },
2713
+ {
2714
+ code: "ORB_X_LISTEN_PER_ROUTED_PAGE",
2715
+ category: "trait_event",
2716
+ description: "A trait that listens per a key is placed on a route page"
2717
+ },
2718
+ {
2719
+ code: "ORB_X_LISTEN_SOURCE_NEVER_PRODUCES",
2720
+ category: "cross",
2721
+ description: "A listens route names a source whose emits contract never produces the listened event"
2722
+ },
2723
+ {
2724
+ code: "ORB_X_LISTEN_SOURCE_UNRESOLVED",
2725
+ category: "cross",
2726
+ description: "A listen entry references a source trait event that the source does not declare"
2727
+ },
2728
+ {
2729
+ code: "ORB_X_LISTEN_TRIGGER_UNMATCHED",
2730
+ category: "cross",
2731
+ description: "A listens entry triggers an event that no transition in the same trait reacts to"
2732
+ },
2733
+ {
2734
+ code: "ORB_X_LLM_WIRE_UNROUTED",
2735
+ category: "cross",
2736
+ description: "A composed std-llm trait can emit a wire event that no trait in the program listens to"
2737
+ },
2738
+ {
2739
+ code: "ORB_X_MISSING_ORBITAL_NAME",
2740
+ category: "cross",
2741
+ description: "An orbital does not declare a name"
2742
+ },
2743
+ {
2744
+ code: "ORB_X_ORPHAN_LISTENER",
2745
+ category: "cross",
2746
+ description: "A trait listens for an event that no trait emits"
2747
+ },
2748
+ {
2749
+ code: "ORB_X_PARALLEL_LAMBDA_IMPURE",
2750
+ category: "parallel",
2751
+ description: "The lambda of array/pmap or array/preduce is not a literal fn or is not provably pure"
2752
+ },
2753
+ {
2754
+ code: "ORB_X_PAYLOAD_FIELD_NAME",
2755
+ category: "cross",
2756
+ description: "A payload field name is not a valid TypeScript identifier"
2757
+ },
2758
+ {
2759
+ code: "ORB_X_PAYLOAD_MISMATCH",
2760
+ category: "cross",
2761
+ description: "An external emit is missing a payload field required by the event's declaration"
2762
+ },
2763
+ {
2764
+ code: "ORB_X_RENDER_UI_EVENT_LITERAL_STALE",
2765
+ category: "cross",
2766
+ description: "A render-ui prop references an event literal that no longer matches a declared event"
2767
+ },
2768
+ {
2769
+ code: "ORB_X_ROW_LITERAL_FIELD_TYPE_MISMATCH",
2770
+ category: "effect",
2771
+ description: "A record literal written into an entity carries a value whose type the declared field does not admit."
2772
+ },
2773
+ {
2774
+ code: "ORB_X_ROW_LITERAL_MISSING_REQUIRED",
2775
+ category: "effect",
2776
+ description: "A `persist create` data literal omits a column the entity requires (no default, not framework-stamped)."
2777
+ },
2778
+ {
2779
+ code: "ORB_X_ROW_LITERAL_UNKNOWN_FIELD",
2780
+ category: "effect",
2781
+ description: "A record literal written into an entity (a `persist` data literal, or a `set` into a relation field) names a key the entity does not declare."
2782
+ },
2783
+ {
2784
+ code: "ORB_X_UNKNOWN_THEME",
2785
+ category: "cross",
2786
+ description: "A theme reference is neither a built-in theme key nor an orbital-declared inline theme"
2787
+ },
2788
+ {
2789
+ code: "ORB_X_UNRESOLVED_RELATION_TARGET",
2790
+ category: "cross",
2791
+ description: "A relation field points at an entity that is not declared in the schema"
2792
+ },
2793
+ {
2794
+ code: "ORB_X_UNTYPED_ARRAY",
2795
+ category: "cross",
2796
+ description: "An array field declares no element type"
2797
+ },
2798
+ {
2799
+ code: "ORB_X_UNUSED_EMISSION",
2800
+ category: "cross",
2801
+ description: "A trait emits an event that no trait listens for"
2802
+ },
2803
+ {
2804
+ code: "SEXPR_INVALID_BINDING",
2805
+ category: "sexpr",
2806
+ description: "An s-expression contains an invalid binding"
2807
+ },
2808
+ {
2809
+ code: "SEXPR_INVALID_OPERATOR",
2810
+ category: "sexpr",
2811
+ description: "An S-expression uses an operator that is not in the operator registry"
2812
+ },
2813
+ {
2814
+ code: "SEXPR_UNKNOWN_ENTITY",
2815
+ category: "sexpr",
2816
+ description: "An entity named in a binding may not exist in the program"
2817
+ },
2818
+ {
2819
+ code: "inbound-hook-duplicate",
2820
+ category: "lint",
2821
+ description: "Two cli hooks declare the same inbound name"
2822
+ },
2823
+ {
2824
+ code: "shared-type-drift",
2825
+ category: "lint",
2826
+ description: "A type shared between behaviors has drifted from its canonical declaration"
2827
+ },
2828
+ {
2829
+ code: "unread",
2830
+ category: "lint",
2831
+ description: "The file the rule reads could not be read or listed"
2832
+ }
2833
+ ];
2834
+
2835
+ // src/types/validation.ts
2836
+ var validationCodes = validation_codes_default;
2837
+ var ORBITAL_PATH_PREFIX = /^orbitals\[(\d+)(?: \([^\]]*\))?\]/;
2838
+ function orbitalIndexOfValidationPath(path) {
2839
+ if (Array.isArray(path)) {
2840
+ if (path[0] === "orbitals") return typeof path[1] === "number" ? path[1] : null;
2841
+ return typeof path[0] === "string" ? orbitalIndexOfValidationPath(path[0]) : null;
2842
+ }
2843
+ const m = typeof path === "string" ? ORBITAL_PATH_PREFIX.exec(path) : null;
2844
+ return m ? Number(m[1]) : null;
2845
+ }
2846
+ var KNOWN_VALIDATION_ERROR_CODES = Object.fromEntries(
2847
+ validationCodes.map((entry) => [entry.code, entry.code])
2848
+ );
2849
+ function isKnownValidationErrorCode(code) {
2850
+ return code in KNOWN_VALIDATION_ERROR_CODES;
2851
+ }
2852
+
2853
+ // src/types/living.ts
2854
+ function widenTier(tier) {
2855
+ return tier;
2856
+ }
2857
+ var ARIA_LIVE = ["off", "polite", "assertive"];
2858
+ var ARIA_CURRENT = ["page", "step", "location", "date", "time", "true", "false"];
2859
+ var ARIA_PRESSED = ["true", "false", "mixed"];
2860
+ var TEXT_DIRECTIONS = ["ltr", "rtl", "auto"];
2861
+ var TAB_INDEX_VALUES = [-1, 0];
2862
+ var ARIA_ROLES = [
2863
+ "alert",
2864
+ "alertdialog",
2865
+ "application",
2866
+ "article",
2867
+ "banner",
2868
+ "blockquote",
2869
+ "button",
2870
+ "caption",
2871
+ "cell",
2872
+ "checkbox",
2873
+ "code",
2874
+ "columnheader",
2875
+ "combobox",
2876
+ "complementary",
2877
+ "contentinfo",
2878
+ "definition",
2879
+ "deletion",
2880
+ "dialog",
2881
+ "document",
2882
+ "emphasis",
2883
+ "feed",
2884
+ "figure",
2885
+ "form",
2886
+ "generic",
2887
+ "grid",
2888
+ "gridcell",
2889
+ "group",
2890
+ "heading",
2891
+ "img",
2892
+ "insertion",
2893
+ "link",
2894
+ "list",
2895
+ "listbox",
2896
+ "listitem",
2897
+ "log",
2898
+ "main",
2899
+ "marquee",
2900
+ "math",
2901
+ "menu",
2902
+ "menubar",
2903
+ "menuitem",
2904
+ "menuitemcheckbox",
2905
+ "menuitemradio",
2906
+ "meter",
2907
+ "navigation",
2908
+ "none",
2909
+ "note",
2910
+ "option",
2911
+ "paragraph",
2912
+ "presentation",
2913
+ "progressbar",
2914
+ "radio",
2915
+ "radiogroup",
2916
+ "region",
2917
+ "row",
2918
+ "rowgroup",
2919
+ "rowheader",
2920
+ "scrollbar",
2921
+ "search",
2922
+ "searchbox",
2923
+ "separator",
2924
+ "slider",
2925
+ "spinbutton",
2926
+ "status",
2927
+ "strong",
2928
+ "subscript",
2929
+ "superscript",
2930
+ "switch",
2931
+ "tab",
2932
+ "table",
2933
+ "tablist",
2934
+ "tabpanel",
2935
+ "term",
2936
+ "textbox",
2937
+ "time",
2938
+ "timer",
2939
+ "toolbar",
2940
+ "tooltip",
2941
+ "tree",
2942
+ "treegrid",
2943
+ "treeitem"
2944
+ ];
2945
+ var AriaRoleSchema = z.enum(ARIA_ROLES);
2946
+ var ARIA_ROLE_SET = new Set(ARIA_ROLES);
2947
+ function isAriaRole(value) {
2948
+ return ARIA_ROLE_SET.has(value);
2949
+ }
2950
+ var A11Y_ATTRIBUTES = {
2951
+ "aria-label": { types: ["string"], description: "Accessible name read by screen readers when the visible text is missing or not descriptive (e.g. an icon-only control)." },
2952
+ "aria-labelledby": { types: ["string"], description: "Id of the element whose text names this one." },
2953
+ "aria-describedby": { types: ["string"], description: "Id of the element whose text describes this one (help text, error)." },
2954
+ "aria-live": { types: ["string"], enumValues: ARIA_LIVE, description: "Announce changes to this region: polite waits for a pause, assertive interrupts." },
2955
+ "aria-current": { types: ["string"], enumValues: ARIA_CURRENT, description: "Marks the current item in a set: the current page, step, location, date or time." },
2956
+ "aria-pressed": { types: ["string"], enumValues: ARIA_PRESSED, description: "Toggle-button state." },
2957
+ "aria-expanded": { types: ["boolean"], description: "Whether the element it controls is expanded." },
2958
+ "aria-selected": { types: ["boolean"], description: "Whether this item is selected (tabs, options, grid cells)." },
2959
+ "aria-hidden": { types: ["boolean"], description: "Hide from assistive technology (decorative content only)." },
2960
+ "aria-busy": { types: ["boolean"], description: "This region is updating; assistive technology waits before announcing it." },
2961
+ role: { types: ["string"], enumValues: ARIA_ROLES, description: "WAI-ARIA role when the element's native semantics don't describe it." },
2962
+ lang: { types: ["string"], description: "Language of this element's content (BCP 47, e.g. ar, sl, en)." },
2963
+ dir: { types: ["string"], enumValues: TEXT_DIRECTIONS, description: "Text direction of this element's content." },
2964
+ tabIndex: { types: ["number"], numericEnumValues: TAB_INDEX_VALUES, description: "0 puts the element in the Tab order; -1 makes it focusable only programmatically." }
2965
+ };
2966
+ var ACCESSIBLE_NAME_ATTRIBUTES = ["aria-label", "aria-labelledby"];
2967
+
2968
+ // src/types/surface.ts
2969
+ var SURFACE_MODES = ["auto", "none"];
2970
+ var DIAGRAM_TONES = [
2971
+ "ink",
2972
+ "label",
2973
+ "guide",
2974
+ "axis",
2975
+ "grid",
2976
+ "highlight",
2977
+ "fill",
2978
+ "series-1",
2979
+ "series-2",
2980
+ "series-3",
2981
+ "series-4",
2982
+ "series-5",
2983
+ "series-6",
2984
+ "series-7",
2985
+ "series-8",
2986
+ "primary",
2987
+ "accent",
2988
+ "success",
2989
+ "warning",
2990
+ "error",
2991
+ "info",
2992
+ "muted"
2993
+ ];
2994
+ var DiagramToneSchema = z.enum(DIAGRAM_TONES);
2995
+ var DIAGRAM_TONE_COLOR_KEYS = {
2996
+ ink: "diagram-ink",
2997
+ label: "diagram-label",
2998
+ guide: "diagram-guide",
2999
+ axis: "diagram-axis",
3000
+ grid: "diagram-grid",
3001
+ highlight: "diagram-highlight",
3002
+ fill: "diagram-fill",
3003
+ "series-1": "series-1",
3004
+ "series-2": "series-2",
3005
+ "series-3": "series-3",
3006
+ "series-4": "series-4",
3007
+ "series-5": "series-5",
3008
+ "series-6": "series-6",
3009
+ "series-7": "series-7",
3010
+ "series-8": "series-8",
3011
+ primary: "primary",
3012
+ accent: "accent",
3013
+ success: "success",
3014
+ warning: "warning",
3015
+ error: "error",
3016
+ info: "info",
3017
+ muted: "muted-foreground"
3018
+ };
3019
+ var DIAGRAM_STROKE_WEIGHTS = ["thin", "normal", "bold"];
3020
+ var DiagramStrokeWeightSchema = z.enum(DIAGRAM_STROKE_WEIGHTS);
3021
+ var DIAGRAM_TEXT_SIZES = ["xs", "sm", "base", "lg", "xl", "2xl"];
3022
+ var DiagramTextSizeSchema = z.enum(DIAGRAM_TEXT_SIZES);
3023
+ var DIAGRAM_TEXT_CASES = ["theme", "verbatim"];
3024
+ var DiagramTextCaseSchema = z.enum(DIAGRAM_TEXT_CASES);
3025
+ var EVAL_TIERS = ["none", "organism", "subset", "compose", "substrate", "free"];
3026
+ function validPattern(p) {
3027
+ try {
3028
+ new RegExp(p.pattern, p.flags);
3029
+ return true;
3030
+ } catch {
3031
+ return false;
3032
+ }
3033
+ }
3034
+ var EvalPatternSchema = z.object({ pattern: z.string(), flags: z.string().optional() }).strict().refine(validPattern, { message: "pattern is not a valid regular expression" });
3035
+ var EvalPredicateSchema = z.discriminatedUnion("kind", [
3036
+ z.object({ kind: z.literal("entity") }).strict(),
3037
+ z.object({ kind: z.literal("field"), required: z.boolean().optional() }).strict(),
3038
+ z.object({ kind: z.literal("enumValue"), value: EvalPatternSchema }).strict(),
3039
+ z.object({ kind: z.literal("roleGated") }).strict(),
3040
+ z.object({ kind: z.literal("ownerScoped"), by: EvalPatternSchema.optional() }).strict(),
3041
+ z.object({ kind: z.literal("feeds"), with: EvalPatternSchema }).strict(),
3042
+ z.object({ kind: z.literal("notifies") }).strict(),
3043
+ z.object({ kind: z.literal("input") }).strict(),
3044
+ z.object({ kind: z.literal("agent") }).strict(),
3045
+ z.object({ kind: z.literal("route"), path: z.string() }).strict(),
3046
+ z.object({ kind: z.literal("rendered"), route: z.string().optional(), on: EvalPatternSchema.optional() }).strict(),
3047
+ z.object({ kind: z.literal("absentText"), words: z.array(z.string()) }).strict(),
3048
+ z.object({ kind: z.literal("absentEntity") }).strict(),
3049
+ z.object({ kind: z.literal("orbital"), absent: z.boolean().optional() }).strict(),
3050
+ z.object({ kind: z.literal("knob"), key: z.string().min(1), value: JsonValueSchema }).strict()
3051
+ ]);
3052
+ var EvalCheckSchema = z.object({
3053
+ id: z.string().min(1),
3054
+ introducedTurn: z.number().int().min(0),
3055
+ nouns: EvalPatternSchema,
3056
+ require: z.array(EvalPredicateSchema),
3057
+ frameRoutes: z.array(z.string()).optional(),
3058
+ coversDeclines: z.array(z.string()).optional()
3059
+ }).strict();
3060
+ var EvalSpecSchema = z.object({
3061
+ id: z.string().min(1),
3062
+ class: z.enum(["plain", "specific", "complex"]),
3063
+ description: z.string().optional(),
3064
+ turns: z.tuple([z.string()]).rest(z.string()),
3065
+ checks: z.array(EvalCheckSchema),
3066
+ expect: z.object({
3067
+ tiers: z.array(z.enum(EVAL_TIERS)).optional(),
3068
+ adopts: z.array(z.string()).optional(),
3069
+ orbitals: z.array(z.string()).optional(),
3070
+ validates: z.boolean().optional()
3071
+ }).strict().optional(),
3072
+ forbidSources: z.array(z.string()).optional()
3073
+ }).strict().superRefine((spec, ctx) => {
3074
+ for (const [i, check] of spec.checks.entries()) {
3075
+ if (check.introducedTurn >= spec.turns.length) {
3076
+ ctx.addIssue({ code: "custom", path: ["checks", i, "introducedTurn"], message: `introducedTurn ${check.introducedTurn} is past the spec's ${spec.turns.length} turns` });
3077
+ }
3078
+ }
3079
+ });
3080
+ function parseEvalSpec(input) {
3081
+ const parsed = EvalSpecSchema.safeParse(input);
3082
+ if (parsed.success) return parsed.data;
3083
+ throw new Error(`invalid eval spec: ${parsed.error.issues.map((i) => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ")}`);
3084
+ }
3085
+ function evalPatternMatches(p, text) {
3086
+ return new RegExp(p.pattern, p.flags).test(text);
3087
+ }
3088
+
3089
+ // src/types/tab-port.ts
3090
+ var TabHostFailure = class extends Error {
3091
+ constructor(kind, message) {
3092
+ super(message);
3093
+ this.kind = kind;
3094
+ this.name = "TabHostFailure";
3095
+ }
3096
+ };
3097
+ var ClientThemeSchema = z.object({
3098
+ name: z.string().min(1),
3099
+ displayName: z.string(),
3100
+ hasLightMode: z.boolean(),
3101
+ hasDarkMode: z.boolean()
3102
+ }).strict();
3103
+ var ClientManifestSchema = z.object({
3104
+ locale: z.string().min(1),
3105
+ direction: z.enum(["ltr", "rtl"]),
3106
+ themes: z.array(ClientThemeSchema),
3107
+ defaultTheme: z.string().min(1).nullable(),
3108
+ defaultMode: z.enum(["light", "dark"])
3109
+ }).strict();
3110
+ function parseClientManifest(value) {
3111
+ return ClientManifestSchema.parse(value);
3112
+ }
3113
+ var PayloadSlotSchema = z.object({
3114
+ name: z.string(),
3115
+ type: z.string(),
3116
+ required: z.boolean(),
3117
+ values: z.array(z.string()).optional(),
3118
+ entity: z.string().optional()
3119
+ });
3120
+ var MachineRowSchema = z.object({
3121
+ orbital: z.string(),
3122
+ trait: z.string(),
3123
+ from: z.string(),
3124
+ event: z.string(),
3125
+ to: z.string(),
3126
+ guarded: z.boolean(),
3127
+ payload: z.array(PayloadSlotSchema)
3128
+ });
3129
+ var EvalPathSchema = z.array(z.union([z.number(), z.string()]));
3130
+ var EvalStepWireSchema = z.object({
3131
+ kind: z.enum(["enter", "exit", "iter", "skip"]),
3132
+ path: EvalPathSchema,
3133
+ value: JsonValueSchema.optional(),
3134
+ error: z.string().optional()
3135
+ });
3136
+ var PlayedEffectSchema = z.object({
3137
+ type: z.string(),
3138
+ args: z.array(JsonValueSchema),
3139
+ status: z.enum(["executed", "failed", "skipped"]),
3140
+ error: z.string().optional(),
3141
+ routed: z.boolean()
3142
+ });
3143
+ var PropositionBindingsSchema = z.object({
3144
+ entity: JsonValueSchema,
3145
+ fromEntity: JsonValueSchema,
3146
+ payload: JsonValueSchema
3147
+ });
3148
+ var PlayedEnsuresSchema = z.object({
3149
+ proposition: JsonValueSchema,
3150
+ verdict: z.enum(["held", "broken", "inconclusive"]),
3151
+ reason: z.string().optional(),
3152
+ counterexample: PropositionBindingsSchema.optional()
3153
+ });
3154
+ var PlayedEmitSchema = z.object({
3155
+ type: z.string(),
3156
+ payload: EventPayloadSchema.optional(),
3157
+ timestamp: z.number()
3158
+ });
3159
+ var PlayedGuardSchema = z.object({
3160
+ arm: z.number(),
3161
+ guard: JsonValueSchema,
3162
+ passed: z.boolean(),
3163
+ trace: z.array(EvalStepWireSchema),
3164
+ error: z.string().optional()
3165
+ });
3166
+ var EntityBindingSchema = z.object({
3167
+ kind: z.enum(["none", "absent", "malformed", "inline", "named", "payload-unresolved", "context-unresolved"]),
3168
+ entity: z.string(),
3169
+ rows: z.number(),
3170
+ readGated: z.boolean()
3171
+ });
3172
+ var TraitRefSchema = z.object({
3173
+ name: z.string(),
3174
+ resolved: z.boolean(),
3175
+ overlayOnly: z.boolean()
3176
+ });
3177
+ var RenderedNodeSchema = z.object({
3178
+ pattern: z.string(),
3179
+ dynamic: z.boolean(),
3180
+ supported: z.boolean(),
3181
+ stub: z.boolean(),
3182
+ binding: EntityBindingSchema,
3183
+ traitRefs: z.array(TraitRefSchema)
3184
+ });
3185
+ var RenderedSlotSchema = z.object({
3186
+ slot: z.string(),
3187
+ sourceTrait: z.string(),
3188
+ ownerEntity: z.string(),
3189
+ nodes: z.array(RenderedNodeSchema),
3190
+ props: JsonValueSchema.optional(),
3191
+ fault: z.object({ code: z.enum(["no-matching-transition", "guard-rejected", "no-dispatchable-traits", "not-an-external-input", "inbound-only-event", "effect-failed", "locale-not-declared", "client-circuit-state-refused", "repaint-failed"]), error: z.string() }).optional()
3192
+ });
3193
+ var PlayedStateSchema = z.object({ before: z.string().nullable(), after: z.string().nullable() });
3194
+ var PendingAskSchema = z.object({
3195
+ trait: z.string(),
3196
+ operator: z.string(),
3197
+ args: z.array(JsonValueSchema),
3198
+ key: z.string()
3199
+ });
3200
+ var PlayedOutcomeSchema = z.object({
3201
+ orbital: z.string(),
3202
+ trait: z.string(),
3203
+ event: z.string(),
3204
+ from: z.string(),
3205
+ to: z.string(),
3206
+ arm: z.number().optional(),
3207
+ fired: z.boolean(),
3208
+ effects: z.array(PlayedEffectSchema),
3209
+ emitted: z.array(PlayedEmitSchema)
3210
+ });
3211
+ var JsonRecordSchema = z.record(z.string(), JsonValueSchema);
3212
+ var PlayedResultSchema = z.object({
3213
+ trait: z.string(),
3214
+ event: z.string(),
3215
+ transitionFired: z.boolean(),
3216
+ guard: z.enum(["pass", "fail", "none"]),
3217
+ firedArm: z.number().optional(),
3218
+ state: PlayedStateSchema,
3219
+ effects: z.array(PlayedEffectSchema),
3220
+ emitted: z.array(PlayedEmitSchema),
3221
+ guards: z.array(PlayedGuardSchema),
3222
+ ensures: z.array(PlayedEnsuresSchema),
3223
+ rendered: z.array(RenderedSlotSchema).optional(),
3224
+ failure: z.string().optional(),
3225
+ entityAfter: EventPayloadSchema.nullable(),
3226
+ pendingAsks: z.array(PendingAskSchema),
3227
+ outcomes: z.array(PlayedOutcomeSchema)
3228
+ });
3229
+ var PlayedStepSchema = z.object({
3230
+ orbital: z.string(),
3231
+ trait: z.string(),
3232
+ from: z.string(),
3233
+ event: z.string(),
3234
+ payload: EventPayloadSchema,
3235
+ result: PlayedResultSchema,
3236
+ entity: JsonRecordSchema.optional(),
3237
+ config: JsonRecordSchema.optional(),
3238
+ now: z.number().optional(),
3239
+ settleMs: z.number().optional(),
3240
+ identity: z.object({ subject: z.string(), claims: JsonRecordSchema }).optional(),
3241
+ credentials: z.record(z.string(), z.string()).optional()
3242
+ });
3243
+ var ProgramSourceLocationSchema = z.object({
3244
+ path: z.string(),
3245
+ line: z.number().int().positive(),
3246
+ column: z.number().int().positive(),
3247
+ length: z.number().int().nonnegative(),
3248
+ endLine: z.number().int().positive(),
3249
+ endColumn: z.number().int().positive(),
3250
+ exact: z.boolean(),
3251
+ scopeEndLine: z.number().int().positive().optional(),
3252
+ scopeEndColumn: z.number().int().positive().optional(),
3253
+ scopeLength: z.number().int().nonnegative().optional()
3254
+ });
3255
+ var ProgramSourceAnchorSchema = ProgramSourceLocationSchema.extend({
3256
+ pointer: z.string(),
3257
+ orbitalId: z.string().nullable(),
3258
+ traitId: z.string().nullable(),
3259
+ originTraitId: z.string()
3260
+ });
3261
+ var ProgramInspectionSchema = z.object({
3262
+ program: OrbitalSchemaSchema,
3263
+ authoredProgram: OrbitalSchemaSchema,
3264
+ definitions: z.array(z.object({
3265
+ traitId: z.string(),
3266
+ definitionFingerprint: z.string(),
3267
+ sourceDeclaration: SourceDeclarationMetadataSchema.extend({ path: z.string().nullable() }).nullable(),
3268
+ sourceCandidates: z.array(z.string())
3269
+ })),
3270
+ composition: z.array(z.object({ traitId: z.string(), kind: z.enum(["trait-declaration", "orbital-reference"]), authoredPointer: z.string(), traitOverrideKey: z.string().nullable(), binding: JsonValueSchema, source: ProgramSourceLocationSchema.nullable() })),
3271
+ sourceMap: z.array(ProgramSourceAnchorSchema),
3272
+ imports: z.array(z.object({ path: z.string(), specifier: z.string(), program: z.string(), authoredProgram: OrbitalSchemaSchema })),
3273
+ lazy: z.array(JsonValueSchema),
3274
+ path: z.string(),
3275
+ version: z.number().int().nonnegative().nullable(),
3276
+ columnEncoding: z.literal("unicode-scalar"),
3277
+ lengthEncoding: z.literal("utf-8-bytes"),
3278
+ lineBase: z.literal(1),
3279
+ columnBase: z.literal(1)
3280
+ });
3281
+
3282
+ export { A11Y_ATTRIBUTES, ACCESSIBLE_NAME_ATTRIBUTES, ACTION_OVERFLOW_TESTID, ACTION_TESTID_PREFIX, ANONYMOUS_USER, ARIA_CURRENT, ARIA_LIVE, ARIA_PRESSED, ARIA_ROLES, AriaRoleSchema, BINDING_CONTEXT_RULES, BINDING_DOCS, BINDING_ROOTS, BindingSchema, CALL_KINDS, ClientManifestSchema, ClientThemeSchema, DIAGRAM_STROKE_WEIGHTS, DIAGRAM_TEXT_CASES, DIAGRAM_TEXT_SIZES, DIAGRAM_TONES, DIAGRAM_TONE_COLOR_KEYS, DiagramStrokeWeightSchema, DiagramTextCaseSchema, DiagramTextSizeSchema, DiagramToneSchema, DispatchVisits, EMPTY_STATE_MARKER, EVAL_TIERS, EvalSpecSchema, FORM_PATTERN, FULL_WRITE_CAPABILITIES, GESTURE_EVENT_PROPS, KNOWN_VALIDATION_ERROR_CODES, LOADING_STATE_MARKER, LOG_SEVERITIES, MachineRowSchema, NATIVE_ID_PREFIX, NATIVE_ID_SEPARATOR, PATTERN_PROP_TYPE_ERROR_TESTID, PatternTypeSchema, PayloadSlotSchema, PlayedStepSchema, ProgramInspectionSchema, ProgramSourceAnchorSchema, ProgramSourceLocationSchema, QueryCapabilitiesSchema, QueryDeclinedError, RENDER_BINDING_MARKER, ROW_SET_MARKER, RawUserClaimsSchema, RowCommitSchema, RowIdPageSchema, RowPredicateSchema, RowQueryPageSchema, RowQuerySchema, RowSetRefSchema, RowWriteBatchSchema, RowWriteOpSchema, RowWriteOutcomeSchema, SEMANTIC_CHANGE_KINDS, SURFACE_MODES, ServerBatchSummarySchema, ServerEffectResultSchema, TAB_INDEX_VALUES, TEXT_DIRECTIONS, TRAIT_MOUNT_ERROR_TESTID, TabHostFailure, TraitFieldRefSchema, VERIFICATION_DOM_ATTRS, ViewerSchema, WriteCapabilitiesSchema, WriteDeclinedError, actionTestId, actionTestIdMatches, containsEntityBinding, containsPayloadBinding, createLazyService, createTypedEventBus, dispatchVisitKey, evalPatternMatches, findPersonaInRoster, gestureActionTestId, gestureOfActionTestId, getBindingExamples, guardHolds, isAriaRole, isCallRecord, isKnownValidationErrorCode, isPlanSnapshot, isRenderBindingMarker, isRowSetMarker, isSessionHistoryEntry, isStructuredLogEntry, isTraitFieldRef, nativeFieldId, nativeIds, nativePatternId, nativeRowId, nativeSlotId, normalizeUserContext, orbitalIndexOfValidationPath, parseClientManifest, parseEvalSpec, parseFetchOrder, personaFromIdentityRow, resolvePersonaSpec, rowMatchesPredicate, rowSetMarker, runRowWrite, splitNativeIds, toBindingRoot, validateBindingInContext, widenTier };
3283
+ //# sourceMappingURL=chunk-GF7KCLNR.js.map
3284
+ //# sourceMappingURL=chunk-GF7KCLNR.js.map