Skip to content
BalanovPublic

About

Fail-closed swarm orchestration with epoch-fenced work and late-completion rejection.

Topics

Resources

Contributing

Security policy

Stars

27 stars

Watchers

0 watching

Forks

Repository files navigation

SKEIN — fail-closed orchestration for local agent swarms, with an epoch fence that rejects late results

Fail-closed orchestration for local agent swarms.

Explicit task graphs · bounded concurrency · persistent epoch fence · MIT

Install · Run · Stop boundary · Measurements · Benchmarks · Русский

CI Latest release MIT license Go 1.26+

Recorded SKEIN stop proof: 160 of 160 real parent and child trees stopped, 160 of 160 heartbeats frozen, with median 141.663 ms

Recorded stop proof from windows-amd64-stop.json · 20 runs · Reproduce the proof.

Skein executes explicit task graphs with bounded concurrency and a persistent epoch fence. An emergency stop invalidates queued work and rejects late completions from the old epoch instead of merely labeling a task canceled.

Independent open-source project by Paritet. Skein is an execution control plane, not an agent framework or a model runtime. Version 0.2.0 is an early release: exercise the stop proof against your own workloads before relying on it operationally.

Architecture · Security boundary · Integration · Benchmarks · Landing source

Install

Linux and macOS:

curl -fsSL https://raw.githubusercontent.com/Balanov/skein/main/install.sh | sh

Windows PowerShell:

irm https://raw.githubusercontent.com/Balanov/skein/main/install.ps1 | iex

Both scripts pick the binary for the current OS and architecture (Linux, macOS, Windows × amd64, arm64), verify it against SHA256SUMS and install into a user directory. Set SKEIN_INSTALL_DIR to override. Alternatively, download binaries from releases or build from source with Go 1.26+:

go build -trimpath -o bin/skein ./cmd/skein

The binary is static, needs no daemon, database or runtime dependencies.

Run

skein run --state .skein --workers 2 --include-tasks examples/fanout.json
skein stop --state .skein --reason "manual emergency stop"
skein status --state .skein   # {"stopped":true,"epoch":2}
skein reset --state .skein    # inspect first; epoch is never reused

A run stores report.json, events.jsonl, leases and payload data under .skein/runs/<run-id>/. Exit codes: 0 success, 3 a task failed, 4 the run was stopped, 1 operational error, 2 usage error.

Manifests are JSON: argv arrays without an implicit shell, dependency graphs, reusable multi-pass blocks, worker and pass limits, per-pass timeouts. See docs/INTEGRATION.md for the full contract and the Go embedding API (import skein "github.com/Balanov/skein", runnable example in examples/embed-go/).

What the stop does — and what it does not

Covered: scheduling within one local run; a persistent idempotent stop latch; epoch-fenced queued work; rejection of late completions; termination of tracked local process trees on Linux, macOS and Windows.

Not covered: sandboxing arbitrary commands; authentication or signed leases; semantic validation of agent output; exactly-once external side effects; automatic crash recovery; distributed consensus; remote or detached work, and side effects that already crossed an external boundary.

A lease is a fencing token, not a credential — external systems honor it only through a gateway that checks it. Manifest commands keep the OS user's permissions; use an OS sandbox for untrusted workloads. See SECURITY.md.

SKEIN stop state transition: persistent latch, new epoch, tracked process-tree termination, and late-result rejection

The stop changes scheduling state; it does not create a sandbox, remote stop, or exactly-once external-effect guarantee. Full architecture · Security boundary.

Measurements

Recorded on Windows 11 / Ryzen 9 5950X; each warm result is the median of 15 interleaved samples on identical graphs.

1,000-node graph Skein Python asyncio LangGraph
Independent 1.580 ms 3.530 ms 876.910 ms
Serial chain 3.272 ms 4.479 ms 534.907 ms
Fan-out / join 2.080 ms 3.795 ms 892.522 ms

A separate cold-process test launched 24 real Python SHA-256 workers per run. Over 15 fresh-process runs, Skein's median was 156.463 ms versus 288.644 ms for asyncio and 998.010 ms for LangGraph, with 360 / 360 results verified for every candidate. The stop proof terminated 160 / 160 real parent/child trees and froze 160 / 160 child heartbeats in 141.663 ms median over 20 runs.

Skein is not ahead everywhere: at 100 independent tasks asyncio had a lower median (0.740 ms versus 1.040 ms). These are local observations, not universal rankings or model-quality results. Full methodology, p95, scaling and reproduction commands: BENCHMARKS.md.

Checks

go test -count=1 ./...
go vet ./...
go test -race -count=1 ./... # requires CGO and a C compiler

CI runs formatting, tests, vet, the Linux race detector, six cross-compile targets, the frontend build, and real functional plus parent/child stop proofs on six native runners (Linux, Windows, macOS × amd64, arm64). Tagged releases build each binary on its native platform and re-run both proofs per binary before publishing.

Related projects

  • uncut — the lossless, headless coding-agent harness.
  • shim — a local-first harness for any model, MCP servers and Agent Skills.
  • equal — turns real API traffic into a local sandbox and an OpenAPI spec.
  • until — evidence-gated autonomous product operations.

License

MIT © 2026 Balanov. Machine-readable citation: CITATION.cff.

About

Fail-closed swarm orchestration with epoch-fenced work and late-completion rejection.

Topics

Resources

Contributing

Security policy

Stars

27 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages