@agent-teams/engineering-foundation 1.2.0 → 1.3.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 (257) hide show
  1. package/dist/capabilities/public-api-compatibility/adapters/inbound/configuration/load-public-api-audit.d.ts +4 -0
  2. package/dist/capabilities/public-api-compatibility/adapters/inbound/configuration/load-public-api-audit.d.ts.map +1 -0
  3. package/dist/capabilities/public-api-compatibility/adapters/inbound/configuration/load-public-api-audit.js +13 -0
  4. package/dist/capabilities/public-api-compatibility/adapters/inbound/configuration/load-public-api-audit.js.map +1 -0
  5. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/audit-compiler-bindings.d.ts +17 -0
  6. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/audit-compiler-bindings.d.ts.map +1 -0
  7. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/audit-compiler-bindings.js +139 -0
  8. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/audit-compiler-bindings.js.map +1 -0
  9. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/load-pinned-audit-sdk.d.ts +7 -0
  10. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/load-pinned-audit-sdk.d.ts.map +1 -0
  11. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/load-pinned-audit-sdk.js +14 -0
  12. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/load-pinned-audit-sdk.js.map +1 -0
  13. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-extractor.d.ts.map +1 -1
  14. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-extractor.js +10 -43
  15. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-extractor.js.map +1 -1
  16. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-observer.d.ts +6 -0
  17. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-observer.d.ts.map +1 -0
  18. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-observer.js +497 -0
  19. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/microsoft-public-api-observer.js.map +1 -0
  20. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/pinned-audit-compiler.d.ts +101 -0
  21. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/pinned-audit-compiler.d.ts.map +1 -0
  22. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/pinned-audit-compiler.js +2 -0
  23. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/pinned-audit-compiler.js.map +1 -0
  24. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/prepare-public-api-extractor.d.ts +15 -0
  25. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/prepare-public-api-extractor.d.ts.map +1 -0
  26. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/prepare-public-api-extractor.js +47 -0
  27. package/dist/capabilities/public-api-compatibility/adapters/outbound/api-extractor/prepare-public-api-extractor.js.map +1 -0
  28. package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-audit-inputs.d.ts +43 -0
  29. package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-audit-inputs.d.ts.map +1 -0
  30. package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-audit-inputs.js +239 -0
  31. package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-audit-inputs.js.map +1 -0
  32. package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-baseline-mapper.d.ts +1 -1
  33. package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-baseline-mapper.d.ts.map +1 -1
  34. package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-baseline-mapper.js.map +1 -1
  35. package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/stage-public-api-audit.d.ts +12 -0
  36. package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/stage-public-api-audit.d.ts.map +1 -0
  37. package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/stage-public-api-audit.js +169 -0
  38. package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/stage-public-api-audit.js.map +1 -0
  39. package/dist/capabilities/public-api-compatibility/api.d.ts +3 -0
  40. package/dist/capabilities/public-api-compatibility/api.d.ts.map +1 -0
  41. package/dist/capabilities/public-api-compatibility/api.js +2 -0
  42. package/dist/capabilities/public-api-compatibility/api.js.map +1 -0
  43. package/dist/capabilities/public-api-compatibility/application/model/public-api-audit-report.d.ts +36 -0
  44. package/dist/capabilities/public-api-compatibility/application/model/public-api-audit-report.d.ts.map +1 -0
  45. package/dist/capabilities/public-api-compatibility/application/model/public-api-audit-report.js +2 -0
  46. package/dist/capabilities/public-api-compatibility/application/model/public-api-audit-report.js.map +1 -0
  47. package/dist/capabilities/public-api-compatibility/application/model/public-api-observation.d.ts +73 -0
  48. package/dist/capabilities/public-api-compatibility/application/model/public-api-observation.d.ts.map +1 -0
  49. package/dist/capabilities/public-api-compatibility/application/model/public-api-observation.js +5 -0
  50. package/dist/capabilities/public-api-compatibility/application/model/public-api-observation.js.map +1 -0
  51. package/dist/capabilities/public-api-compatibility/application/policies/project-public-api-observation.d.ts +33 -0
  52. package/dist/capabilities/public-api-compatibility/application/policies/project-public-api-observation.d.ts.map +1 -0
  53. package/dist/capabilities/public-api-compatibility/application/policies/project-public-api-observation.js +110 -0
  54. package/dist/capabilities/public-api-compatibility/application/policies/project-public-api-observation.js.map +1 -0
  55. package/dist/capabilities/public-api-compatibility/application/policies/public-api-audit-eligibility.d.ts +9 -0
  56. package/dist/capabilities/public-api-compatibility/application/policies/public-api-audit-eligibility.d.ts.map +1 -0
  57. package/dist/capabilities/public-api-compatibility/application/policies/public-api-audit-eligibility.js +180 -0
  58. package/dist/capabilities/public-api-compatibility/application/policies/public-api-audit-eligibility.js.map +1 -0
  59. package/dist/capabilities/public-api-compatibility/application/ports/public-api-observer.d.ts +29 -0
  60. package/dist/capabilities/public-api-compatibility/application/ports/public-api-observer.d.ts.map +1 -0
  61. package/dist/capabilities/public-api-compatibility/application/ports/public-api-observer.js +2 -0
  62. package/dist/capabilities/public-api-compatibility/application/ports/public-api-observer.js.map +1 -0
  63. package/dist/capabilities/public-api-compatibility/application/use-cases/audit-public-api.d.ts +14 -0
  64. package/dist/capabilities/public-api-compatibility/application/use-cases/audit-public-api.d.ts.map +1 -0
  65. package/dist/capabilities/public-api-compatibility/application/use-cases/audit-public-api.js +144 -0
  66. package/dist/capabilities/public-api-compatibility/application/use-cases/audit-public-api.js.map +1 -0
  67. package/dist/capabilities/public-api-compatibility/contract/public-api-audit.d.ts +58 -0
  68. package/dist/capabilities/public-api-compatibility/contract/public-api-audit.d.ts.map +1 -0
  69. package/dist/capabilities/public-api-compatibility/contract/public-api-audit.js +2 -0
  70. package/dist/capabilities/public-api-compatibility/contract/public-api-audit.js.map +1 -0
  71. package/dist/capabilities/public-api-compatibility/node.d.ts +3 -0
  72. package/dist/capabilities/public-api-compatibility/node.d.ts.map +1 -0
  73. package/dist/capabilities/public-api-compatibility/node.js +2 -0
  74. package/dist/capabilities/public-api-compatibility/node.js.map +1 -0
  75. package/dist/capabilities/public-api-compatibility/schemas.d.ts +1 -1
  76. package/dist/capabilities/public-api-compatibility/schemas.d.ts.map +1 -1
  77. package/dist/capabilities/public-api-compatibility/schemas.js +2 -0
  78. package/dist/capabilities/public-api-compatibility/schemas.js.map +1 -1
  79. package/dist/capabilities/source-dependencies/adapters/inbound/configuration/load-capability-config.d.ts +1 -0
  80. package/dist/capabilities/source-dependencies/adapters/inbound/configuration/load-capability-config.d.ts.map +1 -1
  81. package/dist/capabilities/source-dependencies/adapters/inbound/configuration/load-capability-config.js +3 -0
  82. package/dist/capabilities/source-dependencies/adapters/inbound/configuration/load-capability-config.js.map +1 -1
  83. package/dist/capabilities/source-dependencies/adapters/outbound/node/selected-package-source-discovery.d.ts +2 -0
  84. package/dist/capabilities/source-dependencies/adapters/outbound/node/selected-package-source-discovery.d.ts.map +1 -1
  85. package/dist/capabilities/source-dependencies/adapters/outbound/node/selected-package-source-discovery.js +5 -4
  86. package/dist/capabilities/source-dependencies/adapters/outbound/node/selected-package-source-discovery.js.map +1 -1
  87. package/dist/capabilities/source-dependencies/adapters/outbound/node/source-census-reader.d.ts +3 -0
  88. package/dist/capabilities/source-dependencies/adapters/outbound/node/source-census-reader.d.ts.map +1 -0
  89. package/dist/capabilities/source-dependencies/adapters/outbound/node/source-census-reader.js +32 -0
  90. package/dist/capabilities/source-dependencies/adapters/outbound/node/source-census-reader.js.map +1 -0
  91. package/dist/capabilities/source-dependencies/api.d.ts +1 -0
  92. package/dist/capabilities/source-dependencies/api.d.ts.map +1 -1
  93. package/dist/capabilities/source-dependencies/api.js.map +1 -1
  94. package/dist/capabilities/source-dependencies/application/ports/source-census-reader.d.ts +13 -0
  95. package/dist/capabilities/source-dependencies/application/ports/source-census-reader.d.ts.map +1 -0
  96. package/dist/capabilities/source-dependencies/application/ports/source-census-reader.js +2 -0
  97. package/dist/capabilities/source-dependencies/application/ports/source-census-reader.js.map +1 -0
  98. package/dist/capabilities/source-dependencies/module.d.ts +2 -0
  99. package/dist/capabilities/source-dependencies/module.d.ts.map +1 -1
  100. package/dist/capabilities/source-dependencies/module.js +2 -0
  101. package/dist/capabilities/source-dependencies/module.js.map +1 -1
  102. package/dist/capabilities/suppression-governance/adapters/inbound/configuration/load-capability-config.d.ts +1 -0
  103. package/dist/capabilities/suppression-governance/adapters/inbound/configuration/load-capability-config.d.ts.map +1 -1
  104. package/dist/capabilities/suppression-governance/adapters/inbound/configuration/load-capability-config.js +3 -0
  105. package/dist/capabilities/suppression-governance/adapters/inbound/configuration/load-capability-config.js.map +1 -1
  106. package/dist/capabilities/suppression-governance/module.d.ts +1 -0
  107. package/dist/capabilities/suppression-governance/module.d.ts.map +1 -1
  108. package/dist/capabilities/suppression-governance/module.js +1 -0
  109. package/dist/capabilities/suppression-governance/module.js.map +1 -1
  110. package/dist/composition/capability-modules.d.ts.map +1 -1
  111. package/dist/composition/capability-modules.js +3 -0
  112. package/dist/composition/capability-modules.js.map +1 -1
  113. package/dist/composition/command-host.d.ts.map +1 -1
  114. package/dist/composition/command-host.js +2 -1
  115. package/dist/composition/command-host.js.map +1 -1
  116. package/dist/composition/quality-coverage.d.ts +6 -0
  117. package/dist/composition/quality-coverage.d.ts.map +1 -0
  118. package/dist/composition/quality-coverage.js +25 -0
  119. package/dist/composition/quality-coverage.js.map +1 -0
  120. package/dist/features/command-host/adapters/inbound/cli/cli-arguments.d.ts.map +1 -1
  121. package/dist/features/command-host/adapters/inbound/cli/cli-arguments.js +17 -2
  122. package/dist/features/command-host/adapters/inbound/cli/cli-arguments.js.map +1 -1
  123. package/dist/features/command-host/adapters/inbound/cli/foundation-cli.d.ts.map +1 -1
  124. package/dist/features/command-host/adapters/inbound/cli/foundation-cli.js +38 -1
  125. package/dist/features/command-host/adapters/inbound/cli/foundation-cli.js.map +1 -1
  126. package/dist/features/command-host/application/command-invocation.d.ts +1 -0
  127. package/dist/features/command-host/application/command-invocation.d.ts.map +1 -1
  128. package/dist/features/command-host/application/command-invocation.js.map +1 -1
  129. package/dist/features/command-host/application/command-reporting.d.ts +2 -2
  130. package/dist/features/command-host/application/command-reporting.d.ts.map +1 -1
  131. package/dist/features/command-host/application/command-reporting.js +4 -1
  132. package/dist/features/command-host/application/command-reporting.js.map +1 -1
  133. package/dist/features/command-host/application/command-services.d.ts +10 -1
  134. package/dist/features/command-host/application/command-services.d.ts.map +1 -1
  135. package/dist/features/command-host/composition/node-command-host.d.ts +4 -1
  136. package/dist/features/command-host/composition/node-command-host.d.ts.map +1 -1
  137. package/dist/features/command-host/composition/node-command-host.js +3 -0
  138. package/dist/features/command-host/composition/node-command-host.js.map +1 -1
  139. package/dist/features/foundation-check/adapters/inbound/config/foundation-config-reader.d.ts.map +1 -1
  140. package/dist/features/foundation-check/adapters/inbound/config/foundation-config-reader.js +2 -1
  141. package/dist/features/foundation-check/adapters/inbound/config/foundation-config-reader.js.map +1 -1
  142. package/dist/features/foundation-check/application/ports/foundation-config-input.d.ts +1 -1
  143. package/dist/features/foundation-check/application/ports/foundation-config-input.d.ts.map +1 -1
  144. package/dist/features/foundation-check/schemas.d.ts +1 -1
  145. package/dist/features/foundation-check/schemas.d.ts.map +1 -1
  146. package/dist/features/foundation-check/schemas.js +2 -1
  147. package/dist/features/foundation-check/schemas.js.map +1 -1
  148. package/dist/features/quality-coverage/adapters/configuration.d.ts +3 -0
  149. package/dist/features/quality-coverage/adapters/configuration.d.ts.map +1 -0
  150. package/dist/features/quality-coverage/adapters/configuration.js +4 -0
  151. package/dist/features/quality-coverage/adapters/configuration.js.map +1 -0
  152. package/dist/features/quality-coverage/adapters/consumer-execution.d.ts +12 -0
  153. package/dist/features/quality-coverage/adapters/consumer-execution.d.ts.map +1 -0
  154. package/dist/features/quality-coverage/adapters/consumer-execution.js +35 -0
  155. package/dist/features/quality-coverage/adapters/consumer-execution.js.map +1 -0
  156. package/dist/features/quality-coverage/adapters/consumer-observations.d.ts +8 -0
  157. package/dist/features/quality-coverage/adapters/consumer-observations.d.ts.map +1 -0
  158. package/dist/features/quality-coverage/adapters/consumer-observations.js +93 -0
  159. package/dist/features/quality-coverage/adapters/consumer-observations.js.map +1 -0
  160. package/dist/features/quality-coverage/adapters/consumer-toolchain.d.ts +13 -0
  161. package/dist/features/quality-coverage/adapters/consumer-toolchain.d.ts.map +1 -0
  162. package/dist/features/quality-coverage/adapters/consumer-toolchain.js +84 -0
  163. package/dist/features/quality-coverage/adapters/consumer-toolchain.js.map +1 -0
  164. package/dist/features/quality-coverage/adapters/oxlint-output.d.ts +8 -0
  165. package/dist/features/quality-coverage/adapters/oxlint-output.d.ts.map +1 -0
  166. package/dist/features/quality-coverage/adapters/oxlint-output.js +53 -0
  167. package/dist/features/quality-coverage/adapters/oxlint-output.js.map +1 -0
  168. package/dist/features/quality-coverage/adapters/oxlint-session.d.ts +14 -0
  169. package/dist/features/quality-coverage/adapters/oxlint-session.d.ts.map +1 -0
  170. package/dist/features/quality-coverage/adapters/oxlint-session.js +53 -0
  171. package/dist/features/quality-coverage/adapters/oxlint-session.js.map +1 -0
  172. package/dist/features/quality-coverage/adapters/profile-input.d.ts +9 -0
  173. package/dist/features/quality-coverage/adapters/profile-input.d.ts.map +1 -0
  174. package/dist/features/quality-coverage/adapters/profile-input.js +110 -0
  175. package/dist/features/quality-coverage/adapters/profile-input.js.map +1 -0
  176. package/dist/features/quality-coverage/adapters/protected-config.d.ts +15 -0
  177. package/dist/features/quality-coverage/adapters/protected-config.d.ts.map +1 -0
  178. package/dist/features/quality-coverage/adapters/protected-config.js +200 -0
  179. package/dist/features/quality-coverage/adapters/protected-config.js.map +1 -0
  180. package/dist/features/quality-coverage/api.d.ts +13 -0
  181. package/dist/features/quality-coverage/api.d.ts.map +1 -0
  182. package/dist/features/quality-coverage/api.js +7 -0
  183. package/dist/features/quality-coverage/api.js.map +1 -0
  184. package/dist/features/quality-coverage/application/capability.d.ts +7 -0
  185. package/dist/features/quality-coverage/application/capability.d.ts.map +1 -0
  186. package/dist/features/quality-coverage/application/capability.js +12 -0
  187. package/dist/features/quality-coverage/application/capability.js.map +1 -0
  188. package/dist/features/quality-coverage/application/check-quality-coverage.d.ts +9 -0
  189. package/dist/features/quality-coverage/application/check-quality-coverage.d.ts.map +1 -0
  190. package/dist/features/quality-coverage/application/check-quality-coverage.js +56 -0
  191. package/dist/features/quality-coverage/application/check-quality-coverage.js.map +1 -0
  192. package/dist/features/quality-coverage/application/evaluate-coverage.d.ts +6 -0
  193. package/dist/features/quality-coverage/application/evaluate-coverage.d.ts.map +1 -0
  194. package/dist/features/quality-coverage/application/evaluate-coverage.js +125 -0
  195. package/dist/features/quality-coverage/application/evaluate-coverage.js.map +1 -0
  196. package/dist/features/quality-coverage/application/input-observations.d.ts +6 -0
  197. package/dist/features/quality-coverage/application/input-observations.d.ts.map +1 -0
  198. package/dist/features/quality-coverage/application/input-observations.js +2 -0
  199. package/dist/features/quality-coverage/application/input-observations.js.map +1 -0
  200. package/dist/features/quality-coverage/application/model.d.ts +57 -0
  201. package/dist/features/quality-coverage/application/model.d.ts.map +1 -0
  202. package/dist/features/quality-coverage/application/model.js +2 -0
  203. package/dist/features/quality-coverage/application/model.js.map +1 -0
  204. package/dist/features/quality-coverage/application/observation-input.d.ts +17 -0
  205. package/dist/features/quality-coverage/application/observation-input.d.ts.map +1 -0
  206. package/dist/features/quality-coverage/application/observation-input.js +2 -0
  207. package/dist/features/quality-coverage/application/observation-input.js.map +1 -0
  208. package/dist/features/quality-coverage/application/profile.d.ts +38 -0
  209. package/dist/features/quality-coverage/application/profile.d.ts.map +1 -0
  210. package/dist/features/quality-coverage/application/profile.js +2 -0
  211. package/dist/features/quality-coverage/application/profile.js.map +1 -0
  212. package/dist/features/quality-coverage/application/rules.d.ts +20 -0
  213. package/dist/features/quality-coverage/application/rules.d.ts.map +1 -0
  214. package/dist/features/quality-coverage/application/rules.js +33 -0
  215. package/dist/features/quality-coverage/application/rules.js.map +1 -0
  216. package/dist/features/quality-coverage/application/script-route.d.ts +3 -0
  217. package/dist/features/quality-coverage/application/script-route.d.ts.map +1 -0
  218. package/dist/features/quality-coverage/application/script-route.js +46 -0
  219. package/dist/features/quality-coverage/application/script-route.js.map +1 -0
  220. package/dist/features/quality-coverage/application/source-coverage.d.ts +19 -0
  221. package/dist/features/quality-coverage/application/source-coverage.d.ts.map +1 -0
  222. package/dist/features/quality-coverage/application/source-coverage.js +46 -0
  223. package/dist/features/quality-coverage/application/source-coverage.js.map +1 -0
  224. package/dist/features/quality-coverage/application/tool-execution.d.ts +2 -0
  225. package/dist/features/quality-coverage/application/tool-execution.d.ts.map +1 -0
  226. package/dist/features/quality-coverage/application/tool-execution.js +2 -0
  227. package/dist/features/quality-coverage/application/tool-execution.js.map +1 -0
  228. package/dist/features/quality-coverage/node.d.ts +5 -0
  229. package/dist/features/quality-coverage/node.d.ts.map +1 -0
  230. package/dist/features/quality-coverage/node.js +5 -0
  231. package/dist/features/quality-coverage/node.js.map +1 -0
  232. package/dist/features/quality-coverage/schemas.d.ts +2 -0
  233. package/dist/features/quality-coverage/schemas.d.ts.map +1 -0
  234. package/dist/features/quality-coverage/schemas.js +2 -0
  235. package/dist/features/quality-coverage/schemas.js.map +1 -0
  236. package/dist/features/validation-reporting/api.d.ts +1 -1
  237. package/dist/features/validation-reporting/api.d.ts.map +1 -1
  238. package/dist/features/validation-reporting/api.js.map +1 -1
  239. package/dist/process-execution/node-process-runner.d.ts.map +1 -1
  240. package/dist/process-execution/node-process-runner.js +15 -0
  241. package/dist/process-execution/node-process-runner.js.map +1 -1
  242. package/dist/process-execution/windows-managed-process.js +2 -2
  243. package/dist/process-execution/windows-managed-process.js.map +1 -1
  244. package/dist/schema-catalog.d.ts +1 -1
  245. package/dist/schema-catalog.d.ts.map +1 -1
  246. package/dist/schema-ids.d.ts +1 -1
  247. package/dist/schema-ids.d.ts.map +1 -1
  248. package/dist/schema-ids.js +2 -0
  249. package/dist/schema-ids.js.map +1 -1
  250. package/dist/source-inventory/adapters/outbound/filesystem/filesystem-source-tree-reader.d.ts.map +1 -1
  251. package/dist/source-inventory/adapters/outbound/filesystem/filesystem-source-tree-reader.js +4 -0
  252. package/dist/source-inventory/adapters/outbound/filesystem/filesystem-source-tree-reader.js.map +1 -1
  253. package/package.json +5 -1
  254. package/schemas/foundation-config/v2.schema.json +201 -0
  255. package/schemas/package-public-api-audit-report/v1.schema.json +1400 -0
  256. package/schemas/package-public-api-audit-request/v1.schema.json +339 -0
  257. package/schemas/quality-source-coverage/v1.schema.json +119 -0
