agent-consistency 0.1.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.
@@ -0,0 +1,160 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the
13
+ copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other
16
+ entities that control, are controlled by, or are under common control with
17
+ that entity. For the purposes of this definition, "control" means (i) the
18
+ power, direct or indirect, to cause the direction or management of such
19
+ entity, whether by contract or otherwise, or (ii) ownership of fifty percent
20
+ (50%) or more of the outstanding shares, or (iii) beneficial ownership of such
21
+ entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
24
+ permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation source, and
28
+ configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical transformation or
31
+ translation of a Source form, including but not limited to compiled object
32
+ code, generated documentation, and conversions to other media types.
33
+
34
+ "Work" shall mean the work of authorship, whether in Source or Object form,
35
+ made available under the License, as indicated by a copyright notice that is
36
+ included in or attached to the work.
37
+
38
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
39
+ is based on (or derived from) the Work and for which the editorial revisions,
40
+ annotations, elaborations, or other modifications represent, as a whole, an
41
+ original work of authorship. For the purposes of this License, Derivative
42
+ Works shall not include works that remain separable from, or merely link (or
43
+ bind by name) to the interfaces of, the Work and Derivative Works thereof.
44
+
45
+ "Contribution" shall mean any work of authorship, including the original
46
+ version of the Work and any modifications or additions to that Work or
47
+ Derivative Works thereof, that is intentionally submitted to Licensor for
48
+ inclusion in the Work by the copyright owner or by an individual or Legal
49
+ Entity authorized to submit on behalf of the copyright owner. For the purposes
50
+ of this definition, "submitted" means any form of electronic, verbal, or
51
+ written communication sent to the Licensor or its representatives, including
52
+ but not limited to communication on electronic mailing lists, source code
53
+ control systems, and issue tracking systems that are managed by, or on behalf
54
+ of, the Licensor for the purpose of discussing and improving the Work, but
55
+ excluding communication that is conspicuously marked or otherwise designated in
56
+ writing by the copyright owner as "Not a Contribution."
57
+
58
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
59
+ of whom a Contribution has been received by Licensor and subsequently
60
+ incorporated within the Work.
61
+
62
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
63
+ License, each Contributor hereby grants to You a perpetual, worldwide,
64
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
65
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
66
+ sublicense, and distribute the Work and such Derivative Works in Source or
67
+ Object form.
68
+
69
+ 3. Grant of Patent License. Subject to the terms and conditions of this
70
+ License, each Contributor hereby grants to You a perpetual, worldwide,
71
+ non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
72
+ section) patent license to make, have made, use, offer to sell, sell, import,
73
+ and otherwise transfer the Work, where such license applies only to those
74
+ patent claims licensable by such Contributor that are necessarily infringed by
75
+ their Contribution(s) alone or by combination of their Contribution(s) with the
76
+ Work to which such Contribution(s) was submitted. If You institute patent
77
+ litigation against any entity (including a cross-claim or counterclaim in a
78
+ lawsuit) alleging that the Work or a Contribution incorporated within the Work
79
+ constitutes direct or contributory patent infringement, then any patent
80
+ licenses granted to You under this License for that Work shall terminate as of
81
+ the date such litigation is filed.
82
+
83
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
84
+ Derivative Works thereof in any medium, with or without modifications, and in
85
+ Source or Object form, provided that You meet the following conditions:
86
+
87
+ (a) You must give any other recipients of the Work or Derivative Works a copy
88
+ of this License; and
89
+
90
+ (b) You must cause any modified files to carry prominent notices stating that
91
+ You changed the files; and
92
+
93
+ (c) You must retain, in the Source form of any Derivative Works that You
94
+ distribute, all copyright, patent, trademark, and attribution notices from the
95
+ Source form of the Work, excluding those notices that do not pertain to any
96
+ part of the Derivative Works; and
97
+
98
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then
99
+ any Derivative Works that You distribute must include a readable copy of the
100
+ attribution notices contained within such NOTICE file, excluding those notices
101
+ that do not pertain to any part of the Derivative Works, in at least one of the
102
+ following places: within a NOTICE text file distributed as part of the
103
+ Derivative Works; within the Source form or documentation, if provided along
104
+ with the Derivative Works; or within a display generated by the Derivative
105
+ Works, if and wherever such third-party notices normally appear. The contents
106
+ of the NOTICE file are for informational purposes only and do not modify the
107
+ License. You may add Your own attribution notices within Derivative Works that
108
+ You distribute, alongside or as an addendum to the NOTICE text from the Work,
109
+ provided that such additional attribution notices cannot be construed as
110
+ modifying the License.
111
+
112
+ You may add Your own copyright statement to Your modifications and may provide
113
+ additional or different license terms and conditions for use, reproduction, or
114
+ distribution of Your modifications, or for any such Derivative Works as a
115
+ whole, provided Your use, reproduction, and distribution of the Work otherwise
116
+ complies with the conditions stated in this License.
117
+
118
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
119
+ Contribution intentionally submitted for inclusion in the Work by You to the
120
+ Licensor shall be under the terms and conditions of this License, without any
121
+ additional terms or conditions. Notwithstanding the above, nothing herein shall
122
+ supersede or modify the terms of any separate license agreement you may have
123
+ executed with Licensor regarding such Contributions.
124
+
125
+ 6. Trademarks. This License does not grant permission to use the trade names,
126
+ trademarks, service marks, or product names of the Licensor, except as required
127
+ for reasonable and customary use in describing the origin of the Work and
128
+ reproducing the content of the NOTICE file.
129
+
130
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
131
+ writing, Licensor provides the Work (and each Contributor provides its
132
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
133
+ KIND, either express or implied, including, without limitation, any warranties
134
+ or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
135
+ PARTICULAR PURPOSE. You are solely responsible for determining the
136
+ appropriateness of using or redistributing the Work and assume any risks
137
+ associated with Your exercise of permissions under this License.
138
+
139
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
140
+ tort (including negligence), contract, or otherwise, unless required by
141
+ applicable law (such as deliberate and grossly negligent acts) or agreed to in
142
+ writing, shall any Contributor be liable to You for damages, including any
143
+ direct, indirect, special, incidental, or consequential damages of any character
144
+ arising as a result of this License or out of the use or inability to use the
145
+ Work (including but not limited to damages for loss of goodwill, work stoppage,
146
+ computer failure or malfunction, or any and all other commercial damages or
147
+ losses), even if such Contributor has been advised of the possibility of such
148
+ damages.
149
+
150
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or
151
+ Derivative Works thereof, You may choose to offer, and charge a fee for,
152
+ acceptance of support, warranty, indemnity, or other liability obligations
153
+ and/or rights consistent with this License. However, in accepting such
154
+ obligations, You may act only on Your own behalf and on Your sole
155
+ responsibility, not on behalf of any other Contributor, and only if You agree
156
+ to indemnify, defend, and hold each Contributor harmless for any liability
157
+ incurred by, or claims asserted against, such Contributor by reason of your
158
+ accepting any such warranty or additional liability.
159
+
160
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,217 @@
1
+ Metadata-Version: 2.4
2
+ Name: agent-consistency
3
+ Version: 0.1.0
4
+ Summary: Consistency receipts for multi-agent workflows: state snapshots, handoff packets, outcome checks, and run diffs.
5
+ Author: Karim Baidar - karimbaidar@yahoo.com
6
+ License-Expression: Apache-2.0
7
+ Keywords: agents,multi-agent,workflow,consistency,guardrails,durable-functions,observability
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Classifier: Topic :: System :: Distributed Computing
18
+ Requires-Python: >=3.9
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Provides-Extra: dev
22
+ Requires-Dist: build>=1.2; extra == "dev"
23
+ Requires-Dist: mypy>=1.10; extra == "dev"
24
+ Requires-Dist: pytest>=8.0; extra == "dev"
25
+ Requires-Dist: pytest-cov>=5.0; extra == "dev"
26
+ Requires-Dist: ruff>=0.6.0; extra == "dev"
27
+ Requires-Dist: twine>=5.1; extra == "dev"
28
+ Provides-Extra: test
29
+ Requires-Dist: pytest>=8.0; extra == "test"
30
+ Requires-Dist: pytest-cov>=5.0; extra == "test"
31
+ Dynamic: license-file
32
+
33
+ # agent-consistency
34
+
35
+ Prevent stale-state, broken-handoff, and false-success bugs in multi-agent workflows.
36
+
37
+ `agent-consistency` is a small Python library for recording consistency receipts across agent
38
+ workflow steps. It is not an agent framework, policy engine, or tracing dashboard. It focuses on a
39
+ specific production problem:
40
+
41
+ > Your agents may be smart, but are they acting on the same version of reality?
42
+
43
+ Multi-agent systems often fail quietly because an agent reads stale state, receives an incomplete
44
+ handoff, retries a side effect, or declares success after a tool returned `200` even though the
45
+ business outcome is still not true. This library gives each step an explicit receipt:
46
+
47
+ - what state was read
48
+ - what assumptions were made
49
+ - what state changed
50
+ - what was handed off
51
+ - what postcondition proved success
52
+
53
+ The core package is generic. Azure Durable Functions is the first adapter because replay, resume,
54
+ and orchestration history make these consistency problems especially visible.
55
+
56
+ ## Install
57
+
58
+ From a local checkout:
59
+
60
+ ```bash
61
+ python -m venv .venv
62
+ source .venv/bin/activate
63
+ python -m pip install -U pip
64
+ python -m pip install -e ".[dev]"
65
+ ```
66
+
67
+ After publishing:
68
+
69
+ ```bash
70
+ python -m pip install agent-consistency
71
+ ```
72
+
73
+ ## Quickstart
74
+
75
+ ```python
76
+ from agent_consistency import WorkflowRun
77
+
78
+ run = WorkflowRun("refund-ord-1")
79
+
80
+ with run.step("history-agent", "load_order", step_id="history") as step:
81
+ order = {"id": "ord_1", "previous_refund_count": 0, "total": 42.5}
82
+ order_snapshot = step.read_state("order", order, version="order-v3")
83
+
84
+ handoff = step.handoff(
85
+ to_agent="eligibility-agent",
86
+ task="decide refund eligibility",
87
+ facts={"order": order, "policy_version": "policy-v12"},
88
+ evidence={"order.previous_refund_count": order_snapshot.to_dict()},
89
+ required_facts=["order.id", "order.previous_refund_count", "policy_version"],
90
+ required_evidence=["order.previous_refund_count"],
91
+ )
92
+
93
+ with run.step("eligibility-agent", "decide", step_id="eligibility") as step:
94
+ policy = {"max_previous_refunds": 0, "max_amount": 100}
95
+ policy_snapshot = step.read_state("refund_policy", policy, version="policy-v12")
96
+ step.ensure_fresh(policy_snapshot, current_version="policy-v12")
97
+
98
+ step.require_supported_claims(
99
+ handoff,
100
+ {"eligible": True},
101
+ by=["order.previous_refund_count"],
102
+ )
103
+
104
+ with run.step("refund-agent", "issue_refund", step_id="refund") as step:
105
+ provider_result = {"refund_id": "rf_1", "status": "settled"}
106
+ step.write_state("refund", provider_result, version="refund-rf_1")
107
+ step.verify_outcome(
108
+ "refund_settled",
109
+ lambda: provider_result["status"] == "settled",
110
+ details={"refund_id": "rf_1"},
111
+ )
112
+
113
+ for receipt in run.receipts():
114
+ print(receipt.to_dict())
115
+ ```
116
+
117
+ ## Core Features
118
+
119
+ ### State Snapshot Guard
120
+
121
+ Record the exact version and stable hash of state read by an agent step. Before a write, verify the
122
+ step is still based on fresh state.
123
+
124
+ ```python
125
+ from agent_consistency import WorkflowRun
126
+
127
+ run = WorkflowRun("policy-run")
128
+
129
+ with run.step("eligibility-agent", "decide") as step:
130
+ snapshot = step.read_state("refund_policy", {"limit": 100}, version="v12")
131
+ step.write_state(
132
+ "refund_decision",
133
+ {"eligible": True},
134
+ based_on=snapshot,
135
+ current_version="v12",
136
+ )
137
+ ```
138
+
139
+ By default, consistency violations raise exceptions. You can also use `on_violation="warn"` or
140
+ `on_violation="record"`.
141
+
142
+ ```python
143
+ run = WorkflowRun("policy-run", on_violation="record")
144
+ ```
145
+
146
+ ### Handoff Packet Validator
147
+
148
+ Make agent-to-agent handoff explicit. Required fields can use dot paths.
149
+
150
+ ```python
151
+ packet = step.handoff(
152
+ to_agent="refund-agent",
153
+ task="issue refund",
154
+ facts={"order": {"id": "ord_1", "previous_refund_count": 0}},
155
+ assumptions=["order data came from the primary store"],
156
+ constraints=["do not refund if the customer was already refunded"],
157
+ required_facts=["order.id", "order.previous_refund_count"],
158
+ )
159
+ ```
160
+
161
+ ### Outcome Verifier
162
+
163
+ A tool call is not complete just because it returned. Add a postcondition that proves the business
164
+ outcome became true.
165
+
166
+ ```python
167
+ step.verify_outcome(
168
+ "refund_settled",
169
+ lambda: payment_provider.get_refund("rf_1")["status"] == "settled",
170
+ )
171
+ ```
172
+
173
+ ### Run Diff
174
+
175
+ Compare two runs and see where state, assumptions, handoffs, deltas, or outcomes diverged.
176
+
177
+ ```python
178
+ from agent_consistency import diff_runs
179
+
180
+ diff = diff_runs(previous_run_receipts, current_run_receipts)
181
+ print(diff.summary())
182
+ ```
183
+
184
+ ## Azure Durable Functions Adapter
185
+
186
+ The Azure Durable adapter has no hard Azure dependency. It works with a Durable orchestration
187
+ context-like object and provides:
188
+
189
+ - Durable instance id as the consistency run id
190
+ - replay-safe logging helper
191
+ - deterministic activity keys for idempotent side effects
192
+ - optional custom status updates with receipt summaries
193
+
194
+ ```python
195
+ from agent_consistency.adapters import DurableConsistencyContext, replay_safe_log
196
+
197
+ def orchestrator_function(context):
198
+ durable = DurableConsistencyContext(context)
199
+
200
+ with durable.step("refund-orchestrator", "schedule_refund", step_id="schedule") as step:
201
+ intent = {"order_id": "ord_1", "amount": 42.5}
202
+ activity_key = durable.activity_key("issue_refund", intent)
203
+ step.read_state("refund_intent", intent, version=activity_key)
204
+
205
+ durable.set_custom_status()
206
+ ```
207
+
208
+
209
+ ## Status
210
+
211
+ This is an early library with a stable core direction:
212
+
213
+ - generic consistency receipts
214
+ - Azure Durable Functions as the first adapter
215
+ - framework adapters later
216
+
217
+ The goal is to catch quietly wrong success before it becomes production damage.
@@ -0,0 +1,185 @@
1
+ # agent-consistency
2
+
3
+ Prevent stale-state, broken-handoff, and false-success bugs in multi-agent workflows.
4
+
5
+ `agent-consistency` is a small Python library for recording consistency receipts across agent
6
+ workflow steps. It is not an agent framework, policy engine, or tracing dashboard. It focuses on a
7
+ specific production problem:
8
+
9
+ > Your agents may be smart, but are they acting on the same version of reality?
10
+
11
+ Multi-agent systems often fail quietly because an agent reads stale state, receives an incomplete
12
+ handoff, retries a side effect, or declares success after a tool returned `200` even though the
13
+ business outcome is still not true. This library gives each step an explicit receipt:
14
+
15
+ - what state was read
16
+ - what assumptions were made
17
+ - what state changed
18
+ - what was handed off
19
+ - what postcondition proved success
20
+
21
+ The core package is generic. Azure Durable Functions is the first adapter because replay, resume,
22
+ and orchestration history make these consistency problems especially visible.
23
+
24
+ ## Install
25
+
26
+ From a local checkout:
27
+
28
+ ```bash
29
+ python -m venv .venv
30
+ source .venv/bin/activate
31
+ python -m pip install -U pip
32
+ python -m pip install -e ".[dev]"
33
+ ```
34
+
35
+ After publishing:
36
+
37
+ ```bash
38
+ python -m pip install agent-consistency
39
+ ```
40
+
41
+ ## Quickstart
42
+
43
+ ```python
44
+ from agent_consistency import WorkflowRun
45
+
46
+ run = WorkflowRun("refund-ord-1")
47
+
48
+ with run.step("history-agent", "load_order", step_id="history") as step:
49
+ order = {"id": "ord_1", "previous_refund_count": 0, "total": 42.5}
50
+ order_snapshot = step.read_state("order", order, version="order-v3")
51
+
52
+ handoff = step.handoff(
53
+ to_agent="eligibility-agent",
54
+ task="decide refund eligibility",
55
+ facts={"order": order, "policy_version": "policy-v12"},
56
+ evidence={"order.previous_refund_count": order_snapshot.to_dict()},
57
+ required_facts=["order.id", "order.previous_refund_count", "policy_version"],
58
+ required_evidence=["order.previous_refund_count"],
59
+ )
60
+
61
+ with run.step("eligibility-agent", "decide", step_id="eligibility") as step:
62
+ policy = {"max_previous_refunds": 0, "max_amount": 100}
63
+ policy_snapshot = step.read_state("refund_policy", policy, version="policy-v12")
64
+ step.ensure_fresh(policy_snapshot, current_version="policy-v12")
65
+
66
+ step.require_supported_claims(
67
+ handoff,
68
+ {"eligible": True},
69
+ by=["order.previous_refund_count"],
70
+ )
71
+
72
+ with run.step("refund-agent", "issue_refund", step_id="refund") as step:
73
+ provider_result = {"refund_id": "rf_1", "status": "settled"}
74
+ step.write_state("refund", provider_result, version="refund-rf_1")
75
+ step.verify_outcome(
76
+ "refund_settled",
77
+ lambda: provider_result["status"] == "settled",
78
+ details={"refund_id": "rf_1"},
79
+ )
80
+
81
+ for receipt in run.receipts():
82
+ print(receipt.to_dict())
83
+ ```
84
+
85
+ ## Core Features
86
+
87
+ ### State Snapshot Guard
88
+
89
+ Record the exact version and stable hash of state read by an agent step. Before a write, verify the
90
+ step is still based on fresh state.
91
+
92
+ ```python
93
+ from agent_consistency import WorkflowRun
94
+
95
+ run = WorkflowRun("policy-run")
96
+
97
+ with run.step("eligibility-agent", "decide") as step:
98
+ snapshot = step.read_state("refund_policy", {"limit": 100}, version="v12")
99
+ step.write_state(
100
+ "refund_decision",
101
+ {"eligible": True},
102
+ based_on=snapshot,
103
+ current_version="v12",
104
+ )
105
+ ```
106
+
107
+ By default, consistency violations raise exceptions. You can also use `on_violation="warn"` or
108
+ `on_violation="record"`.
109
+
110
+ ```python
111
+ run = WorkflowRun("policy-run", on_violation="record")
112
+ ```
113
+
114
+ ### Handoff Packet Validator
115
+
116
+ Make agent-to-agent handoff explicit. Required fields can use dot paths.
117
+
118
+ ```python
119
+ packet = step.handoff(
120
+ to_agent="refund-agent",
121
+ task="issue refund",
122
+ facts={"order": {"id": "ord_1", "previous_refund_count": 0}},
123
+ assumptions=["order data came from the primary store"],
124
+ constraints=["do not refund if the customer was already refunded"],
125
+ required_facts=["order.id", "order.previous_refund_count"],
126
+ )
127
+ ```
128
+
129
+ ### Outcome Verifier
130
+
131
+ A tool call is not complete just because it returned. Add a postcondition that proves the business
132
+ outcome became true.
133
+
134
+ ```python
135
+ step.verify_outcome(
136
+ "refund_settled",
137
+ lambda: payment_provider.get_refund("rf_1")["status"] == "settled",
138
+ )
139
+ ```
140
+
141
+ ### Run Diff
142
+
143
+ Compare two runs and see where state, assumptions, handoffs, deltas, or outcomes diverged.
144
+
145
+ ```python
146
+ from agent_consistency import diff_runs
147
+
148
+ diff = diff_runs(previous_run_receipts, current_run_receipts)
149
+ print(diff.summary())
150
+ ```
151
+
152
+ ## Azure Durable Functions Adapter
153
+
154
+ The Azure Durable adapter has no hard Azure dependency. It works with a Durable orchestration
155
+ context-like object and provides:
156
+
157
+ - Durable instance id as the consistency run id
158
+ - replay-safe logging helper
159
+ - deterministic activity keys for idempotent side effects
160
+ - optional custom status updates with receipt summaries
161
+
162
+ ```python
163
+ from agent_consistency.adapters import DurableConsistencyContext, replay_safe_log
164
+
165
+ def orchestrator_function(context):
166
+ durable = DurableConsistencyContext(context)
167
+
168
+ with durable.step("refund-orchestrator", "schedule_refund", step_id="schedule") as step:
169
+ intent = {"order_id": "ord_1", "amount": 42.5}
170
+ activity_key = durable.activity_key("issue_refund", intent)
171
+ step.read_state("refund_intent", intent, version=activity_key)
172
+
173
+ durable.set_custom_status()
174
+ ```
175
+
176
+
177
+ ## Status
178
+
179
+ This is an early library with a stable core direction:
180
+
181
+ - generic consistency receipts
182
+ - Azure Durable Functions as the first adapter
183
+ - framework adapters later
184
+
185
+ The goal is to catch quietly wrong success before it becomes production damage.
@@ -0,0 +1,74 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "agent-consistency"
7
+ version = "0.1.0"
8
+ description = "Consistency receipts for multi-agent workflows: state snapshots, handoff packets, outcome checks, and run diffs."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "Apache-2.0"
12
+ license-files = ["LICENSE"]
13
+ authors = [
14
+ { name = "Karim Baidar - karimbaidar@yahoo.com" }
15
+ ]
16
+ keywords = [
17
+ "agents",
18
+ "multi-agent",
19
+ "workflow",
20
+ "consistency",
21
+ "guardrails",
22
+ "durable-functions",
23
+ "observability"
24
+ ]
25
+ classifiers = [
26
+ "Development Status :: 3 - Alpha",
27
+ "Intended Audience :: Developers",
28
+ "Programming Language :: Python :: 3",
29
+ "Programming Language :: Python :: 3.9",
30
+ "Programming Language :: Python :: 3.10",
31
+ "Programming Language :: Python :: 3.11",
32
+ "Programming Language :: Python :: 3.12",
33
+ "Programming Language :: Python :: 3.13",
34
+ "Topic :: Software Development :: Libraries :: Python Modules",
35
+ "Topic :: System :: Distributed Computing",
36
+ ]
37
+ dependencies = []
38
+
39
+ [project.optional-dependencies]
40
+ dev = [
41
+ "build>=1.2",
42
+ "mypy>=1.10",
43
+ "pytest>=8.0",
44
+ "pytest-cov>=5.0",
45
+ "ruff>=0.6.0",
46
+ "twine>=5.1",
47
+ ]
48
+ test = [
49
+ "pytest>=8.0",
50
+ "pytest-cov>=5.0",
51
+ ]
52
+
53
+
54
+ [tool.setuptools.packages.find]
55
+ where = ["src"]
56
+
57
+ [tool.pytest.ini_options]
58
+ addopts = "-ra"
59
+ testpaths = ["tests"]
60
+
61
+ [tool.ruff]
62
+ line-length = 100
63
+ target-version = "py39"
64
+ src = ["src", "tests"]
65
+
66
+ [tool.ruff.lint]
67
+ select = ["E", "F", "I", "UP", "B"]
68
+ ignore = ["UP006", "UP007", "UP035"]
69
+
70
+ [tool.mypy]
71
+ python_version = "3.9"
72
+ packages = ["agent_consistency"]
73
+ ignore_missing_imports = true
74
+ warn_unused_ignores = true
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,40 @@
1
+ from .diff import DiffItem, RunDiff, diff_runs
2
+ from .errors import (
3
+ ConsistencyError,
4
+ DuplicateReceiptError,
5
+ HandoffValidationError,
6
+ OutcomeVerificationError,
7
+ StaleStateError,
8
+ )
9
+ from .handoff import HandoffPacket
10
+ from .models import ConsistencyIssue, ConsistencyReceipt, OutcomeResult, StateDelta, StateSnapshot
11
+ from .outcome import OutcomeVerifier, verify_outcome
12
+ from .run import AgentStep, WorkflowRun
13
+ from .store import InMemoryReceiptStore, JsonlReceiptStore, ReceiptStore, load_receipts
14
+
15
+ __version__ = "0.1.0"
16
+
17
+ __all__ = [
18
+ "AgentStep",
19
+ "ConsistencyError",
20
+ "ConsistencyIssue",
21
+ "ConsistencyReceipt",
22
+ "DiffItem",
23
+ "DuplicateReceiptError",
24
+ "HandoffPacket",
25
+ "HandoffValidationError",
26
+ "InMemoryReceiptStore",
27
+ "JsonlReceiptStore",
28
+ "OutcomeResult",
29
+ "OutcomeVerificationError",
30
+ "OutcomeVerifier",
31
+ "ReceiptStore",
32
+ "RunDiff",
33
+ "StaleStateError",
34
+ "StateDelta",
35
+ "StateSnapshot",
36
+ "WorkflowRun",
37
+ "diff_runs",
38
+ "load_receipts",
39
+ "verify_outcome",
40
+ ]
@@ -0,0 +1,5 @@
1
+ from datetime import datetime, timezone
2
+
3
+
4
+ def utc_now_iso() -> str:
5
+ return datetime.now(timezone.utc).replace(microsecond=0).isoformat()