Hmbown/CodeWhale · error

every ControlOperation has exactly one descriptor

Error message

every ControlOperation has exactly one descriptor

What it means

ControlOperation::descriptor() searches the OPERATIONS table for the variant's descriptor and unwraps, backed by the invariant that each ControlOperation variant appears exactly once in that table. It fires only when a variant is added or renamed without updating OPERATIONS — a code-maintenance bug.

Source

Thrown at crates/lane/src/control.rs:311

        Self::FleetList,
        Self::FleetStatus,
        Self::FleetInterrupt,
        Self::FleetRestart,
        Self::FleetResume,
    ];

    /// Stable wire id shared by every surface, receipt, and test.
    #[must_use]
    pub fn id(self) -> &'static str {
        self.descriptor().id
    }

    #[must_use]
    pub fn descriptor(self) -> &'static OperationDescriptor {
        OPERATIONS
            .iter()
            .find(|descriptor| descriptor.operation == self)
            .expect("every ControlOperation has exactly one descriptor")
    }

    /// Resolve a descriptor from its stable id (`"lane.status"`).
    #[must_use]
    pub fn from_id(id: &str) -> Option<Self> {
        OPERATIONS
            .iter()
            .find(|descriptor| descriptor.id == id)
            .map(|descriptor| descriptor.operation)
    }

    /// Resolve a descriptor from a domain plus the verb word a user typed.
    ///
    /// Every surface routes through this so `/lane interrupt`, a hotbar
    /// dispatch of the same command, and `codewhale lane interrupt` cannot
    /// drift onto different verbs. Compatibility spellings live here once.
    #[must_use]
    pub fn parse_verb(domain: ControlDomain, verb: &str) -> Option<Self> {

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Add or fix the OperationDescriptor entry for the missing ControlOperation variant
  2. Keep/extend the exhaustive-variants test that pins OPERATIONS against the enum
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/lane/src/control.rs:311 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/79fbcb8a718a1df7. Report an issue: GitHub.