Fission-AI/OpenSpec · error · Error

Directory changed while archive was reading ${dir}.

Error message

Directory changed while archive was reading ${dir}.

What it means

Error "Directory changed while archive was reading ${dir}." thrown in Fission-AI/OpenSpec.

Source

Thrown at src/core/archive.ts:442

      } else if (stat.isFile()) {
        const contentFingerprint = await fingerprintFile(entryPath);
        const after = await fs.lstat(entryPath, { bigint: true });
        if (statIdentity(stat) !== statIdentity(after)) {
          throw new Error(`Path changed while archive was reading ${entryPath}.`);
        }
        updateHashField('type', 'file');
        updateHashField('mode', (stat.mode & 0o7777n).toString());
        updateHashField('content-sha256', contentFingerprint);
      } else {
        updateHashField('type', 'other');
        updateHashField('mode', stat.mode.toString());
        updateHashField('size', stat.size.toString());
      }
    }

    const after = await fs.lstat(dir, { bigint: true });
    if (statIdentity(before) !== statIdentity(after)) {
      throw new Error(`Directory changed while archive was reading ${dir}.`);
    }
  };

  await visit(root, '');
  return hash.digest('hex');
}

async function assertCopiedDirectoryUnchanged(
  stagedSource: string,
  destination: string,
  expectedFingerprint: string
): Promise<void> {
  const sourceFingerprint = await fingerprintDirectoryContents(stagedSource);
  const destinationFingerprint = await fingerprintDirectoryContents(destination);
  if (
    sourceFingerprint !== expectedFingerprint ||
    destinationFingerprint !== expectedFingerprint
  ) {

View on GitHub (pinned to 6926ccb18a)

When it happens

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