@eddacraft/anvil-core 0.1.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.
Files changed (215) hide show
  1. package/LICENSE +14 -0
  2. package/dist/antipattern/index.d.ts +11 -0
  3. package/dist/antipattern/index.d.ts.map +1 -0
  4. package/dist/antipattern/index.js +31 -0
  5. package/dist/antipattern/patterns-css.d.ts +17 -0
  6. package/dist/antipattern/patterns-css.d.ts.map +1 -0
  7. package/dist/antipattern/patterns-css.js +72 -0
  8. package/dist/antipattern/patterns-html.d.ts +21 -0
  9. package/dist/antipattern/patterns-html.d.ts.map +1 -0
  10. package/dist/antipattern/patterns-html.js +139 -0
  11. package/dist/antipattern/patterns.d.ts +72 -0
  12. package/dist/antipattern/patterns.d.ts.map +1 -0
  13. package/dist/antipattern/patterns.js +301 -0
  14. package/dist/antipattern/scanner.d.ts +32 -0
  15. package/dist/antipattern/scanner.d.ts.map +1 -0
  16. package/dist/antipattern/scanner.js +89 -0
  17. package/dist/antipattern/types.d.ts +318 -0
  18. package/dist/antipattern/types.d.ts.map +1 -0
  19. package/dist/antipattern/types.js +278 -0
  20. package/dist/architecture/analyzer.d.ts +123 -0
  21. package/dist/architecture/analyzer.d.ts.map +1 -0
  22. package/dist/architecture/analyzer.js +321 -0
  23. package/dist/architecture/baseline.d.ts +112 -0
  24. package/dist/architecture/baseline.d.ts.map +1 -0
  25. package/dist/architecture/baseline.js +245 -0
  26. package/dist/architecture/compiler.d.ts +24 -0
  27. package/dist/architecture/compiler.d.ts.map +1 -0
  28. package/dist/architecture/compiler.js +57 -0
  29. package/dist/architecture/context.d.ts +129 -0
  30. package/dist/architecture/context.d.ts.map +1 -0
  31. package/dist/architecture/context.js +116 -0
  32. package/dist/architecture/dc-generator.d.ts +9 -0
  33. package/dist/architecture/dc-generator.d.ts.map +1 -0
  34. package/dist/architecture/dc-generator.js +220 -0
  35. package/dist/architecture/definition-schema.d.ts +128 -0
  36. package/dist/architecture/definition-schema.d.ts.map +1 -0
  37. package/dist/architecture/definition-schema.js +94 -0
  38. package/dist/architecture/edge-detector-html.d.ts +6 -0
  39. package/dist/architecture/edge-detector-html.d.ts.map +1 -0
  40. package/dist/architecture/edge-detector-html.js +5 -0
  41. package/dist/architecture/edge-detector-web.d.ts +32 -0
  42. package/dist/architecture/edge-detector-web.d.ts.map +1 -0
  43. package/dist/architecture/edge-detector-web.js +133 -0
  44. package/dist/architecture/edge-detector.d.ts +116 -0
  45. package/dist/architecture/edge-detector.d.ts.map +1 -0
  46. package/dist/architecture/edge-detector.js +229 -0
  47. package/dist/architecture/entry-detector.d.ts +44 -0
  48. package/dist/architecture/entry-detector.d.ts.map +1 -0
  49. package/dist/architecture/entry-detector.js +263 -0
  50. package/dist/architecture/index.d.ts +21 -0
  51. package/dist/architecture/index.d.ts.map +1 -0
  52. package/dist/architecture/index.js +48 -0
  53. package/dist/architecture/layer-detector.d.ts +60 -0
  54. package/dist/architecture/layer-detector.d.ts.map +1 -0
  55. package/dist/architecture/layer-detector.js +331 -0
  56. package/dist/architecture/rego-generator.d.ts +25 -0
  57. package/dist/architecture/rego-generator.d.ts.map +1 -0
  58. package/dist/architecture/rego-generator.js +229 -0
  59. package/dist/architecture/templates/index.d.ts +39 -0
  60. package/dist/architecture/templates/index.d.ts.map +1 -0
  61. package/dist/architecture/templates/index.js +124 -0
  62. package/dist/architecture/types.d.ts +280 -0
  63. package/dist/architecture/types.d.ts.map +1 -0
  64. package/dist/architecture/types.js +269 -0
  65. package/dist/architecture/yaml-parser.d.ts +13 -0
  66. package/dist/architecture/yaml-parser.d.ts.map +1 -0
  67. package/dist/architecture/yaml-parser.js +234 -0
  68. package/dist/config/constants.d.ts +9 -0
  69. package/dist/config/constants.d.ts.map +1 -0
  70. package/dist/config/constants.js +20 -0
  71. package/dist/config/index.d.ts +9 -0
  72. package/dist/config/index.d.ts.map +1 -0
  73. package/dist/config/index.js +8 -0
  74. package/dist/config/loader.d.ts +41 -0
  75. package/dist/config/loader.d.ts.map +1 -0
  76. package/dist/config/loader.js +76 -0
  77. package/dist/config/nudge-config.d.ts +35 -0
  78. package/dist/config/nudge-config.d.ts.map +1 -0
  79. package/dist/config/nudge-config.js +34 -0
  80. package/dist/config/types.d.ts +30 -0
  81. package/dist/config/types.d.ts.map +1 -0
  82. package/dist/config/types.js +4 -0
  83. package/dist/contracts/index.d.ts +14 -0
  84. package/dist/contracts/index.d.ts.map +1 -0
  85. package/dist/contracts/index.js +13 -0
  86. package/dist/contracts/schemas/aps.schema.d.ts +269 -0
  87. package/dist/contracts/schemas/aps.schema.d.ts.map +1 -0
  88. package/dist/contracts/schemas/aps.schema.js +183 -0
  89. package/dist/contracts/schemas/index.d.ts +12 -0
  90. package/dist/contracts/schemas/index.d.ts.map +1 -0
  91. package/dist/contracts/schemas/index.js +14 -0
  92. package/dist/contracts/schemas/json-schema.d.ts +14 -0
  93. package/dist/contracts/schemas/json-schema.d.ts.map +1 -0
  94. package/dist/contracts/schemas/json-schema.js +31 -0
  95. package/dist/contracts/schemas/warning.schema.d.ts +171 -0
  96. package/dist/contracts/schemas/warning.schema.d.ts.map +1 -0
  97. package/dist/contracts/schemas/warning.schema.js +123 -0
  98. package/dist/contracts/types/gate.types.d.ts +194 -0
  99. package/dist/contracts/types/gate.types.d.ts.map +1 -0
  100. package/dist/contracts/types/gate.types.js +19 -0
  101. package/dist/contracts/types/index.d.ts +9 -0
  102. package/dist/contracts/types/index.d.ts.map +1 -0
  103. package/dist/contracts/types/index.js +8 -0
  104. package/dist/crypto/hash.d.ts +47 -0
  105. package/dist/crypto/hash.d.ts.map +1 -0
  106. package/dist/crypto/hash.js +110 -0
  107. package/dist/crypto/index.d.ts +7 -0
  108. package/dist/crypto/index.d.ts.map +1 -0
  109. package/dist/crypto/index.js +6 -0
  110. package/dist/drift/index.d.ts +6 -0
  111. package/dist/drift/index.d.ts.map +1 -0
  112. package/dist/drift/index.js +5 -0
  113. package/dist/drift/report-generator.d.ts +21 -0
  114. package/dist/drift/report-generator.d.ts.map +1 -0
  115. package/dist/drift/report-generator.js +240 -0
  116. package/dist/drift/snapshot-capture.d.ts +26 -0
  117. package/dist/drift/snapshot-capture.d.ts.map +1 -0
  118. package/dist/drift/snapshot-capture.js +195 -0
  119. package/dist/drift/snapshot-compare.d.ts +50 -0
  120. package/dist/drift/snapshot-compare.d.ts.map +1 -0
  121. package/dist/drift/snapshot-compare.js +142 -0
  122. package/dist/drift/snapshot-schema.d.ts +197 -0
  123. package/dist/drift/snapshot-schema.d.ts.map +1 -0
  124. package/dist/drift/snapshot-schema.js +193 -0
  125. package/dist/drift/snapshot-storage.d.ts +25 -0
  126. package/dist/drift/snapshot-storage.d.ts.map +1 -0
  127. package/dist/drift/snapshot-storage.js +179 -0
  128. package/dist/explain/antipattern-explainer.d.ts +4 -0
  129. package/dist/explain/antipattern-explainer.d.ts.map +1 -0
  130. package/dist/explain/antipattern-explainer.js +196 -0
  131. package/dist/explain/boundary-explainer.d.ts +5 -0
  132. package/dist/explain/boundary-explainer.d.ts.map +1 -0
  133. package/dist/explain/boundary-explainer.js +261 -0
  134. package/dist/explain/explain-service.d.ts +19 -0
  135. package/dist/explain/explain-service.d.ts.map +1 -0
  136. package/dist/explain/explain-service.js +106 -0
  137. package/dist/explain/index.d.ts +7 -0
  138. package/dist/explain/index.d.ts.map +1 -0
  139. package/dist/explain/index.js +5 -0
  140. package/dist/explain/template-loader.d.ts +9 -0
  141. package/dist/explain/template-loader.d.ts.map +1 -0
  142. package/dist/explain/template-loader.js +51 -0
  143. package/dist/explain/types.d.ts +46 -0
  144. package/dist/explain/types.d.ts.map +1 -0
  145. package/dist/explain/types.js +31 -0
  146. package/dist/index.d.ts +26 -0
  147. package/dist/index.d.ts.map +1 -0
  148. package/dist/index.js +37 -0
  149. package/dist/provenance/collector.d.ts +86 -0
  150. package/dist/provenance/collector.d.ts.map +1 -0
  151. package/dist/provenance/collector.js +425 -0
  152. package/dist/provenance/git-ai-standard/git-notes.d.ts +85 -0
  153. package/dist/provenance/git-ai-standard/git-notes.d.ts.map +1 -0
  154. package/dist/provenance/git-ai-standard/git-notes.js +292 -0
  155. package/dist/provenance/git-ai-standard/index.d.ts +44 -0
  156. package/dist/provenance/git-ai-standard/index.d.ts.map +1 -0
  157. package/dist/provenance/git-ai-standard/index.js +47 -0
  158. package/dist/provenance/git-ai-standard/serializer.d.ts +54 -0
  159. package/dist/provenance/git-ai-standard/serializer.d.ts.map +1 -0
  160. package/dist/provenance/git-ai-standard/serializer.js +224 -0
  161. package/dist/provenance/git-ai-standard/session.d.ts +51 -0
  162. package/dist/provenance/git-ai-standard/session.d.ts.map +1 -0
  163. package/dist/provenance/git-ai-standard/session.js +118 -0
  164. package/dist/provenance/git-ai-standard/types.d.ts +173 -0
  165. package/dist/provenance/git-ai-standard/types.d.ts.map +1 -0
  166. package/dist/provenance/git-ai-standard/types.js +109 -0
  167. package/dist/provenance/index.d.ts +5 -0
  168. package/dist/provenance/index.d.ts.map +1 -0
  169. package/dist/provenance/index.js +6 -0
  170. package/dist/provenance/store.d.ts +83 -0
  171. package/dist/provenance/store.d.ts.map +1 -0
  172. package/dist/provenance/store.js +248 -0
  173. package/dist/provenance/types.d.ts +160 -0
  174. package/dist/provenance/types.d.ts.map +1 -0
  175. package/dist/provenance/types.js +112 -0
  176. package/dist/suppression/index.d.ts +4 -0
  177. package/dist/suppression/index.d.ts.map +1 -0
  178. package/dist/suppression/index.js +3 -0
  179. package/dist/suppression/parser.d.ts +31 -0
  180. package/dist/suppression/parser.d.ts.map +1 -0
  181. package/dist/suppression/parser.js +219 -0
  182. package/dist/suppression/service.d.ts +29 -0
  183. package/dist/suppression/service.d.ts.map +1 -0
  184. package/dist/suppression/service.js +132 -0
  185. package/dist/suppression/store.d.ts +61 -0
  186. package/dist/suppression/store.d.ts.map +1 -0
  187. package/dist/suppression/store.js +169 -0
  188. package/dist/utils/debug.d.ts +48 -0
  189. package/dist/utils/debug.d.ts.map +1 -0
  190. package/dist/utils/debug.js +100 -0
  191. package/dist/utils/index.d.ts +4 -0
  192. package/dist/utils/index.d.ts.map +1 -0
  193. package/dist/utils/index.js +3 -0
  194. package/dist/utils/path-safety.d.ts +21 -0
  195. package/dist/utils/path-safety.d.ts.map +1 -0
  196. package/dist/utils/path-safety.js +49 -0
  197. package/dist/utils/severity.d.ts +37 -0
  198. package/dist/utils/severity.d.ts.map +1 -0
  199. package/dist/utils/severity.js +22 -0
  200. package/dist/validation/aps-validator.d.ts +66 -0
  201. package/dist/validation/aps-validator.d.ts.map +1 -0
  202. package/dist/validation/aps-validator.js +173 -0
  203. package/dist/validation/errors.d.ts +52 -0
  204. package/dist/validation/errors.d.ts.map +1 -0
  205. package/dist/validation/errors.js +115 -0
  206. package/dist/validation/index.d.ts +8 -0
  207. package/dist/validation/index.d.ts.map +1 -0
  208. package/dist/validation/index.js +13 -0
  209. package/dist/warnings/index.d.ts +2 -0
  210. package/dist/warnings/index.d.ts.map +1 -0
  211. package/dist/warnings/index.js +1 -0
  212. package/dist/warnings/warning-id.d.ts +180 -0
  213. package/dist/warnings/warning-id.d.ts.map +1 -0
  214. package/dist/warnings/warning-id.js +257 -0
  215. package/package.json +79 -0
