AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
翻譯準備中
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Typed Kubernetes config with types from the K8s API and your CRDs, editor support, and Argo CD/Flux ordering
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
Typed configuration for Kubernetes.
Real types from the Kubernetes API and your CRDs, errors at the exact field that's wrong,
and plain YAML out: for Argo CD, Flux, or kubectl apply .
Playground ·
Documentation
Cleat is under active development. The language, the CLI and the
editor and Argo CD integrations can change in incompatible ways between
commits, and it hasn't been used in production yet. It isn't accepting
code contributions yet, but issues and feedback are welcome.
"Cleat" is a working name and is likely to change before a first
release.檢視完整 README ↗[!WARNING] Cleat is under active development. The language, the CLI and the editor and Argo CD integrations can change in incompatible ways between commits, and it hasn't been used in production yet. It isn't accepting code contributions yet, but issues and feedback are welcome.
"Cleat" is a working name and is likely to change before a first release.
import * as k8s from "../schemas/kubernetes-1.37.json"
input env: "dev" | "prod"
input image: Str
input replicas: Int where self >= 1 = 2
export k8s.Deployment {
metadata.name: "api",
spec: {
replicas: if env == "prod" then max(replicas, 3) else replicas,
selector.matchLabels.app: "api",
template: {
metadata.labels.app: "api",
spec.containers: [{ name: "api", image, ports: [{ containerPort: 8080 }] }],
},
},
}
$ cleat export examples/quickstart.cleat --set env=prod --set image=ghcr.io/acme/api:1.4.2
apiVersion: apps/v1
kind: Deployment
metadata:
name: api
spec:
replicas: 3
...
apiVersion and kind fill themselves in. Now misspell replicas and add
imagePullPolicy: "Allways" to the container, and the mistakes are caught
before anything reaches a cluster, with the exact location and a fix:
$ cleat check examples/quickstart.cleat
quickstart.cleat:13:5: error: unknown field `replcias` in `k8s.apps.v1.DeploymentSpec`; did you mean `replicas`?
quickstart.cleat:17:64: error: type mismatch: expected `"Always" | "IfNotPresent" | "Never"`, found `"Allways"`
Bad inputs are rejected before evaluation, all of them at once:
$ cleat export examples/quickstart.cleat --set env=production --set image=api:1 --set replicas=0
quickstart.cleat:6:1: error: input `env`: expected `"dev" | "prod"`, got "production" (string)
quickstart.cleat:8:1: error: input `replicas`: 0 does not satisfy `self >= 1`
values.yaml. Inputs declare their types,
defaults and constraints. Bad values are rejected up front, all of them
at once, with the allowed values in the message.base with { [kind: "Deployment"].spec.replicas: 3 }
is checked against the types. A misspelled field or a selector that
matches nothing is an error, not a no-op.export app after db = ... becomes
Argo CD sync waves or Flux dependsOn.| Helm | Kustomize | Cleat | |
|---|---|---|---|
| How you write config | Go templates over YAML text | YAML plus patches | A typed language that outputs YAML |
| Checks against the Kubernetes API | After rendering (cluster or a separate linter) | After rendering (cluster or a separate linter) | While writing, with the field and a fix |
| Inputs | values.yaml (optional JSON Schema) | none | Typed inputs with defaults and constraints |
| Variations per environment | values files | overlays (strategic merge) | modules and typed with patches |
| Ordering between resources | hooks and weights | by kind only | after → sync waves / dependsOn |
| Editor support | limited | limited | Completion, hover, definitions, live preview |
To try it without installing anything, use the
playground: the real
checker compiled to WebAssembly, with completion, hover, live output, and the
same resource map and checks as cleat view.
Cleat is built from source for now (Rust is installed by rustup from
rust-toolchain.toml):
git clone https://github.com/xorps/cleat-lang && cd cleat-lang
cargo install --path crates/cleat # installs the `cleat` binary
schemas/fetch.sh 1.37 # Kubernetes OpenAPI spec, checksum-verified
cleat check examples/quickstart.cleat
cleat export examples/quickstart.cleat --set env=prod --set image=ghcr.io/acme/api:1.4.2
For VS Code, build and install the extension (no npm needed):
editors/vscode/package.sh && code --install-extension editors/vscode/cleat.vsix
Then open a .cleat file. Cleat: Show Output (the preview icon in the
editor title bar) shows the exported YAML beside it, updating as you type,
and Cleat: Show Resource Map shows the cleat view dashboard there;
selecting a resource jumps to where it's defined.
import * as k8s from "../schemas/kubernetes-1.37.json" // the Kubernetes OpenAPI spec
import * as cm from "./crds/cert-manager.crds.yaml" // any CRD files
import { Deployment, Service } from "../schemas/kubernetes-1.37.json"
export cm.Certificate { metadata.name: "web-tls", spec: { secretName: "web-tls", ... } }
Required fields, enums (including the ~40 the Kubernetes spec leaves as
plain strings, like Service.spec.type and imagePullPolicy), int-or-string
fields and schema patterns are all checked. cleat gen <schema> prints the
generated types. You can also narrow types for your own policies:
refine k8s.ServiceSpec with { type: "ClusterIP" | "LoadBalancer" } // no NodePorts here
A module holds the shared pieces; each environment imports it and patches the result:
// examples/overlays/prod.cleat
import * as base from "./base.cleat"
input image: Str
export api = base.app("api", image) with {
[kind: "Deployment"].spec.replicas: 3,
[kind: "Deployment"].metadata.labels +: { tier: "prod" },
[kind: "Service"].spec.type: "LoadBalancer",
}
export db = [postgres, postgres_service]
export config = [app_config]
export app after db, config = [api, api_service]
cleat export --target argocd adds argocd.argoproj.io/sync-wave
annotations. --target flux --out dir writes one directory per component
plus Flux Kustomizations with dependsOn and wait: true. Cycles and
unknown names are compile errors.
import defaults from "./defaults.yaml" with { type: "yaml" } // typed from its contents
import nginxConf from "./nginx.conf" with { type: "text" }
let conf = """
server { listen \(defaults.port); }
"""
$ cleat view examples/webapp.cleat --input examples/webapp.inputs.json
Viewing examples/webapp.cleat at http://127.0.0.1:52418/ (Ctrl-C to stop)
opens the exported resources in your browser as a cluster-style dashboard:
grouped by kind, with replicas, images, ports, routes, relations between
resources and the YAML, plus a map of how Ingresses, Services, workloads and
their config connect, updating as you edit. It also flags what the type
checker can't see, such as a Service that selects no workload or an Ingress
pointing at a missing Service. --out view.html writes a static snapshot.
cleat diff app.cleat --base main shows what your change does to the
rendered resources (added, changed and removed, with a YAML diff of each),
and cleat view --diff main marks the same changes on the map.
Cleat runs as an Argo CD
config management plugin
sidecar: a 6 MB distroless image with a static binary
(deploy/argocd/).
spec:
source:
repoURL: https://github.com/acme/deploy.git
path: apps/shop
plugin:
name: cleat-v1
parameters:
- { name: image, string: ghcr.io/acme/api:1.4.2 }
Each input appears in the Argo CD UI as a parameter, with its type as the
tooltip. Invalid parameters show up in the Application's status with Cleat's
message, and after dependencies become sync waves.
deploy/argocd/e2e/run.sh tests all of this against a real Argo CD in a
throwaway kind cluster.
Cleat is licensed under the Apache License 2.0.
Contributions are accepted under Apache-2.0 OR MIT; see CONTRIBUTING.md.