succession-cli 0.2.0__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.
Files changed (72) hide show
  1. succession_cli-0.2.0/.gitignore +42 -0
  2. succession_cli-0.2.0/PKG-INFO +56 -0
  3. succession_cli-0.2.0/README.md +12 -0
  4. succession_cli-0.2.0/hatch_build.py +57 -0
  5. succession_cli-0.2.0/pyproject.toml +83 -0
  6. succession_cli-0.2.0/src/succession/__init__.py +52 -0
  7. succession_cli-0.2.0/src/succession/acp.py +522 -0
  8. succession_cli-0.2.0/src/succession/acp_cli.py +133 -0
  9. succession_cli-0.2.0/src/succession/agent.py +288 -0
  10. succession_cli-0.2.0/src/succession/audit.py +470 -0
  11. succession_cli-0.2.0/src/succession/canonical.py +103 -0
  12. succession_cli-0.2.0/src/succession/catalog.py +571 -0
  13. succession_cli-0.2.0/src/succession/certificate.py +113 -0
  14. succession_cli-0.2.0/src/succession/chain.py +678 -0
  15. succession_cli-0.2.0/src/succession/cli.py +895 -0
  16. succession_cli-0.2.0/src/succession/data/__init__.py +1 -0
  17. succession_cli-0.2.0/src/succession/data/artifacts.json +1789 -0
  18. succession_cli-0.2.0/src/succession/data/base-sepolia.json +11 -0
  19. succession_cli-0.2.0/src/succession/dataroom.py +275 -0
  20. succession_cli-0.2.0/src/succession/demo.py +200 -0
  21. succession_cli-0.2.0/src/succession/demokeys.py +33 -0
  22. succession_cli-0.2.0/src/succession/envelope.py +140 -0
  23. succession_cli-0.2.0/src/succession/erc8004.py +603 -0
  24. succession_cli-0.2.0/src/succession/evaluator.py +459 -0
  25. succession_cli-0.2.0/src/succession/export.py +237 -0
  26. succession_cli-0.2.0/src/succession/fulfil.py +165 -0
  27. succession_cli-0.2.0/src/succession/importer.py +243 -0
  28. succession_cli-0.2.0/src/succession/marketplace.py +159 -0
  29. succession_cli-0.2.0/src/succession/mcp_server/__init__.py +309 -0
  30. succession_cli-0.2.0/src/succession/memory/__init__.py +23 -0
  31. succession_cli-0.2.0/src/succession/memory/base.py +172 -0
  32. succession_cli-0.2.0/src/succession/memory/credentials.py +135 -0
  33. succession_cli-0.2.0/src/succession/memory/sibyl.py +451 -0
  34. succession_cli-0.2.0/src/succession/merkle.py +226 -0
  35. succession_cli-0.2.0/src/succession/provenance.py +187 -0
  36. succession_cli-0.2.0/src/succession/publish.py +361 -0
  37. succession_cli-0.2.0/src/succession/redaction.py +238 -0
  38. succession_cli-0.2.0/src/succession/reputation.py +404 -0
  39. succession_cli-0.2.0/src/succession/scope.py +344 -0
  40. succession_cli-0.2.0/src/succession/seal.py +309 -0
  41. succession_cli-0.2.0/src/succession/seed.py +309 -0
  42. succession_cli-0.2.0/src/succession/settlement.py +543 -0
  43. succession_cli-0.2.0/src/succession/smp.py +386 -0
  44. succession_cli-0.2.0/src/succession/transfer.py +322 -0
  45. succession_cli-0.2.0/src/succession/valuation.py +306 -0
  46. succession_cli-0.2.0/tests/chain.py +127 -0
  47. succession_cli-0.2.0/tests/conftest.py +32 -0
  48. succession_cli-0.2.0/tests/test_acp.py +281 -0
  49. succession_cli-0.2.0/tests/test_agent.py +92 -0
  50. succession_cli-0.2.0/tests/test_catalog.py +139 -0
  51. succession_cli-0.2.0/tests/test_categories_transfer.py +143 -0
  52. succession_cli-0.2.0/tests/test_chain_transfer.py +304 -0
  53. succession_cli-0.2.0/tests/test_claims.py +116 -0
  54. succession_cli-0.2.0/tests/test_cli.py +163 -0
  55. succession_cli-0.2.0/tests/test_cli_commands.py +238 -0
  56. succession_cli-0.2.0/tests/test_contract.py +455 -0
  57. succession_cli-0.2.0/tests/test_dataroom.py +85 -0
  58. succession_cli-0.2.0/tests/test_erc8004.py +274 -0
  59. succession_cli-0.2.0/tests/test_evaluator.py +417 -0
  60. succession_cli-0.2.0/tests/test_mcp.py +83 -0
  61. succession_cli-0.2.0/tests/test_merkle.py +136 -0
  62. succession_cli-0.2.0/tests/test_partial.py +187 -0
  63. succession_cli-0.2.0/tests/test_publish.py +228 -0
  64. succession_cli-0.2.0/tests/test_reputation.py +255 -0
  65. succession_cli-0.2.0/tests/test_roundtrip.py +227 -0
  66. succession_cli-0.2.0/tests/test_scope.py +234 -0
  67. succession_cli-0.2.0/tests/test_seal.py +87 -0
  68. succession_cli-0.2.0/tests/test_service.py +673 -0
  69. succession_cli-0.2.0/tests/test_sibyl_credentials.py +182 -0
  70. succession_cli-0.2.0/tests/test_transfer.py +324 -0
  71. succession_cli-0.2.0/tests/test_valuation.py +162 -0
  72. succession_cli-0.2.0/tests/test_walkthrough.py +133 -0
