The Manifest and Compatibility
A service's Manifest is its contract in one document: its contexts, aggregates, commands, events, state schemas, subscriptions, published streams and error codes. The routes, the OpenAPI document, the generated clients, wait plans and query admission are all derived from it. This page follows it from the compiler to the service, to its peers and to the compatibility check. One Contract: the Manifest explains why it exists.
From fragments to the service's Manifest
- The compiler writes each domain module's fragment,
META-INF/wow/manifest/<module>.json(What the Compiler Generates). - The Gradle plugin (
generateWowManifestFragment) completes the fragment with the JSON Schemas of its types, the query keywords and the state's fingerprint. A type's Jakarta Bean Validation constraints become its schema's validation keywords, so a client sees them before it sends:@Positiveis anexclusiveMinimumof 0,@NotBlankaminLengthof 1,@Sizethe length or item bounds,@Patternapatternand@Emailtheemailformat. Whether a field may be null, or is required, follows what Wow's JSON reads. A Kotlin property follows its type, its type arguments too (aList<Long?>'s elements may be null), and one of a platform type, inferred from a Java declaration (String!), may be null. A Java reference may be null whatever marks it, Jakarta's@NotNull, JSpecify's@NonNullor@NullMarked, or any other: Wow's JSON reads one that a body leaves out or gives asnullasnull, and writes it back so, and only Jackson's own marks,@JsonSetter(nulls = FAIL)andrequired = trueon a creator's parameter, refuse it, or a Bean Validation provider, where Jakarta's@NotNullmarks a command's field or getter. A value that is never null is a Java primitive, or a Kotlin property of a type that is not nullable: write one of those. A Java primitive is never null, and is required when the creator of the class being described takes it (a record's component, a@JsonCreatorparameter), since Wow's JSON refuses a body without it. A Java list's elements are described as never null, though one can be: the plugin reads no nullability of a Java type argument. The completed fragment replaces the compiler's in the module's resources. The task loads the module's compiled classes, so it runs on the module's Java toolchain (kotlin { jvmToolchain(25) }), not on the JVM that runs Gradle: Gradle may be older than the module. - At build time,
mergeWowManifestmerges the fragments of the service's runtime class path intobuild/wow/manifest.json. - At startup, the host merges the same fragments, adds the framework's error codes, and serves the result at
GET /wow/manifest: on the internal port to the cluster's services, and on the public port only withwow.http.manifest.enabled: true(off by default, as the Manifest lists every route, schema and error of the service), authenticated like every route there: a request with no caller is answered 401.
The snapshot queries read the state schema from the completed fragment: a state field can be filtered and sorted only once the plugin has completed it.
Completing a fragment, the plugin also holds each command and event class to what its writer writes, since the class is loaded there and Jackson can say both. A command's body is written again from its object on every hop it makes (a forward, the command topic, a peer's relay, a saga's or a timer's command, a schedule), with what its class reads; an event is stored as Wow's JSON writes it. A value a class reads and its writer leaves out would be lost there, silently when it may be null, and a required one would fail to read. So generating the Manifest fails, naming the payload, the property and where the class reads it: a constructor parameter no property holds, a Kotlin private val that is not write-only, a setter with no getter, a builder's property the built class has no getter for, or a @JsonAnySetter with no @JsonAnyGetter, in the class or in a value it holds. On an event a write-only property (@JsonProperty(access = WRITE_ONLY)) is one too, since Wow's JSON leaves it out of everything it writes; on a command the body a node writes holds it. Keep the value in a property the writer writes, or @JsonIgnore it with a default the class gives. A class read by a deserializer or a converter of its own, or through a delegating creator, is read whole and not looked into.
A type written by a custom serializer
The plugin learns a type's schema by asking Jackson how it writes the class. It cannot see inside a serializer of the class's own (@JsonSerialize(using = …)) or a @JsonValue, so it does not guess: generateWowManifestFragment stops and asks for the shape. It stops too for a class of any kind, an interface, an abstract class or an enum among them, that @JsonSerialize gives a serializer or a converter of its own, its own annotation or a supertype's, whatever the serializer writes.
Jackson does not write com.example.ledger.Ledger as an object (a custom serializer or @JsonValue), so its schema cannot be introspected: declare it in wow { schemaOverrides.put("com.example.ledger.Ledger", "<JSON Schema>") }.Declare the shape the serializer writes, as a JSON Schema, in the domain module's build.gradle.kts. Each class is named by its binary name, so a nested class is Outer$Inner. A state type and an event are declared alike:
wow {
// The state, which LedgerSerializer writes as {"owner": "…", "lines": [12, 30]}
schemaOverrides.put(
"com.example.ledger.Ledger",
"""{"type":"object","properties":{"owner":{"type":"string"},"lines":{"type":"array","items":{"type":"integer","format":"int64"}}},"required":["owner","lines"]}""",
)
// An event, which PostedSerializer writes as {"amount": 250}
schemaOverrides.put(
"com.example.ledger.Posted",
"""{"type":"object","properties":{"amount":{"type":"integer","format":"int64"}},"required":["amount"]}""",
)
}A property written by a serializer of its own, @JsonSerialize on the property with using, converter, contentUsing or contentConverter, or @JsonRawValue, stops the build the same way. The commonest case is a Long id written as a string, which the Manifest and the generated client would otherwise call a number:
Jackson writes com.example.ledger.Order#id with a serializer of its own (@JsonSerialize using, converter, contentUsing or contentConverter, or @JsonRawValue), so its schema cannot be introspected: declare it in wow { schemaOverrides.put("com.example.ledger.Order#id", "<JSON Schema>") }.wow {
// Order's id, written by @field:JsonSerialize(using = ToStringSerializer::class) as "1024"
schemaOverrides.put("com.example.ledger.Order#id", """{"type":"string"}""")
}A property holding a platform class that Wow's JSON writes as a string or a number stops the build too, unless the Manifest describes that class as written. Those it describes are the value classes a state, a command or an event commonly holds: Year as an integer, YearMonth, MonthDay, ZoneOffset, TimeZone, Locale, Currency and URL as strings, a ByteArray as its Base64 text, and a kotlin.time.Duration as its ISO-8601 text (PT1H30M) as a java.time.Duration is, beside the dates, times, durations, numbers and UUIDs. JSON Values lists each, with the text written for it and what its reader refuses. A Month is an enumeration written by its name, as every enumeration is. Any other such class is refused, held directly or in a collection, an Optional or a map's values: a Charset, a Path, an AtomicLong, and a value class over a kotlin.time.Duration, which the Kotlin module writes as the duration's internal number. Declare the property's schema, or hold the value as a String:
Wow's JSON does not write java.nio.charset.Charset, which com.example.ledger.Ledger#encoding holds, as an object, and it is no scalar Wow describes, so its schema would not be what is written: declare it in wow { schemaOverrides.put("com.example.ledger.Ledger#encoding", "<JSON Schema>") }, or hold it as a String.A value class over an unsigned number (UInt, ULong, UShort or UByte) stops the build whatever schema is declared for it: as a property, nullable or not, read or written, and as an element, a map's key or value, or a type argument of one, a supertype's included (List<Count>, Page<Count>, class Reserve : Paged<Count>). Wow's JSON writes it as its signed carrier (UInt.MAX_VALUE as -1), which any other reader reads as that number, and its nullable form does not read back. Hold the unsigned number itself, which Wow's JSON writes and reads as unsigned, or a value class over a Long or a String.
A Jackson tree needs no declaration. Wow's JSON writes it as the JSON it holds, so the Manifest describes a tools.jackson.databind ObjectNode as an object ({"type":"object"}), an ArrayNode as an array, and any other JsonNode as any value ({}), named by no class: the free shape a state, a command or an event holds content of no class in, such as a 9.x shape with no V10 type. A declared schema of one wins, as of any class. A Jackson 2 tree (com.fasterxml.jackson.databind.JsonNode) is refused, declared or not: Wow's JSON is Jackson 3's, which writes it as a bean of its getters ("nodeType", "object", …), not as the JSON it holds, so hold a Jackson 3 one.
An unwrapped member (@JsonUnwrapped) is described by its type's properties as the object's own, under the names Jackson writes, its prefix and suffix on each. One with a prefix or a suffix whose type unwraps a member of its own stops the build, in a state, an event, a command or a service route's response, naming the member and the one its type unwraps: Jackson writes the inner member's properties without the outer prefix or suffix and reads them with it, so such a value does not read back, and a response is not sent as its schema describes it. A route's request is read by the names its schema gives, so one of that shape is described as it is read. Put the prefix or suffix on the inner member alone, or hold the inner value as a property. A state's unwrapped properties are fields of its contract's <State>View and query constants of its contract, as the snapshot holds them, flat.
A polymorphic type, one Jackson writes with a type id (@JsonTypeInfo, on the type or, as Jackson finds it, on any of its supertypes), is described by the classes it writes a value as, each with its type id as Jackson writes it: the subtypes its @JsonSubTypes lists, or, for a sealed class or interface, Kotlin's or Java's, that lists none, its subclasses at any depth, an object among them, and with the type's arguments (a Result<Money> is an Ok<Money> or a Failed). A type whose classes the build cannot know stops it: an open or abstract class or an interface of a type id, its own or inherited, that lists no subtypes of its own, whose values Jackson writes by their own classes. A schema of the base alone would make a masked read drop every property of a subtype, and could not mask a @Sensitive one. So does a sealed type with a subclass that is neither final nor sealed, a type whose type id no schema can name (a use other than NAME or CLASS, or include = EXTERNAL_PROPERTY), whether or not it lists its subtypes, since Jackson writes a value through that id whatever ids its subtypes declare, and a property that declares a type id itself and lists no subtypes, which is described as its declared type alone. The stop names where the type is held and the three ways out: list its subtypes with @JsonSubTypes, make it a sealed class or interface, or declare its schema.
Polymorphic types no schema can describe: com.example.ledger.Ledger.payments[] (com.example.ledger.Payment): it declares a type id (@JsonTypeInfo) and lists no subtypes of its own, so Jackson writes the class of each value, which this build cannot know. Declare the classes a value is written as with @JsonSubTypes, make the type a sealed class or interface, or declare its schema in wow { schemaOverrides.put("<the class's binary name>", "<JSON Schema>") }.A @JsonFormat whose shape writes a value as another JSON type than its schema describes (an Instant or a Date as a number, a BigDecimal or a Long as a string, an enumeration as its index, a class as an array), or whose pattern writes a value in another text than Wow's JSON writes it (a LocalDate as 2026/01/02, a LocalDateTime as 2026-01-02 03:04:05), stops the build too, naming the property: the generator describes a value by its class, and the views, the clients and the queries read that schema. The format is the one Jackson applies: the property's over its class's, an interface's included. The build writes a value of the class in it and compares, so a shape or a pattern Jackson does not apply to the class (a boolean shape on a String, a pattern on a Double) passes, and so does a pattern that writes what Wow's JSON writes (yyyy-MM-dd'T'HH:mm:ssXXX on an OffsetDateTime). Remove the @JsonFormat, or declare the property's schema as it is written.
Each include style of the type id is described as Jackson writes it: PROPERTY and EXISTING_PROPERTY as a property of each subtype, WRAPPER_OBJECT as an object of one property, named by the type id, and WRAPPER_ARRAY as an array of the type id and the value (prefixItems), whose @Sensitive values are masked as any other. Wow masks a sensitive value by its query path, which names a property by a letter or _ followed by letters, digits, _ and -. So a state, an event or a command that holds a @Sensitive value under any other name stops the build, naming the payload and the path: a WRAPPER_OBJECT type id of a nested class, whose name Jackson writes with a $ (Shape$Pin), or of use = CLASS, with its dots, or a @JsonProperty name of other characters. Give the property such a name, give each subtype such a type id (@JsonTypeName), or write the type id as a property (include = PROPERTY). Without a sensitive value the property is left out of what a query may name, and answered as stored.
A key names a class by its binary name, or a property by the class that declares the accessor Jackson writes it by, #, and the property's name as that class declares it, whatever its JSON name. The stop prints the exact line. So an inherited property is named once, by the class that declares it, a property a class overrides by that class, and a property an interface's annotated getter declares by each class that implements it. A key's declared schema stands for the whole class, or the whole property as written on the wire, whenever the key is present: a property's list items and map values included. The generator adds to a declared property only what it adds to any property: null to the types of one that can be null, and the keywords of its query annotations. A property's key wins over its type's, and a key that names nothing in the module is ignored, so a convention plugin may share one wow { } block. A key serializer (keyUsing) needs no declaration: a JSON object's keys are strings, which the schema does not constrain.
The declared schema stands for the class wherever the Manifest is read:
- the snapshot and event queries filter, sort and project its fields, such as
state.owner; - OpenAPI and the generated clients describe it;
- the compatibility check compares it with the baseline, under the rules of any state or event schema.
The check compares the declared shape, not what the serializer writes. The two are kept in step by hand, and nothing checks one against the other. If the serializer starts writing another field and its declaration does not change, the wire changes and the check does not see it. Change both in the same commit.
Peers get their part
A service that sends another context's commands, or reads its published stream, needs that context's commands, events, state and errors. The plugin selects them from the other context's fragment, as META-INF/wow/contract.json, which its api module publishes as its feature contract. A service that depends on the api module finds the contract on its class path, and uses it to name the commands it sends, check the wait plans that cross into the other context, and decode its published events. Nothing is configured: depending on the api is enough.
A tool that cannot take the api jar, such as a console or a gateway, reads the peer's Manifest from its GET /wow/manifest instead (Call Other Services): from the internal port as a service, or from the public port of a peer that serves it there (wow.http.manifest.enabled: true).
The compatibility check
Each service commits its merged Manifest as a baseline, manifest/baseline.json. The baseline records the service's compatibility line, the major of its version ("line": 10), not the version, which moves with every release. checkWowManifest, part of check, compares every build's merged Manifest with it and sorts each difference:
| Kind | Examples | In check |
|---|---|---|
| Additive | A new command, event or aggregate; a new optional field, a command's nullable with no default but null; a new computed property; a command's constraint loosened | Fails until the baseline records it |
| Breaking | A removed command or event; a new required field; a command's new field with a default that is not null; a field removed or retyped; a command's constraint tightened, such as a minimum raised or a pattern added; an event's or a state's field removed, retyped or made required, whatever its revision; a command's aggregate id moved to another field of its body, or out of it (idProperty); a state field renamed, with @QueryAlias or without; an event renamed, with @Alias or without; a @Sensitive value added to an event of a published stream without a new revision (Event Evolution); a job command removed or changed | Fails the build within the line, listing each change and its path |
The constraint rows are a command's, which its clients send: a tighter constraint refuses values they sent before. A state's or an event's schema is what its readers read: a state's by the clients of the state read (GET …/{id}/state), and an event's by the clients of the state trace (GET …/{id}/state/trace, which answers each commit's events) and of the events query, whom every aggregate has; and both by the snapshot query's clients and the published stream's subscribers. So for a state or an event the constraint rows turn around: a constraint tightened there is additive, and one loosened breaks; the service's own stored records are never checked against a constraint. A field removed, retyped or made required breaks those readers whatever the revision: a new revision and its @Upgrade keep the service's own history readable, not its readers, and a new state revision rebuilds the stored snapshots, not what the state read's clients were built against. To change an event within the line, add a new event beside it and retire the old one once its readers have moved, or wait for the next major.
A command's body that a node forwards, sends to its command topic, relays to a peer or re-routes from its intake is read again by the node that decides it, which refuses a property its class lacks and, during a rollout, may run the release before. So a property added to a command, or to a value type its body reaches, follows the rollout's rule. A property added as nullable with no default but null (val priority: Int? = null) is taken by a node of the earlier release while both run: left unset, it travels as null, which the forward and the command topic read as absent. A property added with a default that is not null (val priority: Int = 0), or made required, is refused by a node of the earlier release when a newer node admitted the command and it holds the value, until the rollout is over (wow.command.malformed, unknown-property); the remedy is the first form, or two releases, nullable in one and given its default in the next. The check reports such a property as breaking at its path, naming that remedy, and a required one added to a command names the rollout too. In Java, a reference added to a command's body with no value but null by default is taken as the first form is, whatever marks it; one given a value by an initializer or a creator's default is the Java form of Int? = 0, refused alike, and one required = true is refused as a required property is. A primitive added is refused: as a required property when a record or a @JsonCreator takes it, as one with a default that is not null, its zero, when a setter does. Add a boxed type instead (Integer priority). So within a compatibility line a property that is neither required nor nullable is not added to a command's body: it is added as nullable with no default but null, and stays nullable until the service's next major, a later release giving it a default (Int? = 0) if it needs one. The pre-release flag, -Pwow.manifest.allowBreaking, is the one way round. It says nothing of a nullable property whose default is not null (Int? = 0), though a node of the earlier release refuses it alike: its schema is that of Int? = null, the remedy itself. An event's, a state's or a route's request's property is compared as before.
A state field renamed breaks its readers even when @QueryAlias keeps its old path. The alias is a query's: a filter, a sort or a projection may go on naming the old path. The stored snapshots, the snapshot query's answers and the published stream carry the new name, so the check reports the rename as it reports a field removed, naming the field it became.
An event renamed breaks its readers even when @Alias keeps its old name. The alias is the service's: its log, which holds the old name, stays readable. The published stream and the events query carry the event under its new name, which a reader on the earlier contract does not know: a subscriber stops receiving the event, and a client reads it, its history included, under a name it does not know. The state trace answers the events committed after the rename under the new name too. So the check reports the rename as breaking for an aggregate with readers of its events, which every aggregate has through the state trace and the events query, and says what to do: each consumer takes the new contract first (Event Evolution). A command renamed with @Alias keeps its senders, since the service reads the old name as the command, and the rename is additive; its routes follow the name, and the check reports each old route removed.
A context that runs a schedule job has commands of its own, wow.schedule.EnableJob, RescheduleJob and DisableJob. The check compares them as it compares an aggregate's commands: one removed or changed breaks, one added is additive. A service route's path variable is matched by its position in the path. A variable renamed at its position breaks, since a client that fills the path by name (ServiceRoutes.call of @ahoo-wang/wow-client) and the OpenAPI document's path parameter use its name; so do two variables that trade places, since a client that fills the path by position would mean another thing. Every other parameter is matched by its name. A parameter's schema is compared as an input, as the route's body is: a number widened or an enum value added accepts what clients sent, and is additive; narrowed, it breaks.
The commands a subscription refers to (derives, calls, and the receipts an @OnRejected or @OnCommitted handler takes) are compared by their names on the wire, not by their classes. The service's Manifest names each by its full type name (eshop-inventory.stock.ReserveStock), which the peer's contract on the class path gives for the class the saga uses, or by a system command's name (wow.lifecycle.TransferOwner); the peer command's schema stays in the peer's own Manifest. So a peer that moves a command's class to another package changes nothing here, and a command renamed on the wire is one removed, which breaks, and one added. A command of the service's own that is renamed and keeps its old name as an @Alias stays the same command in every list. A peer's command renamed the same way is the same command too: the check reads the peer contracts on the class path the Manifest was merged from, for the aliases their commands keep and for the name of a command a recorded baseline still lists by its class, and for nothing else, since what a peer's contract changed is its own check's to say. The baseline then only has to record the new name, which updateWowManifestBaseline does within the line. Of a context whose contract is not on the class path the check cannot tell a rename from a removal: it reports the name removed, and says what it may be.
A computed property, a getter with no field behind it, is readOnly in the schema and listed as required unless its type is nullable, since Wow's JSON always writes it in a state, an event and a response. Nothing reads it back: a command's body may leave it out or carry a value the service ignores, and a stored snapshot or event reads without it. A command's body that a node writes from its object (JSON Values lists where) leaves it out, so a node of a release without the property reads the body. So the check requires it of no reader, only of what the service writes: a new computed property is additive, on a command, on a value type a command holds, or on a state. Snapshots written before it do not hold it, so a query naming it misses them until they are rewritten, by the aggregate's next commit or a snapshot rebuild. A computed property turned into a required field breaks, since old clients and old records never had to hold it, and one removed is a field removed: a client that hands back a value it read is refused (unknown-property).
A write-only property, @JsonProperty(access = WRITE_ONLY), is writeOnly in the schema: a client sends it, and no read answers it nor any published stream carries it, @Sensitive or not, whatever a stored payload holds. On a property whose type is a value class, write the mark with no use-site target, or with @field: or @get:: Kotlin compiles such a constructor twice and puts a @param: mark on the copy Jackson does not read, so the value would be written. Generating the Manifest refuses any Jackson annotation it finds there alone, naming the class and the parameter. A node removes it by its name: a value stored before the class made the property write-only, and one a declared schema marks write-only while the class writes it. A property is write-only when its schema marks it, or what its $ref refers to, or a member of its allOf, or every one of its alternatives. One rule says where its removal is decided: only where no union lies above it, on the way from the payload's root. A union is two or more alternatives that are not null, such as a sealed type's subtypes however its type id is written; a tuple of two or more positions, its prefixItems and what follows them (its items, or any value where items is true or absent); or a value of several kinds, by its type (an object or an array, an object or a string) or, without one, by its keywords. A nullable reference is not one. Below a union a stored value does not say which alternative it is, so no node can tell whether the name is write-only in it. A state's or an event's schema with a write-only property below a union is refused: by the build, naming the payload, the path and the name, and by a node, from its own reading of the schema, where it compiles the payload's model, before it answers any value of it: at the first query or read of the payload, at the node's start where its index management or a CoCache view compiles it, or where its transport sink is assembled (a state's mask) or writes an event's first record (that event's). Hold the write-only value outside the polymorphic value, or raise it to a property of the payload. A state's class can hold one, a sealed type whose subtype holds a write-only property, and the build refuses it; an event's class cannot hold a write-only property, so only a declared schema gives an event one. A command's schema is not refused for a union: a sealed payment method whose card holds a write-only cvv is an ordinary command. A schedule of such a command answers its command as null in a read, in an events query and on the transport sink, as it does a command the node holds no schema of, and so does a schedule of any command whose schema the node cannot compile; the schedule still keeps the command in the log and fires it, and it holds no write-only value but null (below). The build's other refusals below hold for a command too, each saying what to change. The build also refuses a write-only mark on no property (a payload itself, a list's items, a map's values, a tuple's position, one alternative of a property whose alternatives do not all mark it), a write-only property below a key no read walks or a name no query path takes, and a recursive type that holds one. A write-only property in an object that holds other names too, a class with an any-getter, is removed by its name, the other names kept. A node refuses such a Manifest anyway. A write-only name is no query field either: in the events model, a name any event of the aggregate marks write-only is no field for any of its events (Queries). The ClickHouse Sink writes records as committed, so wow_catalog marks a write-only property confidential at its path, as it marks a scheduled command: a dataset masks its flat column, refuses one of another type than a string, and reads no document that holds it. The compatibility check reads the mark. Added to a state's or an event's property, it breaks their readers, who no longer get the property, as a removed field does: making a property write-only to hide it is recorded as a removed field. A baseline recorded before the generator wrote the mark for a constructor's parameter reads the same: record it again. On an event of a published stream at an unchanged revision, a write-only mark or a write-only property added breaks on that count too, whoever reads it: during a rolling upgrade a node of the older code publishes the value as the newer events hold it. Removed, the mark gives the property back to its readers, recorded as additive, but on an event of a published stream at an unchanged revision it breaks: a node of the older code removes the property from the newer events it publishes. Either way, raise the event's @Revision. Below a property write-only on both sides, its readers compare nothing. A command's body, which a client sends, is not changed by either. It travels with its command wherever running the command takes it, a forward between nodes and the command topic for its retention among the places (JSON Values lists them). A schedule does not carry it: the command it stores in the event log holds what the command's class reads, each value as Wow's JSON writes it, which leaves a write-only value out. So a decide function or a processor that schedules a command holding a write-only value that is not null fails, a misuse naming the command's type and the value's path, where the command would otherwise fire without it. Schedule a command that names the secret by a reference instead, or, if the value must travel, drop its write-only mark: it is then stored, and @Sensitive masks it where it is read. A write-only value that is null is stored as null, and the command fires with null, not with the property's default, unless the class's @JsonInclude leaves a null out. A value the class keeps no property of, such as a constructor parameter with no property, is in no writing of the command: a schedule leaves it out where the class reads the command without it, and refuses the command where it does not. A wow.schedule.SetSchedule that carries such a command from another node is rejected by its target when it is set (Scheduling).
A number's width is part of its type. A command field narrowed from Long to Int (a format of int64 to int32, or Double to Float) refuses numbers its clients sent, and breaks; widened from Int to Long, it is additive. For a state or an event it turns around again: widening breaks, since a reader generated as an Int cannot hold a Long, while the service's own stored records must still read back, so narrowing them breaks too. A Double (a number of no format) and a BigDecimal (decimal) hold none of each other's values: Wow's JSON writes a Double's or a Float's not-a-number and infinities as strings, which no BigDecimal reads, and a Double rounds a decimal's digits. So a change between them, or from a Float to a BigDecimal, breaks every side, and so does a Long or a BigInteger turned Double, which rounds past 2^53. A Short, a Byte and a Year are written as an int32, as an Int is, and read fewer numbers: the check tells them apart by the class the schema names (x-wow-class), so an Int turned Short is a narrowing as a Long turned Int is. A Kotlin unsigned number is a range of its own, written as the narrowest signed format that holds it, with its class and its bounds: a UByte and a UShort as an int32, a UInt as an int64, a ULong as a bigint, each with a minimum of 0 and its maximum. So an Int turned UInt breaks a command, which then refuses -1, and a UInt turned Long breaks a state or an event, whose readers cannot hold a negative number. A Number, which Wow's JSON reads exactly, is a decimal. An integer of no format is any integer and a number of none a Double, so a change between them breaks every side. One range under two spellings, a number with and without format: double, is no change. Each change names both ranges and what the reader loses: range changed from int64 (a Long) to no format (a Double): a Double rounds a Long past 2^53. A range changed inside an alternative of a oneOf or an anyOf is told as the alternative instead, with no range: the old one no longer accepted, and the new one added. A hand-written schema's oneOf takes a value that matches exactly one alternative, so a new or widened alternative that shares a JSON type with another (an integer is a number) breaks a command: a value its clients sent may now match two. A discriminated oneOf may still grow: an alternative whose required property, its discriminator, holds a const (or enum) no other alternative's values share is additive, since no value can match two. anyOf has no such rule.
build/wow/manifest-compatibility.txt lists every change, additive ones too. A missing baseline fails check too. After an intended change, updateWowManifestBaseline records the new baseline: commit it with the change, so its review shows what clients and peers will see. Each failure names that task. The eShop regenerates its TypeScript clients from the baselines, so a client and its service never drift apart unnoticed.
A breaking change needs the service's next major version, or a new command or event beside the old one, the old one retired once its last client has moved. While the service's major equals the baseline's line, checkWowManifest fails a break and updateWowManifestBaseline refuses to record it. Once the version's major is greater than the line, the update records the break and the new line in the same change. A pre-release of a major's first version, such as 11.0.0-beta.1, keeps its line open: it records a break, since nothing has shipped on that line yet. Any other pre-release records a break only with -Pwow.manifest.allowBreaking, and the update's report, build/wow/manifest-baseline.txt, logs the flag and the changes it let through.
Names, codes and schema keys
Every name in a Manifest follows one grammar. The compiler holds a domain to it, and each reader that generates code from a Manifest, the contract generator and the TypeScript generator, holds a Manifest to it: a Manifest that breaks one is refused, naming the entry, since the Wow compiler never writes it. The Manifest's JSON Schema (META-INF/wow/manifest.schema.json) carries the same grammars as patterns, on the same entries. It also refuses what Wow's reader refuses of one entry: an integer that is not a whole number an Int holds (1.5, 1e10, or 4294967297, which a narrowing would read as 1), a state revision or a retryAfter below 1, a path variable that is not required, a retryAfter beside retry: none or none beside another retry, and an access attribute named owner or space, the built-in ones. It does not state what the reader refuses across entries or by what it knows itself: two contexts of one name, two aggregates of one name in a context, and a requires marker the reader does not understand. A tool that writes a Manifest checks those itself.
| Entry | Grammar | Example |
|---|---|---|
| A context's name | A lower-case letter, then lower-case letters, digits and -: [a-z][a-z0-9-]*. Never a dot, which separates the context from the aggregate in a type's name | eshop-catalog |
| An aggregate's name | A letter, then letters, digits, _ and -: [A-Za-z][A-Za-z0-9_-]*. Never a dot, which joins names | order-item |
| A command's or an event's name | A name, or a framework name: wow, then names after dots, wow(?:\.[A-Za-z][A-Za-z0-9_-]*)+ | PlaceOrder, wow.lifecycle.DeleteAggregate |
| A subscription's name | Names joined by dots: the processor's and the handler's | OrderProcessSaga.onOrderSubmitted |
| A context's error code | Segments joined by dots, each a letter or a digit, then letters, digits, _ and -: [A-Za-z0-9][A-Za-z0-9_-]* | shop.cart.out-of-stock, 404 |
The grammars are ASCII and narrower than an identifier: a name is also a segment of a topic (wow.<context>.<aggregate>.state), of a URL path and of a Wow-Wait hop, which take nothing else.
A context's name is held to its grammar by the JVM's reader as well (the host, the build, a peer's contract on the class path), not only by the readers that generate code: it names the context's routes, topics and configuration keys. A context's name, and an aggregate's within its context, stands once in a Manifest: the JVM's reader and the TypeScript generator refuse a Manifest that lists one twice, naming it, since one of the two would be taken for the other.
A key of $defs is a type's JVM binary name, such as a.b.Outer$Inner. A parameterized type's key adds its arguments' keys in parentheses, joined by commas, such as a.b.Page(a.b.Item), and an argument that is nullable where it is used is followed by ?, such as a.b.Box(java.lang.String?). A system command's body is keyed by the command's name, such as wow.lifecycle.TransferOwner. A schema refers to a definition as #/$defs/<key>. The keys are the same in every document, the public port's and the OpenAPI document's included: what the public port leaves out is the x-wow-class keyword, the class a value is written from, which the contract and the internal port keep.
A nullable reference is written as "anyOf": [{"type": "null"}, {"$ref": "#/$defs/<key>"}], the null alternative first; a nullable value of a type has null among its types, such as "type": ["string", "null"]. A type is one definition however it is used: no key names a nullable variant of a type, and a type used only where it may be null is defined under its own key and referred to so. A hand-written schema (schemaOverrides) may spell a nullable reference with oneOf, or with the reference first: the contract generator and the TypeScript generator read each spelling as the reference or null. The compatibility check reads the anyOf spelling as the reference made nullable, and compares a oneOf as the alternatives it lists.
A command a Manifest refers to, in a subscription's derives, calls, rejected, committed and schedules and in an aggregate's schedules, is named by its name on the wire where the writer can name it: its full type name, <context>.<aggregate>.<Command> (eshop-inventory.stock.ReserveStock), or a system command's name (wow.lifecycle.TransferOwner). Otherwise it is the reference of its class's schema, #/$defs/<key>, and the document keeps that schema, so no reference dangles. A module's fragment refers so to a command its module does not decide, and a context's peer contract keeps its fragment's references as they are, since it is assembled with no peer at hand. A service's Manifest names each through the service's contexts and the peer contracts on its class path, and keeps the reference where several commands share the class or none of those decides it. An event a subscription takes by type (source.eventSchemas) is likewise a reference to its class's schema in a fragment and a contract, and becomes the context and aggregates that publish it in a service's Manifest. A reader reads both spellings.
What reads the Manifest
| Reader | Uses it for |
|---|---|
| The host | Its routes, wait plans, query admission (ownership, schemas), the internal port's call permissions |
| The OpenAPI document | Every route, its request and response schemas (OpenAPI and springdoc) |
| The TypeScript generator | Typed command and query clients |
| The view engine | The fields and capabilities a view may use |
| Peers | Their contract with this context, through its api module's contract |
| The ops console and migrate-data | Commands, subscriptions and types by name |
A Manifest that changes what a part of it means lists a marker in requires: on the Manifest for the whole of it, or on a context or an aggregate for that part alone. A reader that does not understand a marker refuses the whole Manifest rather than misread it, wherever the marker stands, and says where: the level, the node and the marker, such as The aggregate shop.cart requires x. The JVM's reader does so (the host, the build, a peer's contract on the class path), and so do @ahoo-wang/wow-client's checkManifest, which its fetchManifest and a generated client's routing part go through, and the TypeScript generator. A peer's contract and a generated client's routing part keep the markers of what they keep, where they stand. The compatibility check takes a marker added, at any level and on a new context or aggregate too, for a break, since every reader that does not know it refuses the whole Manifest; a marker removed is additive. A reader from before markers could stand on a context or an aggregate ignores them there. Format 1 defines none yet.