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

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,20 @@
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.103 (2026-08-09)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **aws:** heal a persisted structure that predates a required list field ([dc4c42c](https://github.com/ReventlessDev/reventless-core/commit/dc4c42cab5a7db538d90edbce6d13b949830aad6))
11
+
12
+
13
+ # 3.0.0-alpha.102 (2026-08-08)
14
+
15
+ ### Features
16
+
17
+ * **core,spec:** surface a write-side component's declared error types ([c9c2505](https://github.com/ReventlessDev/reventless-core/commit/c9c25057c70595fe27d73447c9aef9b451f86168))
18
+
19
+
6
20
  # 3.0.0-alpha.101 (2026-08-05)
7
21
 
8
22
  **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.103",
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,
@@ -296,10 +314,24 @@ type writableDef = {
296
314
  consumedEventTypes: array<string>,
297
315
  linkedViews: array<string>,
298
316
  consistencyRead: @s.matches(stringOptionSchema) option<string>,
299
- /** Emitted-event field schemas (Phase 6.3). Required like the other write-side
300
- arrays; `[]` when there are none. The structure is re-derived on every build/
301
- deploy, so no persisted-data back-compat shim is needed. */
317
+ /** Emitted-event field schemas. Required like the other write-side arrays; `[]`
318
+ when there are none. */
302
319
  events: array<eventDef>,
320
+ /** Declared-error field schemas — what this component can refuse a command with.
321
+ Required, on the same reasoning as `events`: the persisted copy is never decoded
322
+ through this schema (the event log carries it as an offload reference, and the
323
+ serving path reads it as raw JSON), so `[]` honestly means "declares no errors"
324
+ rather than "an older deploy could not say".
325
+
326
+ Being required does NOT make it safe to add such a field without a read-path
327
+ shim. A structure is re-derived on every build, but it is only RE-REGISTERED
328
+ when a plugin re-runs the connect handshake — which a plugin whose version never
329
+ changes may not do for a long time. Until then the serving path reads a
330
+ persisted structure that has no key for the new field, and against a `[T!]!` SDL
331
+ field that null propagates to the root and answers the whole query with `data:
332
+ null`. Both admin resolvers therefore heal absent required lists to `[]` on
333
+ read; a new one has to be added to that list too. */
334
+ errors: array<errorDef>,
303
335
  /** Chapter grouping band — see `queryableDef.chapter`. */
304
336
  chapter: @s.matches(stringOptionSchema) option<string>,
305
337
  }
@@ -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,