Pure PoUW decision algorithm — the fabric of knit decisions; zero dependencies, embeddable everywhere
Project description
knitfield — The Fabric of Decision
The pure, dependency-free reasoning engine behind Knitweb's Proof-of-Useful-Work settlement. Where individual decision threads (knits) are woven together into the proof fabric.
Design
knitfield answers one fundamental question: given a claimed proof of work, does it satisfy the job's verification policy and therefore warrant settlement?
Job Class Registry → (e.g., "synaptic-compile", "distill", "smart-contract-procedure")
↓
Verification Policy → (e.g., "uniform" = deterministic; "split" = structural + challenge window)
↓
Pure Decision Predicate → (e.g., split_settles: deterministic_ok AND window_closed AND NOT dispute_upheld)
↓
Settlement Decision → (accept work, mint token reward, or slash)
Knitfield is embedded locally in every Knitweb node, running inside the node's process alongside its Fabric memory state. There is no central server — each peer independently applies knitfield's logic to weave decisions into the proof fabric, accepting or rejecting work proofs through the P2P network.
Architecture
src/knitweb_knitfield/
__init__.py
registry.py — JobClass, register_job_class, job_class, verification_policy
settlement.py — split_settles (pure predicate for distill/split-verified work)
Zero Dependencies
Knitfield imports only Python stdlib. It carries no crypto, networking, or data-structure dependencies, so it can run in any context (IoT, embedded, pure Python, JVM via Jython, etc.) — the decision logic is universally portable.
Usage
from knitweb_knitfield import register_job_class, VERIFICATION_UNIFORM, split_settles
# Register a new job type
register_job_class("my-custom-job", VERIFICATION_UNIFORM)
# Query the registry
policy = job_class("my-custom-job").verification
assert policy == VERIFICATION_UNIFORM
# Pure settlement decision for split-verified work (distill, etc.)
is_settlement_ok = split_settles(
deterministic_ok=True,
window_closed=True,
dispute_upheld=False,
)
assert is_settlement_ok is True
Integration with Knitweb
- Heart (
Knitweb/heart): depends on knitfield; exports the registry + settlement policy. - Vein (
Knitweb/vein): depends on knitfield; registers the "smart-contract-procedure" job class. - Molgang (
Knitweb/molgang): uses knitfield to decide work settlement in the P2P quorum. - Ledgerfield (
Knitweb/ledgerfield): embeds knitfield in settlement nodes for DAO treasury decisions.
Docs
See docs/SETTLEMENT_POLICIES.md for a detailed explanation of VERIFICATION_UNIFORM vs
VERIFICATION_SPLIT and how to compose new policies.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file knitweb_knitfield-0.1.0-py3-none-any.whl.
File metadata
- Download URL: knitweb_knitfield-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43323d5392dc6f616e8f11c61693422e1c807c028103cc89e5c5414ce5df9cdf
|
|
| MD5 |
4d4f55bf0840f72c7b299a48811da53d
|
|
| BLAKE2b-256 |
ea05b00cfe8b387284ef1ff513d0b0480bba426ed52e2f613e93608f4c75c72c
|