failproofai 1.0.7-beta.2 → 1.0.7

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 (252) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +4 -4
  4. package/.next/standalone/.next/required-server-files.json +1 -1
  5. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  6. package/.next/standalone/.next/server/app/_global-error/page.js +4 -4
  7. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  8. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
  11. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +6 -6
  12. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  13. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page.js +4 -4
  16. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  19. package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
  20. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
  21. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +14 -14
  22. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  23. package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/audit/run/route.js +7 -8
  25. package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
  33. package/.next/standalone/.next/server/app/audit/page.js +5 -7
  34. package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/index.html +1 -1
  37. package/.next/standalone/.next/server/app/index.rsc +15 -15
  38. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +14 -14
  39. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
  40. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  41. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  42. package/.next/standalone/.next/server/app/page.js +6 -6
  43. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  45. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
  46. package/.next/standalone/.next/server/app/policies/page.js +11 -13
  47. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  50. package/.next/standalone/.next/server/app/project/[name]/page.js +7 -8
  51. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  52. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  53. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  54. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  55. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js +7 -7
  56. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  59. package/.next/standalone/.next/server/app/projects/page.js +6 -7
  60. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  61. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  62. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +8 -41
  63. package/.next/standalone/.next/server/app/settings/page.js +9 -12
  64. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  65. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  66. package/.next/standalone/.next/server/chunks/{[externals]__1j-zsg5._.js → [externals]__1_bftcl._.js} +1 -1
  67. package/.next/standalone/.next/server/chunks/{[externals]__19_pzeq._.js → [externals]__1msfs-h._.js} +1 -1
  68. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l3yhx4._.js +2 -2
  69. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o07qi9._.js +1 -1
  70. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1bf34x4._.js → [root-of-the-server]__1_r2rbg._.js} +7 -5
  71. package/.next/standalone/.next/server/chunks/_09dz7xv._.js +21 -21
  72. package/.next/standalone/.next/server/chunks/_0tovk6q._.js +1 -1
  73. package/.next/standalone/.next/server/chunks/_0trp3yc._.js +1 -1
  74. package/.next/standalone/.next/server/chunks/{_1q5i8mb._.js → _1c3k-8x._.js} +2 -2
  75. package/.next/standalone/.next/server/chunks/_1ek68ln._.js +16 -16
  76. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
  77. package/.next/standalone/.next/server/chunks/src_hooks_0iu54mz._.js +3 -0
  78. package/.next/standalone/.next/server/chunks/src_hooks_custom-hooks-loader_ts_0lnb3n3._.js +2 -4
  79. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-_ki57._.js +4 -0
  80. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__013jr2b._.js +4 -0
  81. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01wy8d-._.js +4 -0
  82. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02npjtd._.js +4 -0
  83. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0l44ual._.js → [root-of-the-server]__0bd3mje._.js} +2 -2
  84. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0cg-bgc._.js +5 -0
  85. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0cpu_mj._.js +3 -0
  86. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1mf3zp6._.js → [root-of-the-server]__0cxe_2_._.js} +3 -3
  87. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0da85px._.js +4 -0
  88. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ftmoxc._.js +4 -0
  89. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p-5p8u._.js +4 -0
  90. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0u3w0ll._.js +22 -0
  91. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__17d_ffl._.js +3 -0
  92. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__19d9tgz._.js +5 -0
  93. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ctpynv._.js +3 -0
  94. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1jiwfsj._.js +3 -0
  95. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1p2otjt._.js +4 -0
  96. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1phc187._.js +3 -0
  97. package/.next/standalone/.next/server/chunks/ssr/_06imw3p._.js +5 -0
  98. package/.next/standalone/.next/server/chunks/ssr/_08x1r5t._.js +1 -1
  99. package/.next/standalone/.next/server/chunks/ssr/{_1w_5l7t._.js → _0h_douw._.js} +1 -1
  100. package/.next/standalone/.next/server/chunks/ssr/{_1mel6y1._.js → _1-i_gzc._.js} +2 -2
  101. package/.next/standalone/.next/server/chunks/ssr/{_1v-jvrv._.js → _166t73i._.js} +1 -1
  102. package/.next/standalone/.next/server/chunks/ssr/{_1q46vxx._.js → _1_qswah._.js} +2 -2
  103. package/.next/standalone/.next/server/chunks/ssr/{_1gb0ifp._.js → _1es2j7i._.js} +5 -5
  104. package/.next/standalone/.next/server/chunks/ssr/_1u8-lu2._.js +3 -0
  105. package/.next/standalone/.next/server/chunks/ssr/_1zopuov._.js +1 -1
  106. package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo.js +2 -2
  107. package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +1 -1
  108. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
  109. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +2 -2
  110. package/.next/standalone/.next/server/chunks/ssr/app_settings_settings-client_tsx_20lq-mq._.js +3 -0
  111. package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_dist_0w6mzq5._.js → node_modules_next_dist_0drixxt._.js} +4 -4
  112. package/.next/standalone/.next/server/chunks/ssr/src_hooks_1cv9_c4._.js +10 -0
  113. package/.next/standalone/.next/server/chunks/ssr/src_hooks_builtin-policies_ts_09j2ndl._.js +1 -1
  114. package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-home_ts_0je3xkv._.js +1 -1
  115. package/.next/standalone/.next/server/chunks/ssr/src_hooks_pack-cli_ts_0t7me65._.js +1 -1
  116. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  117. package/.next/standalone/.next/server/pages/404.html +1 -1
  118. package/.next/standalone/.next/server/pages/500.html +1 -1
  119. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  120. package/.next/standalone/.next/server/server-reference-manifest.json +23 -56
  121. package/.next/standalone/.next/static/chunks/094xgi4owxaqf.js +1 -0
  122. package/.next/standalone/.next/static/chunks/{129ag2bw93bdh.js → 0__8a7m868fvf.js} +1 -1
  123. package/.next/standalone/.next/static/chunks/{3ugmd_7dyn0id.js → 0o6qlkgubtoex.js} +1 -1
  124. package/.next/standalone/.next/static/chunks/{0fqd7m_u81mi5.js → 13i7-9is-vhys.js} +1 -1
  125. package/.next/standalone/.next/static/chunks/1rz20_pz828f3.js +6 -0
  126. package/.next/standalone/.next/static/chunks/2k9f4tyv04809.css +1 -0
  127. package/.next/standalone/.next/static/chunks/{2_pltstd8-xgs.js → 2klitrtzpaoe0.js} +1 -1
  128. package/.next/standalone/.next/static/chunks/{3brze37td_wnc.js → 2mdh397ghgnvv.js} +1 -1
  129. package/.next/standalone/.next/static/chunks/2rshywgeqsyzk.css +2 -0
  130. package/.next/standalone/.next/static/chunks/3pzx4chkhko9k.js +1 -0
  131. package/.next/standalone/.next/static/chunks/3rh5o7e16irrm.js +69 -0
  132. package/.next/standalone/.next/static/chunks/{1qd741hzlmjbo.js → 43ufqrz8qo3h-.js} +1 -1
  133. package/.next/standalone/SECURITY.md +53 -0
  134. package/.next/standalone/app/actions/pack-actions.ts +0 -12
  135. package/.next/standalone/app/policies/hooks-client.tsx +0 -9
  136. package/.next/standalone/app/settings/page.tsx +1 -20
  137. package/.next/standalone/app/settings/settings-client.tsx +1 -27
  138. package/.next/standalone/app/settings/settings.css +0 -79
  139. package/.next/standalone/package.json +10 -10
  140. package/.next/standalone/sdk/typescript/CHANGELOG.md +15 -1
  141. package/.next/standalone/sdk/typescript/integration/fixtures/ai-4/package-lock.json +10 -30
  142. package/.next/standalone/sdk/typescript/integration/fixtures/ai-4/package.json +3 -0
  143. package/.next/standalone/sdk/typescript/integration/fixtures/ai-5/package-lock.json +4 -16
  144. package/.next/standalone/sdk/typescript/integration/fixtures/ai-5/package.json +3 -0
  145. package/.next/standalone/sdk/typescript/integration/fixtures/langchain-0.3/package-lock.json +13 -132
  146. package/.next/standalone/sdk/typescript/integration/fixtures/langchain-0.3/package.json +4 -0
  147. package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/package-lock.json +4 -142
  148. package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/package.json +4 -0
  149. package/.next/standalone/sdk/typescript/integration/fixtures/mastra-0/package-lock.json +1396 -1016
  150. package/.next/standalone/sdk/typescript/integration/fixtures/mastra-0/package.json +9 -0
  151. package/.next/standalone/server.js +1 -1
  152. package/README.md +2 -2
  153. package/bin/failproofai.mjs +2 -115
  154. package/dist/cli.mjs +6543 -13872
  155. package/dist/index.js +1 -19
  156. package/dist/worker.mjs +2022 -8055
  157. package/package.json +10 -10
  158. package/pi-extension/index.ts +0 -11
  159. package/scripts/build-policy-pack.mjs +2 -53
  160. package/src/audit/features.ts +2 -3
  161. package/src/hooks/builtin-policies.ts +8 -177
  162. package/src/hooks/cloud-enrollment-cli.ts +1 -1
  163. package/src/hooks/cloud-managed-policies.ts +0 -22
  164. package/src/hooks/custom-hooks-loader.ts +7 -45
  165. package/src/hooks/custom-hooks-registry.ts +1 -45
  166. package/src/hooks/first-run-gate.ts +0 -5
  167. package/src/hooks/fp-home.ts +0 -23
  168. package/src/hooks/handler.ts +6 -265
  169. package/src/hooks/hook-activity-store.ts +1 -105
  170. package/src/hooks/hook-telemetry.ts +0 -41
  171. package/src/hooks/loader-utils.ts +0 -6
  172. package/src/hooks/manager.ts +1 -1
  173. package/src/hooks/pack-cli.ts +19 -412
  174. package/src/hooks/pack-manifest.ts +7 -479
  175. package/src/hooks/pack-store.ts +11 -157
  176. package/src/hooks/policy-catalog.ts +0 -204
  177. package/src/hooks/policy-evaluator.ts +796 -940
  178. package/src/hooks/policy-registry.ts +0 -25
  179. package/src/hooks/policy-types.ts +0 -126
  180. package/src/hooks/types.ts +1 -1
  181. package/src/hooks/worker-server.ts +26 -119
  182. package/src/index.ts +0 -6
  183. package/.next/standalone/.next/server/chunks/src_hooks_01frwmb._.js +0 -5
  184. package/.next/standalone/.next/server/chunks/src_hooks_18qtd42._.js +0 -3
  185. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01bmjsj._.js +0 -3
  186. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04usis8._.js +0 -4
  187. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__056wjo4._.js +0 -4
  188. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__059yza8._.js +0 -3
  189. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0eip4_k._.js +0 -22
  190. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n0xg95._.js +0 -4
  191. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qcb0mg._.js +0 -3
  192. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qxnccm._.js +0 -5
  193. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rwtwpm._.js +0 -4
  194. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s_yomn._.js +0 -4
  195. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0soxz2z._.js +0 -3
  196. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0yrsbd_._.js +0 -3
  197. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11mayhe._.js +0 -4
  198. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13d-wb6._.js +0 -3
  199. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1dinjii._.js +0 -3
  200. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1pprgri._.js +0 -4
  201. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1q4p5b8._.js +0 -4
  202. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1qiz0e4._.js +0 -3
  203. package/.next/standalone/.next/server/chunks/ssr/_042cgl1._.js +0 -3
  204. package/.next/standalone/.next/server/chunks/ssr/_0bqoto4._.js +0 -3
  205. package/.next/standalone/.next/server/chunks/ssr/_0uyu3jf._.js +0 -3
  206. package/.next/standalone/.next/server/chunks/ssr/_1feuvhb._.js +0 -5
  207. package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9sni._.js +0 -3
  208. package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h4._.js +0 -3
  209. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_18_d8l1._.js +0 -151
  210. package/.next/standalone/.next/server/chunks/ssr/src_hooks_095a_79._.js +0 -5
  211. package/.next/standalone/.next/server/chunks/ssr/src_hooks_15t8kqj._.js +0 -3
  212. package/.next/standalone/.next/server/chunks/ssr/src_hooks_18k8rl0._.js +0 -12
  213. package/.next/standalone/.next/server/chunks/ssr/src_hooks_1fm2w5z._.js +0 -3
  214. package/.next/standalone/.next/server/chunks/ssr/src_hooks_1j0zy3v._.js +0 -3
  215. package/.next/standalone/.next/static/chunks/043j99m8ykg__.css +0 -2
  216. package/.next/standalone/.next/static/chunks/2c8j9l6j_b1ci.js +0 -1
  217. package/.next/standalone/.next/static/chunks/2qv4hshejedtx.css +0 -1
  218. package/.next/standalone/.next/static/chunks/3-k569wzcli8q.js +0 -1
  219. package/.next/standalone/.next/static/chunks/3otmypm6j_xfo.js +0 -6
  220. package/.next/standalone/.next/static/chunks/3yxro_r2_o9ad.js +0 -69
  221. package/.next/standalone/PROBE-FOLLOWUP.md +0 -186
  222. package/.next/standalone/app/actions/get-jev-config.ts +0 -424
  223. package/.next/standalone/app/actions/update-jev-config.ts +0 -420
  224. package/.next/standalone/app/components/jev-notices.tsx +0 -96
  225. package/.next/standalone/app/settings/jev-panel.tsx +0 -473
  226. package/src/hooks/effective-reviewers.ts +0 -79
  227. package/src/hooks/jev-activity.ts +0 -385
  228. package/src/hooks/jev-cli.ts +0 -1249
  229. package/src/hooks/policy-authority.ts +0 -333
  230. package/src/hooks/policy-reviewability.ts +0 -229
  231. package/src/hooks/semantic/combine.ts +0 -541
  232. package/src/hooks/semantic/compile.ts +0 -176
  233. package/src/hooks/semantic/decide.ts +0 -392
  234. package/src/hooks/semantic/envelope.ts +0 -1296
  235. package/src/hooks/semantic/evaluator.ts +0 -547
  236. package/src/hooks/semantic/facts.ts +0 -292
  237. package/src/hooks/semantic/intent.ts +0 -1190
  238. package/src/hooks/semantic/jev-client.ts +0 -643
  239. package/src/hooks/semantic/jev-config.ts +0 -594
  240. package/src/hooks/semantic/jev-review.ts +0 -374
  241. package/src/hooks/semantic/jev-stats.ts +0 -289
  242. package/src/hooks/semantic/jev-throttle.ts +0 -421
  243. package/src/hooks/semantic/pack-policies.ts +0 -251
  244. package/src/hooks/semantic/policies.ts +0 -596
  245. package/src/hooks/semantic/precondition-names.ts +0 -60
  246. package/src/hooks/semantic/preconditions.ts +0 -58
  247. package/src/hooks/semantic/redact.ts +0 -2910
  248. package/src/hooks/semantic/types.ts +0 -145
  249. package/src/hooks/semver-precedence.ts +0 -128
  250. /package/.next/standalone/.next/static/{gbEOjBgZAxF2UIUwZVHNu → PgeWCHmyVbjRznv2VO7KF}/_buildManifest.js +0 -0
  251. /package/.next/standalone/.next/static/{gbEOjBgZAxF2UIUwZVHNu → PgeWCHmyVbjRznv2VO7KF}/_clientMiddlewareManifest.js +0 -0
  252. /package/.next/standalone/.next/static/{gbEOjBgZAxF2UIUwZVHNu → PgeWCHmyVbjRznv2VO7KF}/_ssgManifest.js +0 -0
