Repository navigation
Release v4.26.0
Reducers whose transitions are written in the model now bind to the executable semantic model, and every piece of code the model hands off to gets a stable identity. This implements decision 0002 for reducers; the rule-predicate role (code validation) follows.
Added
- A reducer whose every
on <Event>rule has a body, inline or in afile, binds to a reducer contract in the executable semantic model: the read model it builds, the events it consumes, a key fixed to the event source id, no initial state, and a result that is the new state or a delete, as Chronicle runs reducers. Inline and file bodies bind to the same contract. The body stays opaque code, not portable meaning. - ESM v3. A model is serialized as v3 only when it contains a bodied reducer; every other model keeps its v1 or v2 bytes exactly. v3 includes all of v2.
LanguageVersion.V3,SemanticVersion.V3andEsmSchemaV3Supportdescribe it, and a full v3 golden vector pins its canonical form. Reducer transitions are canonicalized by event, so reorderingonrules does not change a model's revision. - Implementation requirements carry
RequirementId(derived from the owning construct, role and member, never from a path),ContextVersionandResultVersion,RequiredCapability(purefor reducer transitions) andAttachmentResolution. SemanticDocumentSet.Create(documents, catalog, attachmentContents)lets a host supply the contents offileattachments, which are then identified by a hash of their content. Without supplied contents a file attachment is reported asUnresolvedFilewith no hash; the file compiler, MCP server and Tool supplying contents is tracked in #244.- PLAY0398: a reducer mixes rules with and without a body.
- PLAY0399: a reducer has more than one rule for the same event.
Changed
- The reference runner does not compute reducer state. A specification that reads a reducer-built read model, through
given readmodel,then readmodelorthen query, reports an unsupported outcome naming the reducer and never passes; other specifications in the model run as before. Calling the evaluator directly reports the same for a query over, or returned state of, a reducer-built read model. - A file-backed implementation attachment is no longer hashed from its path, so moving a file no longer changes its hash and editing it is no longer invisible.
- A consumer that accepts only ESM v1 or v2 now receives a v3 model for documents with bodied reducers, where binding used to fail with "requires a portable reducer contract". Reducers without bodies are still rejected with the same message.