contractgate 0.2.0__tar.gz → 0.3.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 (29) hide show
  1. {contractgate-0.2.0 → contractgate-0.3.0}/.gitignore +2 -0
  2. contractgate-0.3.0/CHANGELOG.md +35 -0
  3. {contractgate-0.2.0 → contractgate-0.3.0}/LICENSE +1 -1
  4. {contractgate-0.2.0 → contractgate-0.3.0}/PKG-INFO +4 -4
  5. {contractgate-0.2.0 → contractgate-0.3.0}/README.md +1 -1
  6. {contractgate-0.2.0 → contractgate-0.3.0}/pyproject.toml +3 -3
  7. {contractgate-0.2.0 → contractgate-0.3.0}/src/contractgate/__init__.py +2 -2
  8. contractgate-0.3.0/src/contractgate/_version.py +1 -0
  9. {contractgate-0.2.0 → contractgate-0.3.0}/src/contractgate/async_client.py +1 -1
  10. {contractgate-0.2.0 → contractgate-0.3.0}/src/contractgate/client.py +1 -1
  11. {contractgate-0.2.0 → contractgate-0.3.0}/src/contractgate/exceptions.py +1 -1
  12. contractgate-0.3.0/src/contractgate/llm.py +675 -0
  13. contractgate-0.3.0/tests/test_llm_gate.py +697 -0
  14. contractgate-0.2.0/CHANGELOG.md +0 -14
  15. contractgate-0.2.0/src/contractgate/_version.py +0 -1
  16. contractgate-0.2.0/tests/__init__.py +0 -0
  17. {contractgate-0.2.0 → contractgate-0.3.0}/src/contractgate/_transport.py +0 -0
  18. {contractgate-0.2.0 → contractgate-0.3.0}/src/contractgate/contract.py +0 -0
  19. {contractgate-0.2.0 → contractgate-0.3.0}/src/contractgate/models.py +0 -0
  20. {contractgate-0.2.0 → contractgate-0.3.0}/src/contractgate/validator.py +0 -0
  21. {contractgate-0.2.0/contractgate → contractgate-0.3.0/tests}/__init__.py +0 -0
  22. {contractgate-0.2.0 → contractgate-0.3.0}/tests/conftest.py +0 -0
  23. {contractgate-0.2.0 → contractgate-0.3.0}/tests/fixtures/contracts/compliance_mode.yaml +0 -0
  24. {contractgate-0.2.0 → contractgate-0.3.0}/tests/fixtures/contracts/user_events.yaml +0 -0
  25. {contractgate-0.2.0 → contractgate-0.3.0}/tests/fixtures/contracts/with_transform.yaml +0 -0
  26. {contractgate-0.2.0 → contractgate-0.3.0}/tests/test_client_async.py +0 -0
  27. {contractgate-0.2.0 → contractgate-0.3.0}/tests/test_client_sync.py +0 -0
  28. {contractgate-0.2.0 → contractgate-0.3.0}/tests/test_contract_parse.py +0 -0
  29. {contractgate-0.2.0 → contractgate-0.3.0}/tests/test_validator.py +0 -0
@@ -38,6 +38,8 @@ dashboard/public/llms.txt
38
38
  dashboard/public/llm-integration.md
39
39
  dashboard/public/llms-full.txt
40
40
  dashboard/public/mcp-reference.md
41
+ dashboard/public/llm-output-validation.md
42
+ dashboard/public/llm-sdk-reference.md
41
43
  # Added by code-review-graph
42
44
  .code-review-graph/
43
45
 
