{"category_id":"repository","default_severity":"error","description":"Find Terraform sources in variables/ or outputs/ immediately below another module. These folders do not load into their parent. Separately declared terraform-root components remain valid; semantic declaration placement belongs in Code Standards.","examples":[{"after":"{\"manifest\":\"repository_id = \\\"example-repository\\\"\\ncomponents = []\\n\",\"tracked\":[\"infra/main.tf\",\"infra/variables.tf\"]}","before":"{\"manifest\":\"repository_id = \\\"example-repository\\\"\\ncomponents = []\\n\",\"tracked\":[\"infra/main.tf\",\"infra/variables/region.tf\"]}","expected_severity":"error","id":"sarj-terraform-module-layout","language":"json","title":"Keep declarations in the owning module folder"}],"fix":"Use a cohesive component module with canonical interface files, or declare a real separately invoked component in the existing repository contract. Do not require empty files or relocate tfvars, entrypoints, providers or backends. No automatic module movement.","kind":"rule","references":["https://developer.hashicorp.com/terraform/language/files","https://developer.hashicorp.com/terraform/language/modules/develop/structure"],"rule_id":"repository/terraform/module-layout","rule_version":1,"slug":"terraform-module-layout","source":{"path":"src/repo_standards/policy_sarj/policy.py","symbol":"repository/terraform/module-layout"},"title":"Keep Terraform interfaces inside their owning component module","topic_id":"artifacts","why":"Declaration-kind subdirectories can silently stop the parent evaluating declarations."}
