Skip to main content

intent-eval-core (Python)

The spec authority kernel for agent-native artifacts — Python runtime models.

This Pydantic v2 distribution provides runtime contracts from @intentsolutions/core for the Intent Eval Platform. It does not implement the kernel's authoring-schema validators. The kernel's authority and upstream sources explain the marketplace scope, upstream provenance, and authoring lifecycle.

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 for the shared fixture set. A known published exception for omitted nullable fields is recorded below.

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

16 canonical entities + 4 predicate bodies (Blueprint B § 2 / § 7 + SkillVersion DR-028 T1 + UsageEvent and HumanReview DR-103 D1):

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

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

How it stays in lockstep with the TypeScript kernel

Trajectory assertions

The unreleased trajectory API follows Class-2 record 014. Python validates the pattern as a nonempty string. The executor checks ECMAScript syntax before spend.

Decode JSON with json.loads, validate with EvalSpec.model_validate, and preserve wire names and absent fields when serializing:

import json
from intent_eval_core import EvalSpec

spec = EvalSpec.model_validate(json.loads(spec_json))
wire = spec.model_dump(mode="json", by_alias=True, exclude_unset=True)

exclude_unset=True prevents absent optional fields from becoming explicit null, which trajectory validation rejects. by_alias=True preserves names such as class and in. Pydantic's generated model_json_schema() describes its Python representation; use the repository's canonical JSON Schemas for wire validation. The shared parity corpus exercises JSON decoded by json.loads, including escaped Unicode values.

Generation and validation

  • 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).
  • Security and compatibility — generation requires the exact 0.86.0 pin and rejects remote schema references. Scoped defaults preserve 0.11.0's Python behavior for 21 omitted nullable fields across eight entities, even though the canonical JSON Schemas require those fields. The defaults are enumerated in scripts/codegen_pydantic.py; test_codegen_security.py records these known differences. Removing them is a separate contract decision tracked by bd_000-projects-wcze.11, not part of this security update.
  • 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.12.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.12.0
File Size Uploaded Provenance Actions
intent_eval_core-0.12.0.tar.gz 54.4 kB Without provenance Details for intent_eval_core-0.12.0.tar.gz

Built distribution (wheel)

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

Total release size: 115.1 kB

Release files / intent_eval_core-0.12.0.tar.gz

Download URL intent_eval_core-0.12.0.tar.gz
Size 54.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d9955f0bef87a9a85ffc72c09822d758110403de7ad9e602c1b6b6a03f7e16ea
BLAKE2b-256 checksum
How to use checksums
d203f3bb045e165185af81327c6d62ee22d52da34e1ea7750fd5dd8b0f001255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

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

Download URL intent_eval_core-0.12.0-py3-none-any.whl
Size 60.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e213687cde5904f0eb4f1e954feb6dd8a28a52139926083f3e77386a764b756
BLAKE2b-256 checksum
How to use checksums
cb55424053aebd9b96a915951518a9e954ac56abe55f5006c81a263fc399e4a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for intent-eval-core 0.12.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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