Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
via the provider registry and falls back to the main provider when the field is absent, matching
the pattern used by `apply_quarantine_provider` and `apply_guardrail`. Previously the field had no
effect and IPI probes always used the main/expensive provider. Closes #4753.
- `zeph-acp`, `zeph-channels`, `zeph-config`, `zeph-core`, `zeph-experiments`, `zeph-index`,
`zeph-llm`, `zeph-orchestration`, `zeph-skills`, `zeph-subagent`, `zeph-tools`, `zeph-tui`,
`zeph-vault`, `zeph-worktree`: remaining public enums are now marked `#[non_exhaustive]`,
completing the workspace-wide non-exhaustive enum cleanup (71 enums across 53 files). Cross-crate
exhaustive match sites updated with wildcard arms for forward compatibility. Closes #4743, #4703.

- `zeph-commands`: `CommandHandler` gains a `requires_auth` method (default `false`). Handlers in
the `Debugging`, `Configuration`, and `Advanced` categories (`/log`, `/debug-dump`, `/dump-format`,
`/model`, `/provider`, `/experiment`, `/policy`, `/scheduler`) now return `true`, causing
Expand Down
3 changes: 2 additions & 1 deletion crates/zeph-acp/src/agent/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,11 +552,11 @@ pub(super) fn loopback_event_to_updates(event: LoopbackEvent) -> Vec<SessionUpda
.into_iter()
.map(|(content, status)| {
let acp_status = match status {
zeph_core::channel::PlanItemStatus::Pending => PlanEntryStatus::Pending,
zeph_core::channel::PlanItemStatus::InProgress => {
PlanEntryStatus::InProgress
}
zeph_core::channel::PlanItemStatus::Completed => PlanEntryStatus::Completed,
_ => PlanEntryStatus::Pending,
};
PlanEntry::new(content, PlanEntryPriority::Medium, acp_status)
})
Expand All @@ -571,5 +571,6 @@ pub(super) fn loopback_event_to_updates(event: LoopbackEvent) -> Vec<SessionUpda
}
// Stop hints are consumed directly in the prompt() loop and must not reach here.
LoopbackEvent::Stop(_) => vec![],
_ => vec![],
}
}
2 changes: 1 addition & 1 deletion crates/zeph-acp/src/agent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3158,7 +3158,7 @@ fn compute_stop_reason(cancelled: bool, stop_hint: Option<StopHint>) -> acp::sch
match stop_hint {
Some(StopHint::MaxTokens) => acp::schema::StopReason::MaxTokens,
Some(StopHint::MaxTurnRequests) => acp::schema::StopReason::MaxTurnRequests,
None => acp::schema::StopReason::EndTurn,
None | Some(_) => acp::schema::StopReason::EndTurn,
}
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/zeph-channels/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ fn coerce_field_value(raw: &str, field_type: &ElicitationFieldType) -> Option<se
None
}
}
_ => None,
}
}

Expand Down
2 changes: 2 additions & 0 deletions crates/zeph-channels/src/telegram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,7 @@ fn build_telegram_field_prompt(field: &ElicitationField) -> String {
ElicitationFieldType::String => {
format!("*{name}*{req}: Reply with text")
}
_ => format!("*{name}*{req}: Reply with a value"),
}
}

Expand Down Expand Up @@ -1488,6 +1489,7 @@ fn coerce_telegram_field(text: &str, kind: &ElicitationFieldType) -> Option<serd
.find(|o| o.eq_ignore_ascii_case(text))
.map(|o| serde_json::Value::String(o.clone()))
}
_ => None,
}
}

Expand Down
2 changes: 2 additions & 0 deletions crates/zeph-config/src/providers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};

// ── LLM provider config types (moved from zeph-llm) ─────────────────────────

#[non_exhaustive]
/// Extended or adaptive thinking mode for Claude.
///
/// Serializes with `mode` as tag:
Expand Down Expand Up @@ -39,6 +40,7 @@ pub enum ThinkingEffort {
High,
}

