Fission-AI/OpenSpec · error · Error

Spec inputs for ' ' changed before archive could apply…

Error message

Spec inputs for '${proposed.update.id}' changed before archive could apply them. No files were changed; review the new content and rerun.

What it means

Thrown in the apply phase, just before writing updated specs, when the source fingerprint re-checked at that moment no longer matches the fingerprint recorded during preparation. Means the spec source changed between preparation and mutation; archive skips the write to avoid clobbering newer content and asks the user to review and rerun.

Solutions

  1. Review the new content and rerun the archive
  2. Prevent concurrent edits to change deltas/specs during archive
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

Thrown at src/core/archive.ts:1716

            .filter(
              ({ outcome, counts }) =>
                outcome === 'retire' ||
                (outcome === 'write' &&
                  counts.added + counts.modified + counts.removed + counts.renamed > 0)
            )
            .map(({ update, outcome, rebuilt }) => ({
              update,
              outcome: outcome as 'write' | 'retire',
              rebuilt,
            }));
          const hasRetirements = mutations.some(({ outcome }) => outcome === 'retire');
          await assertDistinctMutationTargets(mutations);
          for (const proposed of prepared) {
            if (
              (await fingerprintPath(proposed.update.source)) !== proposed.sourceFingerprint ||
              (await fingerprintPath(proposed.update.target)) !== proposed.targetFingerprint
            ) {
              throw new Error(
                `Spec inputs for '${proposed.update.id}' changed before archive could apply them. ` +
                  'No files were changed; review the new content and rerun.'
              );
            }
          }
          const specSnapshots = await captureSpecSnapshots(mutations);
          const specSnapshotsByTarget = new Map(
            specSnapshots.map((snapshot) => [snapshot.target, snapshot])
          );

          const mutationAttempts = new Set<string>();
          try {
            // All validations passed; write files and display counts
            const writeTotals = { added: 0, modified: 0, removed: 0, renamed: 0 };
            let wroteAny = false;
          for (const p of prepared) {
            // Deletions are deferred to the loop below.
            if (p.outcome !== 'write') continue;

View on GitHub (pinned to 6926ccb18a)