Fission-AI/OpenSpec · error · StoreError
store_setup_non_empty_directory
store_setup_non_empty_directory
Error message
Store setup does not support initializing a non-empty folder that is not a healthy OpenSpec root.
What it means
Thrown by prepareSetupPlan when the setup path is a non-empty folder that holds no readable store metadata and is not a healthy OpenSpec root. Setup can only initialize an empty folder or adopt a valid root; anything else is treated as accidental data loss risk.
Solutions
- Empty the folder (or move its contents) before running setup
- Point setup at a different, empty path
- Initialize a healthy OpenSpec root in the folder first
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/core/store/operations.ts:516 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/ab96c5caaf70f819.
Report an issue: GitHub.
Appendix: source
Thrown at src/core/store/operations.ts:516
throw new StoreError(
`Store metadata id '${metadata.id}' does not match requested id '${id}'.`,
'store_metadata_id_mismatch',
{
target: 'store.metadata',
fix: `Use id '${metadata.id}' or choose a different setup path.`,
}
);
}
if (input.remote !== undefined) {
// Silent acceptance is the forbidden outcome: the identity file
// already exists, so --remote cannot reach the committed shape.
throw remoteRequiresHandEditError(id, storeRoot);
}
} else {
const openspecRoot = await inspectOpenSpecRoot(storeRoot);
const safeFreshDirectory = await isDirectoryEmpty(storeRoot) || await isGitOnlyDirectory(storeRoot);
if (!openspecRoot.healthy && !safeFreshDirectory) {
throw new StoreError(
'Store setup does not support initializing a non-empty folder that is not a healthy OpenSpec root.',
'store_setup_non_empty_directory',
{
target: 'store.root',
fix: 'Choose an empty folder, a Git-only folder, or an existing healthy OpenSpec root.',
}
);
}
}
backend = await resolveBackendWithObservedOrigin(storeRoot);
}
const registry = await readStoreRegistryState();
const conflictBackend = backend ?? {
type: 'git' as const,
local_path: FileSystemUtils.canonicalizeExistingPath(storeRoot),
};View on GitHub (pinned to 6926ccb18a)