cmgl 1.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.
Files changed (123) hide show
  1. cmgl-1.1.0/.gitignore +20 -0
  2. cmgl-1.1.0/CHANGELOG.md +33 -0
  3. cmgl-1.1.0/CODE_OF_CONDUCT.md +5 -0
  4. cmgl-1.1.0/DEPENDENCIES.md +28 -0
  5. cmgl-1.1.0/LICENSE +199 -0
  6. cmgl-1.1.0/PKG-INFO +407 -0
  7. cmgl-1.1.0/README.md +364 -0
  8. cmgl-1.1.0/SECURITY.md +53 -0
  9. cmgl-1.1.0/THIRD_PARTY_NOTICES.md +7 -0
  10. cmgl-1.1.0/docs/adapters.md +174 -0
  11. cmgl-1.1.0/docs/api-stability.md +77 -0
  12. cmgl-1.1.0/docs/architecture.md +131 -0
  13. cmgl-1.1.0/docs/live-ci.md +70 -0
  14. cmgl-1.1.0/docs/operations.md +139 -0
  15. cmgl-1.1.0/docs/reference-mapping.md +33 -0
  16. cmgl-1.1.0/docs/release-v1.1.0-checklist.md +87 -0
  17. cmgl-1.1.0/docs/releases/v1.1.0.md +49 -0
  18. cmgl-1.1.0/docs/schemas.md +67 -0
  19. cmgl-1.1.0/docs/security-github-publication-checklist.md +33 -0
  20. cmgl-1.1.0/docs/threat-model.md +27 -0
  21. cmgl-1.1.0/examples/basic_inmemory_demo.py +21 -0
  22. cmgl-1.1.0/examples/conformance/README.md +25 -0
  23. cmgl-1.1.0/examples/conformance/authority_bundle.valid.json +1 -0
  24. cmgl-1.1.0/examples/conformance/ledger.valid.jsonl +1 -0
  25. cmgl-1.1.0/examples/conformance/memory_event.valid.json +21 -0
  26. cmgl-1.1.0/examples/conformance/simple_ledger.nonconformant.jsonl +8 -0
  27. cmgl-1.1.0/examples/conformance/strict_ledger.valid.jsonl +28 -0
  28. cmgl-1.1.0/examples/conformance/telemetry_replay.valid.jsonl +2 -0
  29. cmgl-1.1.0/examples/governance_layer_demo.py +47 -0
  30. cmgl-1.1.0/examples/langgraph_mem0_pseudoadapter.md +42 -0
  31. cmgl-1.1.0/examples/ledger_receipt_demo.py +20 -0
  32. cmgl-1.1.0/examples/stale_preference_demo.py +34 -0
  33. cmgl-1.1.0/examples/strict_authority_demo.py +47 -0
  34. cmgl-1.1.0/pyproject.toml +130 -0
  35. cmgl-1.1.0/scripts/check_publishability.py +384 -0
  36. cmgl-1.1.0/scripts/live_adapter_smoke.py +46 -0
  37. cmgl-1.1.0/src/cmgl/__init__.py +269 -0
  38. cmgl-1.1.0/src/cmgl/__main__.py +4 -0
  39. cmgl-1.1.0/src/cmgl/absence.py +29 -0
  40. cmgl-1.1.0/src/cmgl/adapters/__init__.py +3 -0
  41. cmgl-1.1.0/src/cmgl/adapters/binding.py +212 -0
  42. cmgl-1.1.0/src/cmgl/adapters/common.py +331 -0
  43. cmgl-1.1.0/src/cmgl/adapters/graphiti.py +235 -0
  44. cmgl-1.1.0/src/cmgl/adapters/langgraph.py +183 -0
  45. cmgl-1.1.0/src/cmgl/adapters/langmem.py +395 -0
  46. cmgl-1.1.0/src/cmgl/adapters/mem0.py +339 -0
  47. cmgl-1.1.0/src/cmgl/admission.py +78 -0
  48. cmgl-1.1.0/src/cmgl/audit.py +442 -0
  49. cmgl-1.1.0/src/cmgl/authority.py +310 -0
  50. cmgl-1.1.0/src/cmgl/backends/__init__.py +4 -0
  51. cmgl-1.1.0/src/cmgl/backends/inmemory.py +216 -0
  52. cmgl-1.1.0/src/cmgl/backends/protocol.py +34 -0
  53. cmgl-1.1.0/src/cmgl/canonical.py +45 -0
  54. cmgl-1.1.0/src/cmgl/challenge.py +28 -0
  55. cmgl-1.1.0/src/cmgl/checker.py +64 -0
  56. cmgl-1.1.0/src/cmgl/cli.py +119 -0
  57. cmgl-1.1.0/src/cmgl/commands/__init__.py +1 -0
  58. cmgl-1.1.0/src/cmgl/commands/_common.py +16 -0
  59. cmgl-1.1.0/src/cmgl/commands/adapters.py +68 -0
  60. cmgl-1.1.0/src/cmgl/commands/audit.py +42 -0
  61. cmgl-1.1.0/src/cmgl/commands/authority.py +111 -0
  62. cmgl-1.1.0/src/cmgl/commands/compression.py +29 -0
  63. cmgl-1.1.0/src/cmgl/commands/conformance.py +44 -0
  64. cmgl-1.1.0/src/cmgl/commands/ledger.py +80 -0
  65. cmgl-1.1.0/src/cmgl/commands/lifecycle.py +98 -0
  66. cmgl-1.1.0/src/cmgl/commands/memory.py +116 -0
  67. cmgl-1.1.0/src/cmgl/commands/promotion.py +42 -0
  68. cmgl-1.1.0/src/cmgl/commands/receipt.py +55 -0
  69. cmgl-1.1.0/src/cmgl/commands/reference.py +27 -0
  70. cmgl-1.1.0/src/cmgl/commands/retrieve.py +45 -0
  71. cmgl-1.1.0/src/cmgl/commands/schema.py +27 -0
  72. cmgl-1.1.0/src/cmgl/commands/telemetry.py +50 -0
  73. cmgl-1.1.0/src/cmgl/commands/validate.py +56 -0
  74. cmgl-1.1.0/src/cmgl/commands/workflow.py +29 -0
  75. cmgl-1.1.0/src/cmgl/compression.py +250 -0
  76. cmgl-1.1.0/src/cmgl/config.py +116 -0
  77. cmgl-1.1.0/src/cmgl/conformance.py +119 -0
  78. cmgl-1.1.0/src/cmgl/contracts/__init__.py +198 -0
  79. cmgl-1.1.0/src/cmgl/contracts/adapters.py +57 -0
  80. cmgl-1.1.0/src/cmgl/contracts/authority.py +104 -0
  81. cmgl-1.1.0/src/cmgl/contracts/base.py +22 -0
  82. cmgl-1.1.0/src/cmgl/contracts/compression.py +106 -0
  83. cmgl-1.1.0/src/cmgl/contracts/conformance.py +52 -0
  84. cmgl-1.1.0/src/cmgl/contracts/contamination.py +57 -0
  85. cmgl-1.1.0/src/cmgl/contracts/enums.py +184 -0
  86. cmgl-1.1.0/src/cmgl/contracts/ledger.py +89 -0
  87. cmgl-1.1.0/src/cmgl/contracts/lifecycle.py +105 -0
  88. cmgl-1.1.0/src/cmgl/contracts/memory.py +188 -0
  89. cmgl-1.1.0/src/cmgl/contracts/obligations.py +49 -0
  90. cmgl-1.1.0/src/cmgl/contracts/promotion.py +114 -0
  91. cmgl-1.1.0/src/cmgl/contracts/receipts.py +61 -0
  92. cmgl-1.1.0/src/cmgl/contracts/rules.py +21 -0
  93. cmgl-1.1.0/src/cmgl/contracts/telemetry.py +203 -0
  94. cmgl-1.1.0/src/cmgl/contracts/workflow.py +95 -0
  95. cmgl-1.1.0/src/cmgl/current.py +20 -0
  96. cmgl-1.1.0/src/cmgl/digest.py +18 -0
  97. cmgl-1.1.0/src/cmgl/doctor.py +83 -0
  98. cmgl-1.1.0/src/cmgl/evidence.py +134 -0
  99. cmgl-1.1.0/src/cmgl/exceptions.py +29 -0
  100. cmgl-1.1.0/src/cmgl/guarded.py +177 -0
  101. cmgl-1.1.0/src/cmgl/layer.py +359 -0
  102. cmgl-1.1.0/src/cmgl/ledger.py +375 -0
  103. cmgl-1.1.0/src/cmgl/ledger_signing.py +77 -0
  104. cmgl-1.1.0/src/cmgl/lifecycle.py +157 -0
  105. cmgl-1.1.0/src/cmgl/live_smoke.py +212 -0
  106. cmgl-1.1.0/src/cmgl/models.py +189 -0
  107. cmgl-1.1.0/src/cmgl/obligations.py +306 -0
  108. cmgl-1.1.0/src/cmgl/pipeline.py +345 -0
  109. cmgl-1.1.0/src/cmgl/policy.py +343 -0
  110. cmgl-1.1.0/src/cmgl/py.typed +1 -0
  111. cmgl-1.1.0/src/cmgl/receipt_verifier.py +235 -0
  112. cmgl-1.1.0/src/cmgl/rules.py +502 -0
  113. cmgl-1.1.0/src/cmgl/schemas.py +195 -0
  114. cmgl-1.1.0/src/cmgl/state.py +96 -0
  115. cmgl-1.1.0/src/cmgl/stress.py +86 -0
  116. cmgl-1.1.0/src/cmgl/telemetry.py +70 -0
  117. cmgl-1.1.0/src/cmgl/telemetry_ingest.py +137 -0
  118. cmgl-1.1.0/src/cmgl/telemetry_replay.py +299 -0
  119. cmgl-1.1.0/src/cmgl/time.py +19 -0
  120. cmgl-1.1.0/src/cmgl/transitions.py +118 -0
  121. cmgl-1.1.0/src/cmgl/validation.py +160 -0
  122. cmgl-1.1.0/src/cmgl/workflow.py +227 -0
  123. cmgl-1.1.0/uv.lock +3131 -0
