@klok-integration/cli 0.2.0 → 0.3.2

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,7 @@ 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 manifest update` | Set a container's image in a deploy manifest of your GitOps repository, then commit and push. |
46
47
  | `klok sync clone\|pull\|status` | Clone and refresh every repository you can see, in one workspace folder. |
47
48
 
48
49
  Global flags: `--json`, `--no-tui`, `--stream`, `--tenant <slug>`, `--domain <slug>`,
@@ -403,29 +403,7 @@ THE SOFTWARE.
403
403
 
404
404
  Licence: MIT — https://github.com/TehShrike/deepmerge
405
405
 
406
- ```
407
- The MIT License (MIT)
408
-
409
- Copyright (c) 2012 James Halliday, Josh Duff, and other contributors
410
-
411
- Permission is hereby granted, free of charge, to any person obtaining a copy
412
- of this software and associated documentation files (the "Software"), to deal
413
- in the Software without restriction, including without limitation the rights
414
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
415
- copies of the Software, and to permit persons to whom the Software is
416
- furnished to do so, subject to the following conditions:
417
-
418
- The above copyright notice and this permission notice shall be included in
419
- all copies or substantial portions of the Software.
420
-
421
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
422
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
423
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
424
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
425
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
426
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
427
- THE SOFTWARE.
428
- ```
406
+ _No licence file shipped with the package; see the project homepage._
429
407
 
430
408
  ## default-browser@5.5.1
431
409
 
@@ -1221,6 +1199,26 @@ The above copyright notice and this permission notice shall be included in all c
1221
1199
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1222
1200
  ```
1223
1201
 
1202
+ ## yaml@2.9.1
1203
+
1204
+ Licence: ISC — https://eemeli.org/yaml/
1205
+
1206
+ ```
1207
+ Copyright Eemeli Aro <eemeli@gmail.com>
1208
+
1209
+ Permission to use, copy, modify, and/or distribute this software for any purpose
1210
+ with or without fee is hereby granted, provided that the above copyright notice
1211
+ and this permission notice appear in all copies.
1212
+
1213
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1214
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
1215
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1216
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
1217
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
1218
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
1219
+ THIS SOFTWARE.
1220
+ ```
1221
+
1224
1222
  ## yoga-layout@3.2.1
1225
1223
 
1226
1224
  Licence: MIT — https://yogalayout.dev/
@@ -14,4 +14,8 @@ repository's own `README.md` and `docs/` for its architecture.
14
14
  * Tenant, domain and role separation is enforced on the server side; never rely on the UI hiding something.
15
15
  * Secrets and environment configuration come from the Vault env secret of the deployment, never from committed
16
16
  files.
17
+ * Each image is built by a job that includes `klok-image-build.yml` from `klok/environment/build-ci-templates` and
18
+ `extends: .klok_image_build`, never by a copied kaniko or Docker job. In the Dockerfile, production dependencies,
19
+ `public/` or other assets, and the build output are separate `COPY --chown` layers; large data such as model
20
+ weights stays out of the image or gets a layer of its own.
17
21
  * Update `klok-docs/` (or `docs/`) with every change of behaviour, API or configuration.
@@ -15,5 +15,5 @@ https://docs.klok.dev/klok-environment-build-ci-templates/llm.txt (docs sync) fo
15
15
  `klok/environment/build-ci-templates:/klok-docs-publish.yml` and nothing else; the job is `klok docs publish`.
16
16
  * Visibility follows `meta.json` `scope` (`global`, `tenant`, `domain`, `system`); a page that must not be seen by
17
17
  another domain belongs in a project with that scope, not behind a note.
18
- * Preview locally with `znai --source-root docs --preview`, and check what a publish would do with
18
+ * Preview locally with `znai preview --source=docs`, and check what a publish would do with
19
19
  `klok docs publish --dry-run`; the `llm.txt` the build generates is what agents read.
@@ -31,3 +31,6 @@ needs. Read https://docs.klok.dev/klok-framework-klok-quarkus-extension/llm.txt
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
33
  * On `main` the pipeline builds the image, updates the deployment manifest and syncs the documentation; check it.
