Fission-AI/OpenSpec · error · Error
Change ' ' not found. Available changes
Error message
Change '${changeName}' not found. Available changes:
${available.join('\n ')} What it means
Not-found branch of validateChangeExists: the named change has no directory under the changes dir, but other changes do exist, so the error enumerates them. Means a typo'd or stale change name, not an empty workspace.
Solutions
- Use one of the listed available change IDs
- Verify the change name spelling
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/commands/workflow/shared.ts:221 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/99ea4a930b560811.
Report an issue: GitHub.
Appendix: source
Thrown at src/commands/workflow/shared.ts:221
// Validate change name format to prevent path traversal
const lookupError = validateChangeLookupName(changeName);
if (lookupError) {
throw new Error(`Invalid change name '${changeName}': ${lookupError}`);
}
// Check directory existence directly
const changePath = path.join(changesDir, changeName);
const exists = fs.existsSync(changePath) && fs.statSync(changePath).isDirectory();
if (!exists) {
const available = await getAvailableChanges(projectRoot, changesDir);
if (available.length === 0) {
throw new Error(
`Change '${changeName}' not found. No changes exist. Create one with: ${newChangeHint}`
);
}
throw new Error(
`Change '${changeName}' not found. Available changes:\n ${available.join('\n ')}`
);
}
return changeName;
}
/**
* Validates that a schema exists and returns available schemas if not.
*
* @param schemaName - The schema name to validate
* @param projectRoot - Optional project root for project-local schema resolution
*/
export function validateSchemaExists(schemaName: string, projectRoot?: string): string {
const schemaDir = getSchemaDir(schemaName, projectRoot);
if (!schemaDir) {
const availableSchemas = listSchemas(projectRoot);
throw new Error(View on GitHub (pinned to 6926ccb18a)