← rathvan

Rathvan Architecture

Rathvan · architecture review

One kernel, three gates, every integration behind a port

Generated from this repository every time the site is built, so every count below is the current one and not the one that happened to be true when somebody typed it: kernel 1825, builder service 1291, each read from the known-good file that testCounts ratchets — a task that cannot report success without running.

System context

The console and CLI are clients; the builder service hosts the kernel; every external system sits behind a port with a stub beside each live adapter.

Kernel (library, adopted by products)
Builder service (Java 21, no framework)
Clients
SourceControlPort
WorkTrackerPort
NotificationChannelPort
capabilities · gates · RLS-forced schema
AiRouter · FieldCipher · PiiScan
AutoRemediation · Impersonation
Named operations
login · workflows · mcpTools
assistant · registerClient
Identity
operator token → user creds
SAML · Google · DCR
TokenBudget
Console
build.rathvan.com
rathvan CLI
Agents via MCP/DCR
Postgres
additive migrations only
GitHub
draft PRs
Jira
gate mirror
WhatsApp
notifications
Anthropic
models

The pipeline: 13 stages, 3 human gates

every decision mirrors to Jira,
actor recorded
every decision mirrors to Jira,
actor recorded
every decision mirrors to Jira,
actor recorded
Sentence
Intake
PRD
◆ Gate 1
agreement
Design
Build
Verify
◆ Gate 2
staging
◆ Gate 3
readiness
Production
tracker

Identity: five doorways, one revocable registry

Operator
BUILDER_TOKEN
mint
SAML assertion
pinned cert, single-use
rotate + mint
Google OIDC
JWKS-verified
RFC 7591 DCR
CLOSED by default
client credentials
UserRegistry
hashes only · revoke by prefix
server-asserted actor
workflow actions
audited, double-attributed
impersonation time-boxed

Layered adoption model

LayerHoldsRetrofit cost
L0 foundationsidentity · tenancy · RLS · audit · money-minor-units · flagsvery high — must exist in migration 1
L1 capabilitiesauth · profile · notification · storage · ports/registryhigh
L2 relationshipclient/professional · payments seam · email · approvals · integrationsmoderate
L3 verticalsthe actual product (e.g. CRM funnel — PROPOSED until Gate 1)low — scaffolded per product

Invariants — enforced by tests and DDL, not by review

InvariantEnforcement
RLS enabled and forced on every user-data tablegate test scans every migration for the pair
Migrations additive only, contiguously numberedchecksummed; gate test fails on a gap
Feature flags default OFF and registeredregistry map; unregistered = permanently inert
Money is an integer in the smallest unitDDL + kernel types; no float path exists
PII never logged or sent to a modelPiiScan (masked findings, redact()) + FieldCipher (AES-GCM, column-bound)
Production branch unreachable by machinesSourceControlPort refuses main at construction
AI spend boundedTokenBudget is a meter decorator — no call site can skip it
A test count below known-good fails the buildtestCounts; a shrunken suite renders FAILED in evidence reports

Deliberate seams (port exists, adapter is BYO): search, queue/messaging, payments gateways, observability backend. Deliberately refused: docs rendering, SDK generation, a Backstage-rivaling catalogue, A/B testing.

Live demo — a real first run, nothing mocked

Recorded from Chrome on 2026-08-14, and showing the intake as it stood that day: one sentence starts it, 23 gated questions, sign-in with a personal revocable credential, and a workflow honest about what was simulated. This is the system above, operating.

Second cut, narrated (2 min), covering the pipeline and this release's capabilities:

Presentation deck

Six slides for the review itself — present full-screen; each fills the viewport.

1 / 6 · the problem

Most code is now written by agents. Nothing makes it follow your method.

Prompt-to-app tools are fast to a demo and silent on production. Portals catalogue what exists and cannot create it. The gap: a control plane where agents build inside the rules — reuse enforced, security structural, humans at the gates.

2 / 6 · the approach

The method is data. The rules are tests.

3 / 6 · architecture

One kernel, adopted by products. Every integration behind a port.

4 / 6 · identity & security

Five doorways. One revocable registry.

5 / 6 · verification

1825 + 1291 tests. Counted, never assumed.

6 / 6 · roadmap

Free & open source. The enterprise tier is the control plane.