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:
@@ -31,7 +31,6 @@ use crate::theme::Theme;
|
||||
struct StatusEntry {
|
||||
/// Identifier for hit-test lookup (e.g., "context", "badge").
|
||||
id: &'static str,
|
||||
/// Pre-built styled content.
|
||||
line: Line<'static>,
|
||||
/// Display width in columns.
|
||||
width: u16,
|
||||
@@ -49,7 +48,6 @@ pub struct AgentStatusBar<'a> {
|
||||
}
|
||||
|
||||
impl<'a> AgentStatusBar<'a> {
|
||||
/// Create a new empty status bar.
|
||||
pub fn new(theme: &'a Theme) -> Self {
|
||||
Self {
|
||||
items: Vec::new(),
|
||||
@@ -88,11 +86,10 @@ impl<'a> AgentStatusBar<'a> {
|
||||
return HashMap::new();
|
||||
}
|
||||
|
||||
// Fill background
|
||||
buf.set_style(area, Style::default().bg(self.theme.bg_base));
|
||||
|
||||
let sep = self.separator();
|
||||
let sep_w = sep.width() as u16; // 3
|
||||
let sep_w = sep.width() as u16;
|
||||
|
||||
// Total width: items plus the separators *between* them only — no
|
||||
// leading separator before the first item or trailing one after the
|
||||
@@ -116,7 +113,6 @@ impl<'a> AgentStatusBar<'a> {
|
||||
x += sep_w;
|
||||
}
|
||||
|
||||
// Render item
|
||||
buf.set_line(x, area.y, &entry.line, entry.width);
|
||||
areas.insert(
|
||||
entry.id,
|
||||
@@ -134,10 +130,6 @@ impl<'a> AgentStatusBar<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Goal status line
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// Format a token count compactly: `500`, `1.5k`, `50k`, `1.5M`.
|
||||
pub(crate) fn format_tokens_compact(tokens: i64) -> String {
|
||||
let sign = if tokens < 0 { "-" } else { "" };
|
||||
@@ -282,10 +274,6 @@ pub fn goal_status_line(
|
||||
])
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Graph status chip
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// Build the compact `/graph` status chip: node progress, the current
|
||||
/// node, and spend. Same chip idiom as [`goal_status_line`] — dim
|
||||
/// brackets, paused chips invert onto `theme.warning`, active chips
|
||||
@@ -351,10 +339,6 @@ pub fn graph_status_line(
|
||||
])
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// MCP connecting indicator
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// Build the compact MCP-connecting indicator for the agent status bar.
|
||||
///
|
||||
/// Format: `⠋ MCP (1/4)` — a braille spinner (driven by `tick`, same cadence as
|
||||
@@ -805,9 +789,6 @@ mod tests {
|
||||
assert_eq!(goal_phase_label(&g), "Executing");
|
||||
}
|
||||
|
||||
// The old deliverable-index parity test is removed because deliverables
|
||||
// are no longer part of the simplified goal model.
|
||||
|
||||
#[test]
|
||||
fn goal_line_contains_expected_text() {
|
||||
let g = make_goal(
|
||||
|
||||
Reference in New Issue
Block a user