infraweaver 0.3.8 → 0.3.9

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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](LICENSE)
4
4
  [![CI](https://github.com/infraweaver-io/infraweaver-action/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/infraweaver-io/infraweaver-action/actions/workflows/test.yml)
5
- [![Version](https://img.shields.io/badge/version-0.3.8)](package.json) <!-- x-release-please-version -->
5
+ [![Version](https://img.shields.io/badge/version-0.3.9)](package.json) <!-- x-release-please-version -->
6
6
 
7
7
  **Infraweaver brings your Terraform up to best practice — automatically, as reviewable pull requests.**
8
8
 
package/dist/cli.mjs CHANGED
@@ -200490,7 +200490,7 @@ import { randomBytes } from "node:crypto";
200490
200490
  // package.json
200491
200491
  var package_default = {
200492
200492
  name: "infraweaver",
200493
- version: "0.3.8",
200493
+ version: "0.3.9",
200494
200494
  description: "GitHub Action that remediates Terraform to best practices and opens one scoped pull request per concern.",
200495
200495
  keywords: [
200496
200496
  "ai-coding-agent",
@@ -283379,7 +283379,8 @@ function markPossibleRenames(introduced, resolved, headAddresses) {
283379
283379
  if (finding.address === null) continue;
283380
283380
  const dir = dirOf3(finding.concern.location.file);
283381
283381
  const match5 = vanished.find(
283382
- (r) => !used.has(r) && ruleKey(r.concern) === ruleKey(finding.concern) && // renamed in place, or moved elsewhere under its own name
283382
+ (r) => !used.has(r) && ruleKey(r.concern) === ruleKey(finding.concern) && // a `moved` block cannot change a resource's type
283383
+ typeOf(r.address) === typeOf(finding.address) && // renamed in place, or moved elsewhere under its own name
283383
283384
  dirOf3(r.concern.location.file) === dir !== (r.address === finding.address)
283384
283385
  );
283385
283386
  if (!match5) continue;
@@ -283388,6 +283389,9 @@ function markPossibleRenames(introduced, resolved, headAddresses) {
283388
283389
  finding.renamedFrom = { address: match5.address, file: match5.concern.location.file };
283389
283390
  }
283390
283391
  }
283392
+ function typeOf(address) {
283393
+ return address.slice(0, address.lastIndexOf("."));
283394
+ }
283391
283395
  function undeclaredRenames(introduced) {
283392
283396
  const byPair = /* @__PURE__ */ new Map();
283393
283397
  for (const f of introduced) {
@@ -284943,7 +284947,7 @@ function buildLocalTools(ctx) {
284943
284947
  ];
284944
284948
  }
284945
284949
  function cliVersion() {
284946
- const raw2 = "0.3.8";
284950
+ const raw2 = "0.3.9";
284947
284951
  if (raw2 !== void 0 && /^\d+\.\d+\.\d+$/.test(raw2)) {
284948
284952
  return raw2;
284949
284953
  }
@@ -287720,6 +287724,7 @@ This mode reviews the **Terraform** in a human PR and submits ONE review. It is
287720
287724
  - **module & interface hygiene** \u2014 a variable losing its validation or its secure default, a sensitive output not marked \`sensitive\`.
287721
287725
  - **correctness** \u2014 would this pass \`terraform validate\`? deprecated arguments, wrong types, \`count\`/\`for_each\` index churn.
287722
287726
  Do NOT re-raise as a judgement anything an introduced finding already covers, and do not comment on pre-existing code the PR did not touch.
287727
+ When one judgement applies at several sites (the same constraint loosened in every root, the same block missing from each copy), post it ONCE, on the first site, and name the other \`file:line\` sites in that comment \u2014 never the same point once per file.
287723
287728
 
287724
287729
  If the Terraform change is **genuinely trivial** (a comment/whitespace-only edit, a tag value, a description string) AND there are no introduced findings, skip the lenses and submit a \`> \u2705 No new issues found.\` review.
287725
287730
 
@@ -319789,7 +319794,7 @@ async function runVerifyEvidenceCli2(params) {
319789
319794
  }
319790
319795
 
319791
319796
  // src/cli.ts
319792
- var VERSION14 = "0.3.8";
319797
+ var VERSION14 = "0.3.9";
319793
319798
  var bin = basename9(process.argv[1] || "");
319794
319799
  var PROG = bin === "pf" || bin === PRODUCT_SLUG ? bin : PRODUCT_SLUG;
319795
319800
  var rawArgs = process.argv.slice(2);
package/dist/index.js CHANGED
@@ -259203,7 +259203,7 @@ import { randomBytes as randomBytes2 } from "node:crypto";
259203
259203
  // package.json
259204
259204
  var package_default = {
259205
259205
  name: "infraweaver",
259206
- version: "0.3.8",
259206
+ version: "0.3.9",
259207
259207
  description: "GitHub Action that remediates Terraform to best practices and opens one scoped pull request per concern.",
259208
259208
  keywords: [
259209
259209
  "ai-coding-agent",
@@ -276963,6 +276963,7 @@ This mode reviews the **Terraform** in a human PR and submits ONE review. It is
276963
276963
  - **module & interface hygiene** \u2014 a variable losing its validation or its secure default, a sensitive output not marked \`sensitive\`.
276964
276964
  - **correctness** \u2014 would this pass \`terraform validate\`? deprecated arguments, wrong types, \`count\`/\`for_each\` index churn.
276965
276965
  Do NOT re-raise as a judgement anything an introduced finding already covers, and do not comment on pre-existing code the PR did not touch.
276966
+ When one judgement applies at several sites (the same constraint loosened in every root, the same block missing from each copy), post it ONCE, on the first site, and name the other \`file:line\` sites in that comment \u2014 never the same point once per file.
276966
276967
 
276967
276968
  If the Terraform change is **genuinely trivial** (a comment/whitespace-only edit, a tag value, a description string) AND there are no introduced findings, skip the lenses and submit a \`> \u2705 No new issues found.\` review.
276968
276969
 
@@ -280062,7 +280063,8 @@ function markPossibleRenames(introduced, resolved, headAddresses) {
280062
280063
  if (finding.address === null) continue;
280063
280064
  const dir = dirOf3(finding.concern.location.file);
280064
280065
  const match5 = vanished.find(
280065
- (r) => !used.has(r) && ruleKey(r.concern) === ruleKey(finding.concern) && // renamed in place, or moved elsewhere under its own name
280066
+ (r) => !used.has(r) && ruleKey(r.concern) === ruleKey(finding.concern) && // a `moved` block cannot change a resource's type
280067
+ typeOf(r.address) === typeOf(finding.address) && // renamed in place, or moved elsewhere under its own name
280066
280068
  dirOf3(r.concern.location.file) === dir !== (r.address === finding.address)
280067
280069
  );
280068
280070
  if (!match5) continue;
@@ -280071,6 +280073,9 @@ function markPossibleRenames(introduced, resolved, headAddresses) {
280071
280073
  finding.renamedFrom = { address: match5.address, file: match5.concern.location.file };
280072
280074
  }
280073
280075
  }
280076
+ function typeOf(address) {
280077
+ return address.slice(0, address.lastIndexOf("."));
280078
+ }
280074
280079
  function undeclaredRenames(introduced) {
280075
280080
  const byPair = /* @__PURE__ */ new Map();
280076
280081
  for (const f of introduced) {
package/dist/internal.js CHANGED
@@ -2251,6 +2251,7 @@ This mode reviews the **Terraform** in a human PR and submits ONE review. It is
2251
2251
  - **module & interface hygiene** \u2014 a variable losing its validation or its secure default, a sensitive output not marked \`sensitive\`.
2252
2252
  - **correctness** \u2014 would this pass \`terraform validate\`? deprecated arguments, wrong types, \`count\`/\`for_each\` index churn.
2253
2253
  Do NOT re-raise as a judgement anything an introduced finding already covers, and do not comment on pre-existing code the PR did not touch.
2254
+ When one judgement applies at several sites (the same constraint loosened in every root, the same block missing from each copy), post it ONCE, on the first site, and name the other \`file:line\` sites in that comment \u2014 never the same point once per file.
2254
2255
 
2255
2256
  If the Terraform change is **genuinely trivial** (a comment/whitespace-only edit, a tag value, a description string) AND there are no introduced findings, skip the lenses and submit a \`> \u2705 No new issues found.\` review.
2256
2257
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "infraweaver",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "GitHub Action that remediates Terraform to best practices and opens one scoped pull request per concern.",
5
5
  "keywords": [
6
6
  "ai-coding-agent",
@@ -298,6 +298,8 @@ function markPossibleRenames(
298
298
  (r) =>
299
299
  !used.has(r) &&
300
300
  ruleKey(r.concern) === ruleKey(finding.concern) &&
301
+ // a `moved` block cannot change a resource's type
302
+ typeOf(r.address as string) === typeOf(finding.address as string) &&
301
303
  // renamed in place, or moved elsewhere under its own name
302
304
  (dirOf(r.concern.location.file) === dir) !== (r.address === finding.address),
303
305
  );
@@ -308,6 +310,11 @@ function markPossibleRenames(
308
310
  }
309
311
  }
310
312
 
313
+ /** `aws_s3_bucket.logs` → `aws_s3_bucket`, `data.aws_iam_policy_document.x` → `data.aws_iam_policy_document`. */
314
+ function typeOf(address: string): string {
315
+ return address.slice(0, address.lastIndexOf("."));
316
+ }
317
+
311
318
  /** One resource that looks renamed (or moved to another directory) without a
312
319
  * `moved` block, and how many introduced findings ride on it. */
313
320
  export interface UndeclaredRename {
@@ -42,6 +42,7 @@ This mode reviews the **Terraform** in a human PR and submits ONE review. It is
42
42
  - **module & interface hygiene** — a variable losing its validation or its secure default, a sensitive output not marked \`sensitive\`.
43
43
  - **correctness** — would this pass \`terraform validate\`? deprecated arguments, wrong types, \`count\`/\`for_each\` index churn.
44
44
  Do NOT re-raise as a judgement anything an introduced finding already covers, and do not comment on pre-existing code the PR did not touch.
45
+ When one judgement applies at several sites (the same constraint loosened in every root, the same block missing from each copy), post it ONCE, on the first site, and name the other \`file:line\` sites in that comment — never the same point once per file.
45
46
 
46
47
  If the Terraform change is **genuinely trivial** (a comment/whitespace-only edit, a tag value, a description string) AND there are no introduced findings, skip the lenses and submit a \`> ✅ No new issues found.\` review.
47
48