From ad8f055aab9f19406146cc8309651c33757cbdb4 Mon Sep 17 00:00:00 2001 From: "Christian M. Todie" Date: Mon, 16 Nov 2026 20:57:08 -0500 Subject: [PATCH] chore(parity): retire Justfile and add estate governance configs --- .cargo/config.toml | 3 + .gitignore | 4 + .saga/flows/kl-gates.toml | 72 ++++++++++++++++ .saga/teams.toml | 14 ++++ .saga/topologies.toml | 23 ++++++ Justfile | 70 ---------------- Makefile | 170 ++++++++++++-------------------------- blackwall.toml | 16 ++++ projectfile.yaml | 69 ++++++++++++++++ validation.dag.yaml | 81 ++++++++++++++++++ 10 files changed, 335 insertions(+), 187 deletions(-) create mode 100644 .saga/flows/kl-gates.toml create mode 100644 .saga/teams.toml create mode 100644 .saga/topologies.toml delete mode 100644 Justfile create mode 100644 blackwall.toml create mode 100644 projectfile.yaml create mode 100644 validation.dag.yaml diff --git a/.cargo/config.toml b/.cargo/config.toml index a878ebc..9c6f484 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,6 @@ +[build] +jobs = 2 + [registries.crates-io] protocol = "sparse" diff --git a/.gitignore b/.gitignore index d4cb1c0..eb99a72 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,7 @@ target/ .DS_Store Cargo.lock .agents/ + +# Agent custody and DAG runner stores (local runs; never committed) +.blackwall/ +.dagrun/ diff --git a/.saga/flows/kl-gates.toml b/.saga/flows/kl-gates.toml new file mode 100644 index 0000000..871f130 --- /dev/null +++ b/.saga/flows/kl-gates.toml @@ -0,0 +1,72 @@ +# Flow: kl-gates +# +# Standard quality verification gates for unsigned-gg/kl: +# rustfmt check, kl-domain zero-I/O hygiene, clippy (-D warnings, -j 2), +# cargo test (-j 2), and Heimdal operator sign-off gate. + +[flow] +name = "kl-gates" +description = "Execute kl verification gates: fmt, zero-I/O hygiene, clippy (-D warnings, -j 2), cargo test (-j 2), and operator gate" + +[params.package] +required = false +default = "kl" +description = "Target crate package for focused test verification" + +[[step]] +id = "fmt-check" +title = "Verify rustfmt formatting" +kind = "test" +agent = "auto" +verify_cmd = ["cargo", "fmt", "--all", "--", "--check"] +prompt = """ +Run `cargo fmt --all -- --check` across all crates in the workspace. +Ensure there are no formatting violations. +""" + +[[step]] +id = "hygiene-check" +title = "Verify kl-domain zero-I/O domain isolation" +kind = "test" +agent = "auto" +deps = ["fmt-check"] +verify_cmd = ["make", "smoke"] +prompt = """ +Run `make smoke` to verify `crates/kl-domain/src` has zero I/O imports. +""" + +[[step]] +id = "clippy-check" +title = "Run clippy linter with warnings denied (-j 2)" +kind = "test" +agent = "auto" +deps = ["hygiene-check"] +verify_cmd = ["cargo", "clippy", "--workspace", "--all-targets", "-j", "2", "--", "-D", "warnings"] +prompt = """ +Run `cargo clippy --workspace --all-targets -j 2 -- -D warnings`. +Confirm the workspace passes without any warnings. +""" + +[[step]] +id = "test-suite" +title = "Execute Cargo test suite (-j 2)" +kind = "test" +agent = "auto" +deps = ["clippy-check"] +verify_cmd = ["cargo", "test", "-p", "{{params.package}}", "-j", "2"] +prompt = """ +Run unit and integration test suites with mandatory host throttling: +`cargo test -p {{params.package}} -j 2` +All tests must pass. +""" + +[[step]] +id = "operator-gate" +title = "Operator sign-off gate" +kind = "gate" +gate = "heimdal:approval" +deps = ["test-suite"] +prompt = """ +Review verification receipts (fmt, hygiene, clippy, tests). +Approve gate to permit PR landing or promotion. +""" diff --git a/.saga/teams.toml b/.saga/teams.toml new file mode 100644 index 0000000..d61b503 --- /dev/null +++ b/.saga/teams.toml @@ -0,0 +1,14 @@ +# Saga team archetypes for unsigned-gg/kl, read by bifrost::yggdrasil. + +[teams.kl-solo] +topology = "solo" +members = [ + { slot = 0, role = "brokkr", harness = "agy", effort = "high" }, +] + +[teams.kl-dual] +topology = "dual-h" +members = [ + { slot = 0, role = "brokkr", harness = "agy", effort = "high" }, + { slot = 1, role = "loki", harness = "claude", effort = "high" }, +] diff --git a/.saga/topologies.toml b/.saga/topologies.toml new file mode 100644 index 0000000..3fe5b6a --- /dev/null +++ b/.saga/topologies.toml @@ -0,0 +1,23 @@ +# Yggdrasil pane topologies for unsigned-gg/kl, read by bifrost::yggdrasil. + +[topologies.solo] +slots = [{ role = "brokkr", label = "lead" }] +splits = [] + +[topologies.dual-h] +slots = [ + { role = "brokkr", label = "lead" }, + { role = "loki", label = "critic" }, +] +splits = [{ from = 0, direction = "right", ratio = 0.5, new = 1 }] + +[topologies.triad] +slots = [ + { role = "brokkr", label = "lead" }, + { role = "sindri", label = "builder" }, + { role = "loki", label = "critic" }, +] +splits = [ + { from = 0, direction = "right", ratio = 0.5, new = 1 }, + { from = 1, direction = "down", ratio = 0.5, new = 2 }, +] diff --git a/Justfile b/Justfile deleted file mode 100644 index f5434e7..0000000 --- a/Justfile +++ /dev/null @@ -1,70 +0,0 @@ -# Justfile for kl (Kernel Layer Primitives) -# Host Throttling: Physical host ceres runs multiple active agent sessions. -# Shared workstations keep jobs=2 to prevent CPU starvation and OOM. - -set shell := ["bash", "-euo", "pipefail", "-c"] - -jobs := "2" - -# Display available commands -default: - @just --list 2>/dev/null || make help - -# Display this help message -help: - @just --list 2>/dev/null || make help - -# Compile the workspace with locked dependencies and host throttling -build: - cargo build --workspace -j {{jobs}} - -# Format all code -fmt: - cargo fmt --all - -# Check code formatting without modifying -fmt-check: - cargo fmt --all -- --check - -# Lint with clippy, warnings are errors -clippy: - cargo clippy --workspace --all-targets -j {{jobs}} -- -D warnings - -# Run unit and integration tests with bounded threads -test: - cargo test --workspace -j {{jobs}} - -# Run doc tests -doc-test: - cargo test --doc --workspace -j {{jobs}} - -# The push gate: fmt-check, clippy, test, doc-test -check: fmt-check clippy test doc-test - -# What the CI rust job runs -ci: - cargo fmt --all -- --check - cargo clippy --workspace --all-targets -j {{jobs}} -- -D warnings - cargo test --workspace -j {{jobs}} - cargo test --doc --workspace -j {{jobs}} - -# Audit licenses, bans, and advisories -deny: - cargo deny check - -# Check dependencies for known advisories -audit: - cargo audit - -# Build CLI/library and verify domain crate has zero I/O -smoke: - cargo build --workspace -j {{jobs}} - if grep -rnE 'std::net|std::fs|tokio|std::process' crates/kl-domain/src; then \ - echo "smoke: kl-domain must not use I/O" >&2; \ - exit 1; \ - fi; \ - echo "smoke: ok" - -# Build API docs -doc: - cargo doc --workspace --no-deps -j {{jobs}} diff --git a/Makefile b/Makefile index 533074e..a28d0dc 100644 --- a/Makefile +++ b/Makefile @@ -1,129 +1,65 @@ -# Makefile for kl -# Standard POSIX wrapper that awk-parses recipes directly from Justfile. +# Makefile for unsigned-gg/kl (Kernel Layer Primitives) +# Shared workstations keep JOBS=2 to prevent CPU starvation and OOM. SHELL := bash .SHELLFLAGS := -euo pipefail -c -.DEFAULT_GOAL := help .ONESHELL: +.DEFAULT_GOAL := help JOBS ?= 2 - export JOBS -JUST := $(shell command -v just 2>/dev/null) - -# Discover available recipe names from Justfile (excluding help and default) -TARGETS := $(shell awk '(/^[a-zA-Z0-9_-]+ *:[^=]/ || /^[a-zA-Z0-9_-]+ *:$$/) && !/^[a-zA-Z0-9_-]+ *:=/ { split($$1, a, ":"); t = a[1]; if (t != "help" && t != "default") print t }' Justfile 2>/dev/null) - -.PHONY: $(TARGETS) help default - -define AWK_PARSER -BEGIN { - vars["jobs"] = jobs -} -# Capture variable definitions: var := "val" -/^[a-zA-Z0-9_-]+ *:=/ { - var = $$1 - val = $$0 - sub(/^[a-zA-Z0-9_-]+ *:= *"/, "", val) - sub(/".*$$/, "", val) - if (!(var in vars)) vars[var] = val - next -} -# Capture doc comment above recipe -/^# / { - sub(/^# */, "") - last_doc = $$0 - next -} -# Capture recipe signature -(/^[a-zA-Z0-9_-]+ *:[^=]/ || /^[a-zA-Z0-9_-]+ *:$$/) && !/^[a-zA-Z0-9_-]+ *:=/ { - curr = $$1 - sub(/:.*/, "", curr) - header = $$0 - sub(/^[a-zA-Z0-9_-]+ *: */, "", header) - deps[curr] = header - all_targets[curr] = 1 - doc[curr] = last_doc - order[++target_count] = curr - last_doc = "" - next -} -# Capture recipe body lines and interpolate variables -/^[ \t]+/ && curr != "" { - line = $$0 - sub(/^[ \t]+/, "", line) - for (v in vars) { - gsub("\\{\\{ *" v " *\\}\\}", vars[v], line) - } - gsub(/[$$][$$]/, "$$", line) - body[curr] = (body[curr] ? body[curr] "\n" : "") line - next -} -!/^[ \t]/ { - curr = "" - last_doc = "" -} -function emit(t, n, d, i, k, lines, cmd) { - if (!(t in all_targets)) { - print "echo \"error: unknown recipe: " t "\" >&2; exit 1" - return - } - if (deps[t] != "") { - n = split(deps[t], d, " ") - for (i = 1; i <= n; i++) { - if (d[i] != "") emit(d[i]) - } - } - if (body[t] != "") { - k = split(body[t], lines, "\n") - for (i = 1; i <= k; i++) { - cmd = lines[i] - sub(/^@/, "", cmd) - print cmd - } - } -} -function show_help() { - print "Usage: make " - print "" - print "Available recipes (parsed from Justfile):" - for (i = 1; i <= target_count; i++) { - t = order[i] - if (t != "default" && t != "help") { - printf " \033[36m%-24s\033[0m %s\n", t, (doc[t] ? doc[t] : "") - } - } -} -END { - if (target == "help" || target == "default" || target == "") { - show_help() - } else { - print "set -euo pipefail" - emit(target) - } -} -endef -export AWK_PARSER - -help: - @if [ -n "$(JUST)" ]; then \ - $(JUST) --list; \ - else \ - awk -v target="help" -v jobs="$(JOBS)" "$$AWK_PARSER" Justfile; \ - fi +.PHONY: help default build fmt fmt-check clippy test doc-test check ci deny audit smoke doc + +##@ Help + +help: ## Display available Makefile targets + @awk 'BEGIN {FS = ":.*##"; printf "\n\033[1mUsage:\033[0m\n make \033[36m\033[0m\n"} /^[a-zA-Z0-9_.-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1;33m%s\033[0m\n", substr($$0, 5) }' $(MAKEFILE_LIST) default: help -$(TARGETS): - @if [ -n "$(JUST)" ]; then \ - $(JUST) --set jobs "$(JOBS)" "$@"; \ - else \ - awk -v target="$@" -v jobs="$(JOBS)" "$$AWK_PARSER" Justfile | $(SHELL); \ - fi +##@ Build & Verification + +build: ## Compile the workspace with host throttling (-j $(JOBS)) + cargo build --workspace -j $(JOBS) + +fmt: ## Format all code + cargo fmt --all + +fmt-check: ## Check code formatting without modifying + cargo fmt --all -- --check -%: - @if [ -n "$(JUST)" ]; then \ - $(JUST) --set jobs "$(JOBS)" "$*"; \ - else \ - awk -v target="$*" -v jobs="$(JOBS)" "$$AWK_PARSER" Justfile | $(SHELL); \ +clippy: ## Lint with clippy, warnings are errors (-j $(JOBS)) + cargo clippy --workspace --all-targets -j $(JOBS) -- -D warnings + +test: ## Run unit and integration tests (-j $(JOBS)) + cargo test --workspace -j $(JOBS) + +doc-test: ## Run doc tests (-j $(JOBS)) + cargo test --doc --workspace -j $(JOBS) + +check: fmt-check clippy test doc-test ## Push gate: fmt-check, clippy, test, doc-test + +ci: ## Run full CI Rust verification suite + cargo fmt --all -- --check + cargo clippy --workspace --all-targets -j $(JOBS) -- -D warnings + cargo test --workspace -j $(JOBS) + cargo test --doc --workspace -j $(JOBS) + +##@ Hygiene, Security & Docs + +deny: ## Audit licenses, bans, and advisories + cargo deny check + +audit: ## Check dependencies for known advisories + cargo audit + +smoke: ## Build workspace and verify kl-domain has zero I/O + cargo build --workspace -j $(JOBS) + if grep -rnE 'std::net|std::fs|tokio|std::process' crates/kl-domain/src; then + echo "smoke: kl-domain must not use I/O" >&2 + exit 1 fi + echo "smoke: ok" + +doc: ## Build API docs + cargo doc --workspace --no-deps -j $(JOBS) diff --git a/blackwall.toml b/blackwall.toml new file mode 100644 index 0000000..d866f0d --- /dev/null +++ b/blackwall.toml @@ -0,0 +1,16 @@ +# Blackwall build-pipeline custody config for unsigned-gg/kl. +# Custody chain: run -> settle -> reconcile -> verify -> PR -> merge-gate. + +[defaults] +provider = "gateway" +model = "kimi-k3" + +[verify] +command = "make check JOBS=2" + +[merge] +# Green CI reports ready; operator or fast-forward lane lands explicitly. +automerge = false + +[budget] +max_tokens_per_run = 200000 diff --git a/projectfile.yaml b/projectfile.yaml new file mode 100644 index 0000000..d078a7e --- /dev/null +++ b/projectfile.yaml @@ -0,0 +1,69 @@ +$schema: https://projectfile.org/schema/v1.json +kind: SoftwareSourceCode + +identity: + namespace: gg.unsigned + name: kl + version: "0.1.0" + title: + en: "kl — Kernel Layer Primitives" + summary: + en: "Kernel link eBPF probes, priority clamping, and Landlock LSM confinement primitives in Rust." + created: "2026-10-11" + modified: "2026-11-16" + +repositories: + - url: "https://github.com/unsigned-gg/kl.git" + type: git + branch: main + role: origin + +links: + - type: source-code + url: https://github.com/unsigned-gg/kl + - type: bugs + url: https://github.com/unsigned-gg/kl/issues + +license: + spdx: Apache-2.0 OR MIT OR CC0-1.0 + file: LICENSE + +copyright: + year: 2026 + +people: + - family-names: Todie + given-names: Christian M. + email: chris@todie.io + roles: [founder, author, maintainer, copyright] + +organizations: + - name: "Unsigned" + url: https://github.com/unsigned-gg + roles: [funder, copyright, maintainer] + +keywords: + - ebpf + - landlock + - seccomp + - kernel + - confinement + - rust + +org.projectfile.ci: + nodes: + - id: zero-io-domain + run: "! grep -rnE 'std::net|std::fs|tokio|std::process' crates/kl-domain/src" + - id: fmt + run: "cargo fmt --all -- --check" + - id: clippy + depends_on: [fmt, zero-io-domain] + run: "cargo clippy --workspace -j 2 --all-targets -- -D warnings" + - id: test + depends_on: [clippy] + run: "cargo test --workspace -j 2" + - id: doc-test + depends_on: [test] + run: "cargo test --doc --workspace -j 2" + - id: deny + run: "cargo deny check" diff --git a/validation.dag.yaml b/validation.dag.yaml new file mode 100644 index 0000000..bd4c453 --- /dev/null +++ b/validation.dag.yaml @@ -0,0 +1,81 @@ +# kl Workstation & CI Validation DAG for dagrun v0.15.0+ +# Applies two-level cgroup-v2 containment, CPA moldable CPU width planning, +# rss_baseline_bytes memory admission, and cargo-target lock serialization on ceres. + +version: 2 + +defaults: + timeout: 600 + env: + CARGO_BUILD_JOBS: "2" + JOBS: "2" + +resource_caps: + cargo-target: 1 + +steps: + - job: zero-io-domain + group: hygiene + desc: "Verify kl-domain zero-I/O leaf purity" + cmd: "! grep -rnE 'std::net|std::fs|tokio|std::process' crates/kl-domain/src" + cmdtype: unknown + hint: + est_duration_s: 0.2 + rss_baseline_bytes: 67108864 + hard_mem_max_bytes: 268435456 + + - job: fmt-check + group: rust + desc: "Verify Rust workspace formatting" + cmd: "cargo fmt --all -- --check" + cmdtype: unknown + hint: + est_duration_s: 1.0 + rss_baseline_bytes: 268435456 + hard_mem_max_bytes: 1073741824 + + - job: clippy + group: rust + desc: "Run workspace clippy with -D warnings (-j 2)" + cmd: "cargo clippy --workspace -j 2 --all-targets -- -D warnings" + cmdtype: cargo-build + deps: + - rust.fmt-check + - hygiene.zero-io-domain + hint: + est_duration_s: 10.0 + rss_baseline_bytes: 1073741824 + hard_mem_max_bytes: 4294967296 + preferred_inner_jobs: 2 + resources: + cargo-target: 1 + + - job: test + group: rust + desc: "Run workspace unit and binary tests (-j 2)" + cmd: "cargo test --workspace -j 2" + cmdtype: cargo-test + deps: + - rust.clippy + hint: + est_duration_s: 8.0 + rss_baseline_bytes: 1073741824 + hard_mem_max_bytes: 4294967296 + preferred_inner_jobs: 2 + resources: + cargo-target: 1 + + - job: doc-test + group: rust + desc: "Run workspace documentation tests (-j 2)" + cmd: "cargo test --doc --workspace -j 2" + cmdtype: cargo-test + deps: + - rust.test + hint: + est_duration_s: 5.0 + rss_baseline_bytes: 1073741824 + hard_mem_max_bytes: 4294967296 + preferred_inner_jobs: 2 + resources: + cargo-target: 1