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.
Files changed (97) hide show
  1. {stackfix-0.1.1 → stackfix-0.1.2}/PKG-INFO +1 -1
  2. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/fixer/cli.py +28 -11
  3. {stackfix-0.1.1 → stackfix-0.1.2}/pyproject.toml +1 -1
  4. {stackfix-0.1.1 → stackfix-0.1.2}/.github/workflows/stackfix.yml +0 -0
  5. {stackfix-0.1.1 → stackfix-0.1.2}/.gitignore +0 -0
  6. {stackfix-0.1.1 → stackfix-0.1.2}/LICENSE +0 -0
  7. {stackfix-0.1.1 → stackfix-0.1.2}/README.md +0 -0
  8. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/__init__.py +0 -0
  9. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/benchmark/__init__.py +0 -0
  10. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/benchmark/dataset.py +0 -0
  11. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/benchmark/evaluator.py +0 -0
  12. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/cli.py +0 -0
  13. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/fixer/__init__.py +0 -0
  14. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/fixer/detector.py +0 -0
  15. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/fixer/formatter.py +0 -0
  16. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/fixer/lambda_handler.py +0 -0
  17. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/fixer/repairer.py +0 -0
  18. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/generator/__init__.py +0 -0
  19. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/generator/formatter.py +0 -0
  20. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/generator/pipeline.py +0 -0
  21. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/__init__.py +0 -0
  22. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/_cf_injectors.py +0 -0
  23. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/_cf_utils.py +0 -0
  24. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/_hcl_utils.py +0 -0
  25. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/_tf_injectors.py +0 -0
  26. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/_yaml_cf.py +0 -0
  27. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/agentic.py +0 -0
  28. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/engine.py +0 -0
  29. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/inverter/programmatic.py +0 -0
  30. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/scraper/__init__.py +0 -0
  31. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/scraper/aws_samples.py +0 -0
  32. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/scraper/github.py +0 -0
  33. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/scraper/registry.py +0 -0
  34. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/scraper/validator.py +0 -0
  35. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/taxonomy/__init__.py +0 -0
  36. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/taxonomy/base.py +0 -0
  37. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/taxonomy/cloudformation.py +0 -0
  38. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/taxonomy/terraform.py +0 -0
  39. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/utils/__init__.py +0 -0
  40. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/utils/config.py +0 -0
  41. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/utils/ollama.py +0 -0
  42. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/validator/__init__.py +0 -0
  43. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/validator/cloudformation.py +0 -0
  44. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/validator/opentofu.py +0 -0
  45. {stackfix-0.1.1 → stackfix-0.1.2}/cloudgym/validator/terraform.py +0 -0
  46. {stackfix-0.1.1 → stackfix-0.1.2}/examples/.pre-commit-config.yaml +0 -0
  47. {stackfix-0.1.1 → stackfix-0.1.2}/examples/LINKEDIN_POST.md +0 -0
  48. {stackfix-0.1.1 → stackfix-0.1.2}/examples/USE_CASES.md +0 -0
  49. {stackfix-0.1.1 → stackfix-0.1.2}/examples/broken_s3.tf +0 -0
  50. {stackfix-0.1.1 → stackfix-0.1.2}/examples/broken_security_group.tf +0 -0
  51. {stackfix-0.1.1 → stackfix-0.1.2}/examples/broken_vpc.yaml +0 -0
  52. {stackfix-0.1.1 → stackfix-0.1.2}/examples/chart_category_breakdown.png +0 -0
  53. {stackfix-0.1.1 → stackfix-0.1.2}/examples/chart_deployment_tradeoffs.png +0 -0
  54. {stackfix-0.1.1 → stackfix-0.1.2}/examples/chart_hyperparameter_fix.png +0 -0
  55. {stackfix-0.1.1 → stackfix-0.1.2}/examples/chart_overall_comparison.png +0 -0
  56. {stackfix-0.1.1 → stackfix-0.1.2}/examples/chart_size_vs_accuracy.png +0 -0
  57. {stackfix-0.1.1 → stackfix-0.1.2}/paper/main.pdf +0 -0
  58. {stackfix-0.1.1 → stackfix-0.1.2}/paper/main.tex +0 -0
  59. {stackfix-0.1.1 → stackfix-0.1.2}/paper/references.bib +0 -0
  60. {stackfix-0.1.1 → stackfix-0.1.2}/paper/sections/conclusion.tex +0 -0
  61. {stackfix-0.1.1 → stackfix-0.1.2}/paper/sections/dataset.tex +0 -0
  62. {stackfix-0.1.1 → stackfix-0.1.2}/paper/sections/experiments.tex +0 -0
  63. {stackfix-0.1.1 → stackfix-0.1.2}/paper/sections/introduction.tex +0 -0
  64. {stackfix-0.1.1 → stackfix-0.1.2}/paper/sections/method.tex +0 -0
  65. {stackfix-0.1.1 → stackfix-0.1.2}/paper/sections/related_work.tex +0 -0
  66. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/build_benchmark.py +0 -0
  67. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/evaluate.py +0 -0
  68. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/export_gguf.py +0 -0
  69. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/export_model.sh +0 -0
  70. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/finetune.sh +0 -0
  71. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/format_for_finetuning.py +0 -0
  72. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/generate.py +0 -0
  73. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/generate_gold.py +0 -0
  74. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/generate_gold_cf.py +0 -0
  75. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_7b_16L_train_and_eval.sh +0 -0
  76. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_7b_reeval.sh +0 -0
  77. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_7b_train.sh +0 -0
  78. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_7b_train_then_eval.sh +0 -0
  79. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_7b_v2_train_and_eval.sh +0 -0
  80. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_all.sh +0 -0
  81. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_baselines.py +0 -0
  82. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_compression_experiments.sh +0 -0
  83. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_finetuned_eval.sh +0 -0
  84. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_gemma4_eval.sh +0 -0
  85. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_overnight.sh +0 -0
  86. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_remaining.sh +0 -0
  87. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_steps_5_6.sh +0 -0
  88. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/run_v2_pipeline.sh +0 -0
  89. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/scrape.py +0 -0
  90. {stackfix-0.1.1 → stackfix-0.1.2}/scripts/train.py +0 -0
  91. {stackfix-0.1.1 → stackfix-0.1.2}/tests/__init__.py +0 -0
  92. {stackfix-0.1.1 → stackfix-0.1.2}/tests/fixtures/gold_main.tf +0 -0
  93. {stackfix-0.1.1 → stackfix-0.1.2}/tests/fixtures/gold_template.yaml +0 -0
  94. {stackfix-0.1.1 → stackfix-0.1.2}/tests/test_inverter.py +0 -0
  95. {stackfix-0.1.1 → stackfix-0.1.2}/tests/test_pipeline.py +0 -0
  96. {stackfix-0.1.1 → stackfix-0.1.2}/tests/test_taxonomy.py +0 -0
  97. {stackfix-0.1.1 → stackfix-0.1.2}/tests/test_validator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stackfix
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: AI-powered Infrastructure-as-Code repair — fix broken Terraform and CloudFormation on CPU
5
5
  Author: Jon
6
6
  License-Expression: MIT
@@ -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
- if not model:
50
- raise click.ClickException(
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.1", prog_name="stackfix")
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="mlx",
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="mlx")
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="mlx")
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="mlx")
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.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