feat(pi): add Luci CI skill
1dc5978a0dffc89fa6e0a5da3e69584aa8f92157
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
- Parent 1: 61f13cbf56ee
bugabingas dorkfiles
1dc5978a0dffc89fa6e0a5da3e69584aa8f92157
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
+184 / −0 text lines
new file mode 100644+184 / −0 text lines
---name: luci-cidescription: "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."---# Luci CIWork only on repository config and run diagnostics.Do not modify Luci infrastructure or implementation unless explicitly asked.## Configure a repository1. Read repository instructions and every direct `.ci/*.kdl` file.2. Find the repository's canonical CI command or task.3. Keep Luci orchestration thin: select an image, prepare required tooling, then call that canonical command.4. Edit the minimum config.5. Run the exact delegated command locally when possible.6. Re-read the final KDL against the grammar below.Luci reads only direct `.ci/*.kdl` files at the selected commit.Files are lexical; jobs retain file then declaration order.Only `job` is valid at top level; duplicate job names across files fail the run.## Complete current grammar```kdljob "ci" { image "docker.io/library/node:24-alpine" trigger { push true branch "trunk" tag "v*" } matrix { node "22" "24" mode "debug" "release" } secret "TOKEN" env="SERVICE_TOKEN" secret "SIGNING_KEY" file=".secrets/signing-key" run "install-project-tools" run "CI=true run-project-ci"}```A job requires exactly one useful `image` and at least one `run`.Supported job children are only:- `image "..."`- `run "..."`, repeatable- `trigger { ... }`- `matrix { ... }`- `secret "name" env="NAME"`- `secret "name" file="workspace/relative/path"`Unknown nodes fail parsing.**Do not add `cache`, `publish`, `artifact`, generic `env`, service containers,host mounts, or per-job resource fields. They are not implemented.**All `run` strings are joined with `&&` and executed once through `/bin/sh -c`.Order matters; shell state such as `export` survives into later `run` strings.The image must contain `/bin/sh` or provide it through setup.### Triggers`push true` is the default.With no branch/tag filters, the job matches all pushed branches and tags.Branch-only filters exclude tags; tag-only filters exclude branches.If both exist, each applies to its own ref kind.Patterns are path globs; `*` does not cross `/`.`push false` disables automatic runs but keeps manual runs available.Manual runs require the named job at the selected ref/revision and ignore push filters.### MatrixAxes and values expand as a deterministic cartesian product in declaration order.`${axis}` interpolation works only in `image` and `run` strings.Each child also receives `CI_MATRIX_<UPPERCASE_AXIS>`.Do not assume revision, ref, repository, or other CI environment variables exist.### SecretsSecret values are operator-managed outside Git under:```text/data/ci/secrets/<repo>/<job>/<secret-name>```Use exactly one of `env=` or `file=` per secret.Keep file targets workspace-relative.Missing secrets fail before container execution.Never print secrets: repositories, run logs, and artifacts are public,child containers have network access, and log masking is not implemented.## Execution facts that affect configJobs and matrix children run sequentially.The first failed child fails the parent and marks remaining children skipped.Each child gets a clean checkout and a default 20-minute timeout,2 GiB memory, and 2 CPUs.Images pull when missing; containers have network access,no added capabilities, and no Podman socket.A push selecting zero jobs records a zero-duration successful parent.Therefore success without children does not prove checks ran.## Diagnose runsStart at `https://ci.bugabinga.net/`.Filter by repository/job or use `?all=1`.Match the seven-character revision before diagnosing a run.Routes:```text/ dashboard/repos/<repo> all runs for one repository/runs/<run-id> parent, children, details, last 256 KiB logs/runs/<run-id>/logs/<child-id> complete plain-text child log/docs compact live usage reference```Read failures in this order:1. Parent `detail`: repo/ref resolution and KDL/config errors may create no child and no log.2. Child `detail`: execution-level cause and status.3. Embedded log tail: usually enough for the final failing command.4. Raw child log: search backward for the first meaningful error; final `exit status 1` is only the summary.Status meanings:- `queued`: inbox event waiting.- `preparing`: claimed; revision/config/plan being resolved.- `running`: one child executing.- `success`: parent completed without a failed child, including a zero-child plan.- `failed`: preflight, child, persistence, or interrupted-run failure.- `skipped`: child not started after an earlier child failed.Repository health uses the latest completed parent.Queued/running work does not clear an existing failure;a later successful parent does.Common diagnoses:- No run after push: check public repo visibility, pushed ref, polling delay, and trigger match.- Success in `0s`, no children: config is absent at that revision, or no job matched the pushed ref.- Failed parent, no children: read parent detail for invalid KDL, duplicate/missing job, unsafe repo/ref, or missing image/run.- Manual job not found: check job name and config at the exact ref/revision.- Failed child: read child detail, embedded tail, then raw log.- Remaining children skipped: the earlier failed child is the root failure.## Manual runsOliver's Nushell wrapper is:```nudef ci [...args] { ssh -p 2223 root@ci.bugabinga.net ...$args }```Use exactly one selector:```nuci run <repo> <job> --ref <ref>ci run <repo> <job> --rev <commit>```The command prints the accepted run ID.Use `/runs/<run-id>` to follow it.Manual runs mutate CI state; do not submit or rerun without explicit approval.Config changes take effect only after the selected commit reaches the public repository.If observed behavior contradicts this skill,inspect current `bugabinga.net/services/luci/internal/ciconfig` sourceand live run detail.Do not guess or use designed-but-unimplemented fields.