Fission-AI/OpenSpec · error · StoreError

store_setup_path_changed

store_setup_path_changed

Error message

The path ${storeRoot} was created while setup was waiting for confirmation.

What it means

Thrown by setupPreparedStore during execution when the directory facts asserted at prepare time no longer hold: the store path appeared on disk while the plan waited for interactive confirmation. The prepared plan and its rollback points are stale, so execution aborts instead of guessing.

Solutions

  1. Remove or inspect whatever created the path, then re-run prepare and setup
  2. Re-run 'openspec store setup' to build a fresh plan against current disk state
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/core/store/operations.ts:593 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/34635e9b9a471316. Report an issue: GitHub.

Appendix: source

Thrown at src/core/store/operations.ts:593

  prepared: PreparedStoreSetup,
  input: Pick<SetupStoreInput, 'initGit'> = {}
): Promise<StoreMutationResult> {
  const plan: StoreSetupPlan = {
    id: prepared.id,
    storeRoot: prepared.root,
    kind: prepared.rootKind,
    registry: prepared.registry,
    ...(prepared.backend ? { backend: prepared.backend } : {}),
  };
  const { id, storeRoot, kind, registry } = plan;
  let { backend } = plan;

  // The prepare/execute split can span an unbounded interactive
  // confirmation. Re-assert the prepare-time directory facts: if the
  // path appeared in the gap, the plan (and its rollback policy) no
  // longer describes reality - refuse and let a rerun re-prepare.
  if (kind === 'missing' && (await fs.access(storeRoot).then(() => true, () => false))) {
    throw new StoreError(
      `The path ${storeRoot} was created while setup was waiting for confirmation.`,
      'store_setup_path_changed',
      {
        target: 'store.root',
        fix: 'Rerun openspec store setup to re-evaluate the directory.',
      }
    );
  }

  const createdFiles: string[] = [];
  let createdPaths: CreatedPathLedgerEntry[] = [];
  let gitInitialized = false;
  let committed = false;

  // Reruns for an already-registered store stay strict no-ops: no anchor
  // retrofit, no git init, no new commit, no identity requirement. Only an
  // explicit --init-git overrides that for the git side.
  const alreadyRegisteredHere = isRegisteredAtPath(registry, id, storeRoot);

View on GitHub (pinned to 6926ccb18a)