Expand description
Agent Trace specification types for AI code attribution.
This module implements the Agent Trace specification v0.1.0, providing vendor-neutral types for recording AI contributions alongside human authorship in version-controlled codebases.
§Overview
Agent Trace defines how to track which code came from AI versus humans with:
- Line-level granularity for attribution
- Conversation linkage for provenance
- VCS integration for revision tracking
- Extensible metadata for vendor-specific data
§Example
use vtcode_exec_events::trace::*;
use uuid::Uuid;
use chrono::Utc;
let trace = TraceRecord {
version: AGENT_TRACE_VERSION.to_string(),
id: Uuid::new_v4(),
timestamp: Utc::now(),
vcs: Some(VcsInfo {
vcs_type: VcsType::Git,
revision: "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0".to_string(),
}),
tool: Some(ToolInfo {
name: "vtcode".to_string(),
version: Some(env!("CARGO_PKG_VERSION").to_string()),
}),
files: vec![],
metadata: None,
};Structs§
- Contributor
- The contributor that produced a code contribution.
- Related
Resource - A related resource linked to a conversation.
- Tool
Info - Information about the tool that generated the trace.
- Trace
Context - Information needed to create a trace from file changes.
- Trace
Conversation - A conversation that contributed code to a file.
- Trace
File - A file with attributed conversation ranges.
- Trace
Metadata - Additional metadata for trace records.
- Trace
Range - A range of lines with attribution information.
- Trace
Record - A complete Agent Trace record tracking AI contributions to code.
- Trace
Record Builder - Builder for constructing trace records incrementally.
- VcsInfo
- Version control system information.
- VtCode
Metadata - VT Code specific metadata in traces.
Enums§
- Contributor
Type - Type of contributor for code attribution.
- Hash
Algorithm - Hash algorithm for content hashes.
- VcsType
- Supported version control system types.
Constants§
- AGENT_
TRACE_ MIME_ TYPE - MIME type for Agent Trace records.
- AGENT_
TRACE_ VERSION - Current Agent Trace specification version.
Functions§
- compute_
content_ hash - Compute a content hash using the default algorithm (MurmurHash3).
- compute_
content_ hash_ with - Compute a content hash using the specified algorithm.
- normalize_
model_ id - Convert a model string to models.dev convention format.