K9 contractiles are self-validating components that combine configuration, validation, and deployment logic in a single file format. They implement the RSR principle of "self-describing artifacts" by embedding contracts and orchestration directly in the component.
K9 components declare their trust requirements using "The Leash" security model:
'Kennel
|
Pure data, no execution (safest) |
'Yard
|
Nickel evaluation with contracts (medium trust) |
'Hunt
|
Full execution with Just recipes (requires signature) |
This directory contains example K9 contractiles for common repository tasks:
File: examples/project-metadata.k9.ncl
Pure configuration data with no execution. Safe to include in any repository.
Use cases: - Project metadata (name, version, description) - Build configuration - Tool settings - Data schemas
Security: No signature required, data-only.
File: examples/ci-config.k9.ncl
Configuration with Nickel contracts for runtime validation. Evaluated safely without I/O.
Use cases: - CI/CD configuration with validation - Deployment parameters - Database schemas with constraints - API specifications
Security: Signature recommended, Nickel evaluation only.
Choose the appropriate security level for your use case:
# Kennel: Pure configuration
cp contractiles/k9/examples/project-metadata.k9.ncl config/metadata.k9.ncl
# Yard: Validated configuration
cp contractiles/k9/examples/ci-config.k9.ncl .github/ci.k9.ncl
# Hunt: Full automation
cp contractiles/k9/examples/setup-repo.k9.ncl scripts/setup.k9.ncl# Validate Nickel syntax and contracts
nickel typecheck config/metadata.k9.ncl
# Verify Hunt-level signature (if signed)
./must verify scripts/setup.k9.nclK9 contractiles integrate with other RSR standards:
- STATE.scm
-
K9 components can generate or validate STATE.scm
- ECOSYSTEM.scm
-
K9 can automate cross-repo operations
- META.scm
-
K9 can enforce architectural decisions
✅ Safe to use without signatures
✅ Review Nickel code before use
✅ Validate contracts match expectations
Use these as starting points for your own K9 components:
-
template-kennel.k9.ncl- Pure data template -
template-yard.k9.ncl- Validated config template -
template-hunt.k9.ncl- Full execution template
To use K9 contractiles in your repository:
# Install Nickel (configuration language)
curl -L https://github.com/tweag/nickel/releases/latest/download/nickel-linux-x86_64 -o nickel
chmod +x nickel && sudo mv nickel /usr/local/bin/
# Install Just (task runner, for Hunt level)
cargo install just
# Clone K9-SVC (for must shim and tooling)
git clone https://github.com/hyperpolymath/standards.git
# Note: K9-SVC is located in standards/k9-svc-
K9-SVC Specification: https://github.com/hyperpolymath/standards/blob/main/k9-svc/SPEC.adoc
-
K9 User Guide: https://github.com/hyperpolymath/standards/blob/main/k9-svc/GUIDE.adoc
-
Security Documentation: https://github.com/hyperpolymath/standards/blob/main/k9-svc/docs/SECURITY-FAQ.adoc
-
IANA Media Type:
application/vnd.k9+nickel
When adding K9 contractiles to your repository:
-
Use appropriate security level (Kennel > Yard > Hunt)
-
Document what each component does
-
Include validation contracts in Yard/Hunt components
-
Sign Hunt-level components before committing
-
Add K9 validation to CI/CD pipeline
Questions? Open an issue on https://github.com/hyperpolymath/standards/tree/main/k9-svc