@@ -35,17 +35,8 @@
35
35
  import { createHash } from "node:crypto";
36
36
  import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
37
37
  import { dirname, resolve } from "node:path";
38
- import {
39
- MAX_SEMANTIC_POLICIES_PER_PACK,
40
- PACK_COMMIT_RE,
41
- checkPackMinCliVersion,
42
- packsRoot,
43
- parsePackIdentity,
44
- parsePackPolicy,
45
- parsePackSemanticPolicy,
46
- readInstalledPacks,
47
- } from "./pack-manifest";
48
- import type { ResolvedPack, SemanticManifestEntry } from "./pack-manifest";
38
+ import { PACK_COMMIT_RE, packsRoot, parsePackIdentity, parsePackPolicy, readInstalledPacks } from "./pack-manifest";
39
+ import type { ResolvedPack } from "./pack-manifest";
49
40
  import type { InstalledPackRecord } from "./pack-manifest";
50
41
  import type { PolicyCatalogEntry } from "./policy-types";
51
42
  import type { PolicyEffect } from "./cloud-managed-policies";
@@ -95,13 +86,6 @@ export interface AddPackResult {
95
86
  selection: SelectionReason;
96
87
  /** Category slugs the pack offers, for `--category`. */
97
88
  categories: string[];
98
- /**
99
- * How many Jev question sets came with it, and not a list of names: they are
100
- * not selectable and not switchable, so a name here would invite a `--policy`
101
- * that cannot work. A non-zero count is what stops a semantic-only install
102
- * reporting "the pack is installed and enforcing nothing".
103
- */
104
- semantic: number;
105
89
  artifact: string;
106
90
  }
