The engine
KERN starts as compact .kern source, becomes a structured IR, and then flows into compiler targets, review rules, MCP tools, tests, and language-evolution workflows.
The important part is not a template string. It is the shared semantic layer: nodes, props, types, routes, effects, guards, confidence, and evidence survive across tools.
Why it works
The parser accepts an indentation-based language with key=value props, style shorthands, typed nodes, handlers, machines, routes, MCP tools, tests, and evolved node hints. Review and compile both consume the same structured tree.
Review can distinguish reads, writes, network calls, auth, validation, and recovery paths instead of only matching text.
Target support is explicit: native, lowered, or unsupported by feature and position, so the compiler can be honest about what emits cleanly.
Parse diagnostics, review confidence, suppression metadata, and evidence spans make findings easier to audit and automate.
Compile
Each target has its own emitter path. Some features compile natively, some lower to runtime helpers, and some are intentionally marked unsupported until the target can emit them correctly.
shared TypeScript library output
Next.js App Router pages and routes
React output with Tailwind classes
React web components
React Native output
Node/Express APIs
command-line apps
ANSI terminal UI
React terminal UI
Vue 3 SFCs
Nuxt pages and routes
Python FastAPI services
Model Context Protocol servers
portable Python lowering
portable Go lowering
Review engine
The review package builds file context, import graphs, call graphs, concept maps, taint flows, public API maps, quality rules, and confidence graphs. That is why it can report problems like unguarded effects or route contract drift with evidence.
reviewDirectory()
build context graph
extract TS/Python concepts
analyze taint flows
run active rule layers
group by root cause
assign confidence
emit report / SARIFevolve(input)
collect TS files
detect gaps
analyze patterns
propose templates
validate proposals
stage approved outputEvolve
kern evolve is an experimental pipeline for detecting recurring TypeScript patterns, proposing templates or structural nodes, validating them, and staging the result for approval.
Proof
The landing app keeps .kern sources beside generated Next files, uses the compiler target for app routes, and ships the result as a normal Next.js site.