KeiSeiKit-1.0/_primitives/_rust/frustration-matrix/src/hit.rs
Parfii-bot 0be354a920 KeiSeiKit-public — clean state
Single-commit clean baseline after security scrub of niche-tells,
project codenames, internal jargon, and contributor-email leaks.

Contents:
- 100 Rust crates (_primitives/_rust/)
- 37 agent manifests (_manifests/) + generated specs (_generated/)
- 67 user-invocable skills (skills/)
- 33 hooks (hooks/)
- Composition blocks (_blocks/)
- Documentation (docs/, README.md)
- TS adapter packages (_ts_packages/)
- Assembler (_assembler/)
- Roles (_roles/)
- Templates (_templates/)
- Forgejo CI (.forgejo/)

Author: Denis Parfionovich <info@greendragon.info>

License: see LICENSE.
2026-05-01 12:09:03 +08:00

42 lines
1.1 KiB
Rust

//! Normalised per-file parse product.
//!
//! Both markdown and jsonl parsers emit their own line types. The scan
//! loop only needs a common shape: `{file, line_no, text, timestamp?}`.
//! This cube is the only place that knows how to unify the two.
//!
//! `timestamp` is `Some` only for jsonl entries (runtime writes an
//! ISO 8601 `.timestamp` field). Markdown falls back to file mtime,
//! applied by the scan loop — keep this struct dumb.
use crate::jsonl::JsonlUserLine;
use crate::markdown::UserLine;
/// One candidate line for category matching.
pub struct Hit {
pub file: String,
pub line_no: usize,
pub text: String,
pub timestamp: Option<String>,
}
impl From<UserLine> for Hit {
fn from(u: UserLine) -> Self {
Hit {
file: u.file,
line_no: u.line_no,
text: u.text,
timestamp: None,
}
}
}
impl From<JsonlUserLine> for Hit {
fn from(j: JsonlUserLine) -> Self {
Hit {
file: j.file.display().to_string(),
line_no: j.line_no,
text: j.text,
timestamp: j.timestamp,
}
}
}