agenomic 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.
Files changed (128) hide show
  1. agenomic-0.1.0/.github/workflows/ci.yml +40 -0
  2. agenomic-0.1.0/.github/workflows/release.yml +46 -0
  3. agenomic-0.1.0/.gitignore +38 -0
  4. agenomic-0.1.0/.python-version +1 -0
  5. agenomic-0.1.0/AGENTS.md +34 -0
  6. agenomic-0.1.0/CHANGELOG.md +24 -0
  7. agenomic-0.1.0/LICENSE +201 -0
  8. agenomic-0.1.0/PKG-INFO +137 -0
  9. agenomic-0.1.0/README.md +74 -0
  10. agenomic-0.1.0/docs/atep.md +44 -0
  11. agenomic-0.1.0/docs/cloud-upload.md +44 -0
  12. agenomic-0.1.0/docs/decorator.md +35 -0
  13. agenomic-0.1.0/docs/integrations.md +91 -0
  14. agenomic-0.1.0/docs/non-determinism.md +36 -0
  15. agenomic-0.1.0/docs/providers/huggingface.md +133 -0
  16. agenomic-0.1.0/docs/quickstart.md +47 -0
  17. agenomic-0.1.0/docs/redaction.md +39 -0
  18. agenomic-0.1.0/docs/rmp.md +84 -0
  19. agenomic-0.1.0/docs/tracing.md +36 -0
  20. agenomic-0.1.0/examples/01_minimal_trace.py +23 -0
  21. agenomic-0.1.0/examples/02_decorator_jsonl.py +29 -0
  22. agenomic-0.1.0/examples/03_atep_local.py +41 -0
  23. agenomic-0.1.0/examples/04_openai_traced.py +38 -0
  24. agenomic-0.1.0/examples/05_langgraph_traced.py +49 -0
  25. agenomic-0.1.0/examples/06_cloud_upload.py +45 -0
  26. agenomic-0.1.0/examples/07_offline_signed_release.py +67 -0
  27. agenomic-0.1.0/examples/08_online_tracking.py +45 -0
  28. agenomic-0.1.0/examples/09_rmp.py +57 -0
  29. agenomic-0.1.0/pyproject.toml +97 -0
  30. agenomic-0.1.0/scripts/make_golden_fixture.py +57 -0
  31. agenomic-0.1.0/scripts/smoke.sh +52 -0
  32. agenomic-0.1.0/src/agenomic/__init__.py +6 -0
  33. agenomic-0.1.0/src/agenomic/_client.py +91 -0
  34. agenomic-0.1.0/src/agenomic/_version.py +1 -0
  35. agenomic-0.1.0/src/agenomic/agent/__init__.py +22 -0
  36. agenomic-0.1.0/src/agenomic/agent/genome.py +234 -0
  37. agenomic-0.1.0/src/agenomic/atep/__init__.py +24 -0
  38. agenomic-0.1.0/src/agenomic/atep/clock.py +65 -0
  39. agenomic-0.1.0/src/agenomic/atep/event.py +136 -0
  40. agenomic-0.1.0/src/agenomic/atep/segment.py +200 -0
  41. agenomic-0.1.0/src/agenomic/atep/store.py +165 -0
  42. agenomic-0.1.0/src/agenomic/canonical/__init__.py +22 -0
  43. agenomic-0.1.0/src/agenomic/canonical/hashing.py +118 -0
  44. agenomic-0.1.0/src/agenomic/canonical/otel.py +74 -0
  45. agenomic-0.1.0/src/agenomic/canonical/recorder.py +345 -0
  46. agenomic-0.1.0/src/agenomic/cli/__init__.py +5 -0
  47. agenomic-0.1.0/src/agenomic/cli/__main__.py +172 -0
  48. agenomic-0.1.0/src/agenomic/client/__init__.py +6 -0
  49. agenomic-0.1.0/src/agenomic/client/auth.py +13 -0
  50. agenomic-0.1.0/src/agenomic/client/client.py +179 -0
  51. agenomic-0.1.0/src/agenomic/client/retry.py +21 -0
  52. agenomic-0.1.0/src/agenomic/crypto/__init__.py +27 -0
  53. agenomic-0.1.0/src/agenomic/crypto/canonical.py +31 -0
  54. agenomic-0.1.0/src/agenomic/crypto/hashing.py +48 -0
  55. agenomic-0.1.0/src/agenomic/crypto/signing.py +155 -0
  56. agenomic-0.1.0/src/agenomic/exceptions.py +35 -0
  57. agenomic-0.1.0/src/agenomic/exporters/__init__.py +15 -0
  58. agenomic-0.1.0/src/agenomic/exporters/atep_local.py +77 -0
  59. agenomic-0.1.0/src/agenomic/exporters/base.py +35 -0
  60. agenomic-0.1.0/src/agenomic/exporters/http.py +84 -0
  61. agenomic-0.1.0/src/agenomic/exporters/jsonl.py +47 -0
  62. agenomic-0.1.0/src/agenomic/exporters/multi.py +42 -0
  63. agenomic-0.1.0/src/agenomic/integrations/__init__.py +32 -0
  64. agenomic-0.1.0/src/agenomic/integrations/anthropic.py +130 -0
  65. agenomic-0.1.0/src/agenomic/integrations/huggingface.py +188 -0
  66. agenomic-0.1.0/src/agenomic/integrations/langgraph.py +154 -0
  67. agenomic-0.1.0/src/agenomic/integrations/mcp.py +53 -0
  68. agenomic-0.1.0/src/agenomic/integrations/openai.py +140 -0
  69. agenomic-0.1.0/src/agenomic/providers/__init__.py +30 -0
  70. agenomic-0.1.0/src/agenomic/providers/huggingface.py +378 -0
  71. agenomic-0.1.0/src/agenomic/py.typed +0 -0
  72. agenomic-0.1.0/src/agenomic/redaction/__init__.py +6 -0
  73. agenomic-0.1.0/src/agenomic/redaction/engine.py +117 -0
  74. agenomic-0.1.0/src/agenomic/redaction/rules.py +46 -0
  75. agenomic-0.1.0/src/agenomic/rmp/__init__.py +25 -0
  76. agenomic-0.1.0/src/agenomic/rmp/resources.py +596 -0
  77. agenomic-0.1.0/src/agenomic/trace/__init__.py +19 -0
  78. agenomic-0.1.0/src/agenomic/trace/context.py +36 -0
  79. agenomic-0.1.0/src/agenomic/trace/decorator.py +158 -0
  80. agenomic-0.1.0/src/agenomic/trace/envelope_builder.py +55 -0
  81. agenomic-0.1.0/src/agenomic/trace/recorder.py +41 -0
  82. agenomic-0.1.0/src/agenomic/tracking/__init__.py +15 -0
  83. agenomic-0.1.0/src/agenomic/tracking/session.py +247 -0
  84. agenomic-0.1.0/src/agenomic/types/__init__.py +77 -0
  85. agenomic-0.1.0/src/agenomic/types/attestation.py +40 -0
  86. agenomic-0.1.0/src/agenomic/types/envelope.py +49 -0
  87. agenomic-0.1.0/src/agenomic/types/identifiers.py +25 -0
  88. agenomic-0.1.0/src/agenomic/types/orchestration.py +429 -0
  89. agenomic-0.1.0/src/agenomic/types/trace.py +89 -0
  90. agenomic-0.1.0/tests/conftest.py +36 -0
  91. agenomic-0.1.0/tests/fixtures/golden_atep_segments/README.md +19 -0
  92. agenomic-0.1.0/tests/fixtures/golden_atep_segments/golden_pub.pem +3 -0
  93. agenomic-0.1.0/tests/fixtures/golden_atep_segments/golden_v1.atep +0 -0
  94. agenomic-0.1.0/tests/schemas/v0.3/event-type-registry.json +407 -0
  95. agenomic-0.1.0/tests/schemas/v0.3/trace-event.schema.json +37 -0
  96. agenomic-0.1.0/tests/test_agent_genome.py +83 -0
  97. agenomic-0.1.0/tests/test_atep_clock.py +33 -0
  98. agenomic-0.1.0/tests/test_atep_event.py +62 -0
  99. agenomic-0.1.0/tests/test_atep_golden.py +52 -0
  100. agenomic-0.1.0/tests/test_atep_segment.py +92 -0
  101. agenomic-0.1.0/tests/test_atep_store.py +96 -0
  102. agenomic-0.1.0/tests/test_canonical_langgraph.py +57 -0
  103. agenomic-0.1.0/tests/test_canonical_otel.py +42 -0
  104. agenomic-0.1.0/tests/test_canonical_recorder.py +56 -0
  105. agenomic-0.1.0/tests/test_canonical_redaction.py +44 -0
  106. agenomic-0.1.0/tests/test_cli.py +112 -0
  107. agenomic-0.1.0/tests/test_client.py +124 -0
  108. agenomic-0.1.0/tests/test_crypto_canonical.py +27 -0
  109. agenomic-0.1.0/tests/test_crypto_hashing.py +35 -0
  110. agenomic-0.1.0/tests/test_crypto_signing.py +91 -0
  111. agenomic-0.1.0/tests/test_examples.py +35 -0
  112. agenomic-0.1.0/tests/test_exporters_atep.py +62 -0
  113. agenomic-0.1.0/tests/test_exporters_http.py +57 -0
  114. agenomic-0.1.0/tests/test_exporters_jsonl.py +48 -0
  115. agenomic-0.1.0/tests/test_exporters_multi.py +38 -0
  116. agenomic-0.1.0/tests/test_integrations_huggingface.py +110 -0
  117. agenomic-0.1.0/tests/test_integrations_langgraph.py +53 -0
  118. agenomic-0.1.0/tests/test_integrations_mcp.py +30 -0
  119. agenomic-0.1.0/tests/test_integrations_openai.py +66 -0
  120. agenomic-0.1.0/tests/test_providers_huggingface.py +232 -0
  121. agenomic-0.1.0/tests/test_redaction.py +104 -0
  122. agenomic-0.1.0/tests/test_rmp.py +305 -0
  123. agenomic-0.1.0/tests/test_trace_context.py +22 -0
  124. agenomic-0.1.0/tests/test_trace_decorator.py +206 -0
  125. agenomic-0.1.0/tests/test_trace_envelope.py +59 -0
  126. agenomic-0.1.0/tests/test_tracking.py +172 -0
  127. agenomic-0.1.0/tests/test_types.py +92 -0
  128. agenomic-0.1.0/tests/test_types_orchestration.py +231 -0
