Skip to content

ADR-0039: API owns authored compiler discovery surfaces ​

Context ​

Authored Java discovery annotations and their portable compile-time semantics are used by the compiler, but have historically lived with a runtime integration. That placement can pull platform-specific types into the public authoring contract. The production compiler currently discovers Java symbols through JSR-269. YAML owns pipeline topology, step sequence, cardinality, and types; @PipelineStep owns Java-local discovery and its documented execution hints. @ParallelismHint is separate shared metadata generated by the compiler and consumed by runtime policy resolution; it is not part of the authored @PipelineStep surface.

Decision ​

The framework-neutral API owns compiler discovery and shared semantic metadata surfaces, including @PipelineStep, @ParallelismHint, OrderingRequirement, and ThreadSafety. YAML owns pipeline topology, step sequence, cardinality, and types; @PipelineStep owns Java-local discovery and its documented execution hints. @ParallelismHint carries compiler-generated ordering and thread-safety metadata consumed by runtime policy resolution. PipelineStepProcessor is the production JSR-269 host adapter and owns processing rounds, source discovery, diagnostics, and host services. After its once-only and discovery gates, it captures the authored @PipelineStep, @PipelineOrchestrator, and @PipelinePlugin elements plus the round's root elements in an immutable Jsr269SourceInventory. The inventory makes authored discovery inputs explicit to compiler phases without exposing the round lifecycle. PipelineCompiler owns only the immutable ordering and execution of compiler phases over a host-created compilation context. The host snapshots compiler options into an immutable JDK-only view and adapts the compiler's unanchored diagnostic severity vocabulary to JSR-269 Messager; processing rounds, type utilities, filer access, and source-anchored diagnostics remain explicit host services. Renderer contexts receive compiler options and diagnostics plus lazily accessed JSR-269 Elements, Types, and Filer capabilities, never the whole ProcessingEnvironment. The JSR-269 adapter captures authored discovery inputs while semantic ownership remains with the compiler and framework API. Discovery and normalization produce the same compiler semantic model that later phases consume. YAML contract decoding and composition configuration belong to the framework-neutral pipelineframework-dsl artifact, which consumes the semantic model, runtime-core vocabulary, and SnakeYAML without depending on the runtime integration; runtime and deployment consumers depend on that DSL artifact rather than owning its loaders.

The standalone contract and Java domain generation toolchain belongs to pipelineframework-compiler. It consumes published semantic-model, DSL, and runtime-core contracts plus explicit third-party libraries, without loading or depending on a runtime implementation. Generator entry points retain their public class names, and build consumers declare the compiler artifact explicitly. This artifact boundary does not change JSR-269's role as the production compiler host. The compiler artifact owns the production PipelineStepProcessor, its JSR-269 service registration, semantic phases, and renderers. pipelineframework-deployment retains StepClientRegistrar, StepServerRegistrar, and the Quarkus/Jandex extension integration. Platform annotations and reactive types used only in generated source are JavaPoet names, not compiler class-loading dependencies. The framework API owns GeneratedTypeNames, the stable class-name suffix contract used by compiler producers and integration consumers. NamingPolicy owns the generated .pipeline package suffix. Deployment code must not import compiler implementation packages. Compiler unit tests live with the compiler artifact; deployment retains only Quarkus and generated-runtime conformance tests and consumes the compiler artifact in test scope for those tests. Monorepo consumers pin the compiler through an explicit, independently managed compiler-version property rather than inheriting ${project.version}. The compiler source, processor registration, renderers, and compiler-owned tests are maintained in the The-Pipeline-Framework/pipelineframework-compiler repository. The framework reactor no longer declares a local compiler module; it resolves the exact compiler version from published Maven artifacts. Repository-shell checks remain in the framework repository because they validate its Maven launcher and Testcontainers environment rather than compiler semantics.

