{
  "name": "@opensip-cli/graph",
  "version": "0.8.5",
  "license": "Apache-2.0",
  "description": "Static call-graph + dead-end analysis (seven-stage pipeline)",
  "keywords": [
    "opensip-cli",
    "static-analysis",
    "code-quality",
    "call-graph",
    "dependency-graph",
    "code-analysis",
    "architecture"
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/opensip-ai/opensip-cli.git",
    "directory": "packages/graph/engine"
  },
  "homepage": "https://github.com/opensip-ai/opensip-cli",
  "bugs": {
    "url": "https://github.com/opensip-ai/opensip-cli/issues"
  },
  "type": "module",
  "main": "./dist/index.js",
  "types": "./dist/index.d.ts",
  "exports": {
    ".": "./dist/index.js",
    "./internal": "./dist/internal.js",
    "./read": "./dist/read/index.js"
  },
  "files": [
    "dist",
    "LICENSE",
    "NOTICE"
  ],
  "opensipTools": {
    "kind": "tool",
    "id": "graph",
    "identity": {
      "name": "graph"
    },
    "stableId": "3873f1c2-02a9-4719-930a-bca74b62b706",
    "apiVersion": 1,
    "requires": [
      {
        "resource": "filesystem",
        "reason": "Reads source/config files and writes graph cache, baselines, reports, profiles, and worker specs"
      },
      {
        "resource": "subprocess",
        "reason": "Runs live-build and sharded-build worker subprocesses for graph analysis"
      }
    ],
    "commands": [
      {
        "name": "graph",
        "description": "Run static call-graph analysis (rules, entry points, catalog summary in one report)",
        "aliases": [],
        "commonFlags": [
          "json",
          "cwd",
          "quiet",
          "verbose",
          "debug",
          "reportTo",
          "apiKey",
          "open"
        ],
        "options": [
          {
            "flag": "--no-cache",
            "description": "Skip catalog cache (force full rebuild)",
            "negatable": true
          },
          {
            "flag": "--resolution",
            "value": "<mode>",
            "description": "Edge resolution tier: exact (semantic) or fast (syntactic, no type checker)",
            "default": "exact",
            "choices": [
              "exact",
              "fast"
            ]
          },
          {
            "flag": "--recipe",
            "value": "<name>",
            "description": "Run a named recipe (a subset of graph rules). Default: all rules"
          },
          {
            "flag": "--show",
            "value": "<session>",
            "description": "Replay a stored graph session by id, or latest for the latest graph session"
          },
          {
            "flag": "--gate-save",
            "description": "Architecture-gate: save current findings as baseline in the project SQLite store (mutually exclusive with --gate-compare)",
            "default": false
          },
          {
            "flag": "--gate-compare",
            "description": "Architecture-gate: compare current findings against the saved baseline; exit 1 on regression",
            "default": false
          },
          {
            "flag": "--profile",
            "value": "<path>",
            "description": "Write graph performance profile JSON to path"
          },
          {
            "flag": "--workspace",
            "description": "Fan out across detected workspace units (memory-isolated; polyglot)",
            "default": false
          },
          {
            "flag": "--exact",
            "description": "Use the single-program exact build engine instead of the default parallel sharded engine (both resolve through one shared model — exact = the 1-shard case — held equivalent by the directional equivalence guardrail; --exact suits small/single-package repos).",
            "default": false
          },
          {
            "flag": "--concurrency",
            "value": "<n>",
            "description": "Concurrency cap for --workspace and the sharded build (default: cpus()-1)"
          },
          {
            "flag": "--language",
            "value": "<name>",
            "description": "Force a specific language adapter (suppresses auto-detection)"
          },
          {
            "flag": "--list-files",
            "description": "List the source files graph would discover for this scope and exit (no build; honors [paths...], --workspace, --language, --json)",
            "default": false
          },
          {
            "flag": "--filter",
            "value": "<filter>",
            "description": "Agent filter (repeatable): errors-only, warnings-only, category:<name>, source:<slug>, file:<path>, high-impact, top:<n>",
            "arrayDefault": []
          },
          {
            "flag": "--top",
            "value": "<n>",
            "description": "Limit returned signals (sugar for --filter top:<n>)"
          },
          {
            "flag": "--raw",
            "description": "Emit unwrapped payload (no CommandOutcome wrapper)",
            "default": false
          },
          {
            "flag": "--sarif",
            "value": "<path>",
            "description": "Also write this run findings as SARIF 2.1.0. Composes with --gate-save; written even when the gate fails."
          }
        ],
        "args": [
          {
            "name": "paths",
            "variadic": true,
            "optional": true,
            "description": "Subtrees to analyze (default: whole project)"
          }
        ],
        "scope": "project",
        "output": "raw-stream",
        "rawStreamReason": "runtime-render-dispatch",
        "producesVerdict": true
      },
      {
        "name": "graph-shard-worker",
        "description": "[internal] Build one shard from a spec file and emit a ShardBuildResult JSON (spawned by the sharded build)",
        "visibility": "internal",
        "commonFlags": [
          "cwd"
        ],
        "options": [
          {
            "flag": "--config",
            "value": "<path>",
            "description": "Resolved project config inherited from the parent run"
          }
        ],
        "args": [
          {
            "name": "specPath",
            "description": "Path to a JSON ShardWorkerSpec file"
          }
        ],
        "scope": "project",
        "output": "raw-stream",
        "rawStreamReason": "worker-ipc"
      },
      {
        "name": "graph-run-worker",
        "description": "[internal] Run the graph build headless and stream progress + result over IPC (forked by the live view)",
        "visibility": "internal",
        "commonFlags": [
          "cwd"
        ],
        "options": [
          {
            "flag": "--config",
            "value": "<path>",
            "description": "Resolved project config inherited from the parent run"
          }
        ],
        "args": [
          {
            "name": "specPath",
            "description": "Path to a JSON graph build-spec file"
          }
        ],
        "scope": "project",
        "output": "raw-stream",
        "rawStreamReason": "worker-ipc"
      },
      {
        "name": "export",
        "description": "Export graph analysis artifacts: --format sarif (SARIF v2.1.0 findings), catalog (CatalogExport JSON), or baseline (gate fingerprint JSON)",
        "parent": "graph",
        "commonFlags": [
          "cwd",
          "json"
        ],
        "options": [
          {
            "flag": "--format",
            "value": "<fmt>",
            "description": "Export artifact: sarif | catalog | baseline",
            "required": true,
            "choices": [
              "sarif",
              "catalog",
              "baseline"
            ]
          },
          {
            "flag": "--output-sarif",
            "value": "<path>",
            "description": "Output file path for the SARIF v2.1.0 document"
          },
          {
            "flag": "--catalog-output",
            "value": "<path>",
            "description": "Output file path for the CatalogExport JSON"
          },
          {
            "flag": "--tenant-id",
            "value": "<id>",
            "description": "Tenant scope stamped on every row + provenance"
          },
          {
            "flag": "--repo-id",
            "value": "<id>",
            "description": "Repository scope stamped on every row"
          },
          {
            "flag": "--git-sha",
            "value": "<sha>",
            "description": "Commit SHA the catalog was extracted at"
          },
          {
            "flag": "--run-id",
            "value": "<uuid>",
            "description": "Run id for provenance (auto-generated if absent)"
          },
          {
            "flag": "--mode",
            "value": "<mode>",
            "description": "'initial' (full rebuild) or 'incremental' (reuse cache when present)",
            "default": "initial"
          },
          {
            "flag": "--changed-file",
            "value": "<relPath>",
            "description": "Changed file (repeatable). Advisory today — the engine derives the true changed set from fingerprint diffs; recorded for observability.",
            "arrayDefault": []
          },
          {
            "flag": "--language",
            "value": "<name>",
            "description": "Force a specific language adapter (suppresses auto-detection)"
          },
          {
            "flag": "--resolution",
            "value": "<mode>",
            "description": "Edge resolution tier: exact (semantic) or fast (syntactic, no type checker)",
            "default": "exact",
            "choices": [
              "exact",
              "fast"
            ]
          },
          {
            "flag": "--out",
            "value": "<path>",
            "description": "Output file path for the JSON baseline"
          }
        ],
        "scope": "project",
        "output": "raw-stream",
        "rawStreamReason": "file-export"
      },
      {
        "name": "recipes",
        "description": "List available graph recipes",
        "parent": "graph",
        "commonFlags": [
          "json"
        ],
        "scope": "project",
        "output": "command-result"
      },
      {
        "name": "lookup",
        "description": "Look up function occurrences by simple name from the persisted catalog",
        "parent": "graph",
        "commonFlags": [
          "json",
          "cwd"
        ],
        "args": [
          {
            "name": "name",
            "description": "Function simple name to look up (e.g. \"saveBaseline\")"
          }
        ],
        "scope": "project",
        "output": "command-result"
      },
      {
        "name": "index",
        "description": "Emit a symbolindex.json artifact (name→file:line and file→names); --build refreshes the catalog first",
        "parent": "graph",
        "commonFlags": [],
        "options": [
          {
            "flag": "--build",
            "description": "Run the graph pipeline to refresh the catalog before emitting the index",
            "default": false
          },
          {
            "flag": "--cwd <path>",
            "description": "Target directory (out path resolves against this)"
          },
          {
            "flag": "--out",
            "value": "<path>",
            "description": "Output file path",
            "default": "symbolindex.json"
          }
        ],
        "scope": "project",
        "output": "raw-stream",
        "rawStreamReason": "file-export"
      },
      {
        "name": "list",
        "description": "List available graph rules",
        "parent": "graph",
        "commonFlags": [
          "cwd",
          "json"
        ],
        "scope": "project",
        "output": "command-result"
      },
      {
        "name": "impact",
        "description": "Analyze what changed and what depends on it (git --changed/--since or explicit --files)",
        "parent": "graph",
        "commonFlags": [
          "cwd",
          "json"
        ],
        "options": [
          {
            "flag": "--changed",
            "description": "Use git working-tree / branch diff for changed files",
            "default": false
          },
          {
            "flag": "--since",
            "value": "<ref>",
            "description": "Git ref base (diff <ref>...HEAD); implies changed semantics"
          },
          {
            "flag": "--files",
            "value": "<path>",
            "description": "Explicit changed file (repeatable; git-free)",
            "arrayDefault": []
          },
          {
            "flag": "--top",
            "value": "<n>",
            "description": "Cap impacted function count"
          },
          {
            "flag": "--raw",
            "description": "Emit unwrapped payload (no CommandOutcome wrapper)",
            "default": false
          },
          {
            "flag": "--no-cache",
            "description": "Force catalog rebuild before impact analysis",
            "default": false
          }
        ],
        "scope": "project",
        "output": "raw-stream",
        "rawStreamReason": "runtime-render-dispatch",
        "producesVerdict": true
      },
      {
        "name": "graph-equivalence-check",
        "description": "[internal] Verify the sharded build is byte-equivalent to the exact build on a real repo (gates production edge divergence against a committed budget)",
        "visibility": "internal",
        "commonFlags": [],
        "options": [
          {
            "flag": "--cwd <path>",
            "description": "Target repo root to check (default: current directory)"
          },
          {
            "flag": "--budget",
            "value": "<path>",
            "description": "Path to the committed budget JSON (relative to cwd or absolute)",
            "default": ".config/graph-equivalence-budget.json"
          },
          {
            "flag": "--update-budget",
            "description": "Rewrite the budget file to the observed production divergence count (capture/tighten); always exits 0"
          }
        ],
        "scope": "project",
        "output": "raw-stream",
        "rawStreamReason": "diagnostic-gate"
      },
      {
        "name": "graph-context-inventory",
        "description": "[internal] Persist bounded project inventory context evidence",
        "visibility": "internal",
        "commonFlags": [
          "cwd"
        ],
        "scope": "project",
        "output": "raw-stream",
        "rawStreamReason": "host-orchestrated-evidence",
        "producesEvidenceSnapshot": true
      },
      {
        "name": "graph-context-ensure",
        "description": "[internal] Reuse or rebuild one current graph context generation",
        "visibility": "internal",
        "commonFlags": [
          "cwd"
        ],
        "scope": "project",
        "output": "raw-stream",
        "rawStreamReason": "host-orchestrated-evidence",
        "producesEvidenceSnapshot": true
      },
      {
        "name": "graph-context-select-tests",
        "description": "[internal] Persist static test-selection context for explicit files",
        "visibility": "internal",
        "commonFlags": [
          "cwd"
        ],
        "options": [
          {
            "flag": "--files",
            "value": "<path>",
            "description": "Explicit changed file (repeatable; project-relative)",
            "arrayDefault": []
          }
        ],
        "scope": "project",
        "output": "raw-stream",
        "rawStreamReason": "host-orchestrated-evidence",
        "producesEvidenceSnapshot": true
      }
    ],
    "capabilities": [
      {
        "id": "graph-adapter",
        "apiVersion": 1,
        "contributionKind": "module-export",
        "contributionSchema": {
          "requiredKeys": [
            "id"
          ]
        },
        "discovery": {
          "discovery": {
            "mode": "marker",
            "markerKind": "graph-adapter"
          },
          "exportName": "adapter",
          "exportShape": "single",
          "configKeys": {
            "packages": "graphAdapters",
            "autoDiscover": "autoDiscoverGraphAdapters"
          },
          "builtinScope": "@opensip-cli"
        },
        "minSupportedApiVersion": 1
      }
    ]
  },
  "dependencies": {
    "@opentelemetry/api": "^1.9.1",
    "commander": "^15.0.0",
    "drizzle-orm": "^0.45.2",
    "glob": "^13.0.0",
    "minimatch": "^10.2.5",
    "react": "^19.2.7",
    "zod": "^4.4.3",
    "@opensip-cli/cli-ui": "0.8.5",
    "@opensip-cli/cli-live": "0.8.5",
    "@opensip-cli/clone-detection": "0.8.5",
    "@opensip-cli/config": "0.8.5",
    "@opensip-cli/contracts": "0.8.5",
    "@opensip-cli/datastore": "0.8.5",
    "@opensip-cli/core": "0.8.5",
    "@opensip-cli/session-store": "0.8.5",
    "@opensip-cli/shared-analysis": "0.8.5",
    "@opensip-cli/codebase": "0.8.5"
  },
  "devDependencies": {
    "@types/node": "^24.13.3",
    "@types/react": "^19.2.17",
    "typescript": "~6.0.3",
    "vitest": "^4.1.10",
    "@opensip-cli/output": "0.8.5"
  },
  "scripts": {
    "build": "tsc",
    "test": "vitest run --passWithNoTests",
    "typecheck": "tsc --noEmit",
    "clean": "rm -rf dist"
  }
}