@@ -0,0 +1,40 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ os: [ubuntu-latest, macos-latest, windows-latest]
14
+ python: ["3.10", "3.11", "3.12", "3.13"]
15
+ runs-on: ${{ matrix.os }}
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: ${{ matrix.python }}
21
+ - name: Install
22
+ run: |
23
+ python -m pip install --upgrade pip
24
+ python -m pip install -e ".[dev,all]"
25
+ - name: Ruff lint
26
+ run: ruff check src tests examples
27
+ - name: Ruff format
28
+ run: ruff format --check src tests examples
29
+ - name: Mypy
30
+ run: mypy src
31
+ - name: Pytest
32
+ run: pytest -v --cov=agenomic --cov-fail-under=85
33
+ - name: Run offline examples
34
+ if: matrix.os != 'windows-latest'
35
+ run: |
36
+ python examples/01_minimal_trace.py > /dev/null
37
+ python examples/02_decorator_jsonl.py > /dev/null
38
+ python examples/03_atep_local.py > /dev/null
39
+ python examples/05_langgraph_traced.py > /dev/null
40
+ python examples/07_offline_signed_release.py > /dev/null
@@ -0,0 +1,46 @@
1
+ name: release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: "3.11"
16
+ - name: Install build
17
+ run: python -m pip install --upgrade pip build
18
+ - name: Build wheel and sdist
19
+ run: python -m build
20
+ - uses: actions/upload-artifact@v4
21
+ with:
22
+ name: dist
23
+ path: dist/
24
+
25
+ publish:
26
+ needs: build
27
+ runs-on: ubuntu-latest
28
+ permissions:
29
+ id-token: write # OIDC trusted publisher
30
+ contents: write
31
+ environment:
32
+ name: pypi
33
+ url: https://pypi.org/p/agenomic
34
+ steps:
35
+ - uses: actions/download-artifact@v4
36
+ with:
37
+ name: dist
38
+ path: dist/
39
+ - name: Publish to PyPI
40
+ uses: pypa/gh-action-pypi-publish@release/v1
41
+ - name: Create GitHub Release
42
+ if: startsWith(github.ref, 'refs/tags/')
43
+ uses: softprops/action-gh-release@v2
44
+ with:
45
+ generate_release_notes: true
46
+ files: dist/*
@@ -0,0 +1,38 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[oc]
4
+ *.egg-info/
5
+ build/
6
+ dist/
7
+ wheels/
8
+ .eggs/
9
+
10
+ # Virtual environments
11
+ .venv/
12
+ venv/
13
+ env/
14
+
15
+ # Testing
16
+ .pytest_cache/
17
+ .mypy_cache/
18
+ .ruff_cache/
19
+ htmlcov/
20
+ .coverage
21
+ .coverage.*
22
+ coverage.xml
23
+
24
+ # Agenomic
25
+ *.atep
26
+ # … except the committed golden wire-format anchors (see scripts/make_golden_fixture.py)
27
+ !tests/fixtures/golden_atep_segments/*.atep
28
+ .agenomic/
29
+
30
+ # IDE
31
+ .idea/
32
+ .vscode/
33
+ *.swp
34
+ *~
35
+
36
+ # OS
37
+ .DS_Store
38
+ Thumbs.db
@@ -0,0 +1 @@
1
+ 3.10
@@ -0,0 +1,34 @@
1
+ # agenomic-python — agent instructions
2
+
3
+ Public Python SDK for Agenomic. Apache-2.0.
4
+
5
+ ## Product invariants
6
+
7
+ 1. Works fully offline. No primitive requires network.
8
+ 2. ATEP-native. Segments produced here are bit-for-bit compatible with
9
+ agenomic-cli and agenomic-cloud.
10
+ 3. Integrations are optional and lazy. Top-level imports never load
11
+ openai, anthropic, langgraph or mcp.
12
+
13
+ ## Engineering rules
14
+
15
+ - mypy strict. No `Any` in public APIs.
16
+ - pydantic v2 for all data models.
17
+ - No `print()` in library code. Use `logging.getLogger("agenomic.<module>")`.
18
+ - All public functions have docstrings with at least one example.
19
+ - Async-first for I/O-bound primitives (HTTP, file streams). Provide sync
20
+ wrappers via `asyncio.run` only at the top level.
21
+ - No bare `except:`. Catch specific exceptions.
22
+
23
+ ## Naming
24
+
25
+ - Package: `agenomic`
26
+ - CLI: `agenomic-py` (entry point)
27
+ - ATEP file extension: `.atep`
28
+ - Default config dir: `~/.config/agenomic/`
29
+
30
+ ## Security defaults
31
+
32
+ - Redaction runs BEFORE any export.
33
+ - ed25519 PEM keys loaded with file mode check (warn if not 0600).
34
+ - HTTP client uses TLS verify=True. No `verify=False` flag exposed.
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ - Hugging Face provider connector (`agenomic.providers.huggingface`): provider
13
+ alias normalization, `HuggingFaceConfig` with env loading and token
14
+ redaction, an httpx-based `HuggingFaceClient`
15
+ (`validate_credentials`, `resolve_model_metadata`, `generate_text`,
16
+ `embeddings`), and a lockfile model-entry builder (SHA-256 over canonical JSON).
17
+ - Hugging Face instrumentation integration
18
+ (`agenomic.integrations.huggingface`): `instrument_huggingface` and
19
+ `trace_huggingface_call` record `ModelCall(provider="huggingface", ...)`
20
+ without ever logging the token.
21
+ - `client.agent.load(path)` + `agent.configure_model(provider=, model=, task=)`
22
+ to write a provider-agnostic model config into a local `genome.yaml`/`.json`.
23
+ - Optional dependency extra `huggingface` (`huggingface-hub>=0.20`). The SDK
24
+ core itself only requires `httpx`.
agenomic-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
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
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Support. While redistributing the Work or
166
+ Derivative Works thereof, You may choose to offer, and charge a
167
+ fee for, acceptance of support, warranty, indemnity, or other
168
+ liability obligations and/or rights consistent with this License.
169
+ However, in accepting such obligations, You may act only on Your
170
+ own behalf and on Your sole responsibility, not on behalf of any
171
+ other Contributor, and only if You agree to indemnify, defend,
172
+ and hold each Contributor harmless for any liability incurred by,
173
+ or claims asserted against, such Contributor by reason of your
174
+ accepting any such warranty or support.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Agenomic contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
200
+ implied. See the License for the specific language governing permissions
201
+ and limitations under the License.
@@ -0,0 +1,137 @@
1
+ Metadata-Version: 2.4
2
+ Name: agenomic
3
+ Version: 0.1.0
4
+ Summary: Python SDK for Agenomic — agent-native versioning, tracing, and ATEP signed event logs.
5
+ Project-URL: Homepage, https://agenomic.dev
6
+ Project-URL: Source, https://github.com/agenomic/agenomic-python
7
+ Project-URL: Issues, https://github.com/agenomic/agenomic-python/issues
8
+ Author: Agenomic contributors
9
+ License: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: agent,ai-act,atep,compliance,llm,tracing,versioning
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Libraries
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: blake3<1,>=0.4
23
+ Requires-Dist: cbor2<6,>=5.6
24
+ Requires-Dist: cryptography<46,>=42
25
+ Requires-Dist: httpx<1,>=0.27
26
+ Requires-Dist: pydantic<3,>=2.7
27
+ Requires-Dist: typing-extensions>=4.10
28
+ Requires-Dist: ulid-py<2,>=1.1
29
+ Provides-Extra: all
30
+ Requires-Dist: anthropic>=0.34; extra == 'all'
31
+ Requires-Dist: huggingface-hub>=0.20; extra == 'all'
32
+ Requires-Dist: langgraph>=0.2; extra == 'all'
33
+ Requires-Dist: mcp>=1.0; extra == 'all'
34
+ Requires-Dist: openai>=1.40; extra == 'all'
35
+ Requires-Dist: opentelemetry-api>=1.20; extra == 'all'
36
+ Requires-Dist: opentelemetry-sdk>=1.20; extra == 'all'
37
+ Provides-Extra: anthropic
38
+ Requires-Dist: anthropic>=0.34; extra == 'anthropic'
39
+ Provides-Extra: dev
40
+ Requires-Dist: freezegun>=1.5; extra == 'dev'
41
+ Requires-Dist: hypothesis>=6.110; extra == 'dev'
42
+ Requires-Dist: jsonschema>=4.18; extra == 'dev'
43
+ Requires-Dist: mypy>=1.11; extra == 'dev'
44
+ Requires-Dist: opentelemetry-api>=1.20; extra == 'dev'
45
+ Requires-Dist: opentelemetry-sdk>=1.20; extra == 'dev'
46
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
47
+ Requires-Dist: pytest-cov>=5; extra == 'dev'
48
+ Requires-Dist: pytest-httpx>=0.30; extra == 'dev'
49
+ Requires-Dist: pytest>=8; extra == 'dev'
50
+ Requires-Dist: ruff>=0.6; extra == 'dev'
51
+ Provides-Extra: huggingface
52
+ Requires-Dist: huggingface-hub>=0.20; extra == 'huggingface'
53
+ Provides-Extra: langgraph
54
+ Requires-Dist: langgraph>=0.2; extra == 'langgraph'
55
+ Provides-Extra: mcp
56
+ Requires-Dist: mcp>=1.0; extra == 'mcp'
57
+ Provides-Extra: openai
58
+ Requires-Dist: openai>=1.40; extra == 'openai'
59
+ Provides-Extra: otel
60
+ Requires-Dist: opentelemetry-api>=1.20; extra == 'otel'
61
+ Requires-Dist: opentelemetry-sdk>=1.20; extra == 'otel'
62
+ Description-Content-Type: text/markdown
63
+
64
+ # agenomic-python
65
+
66
+ [![CI](https://github.com/agenomic/agenomic-python/actions/workflows/ci.yml/badge.svg)](https://github.com/agenomic/agenomic-python/actions/workflows/ci.yml)
67
+ [![PyPI](https://img.shields.io/pypi/v/agenomic.svg)](https://pypi.org/project/agenomic/)
68
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
69
+
70
+ Python SDK for [Agenomic](https://agenomic.dev) — agent-native versioning, tracing, and ATEP signed event logs.
71
+
72
+ Works fully offline. Cloud upload is optional.
73
+
74
+ ## Install
75
+
76
+ ```bash
77
+ pip install agenomic
78
+ ```
79
+
80
+ Optional integrations:
81
+
82
+ ```bash
83
+ pip install "agenomic[openai]" # OpenAI auto-instrumentation
84
+ pip install "agenomic[anthropic]" # Anthropic auto-instrumentation
85
+ pip install "agenomic[huggingface]" # Hugging Face Hub + Inference
86
+ pip install "agenomic[langgraph]" # LangGraph state-graph tracing
87
+ pip install "agenomic[all]" # Everything
88
+ ```
89
+
90
+ ## Quickstart
91
+
92
+ ```python
93
+ from agenomic.trace.decorator import trace_agent_run
94
+ from agenomic.exporters.jsonl import JsonlExporter
95
+
96
+ with JsonlExporter("traces.jsonl") as exporter:
97
+
98
+ @trace_agent_run(agent_id="agent://acme/demo", exporter=exporter)
99
+ def handle(query: str) -> dict:
100
+ return {"answer": query.upper()}
101
+
102
+ handle("hello")
103
+ ```
104
+
105
+ That writes a signed-ready `TraceEnvelope` to `traces.jsonl`. No network. No
106
+ account required.
107
+
108
+ ## What's in the box
109
+
110
+ - `@trace_agent_run` decorator (sync + async) with contextvar-based propagation
111
+ - `TraceEnvelope` pydantic v2 models compatible with `agenomic-spec`
112
+ - `WorkflowSpec` / `SystemSpec` pydantic v2 models for the v0.2 workflow and
113
+ multi-agent system manifests (RFC 0009), with step-graph and role checks
114
+ - ATEP segment writer/reader with BLAKE3 causal hashes and ed25519 signatures
115
+ - Boundary redaction (REMOVE / MASK / HASH / TRUNCATE) with dotted paths
116
+ - Exporters: JSONL, ATEP local, HTTP batched, multi fan-out
117
+ - Optional, lazy-imported integrations: OpenAI, Anthropic, LangGraph, MCP
118
+ - Async-first cloud client with idempotency keys + retry
119
+
120
+ ## Documentation
121
+
122
+ - [Quickstart](docs/quickstart.md)
123
+ - [Tracing](docs/tracing.md) · [Decorator](docs/decorator.md)
124
+ - [ATEP](docs/atep.md) · [Redaction](docs/redaction.md)
125
+ - [Integrations](docs/integrations.md) · [Cloud upload](docs/cloud-upload.md)
126
+ - [Hugging Face provider](docs/providers/huggingface.md)
127
+ - [Non-determinism disclaimer](docs/non-determinism.md)
128
+
129
+ ## Examples
130
+
131
+ See [`examples/`](examples/) — minimal trace, decorator + JSONL, ATEP local,
132
+ OpenAI traced, LangGraph traced, cloud upload, and a full offline signed
133
+ release.
134
+
135
+ ## License
136
+
137
+ Apache-2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,74 @@
1
+ # agenomic-python
2
+
3
+ [![CI](https://github.com/agenomic/agenomic-python/actions/workflows/ci.yml/badge.svg)](https://github.com/agenomic/agenomic-python/actions/workflows/ci.yml)
4
+ [![PyPI](https://img.shields.io/pypi/v/agenomic.svg)](https://pypi.org/project/agenomic/)
5
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
6
+
7
+ Python SDK for [Agenomic](https://agenomic.dev) — agent-native versioning, tracing, and ATEP signed event logs.
8
+
9
+ Works fully offline. Cloud upload is optional.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pip install agenomic
15
+ ```
16
+
17
+ Optional integrations:
18
+
19
+ ```bash
20
+ pip install "agenomic[openai]" # OpenAI auto-instrumentation
21
+ pip install "agenomic[anthropic]" # Anthropic auto-instrumentation
22
+ pip install "agenomic[huggingface]" # Hugging Face Hub + Inference
23
+ pip install "agenomic[langgraph]" # LangGraph state-graph tracing
24
+ pip install "agenomic[all]" # Everything
25
+ ```
26
+
27
+ ## Quickstart
28
+
29
+ ```python
30
+ from agenomic.trace.decorator import trace_agent_run
31
+ from agenomic.exporters.jsonl import JsonlExporter
32
+
33
+ with JsonlExporter("traces.jsonl") as exporter:
34
+
35
+ @trace_agent_run(agent_id="agent://acme/demo", exporter=exporter)
36
+ def handle(query: str) -> dict:
37
+ return {"answer": query.upper()}
38
+
39
+ handle("hello")
40
+ ```
41
+
42
+ That writes a signed-ready `TraceEnvelope` to `traces.jsonl`. No network. No
43
+ account required.
44
+
45
+ ## What's in the box
46
+
47
+ - `@trace_agent_run` decorator (sync + async) with contextvar-based propagation
48
+ - `TraceEnvelope` pydantic v2 models compatible with `agenomic-spec`
49
+ - `WorkflowSpec` / `SystemSpec` pydantic v2 models for the v0.2 workflow and
50
+ multi-agent system manifests (RFC 0009), with step-graph and role checks
51
+ - ATEP segment writer/reader with BLAKE3 causal hashes and ed25519 signatures
52
+ - Boundary redaction (REMOVE / MASK / HASH / TRUNCATE) with dotted paths
53
+ - Exporters: JSONL, ATEP local, HTTP batched, multi fan-out
54
+ - Optional, lazy-imported integrations: OpenAI, Anthropic, LangGraph, MCP
55
+ - Async-first cloud client with idempotency keys + retry
56
+
57
+ ## Documentation
58
+
59
+ - [Quickstart](docs/quickstart.md)
60
+ - [Tracing](docs/tracing.md) · [Decorator](docs/decorator.md)
61
+ - [ATEP](docs/atep.md) · [Redaction](docs/redaction.md)
62
+ - [Integrations](docs/integrations.md) · [Cloud upload](docs/cloud-upload.md)
63
+ - [Hugging Face provider](docs/providers/huggingface.md)
64
+ - [Non-determinism disclaimer](docs/non-determinism.md)
65
+
66
+ ## Examples
67
+
68
+ See [`examples/`](examples/) — minimal trace, decorator + JSONL, ATEP local,
69
+ OpenAI traced, LangGraph traced, cloud upload, and a full offline signed
70
+ release.
71
+
72
+ ## License
73
+
74
+ Apache-2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,44 @@
1
+ # ATEP
2
+
3
+ ATEP is the **Attested Tamper-Evident Provenance** log format. It captures
4
+ the full history of an agent — identity, capabilities, knowledge, policy,
5
+ runtime, interactions, governance — as a chain of signed events.
6
+
7
+ `agenomic-python` produces ATEP segments that are bit-for-bit compatible
8
+ with `agenomic-cli` (Rust) and `agenomic-cloud`.
9
+
10
+ ## Concepts
11
+
12
+ - **Event**: one signed unit. Carries a header, a payload, a 32-byte BLAKE3
13
+ causal hash over (header || payload || sorted parents), and an ed25519
14
+ signature over the causal hash.
15
+ - **Segment**: a binary file (`.atep`) containing N events plus a header
16
+ with first/last HLC, event count, and a Merkle root over causal hashes.
17
+ - **Store**: a directory layout with one `manifest.json` and one or more
18
+ segments per stream.
19
+
20
+ ## Streams
21
+
22
+ | stream | what goes in it |
23
+ | -------------- | --------------------------------------------------------- |
24
+ | `identity` | agent creation, ownership |
25
+ | `capability` | enabled tools, permissions |
26
+ | `knowledge` | system prompts, knowledge bases attached |
27
+ | `policy` | policy rules, guardrails |
28
+ | `runtime` | model fingerprint, runtime config |
29
+ | `interaction` | one event per agent run (the SDK's main output) |
30
+ | `governance` | release decisions, approvals |
31
+
32
+ ## Wire format
33
+
34
+ See [`src/agenomic/atep/segment.py`](../src/agenomic/atep/segment.py)
35
+ for the canonical layout. CRC32 over everything before the trailing
36
+ `PETA` magic protects against truncation. The 32-byte Merkle root over
37
+ event causal hashes protects against per-event tampering.
38
+
39
+ ## Cross-implementation compat
40
+
41
+ The fixture at
42
+ [`tests/fixtures/golden_atep_segments/golden_v1.atep`](../tests/fixtures/golden_atep_segments/)
43
+ is the wire-format anchor. Any implementation that wants to claim ATEP-v1
44
+ compatibility MUST be able to read it and verify its signatures.