docs(comments): rewrite comments across all crates to the guidelines
Sweep every first-party crate source (1956 .rs files) to the project comment guidelines: delete redundant restatements, decorative banners, change narration, and end-of-line comments; keep and tighten the crucial ones (invariants, bug rationale, SAFETY blocks, ported-source attribution). No functional code changed. Every edit is proven comment-only against the prior tree by a comment-stripping lexer (string/char/raw-string aware) plus a separate doctest-fence check. Where removing a comment made rustfmt or clippy want to re-lay-out adjacent code, the minimal triggering comment is restored so code tokens stay byte-identical. Gates green: cargo fmt --all --check (0 diffs), cargo check and cargo clippy --workspace --all-targets (0 warnings). Adds scripts/check_codegen_comment_guidelines.py — the enforcement gate for these guidelines (flags banners, end-of-line comments, change narration, and commented-out code).
This commit is contained in:
@@ -101,15 +101,12 @@ impl TracingEntry {
|
||||
}
|
||||
styled
|
||||
}
|
||||
/// The monotonic sequence number.
|
||||
pub fn seq(&self) -> u64 {
|
||||
self.seq
|
||||
}
|
||||
/// The ANSI-stripped plain text.
|
||||
pub fn plain(&self) -> &str {
|
||||
&self.plain
|
||||
}
|
||||
/// The pre-parsed styled text.
|
||||
pub fn styled(&self) -> &Text<'static> {
|
||||
&self.styled
|
||||
}
|
||||
@@ -230,11 +227,9 @@ impl TracingModel {
|
||||
pub fn as_slice(&self) -> &[TracingEntry] {
|
||||
&self.entries
|
||||
}
|
||||
/// Number of entries currently stored.
|
||||
pub fn len(&self) -> usize {
|
||||
self.entries.len()
|
||||
}
|
||||
/// Whether the buffer is empty.
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.entries.is_empty()
|
||||
}
|
||||
@@ -309,7 +304,6 @@ impl<T: serde::Serialize> std::fmt::Display for LazyJson<'_, T> {
|
||||
const LOG_CHANNEL_CAPACITY: usize = 16 * 1024;
|
||||
/// Lines dropped due to a full log channel (process-wide).
|
||||
static DROPPED_LOG_LINES: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0);
|
||||
/// Total log lines dropped so far because the channel was full.
|
||||
pub fn dropped_log_lines() -> u64 {
|
||||
DROPPED_LOG_LINES.load(std::sync::atomic::Ordering::Relaxed)
|
||||
}
|
||||
@@ -412,6 +406,7 @@ pub fn init_tracing() -> TracingHandle {
|
||||
EnvFilter, Layer as _, filter::LevelFilter, fmt, layer::SubscriberExt as _,
|
||||
};
|
||||
let (make_writer, rx) = TracingChannelMakeWriter::new();
|
||||
// Flip to `true` locally to enable verbose ACP payload logging.
|
||||
let payload_level = if false { "debug" } else { "off" };
|
||||
let directives = format!(
|
||||
"kigi_shell=info,kigi_tui=trace,kigi_tools=info,kigi_acp_lib=info,{RMCP_SSE_NOISE_TARGET}=error,sampling_log=off,{ACP_UPDATE_TARGET}=debug,{ACP_UPDATE_PAYLOAD_TARGET}={payload_level}"
|
||||
|
||||
Reference in New Issue
Block a user