@maverickcer/env-cap 0.2.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 (195) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +279 -0
  3. package/dist/.dts/build/assemble-project.d.ts +47 -0
  4. package/dist/.dts/build/assemble-project.d.ts.map +1 -0
  5. package/dist/.dts/build/change-model.d.ts +62 -0
  6. package/dist/.dts/build/change-model.d.ts.map +1 -0
  7. package/dist/.dts/build/check-artifacts.d.ts +48 -0
  8. package/dist/.dts/build/check-artifacts.d.ts.map +1 -0
  9. package/dist/.dts/build/citation-verification.d.ts +62 -0
  10. package/dist/.dts/build/citation-verification.d.ts.map +1 -0
  11. package/dist/.dts/build/compatibility.d.ts +76 -0
  12. package/dist/.dts/build/compatibility.d.ts.map +1 -0
  13. package/dist/.dts/build/contract-model.d.ts +92 -0
  14. package/dist/.dts/build/contract-model.d.ts.map +1 -0
  15. package/dist/.dts/build/deep-equal.d.ts +9 -0
  16. package/dist/.dts/build/deep-equal.d.ts.map +1 -0
  17. package/dist/.dts/build/deep-freeze.d.ts +20 -0
  18. package/dist/.dts/build/deep-freeze.d.ts.map +1 -0
  19. package/dist/.dts/build/dependency-graph.d.ts +168 -0
  20. package/dist/.dts/build/dependency-graph.d.ts.map +1 -0
  21. package/dist/.dts/build/dependency-model.d.ts +79 -0
  22. package/dist/.dts/build/dependency-model.d.ts.map +1 -0
  23. package/dist/.dts/build/discover.d.ts +25 -0
  24. package/dist/.dts/build/discover.d.ts.map +1 -0
  25. package/dist/.dts/build/display-path.d.ts +24 -0
  26. package/dist/.dts/build/display-path.d.ts.map +1 -0
  27. package/dist/.dts/build/docs.d.ts +176 -0
  28. package/dist/.dts/build/docs.d.ts.map +1 -0
  29. package/dist/.dts/build/env-example.d.ts +85 -0
  30. package/dist/.dts/build/env-example.d.ts.map +1 -0
  31. package/dist/.dts/build/errors.d.ts +78 -0
  32. package/dist/.dts/build/errors.d.ts.map +1 -0
  33. package/dist/.dts/build/evidence-cache.d.ts +74 -0
  34. package/dist/.dts/build/evidence-cache.d.ts.map +1 -0
  35. package/dist/.dts/build/evidence-model.d.ts +50 -0
  36. package/dist/.dts/build/evidence-model.d.ts.map +1 -0
  37. package/dist/.dts/build/evidence-reference.d.ts +67 -0
  38. package/dist/.dts/build/evidence-reference.d.ts.map +1 -0
  39. package/dist/.dts/build/evidence-snapshot.d.ts +123 -0
  40. package/dist/.dts/build/evidence-snapshot.d.ts.map +1 -0
  41. package/dist/.dts/build/exclusive-group.d.ts +19 -0
  42. package/dist/.dts/build/exclusive-group.d.ts.map +1 -0
  43. package/dist/.dts/build/finding-model.d.ts +79 -0
  44. package/dist/.dts/build/finding-model.d.ts.map +1 -0
  45. package/dist/.dts/build/generate-documentation.d.ts +176 -0
  46. package/dist/.dts/build/generate-documentation.d.ts.map +1 -0
  47. package/dist/.dts/build/generate-env-artifacts.d.ts +176 -0
  48. package/dist/.dts/build/generate-env-artifacts.d.ts.map +1 -0
  49. package/dist/.dts/build/generate-evidence.d.ts +77 -0
  50. package/dist/.dts/build/generate-evidence.d.ts.map +1 -0
  51. package/dist/.dts/build/generate-manifest.d.ts +101 -0
  52. package/dist/.dts/build/generate-manifest.d.ts.map +1 -0
  53. package/dist/.dts/build/generate-usage.d.ts +95 -0
  54. package/dist/.dts/build/generate-usage.d.ts.map +1 -0
  55. package/dist/.dts/build/generated-banner.d.ts +52 -0
  56. package/dist/.dts/build/generated-banner.d.ts.map +1 -0
  57. package/dist/.dts/build/glob.d.ts +18 -0
  58. package/dist/.dts/build/glob.d.ts.map +1 -0
  59. package/dist/.dts/build/governance-fields.d.ts +34 -0
  60. package/dist/.dts/build/governance-fields.d.ts.map +1 -0
  61. package/dist/.dts/build/humanize-key.d.ts +14 -0
  62. package/dist/.dts/build/humanize-key.d.ts.map +1 -0
  63. package/dist/.dts/build/index.d.ts +107 -0
  64. package/dist/.dts/build/index.d.ts.map +1 -0
  65. package/dist/.dts/build/lifecycle-model.d.ts +64 -0
  66. package/dist/.dts/build/lifecycle-model.d.ts.map +1 -0
  67. package/dist/.dts/build/link.d.ts +215 -0
  68. package/dist/.dts/build/link.d.ts.map +1 -0
  69. package/dist/.dts/build/literal-eval.d.ts +23 -0
  70. package/dist/.dts/build/literal-eval.d.ts.map +1 -0
  71. package/dist/.dts/build/live-expirations.d.ts +47 -0
  72. package/dist/.dts/build/live-expirations.d.ts.map +1 -0
  73. package/dist/.dts/build/manifest-snapshot.d.ts +229 -0
  74. package/dist/.dts/build/manifest-snapshot.d.ts.map +1 -0
  75. package/dist/.dts/build/manifest.d.ts +31 -0
  76. package/dist/.dts/build/manifest.d.ts.map +1 -0
  77. package/dist/.dts/build/map-utils.d.ts +8 -0
  78. package/dist/.dts/build/map-utils.d.ts.map +1 -0
  79. package/dist/.dts/build/ownership-model.d.ts +57 -0
  80. package/dist/.dts/build/ownership-model.d.ts.map +1 -0
  81. package/dist/.dts/build/parse.d.ts +199 -0
  82. package/dist/.dts/build/parse.d.ts.map +1 -0
  83. package/dist/.dts/build/reference-projections.d.ts +156 -0
  84. package/dist/.dts/build/reference-projections.d.ts.map +1 -0
  85. package/dist/.dts/build/resolution/resolve-import.d.ts +53 -0
  86. package/dist/.dts/build/resolution/resolve-import.d.ts.map +1 -0
  87. package/dist/.dts/build/resolution/resolve-package-schema.d.ts +83 -0
  88. package/dist/.dts/build/resolution/resolve-package-schema.d.ts.map +1 -0
  89. package/dist/.dts/build/resolution/resolve-tsconfig-paths.d.ts +101 -0
  90. package/dist/.dts/build/resolution/resolve-tsconfig-paths.d.ts.map +1 -0
  91. package/dist/.dts/build/resolution/resolve-within-root.d.ts +35 -0
  92. package/dist/.dts/build/resolution/resolve-within-root.d.ts.map +1 -0
  93. package/dist/.dts/build/resolve-import.d.ts +50 -0
  94. package/dist/.dts/build/resolve-import.d.ts.map +1 -0
  95. package/dist/.dts/build/resolve-package-schema.d.ts +99 -0
  96. package/dist/.dts/build/resolve-package-schema.d.ts.map +1 -0
  97. package/dist/.dts/build/resolve-tsconfig-paths.d.ts +100 -0
  98. package/dist/.dts/build/resolve-tsconfig-paths.d.ts.map +1 -0
  99. package/dist/.dts/build/resolve-within-root.d.ts +35 -0
  100. package/dist/.dts/build/resolve-within-root.d.ts.map +1 -0
  101. package/dist/.dts/build/sarif.d.ts +66 -0
  102. package/dist/.dts/build/sarif.d.ts.map +1 -0
  103. package/dist/.dts/build/scan-dependencies.d.ts +47 -0
  104. package/dist/.dts/build/scan-dependencies.d.ts.map +1 -0
  105. package/dist/.dts/build/sort-by-identity.d.ts +14 -0
  106. package/dist/.dts/build/sort-by-identity.d.ts.map +1 -0
  107. package/dist/.dts/build/source-position.d.ts +69 -0
  108. package/dist/.dts/build/source-position.d.ts.map +1 -0
  109. package/dist/.dts/build/tool-version.d.ts +8 -0
  110. package/dist/.dts/build/tool-version.d.ts.map +1 -0
  111. package/dist/.dts/build/types.d.ts +53 -0
  112. package/dist/.dts/build/types.d.ts.map +1 -0
  113. package/dist/.dts/build/usage-report.d.ts +124 -0
  114. package/dist/.dts/build/usage-report.d.ts.map +1 -0
  115. package/dist/.dts/cli/filesystem.d.ts +3 -0
  116. package/dist/.dts/cli/filesystem.d.ts.map +1 -0
  117. package/dist/.dts/eslint-plugin/glob.d.ts +18 -0
  118. package/dist/.dts/eslint-plugin/glob.d.ts.map +1 -0
  119. package/dist/.dts/eslint-plugin/index.d.ts +27 -0
  120. package/dist/.dts/eslint-plugin/index.d.ts.map +1 -0
  121. package/dist/.dts/eslint-plugin/no-node-fs.d.ts +25 -0
  122. package/dist/.dts/eslint-plugin/no-node-fs.d.ts.map +1 -0
  123. package/dist/.dts/eslint-plugin/no-raw-process-env.d.ts +23 -0
  124. package/dist/.dts/eslint-plugin/no-raw-process-env.d.ts.map +1 -0
  125. package/dist/.dts/evidence/define-projection.d.ts +51 -0
  126. package/dist/.dts/evidence/define-projection.d.ts.map +1 -0
  127. package/dist/.dts/evidence/index.d.ts +23 -0
  128. package/dist/.dts/evidence/index.d.ts.map +1 -0
  129. package/dist/.dts/helpers/index.d.ts +135 -0
  130. package/dist/.dts/helpers/index.d.ts.map +1 -0
  131. package/dist/.dts/helpers/processors.d.ts +32 -0
  132. package/dist/.dts/helpers/processors.d.ts.map +1 -0
  133. package/dist/.dts/helpers/validators.d.ts +68 -0
  134. package/dist/.dts/helpers/validators.d.ts.map +1 -0
  135. package/dist/.dts/node/index.d.ts +2 -0
  136. package/dist/.dts/node/index.d.ts.map +1 -0
  137. package/dist/.dts/runtime/cache.d.ts +20 -0
  138. package/dist/.dts/runtime/cache.d.ts.map +1 -0
  139. package/dist/.dts/runtime/create.d.ts +20 -0
  140. package/dist/.dts/runtime/create.d.ts.map +1 -0
  141. package/dist/.dts/runtime/document.d.ts +181 -0
  142. package/dist/.dts/runtime/document.d.ts.map +1 -0
  143. package/dist/.dts/runtime/errors.d.ts +55 -0
  144. package/dist/.dts/runtime/errors.d.ts.map +1 -0
  145. package/dist/.dts/runtime/index.d.ts +24 -0
  146. package/dist/.dts/runtime/index.d.ts.map +1 -0
  147. package/dist/.dts/runtime/registry.d.ts +12 -0
  148. package/dist/.dts/runtime/registry.d.ts.map +1 -0
  149. package/dist/.dts/runtime/reset.d.ts +8 -0
  150. package/dist/.dts/runtime/reset.d.ts.map +1 -0
  151. package/dist/.dts/runtime/types.d.ts +175 -0
  152. package/dist/.dts/runtime/types.d.ts.map +1 -0
  153. package/dist/.dts/runtime/validate.d.ts +14 -0
  154. package/dist/.dts/runtime/validate.d.ts.map +1 -0
  155. package/dist/build.cjs +83 -0
  156. package/dist/build.cjs.map +1 -0
  157. package/dist/build.d.cts +1 -0
  158. package/dist/build.d.ts +1 -0
  159. package/dist/build.js +19 -0
  160. package/dist/build.js.map +1 -0
  161. package/dist/cli/index.js +134 -0
  162. package/dist/cli/index.js.map +1 -0
  163. package/dist/eslint-plugin/index.cjs +12 -0
  164. package/dist/eslint-plugin/index.cjs.map +1 -0
  165. package/dist/eslint-plugin/index.d.cts +1 -0
  166. package/dist/eslint-plugin/index.d.ts +1 -0
  167. package/dist/eslint-plugin/index.js +5 -0
  168. package/dist/eslint-plugin/index.js.map +1 -0
  169. package/dist/evidence.cjs +7 -0
  170. package/dist/evidence.cjs.map +1 -0
  171. package/dist/evidence.d.cts +1 -0
  172. package/dist/evidence.d.ts +1 -0
  173. package/dist/evidence.js +5 -0
  174. package/dist/evidence.js.map +1 -0
  175. package/dist/helpers.cjs +8 -0
  176. package/dist/helpers.cjs.map +1 -0
  177. package/dist/helpers.d.cts +1 -0
  178. package/dist/helpers.d.ts +1 -0
  179. package/dist/helpers.js +5 -0
  180. package/dist/helpers.js.map +1 -0
  181. package/dist/index.cjs +15 -0
  182. package/dist/index.cjs.map +1 -0
  183. package/dist/index.d.cts +1 -0
  184. package/dist/index.d.ts +1 -0
  185. package/dist/index.js +7 -0
  186. package/dist/index.js.map +1 -0
  187. package/dist/node.cjs +13 -0
  188. package/dist/node.cjs.map +1 -0
  189. package/dist/node.d.cts +1 -0
  190. package/dist/node.d.ts +1 -0
  191. package/dist/node.js +7 -0
  192. package/dist/node.js.map +1 -0
  193. package/package.json +183 -0
  194. package/schemas/contract-model.schema.json +321 -0
  195. package/schemas/env-cap-report.schema.json +2369 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../src/build/docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAyB,MAAM,qBAAqB,CAAA;AACvF,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACrF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAA;AAe5D,6YAA6Y;AAC7Y,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,4CAA4C;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B;AACD,4JAA4J;AAC5J,MAAM,WAAW,uBAAuB;IACtC,QA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AAE,IAAI,EACT,yBAAyB,EAAE,MAAM,EACjC,yBAAyB,EAAE,MAAM,GAChC,sBAAsB,CAoDxB;AAsCD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CACxB,SAAS,EAAE,SAAS,qBAAqB,EAAE,EAC3C,OAAO,EAAE,iBAAiB,GACzB,MAAM,CA2BR;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOlE"}
