diff --git a/src/api/behaviour_tests.rs b/src/api/behaviour_tests.rs index 3a5837e..49ed2eb 100644 --- a/src/api/behaviour_tests.rs +++ b/src/api/behaviour_tests.rs @@ -131,8 +131,8 @@ async fn wrong_method_is_json_405() { } /// Stub that validates names and states like the real sources do. The fakes -/// do not validate; real validation is covered by the source unit tests -/// (WS-A/B/C). These tests prove the handlers surface the source's 400 and +/// do not validate; real validation is covered by the source unit tests. +/// These tests prove the handlers surface the source's 400 and /// that percent-encoded `/` and `;` reach the source intact. struct Strict; diff --git a/src/api/docker.rs b/src/api/docker.rs index d655d58..270eb61 100644 --- a/src/api/docker.rs +++ b/src/api/docker.rs @@ -1,4 +1,4 @@ -//! GET /api/v1/docker/* handlers (WS-E) +//! GET /api/v1/docker/* handlers use axum::extract::rejection::QueryRejection; use axum::extract::{Path, Query, State}; diff --git a/src/api/journal.rs b/src/api/journal.rs index 142f9b5..ec0ab91 100644 --- a/src/api/journal.rs +++ b/src/api/journal.rs @@ -1,4 +1,4 @@ -//! GET /api/v1/journal and /journal/follow handlers (WS-E) +//! GET /api/v1/journal and /journal/follow handlers use std::convert::Infallible; diff --git a/src/api/systemd.rs b/src/api/systemd.rs index bff23fb..895da05 100644 --- a/src/api/systemd.rs +++ b/src/api/systemd.rs @@ -1,4 +1,4 @@ -//! GET /api/v1/systemd/* handlers (WS-E) +//! GET /api/v1/systemd/* handlers use axum::extract::rejection::QueryRejection; use axum::extract::{Path, Query, State}; diff --git a/src/auth/mod.rs b/src/auth/mod.rs index c9c2988..1300fe4 100644 --- a/src/auth/mod.rs +++ b/src/auth/mod.rs @@ -1,7 +1,7 @@ -//! Bearer-token auth (WS-D owns `src/auth/`). +//! Bearer-token auth. //! //! Failures respond `401` with `WWW-Authenticate: Bearer` and the standard -//! JSON error body (DEC-4), for both REST and `/mcp`. Apply the layer to the +//! JSON error body, for both REST and `/mcp`. Apply the layer to the //! protected router only; `/healthz` stays outside it. pub mod tokens; diff --git a/src/auth/tokens.rs b/src/auth/tokens.rs index 69a4289..7176e77 100644 --- a/src/auth/tokens.rs +++ b/src/auth/tokens.rs @@ -1,4 +1,4 @@ -//! Token CRUD and the `slinuxm token` CLI (WS-D owns this file). +//! Token CRUD and the `slinuxm token` CLI. //! //! Tokens have the prefix `slinuxm_` and 32 random bytes. Only the sha256 hex //! digest is stored; the plaintext is printed once on create. diff --git a/src/db.rs b/src/db.rs index 886f1a0..322a20f 100644 --- a/src/db.rs +++ b/src/db.rs @@ -1,4 +1,4 @@ -//! SQLite pool for access tokens (WS-D owns this file). +//! SQLite pool for access tokens. use std::path::Path; use std::time::Duration; diff --git a/src/mcp/prompts.rs b/src/mcp/prompts.rs index 1b67e9b..166b68d 100644 --- a/src/mcp/prompts.rs +++ b/src/mcp/prompts.rs @@ -1,4 +1,4 @@ -//! MCP prompts: `diagnose_unit` and `container_health_report` (WS-F). +//! MCP prompts: `diagnose_unit` and `container_health_report`. //! //! Prompts only return instructions that tell the agent which tools to call; //! they do not read live data themselves. diff --git a/src/mcp/resources.rs b/src/mcp/resources.rs index 3c79950..a68f167 100644 --- a/src/mcp/resources.rs +++ b/src/mcp/resources.rs @@ -1,4 +1,4 @@ -//! MCP resources (WS-F). Resolved live on every read; not subscribable (DEC-5). +//! MCP resources. Resolved live on every read; not subscribable. use rmcp::model::{ReadResourceResult, Resource, ResourceContents}; diff --git a/src/sources/docker.rs b/src/sources/docker.rs index 4a4ceb1..a2af664 100644 --- a/src/sources/docker.rs +++ b/src/sources/docker.rs @@ -1,4 +1,4 @@ -//! Docker source over the unix socket via `bollard` (WS-C). +//! Docker source over the unix socket via `bollard`. //! //! The client is built lazily on first use, so a missing or denied socket //! never fails startup (review G9). Every call retries the connection until it @@ -219,8 +219,6 @@ impl DockerSource for BollardDocker { } } -// ---------------------------------------------------------------- helpers - /// Strip the leading `/` and reject names that could alter the request path. fn normalize_name(name: &str) -> Result { let n = name.trim().trim_start_matches('/'); diff --git a/src/sources/fake.rs b/src/sources/fake.rs index e9ed6a1..c84ad70 100644 --- a/src/sources/fake.rs +++ b/src/sources/fake.rs @@ -1,5 +1,5 @@ //! Fixture-backed in-memory sources for tests and for developing surfaces -//! without systemd, journald or Docker (DEC-2). +//! without systemd, journald or Docker. //! //! `fake_state(config)` returns a ready `AppState`. Each fake exposes its //! fixtures as public fields so tests can replace them. @@ -37,8 +37,6 @@ pub fn fake_state(config: Config) -> AppState { } } -// ---------------------------------------------------------------- systemd - pub struct FakeSystemd { pub units: Vec, pub timers: Vec, @@ -127,8 +125,6 @@ impl SystemdSource for FakeSystemd { } } -// ---------------------------------------------------------------- journal - pub struct FakeJournal { pub entries: Vec, shutdown: CancellationToken, @@ -219,8 +215,6 @@ impl JournalSource for FakeJournal { } } -// ----------------------------------------------------------------- docker - pub struct FakeDocker { pub containers: Vec, pub logs: Vec, diff --git a/src/sources/journal.rs b/src/sources/journal.rs index a13d8d2..669a597 100644 --- a/src/sources/journal.rs +++ b/src/sources/journal.rs @@ -1,4 +1,4 @@ -//! journald source over libsystemd (WS-B). +//! journald source over libsystemd. //! //! `systemd::journal::Journal` is neither `Send` nor `Sync`, so every //! sd-journal call happens inside a `spawn_blocking` closure that opens its own diff --git a/src/sources/mod.rs b/src/sources/mod.rs index 87f9420..6e0f4e0 100644 --- a/src/sources/mod.rs +++ b/src/sources/mod.rs @@ -26,8 +26,6 @@ use tokio::sync::mpsc; use crate::error::AppError; -// ---------------------------------------------------------------- systemd - /// One row of `ListUnits`. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] pub struct UnitSummary { @@ -89,8 +87,6 @@ pub trait SystemdSource: Send + Sync { async fn unit_status(&self, name: &str) -> Result; } -// ---------------------------------------------------------------- journal - /// Syslog severity, 0 (most severe) to 7. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] #[repr(u8)] @@ -251,8 +247,6 @@ pub trait JournalSource: Send + Sync { async fn follow(&self, q: &JournalQuery) -> Result, AppError>; } -// ----------------------------------------------------------------- docker - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] pub struct ContainerSummary { /// Full container id. @@ -322,8 +316,6 @@ pub trait DockerSource: Send + Sync { ) -> Result, AppError>; } -// ---------------------------------------------------------------- helpers - /// Default value of `JournalQuery.lines` and `LogOptions.tail`. pub const DEFAULT_LINES: usize = 100; diff --git a/src/telemetry/logs_export.rs b/src/telemetry/logs_export.rs index aa5fcbf..2195714 100644 --- a/src/telemetry/logs_export.rs +++ b/src/telemetry/logs_export.rs @@ -1,4 +1,4 @@ -//! Journal and docker log fan-out to OTel logs (WS-G). +//! Journal and docker log fan-out to OTel logs. //! //! Journal: one `follow()` per configured unit, or one unfiltered follow when //! `otel.logs.journal_units` is empty. Docker: a reconciler keeps one diff --git a/src/telemetry/metrics_export.rs b/src/telemetry/metrics_export.rs index 025f000..face713 100644 --- a/src/telemetry/metrics_export.rs +++ b/src/telemetry/metrics_export.rs @@ -1,4 +1,4 @@ -//! Metrics poll loop and observable gauges (WS-G). +//! Metrics poll loop and observable gauges. //! //! A background task polls the sources every `metrics_interval_secs` and //! replaces a shared snapshot. Observable gauge callbacks read the latest @@ -57,7 +57,7 @@ pub struct Obs { pub attrs: Vec<(&'static str, String)>, } -/// DEC-7: empty list means `*.service` and `*.timer`; otherwise a glob allowlist. +/// empty list means `*.service` and `*.timer`; otherwise a glob allowlist. pub fn unit_in_scope(cfg: &OtelMetricsConfig, name: &str) -> bool { if cfg.units.is_empty() { name.ends_with(".service") || name.ends_with(".timer") diff --git a/src/telemetry/mod.rs b/src/telemetry/mod.rs index 4528eda..8f47d91 100644 --- a/src/telemetry/mod.rs +++ b/src/telemetry/mod.rs @@ -1,4 +1,4 @@ -//! OpenTelemetry export (WS-G owns `src/telemetry/`). +//! OpenTelemetry export. //! //! One exporter config (`otel.endpoint`, `otel.protocol`, `otel.headers`) //! feeds traces, metrics and logs. The app's own `tracing` events go to diff --git a/src/tls.rs b/src/tls.rs index c01a9df..2ea4a94 100644 --- a/src/tls.rs +++ b/src/tls.rs @@ -1,4 +1,4 @@ -//! Native TLS (DEC-12): rustls with the `ring` provider passed explicitly to +//! Native TLS: rustls with the `ring` provider passed explicitly to //! the config builder (nothing is installed process-wide, so the OTLP //! clients' provider choice is unaffected). Only used when //! `server.tls.enabled`; the plain path never touches this module.