GitHub Action to validate K9 configuration files in your repository.
K9 is a Nickel-based configuration contract format used by the
contractile system for deployment validation and policy enforcement.
Files use the .k9 or .k9.ncl extension and follow a security-tiered
"leash" model: kennel (data-only), yard (validated), and hunt (full
execution).
-
K9! magic number — First non-empty line must be exactly
K9! -
SPDX header — Verifies
SPDX-License-Identifierin the first 10 lines -
Pedigree block — Requires a
pedigree={…}section with:-
namefield (inpedigree.metadataor directly) -
versionorschema_versionfield
-
-
Security level —
leashorsecurity_levelmust be one of:kennel,yard,hunt -
Hunt-level signature — Files at
huntsecurity level must include asignatureorsignature_requiredfield
Add to your workflow:
name: Validate K9
on: [push, pull_request]
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hyperpolymath/k9-validate-action@v1
with:
path: '.' # Directory to scan (default: repo root)
strict: 'false' # Promote warnings to errors (default: false)
# paths-ignore: defaults to vendored / fixture patterns; override
# via newline-separated string. Use '' to disable.| Input | Default | Description |
|---|---|---|
path |
. |
Directory path to scan for K9 files |
strict |
false |
When true, warnings become errors and the action fails on any issue |
paths-ignore |
vendored & fixture defaults | Newline-separated path fragments to skip. Substring match against each file path. Default set: vendor/, vendored/, verified-container-spec/, .audittraining/, integration/fixtures/, test/fixtures/, tests/fixtures/. Pass an empty string (paths-ignore: ’’) to disable and scan everything. See hyperpolymath/hypatia#243 for the architectural rationale (content-pattern validators must distinguish targets from fixtures / vendored / training-corpus files that legitimately contain the very pattern being checked). |
K9 files inside vendored projects (e.g. verified-container-spec/)
carry their own pedigree declarations in their upstream context —
flagging every such file as "Pedigree block missing ’name’ field" is
provenance noise. The defaults match the canonical RSR vendored-content
paths; override for project-specific carve-outs.
| Output | Description |
|---|---|
files-scanned |
Number of K9 files processed |
errors |
Count of validation errors |
warnings |
Count of validation warnings |
| Level | Trust | Requirements |
|---|---|---|
kennel |
Data-only | No signature required. Pure configuration values. |
yard |
Validated | Nickel contracts enforced. Type-checked before use. |
hunt |
Full access | Signature required. Can execute commands and access system resources. |
Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
SPDX-License-Identifier: CC-BY-SA-4.0
See LICENSE for details.