mppi-protocol 0.1.2__tar.gz → 0.1.3__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 (56) hide show
  1. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/PKG-INFO +19 -1
  2. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/README.md +18 -0
  3. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/pyproject.toml +1 -1
  4. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/capabilities.py +28 -0
  5. mppi_protocol-0.1.3/src/mppi_protocol/chain.py +1495 -0
  6. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/circle.py +108 -143
  7. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/contract.py +10 -0
  8. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/discovery.py +9 -3
  9. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/follower.py +185 -43
  10. mppi_protocol-0.1.3/src/mppi_protocol/http.py +217 -0
  11. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/operations.py +22 -7
  12. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/signing.py +49 -0
  13. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/types.py +10 -1
  14. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_chain.py +531 -23
  15. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_circle.py +84 -39
  16. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_circle_activation.py +18 -37
  17. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_deployment.py +9 -0
  18. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_follower.py +164 -2
  19. mppi_protocol-0.1.3/tests/test_funding_check.py +191 -0
  20. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_http_transport.py +198 -5
  21. mppi_protocol-0.1.2/src/mppi_protocol/chain.py +0 -835
  22. mppi_protocol-0.1.2/src/mppi_protocol/http.py +0 -126
  23. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/.gitignore +0 -0
  24. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/LICENSE +0 -0
  25. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi/__init__.py +0 -0
  26. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi/py.typed +0 -0
  27. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi/v1/__init__.py +0 -0
  28. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi/v1/mppi_pb2.py +0 -0
  29. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi/v1/mppi_pb2.pyi +0 -0
  30. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi/v1/mppi_pb2_grpc.py +0 -0
  31. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/__init__.py +0 -0
  32. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/_observers.py +0 -0
  33. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/accounting.py +0 -0
  34. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/amounts.py +0 -0
  35. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/catalog.py +0 -0
  36. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/contract_abi.json +0 -0
  37. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/deployment.py +0 -0
  38. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/errors.py +0 -0
  39. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/local_state.py +0 -0
  40. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/py.typed +0 -0
  41. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/registry.py +0 -0
  42. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/src/mppi_protocol/wire.py +0 -0
  43. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_accounting.py +0 -0
  44. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_amounts.py +0 -0
  45. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_catalog.py +0 -0
  46. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_checkpoint.py +0 -0
  47. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_contract_calls.py +0 -0
  48. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_discovery_validation.py +0 -0
  49. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_fixture_schema.py +0 -0
  50. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_observers.py +0 -0
  51. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_operations.py +0 -0
  52. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_registry.py +0 -0
  53. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_runtime_wire.py +0 -0
  54. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_signing.py +0 -0
  55. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_signing_vectors.py +0 -0
  56. {mppi_protocol-0.1.2 → mppi_protocol-0.1.3}/tests/test_value_types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: mppi-protocol
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Shared MPPI wire bindings and exact payment primitives
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -23,6 +23,24 @@ The implementation validates catalogs and report transitions, computes exact
23
23
  amounts, signs and verifies fixed-session proofs, prepares contract calls and
24
24
  checks canonical receipt evidence. Version `0.1.1` also supplies shared discovery
25
25
  validation and the Circle Agent Wallet adapter used by both Python roles.
26
+ Version `0.1.3`, used by `mppi-agent` 0.1.4, keeps HTTP connections alive and
27
+ sends a step's reads as one JSON-RPC batch (`HttpJsonRpc.call_many`), and treats
28
+ a read timeout as transient. It adds:
29
+
30
+ - `ChainReader.latest`, a one-request snapshot through Multicall3, and the
31
+ batched steps `observe` and `session_at`; on final networks
32
+ (`DeploymentProfile.instant_finality`) receipts alone prove operations;
33
+ - `ChainReader.funding`, which checks a funding signature as USDC does;
34
+ - `ChainFollower.follow`, `refresh_at`, `confirm`, `confirmed_readiness` and
35
+ `on_refresh_failure`, for requests that read no chain;
36
+ - `NotSubmittedError` and `OperationResult.cause`.
37
+
38
+ Three changes are not additive. `OpeningEvidence` and `ClosingEvidence` carry the
39
+ proving `observation` instead of a `Block`, and `ChainReader.agent_wallet` takes
40
+ that observation. The Circle adapter pins no account code:
41
+ `CircleAgentWallet(chain=..., address=..., checkpoint_path=...)` replaces the
42
+ `wallet` and `implementation` pins, and its journal is format 2 (format 1 still
43
+ loads).
26
44
  Version `0.1.2`, used by `mppi-agent` 0.1.3, adds bounded repeats of transient
