pub struct ExplanationSidecar {
pub file: String,
pub summary: String,
pub explanation: String,
pub tags: Vec<String>,
pub related_artifacts: Vec<String>,
}Expand description
Schema for .diff.explanation.yaml sidecar files.
Example YAML:
file: src/auth/middleware.rs
summary: "Refactored auth middleware to use JWT instead of session tokens"
explanation: |
Replaced session-based auth with JWT validation. The middleware now
checks the Authorization header for a Bearer token, validates it
against the JWKS endpoint, and extracts claims into the request context.
This change touches 3 files: middleware.rs (core logic), config.rs
(JWT settings), and tests/auth_test.rs (updated test fixtures).
tags: [security, breaking-change]
related_artifacts:
- src/auth/config.rs
- tests/auth_test.rsFields§
§file: StringThe file this explanation applies to (relative path from workspace root).
summary: StringOne-line summary.
explanation: StringMulti-line explanation of what changed and why.
Optional tags for categorization.
Related artifacts (paths relative to workspace root).
Implementations§
Source§impl ExplanationSidecar
impl ExplanationSidecar
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, ChangeSetError>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, ChangeSetError>
Parse an explanation sidecar from a YAML file.
Sourcepub fn into_tiers(self) -> ExplanationTiers
pub fn into_tiers(self) -> ExplanationTiers
Convert this sidecar into ExplanationTiers (for embedding in Artifact).
Normalizes related_artifacts to URI format (fs://workspace/
Sourcepub fn find_for_file<P: AsRef<Path>>(file_path: P) -> Option<Self>
pub fn find_for_file<P: AsRef<Path>>(file_path: P) -> Option<Self>
Find explanation sidecar for a given file path.
Looks for: <file_path>.diff.explanation.yaml
Returns None if the sidecar doesn’t exist (this is not an error — sidecars are optional).
Trait Implementations§
Source§impl Clone for ExplanationSidecar
impl Clone for ExplanationSidecar
Source§fn clone(&self) -> ExplanationSidecar
fn clone(&self) -> ExplanationSidecar
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExplanationSidecar
impl Debug for ExplanationSidecar
Source§impl<'de> Deserialize<'de> for ExplanationSidecar
impl<'de> Deserialize<'de> for ExplanationSidecar
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ExplanationSidecar
impl PartialEq for ExplanationSidecar
Source§impl Serialize for ExplanationSidecar
impl Serialize for ExplanationSidecar
impl Eq for ExplanationSidecar
impl StructuralPartialEq for ExplanationSidecar
Auto Trait Implementations§
impl Freeze for ExplanationSidecar
impl RefUnwindSafe for ExplanationSidecar
impl Send for ExplanationSidecar
impl Sync for ExplanationSidecar
impl Unpin for ExplanationSidecar
impl UnsafeUnpin for ExplanationSidecar
impl UnwindSafe for ExplanationSidecar
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.