Skip to main content

SzpontNet

A small leaderless LAN protocol for self-discovery, resource advertisement and work hand-off. Machines on a local network find each other over UDP, gossip what they can do, and agree — with no coordinator and no election — on which machine owns each class of work. When one drops or runs dry, every survivor has already recomputed and the work has moved.

This package is the reference implementation: szpontnet/, a standard-library-only Python node run as python -m szpontnet. The protocol it implements is specified next door, in szpontnet-spec — the normative chapters and the black-box conformance tester that can judge any implementation, this one included. The split is the point: the spec is a document about a wire format, not documentation of this code, and it is versioned and read as such.

Standing on its own

The library depends on nothing — not on the application that happens to ship it in this repository, and not on any package outside the standard library (Ed25519 device identity is an optional extra; without it a node runs keyless).

Every knob it reads from the environment is SZPONTNET_<NAME>, through a single accessor (szpontnet/env.py) so that is a property of the code rather than a convention. These names are part of the spec: the conformance tester configures a candidate through them and has no other channel, so a node that reads its settings under some other spelling is one the tester cannot drive. The pre-rename DIPLOMAT_MESH_<NAME> spellings are still honoured when the new one is unset — see the module for when that can be dropped.

The canonical v1 constants and duty catalog from appendix B ship as szpontnet/netmodel.json, so a bare node is conformant out of the box. The five things it cannot answer for itself — which duties this deployment routes, where a node's state lives, where its events go, what "running a job" means on this machine, and whether that work is already under way here — it asks of a host (szpontnet/host.py). Every one has a working default, so a node with no host runs the canonical model, keeps its state in ~/.szpontnet, discards its log and declines work it has no runner for.

Diplomat is one such host (diplomat-platform/linux/diplomat_app/szponthost.py) and registers itself two ways: in-process, and by putting SZPONTNET_HOST=diplomat_app.szponthost in the environment of the node it spawns.

import szpontnet.host

class MyHost(szpontnet.host.Host):
    def model(self):
        return {"duties": [{"id": "render", "placement": {"tokenAware": False, "spread": []}}]}

    def run_job(self, prompt, done_path):
        ...  # your machine, your rules

szpontnet.host.set_host(MyHost())

Its own tests

pip install -e './packages/szpontnet-core[trust]' pytest
pytest packages/szpontnet-core/tests -q

Nothing here imports the application that ships the library, and CI runs this job with no Qt, no diplomat-core and no Diplomat on the import path — so a dependency creeping back in fails a build rather than going unnoticed. One of the tests enforces that directly: it scans every module for a mention of a host application, and another walks the package AST to catch an environment read that skips env.py.

Beyond the unit and host-seam tests, the integration ones live here too: real nodes over loopback for the control-edit state flush, the one-node-per-state-dir startup lock, and the Tor transport (deterministic — the onion dialer is injected, so no real tor runs).

Checking this node against the spec

cd packages/szpontnet-spec/conformance
python -m szpont --node-cmd "python adapters/reference.py"

The tester speaks only the wire protocol from the spec; nothing in it reads this node's source. That is what makes "independently implementable" checkable rather than aspirational — see szpontnet-spec.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

szpontnet-0.4.0.tar.gz (157.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

szpontnet-0.4.0-py3-none-any.whl (152.4 kB view details)

Uploaded Python 3

File details

Details for the file szpontnet-0.4.0.tar.gz.

File metadata

  • Download URL: szpontnet-0.4.0.tar.gz
  • Upload date:
  • Size: 157.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for szpontnet-0.4.0.tar.gz
Algorithm Hash digest
SHA256 dd4f9dbd51afe22e3d5469612e0194ed263d61d16ad4dd40b69f25e225c7dd80
MD5 517f9ed77a8d7cf514e0b801cc2fc5ac
BLAKE2b-256 909bd8bb3347ba77d9df767a92842865c92c9aa1fb0d72c39ac6ce33c66d5e22

See more details on using hashes here.

File details

Details for the file szpontnet-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: szpontnet-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 152.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for szpontnet-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aeca46cc69187587fcfed224495a0b9dc4ae4aa93a1efcecfcbda5530d1923c2
MD5 a7231457cfaefbe6d9f8b2db76f6a5f5
BLAKE2b-256 4540241aeaceeba1b61087f349abe150fa3106fc67bbb311d9a4e7da45a7eead

See more details on using hashes here.

Release history Release notifications | RSS feed

0.5.0

2 files

This release

0.4.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page