infraweaver 0.3.8 → 0.3.10
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 +1 -1
- package/dist/cli.mjs +10 -4
- package/dist/index.js +8 -2
- package/dist/internal.js +1 -0
- package/package.json +1 -1
- package/src/mcp/review.ts +3 -0
- package/src/mcp/terraform/scanDelta.ts +7 -0
- package/src/modes/terraform-code-review.ts +1 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](LICENSE)
|
|
4
4
|
[](https://github.com/infraweaver-io/infraweaver-action/actions/workflows/test.yml)
|
|
5
|
-
[](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.
|
|
200493
|
+
version: "0.3.10",
|
|
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) && //
|
|
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.
|
|
284950
|
+
const raw2 = "0.3.10";
|
|
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
|
|
|
@@ -293000,6 +293005,7 @@ ${marker2}`;
|
|
|
293000
293005
|
await deleteProgressComment(ctx).catch((err) => {
|
|
293001
293006
|
log2.debug(`progress comment cleanup after review failed: ${err}`);
|
|
293002
293007
|
});
|
|
293008
|
+
ctx.toolState.progressComment = null;
|
|
293003
293009
|
if (ctx.toolState.checkoutSha && latestHeadSha && latestHeadSha !== ctx.toolState.checkoutSha) {
|
|
293004
293010
|
const fromSha = ctx.toolState.checkoutSha;
|
|
293005
293011
|
const toSha = latestHeadSha;
|
|
@@ -319789,7 +319795,7 @@ async function runVerifyEvidenceCli2(params) {
|
|
|
319789
319795
|
}
|
|
319790
319796
|
|
|
319791
319797
|
// src/cli.ts
|
|
319792
|
-
var VERSION14 = "0.3.
|
|
319798
|
+
var VERSION14 = "0.3.10";
|
|
319793
319799
|
var bin = basename9(process.argv[1] || "");
|
|
319794
319800
|
var PROG = bin === "pf" || bin === PRODUCT_SLUG ? bin : PRODUCT_SLUG;
|
|
319795
319801
|
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.
|
|
259206
|
+
version: "0.3.10",
|
|
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) && //
|
|
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) {
|
|
@@ -283380,6 +283385,7 @@ ${marker2}`;
|
|
|
283380
283385
|
await deleteProgressComment(ctx).catch((err) => {
|
|
283381
283386
|
log2.debug(`progress comment cleanup after review failed: ${err}`);
|
|
283382
283387
|
});
|
|
283388
|
+
ctx.toolState.progressComment = null;
|
|
283383
283389
|
if (ctx.toolState.checkoutSha && latestHeadSha && latestHeadSha !== ctx.toolState.checkoutSha) {
|
|
283384
283390
|
const fromSha = ctx.toolState.checkoutSha;
|
|
283385
283391
|
const toSha = latestHeadSha;
|
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
package/src/mcp/review.ts
CHANGED
|
@@ -1275,6 +1275,9 @@ export function CreatePullRequestReviewTool(ctx: GitHubWriteToolContext) {
|
|
|
1275
1275
|
await deleteProgressComment(ctx).catch((err) => {
|
|
1276
1276
|
log.debug(`progress comment cleanup after review failed: ${err}`);
|
|
1277
1277
|
});
|
|
1278
|
+
// also when there was none to delete: a later report_progress would
|
|
1279
|
+
// otherwise post a fresh comment beside the review
|
|
1280
|
+
ctx.toolState.progressComment = null;
|
|
1278
1281
|
|
|
1279
1282
|
// detect commits pushed since checkout and guide the agent to review them
|
|
1280
1283
|
// inline instead of dispatching a separate workflow run
|
|
@@ -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
|
|