27
45
  read-only JSON-RPC calls, lag-tolerant chain following
28
46
  (`ChainLagError`, `last_refresh_failure`), `HookError.detail` and
@@ -8,6 +8,24 @@ The implementation validates catalogs and report transitions, computes exact
8
8
  amounts, signs and verifies fixed-session proofs, prepares contract calls and
9
9
  checks canonical receipt evidence. Version `0.1.1` also supplies shared discovery
10
10
  validation and the Circle Agent Wallet adapter used by both Python roles.
11
+ Version `0.1.3`, used by `mppi-agent` 0.1.4, keeps HTTP connections alive and
12
+ sends a step's reads as one JSON-RPC batch (`HttpJsonRpc.call_many`), and treats
13
+ a read timeout as transient. It adds:
14
+
15
+ - `ChainReader.latest`, a one-request snapshot through Multicall3, and the
16
+ batched steps `observe` and `session_at`; on final networks
17
+ (`DeploymentProfile.instant_finality`) receipts alone prove operations;
18
+ - `ChainReader.funding`, which checks a funding signature as USDC does;
19
+ - `ChainFollower.follow`, `refresh_at`, `confirm`, `confirmed_readiness` and
20
+ `on_refresh_failure`, for requests that read no chain;
21
+ - `NotSubmittedError` and `OperationResult.cause`.
22
+
23
+ Three changes are not additive. `OpeningEvidence` and `ClosingEvidence` carry the
24
+ proving `observation` instead of a `Block`, and `ChainReader.agent_wallet` takes
25
+ that observation. The Circle adapter pins no account code:
26
+ `CircleAgentWallet(chain=..., address=..., checkpoint_path=...)` replaces the
27
+ `wallet` and `implementation` pins, and its journal is format 2 (format 1 still
28
+ loads).
11
29
  Version `0.1.2`, used by `mppi-agent` 0.1.3, adds bounded repeats of transient
12
30
  read-only JSON-RPC calls, lag-tolerant chain following
13
31
  (`ChainLagError`, `last_refresh_failure`), `HookError.detail` and
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "mppi-protocol"
7
- version = "0.1.2"
7
+ version = "0.1.3"
8
8
  license = "Apache-2.0"
9
9
  license-files = ["LICENSE"]
10
10
  description = "Shared MPPI wire bindings and exact payment primitives"
@@ -51,7 +51,20 @@ class FundingAuthorization:
51
51
  )
52
52
 
53
53
 
54
+ class NotSubmittedError(RuntimeError):
55
+ """A wallet adapter's own durable record proves the call never reached the
56
+ wallet service: nothing was submitted, so the same call may be sent again.
57
+
58
+ Raise it only with that proof. Any other failure leaves the outcome unknown.
59
+ """
60
+
61
+
54
62
  class TransactionWallet(Protocol):
63
+ """A wallet adapter's transactions. ``execute`` sends ``call`` once from
64
+ ``address`` with zero native value and durably binds ``operation_ref`` to
65
+ it first; ``reconcile`` reports that same submission and never sends.
66
+ """
67
+
55
68
  @property
56
69
  def address(self) -> bytes: ...
57
70
 
@@ -61,6 +74,21 @@ class TransactionWallet(Protocol):
61
74
 
62
75
 
63
76
  class FundingWallet(TransactionWallet, Protocol):
77
+ """An agent's funding wallet from any provider, behind a thin adapter.
78
+
79
+ ``sign_funding_authorization`` returns bytes USDC accepts for exactly that
80
+ authorization from ``address``: an ECDSA signature for an account without
81
+ code, or bytes its ERC-1271 isValidSignature accepts. Before submitting
82
+ funding, the agent checks them and that its ERC-8004 agent id binds
83
+ ``address``. No wallet implementation or version is pinned.
84
+
85
+ A wallet whose service creates the signature when it executes declares an
86
+ optional ``signs_at_execute = True``: ``sign_funding_authorization`` then
87
+ returns a placeholder that ``execute`` replaces. The agent neither verifies
88
+ nor simulates the placeholder; it still checks the agent-id binding, and
89
+ USDC verifies the real signature on chain.
90
+ """
91
+
64
92
  def sign_funding_authorization(self, authorization: FundingAuthorization) -> bytes: ...
65
93
 
66
94