#[non_exhaustive]
/// Prompt-cache TTL variant for the Anthropic API.
///
/// When used as a TOML config value the accepted strings are `"ephemeral"` and `"1h"`.
Expand Down
1 change: 1 addition & 0 deletions crates/zeph-core/src/agent/agent_access_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ async fn semantic_scan_plugin_add(
"plugin add failed: skill {skill_name:?} rejected by semantic scan: {reason}"
)));
}
_ => {}
}
}
Ok(None)
Expand Down
1 change: 1 addition & 0 deletions crates/zeph-core/src/agent/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ use crate::metrics::{MetricsSnapshot, StaticMetricsInit};
use zeph_memory::semantic::SemanticMemory;
use zeph_skills::watcher::SkillEvent;

#[non_exhaustive]
/// Errors that can occur during agent construction.
///
/// Returned by [`Agent::build`] when required configuration is missing.
Expand Down
3 changes: 3 additions & 0 deletions crates/zeph-core/src/agent/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: 2026 Andrei G <bug-ops>
// SPDX-License-Identifier: MIT OR Apache-2.0

#[non_exhaustive]
/// Typed orchestration failure.
///
/// Wraps errors from DAG scheduling, planning, and config verification. Each variant
Expand Down Expand Up @@ -30,6 +31,7 @@ pub enum OrchestrationFailure {
Generic(String),
}

#[non_exhaustive]
/// Typed skill file operation failure.
///
/// Returned when skill name validation or skill directory lookup fails.
Expand All @@ -48,6 +50,7 @@ pub enum SkillOperationFailure {
Generic(String),
}

#[non_exhaustive]
/// Top-level error type for the agent loop.
///
/// All fallible agent operations return `Result<T, AgentError>`. Variants are kept
Expand Down
1 change: 1 addition & 0 deletions crates/zeph-core/src/agent/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,7 @@ impl<C: crate::channel::Channel> Agent<C> {
PlanCommand::Cancel(id) => Ok(self.handle_plan_cancel_as_string(id.as_deref())),
PlanCommand::Resume(id) => Ok(self.handle_plan_resume_as_string(id.as_deref()).await),
PlanCommand::Retry(id) => self.handle_plan_retry_as_string(id.as_deref()),
_ => Ok(String::new()),
}
}

Expand Down
1 change: 1 addition & 0 deletions crates/zeph-core/src/agent/policy_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ impl<C: Channel> Agent<C> {
match enforcer.evaluate(tool, &params, &ctx) {
PolicyDecision::Allow { trace } => format!("Allow: {trace}"),
PolicyDecision::Deny { trace } => format!("Deny: {trace}"),
_ => String::new(),
}
}
Err(e) => format!("policy compile error: {e}"),
Expand Down
1 change: 1 addition & 0 deletions crates/zeph-core/src/agent/rate_limiter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub use zeph_config::RateLimitConfig;
// ToolCategory
// ---------------------------------------------------------------------------

#[non_exhaustive]
/// Logical category used for per-category rate limiting.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum ToolCategory {
Expand Down
1 change: 1 addition & 0 deletions crates/zeph-core/src/agent/speculative/partial_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

use serde_json::Map;

#[non_exhaustive]
/// Result of feeding accumulated JSON delta bytes to [`PartialJsonParser::push`].
#[derive(Debug, Clone, PartialEq)]
pub enum PrefixState {
Expand Down
2 changes: 2 additions & 0 deletions crates/zeph-core/src/agent/speculative/paste.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ use crate::agent::speculative::cache::{args_template, hash_args};
/// Wilson 95% one-sided z-score.
const Z: f64 = 1.645;

#[non_exhaustive]
/// Outcome of a tool call, used when observing a transition.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ToolOutcome {
Success,
Failure,
}

