Fission-AI/OpenSpec · error · SchemaValidationError

Invalid dependency reference in artifact '${artifact.id}': '

Error message

Invalid dependency reference in artifact '${artifact.id}': '${req}' does not exist

What it means

Error "Invalid dependency reference in artifact '${artifact.id}': '${req}' does not exist" thrown in Fission-AI/OpenSpec.

Source

Thrown at src/core/artifact-graph/schema.ts:69

  const seen = new Set<string>();
  for (const artifact of artifacts) {
    if (seen.has(artifact.id)) {
      throw new SchemaValidationError(`Duplicate artifact ID: ${artifact.id}`);
    }
    seen.add(artifact.id);
  }
}

/**
 * Validates that all `requires` references point to valid artifact IDs.
 */
function validateRequiresReferences(artifacts: Artifact[]): void {
  const validIds = new Set(artifacts.map(a => a.id));

  for (const artifact of artifacts) {
    for (const req of artifact.requires) {
      if (!validIds.has(req)) {
        throw new SchemaValidationError(
          `Invalid dependency reference in artifact '${artifact.id}': '${req}' does not exist`
        );
      }
    }
  }
}

/**
 * Validates that there are no cyclic dependencies.
 * Uses DFS to detect cycles and reports the full cycle path.
 */
function validateNoCycles(artifacts: Artifact[]): void {
  const artifactMap = new Map(artifacts.map(a => [a.id, a]));
  const visited = new Set<string>();
  const inStack = new Set<string>();
  const parent = new Map<string, string>();

  function dfs(id: string): string | null {

View on GitHub (pinned to 6926ccb18a)

When it happens

Trigger: Thrown at src/core/artifact-graph/schema.ts:69 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/3201de356797c3b8. Report an issue: GitHub.