Chenile 2.1.37 in development

Not released. The framework working copies have moved to 2.1.37 after 2.1.36 was published to Maven Central.

This initial development commit aligns version references only. There is no 2.1.37 release tag or Maven Central deployment. Use 2.1.36 for applications that resolve published framework artifacts.

Changes so far

Pluggable transformers: any payload, JSON by default

The transformation step of the chenile-highway is now an interpolation, transformersInterpolation, instead of a fixed transformer command. It runs the Spring beans named in the new chenile.transformers property, in order.

  • The default is chenile.transformers=jsonTransformer, so existing applications behave exactly as before with no configuration change.
  • Transformer is renamed to JsonTransformer (bean jsonTransformer).
  • Add transformers for XML, CSV, Protobuf or any other format, or replace JSON entirely, for example chenile.transformers=xmlTransformer,jsonTransformer. A transformer for another text format goes before jsonTransformer.
  • Transformer names are validated at startup, like the other deployable-wide interceptors.

Upgrade note: code or custom chenile-core.xml flows that reference the Transformer class or the <transformer/> tag must switch to JsonTransformer and <transformers-interpolation/>.

See runtime internals.

Polymorphic contracts, defined once (ADR 0001, phases 1 and 2)

An operation’s contract (name, description and, for a polymorphic operation, its variants) is now resolved once in chenile-core and published the same way to MCP and OpenAPI.

  • @ChenilePolymorph, ChenilePolymorphProvider and ChenilePolymorphVariant moved from chenile-mcp to org.chenile.core.polymorph. A variant has a complete name (was nameSuffix; the provider helper variantName(op, suffix) gives <contractName>_<suffix>), java.lang.reflect.Type parameter types, an optional body discriminator and the authorities it needs.
  • A body type selector that implements ChenilePolymorphProvider makes its operation polymorphic with no annotation. SubclassBodyTypeSelector does: one variant per subclass registered in SubclassRegistry.
  • @ChenileOperation(contractName, description) (also read on HTTP controller methods), @ChenileController(description) and JSON contractName, description and polymorph replace @ChenileMCP(name, description); @ChenileMCP is now a marker.
  • The typing step records each request’s variant (ChenileExchange.getPolymorphVariant()), and falls back to the default body type when a selector sets none (chenile.transform.selector-fallback, default true).
  • New ChenileJsonSchemaGenerator (JSON Schema Draft 2020-12, victools 5) used by MCP and OpenAPI.
  • New ChenileOpenApiCustomizer in chenile-http: contract names and descriptions as operation ids and summaries, one path per variant selected by a path variable (for example POST /q/students), oneOf bodies for header or body-field variants, and x-chenile-authorities.
  • Query: QueryPolymorph moved to chenile-query-service and the base QueryController is polymorphic (querySearch); the MCP query controller is mcpQuerySearch.

Authorities per polymorph variant (ADR 0001, phase 3)

SecurityConfigServiceImpl (chenile-security) now guards a polymorphic operation with the authorities of the request’s variant when the variant lists any, before @SecurityConfig(authorities) and @SecurityConfig(authoritiesSupplier). A plain @SecurityConfig on the operation is enough; the provider decides what each variant needs.

Workflows and queries publish their own variants (ADR 0001, phase 4)

  • StmBodyTypeSelector is now a ChenilePolymorphProvider: one variant per event (<contractName>_<eventId>), typed by the event’s payload and guarded by its meta-acls. Workflow MCP tools, OpenAPI event paths and per-event authorization need no extra beans.
  • QueryPolymorph publishes each query’s acls as the variant’s authorities and resolves each request against the current tenant’s definition, so tenant-specific ACLs apply.
  • Removed: StmAuthoritiesBuilder, ProcessIdPolymorph, workflow-service’s ChenileOpenApiConfiguration and the queryAuthorities bean. Replace @SecurityConfig(authoritiesSupplier = "<svc>EventAuthoritiesSupplier") with @SecurityConfig, drop the <svc>EventAuthoritiesSupplier and <svc>ProcessIdPolymorph beans and the @ChenilePolymorph("<svc>ProcessIdPolymorph") annotation. The workflow default ACL (<bean>_<event> when an event has no meta-acls) moves from new StmAuthoritiesBuilder(provider, true) to stmBodyTypeSelector.setDefaultAclRequired(true). It now uses the service’s configured implementation bean, even when a trajectory or ServiceSelector picks another bean for a request. workflow-mcp remains as a dependency-only module.