@@ -0,0 +1,35 @@
1
+ # Changelog
2
+
3
+ All notable changes to the `contractgate` Python SDK.
4
+
5
+ ## 0.3.0 — 2026-10-11
6
+
7
+ RFC-094. Adds the `contractgate.llm` submodule for LLM output
8
+ validation. No breaking changes.
9
+
10
+ - New: `contractgate.llm.LLMGate` and `contractgate.llm.AsyncLLMGate`
11
+ wrap `/egress/{contract_id}` with response-shape extraction and a
12
+ bounded auto-repair re-prompt loop. Caller binds their own LLM
13
+ client (OpenAI / Anthropic / Ollama / vLLM) via `llm=...`; the SDK
14
+ takes no runtime dependency on provider SDKs.
15
+ - New: `contractgate.llm.extract_json(response)` handles OpenAI chat
16
+ JSON mode, OpenAI tool_calls, OpenAI Responses `output_parsed`,
17
+ Anthropic `tool_use` and text-block JSON, raw strings (with
18
+ markdown-fence tolerance), and dict passthrough.
19
+ - New: `contractgate.llm.LLMResponseError` for streaming responses
20
+ (rejected in v1) and unparseable shapes.
21
+ - New: `LLMGate.mask_prompt(payload, prompt_contract_id=...)` returns
22
+ the RFC-004-transformed form of a prompt dict via
23
+ `ingest(dry_run=True)`.
24
+ - Sister alias package `aischemagate` ships at the same cut.
25
+
26
+ ## 0.1.0 — 2026-04-28
27
+
28
+ Initial scaffold per RFC-005.
29
+
30
+ - `Client` (sync) + `AsyncClient` (async) over httpx.
31
+ - `ingest`, `audit`, `get_contract`, `get_version`, `playground`.
32
+ - Local validator (`Contract.from_yaml`, `CompiledContract.validate`).
33
+ - Strict parity with Rust validator: same `ViolationKind`, same field
34
+ paths, same message text. Locked via shared fixture corpus.
35
+ - No PII transforms in the local validator (RFC-004 invariant).
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 ContractGate
3
+ Copyright (c) 2026 DataContractGate
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: contractgate
3
- Version: 0.2.0
4
- Summary: Python SDK for ContractGate — high-performance semantic contract enforcement gateway.
3
+ Version: 0.3.0
4
+ Summary: Python SDK for DataContractGate — high-performance semantic contract enforcement gateway.
5
5
  Project-URL: Homepage, https://datacontractgate.com
6
6
  Project-URL: Source, https://github.com/nightmoose/contractgate
7
- Author: ContractGate
7
+ Author: NightMoose, Inc.
8
8
  License: MIT
9
9
  License-File: LICENSE
10
10
  Keywords: contract,data-quality,ingestion,schema,validation
@@ -30,7 +30,7 @@ Description-Content-Type: text/markdown
30
30
 
31
31
  # contractgate (Python SDK)
32
32
 
33
- First-party Python SDK for [ContractGate][gw] — a high-performance
33
+ First-party Python SDK for [DataContractGate][gw] — a high-performance
34
34
  semantic contract enforcement gateway (Patent Pending).
35
35
 
36
36
  [gw]: https://datacontractgate.com
@@ -1,6 +1,6 @@
1
1
  # contractgate (Python SDK)
2
2
 
3
- First-party Python SDK for [ContractGate][gw] — a high-performance
3
+ First-party Python SDK for [DataContractGate][gw] — a high-performance
4
4
  semantic contract enforcement gateway (Patent Pending).
5
5
 
6
6
  [gw]: https://datacontractgate.com
@@ -4,12 +4,12 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "contractgate"
7
- version = "0.2.0"
8
- description = "Python SDK for ContractGate — high-performance semantic contract enforcement gateway."
7
+ version = "0.3.0"
8
+ description = "Python SDK for DataContractGate — high-performance semantic contract enforcement gateway."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
11
11
  license = { text = "MIT" }
12
- authors = [{ name = "ContractGate" }]
12
+ authors = [{ name = "NightMoose, Inc." }]
13
13
  keywords = ["contract", "validation", "data-quality", "ingestion", "schema"]
14
14
  classifiers = [
15
15
  "Development Status :: 3 - Alpha",
@@ -1,6 +1,6 @@
1
- """ContractGate Python SDK.
1
+ """DataContractGate Python SDK.
2
2
 
3
- First-party client and pure-Python validator for the ContractGate
3
+ First-party client and pure-Python validator for the DataContractGate
4
4
  semantic contract enforcement gateway.
5
5
 
6
6
  Public surface:
@@ -0,0 +1 @@
1
+ __version__ = "0.3.0"
@@ -31,7 +31,7 @@ from contractgate.models import (
31
31
 
32
32
 
33
33
  class AsyncClient:
34
- """Asynchronous client for the ContractGate gateway."""
34
+ """Asynchronous client for the DataContractGate gateway."""
35
35
 
36
36
  def __init__(
37
37
  self,
@@ -25,7 +25,7 @@ from contractgate.models import (
25
25
 
26
26
 
27
27
  class Client:
28
- """Synchronous client for the ContractGate gateway.
28
+ """Synchronous client for the DataContractGate gateway.
29
29
 
30
30
  Construct with the gateway's ``base_url`` and your API key:
31
31
 
@@ -1,4 +1,4 @@
1
- """Exception hierarchy for the ContractGate SDK.
1
+ """Exception hierarchy for the DataContractGate SDK.
2
2
 
3
3
  All SDK exceptions inherit from ``ContractGateError`` so users can
4
4
  catch the entire surface with one ``except``. HTTP-shaped errors carry