@neurcode-ai/cli 0.9.64 → 0.9.66

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 (323) hide show
  1. package/LICENSE +201 -0
  2. package/dist/commands/bootstrap-policy.d.ts +29 -0
  3. package/dist/commands/bootstrap-policy.d.ts.map +1 -0
  4. package/dist/commands/bootstrap-policy.js +334 -0
  5. package/dist/commands/bootstrap-policy.js.map +1 -0
  6. package/dist/commands/brain.d.ts.map +1 -1
  7. package/dist/commands/brain.js +273 -0
  8. package/dist/commands/brain.js.map +1 -1
  9. package/dist/commands/doctor.d.ts.map +1 -1
  10. package/dist/commands/doctor.js +82 -0
  11. package/dist/commands/doctor.js.map +1 -1
  12. package/dist/commands/pilot-report.d.ts +9 -0
  13. package/dist/commands/pilot-report.d.ts.map +1 -0
  14. package/dist/commands/pilot-report.js +176 -0
  15. package/dist/commands/pilot-report.js.map +1 -0
  16. package/dist/commands/quickstart.d.ts +21 -0
  17. package/dist/commands/quickstart.d.ts.map +1 -0
  18. package/dist/commands/quickstart.js +178 -0
  19. package/dist/commands/quickstart.js.map +1 -0
  20. package/dist/commands/remediate-export.d.ts +31 -0
  21. package/dist/commands/remediate-export.d.ts.map +1 -0
  22. package/dist/commands/remediate-export.js +283 -0
  23. package/dist/commands/remediate-export.js.map +1 -0
  24. package/dist/commands/remediate-governance.d.ts +54 -0
  25. package/dist/commands/remediate-governance.d.ts.map +1 -0
  26. package/dist/commands/remediate-governance.js +375 -0
  27. package/dist/commands/remediate-governance.js.map +1 -0
  28. package/dist/commands/remediate.d.ts.map +1 -1
  29. package/dist/commands/remediate.js.map +1 -1
  30. package/dist/commands/replay.d.ts.map +1 -1
  31. package/dist/commands/replay.js +30 -0
  32. package/dist/commands/replay.js.map +1 -1
  33. package/dist/commands/verify.d.ts.map +1 -1
  34. package/dist/commands/verify.js +409 -30
  35. package/dist/commands/verify.js.map +1 -1
  36. package/dist/daemon/server.d.ts.map +1 -1
  37. package/dist/daemon/server.js +1078 -0
  38. package/dist/daemon/server.js.map +1 -1
  39. package/dist/explainability/DeterminismClassifier.d.ts +34 -0
  40. package/dist/explainability/DeterminismClassifier.d.ts.map +1 -0
  41. package/dist/explainability/DeterminismClassifier.js +104 -0
  42. package/dist/explainability/DeterminismClassifier.js.map +1 -0
  43. package/dist/explainability/ViolationFormatter.d.ts +32 -0
  44. package/dist/explainability/ViolationFormatter.d.ts.map +1 -0
  45. package/dist/explainability/ViolationFormatter.js +252 -0
  46. package/dist/explainability/ViolationFormatter.js.map +1 -0
  47. package/dist/explainability/index.d.ts +15 -0
  48. package/dist/explainability/index.d.ts.map +1 -0
  49. package/dist/explainability/index.js +94 -0
  50. package/dist/explainability/index.js.map +1 -0
  51. package/dist/explainability/types.d.ts +37 -0
  52. package/dist/explainability/types.d.ts.map +1 -0
  53. package/dist/explainability/types.js +3 -0
  54. package/dist/explainability/types.js.map +1 -0
  55. package/dist/governance/canonical-invariants.d.ts +88 -0
  56. package/dist/governance/canonical-invariants.d.ts.map +1 -0
  57. package/dist/governance/canonical-invariants.js +197 -0
  58. package/dist/governance/canonical-invariants.js.map +1 -0
  59. package/dist/governance/canonical-ordering.d.ts +76 -0
  60. package/dist/governance/canonical-ordering.d.ts.map +1 -0
  61. package/dist/governance/canonical-ordering.js +189 -0
  62. package/dist/governance/canonical-ordering.js.map +1 -0
  63. package/dist/governance/canonical-pipeline.d.ts +45 -0
  64. package/dist/governance/canonical-pipeline.d.ts.map +1 -0
  65. package/dist/governance/canonical-pipeline.js +616 -0
  66. package/dist/governance/canonical-pipeline.js.map +1 -0
  67. package/dist/governance/diff-line-provenance.d.ts +59 -0
  68. package/dist/governance/diff-line-provenance.d.ts.map +1 -0
  69. package/dist/governance/diff-line-provenance.js +118 -0
  70. package/dist/governance/diff-line-provenance.js.map +1 -0
  71. package/dist/governance/pilot-readiness.d.ts +34 -0
  72. package/dist/governance/pilot-readiness.d.ts.map +1 -0
  73. package/dist/governance/pilot-readiness.js +226 -0
  74. package/dist/governance/pilot-readiness.js.map +1 -0
  75. package/dist/governance/policy-parity-validator.d.ts +62 -0
  76. package/dist/governance/policy-parity-validator.d.ts.map +1 -0
  77. package/dist/governance/policy-parity-validator.js +137 -0
  78. package/dist/governance/policy-parity-validator.js.map +1 -0
  79. package/dist/governance/remediation-boundary.d.ts +55 -0
  80. package/dist/governance/remediation-boundary.d.ts.map +1 -0
  81. package/dist/governance/remediation-boundary.js +120 -0
  82. package/dist/governance/remediation-boundary.js.map +1 -0
  83. package/dist/governance/structural-cache.d.ts +103 -0
  84. package/dist/governance/structural-cache.d.ts.map +1 -0
  85. package/dist/governance/structural-cache.js +240 -0
  86. package/dist/governance/structural-cache.js.map +1 -0
  87. package/dist/governance/structural-on-diff.d.ts +33 -0
  88. package/dist/governance/structural-on-diff.d.ts.map +1 -0
  89. package/dist/governance/structural-on-diff.js +67 -0
  90. package/dist/governance/structural-on-diff.js.map +1 -0
  91. package/dist/governance/structural-policy-merge.d.ts +22 -0
  92. package/dist/governance/structural-policy-merge.d.ts.map +1 -0
  93. package/dist/governance/structural-policy-merge.js +32 -0
  94. package/dist/governance/structural-policy-merge.js.map +1 -0
  95. package/dist/governance/verify-runtime-guard.d.ts +99 -0
  96. package/dist/governance/verify-runtime-guard.d.ts.map +1 -0
  97. package/dist/governance/verify-runtime-guard.js +129 -0
  98. package/dist/governance/verify-runtime-guard.js.map +1 -0
  99. package/dist/index.js +107 -0
  100. package/dist/index.js.map +1 -1
  101. package/dist/integrations/review-compression/index.d.ts +50 -0
  102. package/dist/integrations/review-compression/index.d.ts.map +1 -0
  103. package/dist/integrations/review-compression/index.js +158 -0
  104. package/dist/integrations/review-compression/index.js.map +1 -0
  105. package/dist/intent-engine/domain-taxonomy.d.ts +42 -0
  106. package/dist/intent-engine/domain-taxonomy.d.ts.map +1 -0
  107. package/dist/intent-engine/domain-taxonomy.js +534 -0
  108. package/dist/intent-engine/domain-taxonomy.js.map +1 -0
  109. package/dist/intent-engine/index.d.ts +1 -0
  110. package/dist/intent-engine/index.d.ts.map +1 -1
  111. package/dist/intent-engine/index.js +6 -1
  112. package/dist/intent-engine/index.js.map +1 -1
  113. package/dist/intent-engine/parser.d.ts.map +1 -1
  114. package/dist/intent-engine/parser.js +47 -0
  115. package/dist/intent-engine/parser.js.map +1 -1
  116. package/dist/intent-engine/repo-classifier.d.ts +64 -0
  117. package/dist/intent-engine/repo-classifier.d.ts.map +1 -0
  118. package/dist/intent-engine/repo-classifier.js +178 -0
  119. package/dist/intent-engine/repo-classifier.js.map +1 -0
  120. package/dist/intent-engine/semantic-expander.d.ts +104 -0
  121. package/dist/intent-engine/semantic-expander.d.ts.map +1 -0
  122. package/dist/intent-engine/semantic-expander.js +480 -0
  123. package/dist/intent-engine/semantic-expander.js.map +1 -0
  124. package/dist/patch-engine/patterns.d.ts.map +1 -1
  125. package/dist/patch-engine/patterns.js +8 -4
  126. package/dist/patch-engine/patterns.js.map +1 -1
  127. package/dist/semantic/index.d.ts +14 -0
  128. package/dist/semantic/index.d.ts.map +1 -0
  129. package/dist/semantic/index.js +30 -0
  130. package/dist/semantic/index.js.map +1 -0
  131. package/dist/semantic/tfidf-engine.d.ts +81 -0
  132. package/dist/semantic/tfidf-engine.d.ts.map +1 -0
  133. package/dist/semantic/tfidf-engine.js +278 -0
  134. package/dist/semantic/tfidf-engine.js.map +1 -0
  135. package/dist/semantic/vector-store.d.ts +108 -0
  136. package/dist/semantic/vector-store.d.ts.map +1 -0
  137. package/dist/semantic/vector-store.js +321 -0
  138. package/dist/semantic/vector-store.js.map +1 -0
  139. package/dist/structural-rules/context-severity.d.ts +46 -0
  140. package/dist/structural-rules/context-severity.d.ts.map +1 -0
  141. package/dist/structural-rules/context-severity.js +115 -0
  142. package/dist/structural-rules/context-severity.js.map +1 -0
  143. package/dist/structural-rules/distributed/DS001-saga-rollback-absence.d.ts +11 -0
  144. package/dist/structural-rules/distributed/DS001-saga-rollback-absence.d.ts.map +1 -0
  145. package/dist/structural-rules/distributed/DS001-saga-rollback-absence.js +212 -0
  146. package/dist/structural-rules/distributed/DS001-saga-rollback-absence.js.map +1 -0
  147. package/dist/structural-rules/distributed/DS002-missing-correlation-id.d.ts +11 -0
  148. package/dist/structural-rules/distributed/DS002-missing-correlation-id.d.ts.map +1 -0
  149. package/dist/structural-rules/distributed/DS002-missing-correlation-id.js +213 -0
  150. package/dist/structural-rules/distributed/DS002-missing-correlation-id.js.map +1 -0
  151. package/dist/structural-rules/distributed/index.d.ts +3 -0
  152. package/dist/structural-rules/distributed/index.d.ts.map +1 -0
  153. package/dist/structural-rules/distributed/index.js +8 -0
  154. package/dist/structural-rules/distributed/index.js.map +1 -0
  155. package/dist/structural-rules/engine.d.ts +25 -0
  156. package/dist/structural-rules/engine.d.ts.map +1 -0
  157. package/dist/structural-rules/engine.js +90 -0
  158. package/dist/structural-rules/engine.js.map +1 -0
  159. package/dist/structural-rules/index.d.ts +45 -0
  160. package/dist/structural-rules/index.d.ts.map +1 -0
  161. package/dist/structural-rules/index.js +158 -0
  162. package/dist/structural-rules/index.js.map +1 -0
  163. package/dist/structural-rules/python/PY001-asyncio-task-without-cancel.d.ts +11 -0
  164. package/dist/structural-rules/python/PY001-asyncio-task-without-cancel.d.ts.map +1 -0
  165. package/dist/structural-rules/python/PY001-asyncio-task-without-cancel.js +66 -0
  166. package/dist/structural-rules/python/PY001-asyncio-task-without-cancel.js.map +1 -0
  167. package/dist/structural-rules/python/PY002-unbounded-dict-singleton.d.ts +11 -0
  168. package/dist/structural-rules/python/PY002-unbounded-dict-singleton.d.ts.map +1 -0
  169. package/dist/structural-rules/python/PY002-unbounded-dict-singleton.js +135 -0
  170. package/dist/structural-rules/python/PY002-unbounded-dict-singleton.js.map +1 -0
  171. package/dist/structural-rules/python/PY003-broad-except-clause.d.ts +32 -0
  172. package/dist/structural-rules/python/PY003-broad-except-clause.d.ts.map +1 -0
  173. package/dist/structural-rules/python/PY003-broad-except-clause.js +277 -0
  174. package/dist/structural-rules/python/PY003-broad-except-clause.js.map +1 -0
  175. package/dist/structural-rules/python/PY004-swallowed-async-exception.d.ts +11 -0
  176. package/dist/structural-rules/python/PY004-swallowed-async-exception.d.ts.map +1 -0
  177. package/dist/structural-rules/python/PY004-swallowed-async-exception.js +167 -0
  178. package/dist/structural-rules/python/PY004-swallowed-async-exception.js.map +1 -0
  179. package/dist/structural-rules/python/PY005-fastapi-without-pydantic.d.ts +11 -0
  180. package/dist/structural-rules/python/PY005-fastapi-without-pydantic.d.ts.map +1 -0
  181. package/dist/structural-rules/python/PY005-fastapi-without-pydantic.js +154 -0
  182. package/dist/structural-rules/python/PY005-fastapi-without-pydantic.js.map +1 -0
  183. package/dist/structural-rules/python/PY006-blocking-io-in-async.d.ts +11 -0
  184. package/dist/structural-rules/python/PY006-blocking-io-in-async.d.ts.map +1 -0
  185. package/dist/structural-rules/python/PY006-blocking-io-in-async.js +130 -0
  186. package/dist/structural-rules/python/PY006-blocking-io-in-async.js.map +1 -0
  187. package/dist/structural-rules/python/PY007-sqlalchemy-session-leak.d.ts +11 -0
  188. package/dist/structural-rules/python/PY007-sqlalchemy-session-leak.d.ts.map +1 -0
  189. package/dist/structural-rules/python/PY007-sqlalchemy-session-leak.js +93 -0
  190. package/dist/structural-rules/python/PY007-sqlalchemy-session-leak.js.map +1 -0
  191. package/dist/structural-rules/python/PY008-celery-task-without-retry.d.ts +11 -0
  192. package/dist/structural-rules/python/PY008-celery-task-without-retry.d.ts.map +1 -0
  193. package/dist/structural-rules/python/PY008-celery-task-without-retry.js +154 -0
  194. package/dist/structural-rules/python/PY008-celery-task-without-retry.js.map +1 -0
  195. package/dist/structural-rules/python/PY009-unsafe-pickle-deserialization.d.ts +11 -0
  196. package/dist/structural-rules/python/PY009-unsafe-pickle-deserialization.d.ts.map +1 -0
  197. package/dist/structural-rules/python/PY009-unsafe-pickle-deserialization.js +133 -0
  198. package/dist/structural-rules/python/PY009-unsafe-pickle-deserialization.js.map +1 -0
  199. package/dist/structural-rules/python/PY010-leaked-aiohttp-session.d.ts +11 -0
  200. package/dist/structural-rules/python/PY010-leaked-aiohttp-session.d.ts.map +1 -0
  201. package/dist/structural-rules/python/PY010-leaked-aiohttp-session.js +80 -0
  202. package/dist/structural-rules/python/PY010-leaked-aiohttp-session.js.map +1 -0
  203. package/dist/structural-rules/python/PY011-thread-lifecycle.d.ts +11 -0
  204. package/dist/structural-rules/python/PY011-thread-lifecycle.d.ts.map +1 -0
  205. package/dist/structural-rules/python/PY011-thread-lifecycle.js +97 -0
  206. package/dist/structural-rules/python/PY011-thread-lifecycle.js.map +1 -0
  207. package/dist/structural-rules/python/PY012-asyncio-run-misuse.d.ts +11 -0
  208. package/dist/structural-rules/python/PY012-asyncio-run-misuse.d.ts.map +1 -0
  209. package/dist/structural-rules/python/PY012-asyncio-run-misuse.js +83 -0
  210. package/dist/structural-rules/python/PY012-asyncio-run-misuse.js.map +1 -0
  211. package/dist/structural-rules/python/PY013-mutable-default-arg.d.ts +11 -0
  212. package/dist/structural-rules/python/PY013-mutable-default-arg.d.ts.map +1 -0
  213. package/dist/structural-rules/python/PY013-mutable-default-arg.js +73 -0
  214. package/dist/structural-rules/python/PY013-mutable-default-arg.js.map +1 -0
  215. package/dist/structural-rules/python/PY014-fixed-sleep-retry.d.ts +11 -0
  216. package/dist/structural-rules/python/PY014-fixed-sleep-retry.d.ts.map +1 -0
  217. package/dist/structural-rules/python/PY014-fixed-sleep-retry.js +115 -0
  218. package/dist/structural-rules/python/PY014-fixed-sleep-retry.js.map +1 -0
  219. package/dist/structural-rules/rules/SR001-swallowed-async-rejection.d.ts +11 -0
  220. package/dist/structural-rules/rules/SR001-swallowed-async-rejection.d.ts.map +1 -0
  221. package/dist/structural-rules/rules/SR001-swallowed-async-rejection.js +145 -0
  222. package/dist/structural-rules/rules/SR001-swallowed-async-rejection.js.map +1 -0
  223. package/dist/structural-rules/rules/SR002-unbounded-collection.d.ts +11 -0
  224. package/dist/structural-rules/rules/SR002-unbounded-collection.d.ts.map +1 -0
  225. package/dist/structural-rules/rules/SR002-unbounded-collection.js +196 -0
  226. package/dist/structural-rules/rules/SR002-unbounded-collection.js.map +1 -0
  227. package/dist/structural-rules/rules/SR003-timer-without-cleanup.d.ts +11 -0
  228. package/dist/structural-rules/rules/SR003-timer-without-cleanup.d.ts.map +1 -0
  229. package/dist/structural-rules/rules/SR003-timer-without-cleanup.js +148 -0
  230. package/dist/structural-rules/rules/SR003-timer-without-cleanup.js.map +1 -0
  231. package/dist/structural-rules/rules/SR004-request-boundary-no-validation.d.ts +11 -0
  232. package/dist/structural-rules/rules/SR004-request-boundary-no-validation.d.ts.map +1 -0
  233. package/dist/structural-rules/rules/SR004-request-boundary-no-validation.js +162 -0
  234. package/dist/structural-rules/rules/SR004-request-boundary-no-validation.js.map +1 -0
  235. package/dist/structural-rules/rules/SR005-halfopen-probe-gate.d.ts +11 -0
  236. package/dist/structural-rules/rules/SR005-halfopen-probe-gate.d.ts.map +1 -0
  237. package/dist/structural-rules/rules/SR005-halfopen-probe-gate.js +150 -0
  238. package/dist/structural-rules/rules/SR005-halfopen-probe-gate.js.map +1 -0
  239. package/dist/structural-rules/rules/SR006-fanout-error-sanitization.d.ts +11 -0
  240. package/dist/structural-rules/rules/SR006-fanout-error-sanitization.d.ts.map +1 -0
  241. package/dist/structural-rules/rules/SR006-fanout-error-sanitization.js +161 -0
  242. package/dist/structural-rules/rules/SR006-fanout-error-sanitization.js.map +1 -0
  243. package/dist/structural-rules/rules/SR007-cross-request-error.d.ts +11 -0
  244. package/dist/structural-rules/rules/SR007-cross-request-error.d.ts.map +1 -0
  245. package/dist/structural-rules/rules/SR007-cross-request-error.js +175 -0
  246. package/dist/structural-rules/rules/SR007-cross-request-error.js.map +1 -0
  247. package/dist/structural-rules/rules/SR008-background-task-orphan.d.ts +11 -0
  248. package/dist/structural-rules/rules/SR008-background-task-orphan.d.ts.map +1 -0
  249. package/dist/structural-rules/rules/SR008-background-task-orphan.js +176 -0
  250. package/dist/structural-rules/rules/SR008-background-task-orphan.js.map +1 -0
  251. package/dist/structural-rules/rules/SR009-missing-retry-backoff.d.ts +11 -0
  252. package/dist/structural-rules/rules/SR009-missing-retry-backoff.d.ts.map +1 -0
  253. package/dist/structural-rules/rules/SR009-missing-retry-backoff.js +168 -0
  254. package/dist/structural-rules/rules/SR009-missing-retry-backoff.js.map +1 -0
  255. package/dist/structural-rules/rules/SR010-retry-storm.d.ts +11 -0
  256. package/dist/structural-rules/rules/SR010-retry-storm.d.ts.map +1 -0
  257. package/dist/structural-rules/rules/SR010-retry-storm.js +181 -0
  258. package/dist/structural-rules/rules/SR010-retry-storm.js.map +1 -0
  259. package/dist/structural-rules/rules/SR011-event-listener-leak.d.ts +11 -0
  260. package/dist/structural-rules/rules/SR011-event-listener-leak.d.ts.map +1 -0
  261. package/dist/structural-rules/rules/SR011-event-listener-leak.js +208 -0
  262. package/dist/structural-rules/rules/SR011-event-listener-leak.js.map +1 -0
  263. package/dist/structural-rules/rules/SR012-promise-race-leak.d.ts +11 -0
  264. package/dist/structural-rules/rules/SR012-promise-race-leak.d.ts.map +1 -0
  265. package/dist/structural-rules/rules/SR012-promise-race-leak.js +191 -0
  266. package/dist/structural-rules/rules/SR012-promise-race-leak.js.map +1 -0
  267. package/dist/structural-rules/rules/SR013-missing-idempotency-key.d.ts +11 -0
  268. package/dist/structural-rules/rules/SR013-missing-idempotency-key.d.ts.map +1 -0
  269. package/dist/structural-rules/rules/SR013-missing-idempotency-key.js +219 -0
  270. package/dist/structural-rules/rules/SR013-missing-idempotency-key.js.map +1 -0
  271. package/dist/structural-rules/rules/SR014-mutable-closure-async.d.ts +11 -0
  272. package/dist/structural-rules/rules/SR014-mutable-closure-async.d.ts.map +1 -0
  273. package/dist/structural-rules/rules/SR014-mutable-closure-async.js +208 -0
  274. package/dist/structural-rules/rules/SR014-mutable-closure-async.js.map +1 -0
  275. package/dist/structural-rules/rules/SR015-dangling-abort-controller.d.ts +11 -0
  276. package/dist/structural-rules/rules/SR015-dangling-abort-controller.d.ts.map +1 -0
  277. package/dist/structural-rules/rules/SR015-dangling-abort-controller.js +190 -0
  278. package/dist/structural-rules/rules/SR015-dangling-abort-controller.js.map +1 -0
  279. package/dist/structural-rules/rules/SR016-unsafe-json-parse.d.ts +11 -0
  280. package/dist/structural-rules/rules/SR016-unsafe-json-parse.d.ts.map +1 -0
  281. package/dist/structural-rules/rules/SR016-unsafe-json-parse.js +187 -0
  282. package/dist/structural-rules/rules/SR016-unsafe-json-parse.js.map +1 -0
  283. package/dist/structural-rules/suppressions.d.ts +43 -0
  284. package/dist/structural-rules/suppressions.d.ts.map +1 -0
  285. package/dist/structural-rules/suppressions.js +115 -0
  286. package/dist/structural-rules/suppressions.js.map +1 -0
  287. package/dist/structural-rules/types.d.ts +55 -0
  288. package/dist/structural-rules/types.d.ts.map +1 -0
  289. package/dist/structural-rules/types.js +3 -0
  290. package/dist/structural-rules/types.js.map +1 -0
  291. package/dist/utils/brain-cache.d.ts +100 -0
  292. package/dist/utils/brain-cache.d.ts.map +1 -0
  293. package/dist/utils/brain-cache.js +346 -0
  294. package/dist/utils/brain-cache.js.map +1 -0
  295. package/dist/utils/governance-provenance.d.ts +95 -0
  296. package/dist/utils/governance-provenance.d.ts.map +1 -0
  297. package/dist/utils/governance-provenance.js +187 -0
  298. package/dist/utils/governance-provenance.js.map +1 -0
  299. package/dist/utils/pilot-metrics.d.ts +46 -0
  300. package/dist/utils/pilot-metrics.d.ts.map +1 -0
  301. package/dist/utils/pilot-metrics.js +240 -0
  302. package/dist/utils/pilot-metrics.js.map +1 -0
  303. package/dist/utils/replay-runtime.d.ts +34 -0
  304. package/dist/utils/replay-runtime.d.ts.map +1 -1
  305. package/dist/utils/replay-runtime.js +207 -0
  306. package/dist/utils/replay-runtime.js.map +1 -1
  307. package/dist/utils/verify-runtime-stability.d.ts +142 -0
  308. package/dist/utils/verify-runtime-stability.d.ts.map +1 -0
  309. package/dist/utils/verify-runtime-stability.js +230 -0
  310. package/dist/utils/verify-runtime-stability.js.map +1 -0
  311. package/dist/workspace/cross-repo-graph.d.ts +111 -0
  312. package/dist/workspace/cross-repo-graph.d.ts.map +1 -0
  313. package/dist/workspace/cross-repo-graph.js +450 -0
  314. package/dist/workspace/cross-repo-graph.js.map +1 -0
  315. package/dist/workspace/federated-context.d.ts +144 -0
  316. package/dist/workspace/federated-context.d.ts.map +1 -0
  317. package/dist/workspace/federated-context.js +347 -0
  318. package/dist/workspace/federated-context.js.map +1 -0
  319. package/dist/workspace/index.d.ts +38 -0
  320. package/dist/workspace/index.d.ts.map +1 -0
  321. package/dist/workspace/index.js +48 -0
  322. package/dist/workspace/index.js.map +1 -0
  323. package/package.json +9 -9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PY005-fastapi-without-pydantic.js","sourceRoot":"","sources":["../../../src/structural-rules/python/PY005-fastapi-without-pydantic.ts"],"names":[],"mappings":";;;AAEA,mCAAmC;AACnC,MAAM,kBAAkB,GAAG,qFAAqF,CAAC;AAEjH,yFAAyF;AACzF,MAAM,cAAc,GAAG,+CAA+C,CAAC;AAEvE,sEAAsE;AACtE,mFAAmF;AACnF,MAAM,iBAAiB,GAAG,gEAAgE,CAAC;AAE3F,+CAA+C;AAC/C,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACjC,SAAS;IACT,UAAU;IACV,iBAAiB;IACjB,eAAe;IACf,SAAS;IACT,UAAU;IACV,MAAM;IACN,MAAM;IACN,KAAK;IACL,KAAK;IACL,KAAK;IACL,OAAO;IACP,MAAM;IACN,OAAO;CACR,CAAC,CAAC;AAEH,SAAS,wBAAwB,CAAC,KAAe,EAAE,QAAgB;IACjE,uDAAuD;IACvD,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,IAAI,CAAC,GAAG,QAAQ,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;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AI,EAAE,WAAW,GAAG,CAAC;oBACrB,MAAM,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC;oBAC/D,QAAQ;oBACR,eAAe,EACb,4DAA4D;wBAC5D,6EAA6E;wBAC7E,uEAAuE;oBACzE,WAAW,EACT,uDAAuD;wBACvD,uGAAuG;wBACvG,6DAA6D;oBAC/D,WAAW,EAAE,0BAA0B;oBACvC,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,QAAQ;iBACnB,CAAC,CAAC;gBAEH,CAAC,GAAG,CAAC,CAAC;YACR,CAAC;YAED,OAAO,UAAU,CAAC;QACpB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF;AA1GD,kEA0GC"}
