From 299cae704c8a6331878f0921ebf901e20095de31 Mon Sep 17 00:00:00 2001 From: "Christian M. Todie" Date: Mon, 16 Nov 2026 20:54:32 -0500 Subject: [PATCH] chore(parity): retire Justfile/CODEOWNERS and add estate governance configs --- .cargo/config.toml | 3 + .github/CODEOWNERS | 10 -- .github/labeler.yml | 3 +- .gitignore | 4 +- .saga/flows/kd-gates.toml | 72 ++++++++++ .saga/teams.toml | 14 ++ .saga/topologies.toml | 23 ++++ Justfile | 186 ------------------------- Makefile | 281 +++++++++++++++++++++----------------- projectfile.yaml | 79 +++++++++++ validation.dag.yaml | 135 ++++++++++++++++++ 11 files changed, 490 insertions(+), 320 deletions(-) delete mode 100644 .github/CODEOWNERS create mode 100644 .saga/flows/kd-gates.toml create mode 100644 .saga/teams.toml create mode 100644 .saga/topologies.toml delete mode 100644 Justfile create mode 100644 projectfile.yaml create mode 100644 validation.dag.yaml diff --git a/.cargo/config.toml b/.cargo/config.toml index 176f882..d602775 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,6 @@ +[build] +jobs = 2 + [alias] xtask = "run -q -p xtask --" diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index cce5b71..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,10 +0,0 @@ -# Patrick Gray (@pgray) is CTO and a co-source of architecture canon for this repo, with -# Christian Todie (@todie). His approval satisfies any engineering gate here when he chooses -# to exercise it (ruling 2026-10-06; ~/.agents/sops/second-operator-allen-hackley.md section 12). -# Allen Hackley (@LordVoid) is Director of Engineering. He holds an overriding veto on identity -# services (ruling 2026-10-06; same SOP, section 3e). -# Both are recorded here as comments, not in the patterns below, so GitHub does not auto-request -# their review. Add a person to a pattern only after that person asks, on the paths they pick. -* @todie -/.claude/ @todie -/.github/ @todie diff --git a/.github/labeler.yml b/.github/labeler.yml index cf0f2c3..5920d25 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -18,8 +18,9 @@ ci: - any-glob-to-any-file: - '.github/workflows/**' - '.github/dependabot.yml' - - 'Justfile' - 'Makefile' + - 'projectfile.yaml' + - 'validation.dag.yaml' - 'lefthook.yml' docs: diff --git a/.gitignore b/.gitignore index aeb709f..1adb3ca 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /.tools/ .dagr/ .saga/* +!.saga/*.toml !.saga/flows/ !.saga/flows/*.toml .env* @@ -10,8 +11,9 @@ /dist/ .contracts/ -# Agent custody store (local runs; never committed) +# Agent custody and DAG runner stores (local runs; never committed) .blackwall/ +.dagrun/ .sbx/ # Vendored crates (run `make vendor` to populate; un-ignore if vendoring into repo) diff --git a/.saga/flows/kd-gates.toml b/.saga/flows/kd-gates.toml new file mode 100644 index 0000000..bbba2ec --- /dev/null +++ b/.saga/flows/kd-gates.toml @@ -0,0 +1,72 @@ +# Flow: kd-gates +# +# Standard quality verification gates for unsigned-gg/kd: +# rustfmt check, LeanSpec/zero-I/O hygiene, clippy (-D warnings, -j 2), +# cargo test (-j 2), and Heimdal operator sign-off gate. + +[flow] +name = "kd-gates" +description = "Execute kd verification gates: fmt, spec/zero-I/O hygiene, clippy (-D warnings, -j 2), cargo test (-j 2), and operator gate" + +[params.package] +required = false +default = "kd" +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 = "Run LeanSpec and kd-domain zero-I/O hygiene checks" +kind = "test" +agent = "auto" +deps = ["fmt-check"] +verify_cmd = ["cargo", "run", "--locked", "-j", "2", "-p", "xtask", "--", "spec-check"] +prompt = """ +Run `cargo run --locked -j 2 -p xtask -- spec-check` and verify `crates/kd-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", "--locked", "--all-targets", "-j", "2", "--", "-D", "warnings"] +prompt = """ +Run `cargo clippy --workspace --locked --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}}", "--locked", "-j", "2"] +prompt = """ +Run unit and integration test suites with mandatory host throttling: +`cargo test -p {{params.package}} --locked -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..af174cd --- /dev/null +++ b/.saga/teams.toml @@ -0,0 +1,14 @@ +# Saga team archetypes for unsigned-gg/kd, read by bifrost::yggdrasil. + +[teams.kd-solo] +topology = "solo" +members = [ + { slot = 0, role = "brokkr", harness = "agy", effort = "high" }, +] + +[teams.kd-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..7b59667 --- /dev/null +++ b/.saga/topologies.toml @@ -0,0 +1,23 @@ +# Yggdrasil pane topologies for unsigned-gg/kd, 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 9daa068..0000000 --- a/Justfile +++ /dev/null @@ -1,186 +0,0 @@ -# Justfile for kd -# Standard command runner for Rust workspaces. -# Shared workstations keep jobs=2 to avoid CPU starvation. CI passes jobs=10. - -set shell := ["bash", "-euo", "pipefail", "-c"] - -jobs := "2" -nextest_profile := "default" -org := "cerebral-work" - -# 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 --locked -j {{jobs}} - -# Format all code -fmt: - cargo fmt --all - -# Check code formatting without modifying -fmt-check: - cargo fmt --all -- --check - -# Sort Cargo.toml dependencies alphabetically -sort: - @command -v cargo-sort >/dev/null 2>&1 || { echo "cargo-sort not found; install with: cargo install cargo-sort -j {{jobs}}" >&2; exit 1; } - cargo sort --workspace - -# Check Cargo.toml dependencies are sorted alphabetically -sort-check: - @command -v cargo-sort >/dev/null 2>&1 || { echo "cargo-sort not found; install with: cargo install cargo-sort -j {{jobs}}" >&2; exit 1; } - cargo sort --check --workspace - -# Lint with clippy, warnings are errors -clippy: - cargo clippy --workspace --all-targets --locked -j {{jobs}} -- -D warnings - -# Run unit and integration tests via nextest with bounded threads -test: - cargo nextest run --workspace --locked --build-jobs {{jobs}} --profile {{nextest_profile}} - -# Run doc tests -doc-test: - cargo test --doc --workspace --locked -j {{jobs}} - -# Verify feature powerset -powerset: - cargo hack --feature-powerset --no-dev-deps check --workspace -j {{jobs}} - -# Guard public API against accidental breaking semver drift -semver: - @command -v cargo-semver-checks >/dev/null 2>&1 || { echo "cargo-semver-checks not found" >&2; exit 1; } - cargo semver-checks check-release --workspace - -# Verify workspace compiles against declared MSRV floor (rust-version) -msrv: - @msrv=$$(sed -n 's/^rust-version *= *"\(.*\)"/\1/p' Cargo.toml | head -1); \ - if rustup toolchain list | grep -q "^$$msrv"; then \ - cargo +"$$msrv" check --workspace --all-targets -j {{jobs}}; \ - else \ - echo "msrv: toolchain $$msrv not installed (install with: rustup toolchain install $$msrv)" >&2; \ - fi - -# Audit licenses, bans, advisories, and sources across target triples -deny: - cargo deny check - -# The push gate: fmt, clippy, test, doc-test, deny -check: fmt-check clippy test doc-test deny - -# What the CI rust job runs -ci: - cargo fmt --all -- --check - cargo clippy --workspace --all-targets --locked -j {{jobs}} -- -D warnings - cargo nextest run --workspace --locked --build-jobs {{jobs}} --profile ci - cargo test --doc --workspace --locked -j {{jobs}} - -# Repository hygiene: typos, sort, unused deps, specs, toolchain, pins -hygiene: typos sort-check machete spec-check toolchain-check pin-check - for f in scripts/*.sh; do bash -n "$f"; done - -# Spell check -typos: - typos - -# Hunt down unused dependencies bloating the build graph -machete: - cargo machete - -# Validate specs/ against LeanSpec contracts -spec-check: - cargo xtask spec-check - -# Verify active rustc matches rust-toolchain.toml pinned channel -toolchain-check: - cargo xtask toolchain-check - -# Verify dependency pins in specs/0004 match Cargo.lock -pin-check: - cargo xtask pin-check - -# Fetch pinned estate contracts into .contracts/ (contracts.lock) -fetch-contracts: - cargo xtask fetch-contracts - -# Vendor all dependencies into vendor/crates for offline builds -vendor: - cargo vendor vendor/crates - -# Verify that vendor/crates matches Cargo.lock -vendor-check: - @if [ -d vendor/crates ]; then \ - cargo vendor --versioned-dirs vendor/crates >/dev/null; \ - git status --porcelain vendor/crates | grep -q . && { echo "vendor-check: vendor/crates is out of sync with Cargo.lock" >&2; exit 1; } || echo "vendor-check: ok"; \ - else \ - echo "vendor-check: vendor/crates directory not found (run make vendor first)" >&2; exit 1; \ - fi - -# Build CLI, verify version string, and prove domain crate has zero I/O -smoke: - cargo build -p kd --locked -j {{jobs}} - @out="$$(cargo run -q -p kd --locked -j {{jobs}} -- --version)"; \ - echo "$$out"; \ - [[ "$$out" =~ ^kd\ [0-9]+\.[0-9]+\.[0-9]+\ \(.+\)$$ ]] || { echo "smoke: unexpected --version output" >&2; exit 1; }; \ - cargo run -q -p kd --locked -j {{jobs}} -- demo | grep -q '"done"' || { echo "smoke: demo did not reach done" >&2; exit 1; }; \ - if grep -rnE 'std::net|std::fs|tokio|std::process' crates/kd-domain/src; then \ - echo "smoke: kd-domain must not use I/O" >&2; \ - exit 1; \ - fi; \ - echo "smoke: ok" - -# Check dependencies for known advisories -audit: - cargo audit - -# Write a CycloneDX SBOM (*.cdx.json) -sbom: - cargo cyclonedx --format json - -# Build API docs -doc: - cargo doc --workspace --no-deps -j {{jobs}} - -# Build release binaries for the host into dist/ -dist: - DIST_JOBS={{jobs}} ./scripts/dist.sh - -# Roll CHANGELOG and bump version (VERSION=x.y.z) -release-notes: - [[ "${VERSION:-}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "usage: make release-notes VERSION=x.y.z" >&2; exit 2; } - [ -f CHANGELOG.md ] || { echo "CHANGELOG.md not found" >&2; exit 1; } - grep -q '^## \[Unreleased\]' CHANGELOG.md || { echo "CHANGELOG.md has no [Unreleased] heading" >&2; exit 1; } - sed -i '0,/^version = ".*"/s//version = "'"${VERSION}"'"/' Cargo.toml - cargo update -w --offline 2>/dev/null || cargo update -w - awk -v v="${VERSION}" -v d="$(date -u +%F)" ' \ - /^## \[Unreleased\]/ && !done { print; print ""; print "## [" v "] - " d; done = 1; next } \ - { print }' CHANGELOG.md > CHANGELOG.md.tmp - mv CHANGELOG.md.tmp CHANGELOG.md - echo "release-notes: set version ${VERSION}. Review the diff, then open a PR to development." - -# Check the custody setup (sbx doctor or blackwall doctor) -custody-check: - @if command -v sbx >/dev/null 2>&1; then \ - sbx doctor; \ - elif command -v blackwall >/dev/null 2>&1; then \ - blackwall doctor; \ - else \ - echo "custody-check: neither sbx nor blackwall installed" >&2; exit 1; \ - fi - -# Open this repo as a herdr agent workspace -workspace: - bash scripts/herdr-workspace.sh "$(pwd)" - -# Install the pgt CLI into .tools/bin -pgt-install: - cargo install --git https://github.com/cerebral-work/pgt --rev 54d90f5 pgt --root .tools --locked - - diff --git a/Makefile b/Makefile index 8062a44..18a7f6d 100644 --- a/Makefile +++ b/Makefile @@ -1,137 +1,174 @@ -# Makefile for kd -# Standard POSIX wrapper that awk-parses recipes directly from Justfile. +# Makefile for unsigned-gg/kd +# Shared workstations keep JOBS=2 to prevent CPU starvation. CI passes JOBS=10. SHELL := bash .SHELLFLAGS := -euo pipefail -c -.DEFAULT_GOAL := help .ONESHELL: +.DEFAULT_GOAL := help JOBS ?= 2 NEXTEST_PROFILE ?= default ORG ?= cerebral-work -NAME ?= -REPO ?= -VERSION ?= - -export JOBS NEXTEST_PROFILE ORG NAME REPO VERSION - -JUST := $(shell command -v just 2>/dev/null) - -# Discover available recipe names from Justfile (excluding help, default, and template targets) -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" && t != "new-repo" && t != "template-check") print t }' Justfile 2>/dev/null) - -.PHONY: $(TARGETS) help default - -define AWK_PARSER -BEGIN { - vars["jobs"] = jobs - vars["nextest_profile"] = nextest_profile - vars["org"] = org -} -# 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)" -v nextest_profile="$(NEXTEST_PROFILE)" -v org="$(ORG)" "$$AWK_PARSER" Justfile; \ - fi + +export JOBS NEXTEST_PROFILE ORG + +.PHONY: help default build fmt fmt-check sort sort-check clippy test doc-test powerset semver msrv \ + deny check ci hygiene typos machete spec-check toolchain-check pin-check fetch-contracts \ + vendor vendor-check smoke audit sbom doc dist release-notes custody-check workspace pgt-install + +##@ 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%-24s\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)" "$@"; \ +##@ Build & Verification + +build: ## Compile the workspace with locked dependencies and host throttling + cargo build --workspace --locked -j $(JOBS) + +fmt: ## Format all code + cargo fmt --all + +fmt-check: ## Check code formatting without modifying + cargo fmt --all -- --check + +sort: ## Sort Cargo.toml dependencies alphabetically + @command -v cargo-sort >/dev/null 2>&1 || { echo "cargo-sort not found; install with: cargo install cargo-sort -j $(JOBS)" >&2; exit 1; } + cargo sort --workspace + +sort-check: ## Check Cargo.toml dependencies are sorted alphabetically + @command -v cargo-sort >/dev/null 2>&1 || { echo "cargo-sort not found; install with: cargo install cargo-sort -j $(JOBS)" >&2; exit 1; } + cargo sort --check --workspace + +clippy: ## Lint with clippy, warnings are errors + cargo clippy --workspace --all-targets --locked -j $(JOBS) -- -D warnings + +test: ## Run unit and integration tests via nextest (or cargo test fallback) + @if command -v cargo-nextest >/dev/null 2>&1; then \ + cargo nextest run --workspace --locked --build-jobs $(JOBS) --profile $(NEXTEST_PROFILE); \ else \ - awk -v target="$@" -v jobs="$(JOBS)" -v nextest_profile="$(NEXTEST_PROFILE)" -v org="$(ORG)" "$$AWK_PARSER" Justfile | $(SHELL); \ + cargo test --workspace --locked -j $(JOBS); \ fi -%: - @if [ -n "$(JUST)" ]; then \ - $(JUST) --set jobs "$(JOBS)" "$*"; \ - else \ - awk -v target="$*" -v jobs="$(JOBS)" -v nextest_profile="$(NEXTEST_PROFILE)" -v org="$(ORG)" "$$AWK_PARSER" Justfile | $(SHELL); \ +doc-test: ## Run doc tests + cargo test --doc --workspace --locked -j $(JOBS) + +powerset: ## Verify feature powerset + cargo hack --feature-powerset --no-dev-deps check --workspace -j $(JOBS) + +semver: ## Guard public API against accidental breaking semver drift + @command -v cargo-semver-checks >/dev/null 2>&1 || { echo "cargo-semver-checks not found" >&2; exit 1; } + cargo semver-checks check-release --workspace + +msrv: ## Verify workspace compiles against declared MSRV floor (rust-version) + @msrv=$$(sed -n 's/^rust-version *= *"\(.*\)"/\1/p' Cargo.toml | head -1) + if rustup toolchain list | grep -q "^$$msrv"; then + cargo +"$$msrv" check --workspace --all-targets -j $(JOBS) + else + echo "msrv: toolchain $$msrv not installed (install with: rustup toolchain install $$msrv)" >&2 + fi + +deny: ## Audit licenses, bans, advisories, and sources across target triples + cargo deny check + +check: fmt-check clippy test doc-test deny ## The push gate: fmt, clippy, test, doc-test, deny + +ci: ## Run full CI Rust verification suite + cargo fmt --all -- --check + cargo clippy --workspace --all-targets --locked -j $(JOBS) -- -D warnings + if command -v cargo-nextest >/dev/null 2>&1; then + cargo nextest run --workspace --locked --build-jobs $(JOBS) --profile ci + else + cargo test --workspace --locked -j $(JOBS) fi + cargo test --doc --workspace --locked -j $(JOBS) + +##@ Hygiene & Contracts + +hygiene: typos sort-check machete spec-check toolchain-check pin-check ## Repository hygiene: typos, sort, unused deps, specs, toolchain, pins + for f in scripts/*.sh; do bash -n "$$f"; done + +typos: ## Spell check + typos + +machete: ## Hunt down unused dependencies bloating the build graph + cargo machete + +spec-check: ## Validate specs/ against LeanSpec contracts + cargo xtask spec-check + +toolchain-check: ## Verify active rustc matches rust-toolchain.toml pinned channel + cargo xtask toolchain-check + +pin-check: ## Verify dependency pins in specs/0004 match Cargo.lock + cargo xtask pin-check + +fetch-contracts: ## Fetch pinned estate contracts into .contracts/ (contracts.lock) + cargo xtask fetch-contracts + +vendor: ## Vendor all dependencies into vendor/crates for offline builds + cargo vendor vendor/crates + +vendor-check: ## Verify that vendor/crates matches Cargo.lock + @if [ -d vendor/crates ]; then + cargo vendor --versioned-dirs vendor/crates >/dev/null + git status --porcelain vendor/crates | grep -q . && { echo "vendor-check: vendor/crates is out of sync with Cargo.lock" >&2; exit 1; } || echo "vendor-check: ok" + else + echo "vendor-check: vendor/crates directory not found (run make vendor first)" >&2 + exit 1 + fi + +smoke: ## Build CLI, verify version string, and prove kd-domain has zero I/O + cargo build -p kd --locked -j $(JOBS) + @out="$$(cargo run -q -p kd --locked -j $(JOBS) -- --version)" + echo "$$out" + [[ "$$out" =~ ^kd\ [0-9]+\.[0-9]+\.[0-9]+\ \(.+\)$$ ]] || { echo "smoke: unexpected --version output" >&2; exit 1; } + cargo run -q -p kd --locked -j $(JOBS) -- demo | grep -q '"done"' || { echo "smoke: demo did not reach done" >&2; exit 1; } + if grep -rnE 'std::net|std::fs|tokio|std::process' crates/kd-domain/src; then + echo "smoke: kd-domain must not use I/O" >&2 + exit 1 + fi + echo "smoke: ok" + +##@ Release, Docs & Tooling + +audit: ## Check dependencies for known advisories + cargo audit + +sbom: ## Write a CycloneDX SBOM (*.cdx.json) + cargo cyclonedx --format json + +doc: ## Build API docs + cargo doc --workspace --no-deps -j $(JOBS) + +dist: ## Build release binaries for the host into dist/ + DIST_JOBS=$(JOBS) ./scripts/dist.sh + +release-notes: ## Roll CHANGELOG and bump version (VERSION=x.y.z) + [[ "$${VERSION:-}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$$ ]] || { echo "usage: make release-notes VERSION=x.y.z" >&2; exit 2; } + [ -f CHANGELOG.md ] || { echo "CHANGELOG.md not found" >&2; exit 1; } + grep -q '^## \[Unreleased\]' CHANGELOG.md || { echo "CHANGELOG.md has no [Unreleased] heading" >&2; exit 1; } + sed -i '0,/^version = ".*"/s//version = "'"$${VERSION}"'"/' Cargo.toml + cargo update -w --offline 2>/dev/null || cargo update -w + awk -v v="$${VERSION}" -v d="$$(date -u +%F)" ' \ + /^## \[Unreleased\]/ && !done { print; print ""; print "## [" v "] - " d; done = 1; next } \ + { print }' CHANGELOG.md > CHANGELOG.md.tmp + mv CHANGELOG.md.tmp CHANGELOG.md + echo "release-notes: set version $${VERSION}. Review the diff, then open a PR to development." + +custody-check: ## Check the custody setup (sbx doctor or blackwall doctor) + @if command -v sbx >/dev/null 2>&1; then + sbx doctor + elif command -v blackwall >/dev/null 2>&1; then + blackwall doctor + else + echo "custody-check: neither sbx nor blackwall installed" >&2 + exit 1 + fi + +workspace: ## Open this repo as a herdr agent workspace + bash scripts/herdr-workspace.sh "$$(pwd)" +pgt-install: ## Install the pgt CLI into .tools/bin + cargo install --git https://github.com/cerebral-work/pgt --rev 54d90f5 pgt --root .tools --locked -j $(JOBS) diff --git a/projectfile.yaml b/projectfile.yaml new file mode 100644 index 0000000..af9ecc4 --- /dev/null +++ b/projectfile.yaml @@ -0,0 +1,79 @@ +$schema: https://projectfile.org/schema/v1.json +kind: SoftwareSourceCode + +identity: + namespace: gg.unsigned + name: kd + version: "0.1.0" + title: + en: "kd" + summary: + en: "Signal coordination, process supervision, Linux pidfd lifecycle, graceful two-phase teardown, and RAII terminal hygiene framework in Rust." + created: "2026-10-11" + modified: "2026-11-16" + +repositories: + - url: "https://github.com/unsigned-gg/kd.git" + type: git + branch: main + role: origin + +links: + - type: source-code + url: https://github.com/unsigned-gg/kd + - type: bugs + url: https://github.com/unsigned-gg/kd/issues + +license: + spdx: Apache-2.0 OR MIT + 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: + - pidfd + - process-supervision + - signals + - subreaper + - teardown + - terminal-hygiene + - rust + +org.projectfile.ci: + nodes: + - id: toolchain-check + run: "cargo xtask toolchain-check" + - id: spec-check + depends_on: [toolchain-check] + run: "cargo xtask spec-check" + - id: pin-check + depends_on: [toolchain-check] + run: "cargo xtask pin-check" + - id: zero-io-domain + run: "! grep -rnE 'std::net|std::fs|tokio|std::process' crates/kd-domain/src" + - id: fmt + depends_on: [toolchain-check] + run: "cargo fmt --all -- --check" + - id: clippy + depends_on: [fmt, spec-check, pin-check, zero-io-domain] + run: "cargo clippy --workspace --locked -j 2 --all-targets -- -D warnings" + - id: test + depends_on: [clippy] + run: "cargo test --workspace --locked -j 2" + - id: doc-test + depends_on: [test] + run: "cargo test --doc --workspace --locked -j 2" + - id: deny + run: "cargo deny check" diff --git a/validation.dag.yaml b/validation.dag.yaml new file mode 100644 index 0000000..72b43c6 --- /dev/null +++ b/validation.dag.yaml @@ -0,0 +1,135 @@ +# kd 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: 900 + env: + CARGO_BUILD_JOBS: "2" + JOBS: "2" + +resource_caps: + cargo-target: 1 + +steps: + - job: toolchain-check + group: hygiene + desc: "Verify active rustc matches rust-toolchain.toml" + cmd: "cargo run --locked -j 2 -p xtask -- toolchain-check" + cmdtype: cargo-build + hint: + est_duration_s: 0.5 + rss_baseline_bytes: 134217728 + hard_mem_max_bytes: 536870912 + preferred_inner_jobs: 2 + resources: + cargo-target: 1 + + - job: spec-check + group: hygiene + desc: "Validate LeanSpec specifications under specs/" + cmd: "cargo run --locked -j 2 -p xtask -- spec-check" + cmdtype: unknown + deps: + - hygiene.toolchain-check + hint: + est_duration_s: 0.4 + rss_baseline_bytes: 134217728 + hard_mem_max_bytes: 536870912 + resources: + cargo-target: 1 + + - job: pin-check + group: hygiene + desc: "Verify dependency pins against Cargo.lock" + cmd: "cargo run --locked -j 2 -p xtask -- pin-check" + cmdtype: unknown + deps: + - hygiene.spec-check + hint: + est_duration_s: 0.4 + rss_baseline_bytes: 134217728 + hard_mem_max_bytes: 536870912 + resources: + cargo-target: 1 + + - job: zero-io-domain + group: hygiene + desc: "Verify kd-domain zero-I/O leaf purity" + cmd: "! grep -rnE 'std::net|std::fs|tokio|std::process' crates/kd-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 + deps: + - hygiene.toolchain-check + 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 --locked -j 2 --all-targets -- -D warnings" + cmdtype: cargo-build + deps: + - rust.fmt-check + - hygiene.pin-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 --locked -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 --locked -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 + + - job: deny + group: hygiene + desc: "Audit licenses, bans, advisories, and sources" + cmd: "cargo deny check" + cmdtype: unknown + hint: + est_duration_s: 2.0 + rss_baseline_bytes: 268435456 + hard_mem_max_bytes: 1073741824