chitmark 0.1.1__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,93 @@
1
+ # Dependencies
2
+ node_modules/
3
+ .pnpm-store/
4
+ .corepack-cache/
5
+
6
+ # Build outputs
7
+ dist/
8
+ build/
9
+ out/
10
+ *.tsbuildinfo
11
+ .turbo/
12
+ .vite/
13
+ .cache/
14
+ .eslintcache
15
+ .next/
16
+ .nuxt/
17
+
18
+ # Python
19
+ __pycache__/
20
+ *.py[cod]
21
+ *$py.class
22
+ *.egg-info/
23
+ .eggs/
24
+ .venv/
25
+ venv/
26
+ .env.venv/
27
+ .python-version
28
+ .mypy_cache/
29
+ .pytest_cache/
30
+ .ruff_cache/
31
+ .tox/
32
+ .nox/
33
+ .hypothesis/
34
+ htmlcov/
35
+ .coverage
36
+ .coverage.*
37
+ coverage.xml
38
+ packages/sdk-python/dist/
39
+ .uv/
40
+
41
+ # Env & secrets (never commit; keep templates)
42
+ .env
43
+ .env.*
44
+ !.env.example
45
+ !.env*.example
46
+ *.pem
47
+ *.key
48
+ !*.key.pub
49
+
50
+ # IDE / OS
51
+ .DS_Store
52
+ Thumbs.db
53
+ .idea/
54
+ .vscode/*
55
+ !.vscode/extensions.json
56
+ !.vscode/settings.json
57
+ *.swp
58
+ *.swo
59
+ *~
60
+
61
+ # Coverage / reports
62
+ coverage/
63
+ .nyc_output/
64
+ playwright-report/
65
+ test-results/
66
+ blob-report/
67
+
68
+ # Logs
69
+ *.log
70
+ logs/
71
+ npm-debug.log*
72
+ yarn-debug.log*
73
+ yarn-error.log*
74
+ pnpm-debug.log*
75
+ lerna-debug.log*
76
+
77
+ # Wrangler / Cloudflare
78
+ .wrangler/
79
+ .dev.vars
80
+ .dev.vars.*
81
+ .mf/
82
+
83
+ # Packaging / local artifacts
84
+ *.tgz
85
+ .python-packages/
86
+ *.local
87
+
88
+ # Local planning / task boards (not source of truth)
89
+ .tasks/
90
+
91
+ # Tinybird CLI local auth (contains tokens)
92
+ .tinyb
93
+ tinybird/.tinyb
chitmark-0.1.1/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ Copyright (c) 2026 Open Agent Ledger. All rights reserved.
2
+
3
+ Proprietary license. You are granted a non-exclusive, non-transferable,
4
+ worldwide right to use, modify, and integrate this software in applications
5
+ that communicate with the Chitmark API. Redistribution of this software or
6
+ its modifications — in whole or in part — and sublicensing are prohibited
7
+ without prior written consent from Open Agent Ledger.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
12
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
13
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
14
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
15
+ SOFTWARE.
@@ -0,0 +1,130 @@
1
+ Metadata-Version: 2.4
2
+ Name: chitmark
3
+ Version: 0.1.1
4
+ Summary: Official Python SDK for Chitmark by Open Agent Ledger — trust decisions on agent-mediated actions (verify, feedback, challenge)
5
+ Project-URL: Homepage, https://chitmark.com
6
+ Project-URL: Documentation, https://chitmark.com/docs
7
+ Project-URL: Repository, https://github.com/nonameuserd/Chitmark
8
+ Project-URL: Issues, https://github.com/nonameuserd/Chitmark/issues
9
+ Author-email: Open Agent Ledger <dev@chitmark.com>
10
+ License: Proprietary — no open-source grant. Copyright (c) 2026 Open Agent Ledger. All rights reserved.
11
+ License-File: LICENSE
12
+ Keywords: agent-actions,anti-abuse,chitmark,open-agent-ledger,trust-decisions
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
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: Typing :: Typed
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: httpx>=0.27.0
23
+ Provides-Extra: dev
24
+ Requires-Dist: cryptography>=43.0.0; extra == 'dev'
25
+ Requires-Dist: mypy>=1.14.0; extra == 'dev'
26
+ Requires-Dist: pyjwt>=2.9.0; extra == 'dev'
27
+ Requires-Dist: pytest-asyncio>=0.25.0; extra == 'dev'
28
+ Requires-Dist: pytest>=8.3.0; extra == 'dev'
29
+ Requires-Dist: respx>=0.22.0; extra == 'dev'
30
+ Requires-Dist: ruff>=0.9.0; extra == 'dev'
31
+ Provides-Extra: verdict
32
+ Requires-Dist: cryptography>=43.0.0; extra == 'verdict'
33
+ Requires-Dist: pyjwt>=2.9.0; extra == 'verdict'
34
+ Description-Content-Type: text/markdown
35
+
36
+ # chitmark (Python)
37
+
38
+ Official Python SDK for Chitmark — trust decisions on agent-mediated actions, tuned by business outcomes (`verify` / `feedback` / `challenge`).
39
+
40
+ [![PyPI version](https://img.shields.io/pypi/v/chitmark.svg)](https://pypi.org/project/chitmark/)
41
+
42
+ Requires Python ≥ 3.10.
43
+
44
+ ## Install
45
+
46
+ ```bash
47
+ pip install chitmark
48
+ # or
49
+ uv add chitmark
50
+ ```
51
+
52
+ ## Quick start
53
+
54
+ ```python
55
+ from chitmark import Chitmark
56
+
57
+ client = Chitmark(api_key="ck_live_...")
58
+
59
+ verdict = client.verify(
60
+ action="signup",
61
+ session="sess_9f3a",
62
+ surface="app.acme.com/signup",
63
+ subject={
64
+ "email": "buyer@acmecorp.com",
65
+ "ip": "203.0.113.7",
66
+ "userAgent": "...",
67
+ },
68
+ )
69
+ # Persist verdict["eventId"] on the account row — feedback joins only on that id.
70
+ # Default pii_mode="hashed" minimizes email/IP before the wire.
71
+ ```
72
+
73
+ ## API
74
+
75
+ Three verbs:
76
+
77
+ | Method | Endpoint | Purpose |
78
+ | :---------------------- | :------------------- | :------- |
79
+ | `client.verify(...)` | `POST /v1/verify` | Decide |
80
+ | `client.feedback(...)` | `POST /v1/feedback` | Learn |
81
+ | `client.challenge(...)` | `POST /v1/challenge` | Escalate |
82
+
83
+ **Golden rule:** fail to `challenge`, never to `allow`. Timeouts return a degraded challenge verdict.
84
+
85
+ ### Feedback
86
+
87
+ Attribution is a schema contract, not a lookup: store the `eventId` from
88
+ `verify` on the account row, then report outcomes against that same id — never
89
+ a derived or guessed id.
90
+
91
+ ```python
92
+ # At signup: persist the join key
93
+ verdict = client.verify(action="signup", subject={"email": "a@b.com"})
94
+ db.accounts.update(user_id, chitmark_event_id=verdict["eventId"])
95
+
96
+ # Later, when a label matures (credit burn, chargeback, …):
97
+ client.feedback(
98
+ event_id=account.chitmark_event_id, # the stored join key — never guessed
99
+ outcome="credit_burn",
100
+ value=87.4,
101
+ unit="usd",
102
+ observed_at="2026-08-06T04:00:00Z",
103
+ )
104
+ ```
105
+
106
+ ### PII
107
+
108
+ | Mode | Behavior |
109
+ | :------------ | :------------------------------------------------------ |
110
+ | `hashed` (default) | SHA-256 email, /24 IP truncation, minimized form fields |
111
+ | `none` | Derived/header-shape signals only |
112
+ | `raw` | Tenant opt-in only; higher compliance review |
113
+
114
+ ## Develop
115
+
116
+ ```bash
117
+ cd packages/sdk-python
118
+ uv sync --extra dev # or: pip install -e ".[dev]"
119
+ pytest
120
+ ruff check .
121
+ ```
122
+
123
+ ## Resources
124
+
125
+ - [API reference](https://chitmark.com/docs)
126
+ - [GitHub](https://github.com/nonameuserd/Chitmark)
127
+
128
+ ## License
129
+
130
+ Proprietary — see [LICENSE](LICENSE).
@@ -0,0 +1,95 @@
1
+ # chitmark (Python)
2
+
3
+ Official Python SDK for Chitmark — trust decisions on agent-mediated actions, tuned by business outcomes (`verify` / `feedback` / `challenge`).
4
+
5
+ [![PyPI version](https://img.shields.io/pypi/v/chitmark.svg)](https://pypi.org/project/chitmark/)
6
+
7
+ Requires Python ≥ 3.10.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pip install chitmark
13
+ # or
14
+ uv add chitmark
15
+ ```
16
+
17
+ ## Quick start
18
+
19
+ ```python
20
+ from chitmark import Chitmark
21
+
22
+ client = Chitmark(api_key="ck_live_...")
23
+
24
+ verdict = client.verify(
25
+ action="signup",
26
+ session="sess_9f3a",
27
+ surface="app.acme.com/signup",
28
+ subject={
29
+ "email": "buyer@acmecorp.com",
30
+ "ip": "203.0.113.7",
31
+ "userAgent": "...",
32
+ },
33
+ )
34
+ # Persist verdict["eventId"] on the account row — feedback joins only on that id.
35
+ # Default pii_mode="hashed" minimizes email/IP before the wire.
36
+ ```
37
+
38
+ ## API
39
+
40
+ Three verbs:
41
+
42
+ | Method | Endpoint | Purpose |
43
+ | :---------------------- | :------------------- | :------- |
44
+ | `client.verify(...)` | `POST /v1/verify` | Decide |
45
+ | `client.feedback(...)` | `POST /v1/feedback` | Learn |
46
+ | `client.challenge(...)` | `POST /v1/challenge` | Escalate |
47
+
48
+ **Golden rule:** fail to `challenge`, never to `allow`. Timeouts return a degraded challenge verdict.
49
+
50
+ ### Feedback
51
+
52
+ Attribution is a schema contract, not a lookup: store the `eventId` from
53
+ `verify` on the account row, then report outcomes against that same id — never
54
+ a derived or guessed id.
55
+
56
+ ```python
57
+ # At signup: persist the join key
58
+ verdict = client.verify(action="signup", subject={"email": "a@b.com"})
59
+ db.accounts.update(user_id, chitmark_event_id=verdict["eventId"])
60
+
61
+ # Later, when a label matures (credit burn, chargeback, …):
62
+ client.feedback(
63
+ event_id=account.chitmark_event_id, # the stored join key — never guessed
64
+ outcome="credit_burn",
65
+ value=87.4,
66
+ unit="usd",
67
+ observed_at="2026-08-06T04:00:00Z",
68
+ )
69
+ ```
70
+
71
+ ### PII
72
+
73
+ | Mode | Behavior |
74
+ | :------------ | :------------------------------------------------------ |
75
+ | `hashed` (default) | SHA-256 email, /24 IP truncation, minimized form fields |
76
+ | `none` | Derived/header-shape signals only |
77
+ | `raw` | Tenant opt-in only; higher compliance review |
78
+
79
+ ## Develop
80
+
81
+ ```bash
82
+ cd packages/sdk-python
83
+ uv sync --extra dev # or: pip install -e ".[dev]"
84
+ pytest
85
+ ruff check .
86
+ ```
87
+
88
+ ## Resources
89
+
90
+ - [API reference](https://chitmark.com/docs)
91
+ - [GitHub](https://github.com/nonameuserd/Chitmark)
92
+
93
+ ## License
94
+
95
+ Proprietary — see [LICENSE](LICENSE).
@@ -0,0 +1,86 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.27"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "chitmark"
7
+ version = "0.1.1"
8
+ description = "Official Python SDK for Chitmark by Open Agent Ledger — trust decisions on agent-mediated actions (verify, feedback, challenge)"
9
+ readme = "README.md"
10
+ license = { text = "Proprietary — no open-source grant. Copyright (c) 2026 Open Agent Ledger. All rights reserved." }
11
+ requires-python = ">=3.10"
12
+ authors = [
13
+ { name = "Open Agent Ledger", email = "dev@chitmark.com" },
14
+ ]
15
+ keywords = [
16
+ "chitmark",
17
+ "open-agent-ledger",
18
+ "agent-actions",
19
+ "trust-decisions",
20
+ "anti-abuse",
21
+ ]
22
+ classifiers = [
23
+ "Development Status :: 3 - Alpha",
24
+ "Intended Audience :: Developers",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3.10",
27
+ "Programming Language :: Python :: 3.11",
28
+ "Programming Language :: Python :: 3.12",
29
+ "Programming Language :: Python :: 3.13",
30
+ "Typing :: Typed",
31
+ ]
32
+ dependencies = [
33
+ "httpx>=0.27.0",
34
+ ]
35
+
36
+ [project.optional-dependencies]
37
+ dev = [
38
+ "pytest>=8.3.0",
39
+ "pytest-asyncio>=0.25.0",
40
+ "ruff>=0.9.0",
41
+ "mypy>=1.14.0",
42
+ "respx>=0.22.0",
43
+ "PyJWT>=2.9.0",
44
+ "cryptography>=43.0.0",
45
+ ]
46
+ verdict = [
47
+ "PyJWT>=2.9.0",
48
+ "cryptography>=43.0.0",
49
+ ]
50
+
51
+ [project.urls]
52
+ Homepage = "https://chitmark.com"
53
+ Documentation = "https://chitmark.com/docs"
54
+ Repository = "https://github.com/nonameuserd/Chitmark"
55
+ Issues = "https://github.com/nonameuserd/Chitmark/issues"
56
+
57
+ # src/chitmark layout is auto-discovered by hatchling
58
+
59
+ [tool.hatch.build.targets.sdist]
60
+ include = [
61
+ "/src",
62
+ "/tests",
63
+ "/README.md",
64
+ "/LICENSE",
65
+ ]
66
+
67
+ [tool.hatch.metadata]
68
+ license-files = ["LICENSE"]
69
+
70
+ [tool.pytest.ini_options]
71
+ asyncio_mode = "auto"
72
+ testpaths = ["tests"]
73
+ pythonpath = ["src"]
74
+
75
+ [tool.ruff]
76
+ line-length = 90
77
+ target-version = "py310"
78
+
79
+ [tool.ruff.lint]
80
+ select = ["E", "F", "I", "UP", "B", "SIM"]
81
+
82
+ [tool.mypy]
83
+ python_version = "3.10"
84
+ strict = true
85
+ packages = ["chitmark"]
86
+ mypy_path = "src"
@@ -0,0 +1,45 @@
1
+ """Official Python SDK for Chitmark by Open Agent Ledger.
2
+
3
+ Trust decisions on agent-mediated actions (verify, feedback, challenge),
4
+ tuned by business outcomes.
5
+ """
6
+
7
+ from chitmark.client import SDK_VERSION, Chitmark
8
+ from chitmark.errors import ChitmarkApiError, ChitmarkError
9
+ from chitmark.pii import hash_email_sha256, truncate_ip
10
+ from chitmark.types import (
11
+ ActorType,
12
+ ChallengeMethod,
13
+ ChallengeResponse,
14
+ Decision,
15
+ FeedbackResponse,
16
+ Outcome,
17
+ Principal,
18
+ Subject,
19
+ Verdict,
20
+ VerdictTokenClaims,
21
+ )
22
+ from chitmark.verify_token import VerdictTokenError, verify_verdict_token
23
+
24
+ __all__ = [
25
+ "SDK_VERSION",
26
+ "ActorType",
27
+ "ChallengeMethod",
28
+ "ChallengeResponse",
29
+ "Chitmark",
30
+ "ChitmarkApiError",
31
+ "ChitmarkError",
32
+ "Decision",
33
+ "FeedbackResponse",
34
+ "Outcome",
35
+ "Principal",
36
+ "Subject",
37
+ "Verdict",
38
+ "VerdictTokenClaims",
39
+ "VerdictTokenError",
40
+ "hash_email_sha256",
41
+ "truncate_ip",
42
+ "verify_verdict_token",
43
+ ]
44
+
45
+ __version__ = SDK_VERSION