Skip to content

feat: add HCL/Terraform structural extractor#416

Open
mauricewittek wants to merge 14 commits intosafishamsi:v4from
mauricewittek:feat/hcl-extractor
Open

feat: add HCL/Terraform structural extractor#416
mauricewittek wants to merge 14 commits intosafishamsi:v4from
mauricewittek:feat/hcl-extractor

Conversation

@mauricewittek
Copy link
Copy Markdown

Adds tree-sitter-based extraction for Terraform .tf and .tfvars files, producing block-level graph nodes and cross-file module dependency edges.

What it does

  • Extracts all 7 HCL block types (resource, data, module, variable, output, locals, provider) as graph nodes with stable namespaced IDs
  • Creates containment edges (file → block) and module_source edges (module → referenced source)
  • Resolves cross-file module-input edges (module call argument → child variable definition)
  • Classifies .tf/.tfvars as code in detect.py and routes them through the HCL extractor in the dispatch loop
  • Handles parse errors gracefully with structured diagnostics
  • Enforces resource limits (5MB file size, 200k AST nodes)

I tried to implement this in small commits to make it easier to review commit-by-commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant