Fission-AI/OpenSpec · error

The store declaration in

Error message

The store declaration in ${pointer.filePath} is invalid (${storePointerProblem(pointer.malformed)}). Fix or remove the store: line before running openspec init.

What it means

Init-time pointer guard: the nearest openspec directory declares a store: line, but that declaration is malformed, so OpenSpec cannot tell whether planning is externalized. Init refuses before any cleanup, migration, or prompt runs.

Solutions

  1. Open the config file at the reported path and fix or delete the malformed store: line
  2. Ensure the store value is a valid non-empty reference
  3. Re-run openspec init
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/core/init.ts:201 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25). Data as JSON: /api/errors/fb104d93c3caa8ed. Report an issue: GitHub.

Appendix: source

Thrown at src/core/init.ts:201

    const openspecDir = OPENSPEC_DIR_NAME;
    const openspecPath = path.join(projectPath, openspecDir);

    // Validation happens silently in the background
    const extendMode = await this.validate(projectPath, openspecPath);

    // Pointer guard (slice 3.2): a config-only openspec/ with a store:
    // declaration is externalized planning, not a root to extend — and a
    // subdirectory of such a repo must not silently grow a nested root.
    // Refuse before legacy cleanup, migration, or prompts touch anything.
    // In extend mode the walk finds projectPath itself; otherwise it
    // finds the nearest ancestor root (so pointer-repo subdirectories
    // refuse exactly where a normal command would resolve the pointer).
    const guardRoot = findRepoPlanningRootSync(projectPath);
    if (guardRoot) {
      const { hasPlanningShape, pointer } = classifyOpenSpecDir(guardRoot);
      if (!hasPlanningShape) {
        if (pointer.malformed) {
          throw new Error(
            `The store declaration in ${pointer.filePath} is invalid (` +
              storePointerProblem(pointer.malformed) +
              `). Fix or remove the store: line before running openspec init.`
          );
        }
        if (pointer.value !== undefined) {
          throw new Error(
            `This repo's planning is externalized to store '${pointer.value}' (${pointer.filePath}). ` +
              `Remove the store: line first to convert this repo to a local OpenSpec root.`
          );
        }
      }
    }

    await this.assertLanguageCanBeApplied(projectPath, openspecPath);

    // Check for legacy artifacts and handle cleanup
    const deferredLegacyCleanup = await this.handleLegacyCleanup(projectPath, extendMode);

View on GitHub (pinned to 6926ccb18a)