Skip to main content

Heurix (hx)

Deterministic Codebase Scanner & Automated YAML Synthesizer
100% Deterministic • Offline-Capable • Deep Heuristic Analysis • Non-Destructive Smart Merge


Overview

Heurix (CLI alias: hx) is an intelligent, pure-logic codebase scanner and infrastructure synthesizer. It cross-references repository files, lockfiles, dependency manifests, Dockerfiles, and compose configurations to infer intent and topology—then deterministically synthesizes production-ready CI/CD workflows, Dependabot maintenance files, and Kubernetes manifests.

Why Pure Logic?

  • 100% Deterministic & Reproducible: No hallucinations, non-determinism, or outdated action versions.
  • Instantaneous & Offline: Runs in milliseconds without network calls or API keys.
  • Non-Destructive Smart Merge: Uses AST round-trip merging (ruamel.yaml) to preserve custom steps, Slack notifications, and blocks tagged with # @heurix:preserve.
  • Pre-Flight Validation: Validates all generated YAML against JSON schemas before writing to disk.

Installation & Deployment

1. Install via PyPI

pip install heurix
# or with pipx for isolated global CLI access (recommended)
pipx install heurix

2. Standalone One-Line Installer

curl -fsSL https://raw.githubusercontent.com/Naveen-Boddepalli/heurix/main/install.sh | bash

3. Docker Container (No Python installation required)

docker run --rm -v $(pwd):/workspace ghcr.io/naveen-boddepalli/heurix:latest generate

4. Local Development & Global Shell Alias

Clone the repository and install in editable mode:

git clone https://github.com/Naveen-Boddepalli/heurix.git
cd heurix
python3 -m venv .venv
source .venv/bin/activate
pip install -e '.[dev,build]'

To run hx from anywhere in your shell, add this to your ~/.zshrc or ~/.bashrc:

alias hx="/Users/boddepallinaveen/Desktop/heurix/.venv/bin/hx"

Or execute directly from the repo using ./hx.


Deployment & CI/CD Pipelines

The repository includes complete automated deployment files:

  • PyPI Trusted Publishing (.github/workflows/publish-pypi.yml): Automatically builds sdist and wheel packages and publishes to PyPI using secure GitHub Actions OIDC trusted publishing whenever a release is created or a version tag (v*.*.*) is pushed. Also supports manual TestPyPI/PyPI deployments via workflow_dispatch.
  • Multi-Platform Docker Publishing (.github/workflows/docker-publish.yml): Builds multi-arch (linux/amd64, linux/arm64) container images and publishes to GitHub Container Registry (ghcr.io/naveen-boddepalli/heurix:latest).
  • Continuous Integration (.github/workflows/ci.yml): Automatically runs test suites on every pull request and push to main.
  • Production Dockerfile & .dockerignore: Multi-stage minimal container runtime with non-root security user and /workspace mount point.
  • Homebrew Formula (packaging/homebrew/heurix.rb): Ready for tap-based distribution via brew install.
  • Makefile: Rapid developer tasks (make test, make build, make docker-build, make check).

CLI Commands & Usage

1. hx generate (or simply hx)

Scans the current codebase, runs heuristic detectors, and synthesizes YAML configurations.

# Scan and generate with step-by-step explainability log
hx generate

# Preview changes without modifying files (Dry Run)
hx generate --dry-run

# Show colorized terminal diff of proposed changes
hx generate --diff

# Non-interactive mode (automatically apply changes)
hx generate --yes

# Target a specific repository path
hx generate --path /path/to/project

2. hx diff

Compare the current repository state against synthesized configurations:

hx diff

3. hx check (Continuous Drift Detection)

Verifies if existing CI/CD workflows match current codebase dependencies and configurations. Exits with return code 0 if clean, or 1 if drift is detected (ideal for Git pre-commit hooks and CI pipelines):

hx check

4. hx scan

Inspect the Intermediate Representation (IR) extracted by the heuristics engine:

hx scan

5. hx init

Initialize an optional .heurix.toml policy file for team-wide overrides:

hx init

Deep Heuristic Capabilities

  1. Exact Version Pinning: Discovers exact language versions from .python-version, .nvmrc, .node-version, rust-toolchain.toml, go.mod, or pyproject.toml.
  2. Lockfile & Cache Fingerprinting: Selects optimal install commands and cache actions for uv, poetry, pip, pnpm, yarn, bun, npm, cargo, and go.
  3. Automatic Backing Service Provisioning: Infers database and cache needs (postgres, redis, mongodb) from dependency manifests (psycopg2, prisma, ioredis, mongoose) and configures GitHub Actions services: with health checks and ports.
  4. Environment & Secrets Wiring: Parses .env.example to wire default environment variables and map sensitive keys (STRIPE_SECRET_KEY, AUTH_TOKEN) to ${{ secrets.KEY }}.
  5. Monorepo Topology: Detects pnpm-workspace.yaml, turbo.json, nx.json, and sub-packages.
  6. Container Orchestration: Parses Dockerfile (EXPOSE, base images, health checks) to generate Kubernetes Deployment, Service, and Ingress manifests.
  7. Maintenance Automation: Synthesizes .github/dependabot.yml covering every package ecosystem detected in the repo.

Project Structure

heurix/
├── pyproject.toml              # Build & dependency metadata (scripts: hx, heurix)
├── heurix.md                   # Master architecture & product plan
├── hx                          # Direct executable wrapper
├── src/
│   └── heurix/
│       ├── cli.py              # Typer CLI entrypoint
│       ├── core/
│       │   ├── context.py      # Pydantic ProjectContext IR
│       │   ├── indexer.py      # .gitignore-aware repo indexer (<50ms)
│       │   ├── merger.py       # ruamel.yaml AST smart merge & comment preservation
│       │   ├── validator.py    # Pre-flight JSON schema validator
│       │   └── drift.py        # Continuous drift detection engine
│       ├── detectors/          # Modular language & stack providers
│       │   ├── python_detector.py
│       │   ├── node_detector.py
│       │   ├── rust_detector.py
│       │   ├── go_detector.py
│       │   ├── cpp_detector.py
│       │   ├── docker_detector.py
│       │   └── env_detector.py
│       ├── synthesizers/       # Deterministic YAML generators
│       │   ├── github_actions.py
│       │   ├── maintenance.py
│       │   └── kubernetes.py
│       └── ui/
│           ├── console.py      # Rich explain-tree and summary tables
│           ├── differ.py       # Colorized terminal diff viewer
│           └── prompts.py      # Interactive ambiguity resolution
└── tests/                      # Full test suite (15 unit & integration tests)

Running Tests

.venv/bin/pytest -v

Metadata

Release files for heurix 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 heurix 0.1.0
File Size Uploaded Provenance Actions
heurix-0.1.0.tar.gz 30.8 kB Without provenance Details for heurix-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 65.0 kB

Release files / heurix-0.1.0.tar.gz

Download URL heurix-0.1.0.tar.gz
Size 30.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8b75b67e21867f2720824e924a41292500e22bd288b4db2b879b6c35ac4b0725
BLAKE2b-256 checksum
How to use checksums
61d380d400df27e6fdff7cb7ee8f48150df0fd201995fa37871b1a294843e1e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL heurix-0.1.0-py3-none-any.whl
Size 34.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee5c2346e0481fb3d9b457e5b9a01fac3e8002d27e264402d35839034bc1792f
BLAKE2b-256 checksum
How to use checksums
6ca3121aca436c7bd922169afc7633c24ee966949b9bd4da0e8c374231d78da5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for heurix 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.

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