@@ -0,0 +1,12 @@
1
+ /**
2
+ * APS Schema Module
3
+ *
4
+ * This module exports the Anvil Plan Specification (APS) schema definitions,
5
+ * TypeScript types, validation utilities, and JSON Schema generation.
6
+ */
7
+ export { APSPlanSchema, ChangeSchema, ChangeTypeSchema, ProvenanceSchema, ValidationSchema, EvidenceSchema, EvidenceEntrySchema, ApprovalSchema, ExecutionResultSchema, } from './aps.schema.js';
8
+ export type { APSPlan, Change, ChangeType, Provenance, Validation, Evidence, EvidenceEntry, Approval, ExecutionResult, SchemaValidationResult, } from './aps.schema.js';
9
+ export { validatePlan, createPlan, APS_SCHEMA_VERSION } from './aps.schema.js';
10
+ export * from './warning.schema.js';
11
+ export { generateJSONSchema } from './json-schema.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contracts/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EACV,OAAO,EACP,MAAM,EACN,UAAU,EACV,UAAU,EACV,UAAU,EACV,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,eAAe,EACf,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG/E,cAAc,qBAAqB,CAAC;AAGpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * APS Schema Module
3
+ *
4
+ * This module exports the Anvil Plan Specification (APS) schema definitions,
5
+ * TypeScript types, validation utilities, and JSON Schema generation.
6
+ */
7
+ // Re-export all Zod schemas
8
+ export { APSPlanSchema, ChangeSchema, ChangeTypeSchema, ProvenanceSchema, ValidationSchema, EvidenceSchema, EvidenceEntrySchema, ApprovalSchema, ExecutionResultSchema, } from './aps.schema.js';
9
+ // Re-export utility functions
10
+ export { validatePlan, createPlan, APS_SCHEMA_VERSION } from './aps.schema.js';
11
+ // Warning schema (planless checks)
12
+ export * from './warning.schema.js';
13
+ // Export JSON Schema generation utilities
14
+ export { generateJSONSchema } from './json-schema.js';
@@ -0,0 +1,14 @@
1
+ import type { JSONSchema7 } from 'json-schema';
2
+ /**
3
+ * Generate JSON Schema from the Zod schema
4
+ * This can be used for external tooling, documentation, or validation
5
+ * with tools that require JSON Schema format
6
+ *
7
+ * Uses Zod v4's native z.toJSONSchema() function for conversion
8
+ */
9
+ export declare function generateJSONSchema(): JSONSchema7;
10
+ /**
11
+ * Get a formatted JSON Schema string
12
+ */
13
+ export declare function getJSONSchemaString(pretty?: boolean): string;
14
+ //# sourceMappingURL=json-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../../../src/contracts/schemas/json-schema.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,WAAW,CAuBhD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,UAAO,GAAG,MAAM,CAGzD"}
@@ -0,0 +1,31 @@
1
+ import * as z from 'zod';
2
+ import { APSPlanSchema, APS_SCHEMA_VERSION } from './aps.schema.js';
3
+ /**
4
+ * Generate JSON Schema from the Zod schema
5
+ * This can be used for external tooling, documentation, or validation
6
+ * with tools that require JSON Schema format
7
+ *
8
+ * Uses Zod v4's native z.toJSONSchema() function for conversion
9
+ */
10
+ export function generateJSONSchema() {
11
+ // Use Zod v4's native JSON Schema converter
12
+ const jsonSchema = z.toJSONSchema(APSPlanSchema, {
13
+ target: 'draft-7', // Target JSON Schema Draft 7
14
+ });
15
+ const schemaWithMetadata = {
16
+ ...jsonSchema,
17
+ $schema: 'http://json-schema.org/draft-07/schema#',
18
+ $id: `https://anvil.dev/schemas/aps/${APS_SCHEMA_VERSION}/plan.json`,
19
+ title: 'Anvil Plan Specification (APS)',
20
+ description: 'Schema for Anvil Plan Specification - a deterministic plan format for development automation',
21
+ version: APS_SCHEMA_VERSION,
22
+ };
23
+ return schemaWithMetadata;
24
+ }
25
+ /**
26
+ * Get a formatted JSON Schema string
27
+ */
28
+ export function getJSONSchemaString(pretty = true) {
29
+ const schema = generateJSONSchema();
30
+ return pretty ? JSON.stringify(schema, null, 2) : JSON.stringify(schema);
31
+ }
@@ -0,0 +1,171 @@
1
+ /**
2
+ * Warning types for @eddacraft/anvil-contracts
3
+ *
4
+ * Minimal type definitions for warnings used across packages.
5
+ * Full Zod schemas and utilities are in @eddacraft/anvil-core.
6
+ */
7
+ import { z } from 'zod';
8
+ export declare const LocationSchema: z.ZodObject<{
9
+ file: z.ZodString;
10
+ line: z.ZodNumber;
11
+ column: z.ZodOptional<z.ZodNumber>;
12
+ endLine: z.ZodOptional<z.ZodNumber>;
13
+ endColumn: z.ZodOptional<z.ZodNumber>;
14
+ }, z.core.$strip>;
15
+ export type Location = z.infer<typeof LocationSchema>;
16
+ export declare const DriftSchema: z.ZodObject<{
17
+ isNew: z.ZodBoolean;
18
+ existingCount: z.ZodOptional<z.ZodNumber>;
19
+ baselineId: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strip>;
21
+ export type Drift = z.infer<typeof DriftSchema>;
22
+ export declare const SuppressionSchema: z.ZodObject<{
23
+ reason: z.ZodString;
24
+ author: z.ZodOptional<z.ZodString>;
25
+ timestamp: z.ZodOptional<z.ZodString>;
26
+ scope: z.ZodEnum<{
27
+ file: "file";
28
+ line: "line";
29
+ statement: "statement";
30
+ import: "import";
31
+ }>;
32
+ }, z.core.$strip>;
33
+ export type Suppression = z.infer<typeof SuppressionSchema>;
34
+ export declare const WarningCategorySchema: z.ZodEnum<{
35
+ "anti-pattern": "anti-pattern";
36
+ boundary: "boundary";
37
+ architecture: "architecture";
38
+ }>;
39
+ export type WarningCategory = z.infer<typeof WarningCategorySchema>;
40
+ export declare const WarningSeveritySchema: z.ZodEnum<{
41
+ warning: "warning";
42
+ error: "error";
43
+ info: "info";
44
+ }>;
45
+ export type WarningSeverity = z.infer<typeof WarningSeveritySchema>;
46
+ export declare const ConfidenceSchema: z.ZodEnum<{
47
+ high: "high";
48
+ medium: "medium";
49
+ low: "low";
50
+ }>;
51
+ export type Confidence = z.infer<typeof ConfidenceSchema>;
52
+ export declare const WarningSchema: z.ZodObject<{
53
+ id: z.ZodString;
54
+ fingerprint: z.ZodOptional<z.ZodString>;
55
+ category: z.ZodEnum<{
56
+ "anti-pattern": "anti-pattern";
57
+ boundary: "boundary";
58
+ architecture: "architecture";
59
+ }>;
60
+ severity: z.ZodEnum<{
61
+ warning: "warning";
62
+ error: "error";
63
+ info: "info";
64
+ }>;
65
+ confidence: z.ZodEnum<{
66
+ high: "high";
67
+ medium: "medium";
68
+ low: "low";
69
+ }>;
70
+ title: z.ZodString;
71
+ message: z.ZodString;
72
+ explanation: z.ZodString;
73
+ suggestion: z.ZodString;
74
+ nudge: z.ZodOptional<z.ZodString>;
75
+ location: z.ZodObject<{
76
+ file: z.ZodString;
77
+ line: z.ZodNumber;
78
+ column: z.ZodOptional<z.ZodNumber>;
79
+ endLine: z.ZodOptional<z.ZodNumber>;
80
+ endColumn: z.ZodOptional<z.ZodNumber>;
81
+ }, z.core.$strip>;
82
+ pattern: z.ZodOptional<z.ZodString>;
83
+ drift: z.ZodOptional<z.ZodObject<{
84
+ isNew: z.ZodBoolean;
85
+ existingCount: z.ZodOptional<z.ZodNumber>;
86
+ baselineId: z.ZodOptional<z.ZodString>;
87
+ }, z.core.$strip>>;
88
+ suppressed: z.ZodOptional<z.ZodObject<{
89
+ reason: z.ZodString;
90
+ author: z.ZodOptional<z.ZodString>;
91
+ timestamp: z.ZodOptional<z.ZodString>;
92
+ scope: z.ZodEnum<{
93
+ file: "file";
94
+ line: "line";
95
+ statement: "statement";
96
+ import: "import";
97
+ }>;
98
+ }, z.core.$strip>>;
99
+ }, z.core.$strip>;
100
+ export type Warning = z.infer<typeof WarningSchema>;
101
+ export declare const WarningResultSchema: z.ZodObject<{
102
+ warnings: z.ZodArray<z.ZodObject<{
103
+ id: z.ZodString;
104
+ fingerprint: z.ZodOptional<z.ZodString>;
105
+ category: z.ZodEnum<{
106
+ "anti-pattern": "anti-pattern";
107
+ boundary: "boundary";
108
+ architecture: "architecture";
109
+ }>;
110
+ severity: z.ZodEnum<{
111
+ warning: "warning";
112
+ error: "error";
113
+ info: "info";
114
+ }>;
115
+ confidence: z.ZodEnum<{
116
+ high: "high";
117
+ medium: "medium";
118
+ low: "low";
119
+ }>;
120
+ title: z.ZodString;
121
+ message: z.ZodString;
122
+ explanation: z.ZodString;
123
+ suggestion: z.ZodString;
124
+ nudge: z.ZodOptional<z.ZodString>;
125
+ location: z.ZodObject<{
126
+ file: z.ZodString;
127
+ line: z.ZodNumber;
128
+ column: z.ZodOptional<z.ZodNumber>;
129
+ endLine: z.ZodOptional<z.ZodNumber>;
130
+ endColumn: z.ZodOptional<z.ZodNumber>;
131
+ }, z.core.$strip>;
132
+ pattern: z.ZodOptional<z.ZodString>;
133
+ drift: z.ZodOptional<z.ZodObject<{
134
+ isNew: z.ZodBoolean;
135
+ existingCount: z.ZodOptional<z.ZodNumber>;
136
+ baselineId: z.ZodOptional<z.ZodString>;
137
+ }, z.core.$strip>>;
138
+ suppressed: z.ZodOptional<z.ZodObject<{
139
+ reason: z.ZodString;
140
+ author: z.ZodOptional<z.ZodString>;
141
+ timestamp: z.ZodOptional<z.ZodString>;
142
+ scope: z.ZodEnum<{
143
+ file: "file";
144
+ line: "line";
145
+ statement: "statement";
146
+ import: "import";
147
+ }>;
148
+ }, z.core.$strip>>;
149
+ }, z.core.$strip>>;
150
+ summary: z.ZodObject<{
151
+ total: z.ZodNumber;
152
+ byCategory: z.ZodRecord<z.ZodString, z.ZodNumber>;
153
+ bySeverity: z.ZodRecord<z.ZodString, z.ZodNumber>;
154
+ suppressed: z.ZodNumber;
155
+ blocking: z.ZodNumber;
156
+ }, z.core.$strip>;
157
+ }, z.core.$strip>;
158
+ export type WarningResult = z.infer<typeof WarningResultSchema>;
159
+ export interface WarningSummary {
160
+ total: number;
161
+ byCategory: Record<string, number>;
162
+ bySeverity: Record<string, number>;
163
+ suppressed: number;
164
+ blocking: number;
165
+ }
166
+ export declare function createWarningFingerprint(warning: Warning): string;
167
+ export declare function isBlockingWarning(warning: Warning): boolean;
168
+ export declare function countBySeverity(warnings: Warning[]): Record<string, number>;
169
+ export declare function createWarningResult(warnings: Warning[]): WarningResult;
170
+ export declare function validateWarningResultConsistency(result: WarningResult): boolean;
171
+ //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;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAMjE;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAE3D;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAM3E;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,aAAa,CAsBtE;AAED,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAU/E"}
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Warning types for @eddacraft/anvil-contracts
3
+ *
4
+ * Minimal type definitions for warnings used across packages.
5
+ * Full Zod schemas and utilities are in @eddacraft/anvil-core.
6
+ */
7
+ import { z } from 'zod';
8
+ // =============================================================================
9
+ // Location Schema
10
+ // =============================================================================
11
+ export const LocationSchema = z.object({
12
+ file: z.string(),
13
+ line: z.number().int().positive(),
14
+ column: z.number().int().nonnegative().optional(),
15
+ endLine: z.number().int().positive().optional(),
16
+ endColumn: z.number().int().nonnegative().optional(),
17
+ });
18
+ // =============================================================================
19
+ // Drift Schema
20
+ // =============================================================================
21
+ export const DriftSchema = z.object({
22
+ isNew: z.boolean(),
23
+ existingCount: z.number().int().nonnegative().optional(),
24
+ baselineId: z.string().optional(),
25
+ });
26
+ // =============================================================================
27
+ // Suppression Schema
28
+ // =============================================================================
29
+ export const SuppressionSchema = z.object({
30
+ reason: z.string().min(1),
31
+ author: z.string().optional(),
32
+ timestamp: z.string().datetime().optional(),
33
+ scope: z.enum(['statement', 'import', 'file', 'line']),
34
+ });
35
+ // =============================================================================
36
+ // Warning Schema
37
+ // =============================================================================
38
+ export const WarningCategorySchema = z.enum(['anti-pattern', 'boundary', 'architecture']);
39
+ export const WarningSeveritySchema = z.enum(['error', 'warning', 'info']);
40
+ export const ConfidenceSchema = z.enum(['high', 'medium', 'low']);
41
+ export const WarningSchema = z.object({
42
+ id: z.string().regex(/^(AP|ARCH|BOUND)-\d{3}$/),
43
+ fingerprint: z.string().optional(),
44
+ category: WarningCategorySchema,
45
+ severity: WarningSeveritySchema,
46
+ confidence: ConfidenceSchema,
47
+ title: z.string(),
48
+ message: z.string(),
49
+ explanation: z.string(),
50
+ suggestion: z.string(),
51
+ nudge: z.string().optional(),
52
+ location: LocationSchema,
53
+ pattern: z.string().optional(),
54
+ drift: DriftSchema.optional(),
55
+ suppressed: SuppressionSchema.optional(),
56
+ });
57
+ // =============================================================================
58
+ // Warning Result Schema
59
+ // =============================================================================
60
+ export const WarningResultSchema = z.object({
61
+ warnings: z.array(WarningSchema),
62
+ summary: z.object({
63
+ total: z.number().int().nonnegative(),
64
+ byCategory: z.record(z.string(), z.number().int().nonnegative()),
65
+ bySeverity: z.record(z.string(), z.number().int().nonnegative()),
66
+ suppressed: z.number().int().nonnegative(),
67
+ blocking: z.number().int().nonnegative(),
68
+ }),
69
+ });
70
+ // =============================================================================
71
+ // Helper Functions
72
+ // =============================================================================
73
+ export function createWarningFingerprint(warning) {
74
+ const parts = [warning.id, warning.location.file, warning.location.line.toString()];
75
+ if (warning.pattern) {
76
+ parts.push(warning.pattern);
77
+ }
78
+ return parts.join(':');
79
+ }
80
+ export function isBlockingWarning(warning) {
81
+ return warning.severity === 'error' && !warning.suppressed;
82
+ }
83
+ export function countBySeverity(warnings) {
84
+ const counts = { error: 0, warning: 0, info: 0 };
85
+ for (const w of warnings) {
86
+ counts[w.severity] = (counts[w.severity] || 0) + 1;
87
+ }
88
+ return counts;
89
+ }
90
+ export function createWarningResult(warnings) {
91
+ const byCategory = {};
92
+ const bySeverity = countBySeverity(warnings);
93
+ let suppressed = 0;
94
+ let blocking = 0;
95
+ for (const w of warnings) {
96
+ byCategory[w.category] = (byCategory[w.category] || 0) + 1;
97
+ if (w.suppressed)
98
+ suppressed++;
99
+ if (isBlockingWarning(w))
100
+ blocking++;
101
+ }
102
+ return {
103
+ warnings,
104
+ summary: {
105
+ total: warnings.length,
106
+ byCategory,
107
+ bySeverity,
108
+ suppressed,
109
+ blocking,
110
+ },
111
+ };
112
+ }
113
+ export function validateWarningResultConsistency(result) {
114
+ const actualTotal = result.warnings.length;
115
+ if (result.summary.total !== actualTotal)
116
+ return false;
117
+ const actualBySeverity = countBySeverity(result.warnings);
118
+ for (const [severity, count] of Object.entries(result.summary.bySeverity)) {
119
+ if (actualBySeverity[severity] !== count)
120
+ return false;
121
+ }
122
+ return true;
123
+ }
@@ -0,0 +1,194 @@
1
+ /**
2
+ * Gate Types for @eddacraft/anvil-contracts
3
+ *
4
+ * Pure type definitions for gate configuration and results.
5
+ * No runtime dependencies - these are shared across packages.
6
+ */
7
+ import type { APSPlan, Warning, WarningResult } from '../schemas/index.js';
8
+ /**
9
+ * Policy bundle configuration for remote bundles in GateConfig
10
+ */
11
+ export interface PolicyBundleConfig {
12
+ /** Bundle URL */
13
+ url: string;
14
+ /** Bundle name/identifier */
15
+ name?: string;
16
+ /** Whether this bundle is enabled */
17
+ enabled?: boolean;
18
+ /** Polling interval in milliseconds for updates */
19
+ polling_interval?: number;
20
+ /** Authentication configuration */
21
+ auth?: {
22
+ type: 'bearer' | 'basic' | 'aws-sigv4';
23
+ token?: string;
24
+ username?: string;
25
+ password?: string;
26
+ };
27
+ }
28
+ /**
29
+ * Signature algorithms supported for policy bundle verification
30
+ */
31
+ export type SignatureAlgorithm = 'RS256' | 'RS384' | 'RS512' | 'ES256' | 'ES384' | 'ES512';
32
+ /**
33
+ * Policy verification settings
34
+ */
35
+ export interface PolicyVerificationConfig {
36
+ /** Whether to require signatures on bundles */
37
+ require_signatures?: boolean;
38
+ /** Allowed signature algorithms */
39
+ allowed_algorithms?: SignatureAlgorithm[];
40
+ /** Public keys for verification (key ID to PEM content or path) */
41
+ keys?: Record<string, string>;
42
+ }
43
+ /**
44
+ * Policy-specific configuration within GateConfig
45
+ */
46
+ export interface PolicyConfig {
47
+ /** Remote policy bundles */
48
+ bundles?: PolicyBundleConfig[];
49
+ /** Signature verification settings */
50
+ verification?: PolicyVerificationConfig;
51
+ }
52
+ /**
53
+ * Configuration for a single stack layer (Kindling, Ember, or Edda)
54
+ */
55
+ export interface StackLayerConfig {
56
+ /** Whether this layer is enabled */
57
+ enabled: boolean;
58
+ /** Layer-specific configuration */
59
+ [key: string]: unknown;
60
+ }
61
+ /**
62
+ * Validation settings for stack integrity checks
63
+ */
64
+ export interface StackValidationConfig {
65
+ /** Check that provenance links resolve correctly across layers */
66
+ check_provenance_integrity?: boolean;
67
+ /** Check that schemas are compatible between layers */
68
+ check_schema_compatibility?: boolean;
69
+ }
70
+ /**
71
+ * Stack-wide configuration for the Edda Stack (Kindling -> Ember -> Edda)
72
+ */
73
+ export interface StackConfig {
74
+ /** Kindling layer configuration (observation) */
75
+ kindling?: StackLayerConfig;
76
+ /** Ember layer configuration (candidate memories) */
77
+ ember?: StackLayerConfig;
78
+ /** Edda layer configuration (canonical memories) */
79
+ edda?: StackLayerConfig;
80
+ /** Validation settings for stack integrity checks */
81
+ validation?: StackValidationConfig;
82
+ }
83
+ /**
84
+ * Watch configuration for file watching
85
+ * This is a base type - runtime watch module has more detailed version
86
+ */
87
+ export interface WatchConfig {
88
+ /** File patterns to watch */
89
+ patterns?: string[];
90
+ /** Patterns to exclude */
91
+ exclude?: string[];
92
+ /** Debounce delay in milliseconds */
93
+ debounce?: number;
94
+ /** Git integration settings */
95
+ git?: Record<string, unknown>;
96
+ /** Allow additional properties for runtime extensions */
97
+ [key: string]: unknown;
98
+ }
99
+ export interface GateCheck {
100
+ name: string;
101
+ description: string;
102
+ enabled: boolean;
103
+ config?: Record<string, unknown>;
104
+ }
105
+ /**
106
+ * Extended details that can include warnings from anti-pattern/boundary checks
107
+ */
108
+ export interface GateResultDetails {
109
+ /** Warnings from anti-pattern or boundary detection */
110
+ warnings?: WarningResult;
111
+ /** Any other check-specific details */
112
+ [key: string]: unknown;
113
+ }
114
+ export interface GateResult {
115
+ check: string;
116
+ passed: boolean;
117
+ score?: number;
118
+ message: string;
119
+ details?: GateResultDetails;
120
+ error?: string;
121
+ skipped?: boolean;
122
+ }
123
+ /**
124
+ * Helper to extract warnings from a GateResult
125
+ */
126
+ export declare function getWarningsFromResult(result: GateResult): Warning[];
127
+ /**
128
+ * Helper to check if a GateResult has blocking warnings
129
+ */
130
+ export declare function hasBlockingWarnings(result: GateResult): boolean;
131
+ export interface GateRunResult {
132
+ overall: boolean;
133
+ score: number;
134
+ checks: GateResult[];
135
+ summary: {
136
+ total: number;
137
+ passed: number;
138
+ failed: number;
139
+ skipped: number;
140
+ };
141
+ }
142
+ export interface GateConfig {
143
+ version: number;
144
+ checks: GateCheck[];
145
+ thresholds: {
146
+ overall_score: number;
147
+ [key: string]: number;
148
+ };
149
+ global_config?: Record<string, unknown>;
150
+ /** Watch mode configuration */
151
+ watch?: WatchConfig;
152
+ /** Policy configuration including remote bundles */
153
+ policy?: PolicyConfig;
154
+ /** Stack configuration for Edda Stack layers */
155
+ stack?: StackConfig;
156
+ }
157
+ export type PlanData = APSPlan;
158
+ /**
159
+ * Architecture context base type - full implementation in @eddacraft/anvil-core
160
+ * Uses unknown for layers/modules since runtime has more detailed types
161
+ */
162
+ export interface ArchitectureContextBase {
163
+ /** Project root path */
164
+ root?: string;
165
+ /** Layer information - full type in @eddacraft/anvil-core */
166
+ layers?: Record<string, unknown>;
167
+ /** Module information */
168
+ modules?: Record<string, unknown>;
169
+ /** Allow additional properties for runtime extensions */
170
+ [key: string]: unknown;
171
+ }
172
+ export interface CheckContext {
173
+ /** Plan data - optional for planless mode */
174
+ plan?: PlanData;
175
+ workspace_root: string;
176
+ config: GateConfig;
177
+ check_config: Record<string, unknown>;
178
+ /** Full codebase scan mode (no plan-based scoping) */
179
+ fullScan?: boolean;
180
+ /** Explicit file list for planless mode (workspace-relative or absolute paths) */
181
+ targetFiles?: string[];
182
+ /** Architecture context from ArchitectureCheck - passed to downstream checks (e.g., PolicyCheck) */
183
+ architectureContext?: ArchitectureContextBase;
184
+ }
185
+ /**
186
+ * Options for normalising target files
187
+ */
188
+ export interface NormaliseFilesOptions {
189
+ /** Filter function to check if file should be included */
190
+ filter?: (filePath: string) => boolean;
191
+ /** Whether to check file existence (default: true) */
192
+ checkExists?: boolean;
193
+ }
194
+ //# sourceMappingURL=gate.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate.types.d.ts","sourceRoot":"","sources":["../../../src/contracts/types/gate.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,iBAAiB;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mDAAmD;IACnD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mCAAmC;IACnC,IAAI,CAAC,EAAE;QACL,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,WAAW,CAAC;QACvC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAA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AAsD;IACtD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Gate Types for @eddacraft/anvil-contracts
3
+ *
4
+ * Pure type definitions for gate configuration and results.
5
+ * No runtime dependencies - these are shared across packages.
6
+ */
7
+ /**
8
+ * Helper to extract warnings from a GateResult
9
+ */
10
+ export function getWarningsFromResult(result) {
11
+ return result.details?.warnings?.warnings ?? [];
12
+ }
13
+ /**
14
+ * Helper to check if a GateResult has blocking warnings
15
+ */
16
+ export function hasBlockingWarnings(result) {
17
+ const warnings = getWarningsFromResult(result);
18
+ return warnings.some((w) => w.severity === 'error' && !w.suppressed);
19
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Type exports for @eddacraft/anvil-contracts
3
+ *
4
+ * Re-exports types from schemas for convenience.
5
+ * All types are inferred from Zod schemas.
6
+ */
7
+ export type { APSPlan, Change, ChangeType, Provenance, Validation, Evidence, EvidenceEntry, Approval, ExecutionResult, SchemaValidationResult, Warning, WarningResult, WarningCategory, WarningSeverity, Confidence, Location, Drift, Suppression, WarningSummary, } from '../schemas/index.js';
8
+ export * from './gate.types.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contracts/types/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EACV,OAAO,EACP,MAAM,EACN,UAAU,EACV,UAAU,EACV,UAAU,EACV,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,eAAe,EACf,sBAAsB,EACtB,OAAO,EACP,aAAa,EACb,eAAe,EACf,eAAe,EACf,UAAU,EACV,QAAQ,EACR,KAAK,EACL,WAAW,EACX,cAAc,GACf,MAAM,qBAAqB,CAAC;AAG7B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Type exports for @eddacraft/anvil-contracts
3
+ *
4
+ * Re-exports types from schemas for convenience.
5
+ * All types are inferred from Zod schemas.
6
+ */
7
+ // Re-export gate types
8
+ export * from './gate.types.js';