@intentius/chant-lexicon-helm 0.13.0 → 0.15.0

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "b0be35edf9d26eb7bfd1eaefb678c7e1090b063afb2650fcf7bd4dec32bafc21",
4
+ "manifest.json": "e9c45b71032df595b1ec2b896d2d415658e96303870f93d6633570f1dd70fc2d",
5
5
  "meta.json": "14243c5730a07c6a6edc35ddd351438547d58df5cf345f2233a355b0c7611ccc",
6
6
  "types/index.d.ts": "5377696ca8698cd2999e4680feb8e8e4b54a7b49fb603a87b2f27356114d1794",
7
7
  "rules/chart-metadata.ts": "8f3377e893d5e2828460b7fe5924fca098334245a9a2fdb90f6b67e490eaf091",
@@ -34,5 +34,5 @@
34
34
  "skills/chant-helm-patterns.md": "9e79e6a46391da46709d8aa57e2825a7cd9eb981cd923f02ad60836c49b2561e",
35
35
  "skills/chant-helm-security.md": "bfc367eabceed2e84f1cf94501b407df78aeed963cec104f24a321d0962063c9"
36
36
  },
37
- "composite": "0b2b503e309bb233fbf8e404968e72919f47d1c897adeba9c735260e915de664"
37
+ "composite": "ddee3d896fa76b48a1f3ce60db8bb60356aab56fd43a9a50e53e1446c9de7e0e"
38
38
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The helm lexicon's chant audit catalog — metadata for its post-synth rules
3
+ * (WHM Helm-chart rules). Contributed via helmPlugin.auditCatalog() (#687).
4
+ */
5
+ import { type RuleMeta } from "@intentius/chant/audit/catalog";
6
+ export declare const helmAuditCatalog: Record<string, RuleMeta>;
7
+ //# sourceMappingURL=audit-catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAqD,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAElH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAsBrD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "helm",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "Helm",
6
6
  "intrinsics": [
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAiC,MAAM,0BAA0B,CAAC;AAS7F,eAAO,MAAM,UAAU,EAAE,aAsWxB,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAiC,MAAM,0BAA0B,CAAC;AAU7F,eAAO,MAAM,UAAU,EAAE,aAuWxB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-helm",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "Helm chart lexicon for chant — declarative IaC in TypeScript",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -69,6 +69,6 @@
69
69
  "typescript": "^5.9.3"
70
70
  },
71
71
  "peerDependencies": {
72
- "@intentius/chant": "^0.13.0"
72
+ "@intentius/chant": "^0.15.0"
73
73
  }
74
74
  }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The helm lexicon's chant audit catalog — metadata for its post-synth rules
