ManifestCompatibility
Compares two Manifests and classifies every difference of the wire contract as ChangeKind.ADDITIVE or ChangeKind.BREAKING. Entries are matched by name: a removed context, aggregate, command, event, route, lifecycle command, job command, query model, subscription, published stream or error code is breaking, an added one additive. A context's own commands (ContextManifest.commands, those of its schedule jobs) are compared as an aggregate's are. A command or an event renamed with its former name in its aliases keeps matching, so the rest of it is compared:
A command's rename is additive: a sender on the earlier contract sends the former name, which the service reads as the command, and the receipt it asked for names the command as it was sent. The routes the old name gave are reported removed, since a route follows the name.
An event's rename breaks its readers outside the service, whom every aggregate has: the state trace's clients, the events query's and the published stream's subscribers all meet the event under its new name, which a reader on the earlier contract does not know. The alias keeps only the service's own log readable.
An event removed and listed in the aggregate's
retiredevents (@AggregateRoot(retiredEvents)) is retired, which is additive, when each of its stored names (its name and aliases) is retired; one removed without that breaks the loading of its history. A name no longer retired breaks too; one newly retired is additive.Schemas follow SchemaCompatibility: a removed field, a narrowed type, a newly required field or a removed enum value break; an optional field or an enum value added does not. A state and an event are outputs as well (SchemaDirection.OUTPUT): their readers (the state read's and the state trace's clients, the query models', the published stream's subscribers) read what the service writes now, so a field made optional or nullable, a type widened or an enum value added breaks, whatever the revision, which only rebuilds or upgrades the service's own records. The state schema is the snapshot query's fields, so the same rules hold for it. A field renamed with its old path in
x-wow-alias(@QueryAlias) breaks as one removed does: the stored and published JSON carries the new name, and the alias keeps only the queries that name the old path.A revision covers only the service's own storage, never a contract others read, and every aggregate's state and events have readers besides the service. A state schema that breaks breaks the state read's clients (
GET …/{id}/state), the snapshot query's (itsstate.*fields) and the subscribers of the aggregate's published stream when it carries the state, whatever the state revision: raising it (@AggregateRoot(stateRevision)) only rebuilds the stored snapshots from the log. Likewise an event schema that breaks breaks the state trace's clients (GET …/{id}/state/trace), the events query's and the published stream's subscribers, which read events at their current revision: raising the revision (with an@Upgradefrom each earlier one) only reads the service's own old records. So no revision turns a breaking change additive. A lowered revision breaks.A service route (ServiceRouteManifest) is matched by its name: removing it, or changing its method or path, breaks. The paths are compared with their variables unnamed, and a path variable is matched by its position in the path: one renamed there breaks, since a caller that fills the path by name and the OpenAPI document use its name, and variables that trade places break (a caller that fills the path by position means another thing). Any other parameter is matched by where it is read from and its name (
query:limit). A parameter removed or made required breaks, and so does a required one added; one moved between the path and the query is one removed and one added; a parameter's schema and the route's request are inputs and its response an output (SchemaDirection); a route that no longer takes or answers a body, or newly does, breaks. Its refusal codes are documentation for a client that handles unknown codes, so a code added or removed is additive.Command creation that accepts more (
NONEorREQUIREDtoALLOWED) is additive, any other change breaking; a produced event removed breaks a client waiting for it.A command made internal (
@InternalCommand) breaks: the public port no longer serves its routes, which its public clients send. One made public again is additive: the internal port, and the services that call it, keep its routes either way.Changing an aggregate's id source (
@AggregateRoot(idSource)) either way breaks: a route by no id, the caller's own aggregate's for one whose id is its owner's, means another aggregate, and the ids its clients send or keep change meaning. The routes by no id the change adds or removes are part of it, reported once with it; any other route follows the rules above.An aggregate's access attribute (
@Access) removed or renamed breaks the access policies and the stored records that name it, and so does one whose type changes or that changes between one value and several; one added is additive.Disabling snapshots, changing the ownership, a published stream's topic, or dropping its state breaks; so does a subscription changing its kind, function or source stream, no longer deriving a command, or an
@OnRejected/@OnCommittedhandler no longer taking a command's receipts; a removed@OnCommittedhandler is a removed subscription, and an added one additive. The commands a subscription refers to (derives,calls,rejected,committed) are compared by their names on the wire, not by their classes (ReferencedCommands): a class moved under the same name is no change, a name changed is one removed and one added, and a recorded name a command of the service, or of a peer whose contract is on the build's class path, keeps as an alias is that command; a recorded class reference is compared under the name those contracts give it. Of a context whose contract is not there the gate cannot tell a rename from a removal, which the description says.A marker of
requiresadded breaks, on the Manifest, on a context or on an aggregate, a new context's or aggregate's included: a reader that does not understand it refuses the whole Manifest. One removed is additive.Descriptions, the state fingerprint (derived from the schema), query indexes, schedules, retry budgets and start positions are not contract and are not compared.
Functions
The changes from baseline to current. peers are the peer contracts on the build's class path, read for the commands a subscription refers to alone (ReferencedCommands): what a peer's contract itself changed is its own gate's to compare.