stackfix 0.1.1__tar.gz → 0.1.2__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.
- {stackfix-0.1.1 → stackfix-0.1.2}/PKG-INFO +1 -1
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/fixer/cli.py +28 -11
- {stackfix-0.1.1 → stackfix-0.1.2}/pyproject.toml +1 -1
- {stackfix-0.1.1 → stackfix-0.1.2}/.github/workflows/stackfix.yml +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/.gitignore +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/LICENSE +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/README.md +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/__init__.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/benchmark/__init__.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/benchmark/dataset.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/benchmark/evaluator.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/cli.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/fixer/__init__.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/fixer/detector.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/fixer/formatter.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/fixer/lambda_handler.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/fixer/repairer.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/generator/__init__.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/generator/formatter.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/generator/pipeline.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/__init__.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/_cf_injectors.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/_cf_utils.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/_hcl_utils.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/_tf_injectors.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/_yaml_cf.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/agentic.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/engine.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/programmatic.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/scraper/__init__.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/scraper/aws_samples.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/scraper/github.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/scraper/registry.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/scraper/validator.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/taxonomy/__init__.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/taxonomy/base.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/taxonomy/cloudformation.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/taxonomy/terraform.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/utils/__init__.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/utils/config.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/utils/ollama.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/validator/__init__.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/validator/cloudformation.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/validator/opentofu.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/validator/terraform.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/examples/.pre-commit-config.yaml +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/examples/LINKEDIN_POST.md +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/examples/USE_CASES.md +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/examples/broken_s3.tf +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/examples/broken_security_group.tf +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/examples/broken_vpc.yaml +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/examples/chart_category_breakdown.png +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/examples/chart_deployment_tradeoffs.png +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/examples/chart_hyperparameter_fix.png +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/examples/chart_overall_comparison.png +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/examples/chart_size_vs_accuracy.png +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/paper/main.pdf +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/paper/main.tex +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/paper/references.bib +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/paper/sections/conclusion.tex +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/paper/sections/dataset.tex +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/paper/sections/experiments.tex +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/paper/sections/introduction.tex +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/paper/sections/method.tex +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/paper/sections/related_work.tex +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/build_benchmark.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/evaluate.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/export_gguf.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/export_model.sh +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/finetune.sh +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/format_for_finetuning.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/generate.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/generate_gold.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/generate_gold_cf.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_7b_16L_train_and_eval.sh +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_7b_reeval.sh +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_7b_train.sh +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_7b_train_then_eval.sh +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_7b_v2_train_and_eval.sh +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_all.sh +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_baselines.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_compression_experiments.sh +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_finetuned_eval.sh +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_gemma4_eval.sh +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_overnight.sh +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_remaining.sh +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_steps_5_6.sh +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_v2_pipeline.sh +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/scrape.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/scripts/train.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/tests/__init__.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/tests/fixtures/gold_main.tf +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/tests/fixtures/gold_template.yaml +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/tests/test_inverter.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/tests/test_pipeline.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/tests/test_taxonomy.py +0 -0
- {stackfix-0.1.1 → stackfix-0.1.2}/tests/test_validator.py +0 -0
|
@@ -30,6 +30,27 @@ stderr_console = Console(stderr=True)
|
|
|
30
30
|
_repairer = None
|
|
31
31
|
|
|
32
32
|
|
|
33
|
+
DEFAULT_GGUF_REPO = "Tetsuto/iac-repair-3b-gguf"
|
|
34
|
+
DEFAULT_GGUF_FILE = "iac-repair-3b-q4.gguf"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _resolve_gguf_model(model: str | None) -> str:
|
|
38
|
+
"""Resolve the GGUF model path, auto-downloading if needed."""
|
|
39
|
+
if model and Path(model).exists():
|
|
40
|
+
return model
|
|
41
|
+
|
|
42
|
+
# Auto-download the default model from HuggingFace
|
|
43
|
+
from huggingface_hub import hf_hub_download
|
|
44
|
+
|
|
45
|
+
repo = DEFAULT_GGUF_REPO
|
|
46
|
+
filename = DEFAULT_GGUF_FILE
|
|
47
|
+
|
|
48
|
+
console.print(f"[dim]Downloading model {filename} from {repo}...[/dim]")
|
|
49
|
+
path = hf_hub_download(repo_id=repo, filename=filename)
|
|
50
|
+
console.print(f"[dim]Model cached at {path}[/dim]")
|
|
51
|
+
return path
|
|
52
|
+
|
|
53
|
+
|
|
33
54
|
def _get_repairer(backend: str, model: str | None, adapter: str | None):
|
|
34
55
|
"""Get or create the repairer instance."""
|
|
35
56
|
global _repairer
|
|
@@ -46,12 +67,8 @@ def _get_repairer(backend: str, model: str | None, adapter: str | None):
|
|
|
46
67
|
elif backend == "gguf":
|
|
47
68
|
from cloudgym.fixer.repairer import GGUFRepairer
|
|
48
69
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"GGUF backend requires --model pointing to a .gguf file. "
|
|
52
|
-
"Export one with: python scripts/export_gguf.py 0.5b"
|
|
53
|
-
)
|
|
54
|
-
_repairer = GGUFRepairer(model_path=model)
|
|
70
|
+
model_path = _resolve_gguf_model(model)
|
|
71
|
+
_repairer = GGUFRepairer(model_path=model_path)
|
|
55
72
|
elif backend == "ollama":
|
|
56
73
|
from cloudgym.fixer.repairer import OllamaRepairer
|
|
57
74
|
|
|
@@ -63,7 +80,7 @@ def _get_repairer(backend: str, model: str | None, adapter: str | None):
|
|
|
63
80
|
|
|
64
81
|
|
|
65
82
|
@click.group()
|
|
66
|
-
@click.version_option(version="0.1.
|
|
83
|
+
@click.version_option(version="0.1.2", prog_name="stackfix")
|
|
67
84
|
def cli():
|
|
68
85
|
"""AI-powered Infrastructure-as-Code repair.
|
|
69
86
|
|
|
@@ -115,7 +132,7 @@ def check(files: tuple[str, ...], fmt: str | None):
|
|
|
115
132
|
@click.option("-o", "--output", type=click.Path(), help="Write fixed output to this file")
|
|
116
133
|
@click.option("--format", "fmt", type=click.Choice(["terraform", "cloudformation", "opentofu"]),
|
|
117
134
|
default=None, help="Override auto-detected format")
|
|
118
|
-
@click.option("--backend", type=click.Choice(["mlx", "gguf", "ollama"]), default="
|
|
135
|
+
@click.option("--backend", type=click.Choice(["mlx", "gguf", "ollama"]), default="gguf",
|
|
119
136
|
help="Model backend (default: mlx)")
|
|
120
137
|
@click.option("--model", default=None, help="Override base model")
|
|
121
138
|
@click.option("--adapter", default=None, help="Override adapter path")
|
|
@@ -305,7 +322,7 @@ def _show_diff(original: str, repaired: str, filename: str, color: bool):
|
|
|
305
322
|
|
|
306
323
|
@cli.command(name="pre-commit")
|
|
307
324
|
@click.argument("files", nargs=-1, type=click.Path(exists=True))
|
|
308
|
-
@click.option("--backend", type=click.Choice(["mlx", "gguf", "ollama"]), default="
|
|
325
|
+
@click.option("--backend", type=click.Choice(["mlx", "gguf", "ollama"]), default="gguf")
|
|
309
326
|
@click.option("--model", default=None)
|
|
310
327
|
@click.option("--adapter", default=None)
|
|
311
328
|
def pre_commit(files: tuple[str, ...], backend: str, model: str | None, adapter: str | None):
|
|
@@ -375,7 +392,7 @@ def pre_commit(files: tuple[str, ...], backend: str, model: str | None, adapter:
|
|
|
375
392
|
@click.argument("files", nargs=-1, required=True, type=click.Path(exists=True))
|
|
376
393
|
@click.option("--format", "fmt", type=click.Choice(["terraform", "cloudformation", "opentofu"]),
|
|
377
394
|
default=None, help="Override auto-detected format")
|
|
378
|
-
@click.option("--backend", type=click.Choice(["mlx", "gguf", "ollama"]), default="
|
|
395
|
+
@click.option("--backend", type=click.Choice(["mlx", "gguf", "ollama"]), default="gguf")
|
|
379
396
|
@click.option("--model", default=None)
|
|
380
397
|
@click.option("--adapter", default=None)
|
|
381
398
|
def discuss(files: tuple[str, ...], fmt: str | None, backend: str, model: str | None, adapter: str | None):
|
|
@@ -411,7 +428,7 @@ def discuss(files: tuple[str, ...], fmt: str | None, backend: str, model: str |
|
|
|
411
428
|
|
|
412
429
|
|
|
413
430
|
@cli.command(name="git-diff")
|
|
414
|
-
@click.option("--backend", type=click.Choice(["mlx", "gguf", "ollama"]), default="
|
|
431
|
+
@click.option("--backend", type=click.Choice(["mlx", "gguf", "ollama"]), default="gguf")
|
|
415
432
|
@click.option("--model", default=None)
|
|
416
433
|
@click.option("--adapter", default=None)
|
|
417
434
|
@click.option("--apply", is_flag=True, help="Auto-fix and stage repaired files")
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "stackfix"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.2"
|
|
8
8
|
description = "AI-powered Infrastructure-as-Code repair — fix broken Terraform and CloudFormation on CPU"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|