No separate pipelineframework-compiler-api artifact is introduced at this boundary. The authored API, semantic model, DSL, runtime-core contracts, runtime protocol, and representation-provider API already own the released contracts used across compiler and integration boundaries. The compiler implementation currently exposes no additional production Java SPI that integrations need. A compiler API artifact should be introduced only when an independently consumable compiler invocation or source-host SPI exists; an otherwise empty facade would add a release boundary without removing coupling.

Shared payload-reference, checkpoint-publication, and transition-worker protobuf schemas belong to pipelineframework-runtime-protocol. These are published wire contracts consumed by compiler tooling and runtime integrations; worker implementations remain runtime-owned. Generated Java names stay stable, and runtime-core remains independent of protobuf libraries.

JDK-only contracts shared by compiler output, customer execution, and runtime hosts belong to pipelineframework-runtime-core. This includes command duplicate policy, pipeline-composition descriptors, the generated pipeline-contract descriptor and its ordered-step, capability, and imported-definition provenance records, framework-propagated request context, durable execution identity, and object-boundary adapter interfaces. These contracts keep their existing Java packages and record shapes while moving out of the Quarkus runtime artifact. Their mutable holders, transport filters, codecs, execution engines, stores, and invocation-local recursion state remain runtime-integration concerns. Reactive service APIs remain outside runtime-core because their Mutiny types are a customer-runtime API choice; runtime-core's dependency guard continues to prohibit Mutiny and platform integration, logging, and serialization implementation dependencies. Pure application extension contracts used by generated code, including AwaitCompletionProjector and AwaitCompletionMetadata, likewise belong to pipelineframework-runtime-api rather than the Quarkus runtime implementation.

Compile-time expansion of authored pipeline order belongs to pipelineframework-dsl. Compiler renderers refer to generated-code runtime targets by their stable published names rather than loading runtime implementation classes into the compiler process. Those names remain compatibility obligations of the customer runtime API; spelling them in compiler code does not transfer their semantic ownership to the compiler.

Migration proceeds in sequence: first stabilize authored API surfaces while preserving JSR-269 as the production host; next extract the JSR-269 compiler and semantic phases from Quarkus deployment; only after that add a Jandex source-symbol adapter with parity tests. Both source-symbol adapters feed the same semantic model and phase engine; Jandex must never create a parallel semantic path. Future Jandex and JSR-269 adapters must produce the same semantic values for @ParallelismHint. The API may expose portable class tokens, but validation of platform-specific token types belongs to the relevant integration or capability adapter, not to the API.

Rationale ​

Authored compiler inputs are part of the framework contract even when a particular build host discovers them. Keeping their types in the API preserves stable names and descriptors without making annotation definitions depend on one runtime. A shared semantic model keeps build-host differences at the source-symbol boundary while preserving YAML's authority over topology, step sequence, cardinality, and types, alongside the authored annotation's ownership of Java-local hints and compiler-generated metadata's shared runtime meaning.

Consequences ​

  • Applications can compile against authored discovery annotations and compile-time semantics without depending on a runtime integration module.
  • Runtime integrations retain platform-specific implementations and validate their own capability classes.
  • Customer execution and self-hosted worker processes can share the generated pipeline contract model through runtime-core without depending on the Quarkus runtime implementation.
  • Object-source and object-target provider SPIs, requests, sessions, results, and snapshots are runtime-core contracts; connector implementations consume them without depending on the Quarkus execution engine.
  • Compiler and integration artifacts share generated type naming through the framework API, without integrations depending on compiler implementation classes.
  • Future Jandex and JSR-269 discovery adapters must normalize into the existing compiler model and produce the same @ParallelismHint semantic values while preserving YAML ownership of topology, step sequence, cardinality, and types, alongside authored annotation-owned Java-local hints.
  • @PipelineStep.cacheKeyGenerator uses Class<?> with Void.class as its no-override default; explicit class identity is retained until an integration or capability adapter applies its own validation.

Diagram