### Example Trace Record Structure Source: https://agent-trace.dev/ Demonstrates the complete structure of an Agent Trace record, including version, ID, timestamp, VCS information, tool details, file paths, conversation data, and metadata. ```json { "version": "0.1.0", "id": "550e8400-e29b-41d4-a716-446655440000", "timestamp": "2026-01-23T14:30:00Z", "vcs": { "type": "git", "revision": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0" }, "tool": { "name": "cursor", "version": "2.4.0" }, "files": [ { "path": "src/utils/parser.ts", "conversations": [ { "url": "https://api.cursor.com/v1/conversations/12345", "contributor": { "type": "ai", "model_id": "anthropic/claude-opus-4-5-20251101" }, "ranges": [ { "start_line": 42, "end_line": 67, "content_hash": "murmur3:9f2e8a1b" } ], "related": [ { "type": "session", "url": "https://api.cursor.com/v1/sessions/67890" } ] } ] }, { "path": "src/utils/helpers.ts", "conversations": [ { "url": "https://api.cursor.com/v1/conversations/12345", "contributor": { "type": "ai", "model_id": "openai/gpt-4o" }, "ranges": [ { "start_line": 10, "end_line": 25 } ] } ] } ], "metadata": { "confidence": 0.95, "dev.cursor": { "workspace_id": "ws-abc123" } } } ``` -------------------------------- ### Version Control System Identifiers Source: https://agent-trace.dev/ Shows examples of how different version control systems (Git, Jujutsu, Mercurial) are represented in the `vcs` field, including their specific revision identifier formats. ```json // Git { "vcs": { "type": "git", "revision": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0" } } // Jujutsu (using change ID for stability across rebases) { "vcs": { "type": "jj", "revision": "kkmpptxz" } } // Mercurial { "vcs": { "type": "hg", "revision": "a1b2c3d4e5f6" } } ``` -------------------------------- ### Metadata Field for Implementation-Specific Data (JSON) Source: https://agent-trace.dev/ Illustrates the use of the 'metadata' field to include implementation or vendor-specific data, such as confidence scores or post-processing tools. It also shows how to use reverse-domain notation to prevent key collisions. ```json { "metadata": { "confidence": 0.95, "post_processing_tools": ["prettier@3.0.0"], "dev.cursor": { "workspace_id": "ws-abc123" } } } ``` -------------------------------- ### Linked Resources in Conversation Data (JSON) Source: https://agent-trace.dev/ Demonstrates how to include a 'url' field for conversations and an optional 'related' array to link to sub-resources like sessions or prompts. This structure helps in organizing and navigating related data within a conversation. ```json { "files": [ { "path": "src/api.ts", "conversations": [ { "url": "https://api.example.com/v1/conversations/abc123", "contributor": { "type": "ai", "model_id": "anthropic/claude-opus-4-5-20251101" }, "ranges": [{ "start_line": 10, "end_line": 50 }], "related": [ { "type": "session", "url": "https://api.example.com/v1/sessions/xyz789" }, { "type": "prompt", "url": "https://api.example.com/v1/prompts/def456" } ] } ] } ] } ``` -------------------------------- ### Minimal Valid Trace Record Structure (JSON) Source: https://agent-trace.dev/ Presents the essential fields required for a minimal valid Agent Trace record, including version, ID, timestamp, and file information with conversation ranges. This serves as a basic template for trace data. ```json { "version": "0.1.0", "id": "550e8400-e29b-41d4-a716-446655440000", "timestamp": "2026-01-25T10:00:00Z", "files": [ { "path": "src/app.ts", "conversations": [ { "contributor": { "type": "ai" }, "ranges": [{ "start_line": 1, "end_line": 50 }] } ] } ] } ``` -------------------------------- ### Content Hash for Code Attribution Source: https://agent-trace.dev/ Demonstrates the use of content hashes within ranges to track code attribution accurately, even when code is moved or modified. The hash applies to the specific code segment within the range. ```json { "files": [ { "path": "src/parser.ts", "conversations": [ { "url": "https://api.example.com/v1/conversations/abc", "contributor": { "type": "ai", "model_id": "anthropic/claude-opus-4-5-20251101" }, "ranges": [ { "start_line": 10, "end_line": 25, "content_hash": "murmur3:9f2e8a1b" } ] } ] } ] } ``` -------------------------------- ### AI Model Identifier Format Source: https://agent-trace.dev/ Shows the standard format for identifying AI contributors, following the models.dev convention. The format is `provider/model-name`. ```json { "contributor": { "type": "ai", "model_id": "anthropic/claude-opus-4-5-20251101" } } ``` -------------------------------- ### Attribution Ranges Structure Source: https://agent-trace.dev/ Illustrates how attribution ranges are structured within a trace, grouping multiple line ranges under a single conversation and contributor. This format reduces cardinality for many ranges originating from one AI interaction. ```json { "files": [ { "path": "src/utils.ts", "conversations": [ { "url": "https://api.example.com/v1/conversations/abc", "contributor": { "type": "ai", "model_id": "anthropic/claude-sonnet-4-20250514" }, "ranges": [ { "start_line": 10, "end_line": 25 }, { "start_line": 30, "end_line": 45 }, { "start_line": 80, "end_line": 95 } ] }, { "url": "https://api.example.com/v1/conversations/def", "contributor": { "type": "ai", "model_id": "openai/gpt-4o" }, "ranges": [{ "start_line": 50, "end_line": 52 }] } ] } ] } ``` -------------------------------- ### Agent Trace Record JSON Schema Source: https://agent-trace.dev/ The core JSON schema defining the structure of an Agent Trace Record. It specifies fields like version, ID, timestamp, VCS information, tool details, and an array of files with attributed ranges. This schema is crucial for ensuring data consistency and enabling proper parsing and processing of trace data. ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://agent-trace.dev/schemas/v1/trace-record.json", "title": "Agent Trace Record", "type": "object", "required": ["version", "id", "timestamp", "files"], "properties": { "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+$", "description": "Agent Trace specification version (e.g., '1.0')" }, "id": { "type": "string", "format": "uuid", "description": "Unique identifier for this trace record" }, "timestamp": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp when trace was recorded" }, "vcs": { "$ref": "#/$defs/vcs", "description": "Version control system information for this trace" }, "tool": { "$ref": "#/$defs/tool", "description": "The tool that generated this trace" }, "files": { "type": "array", "items": { "$ref": "#/$defs/file" }, "description": "Array of files with attributed ranges" }, "metadata": { "type": "object", "description": "Additional metadata for implementation-specific or vendor-specific data" } }, "$defs": { "vcs": { "type": "object", "required": ["type", "revision"], "properties": { "type": { "type": "string", "enum": ["git", "jj", "hg", "svn"], "description": "Version control system type" }, "revision": { "type": "string", "description": "Revision identifier (e.g., git commit SHA, jj change ID)" } } }, "tool": { "type": "object", "properties": { "name": { "type": "string" }, "version": { "type": "string" } } }, "file": { "type": "object", "required": ["path", "conversations"], "properties": { "path": { "type": "string", "description": "Relative file path from repository root" }, "conversations": { "type": "array", "items": { "$ref": "#/$defs/conversation" }, "description": "Array of conversations that contributed to this file" } } }, "contributor": { "type": "object", "required": ["type"], "properties": { "type": { "type": "string", "enum": ["human", "ai", "mixed", "unknown"] }, "model_id": { "type": "string", "maxLength": 250, "description": "The model's unique identifier following models.dev convention (e.g., 'anthropic/claude-opus-4-5-20251101')" } } }, "conversation": { "type": "object", "required": ["ranges"], "properties": { "url": { "type": "string", "format": "uri", "description": "URL to look up the conversation that produced this code" }, "contributor": { "$ref": "#/$defs/contributor", "description": "The contributor for ranges in this conversation (can be overridden per-range)" }, "ranges": { "type": "array", "items": { "$ref": "#/$defs/range" }, "description": "Array of line ranges produced by this conversation" }, "related": { "type": "array", "items": { "type": "object", "required": ["type", "url"], "properties": { "type": { "type": "string" }, "url": { "type": "string", "format": "uri" } } }, "description": "Other related resources" } } }, "range": { "type": "object", "required": ["start_line", "end_line"], "properties": { "start_line": { "type": "integer", "minimum": 1 }, "end_line": { "type": "integer", "minimum": 1 }, "content_hash": { "type": "string", "description": "Hash of attributed content for position-independent tracking" }, "contributor": { "$ref": "#/$defs/contributor", "description": "Override contributor for this specific range (e.g., for agent handoffs)" } } } } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.