> ## Documentation Index
> Fetch the complete documentation index at: https://opm.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture Overview

> Monorepo structure and data flow.

# Architecture Overview

OPM is a monorepo. The flow is: **CLI → Scanner → LLM providers → Contract → Base Sepolia**.

## Packages

| Package | Purpose |
| - | - |
| `packages/core` | Types, constants, prompts, benchmarks, risk classification |
| `packages/scanner` | Agent runner, LLM client, scan queue, benchmark runner, ZK verifier |
| `packages/cli` | Ink terminal UI, commands, ENS/OSV/npm integration |
| `packages/contracts` | OPMRegistry.sol, Hardhat config, Circom circuit |
| `packages/web` | Next.js landing page |

## Data Flow

```
CLI (push/install/check)
  → Scanner (parallel agent execution)
    → LLM providers (OpenRouter / OpenAI)
    → Contract writer (submitScore, registerPackage)
      → Base Sepolia
  → npm registry (publish / install)
  → ENS (text records, contenthash)
  → Fileverse (IPFS report upload)
```

## External Services

| Service | Purpose |
| - | - |
| OpenRouter / OpenAI | LLM inference |
| OSV | CVE/GHSA lookup |
| Fileverse | IPFS report storage |
| ChainPatrol | Blocklist fallback |
| Artificial Analysis | Model intelligence indices |
| ENS | Identity resolution + text records |
| npm | Package metadata + tarball download |

## Key Entry Points

* CLI: `packages/cli/src/index.tsx`
* Scanner: `packages/scanner/src/index.ts`
* Contract: `packages/contracts/contracts/OPMRegistry.sol`
* Benchmarks: `packages/core/src/benchmarks.ts`
* ZK circuit: `packages/contracts/circuits/accuracy_verifier.circom`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.