Fission-AI/OpenSpec · error

${specName}: target spec is structurally invalid and cannot

Error message

${specName}: target spec is structurally invalid and cannot be updated until fixed:
${details}

What it means

Error "${specName}: target spec is structurally invalid and cannot be updated until fixed: ${details}" thrown in Fission-AI/OpenSpec.

Source

Thrown at src/core/specs-apply.ts:363

        `${specName} - delta Purpose ignored (it would leave the new spec unreadable); wrote the placeholder Purpose instead.`
      );
    } else if (overview && overview.length < MIN_PURPOSE_LENGTH) {
      // The placeholder always cleared this threshold, so a carried Purpose is
      // the first way archive can leave a spec that `validate --strict` fails.
      // Measured on the parsed overview, which is what the validator reads.
      warn(
        `${specName} - carried Purpose is under ${MIN_PURPOSE_LENGTH} characters; ` +
          `openspec validate --strict reports it as too brief.`
      );
    }
  }

  const structureIssues = findMainSpecStructureIssues(targetContent);
  if (structureIssues.length > 0) {
    const details = structureIssues
      .map(issue => `line ${issue.line}: ${issue.message}`)
      .join('\n');
    throw new Error(
      `${specName}: target spec is structurally invalid and cannot be updated until fixed:\n${details}`
    );
  }

  // Extract requirements section and build name->block map
  const parts = extractRequirementsSection(targetContent);
  const nameToBlock = new Map<string, RequirementBlock>();
  for (const block of parts.bodyBlocks) {
    nameToBlock.set(normalizeRequirementName(block.name), block);
  }

  // Apply operations in order: RENAMED → REMOVED → MODIFIED → ADDED
  // RENAMED
  let renamedApplied = 0;
  const renamedTargets = new Map<string, string>();
  for (const r of plan.renamed) {
    const from = normalizeRequirementName(r.from);
    const to = normalizeRequirementName(r.to);

View on GitHub (pinned to 6926ccb18a)

When it happens

Trigger: Thrown at src/core/specs-apply.ts:363 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25). Data as JSON: /api/errors/f692d21d7af3c9ae. Report an issue: GitHub.