@reventlessdev/reventless-spec 3.0.0-alpha.101 → 3.0.0-alpha.102

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 3.0.0-alpha.102 (2026-08-08)
7
+
8
+ ### Features
9
+
10
+ * **core,spec:** surface a write-side component's declared error types ([c9c2505](https://github.com/ReventlessDev/reventless-core/commit/c9c25057c70595fe27d73447c9aef9b451f86168))
11
+
12
+
6
13
  # 3.0.0-alpha.101 (2026-08-05)
7
14
 
8
15
  **Note:** Version bump only for package @reventlessdev/reventless-spec
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-spec",
3
- "version": "3.0.0-alpha.101",
3
+ "version": "3.0.0-alpha.102",
4
4
  "description": "Specifications for Reventless",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
@@ -288,6 +288,24 @@ type eventDef = {
288
288
  references: array<fieldReference>,
289
289
  }
290
290
 
291
+ /**
292
+ One declared error of a write side, with its field schema. Same shape and same
293
+ derivation as `eventDef` — a refusal is a variant of `Spec.errorSchema` exactly as
294
+ an emitted fact is a variant of `Spec.eventSchema`, so a consumer reading an
295
+ error's payload walks it with the code path it already uses for an event. `name`
296
+ is the variant name (e.g. `CategoryNotFound`) — the same string the runtime puts
297
+ on `errorCode` when a decision is rejected (see `CommandTopic_Helpers`), so a
298
+ caller can match what it reads here against what it receives. Payload-less
299
+ variants (the common case for errors) carry an empty `schema` object and no
300
+ references.
301
+ */
302
+ @schema
303
+ type errorDef = {
304
+ name: string,
305
+ schema: string,
306
+ references: array<fieldReference>,
307
+ }
308
+
291
309
  @schema
292
310
  type writableDef = {
293
311
  name: string,
@@ -300,6 +318,13 @@ type writableDef = {
300
318
  arrays; `[]` when there are none. The structure is re-derived on every build/
301
319
  deploy, so no persisted-data back-compat shim is needed. */
302
320
  events: array<eventDef>,
321
+ /** Declared-error field schemas — what this component can refuse a command with.
322
+ Required, on the same reasoning as `events`: a structure is re-derived on every
323
+ build and re-registered on every deploy, and the persisted copy is never decoded
324
+ through this schema (the event log carries it as an offload reference, and the
325
+ serving path reads it as raw JSON), so `[]` honestly means "declares no errors"
326
+ rather than "an older deploy could not say". */
327
+ errors: array<errorDef>,
303
328
  /** Chapter grouping band — see `queryableDef.chapter`. */
304
329
  chapter: @s.matches(stringOptionSchema) option<string>,
305
330
  }
@@ -127,6 +127,12 @@ let eventDefSchema = S.schema(s => ({
127
127
  references: s.m(S.array(fieldReferenceSchema))
128
128
  }));
129
129
 
130
+ let errorDefSchema = S.schema(s => ({
131
+ name: s.m(S.string),
132
+ schema: s.m(S.string),
133
+ references: s.m(S.array(fieldReferenceSchema))
134
+ }));
135
+
130
136
  let writableDefSchema = S.schema(s => ({
131
137
  name: s.m(S.string),
132
138
  commands: s.m(S.array(commandDefSchema)),
@@ -135,6 +141,7 @@ let writableDefSchema = S.schema(s => ({
135
141
  linkedViews: s.m(S.array(S.string)),
136
142
  consistencyRead: s.m(stringOptionSchema),
137
143
  events: s.m(S.array(eventDefSchema)),
144
+ errors: s.m(S.array(errorDefSchema)),
138
145
  chapter: s.m(stringOptionSchema)
139
146
  }));
140
147
 
@@ -248,6 +255,7 @@ export {
248
255
  commandDefSchema,
249
256
  queryableDefSchema,
250
257
  eventDefSchema,
258
+ errorDefSchema,
251
259
  writableDefSchema,
252
260
  automationSliceDefSchema,
253
261
  outboundTranslationSliceDefSchema,