Skip to main content

Schema models for the opentraces.ai agent trace JSONL format

Project description

opentraces-schema

Pydantic v2 models for the opentraces.ai JSONL trace format.

Install

pip install opentraces-schema

Usage

from opentraces_schema import TraceRecord, SCHEMA_VERSION

record = TraceRecord(
    trace_id="abc-123",
    session_id="sess-456",
    agent={"name": "claude-code", "version": "1.0.32"},
)
line = record.to_jsonl_line()

Version

The schema version (0.7.0) lives in src/opentraces_schema/version.py as the single source of truth. See VERSION-POLICY.md for semver semantics and the bump checklist.

0.7.0 adds the additive dataset security policy contract (WorkflowSecurityContract, DatasetSecurityPolicy, DatasetManifest.security); the TraceRecord wire shape is unchanged from 0.6.0.

0.6.0 makes TraceRecord.patches[] the authoritative output spine for dev-time traces and removes the legacy unified-diff Outcome.patch field. Outcome.committed, Outcome.commit_sha, and TraceRecord.git_links remain reader-compatible projections derived from patch anchors. Full patch, trail, context, and source evidence lives in the private bucket companions (trail.jsonl.gz, context.jsonl.gz, sources.jsonl.gz) rather than being embedded into the JSONL row.

0.5.0 added Context Tree cross-reference fields: Step.context_node_id and TraceRecord.context_tree_summary.

0.4.0 introduced the local dataset/workflow contract used by the CLI's dataset and workflow commands plus the trace-index contract used by trace query, trace map, and trace slice.

0.3.0 added the commit-correlation surface: GitLink, TraceRecord.lifecycle, TraceRecord.generation_index, TraceRecord.git_links, Task.repository_url, Attribution.revision, Attribution.unaccounted_files, AttributionRange.original, AttributionRange.change_type, AttributionRange.contributor, and AttributionConversation.ids / .related.

Schema Rationale

Every version of the schema ships with a rationale document explaining why each model and field exists, grounded in public standards (ATIF, Agent Trace, ADP, OTel) and empirical observations from real agent traces.

The current rationale is RATIONALE-0.7.0.md. Each version has its own rationale file linked from the CHANGELOG.

Contributing

Schema feedback, questions, and proposals are welcome via GitHub Issues. When suggesting a schema change, please include:

  • What field or model you would add, change, or remove
  • Why it matters for your use case (training, analytics, attribution, etc.)
  • How it relates to existing standards (ATIF, Agent Trace, ADP, OTel) if applicable

Breaking changes (field renames, removals, type changes) require a major version bump. New optional fields and models are minor bumps. See VERSION-POLICY.md for details.

Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opentraces_schema-0.7.0.tar.gz (41.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opentraces_schema-0.7.0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file opentraces_schema-0.7.0.tar.gz.

File metadata

  • Download URL: opentraces_schema-0.7.0.tar.gz
  • Upload date:
  • Size: 41.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for opentraces_schema-0.7.0.tar.gz
Algorithm Hash digest
SHA256 528fbac43277c1743db22986bb4bcfa1a98a3c9723341f97b2120f1cbbebeb46
MD5 a6d0e11711cc346fa8978c3b2177205c
BLAKE2b-256 40d9b00410821f53c886c9c95824b149fc3b9657249a8e398f1cbbf95a93c45f

See more details on using hashes here.

Provenance

The following attestation bundles were made for opentraces_schema-0.7.0.tar.gz:

Publisher: publish.yml on JayFarei/opentraces

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opentraces_schema-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for opentraces_schema-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cfdf25e94852b65c75ab5e99ba142130db818d95749382b1ca44824ccc334d4d
MD5 d98e1a6a89ef7125f01c521d7a66ea2d
BLAKE2b-256 e0bd54db0cf91c1be6a24a4f404c3d4628268ea695bb80ba8f4a1e0a362696f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for opentraces_schema-0.7.0-py3-none-any.whl:

Publisher: publish.yml on JayFarei/opentraces

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page