#[non_exhaustive]
/// Error type for `PatternStore` operations.
#[derive(Debug, Error)]
pub enum PatternError {
Expand Down
1 change: 1 addition & 0 deletions crates/zeph-core/src/agent/speculative/prediction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use zeph_common::ToolName;
use zeph_tools::{ToolCall, ToolError};

#[non_exhaustive]
/// Source of a tool call prediction.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum PredictionSource {
Expand Down
2 changes: 1 addition & 1 deletion crates/zeph-core/src/agent/tool_execution/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ impl<C: Channel> Agent<C> {
let vigil_code = match risk {
zeph_tools::audit::VigilRiskLevel::High => 7u8,
zeph_tools::audit::VigilRiskLevel::Medium => 6u8,
zeph_tools::audit::VigilRiskLevel::Low => 0u8,
_ => 0u8,
};
self.services
.security
Expand Down
4 changes: 2 additions & 2 deletions crates/zeph-core/src/agent/tool_execution/tier_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ impl<C: Channel> Agent<C> {
let args_value = serde_json::Value::Object(call.params.clone());
for verifier in &self.tool_orchestrator.pre_execution_verifiers {
match verifier.verify(call.tool_id.as_str(), &args_value) {
zeph_tools::VerificationResult::Allow => {}
zeph_tools::VerificationResult::Block { reason } => {
tracing::warn!(
tool = %call.tool_id,
Expand Down Expand Up @@ -363,6 +362,7 @@ impl<C: Channel> Agent<C> {
format!("{}: {}", verifier.name(), message),
);
}
_ => {}
}
}
}
Expand Down Expand Up @@ -1225,7 +1225,6 @@ impl<C: Channel> Agent<C> {
pending_system_hints: &mut Vec<String>,
) -> Result<Option<(usize, ToolExecFut)>, crate::agent::error::AgentError> {
match utility_actions[idx] {
zeph_tools::UtilityAction::ToolCall => Ok(None),
zeph_tools::UtilityAction::Respond => {
let _ = self
.channel
Expand Down Expand Up @@ -1309,6 +1308,7 @@ impl<C: Channel> Agent<C> {
),
)))
}
_ => Ok(None),
}
}

Expand Down
3 changes: 3 additions & 0 deletions crates/zeph-core/src/agent/trajectory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub use zeph_config::TrajectorySentinelConfig as SentinelConfig;

// ── Signal taxonomy ───────────────────────────────────────────────────────────

#[non_exhaustive]
/// Vigil confidence levels mirrored from the audit crate to avoid a circular dep.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum VigilRiskLevel {
Expand All @@ -36,6 +37,7 @@ pub enum VigilRiskLevel {
High,
}

#[non_exhaustive]
/// Risk signal emitted by security subsystems and accumulated by `TrajectorySentinel`.
///
/// Each variant maps to a configurable weight (see spec 050 §2 for defaults).
Expand Down Expand Up @@ -115,6 +117,7 @@ impl RiskSignal {

// ── Risk levels ───────────────────────────────────────────────────────────────

#[non_exhaustive]
/// Advisory risk level computed from the accumulated score.
///
/// `PolicyGateExecutor` consumes this to decide whether to downgrade an `Allow` decision.
Expand Down
1 change: 1 addition & 0 deletions crates/zeph-core/src/agent/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ impl<C: Channel> Agent<C> {
zeph_tools::FilterConfidence::Fallback => {
m.filter_confidence_fallback += 1;
}
_ => {}
}
}
});
Expand Down
2 changes: 2 additions & 0 deletions crates/zeph-core/src/agent/vigil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ struct CompiledPattern {
regex: Regex,
}

#[non_exhaustive]
/// Action to take when VIGIL flags a tool output.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum VigilAction {
Expand All @@ -46,6 +47,7 @@ pub enum VigilAction {
Sanitize,
}

#[non_exhaustive]
/// Verdict returned by [`VigilGate::verify`].
#[derive(Debug, Clone)]
pub enum VigilVerdict {
Expand Down
6 changes: 6 additions & 0 deletions crates/zeph-core/src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub struct ElicitationField {
pub required: bool,
}

#[non_exhaustive]
/// Type of an elicitation form field.
///
/// # Examples
Expand Down Expand Up @@ -87,6 +88,7 @@ pub struct ElicitationRequest {
pub fields: Vec<ElicitationField>,
}

#[non_exhaustive]
/// User's response to an elicitation request.
///
/// Channels return this after the user interacts with the form. The MCP layer
Expand Down Expand Up @@ -174,6 +176,7 @@ impl ChannelError {
}
}

