Skip to main content

Crowdsource agent traces to HuggingFace Hub

Project description

opentraces

Open protocol + CLI for crowdsourcing agent traces to HuggingFace Hub. Parses coding agent sessions, applies security scanning and redaction, enriches with git signals, and publishes as structured JSONL datasets.

Install

python3 -m venv .venv
source .venv/bin/activate
pip install -e packages/opentraces-schema
pip install -e ".[dev]"

Tell Your Agent

Paste this into your coding agent:

I want you to set up opentraces in this project for trace collection.

Step 1 - Install:
pipx install opentraces

Step 2 - Authenticate:
Run `opentraces auth status` to check if already logged in.
If not authenticated, ask me to run `opentraces login --token` myself,
I need to paste a HuggingFace access token with write scope
(from https://huggingface.co/settings/tokens).

Step 3 - Choose agent:
Ask me which coding agent I'm using. Supported agents can be
listed with `opentraces init --help` (the --agent option).
If I'm using you (the agent running this prompt), detect which
agent you are and suggest that. I can pick multiple.

Step 4 - Initialize and install skill:
opentraces init --agent <chosen-agent> --review-policy review --start-fresh

This sets up automatic trace collection with manual review before
anything is shared, and installs the opentraces agent skill into
.agents/skills/opentraces/ (plus a symlink in .<agent>/skills/)
so you have the full CLI reference for future sessions. If Claude Code
already has past sessions for this repo, use `--import-existing` to bring
that backlog into the inbox immediately, or `--start-fresh` to begin from now on.

After setup, the workflow is:
- `opentraces web` to inspect traces before sharing
- `opentraces commit --all` to commit inbox traces
- `opentraces push` to publish committed traces to HuggingFace

Quick Start

# Authenticate with a write-access token and initialize this repo inbox
opentraces login --token
opentraces init --review-policy review

# Review traces in the browser inbox
opentraces web
opentraces commit --all

# Publish committed traces to HuggingFace Hub
opentraces push --repo your-username/my-traces

Schema

The trace format is defined in packages/opentraces-schema/. Each JSONL line is a self-contained TraceRecord covering one complete agent session, including steps (TAO loops), tool calls, outcome signals, attribution, and security metadata.

The schema builds on public standards:

  • ATIF for trajectory structure
  • Agent Trace for code attribution
  • ADP for training-pipeline interoperability
  • OTel GenAI for observability alignment

Every schema version ships with a rationale document explaining the design decisions behind each model and field. The current rationale is RATIONALE-0.1.0.md.

Contributing

Schema feedback, questions, and proposals are welcome via GitHub Issues. For schema changes, include what you would change, why it matters for your use case, and how it relates to existing standards. See the schema VERSION-POLICY.md for how changes are versioned.

Project Structure

packages/opentraces-schema/   Schema package (Pydantic v2 models)
src/opentraces/               CLI package
  parsers/                    Agent session parsers
  security/                   Secret scanning, anonymization, classification
  enrichment/                 Git signals, attribution, metrics
  clients/                    Browser and terminal inbox frontends
  pipeline.py                 Shared enrichment + security pipeline
  upload/                     HF Hub sharded upload
web/viewer/                   React inbox UI
web/site/docs/                Documentation source
tests/                        Test suite

License

MIT

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

opentraces-0.2.0-py3-none-any.whl (342.8 kB view details)

Uploaded Python 3

File details

Details for the file opentraces-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: opentraces-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 342.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for opentraces-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8731bd114f19a1baa963e42a9297c0f95df1d4b31401af982da558918cf66a4
MD5 660ce3d9a1db5afccc8ce1b30ae2e6d0
BLAKE2b-256 c794aa20b7f13896a93570d3c4245af7844f7abca3d08a8671a0af98e247e558

See more details on using hashes here.

Provenance

The following attestation bundles were made for opentraces-0.2.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