cmgl-1.1.0/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ .env
2
+ .env.*
3
+ !.env.example
4
+ .venv
5
+ __pycache__/
6
+ .pytest_cache/
7
+ .mypy_cache/
8
+ .ruff_cache/
9
+ dist/
10
+ build/
11
+ *.egg-info/
12
+ .DS_Store
13
+ .cmgl/
14
+ logs/
15
+ *.log
16
+ *.sqlite
17
+ *.db
18
+ .coverage
19
+ htmlcov/
20
+ notebooks/.ipynb_checkpoints/
@@ -0,0 +1,33 @@
1
+ # Changelog
2
+
3
+ All notable changes to CMGL are documented here.
4
+
5
+ ## 1.1.0 - 2026-05-14
6
+
7
+ ### Added
8
+
9
+ - Stable public API policy and smoke tests for the documented top-level API.
10
+ - Adapter operation evidence through `ExternalMemoryRef` and `AdapterOperationReceipt`.
11
+ - Safe adapter live-smoke entry point with skip-on-missing-provider-env default and strict `--require-live-env` mode.
12
+ - `cmgl adapters doctor` and `cmgl adapters live-smoke` CLI commands.
13
+ - Release documentation for PyPI Trusted Publishing, GitHub release creation, and manual repository metadata gates.
14
+ - Publishability checks for release docs, lockfile freshness, CLI smoke, built artifacts, wheel import, and manual release checklist output.
15
+
16
+ ### Changed
17
+
18
+ - README install instructions now distinguish post-publication PyPI install, GitHub source install, and local development install.
19
+ - Adapter documentation now states the tested support level: stable shim, fake-client tested, optional live-smoke supported, and no cloud/provider dependency in core tests.
20
+ - Live adapter smoke no longer constructs Mem0 or Graphiti clients when required provider environment variables are absent, unless strict mode is requested.
21
+ - Publish workflow uses PyPI Trusted Publishing / OIDC with publish permissions scoped to the publish job.
22
+
23
+ ### Security
24
+
25
+ - Release docs explicitly require PyPI Trusted Publisher setup and prohibit long-lived PyPI tokens.
26
+ - Security docs cover live adapter secrets, provider-key handling, and leaked receipt/log response.
27
+
28
+ ### Known Manual Release Gates
29
+
30
+ - `cmgl` is not yet published on PyPI at the time of this preparation; the first upload must be performed through PyPI Trusted Publishing.
31
+ - GitHub Releases are currently empty and require a human-created `v1.1.0` release.
32
+ - Five Dependabot PRs for GitHub Actions updates are open and should be reviewed separately.
33
+ - GitHub repository topic `puthon` should be corrected manually to `python`.
@@ -0,0 +1,5 @@
1
+ # Code of Conduct
2
+
3
+ This project expects technical, evidence-oriented discussion. Participants should keep communication relevant to the work, avoid harassment or personal attacks, and disclose conflicts or security-sensitive information through appropriate private channels.
4
+
5
+ Maintainers may moderate issues, pull requests, and discussions to protect project integrity and participant safety.
@@ -0,0 +1,28 @@
1
+ # Dependencies
2
+
3
+ Runtime dependencies:
4
+
5
+ - Pydantic v2
6
+ - Typer
7
+ - Rich
8
+ - tomli on Python < 3.11, for TOML config loading
9
+
10
+ Development dependencies:
11
+
12
+ - pytest
13
+ - pytest-cov
14
+ - ruff
15
+ - mypy
16
+ - build
17
+ - pip-audit
18
+
19
+ Optional extras:
20
+
21
+ - `cmgl[mem0]`: Mem0 safe integration shim dependency.
22
+ - `cmgl[graphiti]`: Graphiti safe integration shim dependency.
23
+ - `cmgl[langmem]`: LangMem safe integration shim dependency.
24
+ - `cmgl[langgraph]`: LangGraph safe integration helper dependency.
25
+ - `cmgl[adapters]`: all supported adapter dependencies.
26
+ - `cmgl[signing]`: `cryptography` for optional local Ed25519 ledger signing.
27
+
28
+ Optional adapter and signing dependencies are not required for core tests or examples.
cmgl-1.1.0/LICENSE ADDED
@@ -0,0 +1,199 @@
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,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising 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
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work.
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean any work of authorship, including
48
+ the original version of the Work and any modifications or additions
49
+ to that Work or Derivative Works thereof, that is intentionally
50
+ submitted to Licensor for inclusion in the Work by the copyright owner
51
+ or by an individual or Legal Entity authorized to submit on behalf of
52
+ the copyright owner. For the purposes of this definition, "submitted"
53
+ means any form of electronic, verbal, or written communication sent
54
+ to the Licensor or its representatives, including but not limited to
55
+ communication on electronic mailing lists, source code control systems,
56
+ and issue tracking systems that are managed by, or on behalf of, the
57
+ Licensor for the purpose of discussing and improving the Work, but
58
+ excluding communication that is conspicuously marked or otherwise
59
+ designated in writing by the copyright owner as "Not a Contribution."
60
+
61
+ "Contributor" shall mean Licensor and any individual or Legal Entity
62
+ on behalf of whom a Contribution has been received by Licensor and
63
+ subsequently incorporated within the Work.
64
+
65
+ 2. Grant of Copyright License. Subject to the terms and conditions of
66
+ this License, each Contributor hereby grants to You a perpetual,
67
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
68
+ copyright license to reproduce, prepare Derivative Works of,
69
+ publicly display, publicly perform, sublicense, and distribute the
70
+ Work and such Derivative Works in Source or Object form.
71
+
72
+ 3. Grant of Patent License. Subject to the terms and conditions of
73
+ this License, each Contributor hereby grants to You a perpetual,
74
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
75
+ patent license to make, have made, use, offer to sell, sell, import,
76
+ and otherwise transfer the Work, where such license applies only to
77
+ those patent claims licensable by such Contributor that are necessarily
78
+ infringed by their Contribution(s) alone or by combination of their
79
+ Contribution(s) with the Work to which such Contribution(s) was
80
+ submitted. If You institute patent litigation against any entity
81
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
82
+ the Work or a Contribution incorporated within the Work constitutes
83
+ direct or contributory patent infringement, then any patent licenses
84
+ granted to You under this License for that Work shall terminate as of
85
+ the date such litigation is filed.
86
+
87
+ 4. Redistribution. You may reproduce and distribute copies of the
88
+ Work or Derivative Works thereof in any medium, with or without
89
+ modifications, and in Source or Object form, provided that You
90
+ meet the following conditions:
91
+
92
+ (a) You must give any other recipients of the Work or
93
+ Derivative Works a copy of this License; and
94
+
95
+ (b) You must cause any modified files to carry prominent notices
96
+ stating that You changed the files; and
97
+
98
+ (c) You must retain, in the Source form of any Derivative Works
99
+ that You distribute, all copyright, patent, trademark, and
100
+ attribution notices from the Source form of the Work,
101
+ excluding those notices that do not pertain to any part of
102
+ the Derivative Works; and
103
+
104
+ (d) If the Work includes a "NOTICE" text file as part of its
105
+ distribution, then any Derivative Works that You distribute must
106
+ include a readable copy of the attribution notices contained
107
+ within such NOTICE file, excluding those notices that do not
108
+ pertain to any part of the Derivative Works, in at least one
109
+ of the following places: within a NOTICE text file distributed
110
+ as part of the Derivative Works; within the Source form or
111
+ documentation, if provided along with the Derivative Works; or,
112
+ within a display generated by the Derivative Works, if and
113
+ wherever such third-party notices normally appear. The contents
114
+ of the NOTICE file are for informational purposes only and
115
+ do not modify the License. You may add Your own attribution
116
+ notices within Derivative Works that You distribute, alongside
117
+ or as an addendum to the NOTICE text from the Work, provided
118
+ that such additional attribution notices cannot be construed
119
+ as modifying the License.
120
+
121
+ You may add Your own copyright statement to Your modifications and
122
+ may provide additional or different license terms and conditions
123
+ for use, reproduction, or distribution of Your modifications, or
124
+ for any such Derivative Works as a whole, provided Your use,
125
+ reproduction, and distribution of the Work otherwise complies with
126
+ the conditions stated in this License.
127
+
128
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
129
+ any Contribution intentionally submitted for inclusion in the Work
130
+ by You to the Licensor shall be under the terms and conditions of
131
+ this License, without any additional terms or conditions.
132
+ Notwithstanding the above, nothing herein shall supersede or modify
133
+ the terms of any separate license agreement you may have executed
134
+ with Licensor regarding such Contributions.
135
+
136
+ 6. Trademarks. This License does not grant permission to use the trade
137
+ names, trademarks, service marks, or product names of the Licensor,
138
+ except as required for reasonable and customary use in describing the
139
+ origin of the Work and reproducing the content of the NOTICE file.
140
+
141
+ 7. Disclaimer of Warranty. Unless required by applicable law or
142
+ agreed to in writing, Licensor provides the Work (and each
143
+ Contributor provides its Contributions) on an "AS IS" BASIS,
144
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
145
+ implied, including, without limitation, any warranties or conditions
146
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
147
+ PARTICULAR PURPOSE. You are solely responsible for determining the
148
+ appropriateness of using or redistributing the Work and assume any
149
+ risks associated with Your exercise of permissions under this License.
150
+
151
+ 8. Limitation of Liability. In no event and under no legal theory,
152
+ whether in tort (including negligence), contract, or otherwise,
153
+ unless required by applicable law (such as deliberate and grossly
154
+ negligent acts) or agreed to in writing, shall any Contributor be
155
+ liable to You for damages, including any direct, indirect, special,
156
+ incidental, or consequential damages of any character arising as a
157
+ result of this License or out of the use or inability to use the
158
+ Work (including but not limited to damages for loss of goodwill,
159
+ work stoppage, computer failure or malfunction, or any and all
160
+ other commercial damages or losses), even if such Contributor
161
+ has been advised of the possibility of such damages.
162
+
163
+ 9. Accepting Warranty or Additional Liability. While redistributing
164
+ the Work or Derivative Works thereof, You may choose to offer,
165
+ and charge a fee for, acceptance of support, warranty, indemnity,
166
+ or other liability obligations and/or rights consistent with this
167
+ License. However, in accepting such obligations, You may act only
168
+ on Your own behalf and on Your sole responsibility, not on behalf
169
+ of any other Contributor, and only if You agree to indemnify,
170
+ defend, and hold each Contributor harmless for any liability
171
+ incurred by, or claims asserted against, such Contributor by reason
172
+ of your accepting any such warranty or additional liability.
173
+
174
+ END OF TERMS AND CONDITIONS
175
+
176
+ APPENDIX: How to apply the Apache License to your work.
177
+
178
+ To apply the Apache License to your work, attach the following
179
+ boilerplate notice, with the fields enclosed by brackets "[]"
180
+ replaced with your own identifying information. Do not include
181
+ the brackets. The text should be enclosed in the appropriate
182
+ comment syntax for the file format. We also recommend that a
183
+ file or class name and description of purpose be included on the
184
+ same "printed page" as the copyright notice for easier
185
+ identification within third-party archives.
186
+
187
+ Copyright [yyyy] [name of copyright owner]
188
+
189
+ Licensed under the Apache License, Version 2.0 (the "License");
190
+ you may not use this file except in compliance with the License.
191
+ You may obtain a copy of the License at
192
+
193
+ http://www.apache.org/licenses/LICENSE-2.0
194
+
195
+ Unless required by applicable law or agreed to in writing, software
196
+ distributed under the License is distributed on an "AS IS" BASIS,
197
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
198
+ See the License for the specific language governing permissions and
199
+ limitations under the License.