Skip to main content

intent-eval-core (Python)

Python (Pydantic v2) distribution of @intentsolutions/core — the canonical contracts kernel for the Intent Eval Platform.

The same entity + predicate contracts the TypeScript package exposes as Zod validators and JSON Schemas, here as Pydantic v2 models for Python consumers. The models are code-generated from the canonical schemas/v1/*.json JSON Schemas and validated for parity against the same golden fixtures the TypeScript/AJV side validates — a payload accepted by the Zod validator is accepted here, and one rejected there is rejected here.

Install

pip install intent-eval-core

Requires Python 3.10+. Runtime dependency: pydantic>=2.5,<3.

Usage

from intent_eval_core import GateResultV1, EvalSpec
from pydantic import ValidationError

row = {
    "gate_id": "audit-harness:ci:escape-scan",
    "gate_name": "escape-scan",
    "gate_version": "0.3.0",
    "gate_decision": "pass",
    "gate_reasons": [],
    "coverage": {"dimensions_evaluated": ["credential-leak"], "dimensions_skipped": []},
    "policy_ref": "sha256:" + "e" * 64 + ":tests/TESTING.md",
    "policy_hash": "sha256:" + "e" * 64,
    "input_hash": "sha256:" + "3" * 64,
    "evaluated_at": "2026-05-17T00:00:10Z",
    "runner": "audit-harness@0.3.0",
    "commit_sha": "abc1234",
}

gate = GateResultV1.model_validate(row)   # raises pydantic.ValidationError on drift
print(gate.gate_decision)                 # GateDecision.pass_

What's exported

15 canonical entities + 3 predicate bodies (Blueprint B § 2 / § 7 + SkillVersion DR-028 T1 + UsageEvent DR-103 D1):

Entity models Predicate-body models
EvalSpec, EvalRun, MatcherMap, EvidenceBundle, JudgeDecision, RuntimeReceipt, RegressionPack, RolloutGate, SkillSnapshot, SessionTrace, ToolInvocation, CostRecord, FailureTaxonomy GateResultV1, RetractionV1, DashboardRenderV1

Plus GATE_RESULT_V1_URI (the canonical predicate URI at evals.intentsolutions.io).

How it stays in lockstep with the TypeScript kernel

  • Codegen, not hand-port — scripts/codegen_pydantic.py runs datamodel-code-generator (pinned) over the canonical schemas/v1/*.json. The output lives in intent_eval_core/_generated/ (reference material; never import from it directly).
  • Cross-field rules — the JSON Schema allOf/if-then conditional rules (e.g. gate-result/v1's "advisory requires advisory_severity", "fail/advisory/error requires a non-empty reason") cannot be expressed by the generator, so the canonical public surface (intent_eval_core/models.py) layers a hand-written Pydantic model_validator on top — the exact mirror of the Zod .superRefine() blocks in the TypeScript validators.
  • Parity tests — tests/test_parity.py runs the shared golden fixtures (tests/fixtures/v1/, the same set the TypeScript suite consumes) through the Python models and asserts identical accept/reject behavior.
  • Version lockstep — the package version tracks the npm @intentsolutions/core package.json#version (the JSON Schemas are the shared source of truth). CI gate: scripts/check_version_lockstep.py.

License

Apache-2.0. See LICENSE and NOTICE.

Metadata

Release files for intent-eval-core 0.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for intent-eval-core 0.11.0
File Size Uploaded
intent_eval_core-0.11.0.tar.gz 46.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for intent-eval-core 0.11.0
File Interpreter ABI Platform
intent_eval_core-0.11.0-py3-none-any.whl Python 3 none any Details

Total release size: 103.2 kB

Release files / intent_eval_core-0.11.0.tar.gz

Download URL intent_eval_core-0.11.0.tar.gz
Size 46.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e00b1d86c5505286d797e6d5410a10dd0b4772b3bfd5140c5e8a9b916398d41b
BLAKE2b-256 checksum
How to use checksums
d7566a2a8eafb0fc1f7b9b105751e94cfd92c7ef1245ec47faba2e50fbbda42a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / intent_eval_core-0.11.0-py3-none-any.whl

Download URL intent_eval_core-0.11.0-py3-none-any.whl
Size 56.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a07002c48389adbbf93e0b965d3b40793ce2fd267da834422e08d083abe4771
BLAKE2b-256 checksum
How to use checksums
9ca03bfa7e3e11b38ac5cbc3d5d6056059c433824fc5e1d01c3ffff848a7c930
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

This release

0.11.0 This release

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page