ruvnet/ruflo · error

EvolutionPipeline requires an explicit signingKey — hardcode

Error message

EvolutionPipeline requires an explicit signingKey — hardcoded defaults are not secure

What it means

EvolutionPipeline signs change proposals, simulation results, and staged rollouts, so it requires `config.signingKey` at construction — the same no-hardcoded-default hardening as ArtifactLedger and ConformanceRunner. `new EvolutionPipeline()` or any config object without signingKey throws before any propose/simulate/stage work. There is no fallback key by design.

Source

Thrown at v3/@claude-flow/guidance/src/evolution.ts:255

// EvolutionPipeline
// ============================================================================

/**
 * The Evolution Pipeline manages the lifecycle of change proposals through
 * signing, simulation, comparison, staged rollout, and promotion or rollback.
 */
export class EvolutionPipeline {
  private readonly signingKey: string;
  private readonly maxDivergence: number;
  private readonly defaultStages: RolloutStage[];

  private proposals = new Map<string, ChangeProposal>();
  private simulations = new Map<string, SimulationResult>();
  private rollouts = new Map<string, StagedRollout>();

  constructor(config: EvolutionPipelineConfig = {}) {
    if (!config.signingKey) {
      throw new Error('EvolutionPipeline requires an explicit signingKey — hardcoded defaults are not secure');
    }
    this.signingKey = config.signingKey;
    this.maxDivergence = config.maxDivergence ?? DEFAULT_MAX_DIVERGENCE;
    this.defaultStages = config.stages ?? DEFAULT_STAGES;
  }

  // ==========================================================================
  // Propose
  // ==========================================================================

  /**
   * Create and sign a new change proposal.
   */
  propose(params: {
    kind: ChangeProposalKind;
    title: string;
    description: string;
    author: string;

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Construct with an explicit key: `new EvolutionPipeline({ signingKey: process.env.EVOLUTION_SIGNING_KEY! })`
  2. Fail fast at boot if required env vars are missing
  3. Use one shared secret-management path for all guidance components that need signing keys

Example fix

// before
const pipeline = new EvolutionPipeline({ maxDivergence: 0.05 }); // throws

// after
const pipeline = new EvolutionPipeline({
  signingKey: requiredEnv('EVOLUTION_SIGNING_KEY'),
  maxDivergence: 0.05,
});
Defensive patterns

Strategy: validation

Validate before calling

const signingKey = process.env.EVOLUTION_SIGNING_KEY;
if (!signingKey) {
  throw new Error('EVOLUTION_SIGNING_KEY must be set before EvolutionPipeline');
}

Prevention

When it happens

Trigger: `new EvolutionPipeline()`; `new EvolutionPipeline({ maxDivergence: 0.05 })` without signingKey; key sourced from an env var absent in the deployment environment.

Common situations: Deploying the evolution service without provisioning its signing secret; sharing config objects between components and dropping the key field; older docs/examples that omit signingKey.

Related errors


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/313b078ee5059b89. Report an issue: GitHub.