3
+ * (WHM Helm-chart rules). Contributed via helmPlugin.auditCatalog() (#687).
4
+ */
5
+ import { auditRule, K8S_PSS, K8S_SECRETS, SCORECARD_PINNED, type RuleMeta } from "@intentius/chant/audit/catalog";
6
+
7
+ export const helmAuditCatalog: Record<string, RuleMeta> = {
8
+ WHM005: auditRule("WHM005", "report-only", "guidance", "Sub-chart wrapper with no templates", "Deploy the upstream chart directly instead of an empty wrapper.", { category: "best-practice" }),
9
+ WHM101: auditRule("WHM101", "merge-worthy", "guidance", "Chart.yaml missing required fields", "Set apiVersion (v2), name, and version in Chart.yaml.", { category: "correctness" }),
10
+ WHM102: auditRule("WHM102", "report-only", "guidance", "Missing values.schema.json", "Add a values.schema.json to validate values.", { category: "best-practice" }),
11
+ WHM103: auditRule("WHM103", "merge-worthy", "guidance", "Invalid Go template syntax", "Fix the unbalanced template braces.", { category: "correctness" }),
12
+ WHM104: auditRule("WHM104", "report-only", "guidance", "Missing NOTES.txt", "Add templates/NOTES.txt for application charts.", { category: "best-practice" }),
13
+ WHM105: auditRule("WHM105", "report-only", "guidance", "Missing _helpers.tpl", "Add templates/_helpers.tpl.", { category: "best-practice" }),
14
+ WHM201: auditRule("WHM201", "report-only", "guidance", "Missing standard Helm labels", "Add the recommended app.kubernetes.io labels.", { category: "best-practice" }),
15
+ WHM202: auditRule("WHM202", "report-only", "guidance", "Hook weights undefined", "Define hook weights when multiple hooks exist.", { category: "best-practice" }),
16
+ WHM203: auditRule("WHM203", "report-only", "guidance", "Undocumented values", "Document values via schema or comments.", { category: "best-practice" }),
17
+ WHM204: auditRule("WHM204", "report-only", "guidance", "Dependencies pinned, not ranged", "Use semver ranges for chart dependencies.", { category: "best-practice" }),
18
+ WHM301: auditRule("WHM301", "report-only", "guidance", "No Helm test", "Add at least one Helm test for application charts.", { category: "best-practice" }),
19
+ WHM302: auditRule("WHM302", "report-only", "guidance", "Container resources not set", "Set limits/requests via values or defaults.", { category: "best-practice" }),
20
+ WHM401: auditRule("WHM401", "merge-worthy", "guidance", "Container image uses :latest or no tag", "Pin the image to an explicit version tag.", { authority: [SCORECARD_PINNED] }),
21
+ WHM402: auditRule("WHM402", "merge-worthy", "guidance", "Container may run as root", "Set runAsNonRoot in the security context.", { authority: [K8S_PSS] }),
22
+ WHM403: auditRule("WHM403", "merge-worthy", "guidance", "Root filesystem writable", "Set readOnlyRootFilesystem.", { authority: [K8S_PSS] }),
23
+ WHM404: auditRule("WHM404", "merge-worthy", "guidance", "Privileged container", "Remove privileged mode.", { authority: [K8S_PSS] }),
24
+ WHM405: auditRule("WHM405", "report-only", "guidance", "Resource specs missing cpu/memory", "Set cpu and memory in limits/requests.", { category: "best-practice" }),
25
+ WHM406: auditRule("WHM406", "report-only", "guidance", "CRDs in crds/ are never upgraded", "Manage CRD upgrades outside Helm or via a separate chart.", { category: "best-practice" }),
26
+ WHM407: auditRule("WHM407", "merge-worthy", "guidance", "Inline Secret data", "Use ExternalSecret/SealedSecret instead of inline Secret data.", { authority: [K8S_SECRETS] }),
27
+ WHM501: auditRule("WHM501", "report-only", "guidance", "Unused values key", "Remove values defined but never referenced.", { category: "best-practice" }),
28
+ WHM502: auditRule("WHM502", "merge-worthy", "guidance", "Deprecated/invalid Kubernetes API version", "Update to a supported apiVersion.", { category: "correctness" }),
29
+ };
@@ -42,7 +42,7 @@ describe.skipIf(!hasGenerated)("helmCompletions", () => {
42
42
  }
43
43
  });
44
44
 
45
- test("limits results to 50", async () => {
45
+ test("caps the unfiltered `new ` dump", async () => {
46
46
  const { helmCompletions } = await import("./completions");
47
47
  const ctx = {
48
48
  uri: "file:///test.ts",
@@ -53,7 +53,8 @@ describe.skipIf(!hasGenerated)("helmCompletions", () => {
53
53
  };
54
54
 
55
55
  const items = helmCompletions(ctx);
56
- expect(items.length).toBeLessThanOrEqual(50);
56
+ // Bare `new ` returns a bounded sample; a typed prefix returns all matches (#600).
57
+ expect(items.length).toBeLessThanOrEqual(100);
57
58
  });
58
59
 
59
60
  test("returns empty for non-matching context", async () => {
package/src/plugin.ts CHANGED
@@ -9,6 +9,7 @@ import type { LexiconPlugin, IntrinsicDef, InitTemplateSet } from "@intentius/ch
9
9
  import { detectTemplate } from "./detect";
10
10
  import { discoverLintRules } from "@intentius/chant/lint/discover";
11
11
  import { postSynthChecks as postSynthCheckList } from "./lint/post-synth";
12
+ import { helmAuditCatalog } from "./lint/audit-catalog";
12
13
  import { createSkillsLoader, createDiffTool } from "@intentius/chant/lexicon-plugin-helpers";
13
14
  import { join, dirname } from "path";
14
15
  import { fileURLToPath } from "url";
@@ -16,6 +17,7 @@ import { helmSerializer } from "./serializer";
16
17
 
17
18
  export const helmPlugin: LexiconPlugin = {
18
19
  name: "helm",
20
+ auditCatalog: () => helmAuditCatalog,
19
21
  serializer: helmSerializer,
20
22
 
21
23
  lintRules() {