Skip to content

hyperpolymath/bag-of-actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Bag-of-Actions

OpenSSF Best Practices License: MPL-2.0 Green Web Elixir Zig Ephapax

Capability-Aware Continuation Mesh

Mobile work that follows resources, not static DAGs.

What is Bag-of-Actions?

Bag-of-Actions is a distributed operating system for mobile continuations. Unlike traditional workflow engines that push tasks to static queues, Bag-of-Actions represents units of work as Batons—serialized execution states that search for environments matching their required capabilities.

  • Resource Safety — Linear types ensure work is never lost or duplicated.

  • Resumable execution — Pause execution on one node, resume on another.

  • Capability Routing — Dynamic dispatch based on hardware, identity, and trust.

  • Polylingual Mesh — Orchestrated by Elixir, executed by Zig, proven by Idris.

Implementation status

Milestone Status Capability

1. Local Baton Cycle

✓ Complete

Zig-hosted Wasm "Freeze/Thaw" state cycle.

2. Elixir Mesh

✓ Complete

Distributed orchestration and Baton handoffs via process groups.

3. Verified ABI

✓ Complete

Idris 2 formal proofs for linear resource preservation typecheck (idris2 --typecheck bag.ipkg). They are source-of-truth specs, not yet runtime-invoked — see EXPLAINME.adoc.

4. Guix Integration

✓ Complete

Guix build orchestration from the Zig host (shelling out to the guix CLI; a direct daemon-socket interface is future work — see EXPLAINME.adoc).

Features

  • Linear Baton Logic — Modelled on Ephapax linear types. In the current POC one-time consumption is enforced by the Elixir orchestrator (process isolation); language-level linearity is a Milestone 3+ goal (see EXPLAINME.adoc).

  • Mobile Wasm Contexts — State capture of WebAssembly execution via return values and CLI output; full linear-memory snapshotting is planned (see EXPLAINME.adoc).

  • Guix-Powered Builds — Integrated Guix orchestration for reproducible artifact creation during continuation steps.

  • Formal Estate Manifest — Verified mapping of infrastructure capabilities (Linux, macOS, GPU, Guix) to physical nodes, mirrored across Estate.idr, src/estate.zig, and nodes.scm.

  • Distributed Fault Tolerance — Built on Elixir/OTP, leveraging the BEAM for robust node discovery and supervision.

  • Trust Attestation — Every frozen verdict carries an HMAC-SHA256 integrity digest, plus an optional ed25519 signature (per-node key) for authenticity; tampering is rejected on thaw. See src/main.zig (CheckBaton) and docs/ci-check-baton.adoc.

Quick start

# Build the Zig host
zig build

# Initialize a new Baton starting at counter 0
./zig-out/bin/bag_of_actions init

# Run the Elixir orchestrator
# This will trigger a recursive 10-step distributed handoff demo
cd bag
mix compile
elixir --sname mesh1 --cookie bag_secret -S mix run -e "Bag.Mesh.submit(0); :timer.sleep(15000)"

Wondering how this works? See EXPLAINME.adoc.

Repository layout

Path Purpose

src/

Zig source code for the Execution Host (Baton supervisor).

bag/

Elixir source code for the Mesh Orchestrator (Control Plane).

verification/

Idris 2 formal proofs and the Estate Manifest (Bag.Estate).

nodes.scm

Guix-native representation of the estate capabilities.

baton.txt

Persistent serialization format for the Milestone 1/2 Baton.

Documentation

License

Distributed under the MPL-2.0 (MPL-2.0).

The future of work is mobile.

About

Capability-aware, resumable, distributed continuation runtime based on Elixir, Ephapax, and Zig.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages