Skip to main content

Lunas

tests PyPI Python License

A deterministic validator for AI-generated code. Apache 2.0.

What it does

lunas check ./path runs a 21-layer pipeline against a directory of code and reports whether the validation passes. Layers cover AST parsing, import resolution, cross-file consistency, package install, type check, test execution, design-brief fidelity, and feature coverage. 19 layers are deterministic (no model call); 2 are hybrid (an LLM verdict with a deterministic override): design_fidelity and feature_coverage.

Install

pip install lunas-validator

The Anthropic SDK is an optional extra for the LLM-using layers:

pip install "lunas-validator[anthropic]"

Or from source:

git clone https://github.com/novesteria/lunas-core.git
cd lunas
pip install -e .

Quick start

lunas check ./my-code                          # deterministic + LLM
lunas check ./my-code --no-llm                 # deterministic only
lunas check ./my-code --brief brief.json       # include design / feature layers
lunas check ./my-code --json report.json       # machine-readable report
lunas check ./my-code --exit-on-fail           # exit 1 on FAIL

The LLM-using layers (design_fidelity, feature_coverage) skip unless an ANTHROPIC_API_KEY is set and a brief.json is supplied.

What a run looks like

A static page whose JavaScript wires a #clear button that does not exist in the HTML. Five applicable layers pass, one fails, the rest skip because they target other stacks:

$ lunas check ./notes --no-llm --verbose
FAIL · 5 passed · 1 failed · 15 skipped · 0.0s · first failure: html_js_id_parity — 1 JS id reference(s) have no matching id in any HTML file
  · python_imports                      stack mismatch: ['static_html']
  ✓ css_completeness                    All 1 CSS file(s) contain real rules, directives, or custom properties
  ✓ ast_brace_balance                   All 1 JS/TS file(s) have balanced brackets
  ✓ static_imports                      All relative imports / script srcs resolve (2 file(s) scanned)
  ✗ html_js_id_parity                   1 JS id reference(s) have no matching id in any HTML file
  ✓ interactivity                       1 interactive element(s) in HTML, 2 event binding(s) in JS/HTML
  ✓ js_syntax                           node --check passed for 1 file(s)
  · npm_install                         stack mismatch: ['static_html']
  · design_fidelity                     No design brief (or empty brief) — nothing to judge
  · feature_coverage                    No design brief — no feature contract to verify

Every applicable layer reports its own verdict; the final result is the conjunction. --json report.json writes the same information as machine-readable output. Exit code is 0 unless --exit-on-fail is set.

Layers

See docs/LAYER_INDEX.md for the full list of layers, their kinds (deterministic / hybrid), and the file under lunas/checks/ that implements each one.

Benchmark

lunas-bench/ contains a cohort of reproducible cases. Each case has a brief.json, an input/ directory, an expected.json describing the validator output, and a short technical README.

python -m lunas_cli check lunas-bench/cohort/<case>/input \
    --brief lunas-bench/cohort/<case>/brief.json \
    --no-llm

See lunas-bench/METHODOLOGY.md for case structure and reproducibility rules.

Contributing

See CONTRIBUTING.md.

License

Apache License 2.0.

Maintainer

Lunas is maintained by Novesteria. Contact: hello@novesteria.com.

Metadata

Release files for lunas-validator 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lunas-validator 0.1.0
File Size Uploaded Provenance
lunas_validator-0.1.0.tar.gz 157.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for lunas-validator 0.1.0
File Interpreter ABI Platform
lunas_validator-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 269.8 kB

Release files / lunas_validator-0.1.0.tar.gz

Download URL lunas_validator-0.1.0.tar.gz
Size 157.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fb890869b5190a83f03eec07bf33d0077c5891c0f3df67a2eface8d6ba86a9cc
BLAKE2b-256 checksum
How to use checksums
ede6f3a66bad926070b7cbb02e4ce05c6eea58139c422e51062a280010da3fe1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / lunas_validator-0.1.0-py3-none-any.whl

Download URL lunas_validator-0.1.0-py3-none-any.whl
Size 112.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
068be809773747b7e840e4c6d71d149271df715de4f67c37b4b048c2cb046019
BLAKE2b-256 checksum
How to use checksums
e651a711df618a112976096feda2a9f733581166c3d12826222dcdf063b917c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for lunas-validator 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page