@@ -0,0 +1,42 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ .venv/
5
+ venv/
6
+ *.egg-info/
7
+ .pytest_cache/
8
+ .ruff_cache/
9
+ dist/
10
+ build/
11
+
12
+ # Node
13
+ node_modules/
14
+ web/dist/
15
+ .vite/
16
+
17
+ # Foundry
18
+ contracts/out/
19
+ contracts/cache/
20
+ contracts/broadcast/
21
+ contracts/lib/
22
+
23
+ # Local state — never commit memory stores, keys, or credentials
24
+ *.db
25
+ *.db-wal
26
+ *.db-shm
27
+ .env
28
+ .env.*
29
+ !.env.example
30
+ .succession/
31
+ demo-state/
32
+
33
+ # Netlify CLI link state (machine-local)
34
+ .netlify/
35
+
36
+ # Local run artifacts
37
+ transfer-runs/
38
+ deployments/local.json
39
+ deployments/transfers-local.json
40
+
41
+ # Recording scratch
42
+ .record-state/
@@ -0,0 +1,56 @@
1
+ Metadata-Version: 2.5
2
+ Name: succession-cli
3
+ Version: 0.2.0
4
+ Summary: The property layer for agent memory — SMP export/hash/import, provenance, valuation, sealing, and transfer.
5
+ Project-URL: Homepage, https://github.com/linoxbt/Succession
6
+ Project-URL: Source, https://github.com/linoxbt/Succession
7
+ Project-URL: Issues, https://github.com/linoxbt/Succession/issues
8
+ License: MIT
9
+ Keywords: agent,base,erc-8004,memory,merkle,provenance
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Topic :: Security :: Cryptography
16
+ Requires-Python: >=3.11
17
+ Requires-Dist: eth-account>=0.13.0
18
+ Requires-Dist: eth-utils>=5.0.0
19
+ Requires-Dist: pycryptodome>=3.20
20
+ Requires-Dist: sibyl-memory-client>=0.8.0
21
+ Provides-Extra: acp
22
+ Requires-Dist: virtuals-acp>=0.3.23; extra == 'acp'
23
+ Provides-Extra: chain
24
+ Requires-Dist: web3>=7.0; extra == 'chain'
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest-cov>=5.0; extra == 'dev'
27
+ Requires-Dist: pytest>=8.0; extra == 'dev'
28
+ Provides-Extra: mcp
29
+ Requires-Dist: mcp>=1.2; extra == 'mcp'
30
+ Requires-Dist: web3>=7.0; extra == 'mcp'
31
+ Provides-Extra: service
32
+ Requires-Dist: fastapi>=0.115; extra == 'service'
33
+ Requires-Dist: httpx>=0.27; extra == 'service'
34
+ Requires-Dist: uvicorn>=0.32; extra == 'service'
35
+ Provides-Extra: test
36
+ Requires-Dist: eth-tester>=0.12.0b1; extra == 'test'
37
+ Requires-Dist: fastapi>=0.115; extra == 'test'
38
+ Requires-Dist: httpx>=0.27; extra == 'test'
39
+ Requires-Dist: py-evm==0.12.1b1; extra == 'test'
40
+ Requires-Dist: pytest-cov>=5.0; extra == 'test'
41
+ Requires-Dist: pytest>=8.0; extra == 'test'
42
+ Requires-Dist: web3>=7.0; extra == 'test'
43
+ Description-Content-Type: text/markdown
44
+
45
+ # `succession` — the SMP pipeline
46
+
47
+ The Python core of Succession: export a tenant's memory into a Succession
48
+ Memory Package, hash and sign it, import it into a fresh tenant, and prove the
49
+ result matches what was committed on-chain.
50
+
51
+ See the [repository README](../../README.md) for the full picture. Quick start:
52
+
53
+ ```bash
54
+ pip install -e ".[dev]"
55
+ pytest
56
+ ```
@@ -0,0 +1,12 @@
1
+ # `succession` — the SMP pipeline
2
+
3
+ The Python core of Succession: export a tenant's memory into a Succession
4
+ Memory Package, hash and sign it, import it into a fresh tenant, and prove the
5
+ result matches what was committed on-chain.
6
+
7
+ See the [repository README](../../README.md) for the full picture. Quick start:
8
+
9
+ ```bash
10
+ pip install -e ".[dev]"
11
+ pytest
12
+ ```
@@ -0,0 +1,57 @@
1
+ """Ship the two files an installed CLI cannot work without.
2
+
3
+ `contracts/out/artifacts.json` is a Foundry build product and gitignored, and
4
+ `deployments/base-sepolia.json` lives at the repo root. Neither is under
5
+ `src/succession/`, so neither reached the wheel, and the chain commands — the
6
+ three the product is actually about — were unreachable for anyone who installed
7
+ rather than cloned.
8
+
9
+ Copying them into `src/succession/data/` at build time keeps one copy in the
10
+ repo as the source of truth while making the wheel self-contained. The ABI has
11
+ to be compiled first; a build without it is refused rather than producing a
12
+ wheel that installs cleanly and then fails on the first chain read, which is the
13
+ failure mode this whole file exists to prevent.
14
+ """
15
+
16
+ from __future__ import annotations
17
+
18
+ import shutil
19
+ from pathlib import Path
20
+
21
+ from hatchling.builders.hooks.plugin.interface import BuildHookInterface
22
+
23
+ ROOT = Path(__file__).resolve().parents[2]
24
+ DATA = Path(__file__).resolve().parent / "src" / "succession" / "data"
25
+
26
+ SOURCES = {
27
+ "artifacts.json": ROOT / "contracts" / "out" / "artifacts.json",
28
+ "base-sepolia.json": ROOT / "deployments" / "base-sepolia.json",
29
+ }
30
+
31
+
32
+ class SuccessionBuildHook(BuildHookInterface):
33
+ PLUGIN_NAME = "succession-data"
34
+
35
+ def initialize(self, version: str, build_data: dict) -> None:
36
+ DATA.mkdir(parents=True, exist_ok=True)
37
+ (DATA / "__init__.py").write_text(
38
+ '"""Data files shipped with the wheel. See hatch_build.py."""\n',
39
+ encoding="utf-8",
40
+ )
41
+
42
+ # The copies under `data/` are tracked in git, which is what makes
43
+ # `pip install git+https://…` work: a build from a clone has no
44
+ # `contracts/out/` because that directory is a gitignored Foundry
45
+ # output. So a missing source here refreshes nothing rather than
46
+ # failing, and the tracked copy ships as-is.
47
+ for name, path in SOURCES.items():
48
+ if path.is_file():
49
+ shutil.copyfile(path, DATA / name)
50
+ elif not (DATA / name).is_file():
51
+ raise RuntimeError(
52
+ f"{name} is neither built nor tracked. Run `npm run build` "
53
+ "in contracts/ and commit "
54
+ f"packages/succession/src/succession/data/{name}; a wheel "
55
+ "without it installs cleanly and then fails on every chain "
56
+ "command, which is worse than a failed build."
57
+ )
@@ -0,0 +1,83 @@
1
+ [project]
2
+ # The command is `succession`; the distribution cannot be. That name has been
3
+ # taken on PyPI since 2016 by an unrelated library, so `pipx install succession`
4
+ # installs someone else's linked lists and no succession command at all — which
5
+ # is exactly what the app used to tell buyers to run.
6
+ name = "succession-cli"
7
+ version = "0.2.0"
8
+ description = "The property layer for agent memory — SMP export/hash/import, provenance, valuation, sealing, and transfer."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = { text = "MIT" }
12
+ keywords = ["agent", "memory", "erc-8004", "provenance", "merkle", "base"]
13
+ classifiers = [
14
+ "Development Status :: 4 - Beta",
15
+ "Intended Audience :: Developers",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Topic :: Security :: Cryptography",
20
+ ]
21
+
22
+ dependencies = [
23
+ "sibyl-memory-client>=0.8.0",
24
+ "eth-account>=0.13.0",
25
+ "eth-utils>=5.0.0",
26
+ "pycryptodome>=3.20",
27
+ ]
28
+
29
+ [project.urls]
30
+ Homepage = "https://github.com/linoxbt/Succession"
31
+ Source = "https://github.com/linoxbt/Succession"
32
+ Issues = "https://github.com/linoxbt/Succession/issues"
33
+
34
+ [project.optional-dependencies-note]
35
+ # virtuals-acp is an extra rather than a hard dependency: it pulls a socket
36
+ # client and wants wallet credentials, and the SMP pipeline must stay runnable
37
+ # without either.
38
+
39
+ [project.optional-dependencies]
40
+ dev = ["pytest>=8.0", "pytest-cov>=5.0"]
41
+ service = ["fastapi>=0.115", "uvicorn>=0.32", "httpx>=0.27"]
42
+ acp = ["virtuals-acp>=0.3.23"]
43
+ chain = ["web3>=7.0"]
44
+ mcp = ["mcp>=1.2", "web3>=7.0"]
45
+ # Everything the full suite needs. `dev` alone runs the pure-pipeline tests;
46
+ # `test` additionally executes the compiled contract bytecode in py-evm and
47
+ # drives the FastAPI layer through starlette's TestClient, which needs httpx.
48
+ # Without this the suite fails at *collection* on a fresh install, which is a
49
+ # worse failure than a red test: it looks like the code is broken.
50
+ test = [
51
+ "pytest>=8.0",
52
+ "pytest-cov>=5.0",
53
+ "httpx>=0.27",
54
+ "fastapi>=0.115",
55
+ "web3>=7.0",
56
+ "py-evm==0.12.1b1",
57
+ "eth-tester>=0.12.0b1",
58
+ ]
59
+
60
+ [project.scripts]
61
+ succession = "succession.cli:main"
62
+ succession-acp = "succession.acp_cli:main"
63
+ succession-mcp = "succession.mcp_server:main"
64
+
65
+ [build-system]
66
+ requires = ["hatchling"]
67
+ build-backend = "hatchling.build"
68
+
69
+ [tool.hatch.build.targets.wheel]
70
+ packages = ["src/succession"]
71
+ # `data/` is gitignored because it is copied in from the repo at build time, and
72
+ # hatchling honours VCS ignores when selecting files. `artifacts` is the
73
+ # override for exactly this case: build products that must ship anyway.
74
+ artifacts = ["src/succession/data/*.json", "src/succession/data/__init__.py"]
75
+
76
+ # The ABI and the deployment record are copied in from the repo at build time.
77
+ # Without them an installed CLI cannot reach the chain at all. See hatch_build.py.
78
+ [tool.hatch.build.targets.wheel.hooks.custom]
79
+ path = "hatch_build.py"
80
+
81
+ [tool.pytest.ini_options]
82
+ testpaths = ["tests"]
83
+ addopts = "-q"
@@ -0,0 +1,52 @@
1
+ """Succession — the property layer for agent memory.
2
+
3
+ Public surface:
4
+
5
+ from succession import export_tenant, import_package, open_tenant
6
+
7
+ Everything else is reachable through the submodules: :mod:`succession.smp` for
8
+ the package format, :mod:`succession.merkle` for the integrity scheme,
9
+ :mod:`succession.valuation`, :mod:`succession.dataroom`, :mod:`succession.seal`,
10
+ and :mod:`succession.certificate`.
11
+ """
12
+
13
+ from .canonical import canonical_bytes, canonical_json
14
+ from .export import ExportResult, build_package, export_tenant, read_all
15
+ from .importer import ImportResult, IntegrityMismatch, import_package, verify_package
16
+ from .memory.sibyl import SibylMemory, open_tenant
17
+ from .merkle import MerkleTree, build_tree, to_hex, verify_proof
18
+ from .provenance import SignatureError, sign_header, verify_header
19
+ from .redaction import Disclosure, Sensitivity, mark, read_disclosure
20
+ from .smp import DATA_CATEGORIES, SMP_CATEGORIES, SMP_VERSION, SMPPackage
21
+
22
+ __version__ = "0.1.0"
23
+
24
+ __all__ = [
25
+ "DATA_CATEGORIES",
26
+ "SMP_CATEGORIES",
27
+ "SMP_VERSION",
28
+ "Disclosure",
29
+ "ExportResult",
30
+ "ImportResult",
31
+ "IntegrityMismatch",
32
+ "MerkleTree",
33
+ "SMPPackage",
34
+ "Sensitivity",
35
+ "SibylMemory",
36
+ "SignatureError",
37
+ "build_package",
38
+ "build_tree",
39
+ "canonical_bytes",
40
+ "canonical_json",
41
+ "export_tenant",
42
+ "import_package",
43
+ "mark",
44
+ "open_tenant",
45
+ "read_all",
46
+ "read_disclosure",
47
+ "sign_header",
48
+ "to_hex",
49
+ "verify_header",
50
+ "verify_package",
51
+ "verify_proof",
52
+ ]