@@ -0,0 +1,84 @@
1
+ import { createRequire } from "node:module";
2
+ import { realpath } from "node:fs/promises";
3
+ import { dirname, isAbsolute, join, relative, sep } from "node:path";
4
+ import { CapabilityInputError, assertNotCancelled } from "../api.js";
5
+ // This is the qualified adapter version set, not a dependency installer or a range resolver.
6
+ const SUPPORTED = { oxlint: "1.77.0", "oxlint-tsgolint": "7.0.2001", typescript: "7.0.2" };
7
+ function reject(name, reason) {
8
+ throw new CapabilityInputError({ code: "QUALITY_TOOLCHAIN_INVALID", message: `${name}: ${reason}`, phase: "quality-toolchain", retryable: false });
9
+ }
10
+ function record(value) {
11
+ return typeof value === "object" && value !== null && !Array.isArray(value);
12
+ }
13
+ function within(root, path) {
14
+ const suffix = relative(root, path);
15
+ return suffix !== ".." && !suffix.startsWith(`..${sep}`) && !isAbsolute(suffix);
16
+ }
17
+ function declaration(name, dependencies) {
18
+ const matches = dependencies.filter(({ dependencyName }) => dependencyName === name);
19
+ const candidate = matches[0];
20
+ if (matches.length !== 1 || candidate === undefined || candidate.section !== "devDependencies" ||
21
+ candidate.targetPackageName !== name || candidate.normalizationProblem !== undefined ||
22
+ !/^\d+\.\d+\.\d+$/u.test(candidate.effectiveVersionSpecifier)) {
23
+ reject(name, "requires one exact consumer root development dependency.");
24
+ }
25
+ return candidate.effectiveVersionSpecifier;
26
+ }
27
+ async function observeInstalledPackage(root, name, version, read, options = {}) {
28
+ let manifestPath;
29
+ try {
30
+ manifestPath = await realpath(createRequire(options.from ?? join(root, "package.json")).resolve(`${name}/package.json`));
31
+ }
32
+ catch {
33
+ reject(name, "is not installed in the consumer toolchain.");
34
+ }
35
+ if (!within(join(root, "node_modules"), manifestPath)) {
36
+ reject(name, "resolved outside consumer node_modules.");
37
+ }
38
+ const value = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(await read({ root, candidate: manifestPath, maxBytes: 2 * 1024 * 1024 })));
39
+ if (!record(value) || value["name"] !== name || value["version"] !== version) {
40
+ reject(name, "installed identity does not match the exact declared pin.");
41
+ }
42
+ if (options.bin === undefined) {
43
+ return manifestPath;
44
+ }
45
+ const binaries = value["bin"];
46
+ const target = typeof binaries === "string" ? binaries : record(binaries) ? binaries[options.bin] : undefined;
47
+ if (typeof target !== "string" || target.length === 0 || isAbsolute(target)) {
48
+ reject(name, "has no supported executable entrypoint.");
49
+ }
50
+ const packageRoot = dirname(manifestPath);
51
+ const executable = await realpath(join(packageRoot, target));
52
+ if (!within(packageRoot, executable)) {
53
+ reject(name, "executable escapes its installed package.");
54
+ }
55
+ await read({ root, candidate: executable, maxBytes: 16 * 1024 * 1024 });
56
+ return executable;
57
+ }
58
+ /** Resolution starts at the consumer, and explicitly rejects ancestor/global fallback. */
59
+ export async function inspectConsumerToolchain(input) {
60
+ assertNotCancelled(input.signal);
61
+ const root = await realpath(input.consumerRoot);
62
+ for (const [name, version] of Object.entries(SUPPORTED)) {
63
+ if (declaration(name, input.dependencies) !== version) {
64
+ reject(name, `unsupported version; this adapter qualifies ${version}.`);
65
+ }
66
+ }
67
+ const oxlintEntrypoint = await observeInstalledPackage(root, "oxlint", SUPPORTED.oxlint, input.read, { bin: "oxlint" });
68
+ const compilerEntrypoint = await observeInstalledPackage(root, "typescript", SUPPORTED.typescript, input.read, { bin: "tsc" });
69
+ const typedWrapper = await observeInstalledPackage(root, "oxlint-tsgolint", SUPPORTED["oxlint-tsgolint"], input.read, { bin: "tsgolint" });
70
+ const nativeName = `@oxlint-tsgolint/${process.platform}-${process.arch}`;
71
+ const nativeManifest = await observeInstalledPackage(root, nativeName, SUPPORTED["oxlint-tsgolint"], input.read, { from: typedWrapper });
72
+ const nativeRoot = dirname(nativeManifest);
73
+ const typedEntrypoint = await realpath(join(nativeRoot, process.platform === "win32" ? "tsgolint.exe" : "tsgolint"));
74
+ if (!within(nativeRoot, typedEntrypoint)) {
75
+ reject(nativeName, "executable escapes its installed package.");
76
+ }
77
+ await input.read({ root, candidate: typedEntrypoint, maxBytes: 128 * 1024 * 1024 });
78
+ for (const dependency of input.dependencies.filter(({ dependencyName }) => dependencyName.startsWith("@types/"))) {
79
+ await observeInstalledPackage(root, dependency.dependencyName, declaration(dependency.dependencyName, input.dependencies), input.read);
80
+ }
81
+ assertNotCancelled(input.signal);
82
+ return { oxlintEntrypoint, compilerEntrypoint, typedEntrypoint };
83
+ }
84
+ //# sourceMappingURL=consumer-toolchain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consumer-toolchain.js","sourceRoot":"","sources":["../../../../src/features/quality-coverage/adapters/consumer-toolchain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAA6D,MAAM,WAAW,CAAC;AAEhI,6FAA6F;AAC7F,MAAM,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAW,CAAC;AAEpG,SAAS,MAAM,CAAC,IAAY,EAAE,MAAc;IAC1C,MAAM,IAAI,oBAAoB,CAAC,EAAE,IAAI,EAAE,2BAA2B,EAAE,OAAO,EAAE,GAAG,IAAI,KAAK,MAAM,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;AACrJ,CAAC;AAED,SAAS,MAAM,CAAC,KAAc;IAC5B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,MAAM,CAAC,IAAY,EAAE,IAAY;IACxC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,OAAO,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;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AAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;IACzI,MAAM,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3C,MAAM,eAAe,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;IACrH,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,eAAe,CAAC,EAAE,CAAC;QAAC,MAAM,CAAC,UAAU,EAAE,2CAA2C,CAAC,CAAC;IAAC,CAAC;IAC9G,MAAM,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC;IACpF,KAAK,MAAM,UAAU,IAAI,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;QACjH,MAAM,uBAAuB,CAAC,IAAI,EAAE,UAAU,CAAC,cAAc,EAAE,WAAW,CAAC,UAAU,CAAC,cAAc,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACzI,CAAC;IACD,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACjC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAAE,CAAC;AACnE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { qualityDiagnostic } from "../api.js";
2
+ export declare function parseOxlintSelection(stdout: string): readonly string[];
3
+ /** The exit status and JSON envelope must agree; a tool failure is never a lint finding. */
4
+ export declare function parseOxlintDiagnostics(stdout: string, exitCode: number): {
5
+ readonly files: number;
6
+ readonly diagnostics: readonly ReturnType<typeof qualityDiagnostic>[];
7
+ };
8
+ //# sourceMappingURL=oxlint-output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oxlint-output.d.ts","sourceRoot":"","sources":["../../../../src/features/quality-coverage/adapters/oxlint-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAmB9C,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAKtE;AAED,4FAA4F;AAC5F,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG;IACxE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,CAAC,OAAO,iBAAiB,CAAC,EAAE,CAAC;CACvE,CAgBA"}
@@ -0,0 +1,53 @@
1
+ import { qualityDiagnostic } from "../api.js";
2
+ function record(value) {
3
+ return typeof value === "object" && value !== null && !Array.isArray(value);
4
+ }
5
+ function malformed() {
6
+ throw new Error("Pinned Oxlint returned malformed execution evidence.");
7
+ }
8
+ function normalizeSelectedPath(value) {
9
+ const path = value.replaceAll("\\", "/");
10
+ if (path.length === 0 || path.length > 1024 || path.includes(":") || path.split("").some((character) => character < " ") ||
11
+ path.split("/").some((segment) => segment === "" || segment === "." || segment === "..")) {
12
+ malformed();
13
+ }
14
+ return path;
15
+ }
16
+ export function parseOxlintSelection(stdout) {
17
+ const lines = stdout.replace(/\r?\n$/u, "").split(/\r?\n/u);
18
+ const paths = lines.map(normalizeSelectedPath);
19
+ if (paths.length === 0 || new Set(paths).size !== paths.length) {
20
+ malformed();
21
+ }
22
+ return paths.toSorted();
23
+ }
24
+ /** The exit status and JSON envelope must agree; a tool failure is never a lint finding. */
25
+ export function parseOxlintDiagnostics(stdout, exitCode) {
26
+ let value;
27
+ try {
28
+ value = JSON.parse(stdout);
29
+ }
30
+ catch {
31
+ malformed();
32
+ }
33
+ if (!record(value) || !Array.isArray(value["diagnostics"]) ||
34
+ typeof value["number_of_files"] !== "number" || !Number.isSafeInteger(value["number_of_files"]) ||
35
+ value["number_of_files"] < 1 || ![0, 1].includes(exitCode)) {
36
+ malformed();
37
+ }
38
+ const diagnostics = value["diagnostics"].map((input) => {
39
+ if (!record(input) || typeof input["filename"] !== "string" ||
40
+ typeof input["code"] !== "string" || !/^[a-z][a-z-]*\([a-z][a-z0-9-]*\)$/u.test(input["code"]) ||
41
+ (input["severity"] !== "error" && input["severity"] !== "warning")) {
42
+ malformed();
43
+ }
44
+ const path = normalizeSelectedPath(input["filename"]);
45
+ const diagnostic = qualityDiagnostic("lint-violation", path, `${path}:${input["code"]}`, "no lint violations", input["code"]);
46
+ return { ...diagnostic, evidence: [...diagnostic.evidence, { kind: "tool-rule", value: input["code"] }] };
47
+ });
48
+ if ((exitCode === 0) !== (diagnostics.length === 0)) {
49
+ malformed();
50
+ }
51
+ return { files: value["number_of_files"], diagnostics };
52
+ }
53
+ //# sourceMappingURL=oxlint-output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oxlint-output.js","sourceRoot":"","sources":["../../../../src/features/quality-coverage/adapters/oxlint-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,SAAS,MAAM,CAAC,KAAc;IAC5B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,SAAS;IAChB,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAa;IAC1C,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACzC,IAA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K,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;QAAC,SAAS,EAAE,CAAC;IAAC,CAAC;IACrE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,EAAE,WAAW,EAAE,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { QualityToolSession, ManagedProcessExecutor } from "../api.js";
2
+ export interface OxlintSessionInput {
3
+ readonly consumerRoot: string;
4
+ readonly nodeExecutable: string;
5
+ readonly oxlintEntrypoint: string;
6
+ readonly compilerEntrypoint: string;
7
+ readonly configPath: string;
8
+ readonly sourceRoots: readonly string[];
9
+ readonly projects: readonly string[];
10
+ readonly environment?: Readonly<Record<string, string | undefined>>;
11
+ }
12
+ /** Entrypoints have already been bound to the pinned consumer toolchain by preparation. */
13
+ export declare function createOxlintSession(input: OxlintSessionInput, executor: ManagedProcessExecutor): QualityToolSession;
14
+ //# sourceMappingURL=oxlint-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oxlint-session.d.ts","sourceRoot":"","sources":["../../../../src/features/quality-coverage/adapters/oxlint-session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAwB,MAAM,WAAW,CAAC;AAGlG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CACrE;AAQD,2FAA2F;AAC3F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,sBAAsB,GAAG,kBAAkB,CAwCnH"}
@@ -0,0 +1,53 @@
1
+ import { isAbsolute, relative, sep } from "node:path";
2
+ import { realpath } from "node:fs/promises";
3
+ import { parseOxlintDiagnostics, parseOxlintSelection } from "./oxlint-output.js";
4
+ function assertToolSuccess(result) {
5
+ if (result.exitCode !== 0 || result.signal !== null || result.stderr.trim().length !== 0) {
6
+ throw new Error("Quality tool prerequisite failed; no valid execution evidence was produced.");
7
+ }
8
+ }
9
+ /** Entrypoints have already been bound to the pinned consumer toolchain by preparation. */
10
+ export function createOxlintSession(input, executor) {
11
+ const lintArgs = [input.oxlintEntrypoint, "--config", input.configPath,
12
+ "--deny-warnings", "--disable-nested-config", "--no-ignore", "--threads", "1", "--format", "json"];
13
+ const run = (args, signal) => executor.run({
14
+ command: input.nodeExecutable, args, cwd: input.consumerRoot,
15
+ ...(input.environment === undefined ? {} : { environment: input.environment }),
16
+ timeoutMs: 120_000, strictUtf8: true, ...(signal === undefined ? {} : { signal })
17
+ });
18
+ return {
19
+ async select(signal) {
20
+ const result = await run([...lintArgs, "--debug", "files", ...input.sourceRoots], signal);
21
+ assertToolSuccess(result);
22
+ return parseOxlintSelection(result.stdout);
23
+ },
24
+ async typeContext(signal) {
25
+ const root = await realpath(input.consumerRoot);
26
+ const paths = new Set();
27
+ for (const project of input.projects) {
28
+ const result = await run([input.compilerEntrypoint, "--project", project,
29
+ "--noEmit", "--incremental", "false", "--composite", "false", "--listFiles", "--pretty", "false"], signal);
30
+ assertToolSuccess(result);
31
+ for (const line of result.stdout.trim().split(/\r?\n/u)) {
32
+ if (!isAbsolute(line)) {
33
+ throw new Error("Compiler returned malformed project evidence.");
34
+ }
35
+ // Compiler output and consumer cwd can name different aliases of the same root.
36
+ const path = relative(root, await realpath(line)).split(sep).join("/");
37
+ if (path !== ".." && !path.startsWith("../") && !isAbsolute(path) && !path.startsWith("node_modules/")) {
38
+ paths.add(path);
39
+ }
40
+ }
41
+ }
42
+ return [...paths].toSorted();
43
+ },
44
+ async lint(signal) {
45
+ const result = await run([...lintArgs, ...input.sourceRoots], signal);
46
+ if (result.signal !== null || result.stderr.trim().length !== 0) {
47
+ throw new Error("Oxlint did not produce valid lint evidence.");
48
+ }
49
+ return parseOxlintDiagnostics(result.stdout, result.exitCode);
50
+ }
51
+ };
52
+ }
53
+ //# sourceMappingURL=oxlint-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oxlint-session.js","sourceRoot":"","sources":["../../../../src/features/quality-coverage/adapters/oxlint-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAalF,SAAS,iBAAiB,CAAC,MAA4B;IACrD,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzF,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC;IACjG,CAAC;AACH,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,mBAAmB,CAAC,KAAyB,EAAE,QAAgC;IAC7F,MAAM,QAAQ,GAAG,CAAC,KAAK,CAAC,gBAAgB,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU;QACpE,iBAAiB,EAAE,yBAAyB,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IACrG,MAAM,GAAG,GAAG,CAAC,IAA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overageProfile, type QualityTopology } from "../api.js";
2
+ export declare function invalidQualityInput(message: string): never;
3
+ export declare function qualityRecord(value: unknown): Record<string, unknown>;
4
+ export declare function qualityString(value: unknown): string;
5
+ export declare function qualityStrings(value: unknown): readonly string[];
6
+ export declare function mapQualityProfile(value: unknown): QualityCoverageProfile;
7
+ /** Normalize qualified flat and nested FMS forms; adoption status does not filter production. */
8
+ export declare function mapQualityTopology(value: unknown, sourcePolicyPath: string): QualityTopology;
9
+ //# sourceMappingURL=profile-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-input.d.ts","sourceRoot":"","sources":["../../../../src/features/quality-coverage/adapters/profile-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,sBAAsB,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAEpG,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAE1D;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGrE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAGhE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,sBAAsB,CAgBxE;AA+BD,iGAAiG;AACjG,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,GAAG,eAAe,CAqB5F"}
@@ -0,0 +1,110 @@
1
+ import { CapabilityInputError } from "../api.js";
2
+ export function invalidQualityInput(message) {
3
+ throw new CapabilityInputError({ code: "QUALITY_PROFILE_INVALID", message, phase: "quality-profile", retryable: false });
4
+ }
5
+ export function qualityRecord(value) {
6
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
7
+ invalidQualityInput("Expected a data object in the quality profile inputs.");
8
+ }
9
+ return Object.fromEntries(Object.entries(value));
10
+ }
11
+ export function qualityString(value) {
12
+ if (typeof value !== "string" || value.length === 0 || value.length > 1024) {
13
+ invalidQualityInput("Expected a bounded nonempty string in the quality profile inputs.");
14
+ }
15
+ return value;
16
+ }
17
+ export function qualityStrings(value) {
18
+ if (!Array.isArray(value) || value.length > 10_000) {
19
+ invalidQualityInput("Expected a bounded list in the quality profile inputs.");
20
+ }
21
+ return value.map(qualityString);
22
+ }
23
+ export function mapQualityProfile(value) {
24
+ const input = qualityRecord(value);
25
+ const scripts = qualityRecord(input["scripts"]);
26
+ const compilerProjects = qualityStrings(input["compilerProjects"]);
27
+ if (compilerProjects.length === 0 || new Set(compilerProjects).size !== compilerProjects.length) {
28
+ invalidQualityInput("Quality coverage requires nonempty unique compiler project paths.");
29
+ }
30
+ return {
31
+ sourcePolicyPath: qualityString(input["sourcePolicyPath"]),
32
+ suppressionPolicyPath: qualityString(input["suppressionPolicyPath"]),
33
+ featureProfilePath: qualityString(input["featureProfilePath"]),
34
+ lintConfigPath: qualityString(input["lintConfigPath"]),
35
+ compilerProjects,
36
+ ...(input["nativeChecks"] === undefined ? {} : { nativeChecks: nativeChecks(input["nativeChecks"]) }),
37
+ scripts: { fast: qualityString(scripts["fast"]), full: qualityString(scripts["full"]), scope: qualityString(scripts["scope"]), typed: qualityString(scripts["typed"]) }
38
+ };
39
+ }
40
+ function boundedModules(value) {
41
+ if (!Array.isArray(value) || value.length === 0 || value.length > 5000) {
42
+ invalidQualityInput("FMS profile requires a nonempty bounded module mapping.");
43
+ }
44
+ return value.map(qualityRecord);
45
+ }
46
+ function nestedTopology(input) {
47
+ const scope = qualityRecord(input["scope"]);
48
+ const adoption = qualityRecord(input["adoption"]);
49
+ const layout = qualityRecord(adoption["abstractLayout"]);
50
+ const modules = boundedModules(scope["productionModules"]);
51
+ const layouts = boundedModules(layout["modules"]);
52
+ for (const entry of layouts) {
53
+ if (!modules.some((module) => module["moduleRoot"] === entry["moduleRoot"] && module["sourceRoot"] === entry["sourceRoot"])) {
54
+ invalidQualityInput("An abstract layout must map an existing production module and its source root.");
55
+ }
56
+ }
57
+ return {
58
+ productionRoots: qualityStrings(scope["workspaceContainers"]),
59
+ applicationRoots: qualityStrings(adoption["applicationRoots"]),
60
+ excludedRoots: qualityStrings(adoption["excludedRoots"]),
61
+ modules: modules.map((module) => ({
62
+ root: qualityString(module["moduleRoot"]), sourceRoot: qualityString(module["sourceRoot"]),
63
+ testRoots: layouts.filter((entry) => entry["moduleRoot"] === module["moduleRoot"]).map((entry) => qualityString(entry["testRoot"]))
64
+ }))
65
+ };
66
+ }
67
+ /** Normalize qualified flat and nested FMS forms; adoption status does not filter production. */
68
+ export function mapQualityTopology(value, sourcePolicyPath) {
69
+ const input = qualityRecord(value);
70
+ const nested = input["authority"] !== undefined;
71
+ const standard = qualityRecord(nested ? input["authority"] : input["standard"]);
72
+ if (input["schemaVersion"] !== 1 || standard["id"] !== "agent-teams.feature-module-standard" || standard["version"] !== "v1") {
73
+ invalidQualityInput("Quality coverage requires an FMS v1 production mapping.");
74
+ }
75
+ if (nested) {
76
+ return nestedTopology(input);
77
+ }
78
+ const topology = qualityRecord(input["topology"]);
79
+ if (topology["sourcePolicy"] !== sourcePolicyPath) {
80
+ invalidQualityInput("Quality coverage requires the accepted FMS source-policy mapping.");
81
+ }
82
+ return {
83
+ productionRoots: qualityStrings(input["productionRoots"]),
84
+ applicationRoots: qualityStrings(input["applicationRoots"]),
85
+ excludedRoots: qualityStrings(input["excludedRoots"]),
86
+ toolingFiles: boundedModules(input["modules"]).flatMap((module) => generatorPaths(module["generatedRoots"])),
87
+ modules: boundedModules(input["modules"]).map((module) => ({
88
+ root: qualityString(module["root"]), sourceRoot: qualityString(module["sourceRoot"]), testRoots: qualityStrings(module["testRoots"])
89
+ }))
90
+ };
91
+ }
92
+ function generatorPaths(value) {
93
+ if (value === undefined) {
94
+ return [];
95
+ }
96
+ if (!Array.isArray(value) || value.length > 5000) {
97
+ invalidQualityInput("Expected bounded generated provenance records.");
98
+ }
99
+ return value.map((entry) => qualityString(qualityRecord(entry)["generator"]));
100
+ }
101
+ function nativeChecks(value) {
102
+ if (!Array.isArray(value) || value.length > 1000) {
103
+ invalidQualityInput("Expected bounded native gate mappings.");
104
+ }
105
+ return value.map((entry) => {
106
+ const item = qualityRecord(entry);
107
+ return { boundaryId: qualityString(item["boundaryId"]), script: qualityString(item["script"]) };
108
+ });
109
+ }
110
+ //# sourceMappingURL=profile-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-input.js","sourceRoot":"","sources":["../../../../src/features/quality-coverage/adapters/profile-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAqD,MAAM,WAAW,CAAC;AAEpG,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,MAAM,IAAI,oBAAoB,CAAC,EAAE,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;AAC3H,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAAC,mBAAmB,CAAC,uDAAuD,CAAC,CAAC;IAAC,CAAC;IAC1J,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC;QAAC,mBAAmB,CAAC,mEAAmE,CAAC,CAAC;IAAC,CAAC;IACzK,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAA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AAK,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC;QAAC,mBAAmB,CAAC,wCAAwC,CAAC,CAAC;IAAC,CAAC;IACpH,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,KAAc,EAAE,EAAE;QAClC,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QAClC,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;IAClG,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { ProtectedSetting, RequiredProtectedSetting } from "../api.js";
2
+ interface OverrideScope {
3
+ readonly files: readonly string[];
4
+ readonly production: readonly string[];
5
+ readonly tests: readonly string[];
6
+ }
7
+ type DataReader = (root: string, path: string) => Promise<unknown>;
8
+ /** A bounded validation of the supported JSON form, never a general effective-config interpreter. */
9
+ export declare function inspectProtectedConfig(root: string, lintPath: string, read: DataReader, scope: OverrideScope): Promise<{
10
+ readonly requiredSettings: readonly string[];
11
+ readonly requiredSettingObservations: readonly RequiredProtectedSetting[];
12
+ readonly settings: readonly ProtectedSetting[];
13
+ }>;
14
+ export {};
15
+ //# sourceMappingURL=protected-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protected-config.d.ts","sourceRoot":"","sources":["../../../../src/features/quality-coverage/adapters/protected-config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAG5E,UAAU,aAAa;IACrB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAeD,KAAK,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AA+EnE,qGAAqG;AACrG,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC;IAC5H,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,QAAQ,CAAC,2BAA2B,EAAE,SAAS,wBAAwB,EAAE,CAAC;IAC1E,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAChD,CAAC,CAkED"}
@@ -0,0 +1,200 @@
1
+ import { createRequire } from "node:module";
2
+ import { dirname, isAbsolute, join, posix, relative, sep } from "node:path";
3
+ import { realpath } from "node:fs/promises";
4
+ import { fileURLToPath } from "node:url";
5
+ import { invalidQualityInput, qualityRecord, qualityStrings } from "./profile-input.js";
6
+ function isTestOnlyOverride(override, scope) {
7
+ const patterns = qualityStrings(override["files"]);
8
+ const excluded = override["excludedFiles"] === undefined ? [] : qualityStrings(override["excludedFiles"]);
9
+ if (patterns.length === 0) {
10
+ invalidQualityInput("Overrides require nonempty file selectors.");
11
+ }
12
+ const selected = scope.files.filter((path) => patterns.some((pattern) => posix.matchesGlob(path, pattern)) &&
13
+ !excluded.some((pattern) => posix.matchesGlob(path, pattern)));
14
+ if (selected.length === 0) {
15
+ invalidQualityInput("Override selector classification has no observed files.");
16
+ }
17
+ if (selected.some((path) => !scope.production.includes(path) && !scope.tests.includes(path))) {
18
+ invalidQualityInput("Override selector includes files without production or test classification.");
19
+ }
20
+ return selected.every((path) => scope.tests.includes(path));
21
+ }
22
+ function requirement(path, group, name, expected, comparison = "equal") {
23
+ return { observationId: `${path}#${group}#${name}`, path, name, expected, comparison };
24
+ }
25
+ function severity(value) {
26
+ const input = Array.isArray(value) ? value[0] : value;
27
+ return input === "error" || input === "deny" || input === 2 ? "error" : String(input);
28
+ }
29
+ function ceiling(value) {
30
+ if (!Array.isArray(value)) {
31
+ return undefined;
32
+ }
33
+ const option = value[1];
34
+ if (typeof option === "number") {
35
+ return option;
36
+ }
37
+ if (typeof option === "object" && option !== null && "max" in option && typeof option.max === "number") {
38
+ return option.max;
39
+ }
40
+ return undefined;
41
+ }
42
+ async function protectedRules(read) {
43
+ const root = fileURLToPath(new URL("../../../../", import.meta.url));
44
+ const typed = qualityRecord(await read(root, "presets/oxlint/type-aware.json"));
45
+ const maintainability = qualityRecord(await read(root, "presets/oxlint/maintainability.json"));
46
+ return new Map(Object.entries({ ...qualityRecord(typed["rules"]), ...qualityRecord(maintainability["rules"]) })
47
+ .filter(([, value]) => severity(value) === "error"));
48
+ }
49
+ async function configPath(root, physicalRoot, from, reference) {
50
+ if (!reference.endsWith(".json") || isAbsolute(reference)) {
51
+ invalidQualityInput("V1 quality coverage accepts contained JSON Oxlint configuration only.");
52
+ }
53
+ let path;
54
+ try {
55
+ path = await realpath(createRequire(join(root, dirname(from), "package.json")).resolve(reference));
56
+ }
57
+ catch {
58
+ invalidQualityInput("An Oxlint extends configuration is missing or unsupported.");
59
+ }
60
+ const suffix = relative(physicalRoot, path);
61
+ if (suffix === ".." || suffix.startsWith(`..${sep}`) || isAbsolute(suffix)) {
62
+ invalidQualityInput("Oxlint configuration escapes the consumer root.");
63
+ }
64
+ return suffix.split(sep).join("/");
65
+ }
66
+ function requiredRuleAssignments(path, group, values, required, testOnly) {
67
+ const assignments = [];
68
+ for (const [name, expected] of required) {
69
+ const suffix = name.split("/").at(-1);
70
+ if (Object.keys(values).some((key) => key !== name && key.split("/").at(-1) === suffix)) {
71
+ invalidQualityInput(`Use the canonical protected rule identifier: ${name}.`);
72
+ }
73
+ if (!Object.hasOwn(values, name)) {
74
+ continue;
75
+ }
76
+ assignments.push(requirement(path, group, name, "error"));
77
+ const actual = values[name];
78
+ const requiredMaximum = ceiling(expected);
79
+ const maximum = testOnly && requiredMaximum !== undefined ? ceiling(actual) ?? requiredMaximum : requiredMaximum;
80
+ if (maximum !== undefined) {
81
+ assignments.push(requirement(path, group, `${name}:ceiling`, maximum, "ceiling"));
82
+ }
83
+ else if (Array.isArray(actual) && actual.length > 1) {
84
+ invalidQualityInput(`Protected rule options require separate adapter qualification: ${name}.`);
85
+ }
86
+ }
87
+ return assignments;
88
+ }
89
+ function observeRuleAssignments(assignments, values) {
90
+ return assignments.map((entry) => ({
91
+ ...entry,
92
+ actual: entry.comparison === "ceiling"
93
+ ? ceiling(values[entry.name.slice(0, -":ceiling".length)]) ?? "missing numeric ceiling"
94
+ : severity(values[entry.name])
95
+ }));
96
+ }
97
+ function retainStrongerCeilings(rules, required) {
98
+ for (const [name, expected] of required) {
99
+ const previous = ceiling(expected);
100
+ const current = ceiling(rules[name]);
101
+ if (previous !== undefined && current !== undefined && Number.isFinite(current) && current >= 0 && current < previous) {
102
+ required.set(name, rules[name]);
103
+ }
104
+ }
105
+ }
106
+ /** A bounded validation of the supported JSON form, never a general effective-config interpreter. */
107
+ export async function inspectProtectedConfig(root, lintPath, read, scope) {
108
+ const physicalRoot = await realpath(root);
109
+ const required = new Map(await protectedRules(read));
110
+ const requiredSettings = ["typeAware", "respectEslintDisableDirectives", "reportUnusedDisableDirectives", ...[...required].flatMap(([name, value]) => ceiling(value) === undefined ? [name] : [name, `${name}:ceiling`])];
111
+ const seen = new Set();
112
+ const active = new Set();
113
+ const assigned = new Set();
114
+ const requiredSettingObservations = [];
115
+ const output = [];
116
+ function inspectAssignments(path, group, values, testOnly = false) {
117
+ const assignments = requiredRuleAssignments(path, group, values, required, testOnly);
118
+ requiredSettingObservations.push(...assignments);
119
+ output.push(...observeRuleAssignments(assignments, values));
120
+ }
121
+ function inspectOption(path, group, name, expected, actual) {
122
+ const entry = requirement(path, group, name, expected);
123
+ requiredSettingObservations.push(entry);
124
+ output.push({ ...entry, actual });
125
+ }
126
+ let typed = false;
127
+ let rootOptions = {};
128
+ async function visit(path) {
129
+ if (active.has(path)) {
130
+ invalidQualityInput("Oxlint extends contains a cycle.");
131
+ }
132
+ if (seen.has(path)) {
133
+ return;
134
+ }
135
+ if (seen.size >= 32) {
136
+ invalidQualityInput("Oxlint configuration exceeds the qualified JSON closure limit.");
137
+ }
138
+ seen.add(path);
139
+ active.add(path);
140
+ const value = qualityRecord(await read(root, path));
141
+ if (value["jsPlugins"] !== undefined) {
142
+ invalidQualityInput("Executable Oxlint plugins are outside this qualified configuration form.");
143
+ }
144
+ for (const reference of value["extends"] === undefined ? [] : qualityStrings(value["extends"])) {
145
+ await visit(await configPath(root, physicalRoot, path, reference));
146
+ }
147
+ const rules = value["rules"] === undefined ? {} : qualityRecord(value["rules"]);
148
+ for (const name of Object.keys(rules)) {
149
+ assigned.add(name);
150
+ }
151
+ inspectAssignments(path, "rules", rules);
152
+ retainStrongerCeilings(rules, required);
153
+ if (value["options"] !== undefined) {
154
+ const options = qualityRecord(value["options"]);
155
+ if (path === lintPath) {
156
+ rootOptions = options;
157
+ }
158
+ if (options["typeAware"] !== undefined) {
159
+ if (typed) {
160
+ inspectOption(path, "options", "typeAware", "true", scalarSetting(options["typeAware"]));
161
+ }
162
+ typed = options["typeAware"] === true;
163
+ }
164
+ }
165
+ const overrides = value["overrides"];
166
+ if (overrides !== undefined) {
167
+ if (!Array.isArray(overrides) || overrides.length > 1000) {
168
+ invalidQualityInput("Oxlint overrides must be a bounded data list.");
169
+ }
170
+ for (const [index, entry] of overrides.entries()) {
171
+ const override = qualityRecord(entry);
172
+ if (Object.keys(override).some((key) => !["files", "excludedFiles", "rules"].includes(key))) {
173
+ invalidQualityInput("V1 overrides support file selectors and rules only.");
174
+ }
175
+ const testOnly = isTestOnlyOverride(override, scope);
176
+ inspectAssignments(path, `override:${index}`, qualityRecord(override["rules"]), testOnly);
177
+ }
178
+ }
179
+ active.delete(path);
180
+ }
181
+ await visit(lintPath);
182
+ for (const [name, expected] of [["respectEslintDisableDirectives", "false"], ["reportUnusedDisableDirectives", "error"]]) {
183
+ const value = rootOptions[name];
184
+ inspectOption(lintPath, "options", name, expected, value === undefined ? "not configured" : scalarSetting(value));
185
+ }
186
+ inspectOption(lintPath, "effective", "typeAware", "true", String(typed));
187
+ for (const name of required.keys()) {
188
+ if (!assigned.has(name)) {
189
+ inspectOption(lintPath, "effective", name, "error", "not configured");
190
+ }
191
+ }
192
+ return { requiredSettings, requiredSettingObservations, settings: output };
193
+ }
194
+ function scalarSetting(value) {
195
+ if (typeof value === "string" || typeof value === "boolean" || typeof value === "number") {
196
+ return String(value);
197
+ }
198
+ invalidQualityInput("Protected options must have scalar values.");
199
+ }
200
+ //# sourceMappingURL=protected-config.js.map