stitch-substrate 0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stitch_substrate-0.4.1/PKG-INFO +25 -0
- stitch_substrate-0.4.1/pyproject.toml +46 -0
- stitch_substrate-0.4.1/setup.cfg +4 -0
- stitch_substrate-0.4.1/stitch/__init__.py +137 -0
- stitch_substrate-0.4.1/stitch/agreement.py +989 -0
- stitch_substrate-0.4.1/stitch/core.py +380 -0
- stitch_substrate-0.4.1/stitch/crypto/__init__.py +43 -0
- stitch_substrate-0.4.1/stitch/crypto/ed25519.py +460 -0
- stitch_substrate-0.4.1/stitch/exceptions.py +31 -0
- stitch_substrate-0.4.1/stitch/stitches.py +492 -0
- stitch_substrate-0.4.1/stitch_substrate.egg-info/PKG-INFO +25 -0
- stitch_substrate-0.4.1/stitch_substrate.egg-info/SOURCES.txt +25 -0
- stitch_substrate-0.4.1/stitch_substrate.egg-info/dependency_links.txt +1 -0
- stitch_substrate-0.4.1/stitch_substrate.egg-info/requires.txt +3 -0
- stitch_substrate-0.4.1/stitch_substrate.egg-info/top_level.txt +1 -0
- stitch_substrate-0.4.1/tests/test_agreement.py +266 -0
- stitch_substrate-0.4.1/tests/test_attest_sign.py +117 -0
- stitch_substrate-0.4.1/tests/test_budget.py +307 -0
- stitch_substrate-0.4.1/tests/test_byte_exact.py +140 -0
- stitch_substrate-0.4.1/tests/test_core.py +430 -0
- stitch_substrate-0.4.1/tests/test_ed25519.py +282 -0
- stitch_substrate-0.4.1/tests/test_n_party.py +324 -0
- stitch_substrate-0.4.1/tests/test_non_ascii.py +285 -0
- stitch_substrate-0.4.1/tests/test_numeric_enforcement.py +128 -0
- stitch_substrate-0.4.1/tests/test_numeric_policy.py +177 -0
- stitch_substrate-0.4.1/tests/test_rfc8032_vectors.py +70 -0
- stitch_substrate-0.4.1/tests/test_signed_bookings.py +314 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: stitch-substrate
|
|
3
|
+
Version: 0.4.1
|
|
4
|
+
Summary: A tiny, language-portable substrate primitive for accountable agent state.
|
|
5
|
+
Author: SuperInstance
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/patchwork-quilt/stitch
|
|
8
|
+
Project-URL: Specification, https://github.com/patchwork-quilt/stitch/blob/main/SPEC.md
|
|
9
|
+
Keywords: substrate,agent,conservation-law,append-only,ledger,surprise,accountable-state
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Classifier: Topic :: System :: Distributed Computing
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Description-Content-Type: text/plain
|
|
22
|
+
Provides-Extra: test
|
|
23
|
+
Requires-Dist: pytest; extra == "test"
|
|
24
|
+
|
|
25
|
+
stitch — a tiny, language-portable substrate primitive for accountable agent state: 11 append-only stitches on hash-chained JSONL ledgers, a per-tenant conservation law, and shared state minted only where sovereign ledgers agree. Zero dependencies (Python stdlib only). Full documentation: https://github.com/patchwork-quilt/stitch
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "stitch-substrate"
|
|
7
|
+
version = "0.4.1"
|
|
8
|
+
description = "A tiny, language-portable substrate primitive for accountable agent state."
|
|
9
|
+
# The readme is inlined here on purpose: a file reference outside this
|
|
10
|
+
# project root ("../README.md") makes setuptools refuse to build at all
|
|
11
|
+
# (cold-test finding F1, 2026-10-27 — `pip install` was broken entirely).
|
|
12
|
+
# The full readme lives at the repository root.
|
|
13
|
+
readme = { text = "stitch — a tiny, language-portable substrate primitive for accountable agent state: 11 append-only stitches on hash-chained JSONL ledgers, a per-tenant conservation law, and shared state minted only where sovereign ledgers agree. Zero dependencies (Python stdlib only). Full documentation: https://github.com/patchwork-quilt/stitch", content-type = "text/plain" }
|
|
14
|
+
license = { text = "MIT" }
|
|
15
|
+
authors = [
|
|
16
|
+
{ name = "SuperInstance" }
|
|
17
|
+
]
|
|
18
|
+
requires-python = ">=3.9"
|
|
19
|
+
classifiers = [
|
|
20
|
+
"Development Status :: 3 - Alpha",
|
|
21
|
+
"Intended Audience :: Developers",
|
|
22
|
+
"License :: OSI Approved :: MIT License",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Programming Language :: Python :: 3.9",
|
|
25
|
+
"Programming Language :: Python :: 3.10",
|
|
26
|
+
"Programming Language :: Python :: 3.11",
|
|
27
|
+
"Programming Language :: Python :: 3.12",
|
|
28
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
29
|
+
"Topic :: System :: Distributed Computing",
|
|
30
|
+
]
|
|
31
|
+
keywords = ["substrate", "agent", "conservation-law", "append-only", "ledger", "surprise", "accountable-state"]
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
test = ["pytest"]
|
|
35
|
+
|
|
36
|
+
[project.urls]
|
|
37
|
+
"Homepage" = "https://github.com/patchwork-quilt/stitch"
|
|
38
|
+
"Specification" = "https://github.com/patchwork-quilt/stitch/blob/main/SPEC.md"
|
|
39
|
+
|
|
40
|
+
[tool.setuptools.packages.find]
|
|
41
|
+
include = ["stitch*"]
|
|
42
|
+
|
|
43
|
+
[tool.pytest.ini_options]
|
|
44
|
+
testpaths = ["tests"]
|
|
45
|
+
python_files = ["test_*.py"]
|
|
46
|
+
addopts = "-v --tb=short"
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"""
|
|
2
|
+
stitch — A tiny, language-portable substrate primitive for accountable agent state.
|
|
3
|
+
|
|
4
|
+
The smallest binding operation in a quilt. 11 stitches, conservation law, append-only
|
|
5
|
+
hash-chained ledger, surprise oracle. Zero dependencies.
|
|
6
|
+
|
|
7
|
+
See SPEC.md for the canonical specification.
|
|
8
|
+
See ARCHITECTURE.md for where this fits in the larger Thor synthesis.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from .core import (
|
|
12
|
+
Tenant,
|
|
13
|
+
Cell,
|
|
14
|
+
Ledger,
|
|
15
|
+
Surprise,
|
|
16
|
+
KLSurprise,
|
|
17
|
+
LOG2_3,
|
|
18
|
+
FNV_OFFSET,
|
|
19
|
+
FNV_PRIME,
|
|
20
|
+
MASK_64,
|
|
21
|
+
ConservationError,
|
|
22
|
+
LedgerError,
|
|
23
|
+
)
|
|
24
|
+
from .exceptions import (
|
|
25
|
+
StitchError,
|
|
26
|
+
BindError,
|
|
27
|
+
EffectRejected,
|
|
28
|
+
UnknownCell,
|
|
29
|
+
)
|
|
30
|
+
from .stitches import (
|
|
31
|
+
bind,
|
|
32
|
+
link,
|
|
33
|
+
effect,
|
|
34
|
+
view,
|
|
35
|
+
tick,
|
|
36
|
+
attest,
|
|
37
|
+
delegate,
|
|
38
|
+
contest,
|
|
39
|
+
merger,
|
|
40
|
+
revoke,
|
|
41
|
+
withdraw,
|
|
42
|
+
declare_budget,
|
|
43
|
+
TENANT_KIND,
|
|
44
|
+
)
|
|
45
|
+
from .agreement import (
|
|
46
|
+
EXCHANGE_KIND,
|
|
47
|
+
AGREED,
|
|
48
|
+
NO_SEND,
|
|
49
|
+
MISSING_MIRROR,
|
|
50
|
+
PAYLOAD_MISMATCH,
|
|
51
|
+
PEER_MISMATCH,
|
|
52
|
+
CHAIN_BROKEN,
|
|
53
|
+
LAW_VIOLATED,
|
|
54
|
+
BAD_SIGNATURE,
|
|
55
|
+
UNSIGNED_BOOKING,
|
|
56
|
+
booking_signing_material,
|
|
57
|
+
AuditVerdict,
|
|
58
|
+
Agreement,
|
|
59
|
+
AgreementN,
|
|
60
|
+
AnchorVerdict,
|
|
61
|
+
payload_hash,
|
|
62
|
+
book_send,
|
|
63
|
+
book_receive,
|
|
64
|
+
audit_ledger,
|
|
65
|
+
agree,
|
|
66
|
+
agreed_state,
|
|
67
|
+
verify_anchor,
|
|
68
|
+
agree_n,
|
|
69
|
+
agreed_state_n,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
__version__ = "0.4.1"
|
|
73
|
+
__author__ = "SuperInstance"
|
|
74
|
+
__license__ = "MIT"
|
|
75
|
+
|
|
76
|
+
__all__ = [
|
|
77
|
+
# Constants
|
|
78
|
+
"LOG2_3",
|
|
79
|
+
"FNV_OFFSET",
|
|
80
|
+
"FNV_PRIME",
|
|
81
|
+
"MASK_64",
|
|
82
|
+
# Core
|
|
83
|
+
"Tenant",
|
|
84
|
+
"Cell",
|
|
85
|
+
"Ledger",
|
|
86
|
+
"Surprise",
|
|
87
|
+
"KLSurprise",
|
|
88
|
+
"ConservationError",
|
|
89
|
+
"LedgerError",
|
|
90
|
+
# Exceptions
|
|
91
|
+
"StitchError",
|
|
92
|
+
"BindError",
|
|
93
|
+
"EffectRejected",
|
|
94
|
+
"UnknownCell",
|
|
95
|
+
# Stitches
|
|
96
|
+
"bind",
|
|
97
|
+
"link",
|
|
98
|
+
"effect",
|
|
99
|
+
"view",
|
|
100
|
+
"tick",
|
|
101
|
+
"attest",
|
|
102
|
+
"delegate",
|
|
103
|
+
"contest",
|
|
104
|
+
"merger",
|
|
105
|
+
"revoke",
|
|
106
|
+
"withdraw",
|
|
107
|
+
# Tenant declaration helpers (v0.3 — not new stitches; helpers that use BIND)
|
|
108
|
+
"declare_budget",
|
|
109
|
+
"TENANT_KIND",
|
|
110
|
+
# Agreement (v0.2)
|
|
111
|
+
"EXCHANGE_KIND",
|
|
112
|
+
"AGREED",
|
|
113
|
+
"NO_SEND",
|
|
114
|
+
"MISSING_MIRROR",
|
|
115
|
+
"PAYLOAD_MISMATCH",
|
|
116
|
+
"PEER_MISMATCH",
|
|
117
|
+
"CHAIN_BROKEN",
|
|
118
|
+
"LAW_VIOLATED",
|
|
119
|
+
# TRACK-C PROTOTYPE (signed bookings)
|
|
120
|
+
"BAD_SIGNATURE",
|
|
121
|
+
"UNSIGNED_BOOKING",
|
|
122
|
+
"booking_signing_material",
|
|
123
|
+
"AuditVerdict",
|
|
124
|
+
"Agreement",
|
|
125
|
+
"AgreementN",
|
|
126
|
+
"AnchorVerdict",
|
|
127
|
+
"payload_hash",
|
|
128
|
+
"book_send",
|
|
129
|
+
"book_receive",
|
|
130
|
+
"audit_ledger",
|
|
131
|
+
"agree",
|
|
132
|
+
"agreed_state",
|
|
133
|
+
"verify_anchor",
|
|
134
|
+
# N-party agreement (v0.3 — closes the "bilateral only" gap)
|
|
135
|
+
"agree_n",
|
|
136
|
+
"agreed_state_n",
|
|
137
|
+
]
|