Fission-AI/OpenSpec · error · ArchiveBlockedError

archive_change_name_invalid

archive_change_name_invalid

Error message

changeNameProblem

What it means

Sentinel wrapping in archive run: the change name failed folderStyleNameProblem validation (naming/format rules) and the validator's problem text is raised as ArchiveBlockedError archive_change_name_invalid. The faulting input is the <change-name> argument; the exact rule violated is in the dynamic message.

Solutions

  1. Use the folder-style change name format the validator expects
  2. Follow the specific reason text returned by the validator
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

Thrown at src/core/archive.ts:1152

    if (!changeName) {
      if (json) {
        throw new ArchiveBlockedError(
          'archive_change_name_required',
          'A change name is required: archive --json is non-interactive.',
          withStoreFlag(root, 'openspec archive <change-name> --json')
        );
      }
      const selectedChange = await this.selectChange(changesDir, root, options);
      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;

View on GitHub (pinned to 6926ccb18a)