107
91
 
@@ -470,10 +454,6 @@ interface FetchedPack {
470
454
  id: string;
471
455
  version: string;
472
456
  policies: PolicyCatalogEntry[];
473
- /** The pack's Jev question sets, validated. Empty when it declares none. */
474
- semantic: SemanticManifestEntry[];
475
- /** The minimum CLI it claims, once this one has been checked against it. */
476
- minCliVersion?: string;
477
457
  effect?: PolicyEffect;
478
458
  /** The git commit the publisher built this from, when they had one. */
479
459
  commit?: string;
@@ -481,66 +461,6 @@ interface FetchedPack {
481
461
  artifactDigest: string;
482
462
  }
483
463
 
484
- /**
485
- * The shape both fetch paths read a manifest's `semantic` array through.
486
- *
487
- * REFUSES what the loader would only drop, and the asymmetry is the same one
488
- * `parsePackPolicy` already has on this path: nothing has been written yet, so
489
- * refusing costs the user a clear error message and the publisher a fix —
490
- * whereas dropping an entry here would install a pack that enforces less than
491
- * the preview just showed, with the difference recorded only in a hook log. The
492
- * loader drops instead because by then the pack IS installed and refusing it
493
- * denies every tool call its regex policies cover.
494
- *
495
- * The per-pack cap is checked for the same reason. Over it, the loader keeps the
496
- * first 24 in declared order and records the rest as dropped; letting that
497
- * happen silently at install time means a machine quietly running a subset of
498
- * what the user agreed to.
499
- *
500
- * The CHARACTER budget is deliberately not checked here. It lives in
501
- * `semantic/pack-policies.ts`, and importing that module would pull Jev's
502
- * sixteen prompts into this one — which is reachable from a Next.js server
503
- * action (`app/actions/pack-actions.ts`), not just from the CLI. `failproofai
504
- * publish` refuses an over-budget pack at build time, and a pack built by some
505
- * other tool has its overflow dropped at resolve time with a recorded reason.
506
- */
507
- function parseManifestSemantic(packId: string, value: unknown): SemanticManifestEntry[] {
508
- if (value === undefined) return [];
509
- if (!Array.isArray(value)) throw new Error(`pack ${packId} semantic is not an array`);
510
- if (value.length > MAX_SEMANTIC_POLICIES_PER_PACK) {
511
- throw new Error(
512
- `pack ${packId} declares ${value.length} semantic policies, over the cap of ${MAX_SEMANTIC_POLICIES_PER_PACK}`,
513
- );
514
- }
515
- const entries = value.map((entry, i) => parsePackSemanticPolicy(packId, entry, i));
516
- const names = new Set<string>();
517
- for (const entry of entries) {
518
- if (names.has(entry.name)) throw new Error(`pack ${packId} declares semantic policy ${entry.name} twice`);
519
- names.add(entry.name);
520
- }
521
- return entries;
522
- }
523
-
524
- /**
525
- * Refuse a pack this CLI is too old to run — HERE, where the message is
526
- * something the person who typed the command can act on.
527
- *
528
- * The loader refuses it too, and that refusal is the fail-closed one: on a
529
- * machine where it lands, every tool call the pack's policies cover is denied
530
- * until somebody works out why. Catching it at install turns the same fact into
531
- * one line at the moment of choosing.
532
- *
533
- * A minimum this build cannot compare is IGNORED, exactly as the loader ignores
534
- * it: a publisher's typo in a version string must not be able to stop anyone
535
- * installing a pack. `failproofai publish` refuses to write one, so this is
536
- * only reachable from a pack built by some other tool.
537
- */
538
- function assertMinCliVersion(packId: string, declared: unknown): string | undefined {
539
- const verdict = checkPackMinCliVersion(packId, declared);
540
- if (verdict.kind === "too-old") throw new Error(verdict.reason);
541
- return verdict.kind === "satisfied" ? verdict.declared : undefined;
542
- }
543
-
544
464
  /** Fetch and fully validate a pack, without writing anything. */
545
465
  /**
546
466
  * The short names for the pack Failproof AI publishes.
@@ -623,19 +543,6 @@ export interface PackPreview {
623
543
  /** The git commit the publisher built this from, when they had one. */
624
544
  commit?: string;
625
545
  policies: PolicyCatalogEntry[];
626
- /**
627
- * The pack's Jev question sets. Shown, not selectable: a pack's `enabled`
628
- * narrowing picks which of its REGEX policies register, and its semantic set
629
- * replaces this build's wholesale or not at all.
630
- *
631
- * Carried on the preview because the preview is what somebody consents to. A
632
- * pack that quietly brings sixteen new questions to the classifier — and
633
- * replaces the sixteen this build shipped — is not something to discover after
634
- * installing it.
635
- */
636
- semantic: SemanticManifestEntry[];
637
- /** The minimum CLI this pack declares, when it declares one this build can read. */
638
- minCliVersion?: string;
639
546
  /** The exact source the preview was read from, tag resolved and pinned. */
640
547
  source: string;
641
548
  /** True when the tag was resolved rather than typed. */
@@ -682,52 +589,22 @@ export async function fetchPackPreview(source: string): Promise<PackPreview> {
682
589
  if (!raw || typeof raw !== "object") throw new Error(`${PACK_MANIFEST_ASSET} is not an object`);
683
590
  const value = raw as {
684
591
  id?: unknown; version?: unknown; policies?: unknown; effect?: unknown; commit?: unknown;
685
- semantic?: unknown; minCliVersion?: unknown;
686
592
  };
687
593
  const identity = parsePackIdentity(value);
688
- const minCliVersion = assertMinCliVersion(identity.id, value.minCliVersion);
689
- const semantic = parseManifestSemantic(identity.id, value.semantic);
690
- const policies = parseManifestPolicies(identity.id, value.policies);
691
- assertDeclaresSomething(policies, semantic);
594
+ if (!Array.isArray(value.policies) || value.policies.length === 0) {
595
+ throw new Error("pack manifest declares no policies");
596
+ }
692
597
  return {
693
598
  id: identity.id,
694
599
  version: identity.version,
695
600
  effect: identity.effect,
696
601
  ...(identity.commit ? { commit: identity.commit } : {}),
697
- policies,
698
- semantic,
699
- ...(minCliVersion ? { minCliVersion } : {}),
602
+ policies: value.policies.map((policy, i) => parsePackPolicy(identity.id, policy, i)),
700
603
  source: formatPackSpec(spec),
701
604
  resolvedFromLatest,
702
605
  };
703
606
  }
704
607
 
705
- /**
706
- * The regex half of a manifest. ABSENT is an empty list, not an error: a pack of
707
- * Jev questions alone is a legitimate thing to publish now, and ours writes
708
- * `policies: []` for one. Present and not an array is still malformed.
709
- */
710
- function parseManifestPolicies(packId: string, value: unknown): PolicyCatalogEntry[] {
711
- if (value === undefined) return [];
712
- if (!Array.isArray(value)) throw new Error(`pack ${packId} policies is not an array`);
713
- return value.map((policy, i) => parsePackPolicy(packId, policy, i));
714
- }
715
-
716
- /**
717
- * A pack has to bring SOMETHING, and either half counts.
718
- *
719
- * It used to be "at least one regex policy", which made a pack of Jev questions
720
- * alone impossible to install — and that is a legitimate pack: the regex floor
721
- * may already be somebody else's, and the two halves version independently. This
722
- * is the same widening `build()` makes to its "registered no policies" refusal,
723
- * so the two ends of the lane agree on what an empty pack is.
724
- */
725
- function assertDeclaresSomething(policies: PolicyCatalogEntry[], semantic: SemanticManifestEntry[]): void {
726
- if (policies.length === 0 && semantic.length === 0) {
727
- throw new Error("pack manifest declares no policies");
728
- }
729
- }
730
-
731
608
  /**
732
609
  * The record this install is really an update OF — matched by id, or failing
733
610
  * that by artifact digest.
@@ -770,26 +647,20 @@ async function fetchPack(spec: PinnedPackSpec): Promise<FetchedPack> {
770
647
  if (!parsed || typeof parsed !== "object") throw new Error(`${PACK_MANIFEST_ASSET} is not an object`);
771
648
  const raw = parsed as {
772
649
  id?: unknown; version?: unknown; policies?: unknown; effect?: unknown; commit?: unknown;
773
- semantic?: unknown; minCliVersion?: unknown;
774
650
  };
775
651
  const identity = parsePackIdentity(raw);
776
- // Before the shape checks below, because being too old for the pack is not a
777
- // complaint about the pack: the message to give is "update the CLI", and a
778
- // manifest field this build cannot read yet must not be reported as malformed.
779
- const minCliVersion = assertMinCliVersion(identity.id, raw.minCliVersion);
652
+ if (!Array.isArray(raw.policies) || raw.policies.length === 0) {
653
+ throw new Error("pack manifest declares no policies");
654
+ }
780
655
  // Validated with the SAME rules the loader applies, so a pack that could never
781
656
  // load is refused here — while nothing has been written — rather than
782
657
  // installing cleanly and failing silently on the next tool call.
783
- const policies = parseManifestPolicies(identity.id, raw.policies);
784
- const semantic = parseManifestSemantic(identity.id, raw.semantic);
785
- assertDeclaresSomething(policies, semantic);
658
+ const policies = raw.policies.map((p, i) => parsePackPolicy(identity.id, p, i));
786
659
 
787
660
  return {
788
661
  id: identity.id,
789
662
  version: identity.version,
790
663
  policies,
791
- semantic,
792
- ...(minCliVersion ? { minCliVersion } : {}),
793
664
  ...(raw.effect !== undefined ? { effect: identity.effect } : {}),
794
665
  ...(identity.commit ? { commit: identity.commit } : {}),
795
666
  artifact,
@@ -814,7 +685,7 @@ export function slugifyCategory(category: string): string {
814
685
  *
815
686
  * The default is the pack's OWN `defaultEnabled` set, not everything. A pack
816
687
  * carries an opinion about which of its policies are safe to switch on
817
- * unattended — for the builtins that is 10 of 39 — and installing the whole
688
+ * unattended — for the builtins that is 10 of 38 — and installing the whole
818
689
  * thing overrode that opinion with one nobody held. `block-kubectl`,
819
690
  * `block-terraform` and `require-ci-green-before-stop` are off by default in the
820
691
  * npm package precisely because they interrupt legitimate work.
@@ -1060,22 +931,6 @@ export async function addPack(
1060
931
  entry: artifactRel,
1061
932
  sha256: fetched.artifactDigest,
1062
933
  policies: fetched.policies,
1063
- // Both halves of the manifest reach the record, because `installed.json` is
1064
- // the only thing enforcement reads. Left off, a pack's Jev questions were
1065
- // fetched, verified, shown in the preview and then dropped on the floor: the
1066
- // resolver found no `semantic` on any installed pack, kept this build's
1067
- // compiled set, and every pack policy naming one of the pack's own checks in
1068
- // `reviewedBy` registered as hard. Nothing failed, and the half the user
1069
- // installed did nothing.
1070
- //
1071
- // Omitted when empty for the same reason the manifest omits it: an empty
1072
- // array reads as "this pack declares semantic entries", and the replacement
1073
- // rule would then have it replace the compiled-in set with nothing.
1074
- ...(fetched.semantic.length > 0 ? { semantic: fetched.semantic } : {}),
1075
- // Recorded so the READER re-checks it. This CLI has already satisfied it or
1076
- // refused the install, but the record outlives this CLI: a downgrade, or a
1077
- // machine restored from another's home directory, has to meet it again.
1078
- ...(fetched.minCliVersion ? { minCliVersion: fetched.minCliVersion } : {}),
1079
934
  // Provenance, carried through from the manifest so `policies` and the
1080
935
  // dashboard can say which source produced what is installed. NOT part of
1081
936
  // verification — `sha256` above is the pin, and this is a label beside it.
@@ -1123,7 +978,6 @@ export async function addPack(
1123
978
  available,
1124
979
  selection: reason,
1125
980
  categories: [...new Set(fetched.policies.map((p) => slugifyCategory(p.category)))],
1126
- semantic: fetched.semantic.length,
1127
981
  artifact: artifactAbs,
1128
982
  };
1129
983
  }