@@ -0,0 +1,11 @@
1
+ import { StructuralRule, StructuralViolation, RuleLanguage } from '../types';
2
+ export declare class PY006BlockingIOInAsync implements StructuralRule {
3
+ id: string;
4
+ name: string;
5
+ policyRef: string;
6
+ severity: "BLOCKING";
7
+ languages: RuleLanguage[];
8
+ description: string;
9
+ check(filePath: string, sourceText: string): StructuralViolation[];
10
+ }
11
+ //# sourceMappingURL=PY006-blocking-io-in-async.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PY006-blocking-io-in-async.d.ts","sourceRoot":"","sources":["../../../src/structural-rules/python/PY006-blocking-io-in-async.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAwB7E,qBAAa,sBAAuB,YAAW,cAAc;IAC3D,EAAE,SAAW;IACb,IAAI,SAAwC;IAC5C,SAAS,SAAW;IACpB,QAAQ,EAAG,UAAU,CAAU;IAC/B,SAAS,EAAE,YAAY,EAAE,CAAc;IACvC,WAAW,SACoG;IAE/G,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,mBAAmB,EAAE;CA8GnE"}
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PY006BlockingIOInAsync = void 0;
4
+ // Matches `async def funcname(`
5
+ const ASYNC_DEF_RE = /^(\s*)async\s+def\s+\w+\s*\(/;
6
+ // Matches nested sync `def` (not async def)
7
+ const SYNC_DEF_RE = /^\s+def\s+\w+\s*\(/;
8
+ // Blocking patterns to detect inside async function bodies
9
+ const BLOCKING_PATTERNS = [
10
+ { re: /\btime\.sleep\s*\(/, label: 'time.sleep()' },
11
+ { re: /\brequests\.get\s*\(/, label: 'requests.get()' },
12
+ { re: /\brequests\.post\s*\(/, label: 'requests.post()' },
13
+ { re: /\brequests\.request\s*\(/, label: 'requests.request()' },
14
+ { re: /\bsubprocess\.run\s*\(/, label: 'subprocess.run()' },
15
+ { re: /\bsubprocess\.call\s*\(/, label: 'subprocess.call()' },
16
+ // open( not preceded by aiofiles.open or async with
17
+ { re: /(?<!aiofiles\.)(?<!\bwith\s)\bopen\s*\(/, label: 'open()' },
18
+ ];
19
+ function getIndent(line) {
20
+ return line.length - line.trimStart().length;
21
+ }
22
+ class PY006BlockingIOInAsync {
23
+ id = 'PY006';
24
+ name = 'Blocking I/O call inside async def';
25
+ policyRef = 'PY006';
26
+ severity = 'BLOCKING';
27
+ languages = ['python'];
28
+ description = 'Blocking I/O (time.sleep, requests, open, subprocess) inside an async def function freezes the event loop.';
29
+ check(filePath, sourceText) {
30
+ try {
31
+ const violations = [];
32
+ // Normalize line endings
33
+ const lines = sourceText.replace(/\r\n/g, '\n').replace(/\r/g, '\n').split('\n');
34
+ // Does the file import aiofiles?
35
+ const importsAiofiles = /\baiofiles\b/.test(sourceText);
36
+ let i = 0;
37
+ while (i < lines.length) {
38
+ const line = lines[i];
39
+ const asyncMatch = ASYNC_DEF_RE.exec(line);
40
+ if (!asyncMatch) {
41
+ i++;
42
+ continue;
43
+ }
44
+ const funcIndent = asyncMatch[1].length;
45
+ const bodyStart = i + 1;
46
+ i++;
47
+ // Collect the function body: lines with indent > funcIndent
48
+ while (i < lines.length) {
49
+ const bl = lines[i];
50
+ const trimmed = bl.trimStart();
51
+ // Blank lines are part of the body
52
+ if (trimmed.length === 0) {
53
+ i++;
54
+ continue;
55
+ }
56
+ const lineIndent = getIndent(bl);
57
+ // If we're back at or before the function's indent, we've left the body
58
+ if (lineIndent <= funcIndent)
59
+ break;
60
+ // Skip comment lines
61
+ if (trimmed.startsWith('#')) {
62
+ i++;
63
+ continue;
64
+ }
65
+ // Skip lines with noqa
66
+ if (/\bnoqa\b/.test(bl)) {
67
+ i++;
68
+ continue;
69
+ }
70
+ // Skip lines that are inside a nested sync def
71
+ // (we only care about the top-level async body, not nested sync helpers)
72
+ if (SYNC_DEF_RE.test(bl)) {
73
+ // Skip the entire nested sync function body
74
+ const nestedIndent = lineIndent;
75
+ i++;
76
+ while (i < lines.length) {
77
+ const nb = lines[i];
78
+ const nt = nb.trimStart();
79
+ if (nt.length === 0) {
80
+ i++;
81
+ continue;
82
+ }
83
+ if (getIndent(nb) <= nestedIndent)
84
+ break;
85
+ i++;
86
+ }
87
+ continue;
88
+ }
89
+ // Check blocking patterns
90
+ for (const { re, label } of BLOCKING_PATTERNS) {
91
+ // If it's an open() hit and aiofiles is imported, skip
92
+ if (label === 'open()' && importsAiofiles)
93
+ continue;
94
+ if (re.test(bl)) {
95
+ violations.push({
96
+ ruleId: this.id,
97
+ ruleName: this.name,
98
+ policyRef: this.policyRef,
99
+ severity: this.severity,
100
+ filePath,
101
+ line: i + 1,
102
+ column: 1,
103
+ evidence: bl.slice(0, 120),
104
+ operationalRisk: `\`${label}\` inside an async function blocks the entire event loop thread. ` +
105
+ 'All other coroutines are frozen for the duration of the call. ' +
106
+ 'Under load, a single blocking call can cause 100ms+ latency spikes across all concurrent requests.',
107
+ remediation: 'Replace time.sleep(n) with `await asyncio.sleep(n)`, ' +
108
+ 'requests.get() with `await aiohttp.ClientSession().get()`, ' +
109
+ 'open() with `async with aiofiles.open()`, ' +
110
+ 'subprocess.run() with `await asyncio.create_subprocess_exec()`.',
111
+ determinism: 'heuristic-advisory',
112
+ confidence: 0.82,
113
+ language: 'python',
114
+ });
115
+ break; // one violation per line
116
+ }
117
+ }
118
+ i++;
119
+ }
120
+ void bodyStart; // suppress unused warning
121
+ }
122
+ return violations;
123
+ }
124
+ catch {
125
+ return [];
126
+ }
127
+ }
128
+ }
129
+ exports.PY006BlockingIOInAsync = PY006BlockingIOInAsync;
130
+ //# sourceMappingURL=PY006-blocking-io-in-async.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PY006-blocking-io-in-async.js","sourceRoot":"","sources":["../../../src/structural-rules/python/PY006-blocking-io-in-async.ts"],"names":[],"mappings":";;;AAEA,gCAAgC;AAChC,MAAM,YAAY,GAAG,8BAA8B,CAAC;AAEpD,4CAA4C;AAC5C,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAEzC,2DAA2D;AAC3D,MAAM,iBAAiB,GAAyC;IAC9D,EAAE,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,cAAc,EAAE;IACnD,EAAE,EAAE,EAAE,sBAAsB,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACvD,EAAE,EAAE,EAAE,uBAAuB,EAAE,KAAK,EAAE,iBAAiB,EAAE;IACzD,EAAE,EAAE,EAAE,0BAA0B,EAAE,KAAK,EAAE,oBAAoB,EAAE;IAC/D,EAAE,EAAE,EAAE,wBAAwB,EAAE,KAAK,EAAE,kBAAkB,EAAE;IAC3D,EAAE,EAAE,EAAE,yBAAyB,EAAE,KAAK,EAAE,mBAAmB,EAAE;IAC7D,oDAAoD;IACpD,EAAE,EAAE,EAAE,yCAAyC,EAAE,KAAK,EAAE,QAAQ,EAAE;CACnE,CAAC;AAEF,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,MAAM,GAAG,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AAE,SAAS;wBAEpD,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;4BAChB,UAAU,CAAC,IAAI,CAAC;gCACd,MAAM,EAAE,IAAI,CAAC,EAAE;gCACf,QAAQ,EAAE,IAAI,CAAC,IAAI;gCACnB,SAAS,EAAE,IAAI,CAAC,SAAS;gCACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gCACvB,QAAQ;gCACR,IAAI,EAAE,CAAC,GAAG,CAAC;gCACX,MAAM,EAAE,CAAC;gCACT,QAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;gCAC1B,eAAe,EACb,KAAK,KAAK,mEAAmE;oCAC7E,gEAAgE;oCAChE,oGAAoG;gCACtG,WAAW,EACT,uDAAuD;oCACvD,6DAA6D;oCAC7D,4CAA4C;oCAC5C,iEAAiE;gCACnE,WAAW,EAAE,oBAAoB;gCACjC,UAAU,EAAE,IAAI;gCAChB,QAAQ,EAAE,QAAQ;6BACnB,CAAC,CAAC;4BACH,MAAM,CAAC,yBAAyB;wBAClC,CAAC;oBACH,CAAC;oBAED,CAAC,EAAE,CAAC;gBACN,CAAC;gBAED,KAAK,SAAS,CAAC,CAAC,0BAA0B;YAC5C,CAAC;YAED,OAAO,UAAU,CAAC;QACpB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF;AAvHD,wDAuHC"}
@@ -0,0 +1,11 @@
1
+ import { StructuralRule, StructuralViolation, RuleLanguage } from '../types';
2
+ export declare class PY007SQLAlchemySessionLeak implements StructuralRule {
3
+ id: string;
4
+ name: string;
5
+ policyRef: string;
6
+ severity: "BLOCKING";
7
+ languages: RuleLanguage[];
8
+ description: string;
9
+ check(filePath: string, sourceText: string): StructuralViolation[];
10
+ }
11
+ //# sourceMappingURL=PY007-sqlalchemy-session-leak.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PY007-sqlalchemy-session-leak.d.ts","sourceRoot":"","sources":["../../../src/structural-rules/python/PY007-sqlalchemy-session-leak.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAmB7E,qBAAa,0BAA2B,YAAW,cAAc;IAC/D,EAAE,SAAW;IACb,IAAI,SAAwD;IAC5D,SAAS,SAAW;IACpB,QAAQ,EAAG,UAAU,CAAU;IAC/B,SAAS,EAAE,YAAY,EAAE,CAAc;IACvC,WAAW,SACwG;IAEnH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,mBAAmB,EAAE;CA6EnE"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PY007SQLAlchemySessionLeak = void 0;
4
+ // Matches bare session assignment: session = Session() / session = SessionLocal() etc.
5
+ // Captures the variable name and the constructor call
6
+ const SESSION_ASSIGN_RE = /^(\s*)(\w+)\s*=\s*(Session|SessionLocal|AsyncSession|get_session|ScopedSession|sessionmaker\(\))\s*\(/;
7
+ // Matches a `with` or `async with` block opening with Session
8
+ const WITH_SESSION_RE = /^\s*(?:async\s+)?with\s+.*Session/;
9
+ // Matches session.close() in a finally block vicinity
10
+ const SESSION_CLOSE_RE = /\bsession\s*\.\s*close\s*\(\)/;
11
+ // Matches a `finally:` block
12
+ const FINALLY_RE = /^\s*finally\s*:/;
13
+ function getIndent(line) {
14
+ return line.length - line.trimStart().length;
15
+ }
16
+ class PY007SQLAlchemySessionLeak {
17
+ id = 'PY007';
18
+ name = 'SQLAlchemy session created outside context manager';
19
+ policyRef = 'PY007';
20
+ severity = 'BLOCKING';
21
+ languages = ['python'];
22
+ description = 'SQLAlchemy session assigned without a context manager or try/finally close() risks connection pool exhaustion.';
23
+ check(filePath, sourceText) {
24
+ try {
25
+ const violations = [];
26
+ // Normalize line endings
27
+ const lines = sourceText.replace(/\r\n/g, '\n').replace(/\r/g, '\n').split('\n');
28
+ for (let i = 0; i < lines.length; i++) {
29
+ const line = lines[i];
30
+ // Skip if this line is a `with Session()` — safe usage
31
+ if (WITH_SESSION_RE.test(line))
32
+ continue;
33
+ const match = SESSION_ASSIGN_RE.exec(line);
34
+ if (!match)
35
+ continue;
36
+ const varName = match[2];
37
+ const assignIndent = match[1].length;
38
+ // Look ahead: find if there is a try/finally with session.close()
39
+ // Search up to 60 lines ahead within the same or deeper indentation scope
40
+ let hasFinallyClose = false;
41
+ let inFinally = false;
42
+ for (let j = i + 1; j < Math.min(i + 60, lines.length); j++) {
43
+ const jl = lines[j];
44
+ const jt = jl.trimStart();
45
+ if (jt.length === 0)
46
+ continue;
47
+ const jIndent = getIndent(jl);
48
+ // If we've gone back to a shallower indent than the assignment, stop
49
+ if (jIndent < assignIndent)
50
+ break;
51
+ if (FINALLY_RE.test(jl)) {
52
+ inFinally = true;
53
+ continue;
54
+ }
55
+ if (inFinally) {
56
+ // Check for varName.close() or generic session.close()
57
+ const closeRe = new RegExp(`\\b${varName}\\s*\\.\\s*close\\s*\\(\\)`);
58
+ if (closeRe.test(jl) || SESSION_CLOSE_RE.test(jl)) {
59
+ hasFinallyClose = true;
60
+ break;
61
+ }
62
+ }
63
+ }
64
+ if (!hasFinallyClose) {
65
+ violations.push({
66
+ ruleId: this.id,
67
+ ruleName: this.name,
68
+ policyRef: this.policyRef,
69
+ severity: this.severity,
70
+ filePath,
71
+ line: i + 1,
72
+ column: 1,
73
+ evidence: line.slice(0, 120),
74
+ operationalRisk: 'Unclosed SQLAlchemy sessions hold database connections open indefinitely. ' +
75
+ 'Connection pools exhaust under load, causing `TimeoutError: QueuePool limit of size X overflow Y reached` ' +
76
+ 'in production within hours of deployment.',
77
+ remediation: 'Use `with Session() as session:` or `async with AsyncSession() as session:` for automatic cleanup. ' +
78
+ 'Never use bare `session = Session()` without a corresponding `finally: session.close()`.',
79
+ determinism: 'heuristic-advisory',
80
+ confidence: 0.78,
81
+ language: 'python',
82
+ });
83
+ }
84
+ }
85
+ return violations;
86
+ }
87
+ catch {
88
+ return [];
89
+ }
90
+ }
91
+ }
92
+ exports.PY007SQLAlchemySessionLeak = PY007SQLAlchemySessionLeak;
93
+ //# sourceMappingURL=PY007-sqlalchemy-session-leak.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PY007-sqlalchemy-session-leak.js","sourceRoot":"","sources":["../../../src/structural-rules/python/PY007-sqlalchemy-session-leak.ts"],"names":[],"mappings":";;;AAEA,uFAAuF;AACvF,sDAAsD;AACtD,MAAM,iBAAiB,GAAG,uGAAuG,CAAC;AAElI,8DAA8D;AAC9D,MAAM,eAAe,GAAG,mCAAmC,CAAC;AAE5D,sDAAsD;AACtD,MAAM,gBAAgB,GAAG,+BAA+B,CAAC;AAEzD,6BAA6B;AAC7B,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAErC,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC;AAC/C,CAAC;AAED,MAAa,0BAA0B;IACrC,EAAE,GAAG,OAAO,CAAC;IACb,IAAI,GAAG,oDAAoD,CAAC;IAC5D,SAAS,GAAG,OAAO,CAAC;IACpB,QAAQ,GAAG,UAAmB,CAAC;IAC/B,SAAS,GAAmB,CAAC,QAAQ,CAAC,CAAC;IACvC,WAAW,GACT,gHAAgH,CAAC;IAEnH,KAAK,CAAC,QAAgB,EAAE,UAAkB;QACxC,IAAI,CAAC;YACH,MAAM,UAAU,GAA0B,EAAE,CAAC;YAC7C,yBAAyB;YACzB,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAEjF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EA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CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;4BAClD,eAAe,GAAG,IAAI,CAAC;4BACvB,MAAM;wBACR,CAAC;oBACH,CAAC;gBACH,CAAC;gBAED,IAAI,CAAC,eAAe,EAAE,CAAC;oBACrB,UAAU,CAAC,IAAI,CAAC;wBACd,MAAM,EAAE,IAAI,CAAC,EAAE;wBACf,QAAQ,EAAE,IAAI,CAAC,IAAI;wBACnB,SAAS,EAAE,IAAI,CAAC,SAAS;wBACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;wBACvB,QAAQ;wBACR,IAAI,EAAE,CAAC,GAAG,CAAC;wBACX,MAAM,EAAE,CAAC;wBACT,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;wBAC5B,eAAe,EACb,4EAA4E;4BAC5E,4GAA4G;4BAC5G,2CAA2C;wBAC7C,WAAW,EACT,qGAAqG;4BACrG,0FAA0F;wBAC5F,WAAW,EAAE,oBAAoB;wBACjC,UAAU,EAAE,IAAI;wBAChB,QAAQ,EAAE,QAAQ;qBACnB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YAED,OAAO,UAAU,CAAC;QACpB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF;AAtFD,gEAsFC"}
@@ -0,0 +1,11 @@
1
+ import { StructuralRule, StructuralViolation, RuleLanguage } from '../types';
2
+ export declare class PY008CeleryTaskWithoutRetry implements StructuralRule {
3
+ id: string;
4
+ name: string;
5
+ policyRef: string;
6
+ severity: "ADVISORY";
7
+ languages: RuleLanguage[];
8
+ description: string;
9
+ check(filePath: string, sourceText: string): StructuralViolation[];
10
+ }
11
+ //# sourceMappingURL=PY008-celery-task-without-retry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PY008-celery-task-without-retry.d.ts","sourceRoot":"","sources":["../../../src/structural-rules/python/PY008-celery-task-without-retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AA8C7E,qBAAa,2BAA4B,YAAW,cAAc;IAChE,EAAE,SAAW;IACb,IAAI,SAA6C;IACjD,SAAS,SAAW;IACpB,QAAQ,EAAG,UAAU,CAAU;IAC/B,SAAS,EAAE,YAAY,EAAE,CAAc;IACvC,WAAW,SACmH;IAE9H,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,mBAAmB,EAAE;CAiHnE"}
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PY008CeleryTaskWithoutRetry = void 0;
4
+ // Matches Celery task decorators
5
+ const CELERY_DECORATOR_RE = /^\s*@(?:\w+\.)?(?:app\.task|celery\.task|shared_task)\s*[\(\n]/;
6
+ const CELERY_DECORATOR_INLINE_RE = /^\s*@(?:\w+\.)?(?:app\.task|celery\.task|shared_task)\s*\(/;
7
+ // Retry configuration keywords inside the decorator
8
+ const RETRY_CONFIG_RE = /(?:max_retries|retry_backoff|autoretry_for|bind\s*=\s*True)/;
9
+ // ignore_result=True — fire-and-forget, valid without retry
10
+ const IGNORE_RESULT_RE = /ignore_result\s*=\s*True/;
11
+ // A raise statement inside the function body
12
+ const RAISE_RE = /\braise\b/;
13
+ // self.retry( call — manual retry in bind=True task
14
+ const SELF_RETRY_RE = /\bself\.retry\s*\(/;
15
+ function getIndent(line) {
16
+ return line.length - line.trimStart().length;
17
+ }
18
+ /**
19
+ * Collect the decorator text (potentially multi-line) starting at decoratorLine.
20
+ * Returns the full decorator string and the line index where the decorator ends.
21
+ */
22
+ function collectDecorator(lines, decoratorLine) {
23
+ let text = lines[decoratorLine];
24
+ let depth = 0;
25
+ for (const ch of lines[decoratorLine]) {
26
+ if (ch === '(')
27
+ depth++;
28
+ else if (ch === ')')
29
+ depth--;
30
+ }
31
+ let j = decoratorLine + 1;
32
+ while (depth > 0 && j < lines.length) {
33
+ text += '\n' + lines[j];
34
+ for (const ch of lines[j]) {
35
+ if (ch === '(')
36
+ depth++;
37
+ else if (ch === ')')
38
+ depth--;
39
+ }
40
+ j++;
41
+ }
42
+ return { text, endLine: j - 1 };
43
+ }
44
+ class PY008CeleryTaskWithoutRetry {
45
+ id = 'PY008';
46
+ name = 'Celery task without retry configuration';
47
+ policyRef = 'PY008';
48
+ severity = 'ADVISORY';
49
+ languages = ['python'];
50
+ description = 'Celery task functions that can raise exceptions but have no retry configuration silently drop jobs on transient failures.';
51
+ check(filePath, sourceText) {
52
+ try {
53
+ const violations = [];
54
+ // Normalize line endings
55
+ const lines = sourceText.replace(/\r\n/g, '\n').replace(/\r/g, '\n').split('\n');
56
+ let i = 0;
57
+ while (i < lines.length) {
58
+ const line = lines[i];
59
+ // Detect Celery decorator
60
+ const isDecorator = CELERY_DECORATOR_RE.test(line) || CELERY_DECORATOR_INLINE_RE.test(line);
61
+ if (!isDecorator) {
62
+ i++;
63
+ continue;
64
+ }
65
+ const decoratorStartLine = i;
66
+ // Collect full decorator text (handles multi-line)
67
+ const { text: decoratorText, endLine: decoratorEnd } = collectDecorator(lines, i);
68
+ // Check for retry config
69
+ const hasRetryConfig = RETRY_CONFIG_RE.test(decoratorText);
70
+ const hasIgnoreResult = IGNORE_RESULT_RE.test(decoratorText);
71
+ // Find the function definition line after decorator
72
+ let funcDefLine = -1;
73
+ let j = decoratorEnd + 1;
74
+ while (j < Math.min(decoratorEnd + 6, lines.length)) {
75
+ const l = lines[j].trimStart();
76
+ if (/^(?:async\s+)?def\s+\w+\s*\(/.test(l)) {
77
+ funcDefLine = j;
78
+ break;
79
+ }
80
+ if (l.length > 0 && !l.startsWith('@') && !l.startsWith('#'))
81
+ break;
82
+ j++;
83
+ }
84
+ if (funcDefLine === -1) {
85
+ i = j;
86
+ continue;
87
+ }
88
+ if (hasRetryConfig) {
89
+ // Already has retry config — no violation
90
+ i = funcDefLine + 1;
91
+ continue;
92
+ }
93
+ // Collect function body
94
+ const funcIndent = getIndent(lines[funcDefLine]);
95
+ let bodyHasRaise = false;
96
+ let bodyHasSelfRetry = false;
97
+ let k = funcDefLine + 1;
98
+ while (k < lines.length) {
99
+ const bl = lines[k];
100
+ const bt = bl.trimStart();
101
+ if (bt.length === 0) {
102
+ k++;
103
+ continue;
104
+ }
105
+ const bi = getIndent(bl);
106
+ if (bi <= funcIndent)
107
+ break;
108
+ if (RAISE_RE.test(bl))
109
+ bodyHasRaise = true;
110
+ if (SELF_RETRY_RE.test(bl))
111
+ bodyHasSelfRetry = true;
112
+ k++;
113
+ }
114
+ // If fire-and-forget (ignore_result=True) and no raise → no violation
115
+ if (hasIgnoreResult && !bodyHasRaise) {
116
+ i = k;
117
+ continue;
118
+ }
119
+ // If uses self.retry() manually → no violation
120
+ if (bodyHasSelfRetry) {
121
+ i = k;
122
+ continue;
123
+ }
124
+ // If function has potential raises and no retry config → flag it
125
+ if (bodyHasRaise) {
126
+ violations.push({
127
+ ruleId: this.id,
128
+ ruleName: this.name,
129
+ policyRef: this.policyRef,
130
+ severity: this.severity,
131
+ filePath,
132
+ line: decoratorStartLine + 1,
133
+ column: 1,
134
+ evidence: lines[decoratorStartLine].slice(0, 120),
135
+ operationalRisk: 'A transient failure (network timeout, DB connection error) in a Celery task without retry configuration ' +
136
+ 'permanently drops the job. The message is lost without processing, causing data loss or inconsistent state.',
137
+ remediation: 'Add `autoretry_for=(Exception,), max_retries=3, retry_backoff=True` to the decorator, ' +
138
+ 'or use `self.retry(exc=exc, countdown=2**self.request.retries)` in the exception handler.',
139
+ determinism: 'heuristic-advisory',
140
+ confidence: 0.75,
141
+ language: 'python',
142
+ });
143
+ }
144
+ i = k;
145
+ }
146
+ return violations;
147
+ }
148
+ catch {
149
+ return [];
150
+ }
151
+ }
152
+ }
153
+ exports.PY008CeleryTaskWithoutRetry = PY008CeleryTaskWithoutRetry;
154
+ //# sourceMappingURL=PY008-celery-task-without-retry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PY008-celery-task-without-retry.js","sourceRoot":"","sources":["../../../src/structural-rules/python/PY008-celery-task-without-retry.ts"],"names":[],"mappings":";;;AAEA,iCAAiC;AACjC,MAAM,mBAAmB,GAAG,gEAAgE,CAAC;AAC7F,MAAM,0BAA0B,GAAG,4DAA4D,CAAC;AAEhG,oDAAoD;AACpD,MAAM,eAAe,GAAG,6DAA6D,CAAC;AAEtF,4DAA4D;AAC5D,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAEpD,6CAA6C;AAC7C,MAAM,QAAQ,GAAG,WAAW,CAAC;AAE7B,oDAAoD;AACpD,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAE3C,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC;AAC/C,CAAC;AAED;;;GAGG;AACH,SAAS,gBAAgB,CAAC,KAAe,EAAE,aAAqB;IAC9D,IAAI,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;IAChC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC;QACtC,IAAI,EAAE,KAAK,GAAG;YAAE,KAAK,EAAE,CAAC;aACnB,IAAI,EAAE,KAAK,GAAG;YAAE,KAAK,EAAE,CAAC;IAC/B,CAAC;IAED,IAAI,CAAC,GAAG,aAAa,GAAG,CAAC,CAAC;IAC1B,OAAO,KAAK,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QACrC,IAAI,IAAI,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACxB,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1B,IAAI,EAAE,KAAK,GAAG;gBAAE,KAAK,EAAE,CAAC;iBACnB,IAAI,EAAE,KAAK,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U,EAAE,IAAI;wBAChB,QAAQ,EAAE,QAAQ;qBACnB,CAAC,CAAC;gBACL,CAAC;gBAED,CAAC,GAAG,CAAC,CAAC;YACR,CAAC;YAED,OAAO,UAAU,CAAC;QACpB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF;AA1HD,kEA0HC"}
@@ -0,0 +1,11 @@
1
+ import { StructuralRule, StructuralViolation, RuleLanguage } from '../types';
2
+ export declare class PY009UnsafePickleDeserialization implements StructuralRule {
3
+ id: string;
4
+ name: string;
5
+ policyRef: string;
6
+ severity: "BLOCKING";
7
+ languages: RuleLanguage[];
8
+ description: string;
9
+ check(filePath: string, sourceText: string): StructuralViolation[];
10
+ }
11
+ //# sourceMappingURL=PY009-unsafe-pickle-deserialization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PY009-unsafe-pickle-deserialization.d.ts","sourceRoot":"","sources":["../../../src/structural-rules/python/PY009-unsafe-pickle-deserialization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAmB7E,qBAAa,gCAAiC,YAAW,cAAc;IACrE,EAAE,SAAW;IACb,IAAI,SAAmC;IACvC,SAAS,SAAW;IACpB,QAAQ,EAAG,UAAU,CAAU;IAC/B,SAAS,EAAE,YAAY,EAAE,CAAc;IACvC,WAAW,SAEsD;IAEjE,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,mBAAmB,EAAE;CAoHnE"}
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PY009UnsafePickleDeserialization = void 0;
4
+ // Matches pickle.loads( or pickle.load(
5
+ const PICKLE_LOAD_RE = /\bpickle\.loads?\s*\(/;
6
+ // Matches joblib.load(
7
+ const JOBLIB_LOAD_RE = /\bjoblib\.load\s*\(/;
8
+ // Matches torch.load( without weights_only=True
9
+ const TORCH_LOAD_RE = /\btorch\.load\s*\(/;
10
+ const TORCH_WEIGHTS_ONLY_RE = /weights_only\s*=\s*True/;
11
+ // Detects if this appears to be a test file
12
+ const TEST_FILE_RE = /(?:^|[\\/])(?:test_|_test|tests[\\/])/;
13
+ // Detects if the pickle input looks like a literal bytes value in a test
14
+ // e.g. pickle.loads(b'\x80\x04...') or pickle.loads(b"...")
15
+ const LITERAL_BYTES_ARG_RE = /\bpickle\.loads?\s*\(\s*b['"]|pickle\.loads?\s*\(\s*b"""|\bpickle\.loads?\s*\(\s*b'''/;
16
+ class PY009UnsafePickleDeserialization {
17
+ id = 'PY009';
18
+ name = 'Unsafe pickle deserialization';
19
+ policyRef = 'PY009';
20
+ severity = 'BLOCKING';
21
+ languages = ['python'];
22
+ description = 'pickle.loads() / pickle.load() executes arbitrary Python code during deserialization. ' +
23
+ 'torch.load() without weights_only=True is equally dangerous.';
24
+ check(filePath, sourceText) {
25
+ try {
26
+ const violations = [];
27
+ // Normalize line endings
28
+ const lines = sourceText.replace(/\r\n/g, '\n').replace(/\r/g, '\n').split('\n');
29
+ const isTestFile = TEST_FILE_RE.test(filePath);
30
+ for (let i = 0; i < lines.length; i++) {
31
+ const line = lines[i];
32
+ const trimmed = line.trimStart();
33
+ // Skip comment lines
34
+ if (trimmed.startsWith('#'))
35
+ continue;
36
+ // Skip noqa lines
37
+ if (/\bnoqa\b/.test(line))
38
+ continue;
39
+ // Check pickle.loads / pickle.load
40
+ if (PICKLE_LOAD_RE.test(line)) {
41
+ // Exclude: test file with literal bytes argument
42
+ if (isTestFile && LITERAL_BYTES_ARG_RE.test(line)) {
43
+ continue;
44
+ }
45
+ violations.push({
46
+ ruleId: this.id,
47
+ ruleName: this.name,
48
+ policyRef: this.policyRef,
49
+ severity: this.severity,
50
+ filePath,
51
+ line: i + 1,
52
+ column: 1,
53
+ evidence: line.slice(0, 120),
54
+ operationalRisk: '`pickle.loads()` executes arbitrary Python code during deserialization. ' +
55
+ 'A single compromised or malformed pickle payload from any source achieves remote code execution ' +
56
+ 'on the deserializing machine. This is a critical supply-chain attack vector in ML systems that share model artifacts.',
57
+ remediation: 'Replace `pickle` with `json`, `msgpack`, or `protobuf` for data serialization. ' +
58
+ 'For ML models, use `safetensors` format. If pickle is truly required, validate the HMAC signature ' +
59
+ 'before deserializing and only accept pickles from trusted, authenticated internal sources.',
60
+ determinism: 'heuristic-advisory',
61
+ confidence: 0.95,
62
+ language: 'python',
63
+ });
64
+ continue;
65
+ }
66
+ // Check joblib.load(
67
+ if (JOBLIB_LOAD_RE.test(line)) {
68
+ violations.push({
69
+ ruleId: this.id,
70
+ ruleName: this.name,
71
+ policyRef: this.policyRef,
72
+ severity: this.severity,
73
+ filePath,
74
+ line: i + 1,
75
+ column: 1,
76
+ evidence: line.slice(0, 120),
77
+ operationalRisk: '`joblib.load()` uses pickle internally and executes arbitrary Python code during deserialization. ' +
78
+ 'Malicious or tampered model artifacts can achieve remote code execution.',
79
+ remediation: 'Use `safetensors` format for model artifacts, or validate the HMAC signature of the joblib file before loading.',
80
+ determinism: 'heuristic-advisory',
81
+ confidence: 0.95,
82
+ language: 'python',
83
+ });
84
+ continue;
85
+ }
86
+ // Check torch.load( — flag if weights_only=True is NOT on the same line
87
+ // Also check the next 2 lines for multi-line calls
88
+ if (TORCH_LOAD_RE.test(line)) {
89
+ // Collect the call: check current line + next 2 for weights_only=True
90
+ let callText = line;
91
+ for (let k = 1; k <= 2 && i + k < lines.length; k++) {
92
+ callText += '\n' + lines[i + k];
93
+ // Stop if we've closed the parens
94
+ let depth = 0;
95
+ for (const ch of callText) {
96
+ if (ch === '(')
97
+ depth++;
98
+ else if (ch === ')')
99
+ depth--;
100
+ }
101
+ if (depth <= 0)
102
+ break;
103
+ }
104
+ if (!TORCH_WEIGHTS_ONLY_RE.test(callText)) {
105
+ violations.push({
106
+ ruleId: this.id,
107
+ ruleName: this.name,
108
+ policyRef: this.policyRef,
109
+ severity: this.severity,
110
+ filePath,
111
+ line: i + 1,
112
+ column: 1,
113
+ evidence: line.slice(0, 120),
114
+ operationalRisk: '`torch.load()` without `weights_only=True` uses pickle and executes arbitrary Python code. ' +
115
+ 'PyTorch 2.0+ requires `weights_only=True` for safe model loading from untrusted sources.',
116
+ remediation: 'Add `weights_only=True`: `torch.load(path, weights_only=True)`. ' +
117
+ 'For full model loading you trust internally, at minimum validate the source integrity before loading.',
118
+ determinism: 'heuristic-advisory',
119
+ confidence: 0.95,
120
+ language: 'python',
121
+ });
122
+ }
123
+ }
124
+ }
125
+ return violations;
126
+ }
127
+ catch {
128
+ return [];
129
+ }
130
+ }
131
+ }
132
+ exports.PY009UnsafePickleDeserialization = PY009UnsafePickleDeserialization;
133
+ //# sourceMappingURL=PY009-unsafe-pickle-deserialization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PY009-unsafe-pickle-deserialization.js","sourceRoot":"","sources":["../../../src/structural-rules/python/PY009-unsafe-pickle-deserialization.ts"],"names":[],"mappings":";;;AAEA,wCAAwC;AACxC,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAE/C,uBAAuB;AACvB,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAE7C,gDAAgD;AAChD,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAC3C,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAExD,4CAA4C;AAC5C,MAAM,YAAY,GAAG,uCAAuC,CAAC;AAE7D,yEAAyE;AACzE,6DAA6D;AAC7D,MAAM,oBAAoB,GAAG,uFAAuF,CAAC;AAErH,MAAa,gCAAgC;IAC3C,EAAE,GAAG,OAAO,CAAC;IACb,IAAI,GAAG,+BAA+B,CAAC;IACvC,SAAS,GAAG,OAAO,CAAC;IACpB,QAAQ,GAAG,UAAmB,CAAC;IAC/B,SAAS,GAAmB,CAAC,QAAQ,CAAC,CAAC;IACvC,WAAW,GACT,wFAAwF;QACxF,8DAA8D,CAAC;IAEjE,KAAK,CAAC,QAAgB,EAAE,UAAkB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AAQ,EAAE,CAAC;4BAC1B,IAAI,EAAE,KAAK,GAAG;gCAAE,KAAK,EAAE,CAAC;iCACnB,IAAI,EAAE,KAAK,GAAG;gCAAE,KAAK,EAAE,CAAC;wBAC/B,CAAC;wBACD,IAAI,KAAK,IAAI,CAAC;4BAAE,MAAM;oBACxB,CAAC;oBAED,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;wBAC1C,UAAU,CAAC,IAAI,CAAC;4BACd,MAAM,EAAE,IAAI,CAAC,EAAE;4BACf,QAAQ,EAAE,IAAI,CAAC,IAAI;4BACnB,SAAS,EAAE,IAAI,CAAC,SAAS;4BACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;4BACvB,QAAQ;4BACR,IAAI,EAAE,CAAC,GAAG,CAAC;4BACX,MAAM,EAAE,CAAC;4BACT,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;4BAC5B,eAAe,EACb,6FAA6F;gCAC7F,0FAA0F;4BAC5F,WAAW,EACT,kEAAkE;gCAClE,uGAAuG;4BACzG,WAAW,EAAE,oBAAoB;4BACjC,UAAU,EAAE,IAAI;4BAChB,QAAQ,EAAE,QAAQ;yBACnB,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;YAED,OAAO,UAAU,CAAC;QACpB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF;AA9HD,4EA8HC"}
@@ -0,0 +1,11 @@
1
+ import { StructuralRule, StructuralViolation, RuleLanguage } from '../types';
2
+ export declare class PY010LeakedAiohttpSession implements StructuralRule {
3
+ id: string;
4
+ name: string;
5
+ policyRef: string;
6
+ severity: "BLOCKING";
7
+ languages: RuleLanguage[];
8
+ description: string;
9
+ check(filePath: string, sourceText: string): StructuralViolation[];
10
+ }
11
+ //# sourceMappingURL=PY010-leaked-aiohttp-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PY010-leaked-aiohttp-session.d.ts","sourceRoot":"","sources":["../../../src/structural-rules/python/PY010-leaked-aiohttp-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAY7E,qBAAa,yBAA0B,YAAW,cAAc;IAC9D,EAAE,SAAW;IACb,IAAI,SAA2D;IAC/D,SAAS,SAAW;IACpB,QAAQ,EAAG,UAAU,CAAU;IAC/B,SAAS,EAAE,YAAY,EAAE,CAAc;IACvC,WAAW,SAC8G;IAEzH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,mBAAmB,EAAE;CAiEnE"}