OpenFoundry is an open-source operational data platform ā a Go monorepo of microservices plus a React frontend, organized around the same capability model as Palantir Foundry's documentation (datasets, ontology, applications, AI/ML, governance, observability).
Working with this codebase as an AI agent? Start at
CLAUDE.md. It's the canonical onboarding for agents (commands, conventions, security-critical zones, what NOT to read) and is kept tighter than this README on purpose.
openfoundry/
āāā apps/web/ React 19 + Vite + TypeScript frontend
āāā services/ 41 Go microservices (one binary per dir, copy services/template/)
āāā libs/ 32 shared Go packages (auth, observability, kernels, ā¦)
āāā proto/ Protobuf source of truth (Go generated to libs/proto-gen/)
āāā sdks/ Generated SDKs (TS/Python/Java)
āāā infra/ Helm, ArgoCD, Terraform, runbooks
āāā docs/ VitePress capability-oriented docs site
āāā docs/archive/ Historical migration logs (do not load by default)
āāā tools/ CLIs (of-cli, route-audit, lint helpers)
āāā go.mod Single module for the whole monorepo
āāā Makefile Canonical task runner
āāā .golangci.yml Lint config (schema v2)
Per-service shape (uniform ā copy services/template/):
services/<svc>/
cmd/<svc>/main.go entrypoint
internal/server/ chi router (/healthz, /metrics, /api)
internal/handlers/ HTTP handlers
internal/domain/ pure logic
internal/repo/ data access (sqlc-generated when relevant)
internal/repo/migrations/ goose-style SQL migrations
internal/models/ wire types
internal/config/ koanf-backed config
The repository is intentionally a single Go module (go.mod at the
root) rather than a go.work multi-module setup:
libs/ and services/.Splitting individual services into their own modules is reversible.
Run from the repo root. The Makefile is canonical; a justfile is
provided as a thin shim over make for muscle memory.
make tools # one-off: install buf, golangci-lint, sqlc, gofumpt to ./bin
make ci # tidy + vet + lint + test (full local CI gate)
make test # fast unit tests (-race + coverage, no Docker)
make test-integration # tests behind //go:build integration (needs Docker)
make gen # regen proto Go + sqlc
make build # compile every package
make build-services # one binary per service into ./bin/
make lint # golangci-lint
make fmt # gofumpt + gci
Frontend (apps/web/):
pnpm --filter @open-foundry/web dev # vite dev server
pnpm --filter @open-foundry/web check # tsc -b --noEmit
pnpm --filter @open-foundry/web test # vitest
errors.Is-style sentinels at package scope
(ErrNotFound, ErrPreconditionFailed, ā¦); HTTP layer maps them.models.Page[T] and
models.ListResponse[T]. Cursor pagination uses next_cursor.libs/auth-middleware.
Read claims from r.Context() via the lib helpers; never parse JWT
in handlers.libs/observability for slog + OTel + Prometheus.
Each service exposes /metrics; do not re-register globals.integration build tag and the
helpers in libs/testing/ (testcontainers).*Handlers, *AppState); avoid
package-level globals.These contracts are pinned by golden tests in
libs/core-models/**/*_test.go and must not drift:
/healthz payload shape (status, service, version, timestamp).ri.foundry.main.dataset.<uuid-v7>.open|committed|aborted,
snapshot|append|update|delete).{"kind": "direct"} / {"kind": "inherited_from_upstream", ...}).mediaSetRid, mediaItemRid, branch, schema).{"type": "DECIMAL", "precision": ā¦, "scale": ā¦}).CLAUDE.md ā agent-facing onboarding (concise).ARCHITECTURE.md ā high-level architecture overview.docs/ ā capability-oriented technical documentation
(VitePress); start at docs/index.md.docs/architecture/adr/ ā numbered, dated
architectural decisions with supersession tracking.docs/archive/ ā historical migration logs and
superseded design docs. Do not load these by default; they exist for
audit only.CLAUDE.md files inside large libs and services (e.g.
libs/ontology-kernel/CLAUDE.md).See CONTRIBUTING.md for the PR process, RFC
requirements, and DCO policy. Security reports follow
SECURITY.md.
OpenFoundry is licensed under AGPL-3.0-only (see LICENSE).