heurix 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- heurix-0.1.0/PKG-INFO +209 -0
- heurix-0.1.0/README.md +170 -0
- heurix-0.1.0/pyproject.toml +73 -0
- heurix-0.1.0/setup.cfg +4 -0
- heurix-0.1.0/src/heurix/__init__.py +5 -0
- heurix-0.1.0/src/heurix/cli.py +249 -0
- heurix-0.1.0/src/heurix/core/context.py +75 -0
- heurix-0.1.0/src/heurix/core/drift.py +113 -0
- heurix-0.1.0/src/heurix/core/indexer.py +126 -0
- heurix-0.1.0/src/heurix/core/merger.py +123 -0
- heurix-0.1.0/src/heurix/core/validator.py +101 -0
- heurix-0.1.0/src/heurix/detectors/__init__.py +47 -0
- heurix-0.1.0/src/heurix/detectors/base.py +36 -0
- heurix-0.1.0/src/heurix/detectors/cpp_detector.py +60 -0
- heurix-0.1.0/src/heurix/detectors/docker_detector.py +125 -0
- heurix-0.1.0/src/heurix/detectors/env_detector.py +78 -0
- heurix-0.1.0/src/heurix/detectors/go_detector.py +61 -0
- heurix-0.1.0/src/heurix/detectors/node_detector.py +221 -0
- heurix-0.1.0/src/heurix/detectors/python_detector.py +200 -0
- heurix-0.1.0/src/heurix/detectors/rust_detector.py +79 -0
- heurix-0.1.0/src/heurix/synthesizers/__init__.py +32 -0
- heurix-0.1.0/src/heurix/synthesizers/base.py +29 -0
- heurix-0.1.0/src/heurix/synthesizers/github_actions.py +228 -0
- heurix-0.1.0/src/heurix/synthesizers/kubernetes.py +154 -0
- heurix-0.1.0/src/heurix/synthesizers/maintenance.py +89 -0
- heurix-0.1.0/src/heurix/ui/console.py +66 -0
- heurix-0.1.0/src/heurix/ui/differ.py +56 -0
- heurix-0.1.0/src/heurix/ui/prompts.py +44 -0
- heurix-0.1.0/src/heurix.egg-info/PKG-INFO +209 -0
- heurix-0.1.0/src/heurix.egg-info/SOURCES.txt +38 -0
- heurix-0.1.0/src/heurix.egg-info/dependency_links.txt +1 -0
- heurix-0.1.0/src/heurix.egg-info/entry_points.txt +3 -0
- heurix-0.1.0/src/heurix.egg-info/requires.txt +19 -0
- heurix-0.1.0/src/heurix.egg-info/top_level.txt +1 -0
- heurix-0.1.0/tests/test_cli.py +56 -0
- heurix-0.1.0/tests/test_detectors.py +125 -0
- heurix-0.1.0/tests/test_drift.py +54 -0
- heurix-0.1.0/tests/test_indexer.py +33 -0
- heurix-0.1.0/tests/test_merger.py +77 -0
- heurix-0.1.0/tests/test_synthesizers.py +109 -0
heurix-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: heurix
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Deterministic Codebase Scanner & Automated YAML Synthesizer
|
|
5
|
+
Author: Heurix Contributors
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Naveen-Boddepalli/heurix
|
|
8
|
+
Project-URL: Repository, https://github.com/Naveen-Boddepalli/heurix
|
|
9
|
+
Project-URL: Issues, https://github.com/Naveen-Boddepalli/heurix/issues
|
|
10
|
+
Keywords: ci-cd,github-actions,kubernetes,yaml,devops,codebase-scanner,automation
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
21
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
Requires-Dist: typer>=0.12.0
|
|
25
|
+
Requires-Dist: rich>=13.0.0
|
|
26
|
+
Requires-Dist: questionary>=2.0.0
|
|
27
|
+
Requires-Dist: pydantic>=2.0.0
|
|
28
|
+
Requires-Dist: pathspec>=0.12.0
|
|
29
|
+
Requires-Dist: ruamel.yaml>=0.18.0
|
|
30
|
+
Requires-Dist: jinja2>=3.1.0
|
|
31
|
+
Requires-Dist: jsonschema>=4.20.0
|
|
32
|
+
Requires-Dist: tomli>=1.1.0; python_version < "3.11"
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
35
|
+
Provides-Extra: build
|
|
36
|
+
Requires-Dist: build>=1.0.0; extra == "build"
|
|
37
|
+
Requires-Dist: twine>=5.0.0; extra == "build"
|
|
38
|
+
Requires-Dist: wheel>=0.40.0; extra == "build"
|
|
39
|
+
|
|
40
|
+
# Heurix (`hx`)
|
|
41
|
+
|
|
42
|
+
> **Deterministic Codebase Scanner & Automated YAML Synthesizer**
|
|
43
|
+
> *100% Deterministic • Offline-Capable • Deep Heuristic Analysis • Non-Destructive Smart Merge*
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Overview
|
|
48
|
+
|
|
49
|
+
**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.
|
|
50
|
+
|
|
51
|
+
### Why Pure Logic?
|
|
52
|
+
- **100% Deterministic & Reproducible:** No hallucinations, non-determinism, or outdated action versions.
|
|
53
|
+
- **Instantaneous & Offline:** Runs in milliseconds without network calls or API keys.
|
|
54
|
+
- **Non-Destructive Smart Merge:** Uses AST round-trip merging (`ruamel.yaml`) to preserve custom steps, Slack notifications, and blocks tagged with `# @heurix:preserve`.
|
|
55
|
+
- **Pre-Flight Validation:** Validates all generated YAML against JSON schemas before writing to disk.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Installation & Deployment
|
|
60
|
+
|
|
61
|
+
### 1. Install via PyPI
|
|
62
|
+
```bash
|
|
63
|
+
pip install heurix
|
|
64
|
+
# or with pipx for isolated global CLI access (recommended)
|
|
65
|
+
pipx install heurix
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 2. Standalone One-Line Installer
|
|
69
|
+
```bash
|
|
70
|
+
curl -fsSL https://raw.githubusercontent.com/Naveen-Boddepalli/heurix/main/install.sh | bash
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 3. Docker Container (No Python installation required)
|
|
74
|
+
```bash
|
|
75
|
+
docker run --rm -v $(pwd):/workspace ghcr.io/naveen-boddepalli/heurix:latest generate
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 4. Local Development & Global Shell Alias
|
|
79
|
+
Clone the repository and install in editable mode:
|
|
80
|
+
```bash
|
|
81
|
+
git clone https://github.com/Naveen-Boddepalli/heurix.git
|
|
82
|
+
cd heurix
|
|
83
|
+
python3 -m venv .venv
|
|
84
|
+
source .venv/bin/activate
|
|
85
|
+
pip install -e '.[dev,build]'
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
To run `hx` from anywhere in your shell, add this to your `~/.zshrc` or `~/.bashrc`:
|
|
89
|
+
```bash
|
|
90
|
+
alias hx="/Users/boddepallinaveen/Desktop/heurix/.venv/bin/hx"
|
|
91
|
+
```
|
|
92
|
+
Or execute directly from the repo using `./hx`.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Deployment & CI/CD Pipelines
|
|
97
|
+
|
|
98
|
+
The repository includes complete automated deployment files:
|
|
99
|
+
- **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`.
|
|
100
|
+
- **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`).
|
|
101
|
+
- **Continuous Integration (`.github/workflows/ci.yml`):** Automatically runs test suites on every pull request and push to `main`.
|
|
102
|
+
- **Production `Dockerfile` & `.dockerignore`:** Multi-stage minimal container runtime with non-root security user and `/workspace` mount point.
|
|
103
|
+
- **Homebrew Formula (`packaging/homebrew/heurix.rb`):** Ready for tap-based distribution via `brew install`.
|
|
104
|
+
- **`Makefile`:** Rapid developer tasks (`make test`, `make build`, `make docker-build`, `make check`).
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## CLI Commands & Usage
|
|
109
|
+
|
|
110
|
+
### 1. `hx generate` (or simply `hx`)
|
|
111
|
+
Scans the current codebase, runs heuristic detectors, and synthesizes YAML configurations.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Scan and generate with step-by-step explainability log
|
|
115
|
+
hx generate
|
|
116
|
+
|
|
117
|
+
# Preview changes without modifying files (Dry Run)
|
|
118
|
+
hx generate --dry-run
|
|
119
|
+
|
|
120
|
+
# Show colorized terminal diff of proposed changes
|
|
121
|
+
hx generate --diff
|
|
122
|
+
|
|
123
|
+
# Non-interactive mode (automatically apply changes)
|
|
124
|
+
hx generate --yes
|
|
125
|
+
|
|
126
|
+
# Target a specific repository path
|
|
127
|
+
hx generate --path /path/to/project
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 2. `hx diff`
|
|
131
|
+
Compare the current repository state against synthesized configurations:
|
|
132
|
+
```bash
|
|
133
|
+
hx diff
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### 3. `hx check` (Continuous Drift Detection)
|
|
137
|
+
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):
|
|
138
|
+
```bash
|
|
139
|
+
hx check
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### 4. `hx scan`
|
|
143
|
+
Inspect the Intermediate Representation (IR) extracted by the heuristics engine:
|
|
144
|
+
```bash
|
|
145
|
+
hx scan
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 5. `hx init`
|
|
149
|
+
Initialize an optional `.heurix.toml` policy file for team-wide overrides:
|
|
150
|
+
```bash
|
|
151
|
+
hx init
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Deep Heuristic Capabilities
|
|
157
|
+
|
|
158
|
+
1. **Exact Version Pinning:** Discovers exact language versions from `.python-version`, `.nvmrc`, `.node-version`, `rust-toolchain.toml`, `go.mod`, or `pyproject.toml`.
|
|
159
|
+
2. **Lockfile & Cache Fingerprinting:** Selects optimal install commands and cache actions for `uv`, `poetry`, `pip`, `pnpm`, `yarn`, `bun`, `npm`, `cargo`, and `go`.
|
|
160
|
+
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.
|
|
161
|
+
4. **Environment & Secrets Wiring:** Parses `.env.example` to wire default environment variables and map sensitive keys (`STRIPE_SECRET_KEY`, `AUTH_TOKEN`) to `${{ secrets.KEY }}`.
|
|
162
|
+
5. **Monorepo Topology:** Detects `pnpm-workspace.yaml`, `turbo.json`, `nx.json`, and sub-packages.
|
|
163
|
+
6. **Container Orchestration:** Parses `Dockerfile` (`EXPOSE`, base images, health checks) to generate Kubernetes `Deployment`, `Service`, and `Ingress` manifests.
|
|
164
|
+
7. **Maintenance Automation:** Synthesizes `.github/dependabot.yml` covering every package ecosystem detected in the repo.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Project Structure
|
|
169
|
+
|
|
170
|
+
```text
|
|
171
|
+
heurix/
|
|
172
|
+
├── pyproject.toml # Build & dependency metadata (scripts: hx, heurix)
|
|
173
|
+
├── heurix.md # Master architecture & product plan
|
|
174
|
+
├── hx # Direct executable wrapper
|
|
175
|
+
├── src/
|
|
176
|
+
│ └── heurix/
|
|
177
|
+
│ ├── cli.py # Typer CLI entrypoint
|
|
178
|
+
│ ├── core/
|
|
179
|
+
│ │ ├── context.py # Pydantic ProjectContext IR
|
|
180
|
+
│ │ ├── indexer.py # .gitignore-aware repo indexer (<50ms)
|
|
181
|
+
│ │ ├── merger.py # ruamel.yaml AST smart merge & comment preservation
|
|
182
|
+
│ │ ├── validator.py # Pre-flight JSON schema validator
|
|
183
|
+
│ │ └── drift.py # Continuous drift detection engine
|
|
184
|
+
│ ├── detectors/ # Modular language & stack providers
|
|
185
|
+
│ │ ├── python_detector.py
|
|
186
|
+
│ │ ├── node_detector.py
|
|
187
|
+
│ │ ├── rust_detector.py
|
|
188
|
+
│ │ ├── go_detector.py
|
|
189
|
+
│ │ ├── cpp_detector.py
|
|
190
|
+
│ │ ├── docker_detector.py
|
|
191
|
+
│ │ └── env_detector.py
|
|
192
|
+
│ ├── synthesizers/ # Deterministic YAML generators
|
|
193
|
+
│ │ ├── github_actions.py
|
|
194
|
+
│ │ ├── maintenance.py
|
|
195
|
+
│ │ └── kubernetes.py
|
|
196
|
+
│ └── ui/
|
|
197
|
+
│ ├── console.py # Rich explain-tree and summary tables
|
|
198
|
+
│ ├── differ.py # Colorized terminal diff viewer
|
|
199
|
+
│ └── prompts.py # Interactive ambiguity resolution
|
|
200
|
+
└── tests/ # Full test suite (15 unit & integration tests)
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Running Tests
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
.venv/bin/pytest -v
|
|
209
|
+
```
|
heurix-0.1.0/README.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Heurix (`hx`)
|
|
2
|
+
|
|
3
|
+
> **Deterministic Codebase Scanner & Automated YAML Synthesizer**
|
|
4
|
+
> *100% Deterministic • Offline-Capable • Deep Heuristic Analysis • Non-Destructive Smart Merge*
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
**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.
|
|
11
|
+
|
|
12
|
+
### Why Pure Logic?
|
|
13
|
+
- **100% Deterministic & Reproducible:** No hallucinations, non-determinism, or outdated action versions.
|
|
14
|
+
- **Instantaneous & Offline:** Runs in milliseconds without network calls or API keys.
|
|
15
|
+
- **Non-Destructive Smart Merge:** Uses AST round-trip merging (`ruamel.yaml`) to preserve custom steps, Slack notifications, and blocks tagged with `# @heurix:preserve`.
|
|
16
|
+
- **Pre-Flight Validation:** Validates all generated YAML against JSON schemas before writing to disk.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Installation & Deployment
|
|
21
|
+
|
|
22
|
+
### 1. Install via PyPI
|
|
23
|
+
```bash
|
|
24
|
+
pip install heurix
|
|
25
|
+
# or with pipx for isolated global CLI access (recommended)
|
|
26
|
+
pipx install heurix
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 2. Standalone One-Line Installer
|
|
30
|
+
```bash
|
|
31
|
+
curl -fsSL https://raw.githubusercontent.com/Naveen-Boddepalli/heurix/main/install.sh | bash
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 3. Docker Container (No Python installation required)
|
|
35
|
+
```bash
|
|
36
|
+
docker run --rm -v $(pwd):/workspace ghcr.io/naveen-boddepalli/heurix:latest generate
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 4. Local Development & Global Shell Alias
|
|
40
|
+
Clone the repository and install in editable mode:
|
|
41
|
+
```bash
|
|
42
|
+
git clone https://github.com/Naveen-Boddepalli/heurix.git
|
|
43
|
+
cd heurix
|
|
44
|
+
python3 -m venv .venv
|
|
45
|
+
source .venv/bin/activate
|
|
46
|
+
pip install -e '.[dev,build]'
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
To run `hx` from anywhere in your shell, add this to your `~/.zshrc` or `~/.bashrc`:
|
|
50
|
+
```bash
|
|
51
|
+
alias hx="/Users/boddepallinaveen/Desktop/heurix/.venv/bin/hx"
|
|
52
|
+
```
|
|
53
|
+
Or execute directly from the repo using `./hx`.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Deployment & CI/CD Pipelines
|
|
58
|
+
|
|
59
|
+
The repository includes complete automated deployment files:
|
|
60
|
+
- **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`.
|
|
61
|
+
- **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`).
|
|
62
|
+
- **Continuous Integration (`.github/workflows/ci.yml`):** Automatically runs test suites on every pull request and push to `main`.
|
|
63
|
+
- **Production `Dockerfile` & `.dockerignore`:** Multi-stage minimal container runtime with non-root security user and `/workspace` mount point.
|
|
64
|
+
- **Homebrew Formula (`packaging/homebrew/heurix.rb`):** Ready for tap-based distribution via `brew install`.
|
|
65
|
+
- **`Makefile`:** Rapid developer tasks (`make test`, `make build`, `make docker-build`, `make check`).
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## CLI Commands & Usage
|
|
70
|
+
|
|
71
|
+
### 1. `hx generate` (or simply `hx`)
|
|
72
|
+
Scans the current codebase, runs heuristic detectors, and synthesizes YAML configurations.
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Scan and generate with step-by-step explainability log
|
|
76
|
+
hx generate
|
|
77
|
+
|
|
78
|
+
# Preview changes without modifying files (Dry Run)
|
|
79
|
+
hx generate --dry-run
|
|
80
|
+
|
|
81
|
+
# Show colorized terminal diff of proposed changes
|
|
82
|
+
hx generate --diff
|
|
83
|
+
|
|
84
|
+
# Non-interactive mode (automatically apply changes)
|
|
85
|
+
hx generate --yes
|
|
86
|
+
|
|
87
|
+
# Target a specific repository path
|
|
88
|
+
hx generate --path /path/to/project
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 2. `hx diff`
|
|
92
|
+
Compare the current repository state against synthesized configurations:
|
|
93
|
+
```bash
|
|
94
|
+
hx diff
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 3. `hx check` (Continuous Drift Detection)
|
|
98
|
+
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):
|
|
99
|
+
```bash
|
|
100
|
+
hx check
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 4. `hx scan`
|
|
104
|
+
Inspect the Intermediate Representation (IR) extracted by the heuristics engine:
|
|
105
|
+
```bash
|
|
106
|
+
hx scan
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 5. `hx init`
|
|
110
|
+
Initialize an optional `.heurix.toml` policy file for team-wide overrides:
|
|
111
|
+
```bash
|
|
112
|
+
hx init
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Deep Heuristic Capabilities
|
|
118
|
+
|
|
119
|
+
1. **Exact Version Pinning:** Discovers exact language versions from `.python-version`, `.nvmrc`, `.node-version`, `rust-toolchain.toml`, `go.mod`, or `pyproject.toml`.
|
|
120
|
+
2. **Lockfile & Cache Fingerprinting:** Selects optimal install commands and cache actions for `uv`, `poetry`, `pip`, `pnpm`, `yarn`, `bun`, `npm`, `cargo`, and `go`.
|
|
121
|
+
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.
|
|
122
|
+
4. **Environment & Secrets Wiring:** Parses `.env.example` to wire default environment variables and map sensitive keys (`STRIPE_SECRET_KEY`, `AUTH_TOKEN`) to `${{ secrets.KEY }}`.
|
|
123
|
+
5. **Monorepo Topology:** Detects `pnpm-workspace.yaml`, `turbo.json`, `nx.json`, and sub-packages.
|
|
124
|
+
6. **Container Orchestration:** Parses `Dockerfile` (`EXPOSE`, base images, health checks) to generate Kubernetes `Deployment`, `Service`, and `Ingress` manifests.
|
|
125
|
+
7. **Maintenance Automation:** Synthesizes `.github/dependabot.yml` covering every package ecosystem detected in the repo.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Project Structure
|
|
130
|
+
|
|
131
|
+
```text
|
|
132
|
+
heurix/
|
|
133
|
+
├── pyproject.toml # Build & dependency metadata (scripts: hx, heurix)
|
|
134
|
+
├── heurix.md # Master architecture & product plan
|
|
135
|
+
├── hx # Direct executable wrapper
|
|
136
|
+
├── src/
|
|
137
|
+
│ └── heurix/
|
|
138
|
+
│ ├── cli.py # Typer CLI entrypoint
|
|
139
|
+
│ ├── core/
|
|
140
|
+
│ │ ├── context.py # Pydantic ProjectContext IR
|
|
141
|
+
│ │ ├── indexer.py # .gitignore-aware repo indexer (<50ms)
|
|
142
|
+
│ │ ├── merger.py # ruamel.yaml AST smart merge & comment preservation
|
|
143
|
+
│ │ ├── validator.py # Pre-flight JSON schema validator
|
|
144
|
+
│ │ └── drift.py # Continuous drift detection engine
|
|
145
|
+
│ ├── detectors/ # Modular language & stack providers
|
|
146
|
+
│ │ ├── python_detector.py
|
|
147
|
+
│ │ ├── node_detector.py
|
|
148
|
+
│ │ ├── rust_detector.py
|
|
149
|
+
│ │ ├── go_detector.py
|
|
150
|
+
│ │ ├── cpp_detector.py
|
|
151
|
+
│ │ ├── docker_detector.py
|
|
152
|
+
│ │ └── env_detector.py
|
|
153
|
+
│ ├── synthesizers/ # Deterministic YAML generators
|
|
154
|
+
│ │ ├── github_actions.py
|
|
155
|
+
│ │ ├── maintenance.py
|
|
156
|
+
│ │ └── kubernetes.py
|
|
157
|
+
│ └── ui/
|
|
158
|
+
│ ├── console.py # Rich explain-tree and summary tables
|
|
159
|
+
│ ├── differ.py # Colorized terminal diff viewer
|
|
160
|
+
│ └── prompts.py # Interactive ambiguity resolution
|
|
161
|
+
└── tests/ # Full test suite (15 unit & integration tests)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Running Tests
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
.venv/bin/pytest -v
|
|
170
|
+
```
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "heurix"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Deterministic Codebase Scanner & Automated YAML Synthesizer"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Heurix Contributors" }
|
|
14
|
+
]
|
|
15
|
+
keywords = [
|
|
16
|
+
"ci-cd",
|
|
17
|
+
"github-actions",
|
|
18
|
+
"kubernetes",
|
|
19
|
+
"yaml",
|
|
20
|
+
"devops",
|
|
21
|
+
"codebase-scanner",
|
|
22
|
+
"automation",
|
|
23
|
+
]
|
|
24
|
+
classifiers = [
|
|
25
|
+
"Development Status :: 4 - Beta",
|
|
26
|
+
"Environment :: Console",
|
|
27
|
+
"Intended Audience :: Developers",
|
|
28
|
+
"License :: OSI Approved :: MIT License",
|
|
29
|
+
"Operating System :: OS Independent",
|
|
30
|
+
"Programming Language :: Python :: 3",
|
|
31
|
+
"Programming Language :: Python :: 3.10",
|
|
32
|
+
"Programming Language :: Python :: 3.11",
|
|
33
|
+
"Programming Language :: Python :: 3.12",
|
|
34
|
+
"Topic :: Software Development :: Build Tools",
|
|
35
|
+
"Topic :: Software Development :: Code Generators",
|
|
36
|
+
]
|
|
37
|
+
dependencies = [
|
|
38
|
+
"typer>=0.12.0",
|
|
39
|
+
"rich>=13.0.0",
|
|
40
|
+
"questionary>=2.0.0",
|
|
41
|
+
"pydantic>=2.0.0",
|
|
42
|
+
"pathspec>=0.12.0",
|
|
43
|
+
"ruamel.yaml>=0.18.0",
|
|
44
|
+
"jinja2>=3.1.0",
|
|
45
|
+
"jsonschema>=4.20.0",
|
|
46
|
+
"tomli>=1.1.0; python_version < '3.11'",
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
[project.optional-dependencies]
|
|
50
|
+
dev = [
|
|
51
|
+
"pytest>=8.0.0",
|
|
52
|
+
]
|
|
53
|
+
build = [
|
|
54
|
+
"build>=1.0.0",
|
|
55
|
+
"twine>=5.0.0",
|
|
56
|
+
"wheel>=0.40.0",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[project.urls]
|
|
60
|
+
Homepage = "https://github.com/Naveen-Boddepalli/heurix"
|
|
61
|
+
Repository = "https://github.com/Naveen-Boddepalli/heurix"
|
|
62
|
+
Issues = "https://github.com/Naveen-Boddepalli/heurix/issues"
|
|
63
|
+
|
|
64
|
+
[project.scripts]
|
|
65
|
+
hx = "heurix.cli:app"
|
|
66
|
+
heurix = "heurix.cli:app"
|
|
67
|
+
|
|
68
|
+
[tool.setuptools.packages.find]
|
|
69
|
+
where = ["src"]
|
|
70
|
+
|
|
71
|
+
[tool.pytest.ini_options]
|
|
72
|
+
testpaths = ["tests"]
|
|
73
|
+
pythonpath = ["src"]
|
heurix-0.1.0/setup.cfg
ADDED