Fission-AI/OpenSpec · error · ArchiveBlockedError

archive_change_symlink

archive_change_symlink

Error message

Change '${changeName}' is a symbolic link. Replace it with a real directory before archiving.

What it means

Safety guard in archive run: lstat shows the change directory is itself a symbolic link, so archiving it could move or transform linked content unexpectedly. ArchiveBlockedError (archive_change_symlink) demands the user replace the link with a real directory first.

Solutions

  1. Replace the symlink with the real directory (or move the real directory into place)
  2. Point the archive at the real change directory
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

Thrown at src/core/archive.ts:1161

      if (!selectedChange) {
        console.log('No change selected. Aborting.');
        return null;
      }
      changeName = selectedChange;
    }

    const changeNameProblem = folderStyleNameProblem(changeName, 'Change name');
    if (changeNameProblem) {
      throw new ArchiveBlockedError('archive_change_name_invalid', changeNameProblem);
    }

    const changeDir = path.join(changesDir, changeName);

    // Verify change exists
    try {
      const stat = await fs.lstat(changeDir);
      if (stat.isSymbolicLink()) {
        throw new ArchiveBlockedError(
          'archive_change_symlink',
          `Change '${changeName}' is a symbolic link. Replace it with a real directory before archiving.`
        );
      }
      if (!stat.isDirectory()) {
        throw new Error(`Change '${changeName}' not found.`);
      }
    } catch (error) {
      if (error instanceof ArchiveBlockedError) throw error;
      const available = await listActiveChangeNames(changesDir);
      throw new ArchiveBlockedError(
        'archive_change_not_found',
        available.length > 0
          ? `Change '${changeName}' not found. Available changes: ${available.join(', ')}`
          : `Change '${changeName}' not found. No active changes exist in this root.`
      );
    }

View on GitHub (pinned to 6926ccb18a)