Polychro — deterministic linting engine for spec-driven development
Validates semi-structured specifications such as YAML, JSON, XML, Markdown, and HTML through composable layers — well-formedness, schema-model, ruleset, and format-aware validation in a single, embeddable pipeline with sub-second latency.
Designed for AI agent loops where non-deterministic generation needs deterministic guardrails. Apache 2.0 licensed.
Features
CLI
Single binary — lint any YAML / JSON / XML / Markdown / HTML spec from the command line.
MCP Server Mode
Expose linting as MCP tools for AI agent consumption.
Native Executable
Standalone binaries for Linux, macOS, and Windows — no JVM required.
GitHub Action
Lint specs in CI with structured SARIF output.
Spectral-Format Rulesets
Execute governance rulesets with given/then semantics.
Polyglot Custom Functions
JavaScript, Python, and Groovy custom functions via sandboxed GraalVM.
Java Custom Functions
Native RuleFunction SPI — fastest path, no GraalVM required.
Schema-Model Validation
Formal document models including JSON Schema Draft 2020-12 and JSON Structure.
Well-Formedness Validation
Duplicate keys, encoding, depth limits, YAML-specific traps.
Format-Aware Validation
Heading hierarchy, internal links, relative file references, HTML structure / accessibility / security, and other document-specific checks.
Unified Diagnostics
All validators produce the same Diagnostic format — one pipeline, one output.
Embeddable Java API
In-process linting for JVM applications — no subprocess, no Node.js.
SDK Clients
Idiomatic wrappers for Go, Node.js / TypeScript, and Python over the native binary.
Pluggable SPI
Add custom validators via ServiceLoader — zero framework coupling.
Quick start
CLI
polychro lint my-spec.yml
polychro lint --ruleset polychro:governance my-spec.yml
polychro lint --validator html=email welcome-email.html
polychro lint --format agent my-spec.yml
MCP Server
polychro serve --ruleset polychro:ai-safety
Lint your specs with Polychro
Apache 2.0, native binaries, MCP server mode. Start with the README on GitHub or follow the Shipyard tutorials.