Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[build]
jobs = 2

[registries.crates-io]
protocol = "sparse"

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ target/
.DS_Store
Cargo.lock
.agents/

# Agent custody and DAG runner stores (local runs; never committed)
.blackwall/
.dagrun/
72 changes: 72 additions & 0 deletions .saga/flows/kl-gates.toml
Original file line number Diff line number Diff line change
@@ -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.
"""
14 changes: 14 additions & 0 deletions .saga/teams.toml
Original file line number Diff line number Diff line change
@@ -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" },
]
23 changes: 23 additions & 0 deletions .saga/topologies.toml
Original file line number Diff line number Diff line change
@@ -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 },
]
70 changes: 0 additions & 70 deletions Justfile

This file was deleted.

170 changes: 53 additions & 117 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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 <target>"
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<target>\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)
16 changes: 16 additions & 0 deletions blackwall.toml
Original file line number Diff line number Diff line change
@@ -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
Loading
Loading