# Growth Monorepo Ontology — Schema

> Schema for `ontology.json`. Generated 2026-05-26.

## Node types

| Type | What it represents | Example |
|---|---|---|
| `Repo` | The monorepo root | `growth` |
| `Domain` | Top-level conceptual area | `infrastructure`, `ai-ml`, `content-mmo`, `trading-quant`, `learning-lingua`, `web-platforms`, `research` |
| `Platform` | Peer-level consolidated stack | `mmo`, `quant`, `lingua` |
| `Component` | Sub-deployable inside a Platform | `mmo/api`, `mmo/web`, `quant/agentic` |
| `Service` | Independently deployable under `services/<name>/` | `keycloak`, `omniroute`, `nginx` |
| `Project` | Applied app under `projects/<name>/` | `portfolio`, `trader`, `telegrambot` |
| `Library` | Shared lib | `common/src`, `common/proto` |
| `Module` | Sub-library (e.g., AI vertical) | `common/ai/automl`, `common/ai/vision` |
| `Language` | Programming language | `python`, `go`, `typescript`, `rust`, `jvm` |
| `BuildSystem` | Toolchain | `bazel`, `pnpm`, `uv`, `cargo`, `go-modules`, `make`, `skaffold` |
| `DataStore` | Persistent backing store | `postgres-cnpg`, `redis`, `minio`, `sqlite-local` |
| `OSS` | Upstream OSS being wrapped | `bitnami/keycloak`, `ingress-nginx`, `cilium` |
| `ExternalAPI` | Third-party API touched by code | `youtube-data-v3`, `tiktok-content`, `meta-graph`, `anthropic`, `openai`, `google-gemini` |
| `IngressDomain` | Public DNS surface | `mmo.toandaominh1997.com`, `quant.toandaominh1997.com` |
| `Cluster` | Kubernetes cluster | `phuck3s` |
| `Node` | Cluster node | `thomas`, `en`, `mch-mcp` |
| `Concept` | Non-code architectural concept | `layered-deploy`, `omniroute-routing`, `auth-via-oauth2-proxy` |

## Edge types

| Edge | From → To | Meaning |
|---|---|---|
| `contains` | Repo/Domain → child | Hierarchical containment |
| `deploys_via` | Service/Component → BuildSystem(skaffold) | How it ships |
| `wraps` | Service → OSS | Helm wrapper around upstream |
| `extends_chart` | Service → `services/base` | Helm parent chart |
| `written_in` | Component → Language | Implementation language |
| `built_by` | Component → BuildSystem | Build toolchain |
| `depends_on` | Component → Library/Component | Code dependency |
| `integrates_with` | Component → ExternalAPI | Calls third-party API |
| `routes_through` | Component → Service(omniroute) | LLM traffic via proxy |
| `uses_datastore` | Component → DataStore | Reads/writes persistent data |
| `exposes` | Service → IngressDomain | Public DNS |
| `auth_via` | Service → Service(oauth2-proxy) | Authentication chain |
| `pinned_to` | Service → Node | Node selector pin (per `feedback_phuck3s_pin_to_thomas`) |
| `realizes` | Service/Component → Concept | Implements a pattern |

## JSON shape

```json
{
  "version": "1.0",
  "generated_at": "2026-05-26",
  "repo": "growth",
  "nodes": [
    {"id": "service:keycloak", "type": "Service", "name": "keycloak",
     "path": "services/keycloak/", "category": "identity-auth",
     "purpose": "...", "language": null, "wraps": "bitnami/keycloak"}
  ],
  "edges": [
    {"from": "service:keycloak", "to": "ingress:auth.toandaominh1997.com", "type": "exposes"}
  ]
}
```

Node IDs are `<type-lowercase>:<slug>` with `/` allowed for nested components (e.g., `component:mmo/api`).
