@klok-integration/cli 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -43,6 +43,8 @@ Credentials are written to `~/.config/klok/credentials.json` with mode 0600.
43
43
  | `klok agents init` | Write the Klok agent instructions and skills into a repository. |
44
44
  | `klok bead list\|show\|report` | Progress beads in the current repository. |
45
45
  | `klok docs publish` | Build this repository's znai documentation and upload it to the docs portal. |
46
+ | `klok solutions validate` | Check the descriptors of an integration solution registry against the descriptor contract. |
47
+ | `klok ci env` | Show what klok-cli detected about the CI job it runs in. |
46
48
  | `klok manifest update` | Set a container's image in a deploy manifest of your GitOps repository, then commit and push. |
47
49
  | `klok sync clone\|pull\|status` | Clone and refresh every repository you can see, in one workspace folder. |
48
50
 
@@ -93,8 +95,8 @@ Cursor (`.cursor/mcp.json`):
93
95
  ## Agent instructions
94
96
 
95
97
  `klok agents init` writes `KLOK-AGENTS.md` with the rules, one managed row in every harness file
96
- (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `.cursorrules`, `.clinerules`,
97
- `.github/copilot-instructions.md`), the klok named rule files (`.cursor/rules`, `.agents/rules`) and the
98
+ (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `.cursorrules`, `.clinerules` or a file inside a
99
+ `.clinerules/` directory, `.github/copilot-instructions.md`), the klok named rule files (`.cursor/rules`, `.agents/rules`) and the
98
100
  Klok skills. `KLOK-AGENTS.md`, the klok rule files and the `klok-*` skills belong to Klok and are
99
101
  replaced wholesale; every other file keeps its content and only has its single row created or replaced,
100
102
  so an update can never duplicate text. Klok skills the CLI no longer ships are removed.
@@ -10,12 +10,16 @@ https://docs.klok.dev/klok-environment-build-ci-templates/llm.txt for the pipeli
10
10
  * One root element `<Name>_vN` that references every complex type; a single `xs:` prefix; `targetNamespace` and
11
11
  `xmlns:tns` set; `elementFormDefault="qualified"`. Validate with the XSD validation of the CI template before
12
12
  pushing (`python3 scripts/validate-xsd.py` from build-ci-templates, or the pipeline's `generate_avro_from_xsd`).
13
- * The major version is part of the model name (`Customer_v1`, class `CustomerV1`); a breaking change is a new
14
- major version and a new topic, never a silent change of an existing one.
13
+ * One name, in kebab case, from the repository down: `customer-v1` is the repository, the XSD file
14
+ (`customer-v1.xsd`), the Maven artifact and the npm and Python packages, and `customer_v1` ends the Java package.
15
+ Inside the XSD the model keeps its PascalCase form: root element `Customer_v1`, root type and class `CustomerV1`.
16
+ * The major version is part of the model name; a breaking change is a new major version and a new topic, never a
17
+ silent change of an existing one.
15
18
  * `meta.json` uses the flat form with `targetNamespace`; it drives the generated project's group, name and
16
19
  documentation.
17
20
  * Consumers reference the artifact only through the catalog alias (`klokLibs.<key>`), never by literal version.
18
21
  * Datamodel documentation lives in `klok-docs/` (purpose, fields that need explanation, producers and consumers,
19
- design decisions) and is mirrored to the documentation project.
22
+ design decisions). Datamodel projects publish no documentation payload yet, because the datamodel template runs
23
+ no Klok Gradle task, so these pages do not reach docs.klok.dev until it does; write them anyway.
20
24
  * On `main` the pipeline publishes and updates the catalog; check it, then refresh consumers with
21
25
  `./gradlew updateKlokLibsToml`.
@@ -1,15 +1,25 @@
1
1
  ## This repository: documentation project
2
2
 
3
3
  A znai documentation project published to https://docs.klok.dev under the doc id in `klok-docs-sync.json`. Read
4
- https://docs.klok.dev/klok-environment-build-ci-templates/llm.txt (docs sync) for how content arrives here.
4
+ https://docs.klok.dev/klok-environment-build-ci-templates/llm.txt (documentation from a source repository) for how
5
+ content arrives here. There are two kinds, and they are edited differently:
6
+
7
+ * **The documentation project of a source repository** (`<tenant>/documentation/<group>/.../<repo>`, mirroring the
8
+ source path) is output. KlokDocumentationEgress (`klok/integration/klok-documentation-egress`, KLK007) builds it
9
+ from the `KlokProjectDocumentationV1` payload the source repository's `main` pipeline publishes, replaces
10
+ everything under `docs/` on every run and commits the AI sections under `docs/_ai/`. Never edit it: a change made
11
+ here is overwritten by the next run. There are exactly two places to change it:
12
+ * `klok-docs/` in the source repository, in a merge request there: the hand written pages, their order and
13
+ chapter titles (`toc-manifest.json`), and where an AI section appears (`<!-- KLOK:GENERATED:START <id> -->` …
14
+ `<!-- KLOK:GENERATED:END <id> -->`);
15
+ * what is generated and how (chapters, sections, prompts, languages, model): klok.dev, Tenant Administration,
16
+ Documentation generation, which tenant admins change.
17
+ * **A standalone documentation project** (directly under `<tenant>/documentation/`, such as
18
+ `klok-integration-strategy-and-tactics`) is written by hand in this repository, and the egress never touches it.
19
+ Keep `docs/toc` and `docs/toc-manifest.json` in sync when adding a page.
5
20
 
