libgrite_core/context/mod.rs
1pub mod extractor;
2
3use blake2::{Blake2b, Digest};
4use blake2::digest::consts::U16;
5
6use crate::types::ids::IssueId;
7
8/// Derive a deterministic IssueId for a file context path.
9/// This allows context events to flow through the standard event pipeline.
10pub fn context_issue_id(path: &str) -> IssueId {
11 let mut hasher = Blake2b::<U16>::new();
12 hasher.update(b"grit:context:file:");
13 hasher.update(path.as_bytes());
14 hasher.finalize().into()
15}
16
17/// Well-known IssueId for project-level context events
18pub const PROJECT_CONTEXT_ISSUE_ID: IssueId = [0xFF; 16];