Skip to main content

Visual Intent Contract Orchestrator: freeze project slices, evolve capsules, verify intent contracts.

Project description

Nexu

AI Cost Tracking

PyPI Version Python License AI Cost Human Time Model

  • 🤖 LLM usage: $1.8755 (13 commits)
  • 👤 Human dev: ~$551 (5.5h @ $100/h, 30min dedup)

Generated on 2026-05-31 using openrouter/qwen/qwen3-coder-next


NexuVisual Intent Contract Orchestrator.

Nexu is a Python package and CLI for creating small, isolated project capsules from a large codebase. It helps you freeze a baseline, extract a slice of code/data/contracts, evolve that slice through multiple LLM or human iterations, and verify the result against formal intent contracts before promoting it back.

The core workflow is:

freeze → capsule create → plan → blueprint → iterate → runtime → export-prompt → verify → report → promote

Nexu is designed to work with Intract-style intent contracts, but it can run as a standalone prototype. The goal is not to make an LLM magically correct. The goal is to keep the LLM inside a small, versioned, contract-bound sandbox and detect when its output diverges from declared intent.

What changed in 0.5.0

The fifth iteration adds LLM orchestration and an MCP service:

  • capsule orchestrate creates an offline or optional LLM-assisted step-by-step capsule evolution plan,
  • orchestration writes orchestration.yaml, orchestration.md, orchestration-prompt.md and context YAML,
  • nexu mcp tools lists tools available to IDE/agent clients,
  • nexu mcp serve exposes Nexu operations through a conservative MCP-compatible stdio JSON-RPC service,
  • MCP promotion remains dry-run only and LLM network calls remain disabled unless explicitly allowed in nexu.yaml.

Why Nexu?

Long-running IDE prompting has a common failure mode:

large repo + vague task + many steps = context drift and hallucinated implementation

Nexu changes the operating model:

large repo
  ↓ freeze baseline
small capsule
  ↓ evolve only this capsule
verified result
  ↓ promote to the real project

Install locally

python -m venv .venv
. .venv/bin/activate
pip install -e .[dev]
nexu --help

First run

nexu init .
nexu freeze . --name baseline
nexu capsule create . --name menu-icons --domain menu --include "examples/frontend_view/src/**" --route /menu-icons
nexu capsule plan menu-icons --steps 10 --goal "Add preview, confidence and reason fields"
nexu capsule blueprint menu-icons --print
nexu capsule iterate menu-icons --steps 3 --goal "Add preview, confidence and reason fields"
nexu capsule runtime menu-icons
nexu capsule orchestrate menu-icons --steps 10 --goal "Add preview, confidence and reason fields"
nexu capsule export-prompt menu-icons
nexu capsule verify menu-icons
nexu capsule review menu-icons
nexu capsule report menu-icons
nexu capsule bundle menu-icons
nexu capsule diff menu-icons
nexu capsule drift menu-icons
nexu capsule promote menu-icons --dry-run

Key Features Added Recently

  • Secure Workspace Promotion: Support for applying capsule changes to the source workspace via the nexu capsule promote --apply command (and via the nexu_capsule_promote_apply MCP tool).
  • Dynamic Intract Policy Engine Integration: Runs the actual sibling intract package validations (including AST verification and contract compliance) during the capsule verify step to guarantee correctness.
  • Web App Dashboard Evolution Example: Fully details multi-stage sandbox visualization and evolution under examples/web_app_dashboard.
  • Web App Calculator Mock Example: Compares a simple arithmetic layout (S0) and a scientific layout (S2) under examples/web_app_calculator (evolving the calc capsule).
  • Web App Database Analytics Example: Showcases transition from raw SQL/NoSQL table logs to glassmorphic visual charts under examples/web_app_analytics.

Important folders

src/nexu/       Python package
docs/           documentation
examples/       runnable example projects
tests/          unit tests

Documentation

Start here:

Main commands

nexu init .
nexu freeze . --name baseline
nexu capsule create . --name my-slice --include "src/my_module/**"
nexu capsule list
nexu capsule status my-slice
nexu capsule blueprint my-slice
nexu capsule iterate my-slice --steps 10 --goal "Evolve final screen"
nexu capsule orchestrate my-slice --steps 10 --goal "Evolve final screen"
nexu capsule export-prompt my-slice
nexu capsule diff my-slice
nexu capsule review my-slice
nexu capsule bundle my-slice
nexu capsule drift my-slice
nexu capsule verify my-slice
nexu capsule review my-slice
nexu capsule bundle my-slice
nexu capsule promote my-slice --dry-run
nexu mcp tools
nexu mcp serve --path .

License

Licensed under Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nexu-0.5.7.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nexu-0.5.7-py3-none-any.whl (50.8 kB view details)

Uploaded Python 3

File details

Details for the file nexu-0.5.7.tar.gz.

File metadata

  • Download URL: nexu-0.5.7.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for nexu-0.5.7.tar.gz
Algorithm Hash digest
SHA256 8ac3d526239fc86d3586f8d4700a37b554f211c9b18ebc7f58c59caaa3281366
MD5 f1b26a3fe9176bffd8f3fb39bf23672e
BLAKE2b-256 c56168e02af512f2c350bf2a2ec8942ab638a0a75e4e47c198fcbc7b55666dbc

See more details on using hashes here.

File details

Details for the file nexu-0.5.7-py3-none-any.whl.

File metadata

  • Download URL: nexu-0.5.7-py3-none-any.whl
  • Upload date:
  • Size: 50.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for nexu-0.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 fd3dcb6a56046bb133d6257bd865bb5a1a98e7db1e1c71af8214ca5c6f1f5723
MD5 564bdfd446e794121872f1bfcb798462
BLAKE2b-256 74037756eca8687fd3718192ab6c866eeab132dd308c1bbfe40ee164e98e5518

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page