6
21
  ### Rules
7
22
 
8
- * `docs/klok-docs/` and `docs/generated/` are written by the docs sync of the source repository. Never edit them
9
- here; change `klok-docs/` in the source repository, or the generator. Only `KLOK:GENERATED` regions of AI
10
- maintained pages are rewritten automatically.
11
- * Human pages live in `docs/` next to them (`overview`, `architecture`, `operations`, `changelog`); keep
12
- `docs/toc` and `docs/toc-manifest.json` in sync when adding a page.
13
23
  * The doc id must start with the tenant prefix (`<tenant>-...`); the pipeline refuses others. Do not set the
14
24
  tenant, the Vault path or upload tokens in the project CI. This project's `.gitlab-ci.yml` is the include of
15
25
  `klok/environment/build-ci-templates:/klok-docs-publish.yml` and nothing else; the job is `klok docs publish`.
@@ -30,7 +30,8 @@ needs. Read https://docs.klok.dev/klok-framework-klok-quarkus-extension/llm.txt
30
30
  * `application.properties` keeps every `klok.*` key explicit; secrets come from environment variables that the
31
31
  Vault env secret provides in Kubernetes (`KLOK_BROKER_AUTH_CLIENT_ID`, ...).
32
32
  * Update `klok-docs/` (overview, design decisions, routes, operations) in the same merge request as the change.
33
- * On `main` the pipeline builds the image, updates the deployment manifest and syncs the documentation; check it.
33
+ * On `main` the pipeline builds the image, updates the deployment manifest and publishes the documentation payload
34
+ that KlokDocumentationEgress turns into the documentation project; check it.
34
35
  * The `Dockerfile` copies `build/quarkus-app/lib/` in a `COPY` of its own before `quarkus-run.jar`, `quarkus/`
35
36
  and `app/`, all with `COPY --chown`, never `COPY build/quarkus-app/ .` followed by `RUN chown -R`, which stores
36
37
  every dependency twice in every build.
@@ -19,6 +19,9 @@ content as one markdown file at `https://docs.klok.dev/<doc-id>/llm.txt`; fetch
19
19
  | Broker client | https://docs.klok.dev/klok-framework-klok-brokerclient-java/llm.txt |
20
20
  | Gradle plugin, versions, catalog | https://docs.klok.dev/klok-framework-klok-gradle-plugin/llm.txt |
21
21
  | CI templates, release process, Vault roles | https://docs.klok.dev/klok-environment-build-ci-templates/llm.txt |
22
+ | Developer rules: identity and access, Keycloak, Vault paths, certificates, infrastructure as code | https://docs.klok.dev/klok-framework-development-guide/llm.txt |
23
+ | How people use the platform: concepts, roles and access, workflow, operations | https://docs.klok.dev/klok-user-guide/llm.txt |
24
+ | Infrastructure: stateful services, certificates, Ansible, Keycloak clients | https://docs.klok.dev/klok-environment-klok-environment-setup/llm.txt |
22
25
 
23
26
  A 404 means the documentation project is not published yet; read the repository's `klok-docs/` folder instead.
24
27
  The `klok-docs` skill describes the lookup in detail.
@@ -154,10 +157,15 @@ step by step procedure; the contract every agent follows is:
154
157
 
155
158
  Klok documentation has three levels, and a change is finished only when all three have been considered:
156
159
 
157
- * **The repository's own `klok-docs/`** (znai markdown, `toc-manifest.json`), which KlokDocumentationEgress merges
158
- with the pages it generates from the code into the repository's documentation project on every `main` pipeline.
159
- That documentation project is output: never edit it; what is generated is set by tenant admins in klok.dev. A change that adds or alters a route, a datamodel, a configuration key, a
160
- CI job, a command or a decision updates `klok-docs/` in the same merge request.
160
+ * **The repository's own `klok-docs/`** (znai markdown, `toc-manifest.json`). On every `main` pipeline
161
+ `./gradlew publishKlokDocs` publishes it, together with the scan of the code, as `KlokProjectDocumentationV1` on
162
+ `persistent://klok[_<env>]/common/KlokProjectDocumentationV1_prepared`. KlokDocumentationEgress
163
+ (`klok/integration/klok-documentation-egress`, KLK007) builds the repository's documentation project from it. That
164
+ documentation project is output, and nobody edits it. There are two places to change a project's documentation:
165
+ `klok-docs/` in the source repository (including the `KLOK:GENERATED` markers that place AI sections in a page),
166
+ and the documentation generation settings in klok.dev, which tenant admins own. A change that adds or alters a
167
+ route, a datamodel, a configuration key, a CI job, a command or a decision updates `klok-docs/` in the same merge
168
+ request.
161
169
 
