repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

docs(luci): source current machine reference

f6252f20d93908bb00ee3115151869c38237243f

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (1)

pi/agent/skills/luci-ci/SKILL.md

Modified
2 2 name: luci-ci
3 -description: "Create, edit, review, or diagnose Luci CI configuration for ci.bugabinga.net. Use for .ci/*.kdl files, Luci jobs/triggers/matrices/secrets, failed or missing runs, run status, and CI logs."
3 +description: "Create, edit, review, or diagnose Luci CI configuration for ci.bugabinga.net. Use for .ci/*.kdl files, failed or missing runs, run status, logs, caches, publishing, schedules, and push path filters."
6 6 # Luci CI
8 -Work only on repository config and run diagnostics.
8 +Before configuring or diagnosing Luci, fetch the current machine reference:
10 +```text
11 +https://ci.bugabinga.net/llms.txt
12 +```
14 +Treat that response as authoritative for grammar, behavior, CLI, routes,
15 +and security constraints.
16 +If it cannot be fetched, report the failure and inspect the current
17 +`bugabinga.net/services/luci` source when available; do not guess syntax or
18 +reuse remembered fields.
19 +The human reference is `https://ci.bugabinga.net/docs`.
21 +Work only on repository configuration and run diagnostics.
9 22 Do not modify Luci infrastructure or implementation unless explicitly asked.
11 -## Configure a repository
13 -1. Read repository instructions and every direct `.ci/*.kdl` file.
14 -2. Find the repository's canonical CI command or task.
15 -3. Keep Luci orchestration thin: select an image, prepare required tooling,
16 - then call that canonical command.
17 -4. Edit the minimum config.
18 -5. Run the exact delegated command locally when possible.
19 -6. Re-read the final KDL against the grammar below.
21 -Luci reads only direct `.ci/*.kdl` files at the selected commit.
22 -Files are lexical; jobs retain file then declaration order.
23 -Only `job` is valid at top level; duplicate job names across files fail the run.
25 -## Complete current grammar
27 -```kdl
28 -job "ci" {
29 - image "docker.io/library/node:24-alpine"
31 - trigger {
32 - push true
33 - branch "trunk"
34 - tag "v*"
35 - }
37 - matrix {
38 - node "22" "24"
39 - mode "debug" "release"
40 - }
42 - secret "TOKEN" env="SERVICE_TOKEN"
43 - secret "SIGNING_KEY" file=".secrets/signing-key"
45 - run "install-project-tools"
46 - run "CI=true run-project-ci"
48 -```
50 -A job requires exactly one useful `image` and at least one `run`.
51 -Supported job children are only:
53 -- `image "..."`
54 -- `run "..."`, repeatable
55 -- `trigger { ... }`
56 -- `matrix { ... }`
57 -- `secret "name" env="NAME"`
58 -- `secret "name" file="workspace/relative/path"`
60 -Unknown nodes fail parsing.
61 -**Do not add `cache`, `publish`, `artifact`, generic `env`, service containers,
62 -host mounts, or per-job resource fields. They are not implemented.**
64 -All `run` strings are joined with `&&` and executed once through `/bin/sh -c`.
65 -Order matters; shell state such as `export` survives into later `run` strings.
66 -The image must contain `/bin/sh` or provide it through setup.
68 -### Triggers
70 -`push true` is the default.
71 -With no branch/tag filters, the job matches all pushed branches and tags.
72 -Branch-only filters exclude tags; tag-only filters exclude branches.
73 -If both exist, each applies to its own ref kind.
74 -Patterns are path globs; `*` does not cross `/`.
75 -`push false` disables automatic runs but keeps manual runs available.
76 -Manual runs require the named job at the selected ref/revision and ignore push filters.
78 -### Matrix
80 -Axes and values expand as a deterministic cartesian product in declaration order.
81 -`${axis}` interpolation works only in `image` and `run` strings.
82 -Each child also receives `CI_MATRIX_<UPPERCASE_AXIS>`.
83 -Do not assume revision, ref, repository, or other CI environment variables exist.
85 -### Secrets
87 -Secret values are operator-managed outside Git under:
89 -```text
90 -/data/ci/secrets/<repo>/<job>/<secret-name>
91 -```
93 -Use exactly one of `env=` or `file=` per secret.
94 -Keep file targets workspace-relative.
95 -Missing secrets fail before container execution.
96 -Never print secrets: repositories, run logs, and artifacts are public,
97 -child containers have network access, and log masking is not implemented.
99 -## Execution facts that affect config
101 -Jobs and matrix children run sequentially.
102 -The first failed child fails the parent and marks remaining children skipped.
103 -Each child gets a clean checkout and a default 20-minute timeout,
104 -2 GiB memory, and 2 CPUs.
105 -Images pull when missing; containers have network access,
106 -no added capabilities, and no Podman socket.
108 -A push selecting zero jobs records a zero-duration successful parent.
109 -Therefore success without children does not prove checks ran.
111 -## Diagnose runs
113 -Start at `https://ci.bugabinga.net/`.
114 -Filter by repository/job or use `?all=1`.
115 -Match the seven-character revision before diagnosing a run.
117 -Routes:
119 -```text
120 -/ dashboard
121 -/repos/<repo> all runs for one repository
122 -/runs/<run-id> parent, children, details, last 256 KiB logs
123 -/runs/<run-id>/logs/<child-id> complete plain-text child log
124 -/docs compact live usage reference
125 -```
127 -Read failures in this order:
129 -1. Parent `detail`: repo/ref resolution and KDL/config errors may create
130 - no child and no log.
131 -2. Child `detail`: execution-level cause and status.
132 -3. Embedded log tail: usually enough for the final failing command.
133 -4. Raw child log: search backward for the first meaningful error;
134 - final `exit status 1` is only the summary.
136 -Status meanings:
138 -- `queued`: inbox event waiting.
139 -- `preparing`: claimed; revision/config/plan being resolved.
140 -- `running`: one child executing.
141 -- `success`: parent completed without a failed child, including a zero-child plan.
142 -- `failed`: preflight, child, persistence, or interrupted-run failure.
143 -- `skipped`: child not started after an earlier child failed.
145 -Repository health uses the latest completed parent.
146 -Queued/running work does not clear an existing failure;
147 -a later successful parent does.
149 -Common diagnoses:
151 -- No run after push: check public repo visibility, pushed ref, polling delay,
152 - and trigger match.
153 -- Success in `0s`, no children: config is absent at that revision,
154 - or no job matched the pushed ref.
155 -- Failed parent, no children: read parent detail for invalid KDL,
156 - duplicate/missing job, unsafe repo/ref, or missing image/run.
157 -- Manual job not found: check job name and config at the exact ref/revision.
158 -- Failed child: read child detail, embedded tail, then raw log.
159 -- Remaining children skipped: the earlier failed child is the root failure.
161 -## Manual runs
23 +Keep orchestration thin and delegate to the repository's canonical CI command.
24 +Read repository instructions and every direct `.ci/*.kdl` file before editing.
25 +Run the delegated command locally when possible.
163 27 Oliver's Nushell wrapper is:
166 30 def ci [...args] { ssh -p 2223 root@ci.bugabinga.net ...$args }
169 -Use exactly one selector:
171 -```nu
172 -ci run <repo> <job> --ref <ref>
173 -ci run <repo> <job> --rev <commit>
174 -```
176 -The command prints the accepted run ID.
177 -Use `/runs/<run-id>` to follow it.
178 -Manual runs mutate CI state; do not submit or rerun without explicit approval.
179 -Config changes take effect only after the selected commit reaches the public repository.
181 -If observed behavior contradicts this skill,
182 -inspect current `bugabinga.net/services/luci/internal/ciconfig` source
183 -and live run detail.
184 -Do not guess or use designed-but-unimplemented fields.
33 +Status, repository, run-detail, log, and docs commands are read-only.
34 +Manual submissions and reruns mutate public CI state; do not execute them
35 +without explicit approval.
36 +Configuration changes take effect only after the selected commit reaches the
37 +public repository.
38 +Never claim a revision ran or deployed without matching live run evidence.