@intentius/chant-lexicon-temporal 0.7.0 → 0.8.1

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.
Files changed (107) hide show
  1. package/dist/codegen/docs-cli.d.ts +3 -0
  2. package/dist/codegen/docs-cli.d.ts.map +1 -0
  3. package/dist/codegen/docs.d.ts +7 -0
  4. package/dist/codegen/docs.d.ts.map +1 -0
  5. package/dist/codegen/generate-cli.d.ts +3 -0
  6. package/dist/codegen/generate-cli.d.ts.map +1 -0
  7. package/dist/codegen/generate.d.ts +16 -0
  8. package/dist/codegen/generate.d.ts.map +1 -0
  9. package/dist/codegen/package-cli.d.ts +3 -0
  10. package/dist/codegen/package-cli.d.ts.map +1 -0
  11. package/dist/codegen/package.d.ts +10 -0
  12. package/dist/codegen/package.d.ts.map +1 -0
  13. package/dist/composites/apply-op.d.ts +73 -0
  14. package/dist/composites/apply-op.d.ts.map +1 -0
  15. package/dist/composites/cloud-stack.d.ts +54 -0
  16. package/dist/composites/cloud-stack.d.ts.map +1 -0
  17. package/dist/composites/dev-stack.d.ts +63 -0
  18. package/dist/composites/dev-stack.d.ts.map +1 -0
  19. package/dist/composites/pipeline-audit-op.d.ts +55 -0
  20. package/dist/composites/pipeline-audit-op.d.ts.map +1 -0
  21. package/dist/composites/reconcile-op.d.ts +62 -0
  22. package/dist/composites/reconcile-op.d.ts.map +1 -0
  23. package/dist/composites/watch-op.d.ts +56 -0
  24. package/dist/composites/watch-op.d.ts.map +1 -0
  25. package/dist/composites/workflow-audit-op.d.ts +61 -0
  26. package/dist/composites/workflow-audit-op.d.ts.map +1 -0
  27. package/dist/config.d.ts +197 -0
  28. package/dist/config.d.ts.map +1 -0
  29. package/dist/coverage.d.ts +15 -0
  30. package/dist/coverage.d.ts.map +1 -0
  31. package/dist/describe-resources.d.ts +26 -0
  32. package/dist/describe-resources.d.ts.map +1 -0
  33. package/dist/index.d.ts +23 -0
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/integrity.json +5 -5
  36. package/dist/lint/post-synth/index.d.ts +3 -0
  37. package/dist/lint/post-synth/index.d.ts.map +1 -0
  38. package/dist/lint/post-synth/tmp001-retention-too-short.d.ts +10 -0
  39. package/dist/lint/post-synth/tmp001-retention-too-short.d.ts.map +1 -0
  40. package/dist/lint/post-synth/tmp002-allowall-without-note.d.ts +11 -0
  41. package/dist/lint/post-synth/tmp002-allowall-without-note.d.ts.map +1 -0
  42. package/dist/lint/post-synth/tmp010-cron-syntax.d.ts +12 -0
  43. package/dist/lint/post-synth/tmp010-cron-syntax.d.ts.map +1 -0
  44. package/dist/lint/post-synth/tmp011-namespace-reference.d.ts +10 -0
  45. package/dist/lint/post-synth/tmp011-namespace-reference.d.ts.map +1 -0
  46. package/dist/manifest.json +1 -1
  47. package/dist/op/activities/apply.d.ts +70 -0
  48. package/dist/op/activities/apply.d.ts.map +1 -0
  49. package/dist/op/activities/argo.d.ts +56 -0
  50. package/dist/op/activities/argo.d.ts.map +1 -0
  51. package/dist/op/activities/build.d.ts +11 -0
  52. package/dist/op/activities/build.d.ts.map +1 -0
  53. package/dist/op/activities/gitlab.d.ts +15 -0
  54. package/dist/op/activities/gitlab.d.ts.map +1 -0
  55. package/dist/op/activities/heartbeat.d.ts +27 -0
  56. package/dist/op/activities/heartbeat.d.ts.map +1 -0
  57. package/dist/op/activities/helm.d.ts +18 -0
  58. package/dist/op/activities/helm.d.ts.map +1 -0
  59. package/dist/op/activities/index.d.ts +29 -0
  60. package/dist/op/activities/index.d.ts.map +1 -0
  61. package/dist/op/activities/kubectl.d.ts +11 -0
  62. package/dist/op/activities/kubectl.d.ts.map +1 -0
  63. package/dist/op/activities/lifecycle.d.ts +42 -0
  64. package/dist/op/activities/lifecycle.d.ts.map +1 -0
  65. package/dist/op/activities/pipeline-audit.d.ts +84 -0
  66. package/dist/op/activities/pipeline-audit.d.ts.map +1 -0
  67. package/dist/op/activities/policy.d.ts +17 -0
  68. package/dist/op/activities/policy.d.ts.map +1 -0
  69. package/dist/op/activities/reconcile.d.ts +69 -0
  70. package/dist/op/activities/reconcile.d.ts.map +1 -0
  71. package/dist/op/activities/shell.d.ts +13 -0
  72. package/dist/op/activities/shell.d.ts.map +1 -0
  73. package/dist/op/activities/teardown.d.ts +10 -0
  74. package/dist/op/activities/teardown.d.ts.map +1 -0
  75. package/dist/op/activities/util.d.ts +8 -0
  76. package/dist/op/activities/util.d.ts.map +1 -0
  77. package/dist/op/activities/wait.d.ts +16 -0
  78. package/dist/op/activities/wait.d.ts.map +1 -0
  79. package/dist/op/activities/workflow-audit.d.ts +92 -0
  80. package/dist/op/activities/workflow-audit.d.ts.map +1 -0
  81. package/dist/op/serializer.d.ts +20 -0
  82. package/dist/op/serializer.d.ts.map +1 -0
  83. package/dist/plugin.d.ts +10 -0
  84. package/dist/plugin.d.ts.map +1 -0
  85. package/dist/resources.d.ts +101 -0
  86. package/dist/resources.d.ts.map +1 -0
  87. package/dist/rules/{tmp001.ts → tmp001-retention-too-short.ts} +9 -11
  88. package/dist/rules/{tmp002.ts → tmp002-allowall-without-note.ts} +9 -11
  89. package/dist/rules/tmp011-namespace-reference.ts +2 -2
  90. package/dist/serializer.d.ts +15 -0
  91. package/dist/serializer.d.ts.map +1 -0
  92. package/dist/validate-cli.d.ts +3 -0
  93. package/dist/validate-cli.d.ts.map +1 -0
  94. package/dist/validate.d.ts +18 -0
  95. package/dist/validate.d.ts.map +1 -0
  96. package/package.json +27 -6
  97. package/src/lint/post-synth/index.ts +13 -0
  98. package/src/lint/post-synth/post-synth.test.ts +124 -1
  99. package/src/lint/{rules/tmp001.ts → post-synth/tmp001-retention-too-short.ts} +9 -11
  100. package/src/lint/{rules/tmp002.ts → post-synth/tmp002-allowall-without-note.ts} +9 -11
  101. package/src/lint/post-synth/tmp011-namespace-reference.ts +2 -2
  102. package/src/op/serializer.ts +2 -2
  103. package/src/plugin.test.ts +5 -6
  104. package/src/plugin.ts +2 -12
  105. package/src/serializer.ts +6 -6
  106. package/src/lint/rules/index.ts +0 -2
  107. package/src/lint/rules/lint-rules.test.ts +0 -150
