agent-trace: Add SCE metadata to generated payloads#46
Conversation
Emit implementation-owned metadata.sce.version from the compiled CLI package version when building Agent Trace payloads. Update golden fixtures and tests to assert the metadata is present and schema-valid, and document the persisted payload contract. Plan: agent-trace-sce-metadata Tasks: T01, T02, T03 Co-authored-by: SCE <sce@crocoder.dev>
📝 WalkthroughWalkthroughAdds SCE metadata to agent traces: defines a version constant and metadata types, embeds a defaulted ChangesSCE Trace Metadata Versioning
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cli/src/services/agent_trace/tests.rs (1)
1-7:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winReorder imports to match repository Rust grouping.
Third-party crates (
serde_json) must be grouped before localcrate::andsuper::imports, per the coding guideline.♻️ Proposed fix
-use super::{ - build_agent_trace, validate_agent_trace_value, AgentTraceMetadataInput, AgentTraceVcsType, - LineRange, AGENT_TRACE_VERSION, SCE_METADATA_VERSION, -}; -use crate::services::patch::{combine_patches, parse_patch, ParsedPatch}; use serde_json::{json, Value}; + +use crate::services::patch::{combine_patches, parse_patch, ParsedPatch}; +use super::{ + build_agent_trace, validate_agent_trace_value, AgentTraceMetadataInput, AgentTraceVcsType, + LineRange, AGENT_TRACE_VERSION, SCE_METADATA_VERSION, +};🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cli/src/services/agent_trace/tests.rs` around lines 1 - 7, Reorder the use statements so third-party crates come first: move serde_json::{json, Value} above the local imports; then list crate::services::patch items (combine_patches, parse_patch, ParsedPatch) followed by the super:: items (build_agent_trace, validate_agent_trace_value, AgentTraceMetadataInput, AgentTraceVcsType, LineRange, AGENT_TRACE_VERSION, SCE_METADATA_VERSION) to match the repository Rust import grouping conventions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@cli/src/services/agent_trace/tests.rs`:
- Around line 1-7: Reorder the use statements so third-party crates come first:
move serde_json::{json, Value} above the local imports; then list
crate::services::patch items (combine_patches, parse_patch, ParsedPatch)
followed by the super:: items (build_agent_trace, validate_agent_trace_value,
AgentTraceMetadataInput, AgentTraceVcsType, LineRange, AGENT_TRACE_VERSION,
SCE_METADATA_VERSION) to match the repository Rust import grouping conventions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: a049642c-e8b9-41db-9ab1-9fb105429e78
⛔ Files ignored due to path filters (7)
context/context-map.mdis excluded by!context/**/*.mdcontext/glossary.mdis excluded by!context/**/*.mdcontext/overview.mdis excluded by!context/**/*.mdcontext/plans/agent-trace-sce-metadata.mdis excluded by!context/**/*.mdcontext/sce/agent-trace-db.mdis excluded by!context/**/*.mdcontext/sce/agent-trace-hooks-command-routing.mdis excluded by!context/**/*.mdcontext/sce/agent-trace-minimal-generator.mdis excluded by!context/**/*.md
📒 Files selected for processing (9)
cli/src/services/agent_trace.rscli/src/services/agent_trace/fixtures/average_age_reconstruction/golden.jsoncli/src/services/agent_trace/fixtures/file_rename_reconstruction/golden.jsoncli/src/services/agent_trace/fixtures/hello_world_reconstruction/golden.jsoncli/src/services/agent_trace/fixtures/mixed_change_reconstruction/golden.jsoncli/src/services/agent_trace/fixtures/poem_edit_reconstruction/golden.jsoncli/src/services/agent_trace/fixtures/poem_write_reconstruction/golden.jsoncli/src/services/agent_trace/fixtures/text_file_lifecycle_reconstruction/golden.jsoncli/src/services/agent_trace/tests.rs
Co-authored-by: SCE <sce@crocoder.dev>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cli/src/services/agent_trace/tests.rs (1)
1-7: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winReorder imports to follow repository Rust grouping rules.
Move third-party imports (
serde_json) above local crate/module imports, keeping groups in the required order.As per coding guidelines, "**/*.rs: Group Rust imports in this order: standard library, third-party crates, then
crate::...imports."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cli/src/services/agent_trace/tests.rs` around lines 1 - 7, The import block in tests.rs is misordered; move the third-party import serde_json (json, Value) above local crate/module imports so imports follow the repo rule (standard library, third-party, then crate), preserving the existing items (build_agent_trace, validate_agent_trace_value, AgentTraceMetadataInput, AgentTraceVcsType, LineRange, AGENT_TRACE_VERSION, combine_patches, parse_patch, ParsedPatch) and ensure a blank line separates the groups.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@cli/src/services/agent_trace/tests.rs`:
- Around line 1-7: The import block in tests.rs is misordered; move the
third-party import serde_json (json, Value) above local crate/module imports so
imports follow the repo rule (standard library, third-party, then crate),
preserving the existing items (build_agent_trace, validate_agent_trace_value,
AgentTraceMetadataInput, AgentTraceVcsType, LineRange, AGENT_TRACE_VERSION,
combine_patches, parse_patch, ParsedPatch) and ensure a blank line separates the
groups.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6950ce63-6c00-4eb3-bda3-0e35a36054bd
📒 Files selected for processing (1)
cli/src/services/agent_trace/tests.rs
Emit implementation-owned metadata.sce.version from the compiled CLI package version when building Agent Trace payloads. Update golden fixtures and tests to assert the metadata is present and schema-valid, and document the persisted payload contract.
Summary by CodeRabbit