Remove workstream/decision tags and section banners from comments
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YShymaPrXmc3KYRUg2HMSs
This commit is contained in:
1 parent
e39d885fae
commit
8b3f91dcb7
17 files changed
+19
-35
No files matched your search
@@ -131,8 +131,8 @@ async fn wrong_method_is_json_405() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Stub that validates names and states like the real sources do. The fakes
|
/// 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
|
/// 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
|
/// These tests prove the handlers surface the source's 400 and
|
||||||
/// that percent-encoded `/` and `;` reach the source intact.
|
/// that percent-encoded `/` and `;` reach the source intact.
|
||||||
struct Strict;
|
struct Strict;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
//! GET /api/v1/docker/* handlers (WS-E)
|
//! GET /api/v1/docker/* handlers
|
||||||
|
|
||||||
use axum::extract::rejection::QueryRejection;
|
use axum::extract::rejection::QueryRejection;
|
||||||
use axum::extract::{Path, Query, State};
|
use axum::extract::{Path, Query, State};
|
||||||
|
|||||||
+1
-1
@@ -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;
|
use std::convert::Infallible;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
//! GET /api/v1/systemd/* handlers (WS-E)
|
//! GET /api/v1/systemd/* handlers
|
||||||
|
|
||||||
use axum::extract::rejection::QueryRejection;
|
use axum::extract::rejection::QueryRejection;
|
||||||
use axum::extract::{Path, Query, State};
|
use axum::extract::{Path, Query, State};
|
||||||
|
|||||||
+2
-2
@@ -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
|
//! 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.
|
//! protected router only; `/healthz` stays outside it.
|
||||||
|
|
||||||
pub mod tokens;
|
pub mod tokens;
|
||||||
|
|||||||
+1
-1
@@ -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
|
//! Tokens have the prefix `slinuxm_` and 32 random bytes. Only the sha256 hex
|
||||||
//! digest is stored; the plaintext is printed once on create.
|
//! digest is stored; the plaintext is printed once on create.
|
||||||
|
|||||||
@@ -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::path::Path;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|||||||
+1
-1
@@ -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;
|
//! Prompts only return instructions that tell the agent which tools to call;
|
||||||
//! they do not read live data themselves.
|
//! they do not read live data themselves.
|
||||||
|
|||||||
@@ -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};
|
use rmcp::model::{ReadResourceResult, Resource, ResourceContents};
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
//! 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
|
//! 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.
|
/// Strip the leading `/` and reject names that could alter the request path.
|
||||||
fn normalize_name(name: &str) -> Result<String, AppError> {
|
fn normalize_name(name: &str) -> Result<String, AppError> {
|
||||||
let n = name.trim().trim_start_matches('/');
|
let n = name.trim().trim_start_matches('/');
|
||||||
|
|||||||
+1
-7
@@ -1,5 +1,5 @@
|
|||||||
//! Fixture-backed in-memory sources for tests and for developing surfaces
|
//! 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
|
//! `fake_state(config)` returns a ready `AppState`. Each fake exposes its
|
||||||
//! fixtures as public fields so tests can replace them.
|
//! 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 struct FakeSystemd {
|
||||||
pub units: Vec<UnitStatus>,
|
pub units: Vec<UnitStatus>,
|
||||||
pub timers: Vec<TimerInfo>,
|
pub timers: Vec<TimerInfo>,
|
||||||
@@ -127,8 +125,6 @@ impl SystemdSource for FakeSystemd {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------- journal
|
|
||||||
|
|
||||||
pub struct FakeJournal {
|
pub struct FakeJournal {
|
||||||
pub entries: Vec<JournalEntry>,
|
pub entries: Vec<JournalEntry>,
|
||||||
shutdown: CancellationToken,
|
shutdown: CancellationToken,
|
||||||
@@ -219,8 +215,6 @@ impl JournalSource for FakeJournal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------- docker
|
|
||||||
|
|
||||||
pub struct FakeDocker {
|
pub struct FakeDocker {
|
||||||
pub containers: Vec<ContainerStatus>,
|
pub containers: Vec<ContainerStatus>,
|
||||||
pub logs: Vec<LogLine>,
|
pub logs: Vec<LogLine>,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! journald source over libsystemd (WS-B).
|
//! journald source over libsystemd.
|
||||||
//!
|
//!
|
||||||
//! `systemd::journal::Journal` is neither `Send` nor `Sync`, so every
|
//! `systemd::journal::Journal` is neither `Send` nor `Sync`, so every
|
||||||
//! sd-journal call happens inside a `spawn_blocking` closure that opens its own
|
//! sd-journal call happens inside a `spawn_blocking` closure that opens its own
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ use tokio::sync::mpsc;
|
|||||||
|
|
||||||
use crate::error::AppError;
|
use crate::error::AppError;
|
||||||
|
|
||||||
// ---------------------------------------------------------------- systemd
|
|
||||||
|
|
||||||
/// One row of `ListUnits`.
|
/// One row of `ListUnits`.
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
|
||||||
pub struct UnitSummary {
|
pub struct UnitSummary {
|
||||||
@@ -89,8 +87,6 @@ pub trait SystemdSource: Send + Sync {
|
|||||||
async fn unit_status(&self, name: &str) -> Result<UnitStatus, AppError>;
|
async fn unit_status(&self, name: &str) -> Result<UnitStatus, AppError>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------- journal
|
|
||||||
|
|
||||||
/// Syslog severity, 0 (most severe) to 7.
|
/// Syslog severity, 0 (most severe) to 7.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
@@ -251,8 +247,6 @@ pub trait JournalSource: Send + Sync {
|
|||||||
async fn follow(&self, q: &JournalQuery) -> Result<mpsc::Receiver<JournalEntry>, AppError>;
|
async fn follow(&self, q: &JournalQuery) -> Result<mpsc::Receiver<JournalEntry>, AppError>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------- docker
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
|
||||||
pub struct ContainerSummary {
|
pub struct ContainerSummary {
|
||||||
/// Full container id.
|
/// Full container id.
|
||||||
@@ -322,8 +316,6 @@ pub trait DockerSource: Send + Sync {
|
|||||||
) -> Result<mpsc::Receiver<LogLine>, AppError>;
|
) -> Result<mpsc::Receiver<LogLine>, AppError>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------- helpers
|
|
||||||
|
|
||||||
/// Default value of `JournalQuery.lines` and `LogOptions.tail`.
|
/// Default value of `JournalQuery.lines` and `LogOptions.tail`.
|
||||||
pub const DEFAULT_LINES: usize = 100;
|
pub const DEFAULT_LINES: usize = 100;
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
//! Journal: one `follow()` per configured unit, or one unfiltered follow when
|
||||||
//! `otel.logs.journal_units` is empty. Docker: a reconciler keeps one
|
//! `otel.logs.journal_units` is empty. Docker: a reconciler keeps one
|
||||||
|
|||||||
@@ -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
|
//! A background task polls the sources every `metrics_interval_secs` and
|
||||||
//! replaces a shared snapshot. Observable gauge callbacks read the latest
|
//! replaces a shared snapshot. Observable gauge callbacks read the latest
|
||||||
@@ -57,7 +57,7 @@ pub struct Obs {
|
|||||||
pub attrs: Vec<(&'static str, String)>,
|
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 {
|
pub fn unit_in_scope(cfg: &OtelMetricsConfig, name: &str) -> bool {
|
||||||
if cfg.units.is_empty() {
|
if cfg.units.is_empty() {
|
||||||
name.ends_with(".service") || name.ends_with(".timer")
|
name.ends_with(".service") || name.ends_with(".timer")
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! OpenTelemetry export (WS-G owns `src/telemetry/`).
|
//! OpenTelemetry export.
|
||||||
//!
|
//!
|
||||||
//! One exporter config (`otel.endpoint`, `otel.protocol`, `otel.headers`)
|
//! One exporter config (`otel.endpoint`, `otel.protocol`, `otel.headers`)
|
||||||
//! feeds traces, metrics and logs. The app's own `tracing` events go to
|
//! feeds traces, metrics and logs. The app's own `tracing` events go to
|
||||||
|
|||||||
+1
-1
@@ -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
|
//! the config builder (nothing is installed process-wide, so the OTLP
|
||||||
//! clients' provider choice is unaffected). Only used when
|
//! clients' provider choice is unaffected). Only used when
|
||||||
//! `server.tls.enabled`; the plain path never touches this module.
|
//! `server.tls.enabled`; the plain path never touches this module.
|
||||||
|
|||||||
Reference in new issue
Block a user