The registry holds the whole contract (ADR 0001, phase 5)

  • Published service definitions now carry each operation’s contractName, request and response JSON Schemas and variants, plus the service’s shared schemas, generated by the publishing deployable with ChenileJsonSchemaGenerator.
  • The registry serves an aggregated OpenAPI 3.1 document for the whole system, GET /serviceregistry/openapi, and one per service, GET /serviceregistry/{serviceId}/openapi.
  • Database: new columns service_definition.shared_schemas and operation_definition.request_schema, response_schema and variant_definitions (text), plus operation_definition.contract_name. Add them if Hibernate does not manage the registry’s schema.
  • ServiceRegistryClientImpl now serializes with Jackson 3.

Query: safer sorting and server-only system filters

Two fixes to the query request handling in query-api (AbstractSearchServiceImpl, SearchRequest):

  • Sorting is limited to sortable columns. Sort names are written into the SQL as identifiers (the ${orderby} fragment), so a sort on a column that the query’s definition does not mark "sortable": true is now rejected with 400 (Q724) before any SQL runs. Before, any name was accepted, which allowed SQL injection through sortCriteria[].name. Positional (index) sorting is unchanged, and sort criteria on a query that is not sortable are still ignored.
  • System filters belong to the server. systemFilters is no longer read from a client’s JSON; it is set only on the server, for example by queryUserFilterInterceptor (authIds). Neither customVariables nor filters can replace a system filter, and customVariables cannot replace the to-do-list state filter. Before, a client could send customVariables.authIds and widen what it was allowed to see.

Upgrade notes: mark every column that clients sort on with "sortable": true in the query definition; a request that sorts on any other column now fails with 400. Callers that sent systemFilters in the request body must set them on the server instead, in an interceptor or before calling SearchService. The JGen mybatisQuery template and the chenile-samples query services are updated to match.

Region-to-trajectory mapping works

RegionToTrajectoryConverter (utils) wrote the region into a header named chenile-trajectory-id, which nothing reads, and read the region from x-region. It now reads the standard region header, x-chenile-region-id, and, when the request has no trajectory, sets x-chenile-trajectory-id on the exchange and the trajectory in the request context, so the service-reference step, cconfig and workflow resolvers all see it. Register it as a pre-processor: chenile.pre.processors=regionToTrajectoryConverter. Its constructor now takes the ContextContainer.

Upgrade note: send the region as x-chenile-region-id instead of x-region.

Integration-test steps match the unit-test steps

chenile-bdd’s it-cucumber-utils now implements the whole REST step vocabulary of cucumber-utils against a running server, so a feature file runs unchanged in both. Headers carry substituted ${variables}; every assertion reads the REST Assured response (about ten used to fail with a ClassCastException); the warning steps that check a code work; store … from response to … takes one space, as in unit tests (the two-space form stays as an alias); and the collection, the value of …, size, empty-payload and fix and store JSON string steps are added. In both it-cucumber-utils and chenile-core’s cucumber-utils, CukesContext now gives every thread its own map (it used to give one only to the first thread). A new test runs each step against a local HTTP server and checks that every step expression compiles and matches its method. See Cucumber step libraries.

Spring AI 2.0.1

chenile-parent moves from Spring AI 2.0.0-M2 to 2.0.1 (Jackson 3, MCP Java SDK 2.0.0). chenile-mcp now uses org.springframework.ai.mcp.server.webmvc.transport.WebMvcStreamableServerTransportProvider and the Jackson 3 JacksonMcpJsonMapper. MCP request header names now arrive in lower case.

Upgrade notes: replace @ChenileMCP(name = ..., description = ...) with @ChenileMCP plus @ChenileOperation(contractName = ..., description = ...); import the polymorph types from org.chenile.core.polymorph; build variant names with variantName(...).