Fission-AI/OpenSpec · error · Error

errors.map(( ) => message).join(' ')

Error message

errors.map(({ message }) => message).join(' ')

What it means

Aggregation point in archive rollback: individual rollback step failures are collected and their messages joined with spaces into one combined error. The message is dynamically built from those step failures, so its text reflects whichever restore operations went wrong.

Solutions

  1. Address each listed per-snapshot failure in order
  2. Check for locks/permissions on the spec paths and re-run the archive
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/core/archive.ts:1018 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/c56b193b9f0c797d. Report an issue: GitHub.

Appendix: source

Thrown at src/core/archive.ts:1018

        } else if (snapshot.contentExisted) {
          await fs.writeFile(snapshot.target, snapshot.content!);
        } else {
          const referent = path.resolve(path.dirname(snapshot.target), snapshot.symlink);
          await fs.rm(referent, { force: true });
        }
        continue;
      }
      if (snapshot.content !== undefined) {
        await fs.mkdir(path.dirname(snapshot.target), { recursive: true });
        await fs.writeFile(snapshot.target, snapshot.content);
        if (snapshot.mode !== undefined) await fs.chmod(snapshot.target, snapshot.mode);
      }
    } catch (error) {
      errors.push(error instanceof Error ? error : new Error(String(error)));
    }
  }
  if (errors.length > 0) {
    throw new Error(errors.map(({ message }) => message).join(' '));
  }
}

async function finalizeRetirementBackups(
  snapshots: SpecSnapshot[],
  mainSpecsDir: string
): Promise<void> {
  const errors: string[] = [];
  for (const snapshot of snapshots) {
    if (snapshot.outcome !== 'retire' || snapshot.displacedPath === undefined) continue;
    const displacedPath = snapshot.displacedPath;
    try {
      if (
        snapshot.displacedFingerprint === undefined ||
        (await fingerprintMovablePath(displacedPath)) !== snapshot.displacedFingerprint
      ) {
        throw new Error('the displaced spec changed after retirement verification');
      }

View on GitHub (pinned to 6926ccb18a)