Skip to main content

Morvix

PyPI version Python versions CI CodeQL License: MIT

A test-authoring, test-running, and test-sharing CLI for university programming assignments.

Most courses don't hand out test suites, so students end up writing their own: they build test cases from their own solution, run their program against them, and share the cases on GitHub so classmates can check their code too. Morvix automates that whole loop - building, running, and sharing these self-made test harnesses - quickly and consistently, across languages and platforms.

It's an honest tool. The "expected answers" come from one student's own solution, so passing every test does not prove a solution is correct - it proves it agrees with that one solution on the cases tried. Morvix says so plainly (it's baked into every package's README) and makes the real signal - lots of independent solutions agreeing - easy to see.

Morvix is not an online judge, not a grading server, and not an AI tool. It runs locally and offline. Linux and macOS are the primary targets; Windows works on a best-effort basis.

Install

pip install morvix          # or, from a clone:
pip install .

Needs Python 3.9+. The only dependencies are prompt_toolkit and rich. The runner that ships inside shared packages is pure standard library, so whoever you share with needs nothing but Python 3.

Quick start (the Author)

Run morvix with no arguments to open the interactive shell (live autocomplete, history, a status bar), or use any command one-shot from your normal shell. What you can do one way is identical the other way.

cd my-assignment
morvix init                       # create a project here (guided)
morvix config cpp                 # how to build/run your language
morvix import solution.cpp        # the solution under test (it also defines the answers)
morvix gen --random --count 100   # generate inputs from the built-in shapes
morvix gen --expected             # compute answers by running your solution
morvix run --all                  # build, run, judge - with a live table
morvix runner new full            # a named, shareable run profile
morvix package --zip              # bundle it up to share (your source is left out)

All of Morvix's state lives in a single hidden .morvix/ directory, so your project root stays clean — just your own source next to .morvix/.

Structured input? Write a generator

Random shapes (gen --random) are great for simple stdin formats, but most assignments read something structured (a grid, a graph, a constrained matrix). For those, random data produces meaningless tests — Morvix will warn you when an gen --expected run comes back all-empty. The fix is a custom generator:

morvix gen --new-generator mygen        # writes a starter you edit
morvix gen --generator .morvix/generators/mygen.py --count 1000
morvix gen --expected

See examples/exact_cover for a full worked example.

Quick start (the Receiver)

You got a package from a classmate. You don't need Morvix at all:

unzip their-tests.zip && cd their-tests
./run.sh my_solution.cpp          # builds your code, runs every test, reports

If you do have Morvix, open it in the unpacked directory and you get the rich view - browse the tests, re-run selectively, and diff your per-case results against the author's.

What's in the box

  • Languages: C, C++, NASM, Python, Java, Rust - each a small adapter. Adding one is one file.
  • Execution models: stdio, library (link & assert), args, file, interactive.
  • Comparison: byte-exact, whitespace-insensitive, float-tolerant, hash, a custom checker, and expected exit status / crash - combinable per case.
  • Limits & checks: wall/CPU time, peak memory (approximate), hard memory caps, output caps, and an optional valgrind memory-correctness pass.
  • Generation: random shapes (with distribution and difficulty dials and worst-case "adversary" shapes), declarative grammars for structured input, custom generators and a vetted catalog, boundary / exhaustive / pairwise / multi-test / size-ladder coverage, stress + crash testing with automatic shrinking to a minimal reproducer, oracle-free metamorphic / property / fuzz checks, importing and mutating real inputs, format inference, input validators, answer-stability and snapshot checks, and an opt-in model-assist hook. Every mode produces inputs only - answers always come from running your own solution.
  • Sharing: zip / tar / tar.gz / tar.xz packages with an auto-generated README and a manifest.
  • Workflows: record a sequence of commands and replay it on the next assignment.

These three axes - language, execution model, comparison - are kept independent, so they never multiply against each other. That's the design decision everything else hangs on.

The full guide

morvix docs opens the complete guide in your terminal — concepts, every command, and what's supported — generated from the tool itself, so it's always current. morvix docs <topic> shows one section, and morvix docs --out GUIDE.md writes it all as Markdown. The committed copy is GUIDE.md (CI fails if it ever drifts).

Design

The full design is in documentation.md: the architecture, every command, the file formats, and the reasoning behind each choice.

Contributing

Contributions are welcome. New capability lands on exactly one of the three axes, so adding a language, an execution model, or a comparison strategy is a small, self-contained change. See CONTRIBUTING.md for setup, the extension recipes, and the invariants that keep the project honest and small. In short: work through a pull request, use conventional commit messages (the squash-merged PR title becomes the commit), and let CI's checks (tests, lint, format, type check, the docs gate, and the zero-install receiver proof) go green. Versions and releases are automated — please don't bump them by hand.

Be respectful (Code of Conduct), report vulnerabilities privately (SECURITY.md), and ask questions in Discussions. Release notes live in CHANGELOG.md.

Above all, keep the honesty principle intact: Morvix shows agreement between solutions, never an authoritative verdict on correctness.

License

MIT (c) Krzysztof Adamczyk

Metadata

Release files for morvix 0.10.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 morvix 0.10.0
File Size Uploaded Provenance Actions
morvix-0.10.0.tar.gz 323.4 kB With provenance Details for morvix-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for morvix 0.10.0
File Interpreter ABI Platform Actions
morvix-0.10.0-py3-none-any.whl Python 3 none any Details for morvix-0.10.0-py3-none-any.whl

Total release size: 568.8 kB

Release files / morvix-0.10.0.tar.gz

Download URL morvix-0.10.0.tar.gz
Size 323.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4a2acaca5e32c212e83b53a4b57e3c191d9bb216d68fa83c4666f60043245bc0
BLAKE2b-256 checksum
How to use checksums
b0654cec30db7b662826ad35d04d8f9f6b3eec84d3ac772f6af46df787729d50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.

Transparency log

Release files / morvix-0.10.0-py3-none-any.whl

Download URL morvix-0.10.0-py3-none-any.whl
Size 245.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8763a5514e8a6a26942e21eb209a4849918a74959e1ef41069a5c54e2b93f1a1
BLAKE2b-256 checksum
How to use checksums
299ceda9ee9f78b8269ff7668c1dda7c76cb0e3dedc01228be54e205fc73e7c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.

Transparency log

Security for morvix 0.10.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for morvix-0.10.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.

Transparency log

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.

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