#[non_exhaustive]
/// Kind of binary attachment on an incoming message.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AttachmentKind {
Expand Down Expand Up @@ -468,6 +471,7 @@ pub trait Channel: Send {
}
}

#[non_exhaustive]
/// Reason why the agent turn ended — carried by [`LoopbackEvent::Stop`].
///
/// Emitted by the agent loop immediately before `Flush` when a non-default
Expand Down Expand Up @@ -549,6 +553,7 @@ pub type ToolStartData = ToolStartEvent;
/// Kept for use in the ACP layer. Prefer [`ToolOutputEvent`] in new code.
pub type ToolOutputData = ToolOutputEvent;

#[non_exhaustive]
/// Events emitted by the agent side toward the A2A caller.
#[derive(Debug, Clone)]
pub enum LoopbackEvent {
Expand Down Expand Up @@ -589,6 +594,7 @@ pub enum LoopbackEvent {
Stop(StopHint),
}

#[non_exhaustive]
/// Status of a plan item, mirroring `acp::PlanEntryStatus`.
#[derive(Debug, Clone)]
pub enum PlanItemStatus {
Expand Down
2 changes: 2 additions & 0 deletions crates/zeph-core/src/config_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::time::Duration;
use notify_debouncer_mini::{DebouncedEventKind, new_debouncer};
use tokio::sync::mpsc;

#[non_exhaustive]
#[derive(Debug, thiserror::Error)]
pub enum ConfigWatcherError {
#[error("config path has no parent directory")]
Expand All @@ -19,6 +20,7 @@ pub enum ConfigWatcherError {
Notify(#[from] notify::Error),
}

#[non_exhaustive]
#[derive(Clone)]
pub enum ConfigEvent {
Changed,
Expand Down
2 changes: 2 additions & 0 deletions crates/zeph-core/src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ use tokio::task::JoinHandle;

use crate::config::DaemonConfig;

#[non_exhaustive]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ComponentStatus {
Running,
Failed(String),
Stopped,
}

#[non_exhaustive]
/// Error type for daemon component task failures.
#[derive(Debug, thiserror::Error)]
pub enum DaemonError {
Expand Down
1 change: 1 addition & 0 deletions crates/zeph-core/src/debug_dump/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ fn now_unix_nanos() -> u64 {

// ─── Public types ─────────────────────────────────────────────────────────────

#[non_exhaustive]
/// Span status code (matches OTLP `StatusCode` values).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum SpanStatus {
Expand Down
1 change: 1 addition & 0 deletions crates/zeph-core/src/file_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::time::Duration;
use notify_debouncer_mini::{DebouncedEventKind, new_debouncer};
use tokio::sync::mpsc;

#[non_exhaustive]
#[derive(Debug, thiserror::Error)]
pub enum FileWatcherError {
#[error("no watch paths configured")]
Expand Down
1 change: 1 addition & 0 deletions crates/zeph-core/src/goal/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

//! Goal status FSM with valid transition table.

#[non_exhaustive]
/// Status of a long-horizon goal.
///
/// Transitions form a directed acyclic graph where `Completed` and `Cleared`
Expand Down
1 change: 1 addition & 0 deletions crates/zeph-core/src/goal/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use zeph_db::DbPool;

use super::{Goal, GoalStatus};

#[non_exhaustive]
/// Error variants for goal store operations.
#[derive(Debug, thiserror::Error)]
pub enum GoalError {
Expand Down
1 change: 1 addition & 0 deletions crates/zeph-core/src/goal/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use zeph_llm::any::AnyProvider;
use super::autonomous::SupervisorVerdict;
use crate::quality::parser::{ChatJsonError, chat_json};

#[non_exhaustive]
/// Errors returned by the supervisor.
#[derive(Debug, thiserror::Error)]
pub enum SupervisorError {
Expand Down
1 change: 1 addition & 0 deletions crates/zeph-core/src/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use tokio::sync::mpsc;

use crate::config::ProviderKind;

#[non_exhaustive]
pub enum InstructionEvent {
Changed,
}
Expand Down
Loading
Loading