pbakaus/impeccable · error · Error

concept-seed: --mode must be persuade, operate, read, or exp

Error message

concept-seed: --mode must be persuade, operate, read, or experience

What it means

Thrown when `mode` is set to a value not in SEED_MODES = {persuade, operate, read, experience}. Mode is optional (default null) and describes which register of work the seed targets. The allowed set is fixed and mirrored in the catalog validator.

Source

Thrown at skill/scripts/concept-seed.mjs:322

  _resolvedData = undefined,
} = {}) {
  if (scope !== 'surface' && scope !== 'direction') {
    throw new Error('concept-seed: --scope must be direction or surface');
  }
  if (!Number.isInteger(reroll) || reroll < 0) {
    throw new Error('concept-seed: --reroll must be a non-negative integer');
  }
  if (register !== null && register !== 'safer' && register !== 'bolder') {
    throw new Error('concept-seed: --register must be safer or bolder');
  }
  if (register !== null && reroll < 1) {
    throw new Error('concept-seed: --register steers a re-roll round; pass --reroll <n> with it');
  }
  if (register !== null && scope !== 'direction') {
    throw new Error('concept-seed: --register applies to direction rounds only');
  }
  if (mode !== null && !SEED_MODES.has(mode)) {
    throw new Error('concept-seed: --mode must be persuade, operate, read, or experience');
  }
  // Grain needs no mode: how much of the product is in play is independent of
  // which register of work it is.
  if (grain !== null && !COMPOSITION_GRAINS.includes(grain)) {
    throw new Error(`concept-seed: --grain must be one of ${COMPOSITION_GRAINS.join(', ')}`);
  }
  if (platform !== null && !COMPOSITION_PLATFORMS.includes(platform)) {
    throw new Error(`concept-seed: --platform must be one of ${COMPOSITION_PLATFORMS.join(', ')}`);
  }
  if (!Number.isInteger(candidateCount) || candidateCount < 5 || candidateCount > 7) {
    throw new Error('concept-seed: --candidate-count must be an integer from 5 to 7');
  }
  const unit = (salt) => {
    const h = crypto.createHash('sha256').update(`${scope}:${salt}:${key}`).digest();
    return h.readUInt32BE(0) / 0xffffffff;
  };
  const indexSalt = reroll === 0 ? 'index' : `index:reroll-${reroll}`;
  const buildIndex = 3 + Math.floor(unit(indexSalt) * (candidateCount - 2)); // 3..candidateCount

View on GitHub (pinned to d14711ae3d)

Solutions

  1. Use exactly one of persuade, operate, read, experience, or omit mode / pass null.
  2. If exposing mode via CLI, validate against SEED_MODES before calling.

Example fix

// before
await seedConcepts({ scope: 'surface', mode: 'reading' });

// after
await seedConcepts({ scope: 'surface', mode: 'read' }); // or persuade|operate|experience
Defensive patterns

Strategy: type-guard

Type guard

import { SEED_MODES } from './lib/concept-catalog.mjs';
function isValidMode(v) {
  return v == null || SEED_MODES.has(v);
}

Prevention

When it happens

Trigger: Passing 'reading' instead of 'read'; passing 'transactional' or 'browsing'; passing an empty string instead of null; case mismatch.

Common situations: Using a gerund or synonym; copying a mode label from a different part of the skill; config drift between the caller's enum and SEED_MODES.

Related errors


AI-assisted analysis of pbakaus/impeccable@d14711ae3d (2026-08-13). Data as JSON: /api/errors/5a3069ed23b411a0. Report an issue: GitHub.