@@ -1,150 +0,0 @@
1
- /**
2
- * Lint rule tests — TMP001, TMP002.
3
- */
4
-
5
- import { describe, test, expect } from "vitest";
6
- import type { LintContext } from "@intentius/chant/lint/rule";
7
- import { DECLARABLE_MARKER } from "@intentius/chant/declarable";
8
- import { tmp001 } from "./tmp001";
9
- import { tmp002 } from "./tmp002";
10
-
11
- // ── Helpers ─────────────────────────────────────────────────────────
12
-
13
- function makeEntity(entityType: string, props: Record<string, unknown>) {
14
- return {
15
- [DECLARABLE_MARKER]: true,
16
- entityType,
17
- lexicon: "temporal",
18
- kind: "resource",
19
- props,
20
- attributes: {},
21
- };
22
- }
23
-
24
- function makeCtx(entities: Map<string, unknown>): LintContext {
25
- return {
26
- entities: entities as Map<string, never>,
27
- project: { name: "test" } as never,
28
- };
29
- }
30
-
31
- // ── TMP001: retention-too-short ──────────────────────────────────────
32
-
33
- describe("TMP001: retention-too-short", () => {
34
- test("flags namespace with 1d retention", () => {
35
- const ctx = makeCtx(new Map([
36
- ["ns", makeEntity("Temporal::Namespace", { name: "default", retention: "1d" })],
37
- ]));
38
- const diags = tmp001.check(ctx);
39
- expect(diags).toHaveLength(1);
40
- expect(diags[0].ruleId).toBe("TMP001");
41
- expect(diags[0].severity).toBe("error");
42
- expect(diags[0].message).toContain("1d");
43
- });
44
-
45
- test("flags namespace with 48h retention", () => {
46
- const ctx = makeCtx(new Map([
47
- ["ns", makeEntity("Temporal::Namespace", { name: "default", retention: "48h" })],
48
- ]));
49
- const diags = tmp001.check(ctx);
50
- expect(diags).toHaveLength(1);
51
- expect(diags[0].ruleId).toBe("TMP001");
52
- });
53
-
54
- test("passes with 3d retention (exactly at threshold)", () => {
55
- const ctx = makeCtx(new Map([
56
- ["ns", makeEntity("Temporal::Namespace", { name: "default", retention: "3d" })],
57
- ]));
58
- expect(tmp001.check(ctx)).toHaveLength(0);
59
- });
60
-
61
- test("passes with 7d retention", () => {
62
- const ctx = makeCtx(new Map([
63
- ["ns", makeEntity("Temporal::Namespace", { name: "default", retention: "7d" })],
64
- ]));
65
- expect(tmp001.check(ctx)).toHaveLength(0);
66
- });
67
-
68
- test("passes when retention is unset (defaults to 7d)", () => {
69
- const ctx = makeCtx(new Map([
70
- ["ns", makeEntity("Temporal::Namespace", { name: "default" })],
71
- ]));
72
- expect(tmp001.check(ctx)).toHaveLength(0);
73
- });
74
-
75
- test("skips non-namespace entities", () => {
76
- const ctx = makeCtx(new Map([
77
- ["s", makeEntity("Temporal::Server", { mode: "dev" })],
78
- ]));
79
- expect(tmp001.check(ctx)).toHaveLength(0);
80
- });
81
-
82
- test("skips unrecognised retention format", () => {
83
- const ctx = makeCtx(new Map([
84
- ["ns", makeEntity("Temporal::Namespace", { name: "default", retention: "1week" })],
85
- ]));
86
- expect(tmp001.check(ctx)).toHaveLength(0);
87
- });
88
- });
89
-
90
- // ── TMP002: allowall-without-note ────────────────────────────────────
91
-
92
- describe("TMP002: allowall-without-note", () => {
93
- test("warns for AllowAll overlap without state.note", () => {
94
- const ctx = makeCtx(new Map([
95
- ["sched", makeEntity("Temporal::Schedule", {
96
- scheduleId: "heavy-job",
97
- spec: { cronExpressions: ["0 * * * *"] },
98
- action: { workflowType: "heavyWorkflow", taskQueue: "heavy" },
99
- policies: { overlap: "AllowAll" },
100
- })],
101
- ]));
102
- const diags = tmp002.check(ctx);
103
- expect(diags).toHaveLength(1);
104
- expect(diags[0].ruleId).toBe("TMP002");
105
- expect(diags[0].severity).toBe("warning");
106
- });
107
-
108
- test("passes when AllowAll has a note", () => {
109
- const ctx = makeCtx(new Map([
110
- ["sched", makeEntity("Temporal::Schedule", {
111
- scheduleId: "heavy-job",
112
- spec: { cronExpressions: ["0 * * * *"] },
113
- action: { workflowType: "heavyWorkflow", taskQueue: "heavy" },
114
- policies: { overlap: "AllowAll" },
115
- state: { note: "Workflow is idempotent — concurrent runs are safe" },
116
- })],
117
- ]));
118
- expect(tmp002.check(ctx)).toHaveLength(0);
119
- });
120
-
121
- test("passes for Skip overlap (no note needed)", () => {
122
- const ctx = makeCtx(new Map([
123
- ["sched", makeEntity("Temporal::Schedule", {
124
- scheduleId: "daily",
125
- spec: { cronExpressions: ["0 3 * * *"] },
126
- action: { workflowType: "dailyWorkflow", taskQueue: "daily" },
127
- policies: { overlap: "Skip" },
128
- })],
129
- ]));
130
- expect(tmp002.check(ctx)).toHaveLength(0);
131
- });
132
-
133
- test("passes when no policies set", () => {
134
- const ctx = makeCtx(new Map([
135
- ["sched", makeEntity("Temporal::Schedule", {
136
- scheduleId: "daily",
137
- spec: { cronExpressions: ["0 3 * * *"] },
138
- action: { workflowType: "dailyWorkflow", taskQueue: "daily" },
139
- })],
140
- ]));
141
- expect(tmp002.check(ctx)).toHaveLength(0);
142
- });
143
-
144
- test("skips non-schedule entities", () => {
145
- const ctx = makeCtx(new Map([
146
- ["ns", makeEntity("Temporal::Namespace", { name: "default" })],
147
- ]));
148
- expect(tmp002.check(ctx)).toHaveLength(0);
149
- });
150
- });