162
170
  `klok-docs/` has to answer **two different questions**, and a repository that answers only the first is not
163
171
  documented:
@@ -180,8 +188,9 @@ Klok documentation has three levels, and a change is finished only when all thre
180
188
  and tactics (`klok-integration-strategy-and-tactics`) and the framework, CI and tooling documentation. They
181
189
  describe how the platform is used and why. A change that alters a rule, a convention, a workflow, a command or
182
190
  a published contract belongs there too, even when the code that changed lives somewhere else entirely.
183
- * **Generated pages** (`docs/generated/`, `KLOK:GENERATED` regions), which are never edited by hand. A wrong
184
- generated page is a bug in the generator.
191
+ * **Generated pages**: everything KlokDocumentationEgress writes into a documentation project, including the AI
192
+ sections that fill `KLOK:GENERATED` regions. They are never edited by hand. A wrong generated page is fixed in
193
+ the egress or in the documentation generation settings in klok.dev.
185
194
 
186
195
  ### Before the merge request
187
196
 
@@ -194,8 +203,8 @@ Klok documentation has three levels, and a change is finished only when all thre
194
203
  3. Correct what you can judge yourself. A central page that is now plainly wrong is fixed in its own small merge
195
204
  request against that documentation project, linked from the change. What you cannot judge is written down
196
205
  rather than dropped.
197
- 4. Write the merge request description for two readers: the reviewer, and the documentation flow that runs after
198
- the merge. State what changed, why, and which documentation it affects or might affect. A description that
206
+ 4. Write the merge request description for the reviewer: state what changed, why, and which documentation it
207
+ affects or might affect. A description that
199
208
  says only "fixes the build" produces no documentation update.
200
209
 
201
210
  ### After the merge
@@ -11,8 +11,10 @@ https://docs.klok.dev/klok-environment-build-ci-templates/llm.txt (datamodel pip
11
11
  ## Creating or changing a model
12
12
 
13
13
  1. The model lives in its own repository `<tenant>/datamodel/<common|public|domain/<d>|system/<s>>/<name>-v<n>`,
14
- where the repository name is the model name in kebab case (`supplier-invoice-v1`); the XSD file inside keeps
15
- the PascalCase form (`SupplierInvoice_v1.xsd`).
14
+ where the repository name is the model name in kebab case (`supplier-invoice-v1`). The XSD file has the same
15
+ name (`supplier-invoice-v1.xsd`), and so do the Maven artifact and the npm and Python packages; the Java package
16
+ ends in `supplier_invoice_v1`. Inside the XSD the model keeps its PascalCase form: root element
17
+ `SupplierInvoice_v1`, root type `SupplierInvoiceV1`.
16
18
 
17
19
  **Create it through klok.dev, or through the agent at https://agent.klok.dev** authenticated as the tenant
18
20
  with the right to create projects in the domain. That is the supported path: it creates the repository from
@@ -45,7 +47,8 @@ https://docs.klok.dev/klok-environment-build-ci-templates/llm.txt (datamodel pip
45
47
 
46
48
  * Run `./gradlew updateKlokLibsToml` in the consumer, commit the refreshed `gradle/klok-libs.versions.toml`, and
47
49
  reference the alias (`klokLibs.klokOdlV1` or the bundle). Never type a version.
48
- * The generated class is `dev.klok.<tenant>.datamodel.<group>.<name>_v<n>.<Name>Vn`; the ODL type of an object is
49
- the fully qualified class name.
50
+ * The generated class is `dev.klok.<tenant>.datamodel.<group>.<name_with_underscores>_v<n>.<Name>Vn` (for
51
+ `klok-task-event-v1`: `dev.klok.klok.datamodel.common.klok_task_event_v1.KlokTaskStatusEventV1`); the ODL type of an object is the
52
+ fully qualified class name, so moving a class to another package is a data migration of its ODL index.
50
53
  * The topic for the model is derived from the class (`persistent://<tenant>[_<env>]/<domain>/<Name>Vn`); do not
51
54
  invent topic strings.
@@ -30,7 +30,7 @@ drops the `klok-` prefix of the name (`klok-integration-strategy-and-tactics`).
30
30
  | Naming conventions, `klok-*` properties, CloudEvents attributes | `klok-framework-klok-common` |
31
31
  | Broker client configuration, subscriptions, request/reply | `klok-framework-klok-brokerclient-java` |
32
32
  | Gradle plugin, versions, catalog refresh | `klok-framework-klok-gradle-plugin` |
33
- | CI templates, release process, Vault roles, docs sync, catalog update | `klok-environment-build-ci-templates` |
33
+ | CI templates, release process, Vault roles, documentation chain, catalog update | `klok-environment-build-ci-templates` |
34
34
  | ODL REST and request/reply, tasks API | `klok-integration-klok-api-opensearch` |
35
35
  | ODL writers, log receivers | `klok-integration-klok-egress-opensearch` |
36
36
  | Scheduled queries, stale task detection | `klok-integration-klok-ingress-opensearch` |