Fission-AI/OpenSpec · error · ArchiveBlockedError

archive_path_outside_root

archive_path_outside_root

Error message

Refusing to archive through a path outside the OpenSpec root: ${managedDir}

What it means

Error "Refusing to archive through a path outside the OpenSpec root: ${managedDir}" thrown in Fission-AI/OpenSpec.

Source

Thrown at src/core/archive.ts:1126

  private async run(
    changeName: string | undefined,
    options: ArchiveOptions,
    root: ResolvedOpenSpecRoot,
    json: boolean
  ): Promise<ArchiveResult | null> {
    const changesDir = root.changesDir;
    const archiveDir = root.archiveDir;
    const mainSpecsDir = root.specsDir;

    for (const [allowedDirectory, managedDir] of [
      [root.path, changesDir],
      [changesDir, archiveDir],
      [root.path, mainSpecsDir],
    ] as const) {
      try {
        FileSystemUtils.assertPathWithin(allowedDirectory, managedDir);
      } catch {
        throw new ArchiveBlockedError(
          'archive_path_outside_root',
          `Refusing to archive through a path outside the OpenSpec root: ${managedDir}`
        );
      }
    }

    // Get change name interactively if not provided
    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.');

View on GitHub (pinned to 6926ccb18a)

When it happens

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