34
+ * The `Dockerfile` copies `build/quarkus-app/lib/` in a `COPY` of its own before `quarkus-run.jar`, `quarkus/`
35
+ and `app/`, all with `COPY --chown`, never `COPY build/quarkus-app/ .` followed by `RUN chown -R`, which stores
36
+ every dependency twice in every build.
@@ -98,6 +98,13 @@ step by step procedure; the contract every agent follows is:
98
98
  * After every push to git.klok.dev, check the pipeline (`glab api "projects/<id>/pipelines?per_page=3"`, job traces)
99
99
  and fix failures before moving on. Publishing, image pushes, manifest updates and catalog updates only happen on
100
100
  `main`; merge request pipelines build and test.
101
+ * Container images are built without privileges, always. Every image job extends `.klok_image_build` from
102
+ `klok/environment/build-ci-templates` (`klok-image-build.yml`): kaniko in an ordinary container, reproducible
103
+ layers, no layer cache, push from `main` only. Never use or propose a privileged runner, `docker:dind`, or a
104
+ relaxed seccomp or AppArmor profile. A Dockerfile copies dependencies, assets and application code as separate
105
+ `COPY` layers and sets owners with `COPY --chown`, never `RUN chown -R`, so that a build stores only what
106
+ changed. Read the *Container images* page of https://docs.klok.dev/klok-environment-build-ci-templates/llm.txt
107
+ before changing a Dockerfile or an image job.
101
108
  * Vault (`vault.ipaas.se`) is changed by a human only. Agents may read to diagnose and must then propose the exact
102
109
  command, including every existing field of the object.
103
110
  * New projects are created through klok.dev, or through the agent at https://agent.klok.dev authenticated as the
@@ -148,6 +155,24 @@ Klok documentation has three levels, and a change is finished only when all thre
148
155
  * **The repository's own `klok-docs/`** (znai markdown, `toc-manifest.json`), which the CI mirrors into the
149
156
  repository's documentation project. A change that adds or alters a route, a datamodel, a configuration key, a
150
157
  CI job, a command or a decision updates `klok-docs/` in the same merge request.
158
+
159
+ `klok-docs/` has to answer **two different questions**, and a repository that answers only the first is not
160
+ documented:
161
+
162
+ 1. **Why it is built this way.** The design decisions, what was weighed against what, and the invariants that
163
+ must not be broken. This is the kind everyone remembers to write.
164
+ 2. **How each role is meant to use it.** One guide per audience the product actually has — for a ticketing
165
+ product that is platform administrator, organizer, exhibitor and buyer; for an integration it may be the
166
+ operator and the consuming team. Write it as a walk through the real flow, naming the pages and commands a
167
+ person will actually touch. This is the kind that gets forgotten, and it is the kind a new colleague reads
168
+ first.
169
+
170
+ Write both **as the work happens**, not at the end of the branch. By the end nobody remembers why a choice was
171
+ made, and a guide written from memory describes the product somebody meant to build.
172
+
173
+ Keep `klok-docs/` as the single copy. Do not mirror a page into a second `docs/` folder: two copies of one page
174
+ are two pages that quietly stop agreeing. `docs/` may hold what is genuinely not product documentation, such as
175
+ a strategy document that predates the code.
151
176
  * **The platform documentation** under `<tenant>/documentation/`: the user guide (`klok-user-guide`), strategy
152
177
  and tactics (`klok-integration-strategy-and-tactics`) and the framework, CI and tooling documentation. They
153
178
  describe how the platform is used and why. A change that alters a rule, a convention, a workflow, a command or
@@ -157,8 +182,9 @@ Klok documentation has three levels, and a change is finished only when all thre
157
182
 
158
183
  ### Before the merge request
159
184
 
160
- 1. Update the repository's `klok-docs/` in the same merge request as the change. Documentation that is promised
161
- for a later merge request is documentation that never arrives.
185
+ 1. Update the repository's `klok-docs/` in the same merge request as the change — ideally in the same commit as
186
+ the code it describes. Documentation that is promised for a later merge request is documentation that never
187
+ arrives, and a final "docs" commit at the end of a branch is the same promise wearing a hat.
162
188
  2. Ask what a reader of the platform documentation would now find wrong: a renamed command, a new rule, a changed
163
189
  default, a workflow with one more step. Read the affected pages (`https://docs.klok.dev/<doc-id>/llm.txt`)
164
190
  instead of guessing what they say.