@@ -0,0 +1,85 @@
1
+ import type { DiscoveredContract } from "./link.js";
2
+ import type { BuildFileSystem } from "./types.js";
3
+ /**
4
+ * Controls what happens when a `.env.example` already exists at the target
5
+ * location. `"keep-sibling"` (default): never touch the existing file --
6
+ * write a timestamped sibling instead, for the developer to diff/merge
7
+ * manually. `"overwrite"`: replace the existing file with freshly rendered
8
+ * content directly. `"skip"`: write nothing at all.
9
+ */
10
+ export type EnvExampleOnExisting = "keep-sibling" | "overwrite" | "skip";
11
+ /** The result of a completed {@link writeEnvExample} call. */
12
+ export interface EnvExampleResult {
13
+ /**
14
+ * Where the example file actually got written. `undefined` only when
15
+ * `onExisting: "skip"` left an existing file untouched and nothing was
16
+ * written.
17
+ */
18
+ readonly writtenPath: string | undefined;
19
+ /**
20
+ * Set when a file already existed at the requested location and was left
21
+ * untouched: with the default `"keep-sibling"`, `writtenPath` is a fresh
22
+ * timestamped sibling instead; with `"skip"`, this is the only outcome and
23
+ * `writtenPath` is `undefined`. Always `undefined` with `"overwrite"`.
24
+ */
25
+ readonly skippedExistingPath: string | undefined;
26
+ /** Variable names (live or already commented-out) in an existing example file that no discovered contract declares anymore. */
27
+ readonly staleVariables: readonly string[];
28
+ /** Variables live in an existing example file whose feature is no longer active, and that no other active feature still needs -- safe to comment out. */
29
+ readonly variablesToComment: readonly string[];
30
+ /** Variables the current (active) configuration requires that aren't yet a live entry in an existing example file. */
31
+ readonly variablesToAdd: readonly string[];
32
+ }
33
+ /** The result of {@link computeReconciliation}: an existing `.env.example` diffed against the current configuration. */
34
+ export interface Reconciliation {
35
+ /** Variable names (live or already commented-out) in an existing example file that no discovered contract declares anymore. */
36
+ readonly staleVariables: readonly string[];
37
+ /** Variables live in an existing example file whose feature is no longer active, and that no other active feature still needs -- safe to comment out. */
38
+ readonly variablesToComment: readonly string[];
39
+ /** Variables the current (active) configuration requires that aren't yet a live entry in an existing example file. */
40
+ readonly variablesToAdd: readonly string[];
41
+ }
42
+ /**
43
+ * Renders a deterministic `.env.example`-style file scoped to the *current*
44
+ * configuration: every unique variable the active contracts require (one
45
+ * live entry per key, alphabetical; a key declared by more than one active
46
+ * contract renders once live and the rest commented-out with a pointer),
47
+ * followed by variables unique to disabled contracts (commented-out, for
48
+ * visibility -- a key already required by an active contract is not unique
49
+ * and never repeated here). `reconciliationHeader`, when non-empty, is
50
+ * spliced in right after the banner (see `computeReconciliation`).
51
+ */
52
+ export declare function renderEnvExample(contracts: readonly DiscoveredContract[], reconciliationHeader?: readonly string[]): string;
53
+ /** Parses `KEY=value` lines out of an existing `.env`-style file, ignoring comments and blank lines. */
54
+ export declare function extractDeclaredVariables(source: string): string[];
55
+ /** Parses `# KEY=value` lines out of an existing `.env`-style file -- variables it already knows about but has turned off. */
56
+ export declare function extractCommentedVariables(source: string): string[];
57
+ /**
58
+ * Diffs an existing `.env.example` against the current configuration into
59
+ * three actionable sets. Pure and filesystem-independent -- `writeEnvExample`
60
+ * is the only caller that reads the file itself.
61
+ */
62
+ export declare function computeReconciliation(contracts: readonly DiscoveredContract[], existingContent: string): Reconciliation;
63
+ /**
64
+ * Writes a rendered `.env.example` to `location`. Behavior when a file
65
+ * already exists there is governed by `options.onExisting` (default
66
+ * `"keep-sibling"`, see `EnvExampleOnExisting`):
67
+ * - `"keep-sibling"`: the existing file is left alone; freshly generated
68
+ * content is written to a timestamped sibling instead
69
+ * (`<location>.<epoch-ms>`), prefixed with a reconciliation header
70
+ * comparing it against the existing file (omitted when there's nothing
71
+ * to report).
72
+ * - `"overwrite"`: the existing file is replaced directly with freshly
73
+ * rendered content -- no reconciliation header (the changes it would
74
+ * describe are already applied).
75
+ * - `"skip"`: nothing is written.
76
+ * When no file exists yet at `location`, all three modes behave the same:
77
+ * write fresh content, nothing to reconcile against. `staleVariables`/
78
+ * `variablesToComment`/`variablesToAdd` are always computed and returned
79
+ * when a prior file existed, even under `"overwrite"`/`"skip"`, as a
80
+ * diagnostic -- independent of whether anything was actually written.
81
+ */
82
+ export declare function writeEnvExample(contracts: readonly DiscoveredContract[], location: string, fs: BuildFileSystem, options?: {
83
+ onExisting?: EnvExampleOnExisting;
84
+ }): Promise<EnvExampleResult>;
85
+ //# sourceMappingURL=env-example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env-example.d.ts","sourceRoot":"","sources":["../../../src/build/env-example.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAsB,MAAM,WAAW,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAGjD;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG,WAAW,GAAG,MAAM,CAAA;AAExE,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC;;;;;OAKG;IACH,QAAQ,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAA;IAChD,+HAA+H;IAC/H,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1C,yJAAyJ;IACzJ,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAA;IAC9C,sHAAsH;IACtH,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;CAC3C;AAED,wHAAwH;AACxH,MAAM,WAAW,cAAc;IAC7B,+HAA+H;IAC/H,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1C,yJAAyJ;IACzJ,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAA;IAC9C,sHAAsH;IACtH,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;CAC3C;AAqED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,kBAAkB,EAAE,EACxC,oBAAoB,GAAE,SAAS,MAAM,EAAO,GAC3C,MAAM,CAwER;AAED,wGAAwG;AACxG,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAkBjE;AAED,8HAA8H;AAC9H,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAgBlE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,kBAAkB,EAAE,EACxC,eAAe,EAAE,MAAM,GACtB,cAAc,CAkBhB;AAmBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,SAAS,kBAAkB,EAAE,EACxC,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,eAAe,EACnB,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,oBAAoB,CAAA;CAAO,GAClD,OAAO,CAAC,gBAAgB,CAAC,CA+D3B"}
@@ -0,0 +1,78 @@
1
+ import type { CompatibilityIssue } from "./compatibility.js";
2
+ /**
3
+ * Thrown by {@link generateEnvManifest} on a blocking compatibility/exclusive-group
4
+ * finding, or an output path escaping `root`.
5
+ *
6
+ * @remarks
7
+ * Nothing is written when this throws -- generation fails atomically, same as
8
+ * {@link runtime.validateEnv} fails atomically at runtime.
9
+ *
10
+ * `code` is a stable, Stable-tier discriminant for programmatic handling --
11
+ * prefer it over `.name`/`instanceof` when a message-independent switch is needed.
12
+ */
13
+ export declare class EnvManifestGenerationError extends Error {
14
+ /** Stable discriminant for programmatic handling; always `"ENV_MANIFEST_GENERATION_FAILED"`. */
15
+ readonly code = "ENV_MANIFEST_GENERATION_FAILED";
16
+ /** Every blocking finding, aggregated. */
17
+ readonly issues: readonly CompatibilityIssue[];
18
+ constructor(issues: readonly CompatibilityIssue[]);
19
+ }
20
+ /**
21
+ * Thrown by {@link generateDocumentation} on a blocking undocumented-contract/
22
+ * variable finding (when `onUndocumented: "throw"`), or an output path
23
+ * (`location`/`envExample.location`) escaping `root`. Nothing is written
24
+ * when this throws.
25
+ *
26
+ * @remarks
27
+ * `code` is a stable, Stable-tier discriminant for programmatic handling --
28
+ * prefer it over `.name`/`instanceof` when a message-independent switch is needed.
29
+ */
30
+ export declare class EnvDocumentationGenerationError extends Error {
31
+ /** Stable discriminant for programmatic handling; always `"ENV_DOCUMENTATION_GENERATION_FAILED"`. */
32
+ readonly code = "ENV_DOCUMENTATION_GENERATION_FAILED";
33
+ /** Every blocking finding, aggregated. */
34
+ readonly issues: readonly CompatibilityIssue[];
35
+ constructor(issues: readonly CompatibilityIssue[]);
36
+ }
37
+ /**
38
+ * Thrown by {@link generateUsageReport} on a blocking abandoned-contract/
39
+ * unconsumed-owned-variable finding (when `onOwnershipIssue: "throw"`), or an
40
+ * output path (`report.location`) escaping `root`.
41
+ *
42
+ * @remarks
43
+ * Never thrown for `unresolvedConsumers` or `indeterminate` findings -- both are "we don't
44
+ * know" states, and uncertainty is never promoted to a failure.
45
+ *
46
+ * `code` is a stable, Stable-tier discriminant for programmatic handling --
47
+ * prefer it over `.name`/`instanceof` when a message-independent switch is needed.
48
+ */
49
+ export declare class EnvUsageAnalysisError extends Error {
50
+ /** Stable discriminant for programmatic handling; always `"ENV_USAGE_ANALYSIS_FAILED"`. */
51
+ readonly code = "ENV_USAGE_ANALYSIS_FAILED";
52
+ /** Every blocking finding, aggregated. */
53
+ readonly issues: readonly CompatibilityIssue[];
54
+ constructor(issues: readonly CompatibilityIssue[]);
55
+ }
56
+ /**
57
+ * Thrown by {@link generateEnvArtifacts} when any requested pass (manifest/docs/usage)
58
+ * reports a blocking finding, aggregated across all requested passes into
59
+ * one error.
60
+ *
61
+ * @remarks
62
+ * Nothing from any pass is written when this throws -- see
63
+ * `generate-env-artifacts.ts`'s compute-atomic guarantee (ADR 0011). Write-phase failures
64
+ * (a real I/O error after all computes already passed) are NOT wrapped in
65
+ * this type -- they propagate as whatever `fs.writeFile` itself throws,
66
+ * since by that point some artifacts may already be on disk.
67
+ *
68
+ * `code` is a stable, Stable-tier discriminant for programmatic handling --
69
+ * prefer it over `.name`/`instanceof` when a message-independent switch is needed.
70
+ */
71
+ export declare class EnvProjectGenerationError extends Error {
72
+ /** Stable discriminant for programmatic handling; always `"ENV_PROJECT_GENERATION_FAILED"`. */
73
+ readonly code = "ENV_PROJECT_GENERATION_FAILED";
74
+ /** Every blocking finding, aggregated across all requested passes. */
75
+ readonly issues: readonly CompatibilityIssue[];
76
+ constructor(issues: readonly CompatibilityIssue[]);
77
+ }
78
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/build/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAmB5D;;;;;;;;;;GAUG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,gGAAgG;IAChG,QAAQ,CAAC,IAAI,oCAAmC;IAChD,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAA;gBAElC,MAAM,EAAE,SAAS,kBAAkB,EAAE;CAelD;AAED;;;;;;;;;GASG;AACH,qBAAa,+BAAgC,SAAQ,KAAK;IACxD,qGAAqG;IACrG,QAAQ,CAAC,IAAI,yCAAwC;IACrD,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAA;gBAElC,MAAM,EAAE,SAAS,kBAAkB,EAAE;CAelD;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,2FAA2F;IAC3F,QAAQ,CAAC,IAAI,+BAA8B;IAC3C,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAA;gBAElC,MAAM,EAAE,SAAS,kBAAkB,EAAE;CAWlD;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,+FAA+F;IAC/F,QAAQ,CAAC,IAAI,mCAAkC;IAC/C,sEAAsE;IACtE,QAAQ,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAA;gBAElC,MAAM,EAAE,SAAS,kBAAkB,EAAE;CAQlD"}
@@ -0,0 +1,74 @@
1
+ import type { EvidenceModel } from "./evidence-model.js";
2
+ import type { GenerateEvidenceModelOptions } from "./generate-evidence.js";
3
+ import type { BuildFileSystem } from "./types.js";
4
+ /**
5
+ * A fast, honest read path for the persisted evidence artifact -- for a
6
+ * report/projection script, a CI step, or any consumer that just wants the
7
+ * current `EvidenceModel` without paying a full `generateEvidenceModel()`
8
+ * recompute (schema parsing, cross-file linking, the dependency-graph AST
9
+ * scan, all six model builds) on every single invocation, and without ever
10
+ * risking silently-stale data. The mechanism: a cheap content fingerprint,
11
+ * computed from raw file bytes with zero AST work, lets a caller cheaply
12
+ * prove "nothing relevant to evidence generation has changed since this file
13
+ * was last written" before trusting it.
14
+ */
15
+ /** Options for {@link computeSourceFingerprint}. */
16
+ export interface ComputeSourceFingerprintOptions {
17
+ /** The filesystem capability -- `./build` never imports `node:fs` (ADR 0040). */
18
+ readonly fs: BuildFileSystem;
19
+ readonly root: string;
20
+ readonly include: readonly string[];
21
+ readonly exclude: readonly string[];
22
+ readonly packages: readonly string[];
23
+ }
24
+ /**
25
+ * SHA-256 over the raw bytes of every schema file and every usage-scan-
26
+ * surface file (the same file sets `assembleProject()`/`computeScanSurface()`
27
+ * touch), plus env-cap's own installed version -- zero AST parsing or
28
+ * linking. Still requires the discovery/glob walk itself (fingerprinting has
29
+ * to know which files matter), but skips everything after it. Deterministic:
30
+ * file paths are deduplicated and sorted before hashing, so the result never
31
+ * depends on filesystem enumeration order.
32
+ *
33
+ * @remarks
34
+ * Not a timestamp, and never compared as one -- a fresh mtime doesn't prove
35
+ * content is unchanged (a checkout, a rebase, or a touch can all bump it
36
+ * with no real edit), and content is the only thing that actually
37
+ * invalidates a cached evidence artifact.
38
+ */
39
+ export declare function computeSourceFingerprint(options: ComputeSourceFingerprintOptions): Promise<string>;
40
+ /** Writes `fingerprint`'s paired sidecar for `evidencePath` -- call immediately after writing the evidence artifact itself, so the two files always describe the same moment in the source tree's history. */
41
+ export declare function writeEvidenceFingerprint(evidencePath: string, fingerprint: string, fs: BuildFileSystem): Promise<void>;
42
+ /** Options for {@link getEvidenceModel} -- every `generateEvidenceModel()` option, plus where the cached artifact lives. */
43
+ export interface GetEvidenceModelOptions extends GenerateEvidenceModelOptions {
44
+ /** Where the cached evidence artifact (and its `.fingerprint` sidecar) live, e.g. `docs/env.evidence.json`, relative to `root`. Required -- there is no honest default env-cap could guess at for where a project keeps this. */
45
+ readonly location: string;
46
+ }
47
+ /** The result of {@link getEvidenceModel}. */
48
+ export interface GetEvidenceModelResult {
49
+ readonly evidence: EvidenceModel;
50
+ /** `"hit"` -- the committed evidence artifact's fingerprint matched current source; read from disk, no recompute. `"miss"` -- a real `generateEvidenceModel()` call ran. */
51
+ readonly source: "hit" | "miss";
52
+ /** Set only when `source === "miss"` -- why the cache wasn't trusted, for a caller that wants to log it. */
53
+ readonly missReason: string | undefined;
54
+ }
55
+ /**
56
+ * Trusts the committed evidence artifact at `options.location` only when its
57
+ * paired `.fingerprint` sidecar matches a freshly (cheaply) computed
58
+ * {@link computeSourceFingerprint} -- never on file presence alone, never on
59
+ * a timestamp. On any mismatch (stale fingerprint, missing/corrupt evidence
60
+ * file, no fingerprint sidecar at all), falls back to a real
61
+ * `generateEvidenceModel()` call -- never hard-fails, never silently serves
62
+ * data that might be stale.
63
+ *
64
+ * @remarks
65
+ * Never writes anything. A cache miss here does not self-heal the cache --
66
+ * only an explicit write (`generateEnvArtifacts()`'s `evidence` option)
67
+ * refreshes the committed artifact and its fingerprint together, so "when
68
+ * was this last regenerated" stays under explicit control, never an
69
+ * implicit side effect of a read. Two independent callers hitting the same
70
+ * stale cache both recompute independently; neither one's recompute updates
71
+ * the file the other reads.
72
+ */
73
+ export declare function getEvidenceModel(options: GetEvidenceModelOptions): Promise<GetEvidenceModelResult>;
74
+ //# sourceMappingURL=evidence-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evidence-cache.d.ts","sourceRoot":"","sources":["../../../src/build/evidence-cache.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAKxD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAA;AAO1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD;;;;;;;;;;GAUG;AAEH,oDAAoD;AACpD,MAAM,WAAW,+BAA+B;IAC9C,iFAAiF;IACjF,QAAQ,CAAC,EAAE,EAAE,eAAe,CAAA;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CACrC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,MAAM,CAAC,CA+CjB;AAMD,8MAA8M;AAC9M,wBAAsB,wBAAwB,CAC5C,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,EAAE,EAAE,eAAe,GAClB,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,4HAA4H;AAC5H,MAAM,WAAW,uBAAwB,SAAQ,4BAA4B;IAC3E,iOAAiO;IACjO,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAED,8CAA8C;AAC9C,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAA;IAChC,4KAA4K;IAC5K,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,CAAA;IAC/B,4GAA4G;IAC5G,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;CACxC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,sBAAsB,CAAC,CAgFjC"}
@@ -0,0 +1,50 @@
1
+ import type { ChangeModel } from "./change-model.js";
2
+ import type { ContractModel } from "./contract-model.js";
3
+ import type { DependencyModel } from "./dependency-model.js";
4
+ import type { FindingModel } from "./finding-model.js";
5
+ import type { LifecycleModel } from "./lifecycle-model.js";
6
+ import type { OwnershipModel } from "./ownership-model.js";
7
+ /**
8
+ * Bump only when a reader could misinterpret the new shape of `EvidenceModel`
9
+ * itself (not any one sub-model's own `<MODEL>_SCHEMA_VERSION`, which is
10
+ * versioned independently) -- same rule every other canonical model follows.
11
+ */
12
+ export declare const EVIDENCE_MODEL_SCHEMA_VERSION = 1;
13
+ /**
14
+ * Who/when/what produced a given `EvidenceModel` instance. Caller-supplied,
15
+ * never ambient-detected -- `generateEvidenceModel()` never shells out to
16
+ * `git` itself, mirroring ADR 0012's live-expiration-callback precedent.
17
+ */
18
+ export interface EvidenceProvenance {
19
+ readonly generatedAt: string;
20
+ readonly toolVersion: string;
21
+ readonly commit: string | undefined;
22
+ }
23
+ /**
24
+ * The seventh canonical fact model (ADR 0024): the assembled union of the
25
+ * other six, plus provenance, the immutable input every
26
+ * `defineEvidenceProjection()` projector runs over (`env-cap/evidence`,
27
+ * ADR 0031).
28
+ *
29
+ * @remarks
30
+ * This type is the one intentional exception to `src/build/`'s zero-
31
+ * cross-folder-import rule: `src/evidence/` imports it with `import type`
32
+ * only (fully erased at compile time under `verbatimModuleSyntax`), the same
33
+ * shape as `helpers`' single sanctioned edge onto `runtime` -- see
34
+ * `specs/architecture.md`. `src/evidence/` never imports a *value* from
35
+ * here, only this shape, so it stays isomorphic and Node-free. An actual
36
+ * `EvidenceModel` instance is produced by {@link generateEvidenceModel}
37
+ * (`env-cap/build`, Node-only), which runs discovery once,
38
+ * builds all six sub-models, and `deepFreeze()`s the result.
39
+ */
40
+ export interface EvidenceModel {
41
+ readonly schemaVersion: typeof EVIDENCE_MODEL_SCHEMA_VERSION;
42
+ readonly provenance: EvidenceProvenance;
43
+ readonly contract: ContractModel;
44
+ readonly dependency: DependencyModel;
45
+ readonly ownership: OwnershipModel;
46
+ readonly lifecycle: LifecycleModel;
47
+ readonly finding: FindingModel;
48
+ readonly change: ChangeModel;
49
+ }
50
+ //# sourceMappingURL=evidence-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evidence-model.d.ts","sourceRoot":"","sources":["../../../src/build/evidence-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,IAAI,CAAA;AAE9C;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CACpC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,aAAa,EAAE,OAAO,6BAA6B,CAAA;IAC5D,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAA;IACvC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAA;IAChC,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAA;IACpC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAA;IAClC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAA;IAClC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;IAC9B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAC7B"}
@@ -0,0 +1,67 @@
1
+ import type { SourcePosition } from "./source-position.js";
2
+ /**
3
+ * A structured pointer back to where a `Finding` (or, later, any other
4
+ * model's derived fact) came from -- never a formatted string. See ADR 0024
5
+ * and ADR 0026.
6
+ *
7
+ * @remarks
8
+ * Deliberately only as many `model` variants as something in this codebase
9
+ * actually needs to reference today (`"contract"`, `"ownership"`,
10
+ * `"change"`). This is an additive, growable union, not a speculative
11
+ * six-model union built ahead of a real consumer -- a later phase (e.g. the
12
+ * Dependency or Lifecycle Model) adds its own variant only once a finding
13
+ * or projector genuinely needs to point at it.
14
+ */
15
+ export type EvidenceReference = ContractEvidenceReference | OwnershipEvidenceReference | ChangeEvidenceReference;
16
+ /**
17
+ * The one shape every model in this package uses to point at a declared
18
+ * contract: the file it's declared in, and the binding it's exported as.
19
+ * Nothing else -- see ADR 0039.
20
+ *
21
+ * @remarks
22
+ * Deliberately *not* carrying `contractName`. A display name is a rendering
23
+ * concern, resolved on demand from `ContractModel` (the one model that owns
24
+ * it) by whichever renderer actually needs prose; duplicating it onto every
25
+ * reference made it a second, independently-stale copy of a fact that can
26
+ * change under a `documentEnv()` edit. Deliberately not carrying a
27
+ * pre-formatted `identity` string either -- `${file}#${exportName}` is
28
+ * trivially derivable, and a stored copy is one more thing that can disagree
29
+ * with the two fields it was built from. Code that genuinely needs a map key
30
+ * builds that string locally, at the point of use.
31
+ */
32
+ export interface ContractRef {
33
+ /** Root-relative, POSIX-separated path of the file declaring the contract -- see `displayPath()`. */
34
+ readonly file: string;
35
+ /** The binding name the `createEnv()` result is exported as. */
36
+ readonly exportName: string;
37
+ }
38
+ /** Points at a declared contract and, optionally, one of its variables -- the shape every `CompatibilityIssue`/documentation finding can be resolved to. Unlike {@link ContractRef}, both identity fields are optional here: a finding can legitimately know only the file (an unresolvable `documentEnv()` link) or neither. */
39
+ export interface ContractEvidenceReference {
40
+ readonly model: "contract";
41
+ /** Root-relative, POSIX-separated path of the file declaring the contract, when known -- see `displayPath()`. */
42
+ readonly file: string | undefined;
43
+ /** The contract's exported binding name, when known. */
44
+ readonly exportName: string | undefined;
45
+ /** The environment variable name, when the finding is variable-level rather than contract-level. */
46
+ readonly variable: string | undefined;
47
+ /** Exact file:line:column this finding is about -- the contract's `createEnv()` declaration, its `documentEnv()` declaration, or the specific variable's own declaration, whichever is most relevant to the finding. `undefined` only when no single position is more relevant than another (e.g. an `indeterminate-ownership` finding, which can have multiple candidate sites -- see `IndeterminateOwnershipFinding.dynamicAccessSites` for the full list instead). See ADR 0036. */
48
+ readonly position: SourcePosition | undefined;
49
+ }
50
+ /** Points at a contract by name for an ownership/usage finding -- `usage-report.ts`'s finding types don't consistently carry `file`/`exportName` together, only `contractName`. */
51
+ export interface OwnershipEvidenceReference {
52
+ readonly model: "ownership";
53
+ readonly contractName: string;
54
+ /** Root-relative path of the file declaring the contract, when the source finding carries one. */
55
+ readonly file: string | undefined;
56
+ /** The environment variable name, when the finding is variable-level rather than contract-level. */
57
+ readonly variable: string | undefined;
58
+ /** See {@link ContractEvidenceReference.position}. */
59
+ readonly position: SourcePosition | undefined;
60
+ }
61
+ /** Points at a generated artifact's path -- what `checkEnvArtifacts()`'s drift findings are about, not a declared contract or variable at all. */
62
+ export interface ChangeEvidenceReference {
63
+ readonly model: "change";
64
+ /** Absolute path of the generated artifact. */
65
+ readonly path: string;
66
+ }
67
+ //# sourceMappingURL=evidence-reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evidence-reference.d.ts","sourceRoot":"","sources":["../../../src/build/evidence-reference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,iBAAiB,GAC3B,yBAAyB,GAAG,0BAA0B,GAAG,uBAAuB,CAAA;AAElF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,WAAW;IAC1B,qGAAqG;IACrG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,gEAAgE;IAChE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B;AAED,iUAAiU;AACjU,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;IAC1B,iHAAiH;IACjH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,wDAAwD;IACxD,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,oGAAoG;IACpG,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,udAAud;IACvd,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAA;CAC9C;AAED,mLAAmL;AACnL,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAA;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,kGAAkG;IAClG,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,oGAAoG;IACpG,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAA;CAC9C;AAED,kJAAkJ;AAClJ,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAA;IACxB,+CAA+C;IAC/C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB"}
@@ -0,0 +1,123 @@
1
+ import type { DynamicAccessCitationProblem } from "./citation-verification.js";
2
+ import type { ContractRef } from "./evidence-reference.js";
3
+ import type { ContractModelContract } from "./contract-model.js";
4
+ import type { EvidenceModel } from "./evidence-model.js";
5
+ import type { DiscoveredContract } from "./link.js";
6
+ import type { ParseWarning } from "./parse.js";
7
+ import type { DynamicAccessAssertion } from "./source-position.js";
8
+ import type { BuildFileSystem } from "./types.js";
9
+ /**
10
+ * The persisted evidence artifact and everything that reads/diffs it.
11
+ *
12
+ * Not a sibling of `env.manifest.ts`. `env.manifest.ts` is a *runtime build
13
+ * artifact* -- real TypeScript, imported and executed by the running
14
+ * application. This module's own artifact is a *CI/reporting artifact*: the
15
+ * literal `EvidenceModel` a caller gets back from `generateEvidenceModel()`,
16
+ * serialized to disk, read only by `--check`, by CI tooling, and by whatever
17
+ * a project's own reporting/projection code chooses to do with it -- never
18
+ * imported by anything under `src/runtime/`, never a build input to the
19
+ * application itself. Its location is never derived from a manifest's own
20
+ * output path (there is no `<manifest>.snapshot.json` sidecar mechanism
21
+ * anymore); a caller supplies it directly, independent of whether a `.ts`
22
+ * manifest is even being generated at all.
23
+ *
24
+ * Two jobs, one file: this is both (a) the baseline `diffContracts()`
25
+ * compares the current run's `ContractModel` against to produce
26
+ * `ManifestChangeReport`, and (b) the committed-baseline content-hash source
27
+ * `buildCitationSnapshots()` (`citation-verification.ts`) uses to tell a
28
+ * "fresh" developer dynamic-access citation from a "stale" one (ADR 0037).
29
+ * Whether a project commits this file to git or regenerates it fresh every CI
30
+ * run is that project's call -- a missing file is always treated as the normal
31
+ * first-run state, never an error.
32
+ */
33
+ /** One field's before/after value in a {@link ManifestContractUpdate} or {@link ManifestVariableUpdate}. */
34
+ export interface ManifestFieldChange {
35
+ /** The changed field's name. */
36
+ readonly field: string;
37
+ /** The value from the previous snapshot, or `undefined` if the field was unset. */
38
+ readonly previous: string | undefined;
39
+ /** The value in the current run, or `undefined` if the field is now unset. */
40
+ readonly current: string | undefined;
41
+ }
42
+ /** Identifies one contract for {@link ManifestChangeReport} purposes -- see {@link ContractRef} for why neither a `contractName` nor a pre-formatted `identity` is carried here. */
43
+ export type ManifestContractRef = ContractRef;
44
+ /** Identifies one variable for {@link ManifestChangeReport} purposes -- its owning contract's identity plus its own key. See {@link ContractRef}. */
45
+ export interface ManifestVariableRef extends ContractRef {
46
+ /** The environment variable name. */
47
+ readonly key: string;
48
+ }
49
+ /** A contract present in both snapshots, with at least one changed field. */
50
+ export interface ManifestContractUpdate extends ManifestContractRef {
51
+ /** Every field that changed between the previous and current snapshot. */
52
+ readonly changes: readonly ManifestFieldChange[];
53
+ }
54
+ /** A variable present in both snapshots, with at least one changed field. */
55
+ export interface ManifestVariableUpdate extends ManifestVariableRef {
56
+ /** Every field that changed between the previous and current snapshot. */
57
+ readonly changes: readonly ManifestFieldChange[];
58
+ }
59
+ /**
60
+ * The result of diffing two `ContractModel.contracts` arrays -- see
61
+ * `diffContracts()`. Comprehensive by construction: every own field of
62
+ * `ContractModelContract`/`ContractModelVariable` (schema facts --
63
+ * `hasDefault`/`processorSource`/`validatorSource`/... -- alongside
64
+ * documented metadata) participates, and every discovered contract is
65
+ * covered, not only active ones. A field-by-field, hand-maintained diff
66
+ * (this module's previous design) would need updating by hand every time
67
+ * Contract Model gains a field; the generic differ below can't drift out of
68
+ * sync with the model it diffs.
69
+ */
70
+ export interface ManifestChangeReport {
71
+ /** Contracts present now but not in the previous snapshot. */
72
+ readonly addedContracts: readonly ManifestContractRef[];
73
+ /** Contracts present in the previous snapshot but not now. */
74
+ readonly removedContracts: readonly ManifestContractRef[];
75
+ /** Variables present now but not in the previous snapshot. */
76
+ readonly addedVariables: readonly ManifestVariableRef[];
77
+ /** Variables present in the previous snapshot but not now. */
78
+ readonly removedVariables: readonly ManifestVariableRef[];
79
+ /** Contracts present in both snapshots with at least one changed field. */
80
+ readonly updatedContracts: readonly ManifestContractUpdate[];
81
+ /** Variables present in both snapshots with at least one changed field. */
82
+ readonly updatedVariables: readonly ManifestVariableUpdate[];
83
+ }
84
+ /**
85
+ * Pure. `previous === undefined` (no snapshot last time, for any reason --
86
+ * see `EvidenceSnapshotReadResult`) reports everything in `current` as
87
+ * added, nothing as removed/updated.
88
+ */
89
+ export declare function diffContracts(previous: readonly ContractModelContract[] | undefined, current: readonly ContractModelContract[]): ManifestChangeReport;
90
+ /** Distinguishes *why* there's no usable previous snapshot, rather than collapsing every case into a bare `undefined`. A missing file is the normal, silent, expected first-run/never-configured case. An unparseable file or a `schemaVersion` this build doesn't recognize are both real, diagnosable problems. */
91
+ export type EvidenceSnapshotReadResult = {
92
+ readonly status: "missing";
93
+ } | {
94
+ readonly status: "invalid-json";
95
+ readonly detail: string;
96
+ } | {
97
+ readonly status: "unsupported-version";
98
+ readonly foundVersion: unknown;
99
+ } | {
100
+ readonly status: "ok";
101
+ readonly snapshot: EvidenceModel;
102
+ };
103
+ export declare function readEvidenceSnapshot(snapshotPath: string, fs: BuildFileSystem): Promise<EvidenceSnapshotReadResult>;
104
+ export declare function writeEvidenceSnapshot(snapshotPath: string, snapshot: EvidenceModel, fs: BuildFileSystem): Promise<void>;
105
+ export declare function normalizeEvidenceSnapshotForComparison(snapshot: EvidenceModel): EvidenceModel;
106
+ /** Everything reading a previous evidence snapshot and diffing the current run against it produces, in one call. Never writes anything itself -- writing the fresh snapshot stays a separate, explicit step on the real write path. */
107
+ export interface EvidenceChangesComputation {
108
+ readonly report: ManifestChangeReport;
109
+ /** Set only when the previous snapshot existed but was unusable (corrupt JSON or an unrecognized `schemaVersion`) -- never set for the ordinary "no snapshot yet" first-run case. */
110
+ readonly readWarning: ParseWarning | undefined;
111
+ readonly dynamicAccessAcknowledgments: ReadonlyMap<string, readonly DynamicAccessAssertion[]>;
112
+ readonly dynamicAccessCitationProblems: readonly DynamicAccessCitationProblem[];
113
+ }
114
+ /**
115
+ * The one I/O-performing helper every caller wanting change/citation-freshness
116
+ * data shares: reads the previous evidence snapshot (if `snapshotPath` is
117
+ * given and a file exists there), diffs the current run's `ContractModel`
118
+ * against it, and re-checks every current `dynamicAccess` citation's
119
+ * freshness. `snapshotPath` is always caller-supplied, directly -- there is
120
+ * no derivation from a manifest's own output path.
121
+ */
122
+ export declare function computeEvidenceChanges(root: string, snapshotPath: string, activeContracts: readonly DiscoveredContract[], currentContracts: readonly ContractModelContract[], readFile: (filePath: string) => Promise<string>, fs: BuildFileSystem): Promise<EvidenceChangesComputation>;
123
+ //# sourceMappingURL=evidence-snapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evidence-snapshot.d.ts","sourceRoot":"","sources":["../../../src/build/evidence-snapshot.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAA;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAyB,MAAM,qBAAqB,CAAA;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,4GAA4G;AAC5G,MAAM,WAAW,mBAAmB;IAClC,gCAAgC;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,mFAAmF;IACnF,QAA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,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,EAC/C,EAAE,EAAE,eAAe,GAClB,OAAO,CAAC,0BAA0B,CAAC,CAmDrC"}
@@ -0,0 +1,19 @@
1
+ import type { CompatibilityIssue } from "./compatibility.js";
2
+ import type { DiscoveredContract } from "./link.js";
3
+ /**
4
+ * Detects two *active* contracts declaring the same `exclusiveGroup` --
5
+ * e.g. two interchangeable database backends both left enabled at once.
6
+ *
7
+ * @remarks
8
+ * Unlike `detectCompatibilityIssues`, this is never a heuristic warning: an
9
+ * author explicitly declared these contracts mutually exclusive, so any
10
+ * violation is always a hard error, regardless of `onIncompatibility`. See
11
+ * ADR 0009 for why this doesn't follow 0005's warn-by-default policy.
12
+ *
13
+ * Inactive contracts are ignored entirely here (filtered internally, not by
14
+ * the caller) so this stays correct even when called directly via the
15
+ * `/build` export -- an inactive contract can share a group with an active
16
+ * one with no conflict, since it was never wired into anything.
17
+ */
18
+ export declare function detectExclusiveGroupIssues(contracts: readonly DiscoveredContract[]): CompatibilityIssue[];
19
+ //# sourceMappingURL=exclusive-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exclusive-group.d.ts","sourceRoot":"","sources":["../../../src/build/exclusive-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAEnD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,SAAS,kBAAkB,EAAE,GACvC,kBAAkB,EAAE,CAoCtB"}
@@ -0,0 +1,79 @@
1
+ import type { ArtifactCheckFinding } from "./check-artifacts.js";
2
+ import type { CompatibilityIssue, CompatibilityIssueCode } from "./compatibility.js";
3
+ import type { EvidenceReference } from "./evidence-reference.js";
4
+ import type { DocumentationFindings } from "./generate-documentation.js";
5
+ import type { DynamicAccessCitationProblem } from "./citation-verification.js";
6
+ import type { AbandonedContractFinding, IndeterminateOwnershipFinding, UnconsumedOwnedVariableFinding, UnresolvedConsumerFinding } from "./usage-report.js";
7
+ /**
8
+ * The fourth of env-cap's seven canonical fact models (ADR 0024) -- every
9
+ * rule violation and derived risk signal, unified behind one shape, with a
10
+ * stable `code` and a structured {@link EvidenceReference} instead of four
11
+ * independently-shaped finding families. See ADR 0026.
12
+ */
13
+ /** Every stable `code` a {@link Finding} can carry. A superset of {@link CompatibilityIssueCode} plus one code per non-compatibility source family this model adapts. */
14
+ export type FindingCode = CompatibilityIssueCode | "EXCLUSIVE_GROUP_VIOLATION" | "ARTIFACT_STALE" | "ARTIFACT_MISSING" | "UNDOCUMENTED_CONTRACT" | "UNDOCUMENTED_VARIABLE" | "STALE_DOC_ENTRY" | "EXPIRED" | "EXPIRING_SOON" | "UNRESOLVED_DOCUMENTENV_LINK" | "ABANDONED_CONTRACT" | "UNRESOLVED_CONSUMER" | "UNCONSUMED_OWNED_VARIABLE" | "INDETERMINATE_OWNERSHIP" | "MISSING_DYNAMIC_ACCESS_CITATION" | "STALE_DYNAMIC_ACCESS_CITATION" | "NONSTANDARD_SENSITIVITY_LEVEL";
15
+ /** Which source check produced a {@link Finding} -- coarser than `code`, for a consumer that only wants to filter by kind (e.g. "show me every documentation gap") without enumerating every individual code. */
16
+ export type FindingFamily = "compatibility" | "drift" | "documentation" | "ownership";
17
+ /** One rule violation or derived signal, in the Finding Model's canonical shape. */
18
+ export interface Finding {
19
+ /**
20
+ * `"error"` for a provable, always-blocking violation (e.g. an
21
+ * exclusive-group conflict); `"warning"` for everything gated by
22
+ * `onIncompatibility`/`onUndocumented`/`onOwnershipIssue`'s default "warn"
23
+ * behavior; `"info"` for an observation that is never actionable enough to
24
+ * block anything, even under `--strict` -- see `INFO_ONLY_CODES` in
25
+ * `generate-env-artifacts.ts`.
26
+ */
27
+ readonly severity: "error" | "warning" | "info";
28
+ /** Stable, machine-readable identifier -- always set, unlike {@link CompatibilityIssue.code} which stays optional on that narrower, pre-existing type. */
29
+ readonly code: FindingCode;
30
+ /** Which source check produced this finding. */
31
+ readonly family: FindingFamily;
32
+ /** Human-readable explanation, reusing the source finding's own prose where one exists. */
33
+ readonly message: string;
34
+ /** Structured pointer back to what this finding is about. */
35
+ readonly location: EvidenceReference;
36
+ }
37
+ /** Bump only when a reader could misinterpret the new shape -- same discipline every other canonical model's `schemaVersion` follows. */
38
+ export declare const FINDING_MODEL_SCHEMA_VERSION = 3;
39
+ export interface FindingModel {
40
+ readonly schemaVersion: typeof FINDING_MODEL_SCHEMA_VERSION;
41
+ readonly findings: readonly Finding[];
42
+ }
43
+ /**
44
+ * Every source a {@link buildFindingModel} call can adapt, all optional --
45
+ * a caller passes whichever of `generateEnvArtifacts()`'s `manifest`/`docs`/
46
+ * `usage` results it actually requested, exactly like that result's own
47
+ * top-level fields are each independently optional.
48
+ */
49
+ export interface BuildFindingModelInput {
50
+ /** Every `EvidenceReference.file` below is rendered relative to this, matching every other rendered path in this package's output -- see `displayPath()`. */
51
+ readonly root: string;
52
+ /** From `detectCompatibilityIssues()`. */
53
+ readonly compatibilityIssues?: readonly CompatibilityIssue[];
54
+ /** From `detectExclusiveGroupIssues()` -- kept separate from `compatibilityIssues` since it never sets its own `code` yet (ADR 0009), so this adapter synthesizes `"EXCLUSIVE_GROUP_VIOLATION"` for every entry. */
55
+ readonly exclusiveGroupIssues?: readonly CompatibilityIssue[];
56
+ /** From `checkEnvArtifacts()`'s result. Only `"stale"`/`"missing"` findings become a `Finding` -- `"ok"` means nothing to report. */
57
+ readonly artifactCheckFindings?: readonly ArtifactCheckFinding[];
58
+ /** From `generateDocumentation()`'s result. */
59
+ readonly documentation?: DocumentationFindings;
60
+ /** From `generateUsageReport()`'s result. */
61
+ readonly abandonedContracts?: readonly AbandonedContractFinding[];
62
+ /** From `generateUsageReport()`'s result. */
63
+ readonly unresolvedConsumers?: readonly UnresolvedConsumerFinding[];
64
+ /** From `generateUsageReport()`'s result. */
65
+ readonly unconsumedOwnedVariables?: readonly UnconsumedOwnedVariableFinding[];
66
+ /** From `generateUsageReport()`'s result. */
67
+ readonly indeterminateOwnership?: readonly IndeterminateOwnershipFinding[];
68
+ /** From `computeManifestChanges()`'s result -- every `dynamicAccess` citation that's gone `"stale"` or `"missing"` since it was last acknowledged. See ADR 0037. */
69
+ readonly dynamicAccessCitationProblems?: readonly DynamicAccessCitationProblem[];
70
+ }
71
+ /**
72
+ * Adapts every existing finding family into the Finding Model's unified
73
+ * shape -- an adapter over data that already exists, not a new source of
74
+ * truth. Order of the returned array mirrors the order sources are given
75
+ * above; a consumer wanting a specific order (by severity, by file, ...)
76
+ * sorts it themselves.
77
+ */
78
+ export declare function buildFindingModel(input: BuildFindingModelInput): FindingModel;
79
+ //# sourceMappingURL=finding-model.d.ts.map