Convention in a plugin, not in build scripts
Every Klok project builds, versions, publishes and documents itself the same way, and the way changes over time. Putting
it in a plugin that projects apply means a change ships as a plugin release and reaches every project through the
catalog, instead of a mass edit of build scripts. A project's build.gradle should contain its dependencies and nothing
about the platform.
Timestamped versions from main
A main build is a release. A version that is unique per build never has to be bumped by hand, can be published to an
immutable registry any number of times, and is traceable to a pipeline through its timestamp. The trade off is that
consumers cannot express "at least version X" meaningfully across timestamps; they take whatever the catalog says, which
is the intent.
Deployed projects are versioned by their commit, libraries by their build
Decided 2026-10-07 (klok-gradle-plugin#26). An integration is deployed by the digest of its image, so a version that
changes with every build redeployed every service on every pipeline, a rerun of an unchanged commit included. A deployed
project is not published to a registry, so it does not need a new version per build; it needs one that names its source.
The commit time keeps the format (-build.<yyMMddHHmmss>), so nothing that reads a version had to change, and it still
orders builds in time. A hash of the inputs would have been more exact, but a rebuild of the same commit with a changed
catalog already differs in lib/, so the version does not need to say so. Libraries keep the build time, because each
of their main builds is a release to an immutable registry. Gradle archives without timestamps and
quarkus.package.output-timestamp remove the other build times; the bytecode Quarkus records in parallel is not
reproducible, and the Gradle build cache is what returns the same bytes for the same inputs (Versioning and
publishing).
One timestamp per build
The timestamp was computed per project, so the modules of a multi-module build could get different versions when the
second ticked over between them, and the Quarkus deployment module then referenced a runtime version that did not exist.
It is now computed once on the root project and shared.
The catalog is the coordination point
Projects do not pin framework or datamodel versions; the catalog on main is the only place where a version is stated,
releases write to it and builds read from it. This is the "Git is the truth" principle applied to dependencies: the
catalog file can also be edited by hand in GitLab and every build follows.
Two catalogs, and the tenant's copy has a fixed name
Decided 2026-09-30. The platform catalog is the only public project on git.klok.dev and carries the framework, the
plugin, the aligned third-party versions and klok's datamodels; a tenant's own datamodels belong to the tenant, so they
move through a private catalog of its own, <tenant>/framework/<tenant>-gradle-dependency-catalog, read as
tenantLibs. Tenant klok gets no second libs catalog: its datamodels stay where they are, and its private catalog
carries the agent skills only, so one code path serves every tenant and klok differs in one naming rule.
The project's copy is gradle/tenant-libs.versions.toml for every tenant, not <tenant>-libs.versions.toml, because
the accessor is fixed and from files(...) in settings.gradle is a literal path: a tenant-named file would make every
settings file tenant specific and every template a rendering. A committed empty catalog (four empty tables) keeps the
two-line block valid before the first refresh, for klok and for a tenant without a catalog yet.
The tenant part of updateKlokLibsToml never fails the build, unlike the platform part. A project must build before its
tenant has a catalog, a laptop without a token must still refresh the platform copy, and a broken tenant catalog must
not stop every pipeline of the tenant: each of those is a warning that names the cause and the fix, and the copy is kept
or the empty catalog written.
Skills are pruned by their marker, never by their name
Decided 2026-09-30. updateKlokAgents used to remove retired skills by name prefix: every Klok skill was klok-*.
Tenant skills broke that rule twice over: tenant klok's skills are named klok-context and klok-integration-…, and
every tenant's skills sit in the same directories as the platform skills and a developer's own. The marker line each
installed skill already carried is the only reliable owner record, so the prune rule now reads it: a platform marker is
removed when the platform set no longer lists the name, a tenant marker only when that tenant's catalog was read in the
same run and no longer lists it, and a directory without a marker is never touched. The rule is the same in klok-cli and
the agent runner, because a repository is written by all three. The one loss is that a copy of a Klok skill under a new
name keeps the marker and is pruned; removing the marker line is how a copy becomes one's own.
The plugin extracts what can be extracted: routes, datamodels, sub routes, sources. Documentation pages that need a
human are written in klok-docs/ of the repository and mirrored by the docs sync; generated pages never overwrite them.
Extraction with Spoon on source level, rather than reflection on the built jar, keeps the scan independent of Quarkus
startup and lets it include source snippets.
A datamodel is documented from its repository, one page per class
A datamodel repository holds a schema; the Java project the plugin runs in is generated from it inside the repository,
and carries no klok-docs/. The payload therefore reads the documentation files from the repository root, found as the
nearest .git above the project, rather than from a path the pipeline passes in: the same rule holds by hand, in GitLab
CI and on another CI system, and a project outside a checkout still builds.
Every class of the model becomes a dataModelDocs[] entry, rather than only the root type named in the schema's
metadata. The metadata files are not uniform across the existing datamodel repositories (some have a name, some a
schemaName, some neither), and a reader of a datamodel wants the fields of the nested types as much as those of the
root. Listing the classes needs no guess about which one is the model. Enumerations stay in sources[], because a page
per enum would show no fields.
A datamodel is checked against every earlier release, both ways, before it is released
The major version is in a datamodel's name, its classes and its topics, so a release that breaks a reader cannot share
the name; it is a new major version. Deployment order gives the direction: producers and consumers of a topic are
deployed independently and a service may stay on an earlier release, so a new release must read what every earlier one
wrote (backward) and be readable by every earlier one (forward), against all earlier releases and not only the last
(transitive). That is Pulsar's FULL_TRANSITIVE, and the check runs the broker's own rule for it, Avro's
SchemaValidatorBuilder().mutualReadStrategy().validateAll() on schemas parsed without validating defaults.
The broker's rule alone is not enough. Its validator accepts a new enumeration value, and a consumer on an earlier
release then fails on the first message that carries it, which is exactly the break the rule exists to prevent. The
check therefore also asks Avro's SchemaCompatibility, which a reader's decoder follows, in both directions, and fails
when either finds a problem. It adds one rule of the platform's that Avro does not have: a removed or renamed field is a
new major version even when it was optional. Avro reads around a missing optional field, so a service built with an
earlier release would get an empty value from then on and never notice; the platform rules, klok.dev's datamodel editor
and this check agree that such a change needs a new name. Avro's findings name the union a field sits in rather than the
field, since every reference typed field of a datamodel is a ["null", T] union, so the report adds a plain field by
field comparison for people; the verdict stays Avro's.
The check compares the wire schema, the one Schema.AVRO(clazz) registers, and not the XSD: that is what readers decode
with, and two XSDs that look alike can give different wire schemas (a required xs:long is a Java long, a required
xs:string is still optional on the wire). Each earlier release's jar is dumped the same way as the build's own
classes, so the comparison is like for like.
The list of earlier releases comes from Git: the release job tags every version it publishes. A Maven registry cannot
answer the question, because the GitLab package registries serve no maven-metadata.xml for these artifacts, so Gradle
cannot list their versions; and Gradle cannot resolve them either from inside the datamodel's own build, where a
dependency on the project's own group and artifact at an older version selects the project itself. The jars are
therefore downloaded by their standard Maven path from the repositories the project declares, with their credentials.
The catalog's version is compared as well and must be found, so a clone without tags or a registry that answers 404 to a
missing login cannot turn the check into a silent pass.
A release that broke compatibility before the check existed would otherwise block every later change of its datamodel.
compatibility.since in klok-datamodel-project.json lets the owner record that no service runs the releases before a
given one, with a required reason, in the repository and in a reviewed merge request, rather than as a switch in the
pipeline. There is deliberately no switch that turns the check off.
Python datamodels are generated from the schema Java registers
A Python producer and a Java consumer only agree when both use the same Avro schema, and today that is not the XSD
.avsc: Pulsar derives the schema from the generated POJO by reflection, with a different namespace, field order,
nullability and enum symbols. Generating Python from the .avsc would give packages that look right and write bytes
Java misreads. The plugin therefore asks Pulsar itself (Schema.AVRO(clazz), the call KlokBrokerClient makes) in a
JVM with the datamodel classes and the catalog's pulsar-client, and generates from the answer. When the datamodels
move to an embedded SCHEMA$, the same call returns the embedded schema, so the migration needs no change here.
The dump runs in a separate JVM rather than in the Gradle daemon because the datamodel classes and the right Pulsar
version must be on one class path, and neither belongs on the plugin's.
The dump class path carries org.apache.pulsar:pulsar-client-admin-api next to pulsar-client, in the same group and
at the same version constraint, derived from klokLibs.pulsarClient rather than from an alias of its own.
pulsar-client 5.0.0 still uses classes of that module (Schema.AVRO reaches
org.apache.pulsar.common.policies.data.AutoFailoverPolicyData) but no longer declares it as a dependency, as 4.x did;
without it the dump fails with a NoClassDefFoundError. Deriving it keeps the catalog the only source of versions and
keeps every existing catalog valid: a new required alias would make updateKlokLibsToml refuse every catalog that lacks
it, and break the projects whose committed copy predates it. With 4.x the module is already there transitively at the
same version, so the addition changes nothing.
The Python package is part of publish, not a pipeline job
The datamodel pipeline already runs publish in the generated Java project. Hooking the Python package into that task
gives every datamodel its package without a change to build-template-datamodel.yml, keeps the logic in a tool that
runs the same way by hand, and keeps the pipeline portable to another CI system. The wheel is built in Java (a pure
Python wheel is a zip with three metadata files) so the step needs no Python build toolchain, and the upload is the same
multipart request twine sends.
A failed upload fails the release on purpose: a datamodel version that exists for Java but not for Python breaks the
promise that every language gets every version. klokPythonDatamodel=false is the explicit way out.
The npm version of a datamodel is its Java version
A TypeScript datamodel package has the version of the Java artifact it mirrors, so "which Java build is this" never
needs a lookup table, and the ce-dataschema URN (which carries the Java version) and the package version name the same
build. 1.0.0-build.<timestamp> is valid semver and is used unchanged. A version with build metadata,
x.y.z+<timestamp>, becomes x.y.z-build.<timestamp>: npm ignores build metadata, so two builds would otherwise
publish the same version and the second would be refused.
The consequence is that every datamodel version is a semver prerelease. A range such as ^1.0.0 does not select it, so
a consumer pins the exact version, which is how Java projects already take versions from the catalog. The tarball is
packed in Java with sorted entries and fixed times, like the wheel, so the same build gives the same integrity.
A prerelease also needs an explicit dist-tag: npm 11 refuses npm publish and npm stage publish of one without
--tag. Every path therefore names latest: the Java PUT to GitLab sets it in dist-tags, the staged release passes
--tag latest, and the command printed for a first manual publish carries it too. latest is right because every
release is built from main and is the newest version of the datamodel, so npm install <package> without a version
gets it, as it would for any other package.
TypeScript datamodels are written as JavaScript and declarations, in Java
The plugin writes index.js, index.cjs and index.d.ts as text, the way it writes the Python package, instead of
generating TypeScript and compiling it. A compiler step would put Node and TypeScript into every datamodel pipeline and
every build on a laptop, for output that follows one fixed pattern per record. The JavaScript is kept plain enough to
read in node_modules, and the CommonJS entry is derived from the same text as the ESM entry, so the two cannot
disagree. What a compiler would have checked is checked in the plugin's own build instead: the interop test runs the
generated package in a real Node, reads Java's bytes with it, and type checks the declarations with tsc.
The package is generated from the schema Java registers, for the reasons in the Python section above, and encodes with
avsc using wrapUnions: false, so a nullable field is a plain value or null rather than a wrapped union. The
logical types Java writes (timestamp-micros, timestamp-millis, date) become Date through a small helper in the
package. A time of day (time-millis, time-micros, Java's LocalTime) becomes the ISO 8601 string Java prints,
"08:30:15.250", rather than a bare count since midnight: JavaScript has no time-of-day type, the string reads the same
in Java, Python (datetime.time) and a log line, and a malformed one fails the encoding instead of landing as another
time. Anything the generator cannot express faithfully (another logical type, a union other than ["null", T]) fails
the build with the record and field named, because a package that looks right and writes bytes Java misreads is worse
than no package.
The declarations are shipped twice, as index.d.ts and index.d.cts. With "type": "module" TypeScript reads a
.d.ts as ESM declarations, and a CommonJS project that resolves with node16 would then refuse the import; the
require condition of exports therefore points at a .d.cts with the same content.
avsc is required at ^5.7.9. Versions up to 5.7.7 call buffer.SlowBuffer when loaded, which current Node no longer
has, so a package that allowed them would crash on import there.
A private package is published to GitLab with the npm registry protocol implemented in Java, the PUT of one JSON
document with the manifest, the checksums and the base64 tarball that npm publish sends, rather than by running the
npm CLI, so publishing needs no Node in the pipeline either.
Public packages are staged, never published by a pipeline
A PUBLIC datamodel is staged on npmjs.org with npm stage publish, and a maintainer publishes it with 2FA. That is
npm's recommendation, and it is how klok-cli and the TypeScript broker client are released: one stage-only token without
2FA bypass serves every @klok-integration package, and no pipeline can put a version live on its own. A token that
bypasses 2FA to publish directly was considered and rejected; npm removes direct publishing for such tokens in January
2027 in any case.
npm documents staging as a CLI command, not as a registry protocol, so the plugin runs the npm CLI here (11.15 or newer,
which the Klok build image carries) instead of extending the Java PUT. That is the one place the datamodel pipeline
needs npm.
npm cannot stage a package that does not exist yet, so the first version of every new public package is published by a
person. The task treats a missing package as that documented manual step, with a warning and the commands, rather than a
failure: failing would block the Java release of a new datamodel for something only a person can do.
Tokens do not cross registries
A PUBLIC datamodel is staged on the public npm registry with NPM_TOKEN, which the Klok Vault login exports in every
pipeline; any other datamodel publishes to the GitLab registry of its project with the job token, as the Python package
does. Each token is sent only to the registry it belongs to: NPM_TOKEN never goes to GitLab, no GitLab token goes to
npmjs.org, and the job token does not follow a klokNpmRegistry override to another host. A misconfigured target then
fails for a missing token instead of handing a secret to the wrong server.
A PUBLIC datamodel counts as having a target in a pipeline (CI is set, as on GitLab, GitHub and most CI systems) or
when a token is given, so ./gradlew publish on a laptop does not try the public registry by accident.
The scan passes on the classes a route uses, and @KlokDocs marks the important ones
Decided 2026-09-29. The documentation's AI sections were written from a route's own source only, so a route that calls a
project class got a guessed description of it (KLK007T1_PublishKlokStandard and KlokStandard). Every route now
carries referencedSourceRefs, the project types it references one level deep, whether annotated or not; the annotation
@dev.klok.framework.common.docs.KlokDocs additionally gives a class or package its own page. One level is enough to
stop the guessing and keeps the prompt small; following references further would pull most of a project into every
route. The annotation is matched in source by its qualified name, because the scan reads source and the annotation has
CLASS retention, and the plugin depends on klok-common only by that name. The caps are constants rather than settings
until a project needs another value.
Klok knowledge is bundled at build time from the agents zip
Decided 2026-09-30. Services that talk to Kloker restated the platform rules in their own prompts, and the copies
drifted. The knowledge is now written once in klok-integration-agent and travels in klok-agents.zip, so the plugin
reuses the download and cache of updateKlokAgents rather than a second path, and a service reads the blocks from its
own classpath with klok-common's KlokKnowledge: no runtime call to GitLab or the ODL on an AI request. The knowledge
tasks only write resources and use nothing from klok-common. The download is a separate, always-running task so that the
extraction itself can be up to date and cacheable, and the cached zip is only replaced when its content changes, so an
unchanged catalog does not rebuild the jar.
Who bundles it and what a missing block means were decided again on 2026-11-04, when the Kloker gateway and the
documentation egress started loading blocks. Until then every integration bundled the knowledge by default, 21 of them,
and none read it; a missing block was a warning, and the service found out when it asked for the block. The gateway has
one replica with the Recreate strategy, so a failed start is an outage, and CI runs no integration tests
(build_java_job is quarkusBuild), so the check has to be a Gradle task failure. Three checks were weighed: the
service at start alone (too late, it is the outage), a test in the service (CI does not run it), and the build. The
build is the gate and the service's start check the second line. klokKnowledge=true became the only switch, so 21
integrations stop downloading a zip they do not use; every other project has nothing to fail on. A consumer is listed in
knowledge/consumers.json because the list says which blocks it needs, which the plugin cannot learn from a build of a
project. A laptop keeps the warnings: a developer may be offline or building from another copy of the text.
The recorded commit says which text a service runs with, and it comes from GitLab's raw file API, decided 2026-11-04.
The web's raw URL (/-/raw/main/klok-agents.zip) serves the same bytes but names no commit, so every build recorded
unknown. Three ways to get one were weighed: a second request to the commits API, the tip in X-Gitlab-Commit-Id, and
X-Gitlab-Last-Commit-Id on the raw file API. The last one needs no second request and stays put while other files of
the catalog change, which the tip does not; the tip is only the fallback for a server that sends nothing better. Checked
by hand on 2026-11-04: both URLs answer anonymously with the same 110158 bytes (same sha256), and the API's
X-Gitlab-Last-Commit-Id equals the catalog's newest chore(catalog): update klok-agents commit. The default URL is
read without a token: the catalog is public, and the same request with a job token GitLab does not accept answered 401,
which would turn a public read into a refusal. A cache filled before this has a record that says unknown for the same
bytes, so a record is written again when the server names another commit, which the next build does once.
The topic check asks klok.dev, and the build only lists
Decided 2026-10-08. The broker creates no topic by itself, so a deploy must know beforehand that every topic its service
needs exists and is granted. Two places could compare: the build, against the broker's admin API, or klok.dev. The
build's CI identity is the tenant's CI broker client; it cannot read the grants of another client
(service-account-<clientId> of the service), and giving it that right would let every pipeline read every grant of its
tenant. klok.dev already holds Git (the tenant's Pulsar file) and reads the broker with its own identity, and it is
where a developer requests a missing topic, so the comparison and the answer live there. The plugin does what only the
build can: it knows the code, so it lists the topics (klokTopics) and sends the list (klokTopicCheck). The list is
also a file (topics.json) any other tool can send or read.
Three more choices:
klokTopicCheck lists by itself. It is a klokTopics with a check after it, not a task that reads the other's
output, so --environment given to the check always names the topics that are checked.
- Strict in CI, lenient on a laptop. A check that cannot run fails a CI build (a deploy without a check is the failure
this exists to prevent) and only warns locally, where the developer may be offline or without a token.
- Messages from the contract. A problem klok.dev reports without text gets klok-common's
KlokTopicProvisioning
message, the one the framework logs when the service fails to start, so the build and the running service say the same
thing.
A route's result and dead letters are listed in its own namespace
Decided 2026-11-23, with klok-quarkus-extension 3.18.0 (klok/framework/klok-quarkus-extension#76). The framework moved
the last two topics a consuming route wrote in the namespace its overrides named: an offramp with result's result, and
the dead letters of a topic in another domain or tenant. KLK006E7_PostmarkSendKlokai reads klok/mailbox and may
publish only in klok/mail and klok/common; the listing asked for klok/mailbox/KlokMailSendResultV1_klokai, which
the service never used once it worked around the framework in code. The scan follows the framework again:
RouteTopics.overridesApply keeps the override off an offramp with result's publish side, as it does for a processing
route, and ExpectedTopics names the dead letter topic by the framework's rule (KlokTopicResolver.deadLetterTopic):
beside the consumed topic when it is in the service's own tenant and in its own domain or common, else the same name
in the service's own tenant and domain. Why the framework chose that rule over the alternatives is in its design
decisions (A route's dead letters are its own; so is an offramp's result). The listing is not gated on the extension
version: pipelines build with the catalog's latest extension, and this change is released after 3.18.0 reached the
catalog.
Decided 2026-11-12, with klok-quarkus-extension 3.12.0. The scan lists the topics where the framework publishes, so it
follows the framework's two corrections. A processing route applied topic.tenant-override and topic.domain-override
to both its topics, so a route that read a shared file event in <tenant>/common also published its result there, in a
namespace it should only read (write narrow, consume wide, klok/framework/klok-quarkus-extension#30): the overrides
now name the consumed topic and its _DLQ, and the result and the route's CloudEvents stay in the service's own tenant
and domain. The task framework published in the service's domain, while the task materializer and klok-api-tasks listen
in common, so a service with klok.domain=hr sent its task events where nobody read them and listened for
cancellations where none were sent (klok/integration/klok-api-konvoj#6, klok/integration-solutions#14): task snapshots,
status events and the command subscription are now listed in common, like log events and the ODL. Onramps and
request/reply pairs keep the override on every topic, because they have no second, consumed side to separate (an offramp
with result's result and every route's dead letters moved in 3.18.0, above). Which topic follows the override is decided
per topic in RouteTopics.overridesApply, next to the pattern table, so the scan and the listing cannot disagree. A
service built with an older extension still publishes where the overrides say; the listing describes 3.12.0 and later.
The solution check reads the registry in Git, as one archive
Decided 2026-10-08. A solution id is allocated by the merge request that adds its folder to
<tenant>/integration-solutions, and a number is never used twice. Nothing compared that lock with the code: klok.dev
proposed the next number from its own table, which saw neither the routes nor open merge requests, and two numbers were
already in code without a registry entry. The build is where the route ids are known, so klokSolutionCheck compares
them with the registry itself, without klok.dev in between: the registry is Git, and a check that asks a copy of Git
would need that copy to be fresh. Four choices:
- One archive, not a listing. A CI job token may read
repository/archive and repository/files/:path/raw of another
project but not repository/tree, so the folders cannot be listed. The archive of solutions/ on main is one request
that brings every descriptor and names the commit it was made from.
- The root group decides the tenant in CI. About twenty klok repositories say
klok.tenant=klokdemo; their registry
is klok's, because the repository is in the klok group. CI_PROJECT_ROOT_NAMESPACE comes first, and a klok.tenant
that disagrees is a warning, not a second registry.
- 1.x route names count, as the runtime counts them.
I10A1_UsersOnrampSftp reports KLK010 when it runs, so it is
checked as KLK010, with klok-quarkus-extension's LEGACY pattern copied into RouteId. A legacy name without a known
tenant short code is a warning: guessing the code would check the wrong number.
- Strict in CI, lenient on a laptop, as the topic check. A registry that cannot be read fails a CI build and only
warns locally; whether a failed check blocks a pipeline is the CI template's choice (
KLOK_SOLUTION_CHECK), so projects
can be brought in line in report mode first.
Tenant and domain come from the keys the service reads
Decided 2026-10-08. The payload took its domain from klok { domain }, whose default is the placeholder
default-domain, while the service names its topics from klok.domain in application.properties; and the scan's
env input was wired to the domain by mistake. The topics a build lists must be the ones the service uses, so
klokTopics reads klok.tenant and klok.domain (a %prod. key first), and the payload uses them whenever the build
does not set its own. A value set in klok { } still wins in the payload, so no existing payload changes meaning.
Topics are resolved like the framework does, and unknown is empty
Decided 2026-10-06. consumesTopics and publishesTopics were in the payload from the start but never filled, so
klok.dev derived topics from the pattern and configKeys[] and missed every purpose set in code (KLK003E1_ChatWorker
consumes KlokAiTaskRequestV1_ai.chat, which the portal showed as KlokAiTaskRequestV1). The scan now fills them with
the framework's own rules: the configuration first, then the purpose method when Spoon can read its value, else none.
Three choices:
- Simple names, not full topics. Tenant, environment and domain are decided when the route runs, and the receiver
knows the project's tenant and domain; a full name in the payload would be right in one environment only.
- klok-common's naming, not string concatenation. The scan uses
KlokNamingConventions, the functions the framework's
KlokTopicResolver uses, so a change of the convention reaches both. The plugin depends on klok-common directly for its
String overloads; the broker client brings an older version that only takes classes.
- No name rather than a wrong one. A purpose the scan cannot evaluate leaves that direction empty and is logged. A
guessed
<Model> without the purpose would point the portal at a topic nobody reads, which is worse than a gap the
broker's own statistics can fill. The datamodel was not changed, so an empty list means "none or unknown".
The plugin takes its Klok dependencies from the catalog
The plugin is the code that reads the dependency catalog, which looked like a reason to pin its own dependencies by
hand: it seemed to need a released version of itself to read the catalog it is in. It does, and that is fine. The last
release is on Maven Central, and the build applies it with apply false, only to get its UpdateKlokLibsTomlTask.
What was wrong with pins. A release of klok-common or of the documentation datamodel never reached the plugin by
itself. On 2026-11-03 the plugin was four releases behind on klok-project-documentation-v1, so the field mcpTool,
added on 2026-10-27, could not be sent by any producer, and it took a merge request per raise.
What was weighed:
| Option |
Why not, or why |
Keep the pins, and have release-dependents open a merge request that raises them |
A merge request per release in a repository that has nothing to review; every other library needs no such thing. |
Port the catalog copy into the plugin's own build.gradle as a script |
A second implementation of the same bytes, against the rule that one tool writes them. |
| Depend on klok-cli to write the copy |
Tools are peers: the plugin never depends on klok-cli. |
The released plugin's task, apply false (chosen) |
The bytes come from the code every project uses. The cost is one bootstrapping step: a broken plugin release that cannot refresh a copy is repaired by the release after it, or by writing the file by hand, as in any project. |
The invariants. build.gradle holds no literal Klok version (BuildScriptCatalogGuardTest fails on one), and
-PklokCommonVersion and -PklokBrokerclientVersion still build against another version, for example one in
mavenLocal. Everything on these dependencies ends up on every project's build classpath (klok-gradle-plugin#11).
What was tested. On 2026-11-04 a local build with the committed copy resolved klok-common 0.3.5+261013111836,
klok-brokerclient-java 0.3.13+261104012039 and klok-project-documentation-v1 1.0.0-build.261027110002, and the whole
test suite passed against them, in the pipeline's order: updateKlokLibsToml in one Gradle run, then the build in
another, because the catalog is read at settings time.
klokTopics names the log events topic from the project's own extension version
klok-quarkus-extension publishes log events on KlokLogEventV4 before 3.17.0 and on KlokLogEventV6 from 3.17.0
(klok/framework/klok-quarkus-extension!62; klok-common's Log fields and correlation documentation page). klokTopics
has to list the one the deployed service actually uses, or klokTopicCheck and the tenant's Pulsar file would be
checked and provisioned against the wrong name.
Where the version comes from. The scan that builds the topic listing reads Java sources and
application.properties; neither says which extension a project depends on. The version catalogs the build already
reads for updateKlokLibsToml and the documentation payload's klokDocs.versionFrom = 'catalog'
(DocumentedVersion.fromCatalog) do: every build declares klokQuarkusExtension in klok-libs.versions.toml (kept
current by the weekly fleet job) when it applies the extension, so klokTopics reads the same
dev.klok.framework:klok-quarkus-extension module version from the build's version catalogs
(KlokPlugin.catalogModuleVersions) instead of adding a second way to learn it.
Unknown defaults to the newer datamodel, with a warning. A project whose catalogs name no klokQuarkusExtension
library (one that does not apply klok-gradle-plugin's catalogs, or whose catalog has not been refreshed yet) could be
read either way: still on the old extension, or on a build setup the scan has not seen before. KlokLogEventV6 is the
one every Klok service will run with once klok-quarkus-extension!62 ships and the fleet is rebuilt, so listing it, with
a warning that says why, fails safe towards the direction the platform is moving in rather than silently keeping a
datamodel that stops being readable (klok-egress-opensearch's KlokLogEventV4 receiver is removed once the fleet no
longer publishes it; klok-common#12).