hex-audit 0.4.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 (486) hide show
  1. package/CLAUDE.md +105 -0
  2. package/DEMO.md +141 -0
  3. package/README.md +378 -0
  4. package/dashboard/.next/BUILD_ID +1 -0
  5. package/dashboard/.next/app-build-manifest.json +99 -0
  6. package/dashboard/.next/app-path-routes-manifest.json +1 -0
  7. package/dashboard/.next/build-manifest.json +32 -0
  8. package/dashboard/.next/cache/.tsbuildinfo +1 -0
  9. package/dashboard/.next/cache/webpack/client-production/0.pack +0 -0
  10. package/dashboard/.next/cache/webpack/client-production/index.pack +0 -0
  11. package/dashboard/.next/cache/webpack/edge-server-production/0.pack +0 -0
  12. package/dashboard/.next/cache/webpack/edge-server-production/index.pack +0 -0
  13. package/dashboard/.next/cache/webpack/server-production/0.pack +0 -0
  14. package/dashboard/.next/cache/webpack/server-production/1.pack +0 -0
  15. package/dashboard/.next/cache/webpack/server-production/2.pack +0 -0
  16. package/dashboard/.next/cache/webpack/server-production/index.pack +0 -0
  17. package/dashboard/.next/cache/webpack/server-production/index.pack.old +0 -0
  18. package/dashboard/.next/export-marker.json +1 -0
  19. package/dashboard/.next/images-manifest.json +1 -0
  20. package/dashboard/.next/next-minimal-server.js.nft.json +1 -0
  21. package/dashboard/.next/next-server.js.nft.json +1 -0
  22. package/dashboard/.next/package.json +1 -0
  23. package/dashboard/.next/prerender-manifest.js +1 -0
  24. package/dashboard/.next/prerender-manifest.json +1 -0
  25. package/dashboard/.next/react-loadable-manifest.json +300 -0
  26. package/dashboard/.next/required-server-files.json +1 -0
  27. package/dashboard/.next/routes-manifest.json +1 -0
  28. package/dashboard/.next/server/app/_not-found/page.js +1 -0
  29. package/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -0
  30. package/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
  31. package/dashboard/.next/server/app/_not-found.html +1 -0
  32. package/dashboard/.next/server/app/_not-found.meta +6 -0
  33. package/dashboard/.next/server/app/_not-found.rsc +12 -0
  34. package/dashboard/.next/server/app/access/page.js +1 -0
  35. package/dashboard/.next/server/app/access/page.js.nft.json +1 -0
  36. package/dashboard/.next/server/app/access/page_client-reference-manifest.js +1 -0
  37. package/dashboard/.next/server/app/access.html +1 -0
  38. package/dashboard/.next/server/app/access.meta +5 -0
  39. package/dashboard/.next/server/app/access.rsc +8 -0
  40. package/dashboard/.next/server/app/api/code/route.js +1 -0
  41. package/dashboard/.next/server/app/api/code/route.js.nft.json +1 -0
  42. package/dashboard/.next/server/app/api/flows/route.js +1 -0
  43. package/dashboard/.next/server/app/api/flows/route.js.nft.json +1 -0
  44. package/dashboard/.next/server/app/api/flows.body +1 -0
  45. package/dashboard/.next/server/app/api/flows.meta +1 -0
  46. package/dashboard/.next/server/app/api/github-status/route.js +1 -0
  47. package/dashboard/.next/server/app/api/github-status/route.js.nft.json +1 -0
  48. package/dashboard/.next/server/app/api/issues/[id]/move/route.js +1 -0
  49. package/dashboard/.next/server/app/api/issues/[id]/move/route.js.nft.json +1 -0
  50. package/dashboard/.next/server/app/api/issues/[id]/route.js +1 -0
  51. package/dashboard/.next/server/app/api/issues/[id]/route.js.nft.json +1 -0
  52. package/dashboard/.next/server/app/api/mermaid/route.js +1 -0
  53. package/dashboard/.next/server/app/api/mermaid/route.js.nft.json +1 -0
  54. package/dashboard/.next/server/app/api/progress/route.js +1 -0
  55. package/dashboard/.next/server/app/api/progress/route.js.nft.json +1 -0
  56. package/dashboard/.next/server/app/api/watch/route.js +3 -0
  57. package/dashboard/.next/server/app/api/watch/route.js.nft.json +1 -0
  58. package/dashboard/.next/server/app/calls/page.js +1 -0
  59. package/dashboard/.next/server/app/calls/page.js.nft.json +1 -0
  60. package/dashboard/.next/server/app/calls/page_client-reference-manifest.js +1 -0
  61. package/dashboard/.next/server/app/calls.html +1 -0
  62. package/dashboard/.next/server/app/calls.meta +5 -0
  63. package/dashboard/.next/server/app/calls.rsc +8 -0
  64. package/dashboard/.next/server/app/conformance/page.js +1 -0
  65. package/dashboard/.next/server/app/conformance/page.js.nft.json +1 -0
  66. package/dashboard/.next/server/app/conformance/page_client-reference-manifest.js +1 -0
  67. package/dashboard/.next/server/app/conformance.html +1 -0
  68. package/dashboard/.next/server/app/conformance.meta +5 -0
  69. package/dashboard/.next/server/app/conformance.rsc +8 -0
  70. package/dashboard/.next/server/app/diagram/page.js +1 -0
  71. package/dashboard/.next/server/app/diagram/page.js.nft.json +1 -0
  72. package/dashboard/.next/server/app/diagram/page_client-reference-manifest.js +1 -0
  73. package/dashboard/.next/server/app/diagram.html +1 -0
  74. package/dashboard/.next/server/app/diagram.meta +5 -0
  75. package/dashboard/.next/server/app/diagram.rsc +10 -0
  76. package/dashboard/.next/server/app/flows/page.js +1 -0
  77. package/dashboard/.next/server/app/flows/page.js.nft.json +1 -0
  78. package/dashboard/.next/server/app/flows/page_client-reference-manifest.js +1 -0
  79. package/dashboard/.next/server/app/flows.html +1 -0
  80. package/dashboard/.next/server/app/flows.meta +5 -0
  81. package/dashboard/.next/server/app/flows.rsc +10 -0
  82. package/dashboard/.next/server/app/functions/page.js +1 -0
  83. package/dashboard/.next/server/app/functions/page.js.nft.json +1 -0
  84. package/dashboard/.next/server/app/functions/page_client-reference-manifest.js +1 -0
  85. package/dashboard/.next/server/app/functions.html +1 -0
  86. package/dashboard/.next/server/app/functions.meta +5 -0
  87. package/dashboard/.next/server/app/functions.rsc +8 -0
  88. package/dashboard/.next/server/app/icon.svg/route.js +12 -0
  89. package/dashboard/.next/server/app/icon.svg/route.js.nft.json +1 -0
  90. package/dashboard/.next/server/app/icon.svg.body +18 -0
  91. package/dashboard/.next/server/app/icon.svg.meta +1 -0
  92. package/dashboard/.next/server/app/index.html +1 -0
  93. package/dashboard/.next/server/app/index.meta +5 -0
  94. package/dashboard/.next/server/app/index.rsc +9 -0
  95. package/dashboard/.next/server/app/issues/page.js +1 -0
  96. package/dashboard/.next/server/app/issues/page.js.nft.json +1 -0
  97. package/dashboard/.next/server/app/issues/page_client-reference-manifest.js +1 -0
  98. package/dashboard/.next/server/app/issues.html +1 -0
  99. package/dashboard/.next/server/app/issues.meta +5 -0
  100. package/dashboard/.next/server/app/issues.rsc +8 -0
  101. package/dashboard/.next/server/app/page.js +20 -0
  102. package/dashboard/.next/server/app/page.js.nft.json +1 -0
  103. package/dashboard/.next/server/app/page_client-reference-manifest.js +1 -0
  104. package/dashboard/.next/server/app/progress/page.js +1 -0
  105. package/dashboard/.next/server/app/progress/page.js.nft.json +1 -0
  106. package/dashboard/.next/server/app/progress/page_client-reference-manifest.js +1 -0
  107. package/dashboard/.next/server/app/progress.html +1 -0
  108. package/dashboard/.next/server/app/progress.meta +5 -0
  109. package/dashboard/.next/server/app/progress.rsc +8 -0
  110. package/dashboard/.next/server/app/stats/page.js +1 -0
  111. package/dashboard/.next/server/app/stats/page.js.nft.json +1 -0
  112. package/dashboard/.next/server/app/stats/page_client-reference-manifest.js +1 -0
  113. package/dashboard/.next/server/app/stats.html +1 -0
  114. package/dashboard/.next/server/app/stats.meta +5 -0
  115. package/dashboard/.next/server/app/stats.rsc +8 -0
  116. package/dashboard/.next/server/app-paths-manifest.json +22 -0
  117. package/dashboard/.next/server/chunks/431.js +1 -0
  118. package/dashboard/.next/server/chunks/557.js +1 -0
  119. package/dashboard/.next/server/chunks/645.js +6 -0
  120. package/dashboard/.next/server/chunks/649.js +2 -0
  121. package/dashboard/.next/server/chunks/665.js +13 -0
  122. package/dashboard/.next/server/chunks/786.js +12 -0
  123. package/dashboard/.next/server/chunks/818.js +6 -0
  124. package/dashboard/.next/server/chunks/916.js +2 -0
  125. package/dashboard/.next/server/chunks/font-manifest.json +1 -0
  126. package/dashboard/.next/server/font-manifest.json +1 -0
  127. package/dashboard/.next/server/functions-config-manifest.json +1 -0
  128. package/dashboard/.next/server/interception-route-rewrite-manifest.js +1 -0
  129. package/dashboard/.next/server/middleware-build-manifest.js +1 -0
  130. package/dashboard/.next/server/middleware-manifest.json +6 -0
  131. package/dashboard/.next/server/middleware-react-loadable-manifest.js +1 -0
  132. package/dashboard/.next/server/next-font-manifest.js +1 -0
  133. package/dashboard/.next/server/next-font-manifest.json +1 -0
  134. package/dashboard/.next/server/pages/404.html +1 -0
  135. package/dashboard/.next/server/pages/500.html +1 -0
  136. package/dashboard/.next/server/pages/_app.js +1 -0
  137. package/dashboard/.next/server/pages/_app.js.nft.json +1 -0
  138. package/dashboard/.next/server/pages/_document.js +1 -0
  139. package/dashboard/.next/server/pages/_document.js.nft.json +1 -0
  140. package/dashboard/.next/server/pages/_error.js +1 -0
  141. package/dashboard/.next/server/pages/_error.js.nft.json +1 -0
  142. package/dashboard/.next/server/pages-manifest.json +1 -0
  143. package/dashboard/.next/server/server-reference-manifest.js +1 -0
  144. package/dashboard/.next/server/server-reference-manifest.json +1 -0
  145. package/dashboard/.next/server/webpack-runtime.js +1 -0
  146. package/dashboard/.next/static/0IZAlhEwk5-v4myUvWKBd/_buildManifest.js +1 -0
  147. package/dashboard/.next/static/0IZAlhEwk5-v4myUvWKBd/_ssgManifest.js +1 -0
  148. package/dashboard/.next/static/chunks/1.8868c4d131111be7.js +36 -0
  149. package/dashboard/.next/static/chunks/1015.3ab89142e5f44120.js +226 -0
  150. package/dashboard/.next/static/chunks/1151.b6ef5c786e587ed7.js +1 -0
  151. package/dashboard/.next/static/chunks/1199.a072929dbec89965.js +148 -0
  152. package/dashboard/.next/static/chunks/1375.d4d2f7fc9c9c2ff1.js +43 -0
  153. package/dashboard/.next/static/chunks/1799.83206776abbbf1fc.js +9 -0
  154. package/dashboard/.next/static/chunks/20154aaa.ccc347c04ab5ad4a.js +1 -0
  155. package/dashboard/.next/static/chunks/2077.7011a570c87aa7b1.js +1 -0
  156. package/dashboard/.next/static/chunks/2166.cc0fabeb2e89b840.js +215 -0
  157. package/dashboard/.next/static/chunks/2291.85a70cb0c228157b.js +29 -0
  158. package/dashboard/.next/static/chunks/2325.2c55cb9a6282ae3f.js +24 -0
  159. package/dashboard/.next/static/chunks/2383.62c035a052272594.js +1 -0
  160. package/dashboard/.next/static/chunks/2694.92bbe252063e4786.js +1 -0
  161. package/dashboard/.next/static/chunks/275.0d761aa0e5b030b8.js +34 -0
  162. package/dashboard/.next/static/chunks/2781.8536b644a480aede.js +93 -0
  163. package/dashboard/.next/static/chunks/2805.a8d71d2f92bb6ba9.js +1 -0
  164. package/dashboard/.next/static/chunks/2879.51436986f93981d9.js +1 -0
  165. package/dashboard/.next/static/chunks/3017.e55781da9dd32d37.js +1 -0
  166. package/dashboard/.next/static/chunks/3205-728c260fbb4f89c6.js +2 -0
  167. package/dashboard/.next/static/chunks/3236.dff44fa7961d9d5e.js +1 -0
  168. package/dashboard/.next/static/chunks/3480.9451396ad7ee7613.js +1 -0
  169. package/dashboard/.next/static/chunks/3626.ba1cf848a9f2e93d.js +64 -0
  170. package/dashboard/.next/static/chunks/3865.a432a7910a2f5281.js +90 -0
  171. package/dashboard/.next/static/chunks/3887.c22cbfa3f095826c.js +1 -0
  172. package/dashboard/.next/static/chunks/3924-4a05057b5450abe1.js +1 -0
  173. package/dashboard/.next/static/chunks/3948.fe3c7d758568d98b.js +287 -0
  174. package/dashboard/.next/static/chunks/4728.07d87640a3e7dd0d.js +24 -0
  175. package/dashboard/.next/static/chunks/4787.4e5f6a0e0e40a583.js +23 -0
  176. package/dashboard/.next/static/chunks/5060.baca226af35ed016.js +1 -0
  177. package/dashboard/.next/static/chunks/5284.f949ac90c95ff143.js +1 -0
  178. package/dashboard/.next/static/chunks/5715.1524bcc9591e180b.js +115 -0
  179. package/dashboard/.next/static/chunks/6014.700ae4969b64d728.js +104 -0
  180. package/dashboard/.next/static/chunks/6024.4d23707c65514679.js +79 -0
  181. package/dashboard/.next/static/chunks/6052.033a6f1013c666eb.js +141 -0
  182. package/dashboard/.next/static/chunks/6177.e5c84cfc4c0dea51.js +1 -0
  183. package/dashboard/.next/static/chunks/618f8807-547c5614e1318888.js +1 -0
  184. package/dashboard/.next/static/chunks/6434.9481771c33195d29.js +1 -0
  185. package/dashboard/.next/static/chunks/6468.f4a3e8fa6accc6da.js +77 -0
  186. package/dashboard/.next/static/chunks/6540.86f367d7390738d4.js +1 -0
  187. package/dashboard/.next/static/chunks/6549.4d0d472df96429a5.js +1 -0
  188. package/dashboard/.next/static/chunks/690f35d0.3e40ca0930e4bbdb.js +119 -0
  189. package/dashboard/.next/static/chunks/7020.831e16e26d91abc1.js +166 -0
  190. package/dashboard/.next/static/chunks/7397-f6f4dddc7a20bfc1.js +1 -0
  191. package/dashboard/.next/static/chunks/7498-ea83cb9e30ec5491.js +1 -0
  192. package/dashboard/.next/static/chunks/7802.89aec9ee11680850.js +80 -0
  193. package/dashboard/.next/static/chunks/7973.8b526f589aca5d84.js +79 -0
  194. package/dashboard/.next/static/chunks/7a04ac15.1c6cea694301806c.js +62 -0
  195. package/dashboard/.next/static/chunks/8216.1bead812eb126c35.js +5 -0
  196. package/dashboard/.next/static/chunks/8233babc.780b8e272eda298f.js +92 -0
  197. package/dashboard/.next/static/chunks/8452-e616b5f43bceb95f.js +13 -0
  198. package/dashboard/.next/static/chunks/8645.a5ca76f11edc9633.js +1 -0
  199. package/dashboard/.next/static/chunks/8928-60c623ee89d2e6ad.js +1 -0
  200. package/dashboard/.next/static/chunks/9173.2486ffca31131ec5.js +1 -0
  201. package/dashboard/.next/static/chunks/9178.469341860bf8caec.js +1 -0
  202. package/dashboard/.next/static/chunks/9466.e904660d38c03eea.js +1 -0
  203. package/dashboard/.next/static/chunks/9660.84a85811380c5f33.js +1 -0
  204. package/dashboard/.next/static/chunks/9717.6cf5c8c89403b651.js +1 -0
  205. package/dashboard/.next/static/chunks/9720.67d4d0d15a96d691.js +1 -0
  206. package/dashboard/.next/static/chunks/9811.65e1d080c2d256af.js +1 -0
  207. package/dashboard/.next/static/chunks/app/_not-found/page-548ab392d0e890d1.js +1 -0
  208. package/dashboard/.next/static/chunks/app/access/page-3668562e7464eb5d.js +1 -0
  209. package/dashboard/.next/static/chunks/app/calls/page-d07f5b8664cc8303.js +1 -0
  210. package/dashboard/.next/static/chunks/app/conformance/page-2fede1d7b5f9265d.js +1 -0
  211. package/dashboard/.next/static/chunks/app/diagram/page-b228444265546495.js +1 -0
  212. package/dashboard/.next/static/chunks/app/flows/page-fa67783d8cd79cab.js +1 -0
  213. package/dashboard/.next/static/chunks/app/functions/page-686f0296639133a3.js +1 -0
  214. package/dashboard/.next/static/chunks/app/issues/page-dc110d4cc0a5c398.js +1 -0
  215. package/dashboard/.next/static/chunks/app/layout-e7b50543ba216d12.js +1 -0
  216. package/dashboard/.next/static/chunks/app/page-a0f25953d4457935.js +1 -0
  217. package/dashboard/.next/static/chunks/app/progress/page-f07ac39d1d27b480.js +1 -0
  218. package/dashboard/.next/static/chunks/app/stats/page-db81f600a086f252.js +1 -0
  219. package/dashboard/.next/static/chunks/b7167ec1.7afbab6f609e3326.js +153 -0
  220. package/dashboard/.next/static/chunks/c7ea4e13.5effeeba6618bdb7.js +1 -0
  221. package/dashboard/.next/static/chunks/framework-cf6f5bdca6ba0184.js +33 -0
  222. package/dashboard/.next/static/chunks/main-70c6d841ad572657.js +1 -0
  223. package/dashboard/.next/static/chunks/main-app-9d2f6b8a47133e9b.js +1 -0
  224. package/dashboard/.next/static/chunks/pages/_app-6ad2b50514c24ab4.js +1 -0
  225. package/dashboard/.next/static/chunks/pages/_error-d5eb11c5c4626811.js +1 -0
  226. package/dashboard/.next/static/chunks/polyfills-78c92fac7aa8fdd8.js +1 -0
  227. package/dashboard/.next/static/chunks/webpack-08869f2b18792e51.js +1 -0
  228. package/dashboard/.next/static/css/e6cb67f77f13ae8e.css +3 -0
  229. package/dashboard/.next/static/media/0aa834ed78bf6d07-s.woff2 +0 -0
  230. package/dashboard/.next/static/media/438aa629764e75f3-s.woff2 +0 -0
  231. package/dashboard/.next/static/media/4c9affa5bc8f420e-s.p.woff2 +0 -0
  232. package/dashboard/.next/static/media/51251f8b9793cdb3-s.woff2 +0 -0
  233. package/dashboard/.next/static/media/67957d42bae0796d-s.woff2 +0 -0
  234. package/dashboard/.next/static/media/875ae681bfde4580-s.woff2 +0 -0
  235. package/dashboard/.next/static/media/886030b0b59bc5a7-s.woff2 +0 -0
  236. package/dashboard/.next/static/media/939c4f875ee75fbb-s.woff2 +0 -0
  237. package/dashboard/.next/static/media/bb3ef058b751a6ad-s.p.woff2 +0 -0
  238. package/dashboard/.next/static/media/cc978ac5ee68c2b6-s.woff2 +0 -0
  239. package/dashboard/.next/static/media/e857b654a2caa584-s.woff2 +0 -0
  240. package/dashboard/.next/static/media/f911b923c6adde36-s.woff2 +0 -0
  241. package/dashboard/.next/trace +80 -0
  242. package/dashboard/.next/types/app/access/page.ts +79 -0
  243. package/dashboard/.next/types/app/api/code/route.ts +343 -0
  244. package/dashboard/.next/types/app/api/flows/route.ts +343 -0
  245. package/dashboard/.next/types/app/api/github-status/route.ts +343 -0
  246. package/dashboard/.next/types/app/api/issues/[id]/move/route.ts +343 -0
  247. package/dashboard/.next/types/app/api/issues/[id]/route.ts +343 -0
  248. package/dashboard/.next/types/app/api/mermaid/route.ts +343 -0
  249. package/dashboard/.next/types/app/api/progress/route.ts +343 -0
  250. package/dashboard/.next/types/app/api/watch/route.ts +343 -0
  251. package/dashboard/.next/types/app/calls/page.ts +79 -0
  252. package/dashboard/.next/types/app/conformance/page.ts +79 -0
  253. package/dashboard/.next/types/app/diagram/page.ts +79 -0
  254. package/dashboard/.next/types/app/flows/page.ts +79 -0
  255. package/dashboard/.next/types/app/functions/page.ts +79 -0
  256. package/dashboard/.next/types/app/issues/page.ts +79 -0
  257. package/dashboard/.next/types/app/page.ts +79 -0
  258. package/dashboard/.next/types/app/progress/page.ts +79 -0
  259. package/dashboard/.next/types/app/stats/page.ts +79 -0
  260. package/dashboard/.next/types/package.json +1 -0
  261. package/dashboard/app/access/AccessClient.tsx +402 -0
  262. package/dashboard/app/access/ReadOnlyFunctions.tsx +114 -0
  263. package/dashboard/app/access/page.tsx +118 -0
  264. package/dashboard/app/api/code/route.ts +35 -0
  265. package/dashboard/app/api/flows/route.ts +28 -0
  266. package/dashboard/app/api/github-status/route.ts +23 -0
  267. package/dashboard/app/api/issues/[id]/move/route.ts +74 -0
  268. package/dashboard/app/api/issues/[id]/route.ts +109 -0
  269. package/dashboard/app/api/mermaid/route.ts +25 -0
  270. package/dashboard/app/api/progress/route.ts +36 -0
  271. package/dashboard/app/api/watch/route.ts +52 -0
  272. package/dashboard/app/calls/CallsClient.tsx +170 -0
  273. package/dashboard/app/calls/page.tsx +50 -0
  274. package/dashboard/app/conformance/ConformanceTable.tsx +214 -0
  275. package/dashboard/app/conformance/page.tsx +179 -0
  276. package/dashboard/app/diagram/page.tsx +65 -0
  277. package/dashboard/app/flows/page.tsx +102 -0
  278. package/dashboard/app/functions/FunctionsClient.tsx +167 -0
  279. package/dashboard/app/functions/page.tsx +171 -0
  280. package/dashboard/app/globals.css +157 -0
  281. package/dashboard/app/icon.svg +18 -0
  282. package/dashboard/app/issues/IssuesBoardClient.tsx +636 -0
  283. package/dashboard/app/issues/page.tsx +239 -0
  284. package/dashboard/app/layout.tsx +40 -0
  285. package/dashboard/app/page.tsx +259 -0
  286. package/dashboard/app/progress/ProgressClient.tsx +333 -0
  287. package/dashboard/app/progress/page.tsx +118 -0
  288. package/dashboard/app/stats/StatsClient.tsx +452 -0
  289. package/dashboard/app/stats/page.tsx +43 -0
  290. package/dashboard/components/AutoRefresh.tsx +37 -0
  291. package/dashboard/components/CodeReference.tsx +129 -0
  292. package/dashboard/components/CommandPalette.tsx +135 -0
  293. package/dashboard/components/ConfidenceBadge.tsx +53 -0
  294. package/dashboard/components/DashboardLayout.tsx +450 -0
  295. package/dashboard/components/FilterableTable.tsx +293 -0
  296. package/dashboard/components/LiveStatus.tsx +99 -0
  297. package/dashboard/components/MarkdownRenderer.tsx +40 -0
  298. package/dashboard/components/MermaidViewer.tsx +267 -0
  299. package/dashboard/components/NotYetGenerated.tsx +32 -0
  300. package/dashboard/components/SeverityBadge.tsx +28 -0
  301. package/dashboard/components/SignalBars.tsx +27 -0
  302. package/dashboard/components/SortableTable.tsx +122 -0
  303. package/dashboard/lib/conformance-tokens.ts +49 -0
  304. package/dashboard/lib/data.ts +102 -0
  305. package/dashboard/lib/watcher.ts +45 -0
  306. package/dashboard/next-env.d.ts +5 -0
  307. package/dashboard/next.config.mjs +9 -0
  308. package/dashboard/postcss.config.cjs +6 -0
  309. package/dashboard/tailwind.config.ts +79 -0
  310. package/dashboard/tsconfig.json +21 -0
  311. package/dist/analysis/access-control.d.ts +24 -0
  312. package/dist/analysis/access-control.d.ts.map +1 -0
  313. package/dist/analysis/access-control.js +378 -0
  314. package/dist/analysis/access-control.js.map +1 -0
  315. package/dist/analysis/attack-surface.d.ts +51 -0
  316. package/dist/analysis/attack-surface.d.ts.map +1 -0
  317. package/dist/analysis/attack-surface.js +206 -0
  318. package/dist/analysis/attack-surface.js.map +1 -0
  319. package/dist/analysis/constraint-extraction.d.ts +25 -0
  320. package/dist/analysis/constraint-extraction.d.ts.map +1 -0
  321. package/dist/analysis/constraint-extraction.js +398 -0
  322. package/dist/analysis/constraint-extraction.js.map +1 -0
  323. package/dist/analysis/context-assembler.d.ts +16 -0
  324. package/dist/analysis/context-assembler.d.ts.map +1 -0
  325. package/dist/analysis/context-assembler.js +88 -0
  326. package/dist/analysis/context-assembler.js.map +1 -0
  327. package/dist/analysis/dependency-graph.d.ts +31 -0
  328. package/dist/analysis/dependency-graph.d.ts.map +1 -0
  329. package/dist/analysis/dependency-graph.js +223 -0
  330. package/dist/analysis/dependency-graph.js.map +1 -0
  331. package/dist/analysis/erc-detection.d.ts +16 -0
  332. package/dist/analysis/erc-detection.d.ts.map +1 -0
  333. package/dist/analysis/erc-detection.js +81 -0
  334. package/dist/analysis/erc-detection.js.map +1 -0
  335. package/dist/analysis/external-calls.d.ts +8 -0
  336. package/dist/analysis/external-calls.d.ts.map +1 -0
  337. package/dist/analysis/external-calls.js +124 -0
  338. package/dist/analysis/external-calls.js.map +1 -0
  339. package/dist/analysis/nsloc.d.ts +46 -0
  340. package/dist/analysis/nsloc.d.ts.map +1 -0
  341. package/dist/analysis/nsloc.js +106 -0
  342. package/dist/analysis/nsloc.js.map +1 -0
  343. package/dist/analysis/pattern-detection.d.ts +20 -0
  344. package/dist/analysis/pattern-detection.d.ts.map +1 -0
  345. package/dist/analysis/pattern-detection.js +236 -0
  346. package/dist/analysis/pattern-detection.js.map +1 -0
  347. package/dist/analysis/state-variables.d.ts +33 -0
  348. package/dist/analysis/state-variables.d.ts.map +1 -0
  349. package/dist/analysis/state-variables.js +179 -0
  350. package/dist/analysis/state-variables.js.map +1 -0
  351. package/dist/commands/access.d.ts +3 -0
  352. package/dist/commands/access.d.ts.map +1 -0
  353. package/dist/commands/access.js +99 -0
  354. package/dist/commands/access.js.map +1 -0
  355. package/dist/commands/ai-status.d.ts +3 -0
  356. package/dist/commands/ai-status.d.ts.map +1 -0
  357. package/dist/commands/ai-status.js +172 -0
  358. package/dist/commands/ai-status.js.map +1 -0
  359. package/dist/commands/analyze.d.ts +3 -0
  360. package/dist/commands/analyze.d.ts.map +1 -0
  361. package/dist/commands/analyze.js +101 -0
  362. package/dist/commands/analyze.js.map +1 -0
  363. package/dist/commands/calls.d.ts +3 -0
  364. package/dist/commands/calls.d.ts.map +1 -0
  365. package/dist/commands/calls.js +92 -0
  366. package/dist/commands/calls.js.map +1 -0
  367. package/dist/commands/claude.d.ts +3 -0
  368. package/dist/commands/claude.d.ts.map +1 -0
  369. package/dist/commands/claude.js +42 -0
  370. package/dist/commands/claude.js.map +1 -0
  371. package/dist/commands/constraints.d.ts +3 -0
  372. package/dist/commands/constraints.d.ts.map +1 -0
  373. package/dist/commands/constraints.js +32 -0
  374. package/dist/commands/constraints.js.map +1 -0
  375. package/dist/commands/context.d.ts +3 -0
  376. package/dist/commands/context.d.ts.map +1 -0
  377. package/dist/commands/context.js +57 -0
  378. package/dist/commands/context.js.map +1 -0
  379. package/dist/commands/dashboard.d.ts +3 -0
  380. package/dist/commands/dashboard.d.ts.map +1 -0
  381. package/dist/commands/dashboard.js +95 -0
  382. package/dist/commands/dashboard.js.map +1 -0
  383. package/dist/commands/deps.d.ts +3 -0
  384. package/dist/commands/deps.d.ts.map +1 -0
  385. package/dist/commands/deps.js +67 -0
  386. package/dist/commands/deps.js.map +1 -0
  387. package/dist/commands/doctor.d.ts +17 -0
  388. package/dist/commands/doctor.d.ts.map +1 -0
  389. package/dist/commands/doctor.js +154 -0
  390. package/dist/commands/doctor.js.map +1 -0
  391. package/dist/commands/init.d.ts +3 -0
  392. package/dist/commands/init.d.ts.map +1 -0
  393. package/dist/commands/init.js +330 -0
  394. package/dist/commands/init.js.map +1 -0
  395. package/dist/commands/patterns.d.ts +3 -0
  396. package/dist/commands/patterns.d.ts.map +1 -0
  397. package/dist/commands/patterns.js +40 -0
  398. package/dist/commands/patterns.js.map +1 -0
  399. package/dist/commands/state.d.ts +3 -0
  400. package/dist/commands/state.d.ts.map +1 -0
  401. package/dist/commands/state.js +92 -0
  402. package/dist/commands/state.js.map +1 -0
  403. package/dist/commands/stats.d.ts +3 -0
  404. package/dist/commands/stats.d.ts.map +1 -0
  405. package/dist/commands/stats.js +347 -0
  406. package/dist/commands/stats.js.map +1 -0
  407. package/dist/commands/surface.d.ts +3 -0
  408. package/dist/commands/surface.d.ts.map +1 -0
  409. package/dist/commands/surface.js +45 -0
  410. package/dist/commands/surface.js.map +1 -0
  411. package/dist/commands/update-skills.d.ts +3 -0
  412. package/dist/commands/update-skills.d.ts.map +1 -0
  413. package/dist/commands/update-skills.js +40 -0
  414. package/dist/commands/update-skills.js.map +1 -0
  415. package/dist/commands/update.d.ts +3 -0
  416. package/dist/commands/update.d.ts.map +1 -0
  417. package/dist/commands/update.js +157 -0
  418. package/dist/commands/update.js.map +1 -0
  419. package/dist/core/config.d.ts +24 -0
  420. package/dist/core/config.d.ts.map +1 -0
  421. package/dist/core/config.js +70 -0
  422. package/dist/core/config.js.map +1 -0
  423. package/dist/core/errors.d.ts +17 -0
  424. package/dist/core/errors.d.ts.map +1 -0
  425. package/dist/core/errors.js +113 -0
  426. package/dist/core/errors.js.map +1 -0
  427. package/dist/core/external-tools.d.ts +39 -0
  428. package/dist/core/external-tools.d.ts.map +1 -0
  429. package/dist/core/external-tools.js +151 -0
  430. package/dist/core/external-tools.js.map +1 -0
  431. package/dist/core/logger.d.ts +16 -0
  432. package/dist/core/logger.d.ts.map +1 -0
  433. package/dist/core/logger.js +22 -0
  434. package/dist/core/logger.js.map +1 -0
  435. package/dist/core/output.d.ts +13 -0
  436. package/dist/core/output.d.ts.map +1 -0
  437. package/dist/core/output.js +45 -0
  438. package/dist/core/output.js.map +1 -0
  439. package/dist/core/paths.d.ts +21 -0
  440. package/dist/core/paths.d.ts.map +1 -0
  441. package/dist/core/paths.js +32 -0
  442. package/dist/core/paths.js.map +1 -0
  443. package/dist/core/progress.d.ts +34 -0
  444. package/dist/core/progress.d.ts.map +1 -0
  445. package/dist/core/progress.js +119 -0
  446. package/dist/core/progress.js.map +1 -0
  447. package/dist/core/schema.d.ts +3197 -0
  448. package/dist/core/schema.d.ts.map +1 -0
  449. package/dist/core/schema.js +420 -0
  450. package/dist/core/schema.js.map +1 -0
  451. package/dist/core/skills.d.ts +28 -0
  452. package/dist/core/skills.d.ts.map +1 -0
  453. package/dist/core/skills.js +82 -0
  454. package/dist/core/skills.js.map +1 -0
  455. package/dist/index.d.ts +3 -0
  456. package/dist/index.d.ts.map +1 -0
  457. package/dist/index.js +43 -0
  458. package/dist/index.js.map +1 -0
  459. package/dist/parsers/lcov.d.ts +27 -0
  460. package/dist/parsers/lcov.d.ts.map +1 -0
  461. package/dist/parsers/lcov.js +68 -0
  462. package/dist/parsers/lcov.js.map +1 -0
  463. package/dist/parsers/slither.d.ts +63 -0
  464. package/dist/parsers/slither.d.ts.map +1 -0
  465. package/dist/parsers/slither.js +160 -0
  466. package/dist/parsers/slither.js.map +1 -0
  467. package/dist/parsers/solc.d.ts +19 -0
  468. package/dist/parsers/solc.d.ts.map +1 -0
  469. package/dist/parsers/solc.js +43 -0
  470. package/dist/parsers/solc.js.map +1 -0
  471. package/dist/parsers/solidity-parser.d.ts +77 -0
  472. package/dist/parsers/solidity-parser.d.ts.map +1 -0
  473. package/dist/parsers/solidity-parser.js +357 -0
  474. package/dist/parsers/solidity-parser.js.map +1 -0
  475. package/dist/skills/generate-overleaf.md +326 -0
  476. package/dist/skills/generate-poc.md +186 -0
  477. package/dist/skills/ingest-aa-report.md +172 -0
  478. package/dist/skills/init-audit.md +271 -0
  479. package/dist/skills/sync-issues.md +266 -0
  480. package/dist/skills/validate-issue.md +149 -0
  481. package/dist/skills/write-finding.md +142 -0
  482. package/dist/types/index.d.ts +30 -0
  483. package/dist/types/index.d.ts.map +1 -0
  484. package/dist/types/index.js +2 -0
  485. package/dist/types/index.js.map +1 -0
  486. package/package.json +81 -0
@@ -0,0 +1,271 @@
1
+ ---
2
+ description: "Initialize a Solidity audit project: deterministic analysis + protocol overview + system diagram + flow charts + spec conformance, all in one run"
3
+ ---
4
+
5
+ # Skill: Initialize Audit
6
+
7
+ **Recommended model:** Opus (this skill performs all reasoning-heavy pre-review work; switch to Opus before invoking)
8
+
9
+ You are setting up a new Solidity audit project with Hex. This single skill replaces the old chain of `/init-audit` → `/generate-overview` → `/generate-diagram` → `/generate-flows` → `/check-spec-conformance`. By the time it finishes, every analysis page on the dashboard has data and every DEVIATES/PARTIAL spec item has been materialized as a Potential card on the issue board.
10
+
11
+ ## Prerequisites
12
+
13
+ - The auditor has cloned or received the client project.
14
+ - Node.js and npm are installed.
15
+ - Hex CLI is installed (`npm install -g hex-audit`).
16
+
17
+ ## Phase 1 — Config + dependency safety
18
+
19
+ ### 1.1 Gather information
20
+
21
+ Ask the auditor for:
22
+ - **Project directory path** — where the client project lives (default: current directory).
23
+ - **Scope** — glob or explicit list of files in audit scope (e.g., `src/core/**/*.sol`).
24
+ - **Commit hash** — the specific commit being audited (default: HEAD).
25
+ - **Chain** — target chain (default: ethereum).
26
+ - **Documentation URL** — if available.
27
+
28
+ ### 1.2 Audit dependencies (BEFORE compiling)
29
+
30
+ Build scripts and `npm install` hooks are a primary supply-chain attack vector. Check these **before** running `forge build`, `npm install`, or any compilation command:
31
+
32
+ 1. **`package.json` install hooks** — `preinstall`, `postinstall`, `prepare`, `prebuild`, `pretest` scripts that shell out, download from URLs, or touch files outside the project. Cross-reference with npmjs.com advisories.
33
+ 2. **Foundry `lib/` submodules** — inspect each `lib/*/foundry.toml` for `ffi = true`, broad `fs_permissions`, or `script` entries.
34
+ 3. **Root `foundry.toml`**:
35
+ - `ffi = true` → **HIGH RISK** (arbitrary system commands during build/test).
36
+ - `fs_permissions` broader than read-only on `./src` or `./out` → flag.
37
+ - Profile overrides differing from main profile → flag.
38
+ 4. **`remappings.txt`** — verify each target exists in `lib/`; flag shadowed paths, mismatched paths, or hijack vectors (a remap of `@openzeppelin/=lib/malicious-oz/`).
39
+ 5. **Suspicious files** — root-level `*.sh`, `*.py`, `Makefile` targets, `.github/` workflows.
40
+ 6. **Plaintext secrets** in `.env*` files (private keys, mnemonics, API keys). Do NOT log the values.
41
+ 7. **`.vscode/extensions.json`** — flag extension recommendations from unknown publishers.
42
+
43
+ **If any build-time threats are found: STOP and warn before compilation.**
44
+
45
+ After build safety passes, evaluate Solidity dependencies:
46
+ - Identify well-known libs (OpenZeppelin, Solmate, Solady, PRBMath). Flag outdated versions with known advisories (OZ < 4.9.3, Solmate `SafeTransferLib` missing code-size check, etc.).
47
+ - Flag typosquats (`@openzepplin` vs `@openzeppelin`).
48
+ - Flag unused dependencies (in `lib/` or `node_modules/` but not imported by scope files).
49
+ - Spot-check unknown packages for inline assembly, `selfdestruct`, `delegatecall` to hardcoded addresses.
50
+
51
+ ### 1.3 Initialize and analyze
52
+
53
+ Run:
54
+ ```bash
55
+ npx hex init --project "<path>" --scope "<scope>" --commit <hash> --chain <chain> --docs "<url>"
56
+ npx hex analyze
57
+ ```
58
+
59
+ `hex analyze` runs stats → deps → access → state → calls → patterns → constraints in parallel, then `surface` last. If a tool is missing (Slither, forge), the corresponding analysis is skipped — note the limitation and move on.
60
+
61
+ ## Phase 2 — Protocol overview
62
+
63
+ Read from the output directory (`.hex/`):
64
+ - `config.json` — project name, scope, chain, docs URL.
65
+ - `stats.json` — contracts, nSLOC, ERCs, dependencies.
66
+ - `deps.json` — contract relationships and clusters.
67
+
68
+ Run `npx hex context` to load the full codebase. If `config.json.project.docs_url` is set, fetch and read the documentation.
69
+
70
+ Write a 2–3 paragraph overview to `.hex/overview.md` covering:
71
+ 1. **What the protocol does** — purpose, target users, the problem it solves.
72
+ 2. **Core mechanism** — deposit/withdraw flows, token economics, governance model.
73
+ 3. **Key contracts and their roles** — entry points, state holders, libraries.
74
+ 4. **Notable design patterns** — upgradeability, access control, external dependencies, oracle usage.
75
+
76
+ Write for an experienced Solidity auditor. Be precise and technical. Reference specific contract names and functions where relevant.
77
+
78
+ **Do NOT:**
79
+ - List findings or security concerns (this is purely descriptive).
80
+ - Speculate about vulnerabilities.
81
+ - Include code snippets.
82
+ - Add disclaimers about AI limitations.
83
+
84
+ **Format:**
85
+
86
+ ```markdown
87
+ # Protocol Overview: [Name]
88
+
89
+ [2-3 paragraphs]
90
+
91
+ ## Key Contracts
92
+
93
+ | Contract | Type | nSLOC | Role |
94
+ |----------|------|-------|------|
95
+ | ... | ... | ... | ... |
96
+
97
+ ## External Dependencies
98
+ - [Package] v[version] — used for [purpose]
99
+
100
+ ## Architecture Notes
101
+ - [Notable design decisions, patterns, or concerns to keep in mind during review]
102
+ ```
103
+
104
+ ## Phase 3 — System diagram
105
+
106
+ Read `.hex/overview.md`, `.hex/patterns.json` (for `UPGRADEABLE`, `CROSS_CHAIN`, `DELEGATECALL`, `protocol_hints`), `.hex/attack-surface.json` (entry-point classification, token interactions, external deps), `.hex/access-control.json` (roles + modifiers).
107
+
108
+ Detect the protocol archetype from `patterns.json` (Vault / Lending / Bridge / Governance / AMM / Staking). Multiple may apply.
109
+
110
+ Write a Mermaid `graph TD` diagram to `.hex/diagrams/diagram.mmd`. Constraints:
111
+
112
+ - **Only in-scope contracts** (per `config.json.project.scope`). Out-of-scope contracts may appear as simplified nodes if in-scope contracts interact with them; otherwise omit.
113
+ - Skip interfaces, abstract contracts, and pure libraries.
114
+ - **Maximum ~15 nodes per diagram.** If the protocol is larger, split into multiple files (`diagram-core.mmd`, `diagram-governance.mmd`, etc.) grouped by purpose.
115
+ - Prefix contract labels with a semantic symbol where applicable:
116
+ - 🏦 Vault / ERC-4626, 💰 Token, 🔮 Oracle, 🔒 Timelock/access control, 📦 Storage, ⚡ Flash loan, 🌉 Bridge.
117
+ - Define a classDef palette at the bottom of every diagram:
118
+ ```
119
+ classDef core fill:#a5d8ff,stroke:#1971c2,color:#000
120
+ classDef user fill:#b2f2bb,stroke:#2f9e44,color:#000
121
+ classDef admin fill:#ff8787,stroke:#c92a2a,color:#000
122
+ classDef ext fill:#ffd8a8,stroke:#e8590c,color:#000
123
+ classDef proxy fill:#d0bfff,stroke:#7048e8,color:#000,stroke-dasharray:5 5
124
+ classDef storage fill:#ffec99,stroke:#f08c00,color:#000
125
+ ```
126
+ - Apply class by role: core logic → `core`, user-facing → `user`, admin/governance → `admin`, external deps → `ext`, proxy/upgradeable → `proxy`, storage/registry → `storage`.
127
+ - Edge labels: type the interaction — `-->|external call|`, `-.->|delegatecall|`, `==>|access-controlled|`, `-.->|reads|`.
128
+ - Include a short overview header comment (`%% System architecture for <Project>`) and a visual legend at the bottom showing each classDef with one-line meaning.
129
+
130
+ ## Phase 4 — Flow charts
131
+
132
+ Same context as Phase 3, plus `.hex/external-calls.json`.
133
+
134
+ For each archetype, generate at minimum:
135
+ - **Value Flow** — how tokens/ETH move (deposits, withdrawals, fees, swaps).
136
+ - **Permission Flow** — who can do what; role grant/revoke; admin operations.
137
+
138
+ Archetype-specific flows (only generate when the archetype is detected):
139
+ - **Vault**: deposit/mint, withdraw/redeem, strategy allocation, fee collection.
140
+ - **Lending**: borrow, repay, liquidation (health check → liquidation → seizure → bad debt).
141
+ - **Governance**: proposal lifecycle (create → vote → queue → execute), delegation.
142
+ - **Bridge**: send (lock/burn → relay → finality → mint/unlock), receive/verify.
143
+ - **AMM/DEX**: swap, add liquidity, remove liquidity, fee accrual.
144
+ - **Staking**: stake, unstake, claim, compound.
145
+ - Add an **upgrade flow** if any upgradeable proxies are detected.
146
+
147
+ Write each flow to `.hex/diagrams/flow-<name>.mmd` (e.g., `flow-deposit.mmd`). Constraints per flow:
148
+
149
+ - **In-scope contracts only.** Out-of-scope contracts may appear as `ext` nodes when called by in-scope code.
150
+ - **Max ~15 nodes per flow.** Split if larger.
151
+ - Distinct shapes by semantic role:
152
+ - Stadium `id(["Label"])` — entry point, success outcome, or revert
153
+ - Rectangle `id["Label"]` — internal step or external call
154
+ - Cylinder `id[("Label")]` — state change / storage mutation
155
+ - Rhombus `id{"Label"}` — decision / validation
156
+ - Use the same classDef palette as the diagram, plus `entry`, `state`, `decision`, `reject`, `success` variants per flow needs.
157
+ - **Every decision diamond shows BOTH the success and the revert path** — don't omit failure branches.
158
+ - Use plain-English labels (`"Burns user shares"`, not `"_burn(msg.sender, shares)"`).
159
+ - Wrap each contract's nodes in a `subgraph` swim-lane.
160
+
161
+ ## Phase 5 — Spec conformance
162
+
163
+ Read `.hex/config.json` (docs URL, scope, ERCs), `.hex/stats.json` (ERC/EIP usage), `.hex/attack-surface.json` (token interactions).
164
+
165
+ Cross-reference four sources:
166
+
167
+ **5.1 External documentation.** Fetch `config.json.project.docs_url`. Extract every behavioral claim ("users can deposit X and receive Y", "fees capped at 10%", "only admin can pause"). For each claim, find the implementing code and verify match.
168
+
169
+ **5.2 NatSpec.** For every function with `@notice`/`@dev`/`@param`/`@return`:
170
+ - Does the function actually do what `@notice` says?
171
+ - Are `@param` constraints accurate?
172
+ - Does it return what `@return` claims?
173
+ - Pay extra attention to conditional NatSpec ("reverts if…", "only when…").
174
+
175
+ **5.3 Interface conformance.** For every interface the contract implements (explicit `is IFoo` or implicit):
176
+ - All interface functions implemented?
177
+ - Behavioral semantics of each function respected?
178
+
179
+ **5.4 ERC/EIP compliance.** For each ERC/EIP in `stats.json.erc_eip_usage`:
180
+ - **Fetch the canonical spec** via WebFetch from `https://eips.ethereum.org/EIPS/eip-<number>`. If the fetch fails, note `"spec_fetched": false` and fall back to training knowledge.
181
+ - Extract every MUST/SHOULD/MAY requirement into a checklist; verify each against the implementation.
182
+
183
+ Known gotchas:
184
+ - **ERC-20**: return values on transfer/approve, zero-amount transfers, approval race.
185
+ - **ERC-4626**: rounding direction per spec, preview vs actual, max* return values.
186
+ - **ERC-721**: safeTransferFrom callbacks.
187
+ - **ERC-2612**: permit deadline, nonce handling, domain separator chain ID.
188
+
189
+ **Weird token compat.** For every contract interacting with ERC-20 tokens (check `attack-surface.json.token_interactions`), classify handling of:
190
+ - Fee-on-transfer (balance-diff accounting vs trusting transfer amount).
191
+ - Rebasing (shares vs absolute balances; stale balance caches).
192
+ - Blocklist (DoS via blocked recipient in batches/loops; liquidation/withdrawal block).
193
+ - Double-entry-point legacy tokens (dedup on contract address).
194
+
195
+ ### Output format
196
+
197
+ Write `.hex/spec-conformance.json`:
198
+
199
+ ```json
200
+ {
201
+ "checked_at": "<ISO-8601>",
202
+ "sources_checked": { "external_docs": true, "natspec": true, "interfaces": true, "erc_eip": ["ERC-20", "ERC-4626"] },
203
+ "summary": { "total_checks": N, "conforms": N, "deviates": N, "partial": N, "unverifiable": N, "undocumented": N },
204
+ "items": [
205
+ {
206
+ "id": "SC-001",
207
+ "source": "erc_eip" | "natspec" | "interface" | "external_docs",
208
+ "spec_text": "Verbatim text or paraphrase of the requirement",
209
+ "spec_location": { "type": "eip", "number": 4626, "section": "Specification", "url": "https://eips.ethereum.org/EIPS/eip-4626" },
210
+ "status": "CONFORMS" | "DEVIATES" | "PARTIAL" | "UNVERIFIABLE" | "UNDOCUMENTED",
211
+ "finding": "Plain-English explanation of what the code does vs what the spec demands.",
212
+ "code_location": { "file": "src/Vault.sol", "line_start": 120, "line_end": 145 },
213
+ "severity_hint": "Low",
214
+ "confidence": "high"
215
+ }
216
+ ]
217
+ }
218
+ ```
219
+
220
+ Also write a human-readable `.hex/spec-conformance.md` rendering the same data grouped by status (DEVIATES first, CONFORMS last).
221
+
222
+ ## Phase 6 — Materialize conformance items onto the board
223
+
224
+ For every item in `spec-conformance.json.items` with `status` of `DEVIATES` or `PARTIAL`, append a tracking entry to `.hex/tracking.json` (creating the file if missing). Schema:
225
+
226
+ ```json
227
+ {
228
+ "id": "<spec-item-id, e.g. SC-001>",
229
+ "title": "<spec-item.finding's first sentence, truncated to ~80 chars>",
230
+ "severity": "<spec-item.severity_hint, default 'Info' if absent>",
231
+ "source": "conformance",
232
+ "status": "pending_validation",
233
+ "poc_status": "not_started",
234
+ "poc_file": null,
235
+ "duplicates": [],
236
+ "notes": "<spec source + spec_location URL — so the board card has provenance>"
237
+ }
238
+ ```
239
+
240
+ These appear on the dashboard's Issues board as Potential cards immediately. The auditor validates them later with `/validate-issue <id>`.
241
+
242
+ **Idempotency:** if a tracking entry with the same id already exists, leave it alone (the auditor may have already edited/promoted it).
243
+
244
+ ## Phase 7 — Report and auto-launch the dashboard
245
+
246
+ Summarize:
247
+ - Files / contracts in scope, total nSLOC.
248
+ - Number of external/public functions, state variables.
249
+ - Number of conformance DEVIATES/PARTIAL items materialized to the board.
250
+ - Any warnings or limitations (missing tools, failed coverage, etc.).
251
+
252
+ Then launch the dashboard in the background so the auditor's browser opens automatically. Run this Bash command with `run_in_background: true` so the skill returns control to the auditor while Next.js keeps serving the dashboard:
253
+
254
+ ```bash
255
+ npx hex dashboard
256
+ ```
257
+
258
+ Print a one-line confirmation after starting it: `Dashboard starting at http://localhost:3000 (live-refreshing as .hex/ changes).`
259
+
260
+ Do NOT run the command in the foreground — that would block this skill's return. The dashboard's auto-open already handles the browser; you just need to launch the process and return.
261
+
262
+ ## Outputs (recap)
263
+
264
+ After this skill finishes, the following exist in `.hex/`:
265
+
266
+ - `config.json`, `stats.json`, `deps.json`, `access-control.json`, `state-vars.json`, `external-calls.json`, `patterns.json`, `constraints.json`, `attack-surface.json`
267
+ - `overview.md`
268
+ - `diagrams/diagram.mmd` (+ split diagrams if needed)
269
+ - `diagrams/flow-*.mmd`
270
+ - `spec-conformance.json`, `spec-conformance.md`
271
+ - `tracking.json` — populated with conformance DEVIATES/PARTIAL items as Potential issues
@@ -0,0 +1,266 @@
1
+ ---
2
+ description: 'Two-way sync between local Hex findings and GitHub Issues — pulls teammate issues into the board (canonical), pushes verified findings out, runs inline dedup'
3
+ ---
4
+
5
+ # Skill: Sync Issues
6
+
7
+ **Recommended model:** Sonnet
8
+
9
+ This skill is Hex's GitHub Issues integration. Hex never authenticates with GitHub — you authenticate once via `gh auth login` and this skill drives the `gh` CLI via bash. A single invocation runs both directions plus inline dedup.
10
+
11
+ **Dedup direction note.** GitHub is the **source of truth**. When a teammate's pulled GitHub issue matches a local potential issue (same root cause, same contract/function), the **local** entry is marked Duplicate — not the GitHub one. The rationale is multi-auditor coordination: if a teammate already filed an issue, your in-progress local card is redundant. This is opposite of the auditagent dedup direction in `/ingest-aa-report`.
12
+
13
+ ## Context Assembly
14
+
15
+ Read:
16
+ - `<output_dir>/config.json` — needs `settings.github.repo` set.
17
+ - `<output_dir>/findings.json` — local canonical findings.
18
+ - `<output_dir>/tracking.json` — for status filtering on push (default: only `verified` is pushed).
19
+ - `<output_dir>/external/github/findings.json` if it exists — last pulled state.
20
+ - `<output_dir>/external/github/sync-status.json` for `last_synced_at`.
21
+
22
+ Writes to:
23
+ - `<output_dir>/findings.json` — updates `github.*` blocks on local findings.
24
+ - `<output_dir>/external/github/findings.json` — teammate findings in `AiResultFile` shape.
25
+ - `<output_dir>/external/github/sync-status.json` — counters + timestamp.
26
+ - `<output_dir>/external/github/raw-issues.json` — debug cache of the gh JSON.
27
+ - `<output_dir>/tracking.json` — teammate findings as new entries; local entries flipped to `duplicate` on match.
28
+ - `<output_dir>/comparison.json` — appended with `match_signals` for each dedup hit.
29
+
30
+ ## Phase 0 — Preflight
31
+
32
+ **0a. `gh` installed and authenticated?** Run `gh auth status`. If non-zero exit, print:
33
+
34
+ ```
35
+ gh CLI is not authenticated. Run `gh auth login` once on this machine, then re-run /sync-issues.
36
+ ```
37
+
38
+ …and stop. Hex never stores GitHub credentials.
39
+
40
+ If `gh` itself is missing: instruct install from `https://cli.github.com/` then `gh auth login`.
41
+
42
+ **0b. Resolve `settings.github.repo`.** If missing, use **AskUserQuestion**: "Which GitHub repo should this audit sync to? (e.g. `nethermind/audit-vaultx`)". Validate it has an `owner/repo` shape. Persist back to `config.json`.
43
+
44
+ **0c. Permission check.** Run `gh repo view <repo> --json viewerPermission`. If `READ` or null, **AskUserQuestion**: "Read-only access to <repo>. Push will fail. Continue with pull-only? (yes/no)". Track `push_enabled`.
45
+
46
+ ## Phase 1 — Pull
47
+
48
+ **1a. Fetch issues.**
49
+
50
+ ```bash
51
+ gh issue list --repo <repo> --label "hex" --state all --limit 1000 \
52
+ --json number,title,body,labels,state,author,createdAt,updatedAt,url
53
+ ```
54
+
55
+ Save raw JSON to `external/github/raw-issues.json`.
56
+
57
+ For each issue whose `updatedAt` is newer than the prior `last_synced_at`, fetch comments:
58
+
59
+ ```bash
60
+ gh issue view <number> --repo <repo> --json comments
61
+ ```
62
+
63
+ (First sync: fetch for everything.)
64
+
65
+ **1b. Classify each issue.**
66
+
67
+ Find the round-trip footer in the body: regex `<!--\s*hex-finding-id:\s*(F\d+|AA-\d+|SC-\d+)\s*-->`. Then:
68
+
69
+ - **Footer present, ID matches a local `findings.json` entry** → known local finding. Update its `github` block in place:
70
+ ```json
71
+ {
72
+ "issue_number": <num>,
73
+ "issue_url": "<url>",
74
+ "state": "open|closed",
75
+ "last_synced_at": "<now>",
76
+ "sync_status": "in_sync",
77
+ "comments": [{ "author": "<login>", "body": "<text>", "created_at": "<iso>", "url": "<url>" }]
78
+ }
79
+ ```
80
+
81
+ - **Footer present, no matching local finding** → an issue we previously pushed that's since been deleted locally. Append a tracking entry restoring the link (status `pending_validation`, source `manual`, notes pointing at the URL). Do not touch `findings.json` — the body may have been edited remotely.
82
+
83
+ - **No footer** → teammate finding. Two writes:
84
+ 1. Add to the in-memory `external/github/findings.json` AiResultFile (`tool: "github"`, severity parsed from `severity:*` labels, default Medium):
85
+ ```json
86
+ {
87
+ "id": "github-<issue_number>",
88
+ "tool": "github",
89
+ "title": "<issue title>",
90
+ "severity": "Critical|High|Medium|Low|Info",
91
+ "description": "<body without footer>",
92
+ "affected_code": [<best-effort file refs extracted from body>],
93
+ "confidence": "medium",
94
+ "category": "<from label if present>",
95
+ "raw_category": "github-issue"
96
+ }
97
+ ```
98
+ 2. Add to `tracking.json`:
99
+ ```json
100
+ {
101
+ "id": "github-<issue_number>",
102
+ "title": "<title>",
103
+ "severity": "<severity>",
104
+ "source": "github",
105
+ "status": "pending_validation",
106
+ "poc_status": "not_started",
107
+ "poc_file": null,
108
+ "duplicates": [],
109
+ "notes": "issue=<url> author=<author>"
110
+ }
111
+ ```
112
+
113
+ Write `external/github/findings.json` atomically after the pass.
114
+
115
+ ## Phase 2 — Inline dedup (GitHub-canonical)
116
+
117
+ For each **new github entry** added in Phase 1 step 1b's third branch, run a semantic comparison against every **existing** non-github tracking entry. Match signals:
118
+
119
+ | Signal | Compare |
120
+ |---|---|
121
+ | **contract** (boolean) | Affected contract name match? |
122
+ | **function** (boolean) | Affected function name match? |
123
+ | **root_cause** (`same` / `overlapping` / `different`) | Technical mechanism |
124
+ | **attack_vector** (`same` / `overlapping` / `different`) | What an attacker actually does |
125
+
126
+ A match requires at least one of:
127
+ - `root_cause = same` AND `function = true`, or
128
+ - `root_cause = same` AND `contract = true` AND `attack_vector = same`, or
129
+ - `root_cause = overlapping` AND `function = true` AND `attack_vector = same`.
130
+
131
+ **On match (GitHub is canonical):**
132
+
133
+ - Flip the **local** matching entry to `status: "duplicate"`, set `duplicate_of: "github-<issue_number>"` on it.
134
+ - The github entry stays `pending_validation` (it's the canonical the team is working from).
135
+ - Append to `comparison.json` under `duplicates`:
136
+ ```json
137
+ {
138
+ "ai_finding": "<local-entry-id>",
139
+ "matches": "github-<issue_number>",
140
+ "confidence": "high|medium|low",
141
+ "match_signals": { "contract": true, "function": true, "root_cause": "same", "attack_vector": "same" },
142
+ "reasoning": "<one short sentence>"
143
+ }
144
+ ```
145
+ (The schema field is named `ai_finding` for historical reasons but is repurposed here as "the local duplicate.")
146
+
147
+ Persist updated `tracking.json` and `comparison.json` after the dedup pass.
148
+
149
+ ## Phase 3 — Push
150
+
151
+ Skip if `push_enabled = false`.
152
+
153
+ **3a. Candidates.** From `findings.json`, select each finding whose tracking entry has `status` in `settings.github.publish_status` (default `["verified"]`). Skip findings already marked `status: "duplicate"` (no point publishing a known duplicate).
154
+
155
+ Within candidates:
156
+ - Has `github.issue_number` → update via `gh issue edit`.
157
+ - No `github.issue_number` → create via `gh issue create`.
158
+
159
+ **3b. Render the body** (write to a temp file, then `--body-file`):
160
+
161
+ ```markdown
162
+ **Severity:** <Severity>
163
+
164
+ <finding.description>
165
+
166
+ ### Affected code
167
+
168
+ <for each finding.root_cause.locations[]>
169
+ **`<location.file>`**
170
+
171
+ ```solidity
172
+ <location.snippet>
173
+ ```
174
+ </for>
175
+
176
+ ### Recommendation
177
+
178
+ <finding.recommendation>
179
+
180
+ ---
181
+
182
+ *Synced from Hex audit `<config.project.name>` at commit `<config.project.commit>`.*
183
+
184
+ <!-- hex-finding-id: <finding.id> -->
185
+ ```
186
+
187
+ The footer is the round-trip identity key — never omit.
188
+
189
+ **3c. Labels.**
190
+
191
+ ```
192
+ <default_labels...> severity:<lowercased> source:<finding.source or 'manual'> status:<tracking.status>
193
+ ```
194
+
195
+ Apply via repeated `--label` flags.
196
+
197
+ **3d. Create or update.**
198
+
199
+ Create:
200
+ ```bash
201
+ gh issue create --repo <repo> --title "[<Severity>] <title>" --body-file <tmp> \
202
+ --label "hex" --label "audit" --label "severity:..." --label "source:..." --label "status:..."
203
+ ```
204
+
205
+ Parse the returned URL to extract the issue number; update the local finding's `github` block.
206
+
207
+ Update existing:
208
+ ```bash
209
+ gh issue edit <num> --repo <repo> --title "[<Severity>] <title>" --body-file <tmp> \
210
+ --add-label "severity:..." --add-label "status:..."
211
+ ```
212
+
213
+ Do NOT `--remove-label` — teammates may have added labels we shouldn't strip.
214
+
215
+ If push fails for any single finding: capture stderr, set its `github.sync_status` to `conflict`, append a one-line error, continue with the next finding. Never abort the whole sync on one failure.
216
+
217
+ **3e. Persist** `findings.json` once after all pushes, atomically.
218
+
219
+ ## Phase 4 — Status report
220
+
221
+ Write `external/github/sync-status.json`:
222
+
223
+ ```json
224
+ {
225
+ "repo": "<repo>",
226
+ "last_synced_at": "<now>",
227
+ "pushed": <new-created>,
228
+ "updated": <existing-updated>,
229
+ "pulled": <total-issues-seen>,
230
+ "teammate_findings": <count-of-footer-less>,
231
+ "duplicates_detected": <local-entries-flipped-to-duplicate>,
232
+ "errors": [<one-line-per-error>]
233
+ }
234
+ ```
235
+
236
+ Print:
237
+
238
+ ```
239
+ GitHub sync complete (<repo>)
240
+ ↑ Pushed N new, updated M
241
+ ↓ Pulled K issues — J teammate findings, L matched local
242
+ ⇄ Dedup flipped D local entries to Duplicate (GitHub is canonical)
243
+ <if errors:>
244
+ Errors:
245
+ - <error 1>
246
+ ```
247
+
248
+ ## Conflict resolution defaults
249
+
250
+ - **Body content** — local wins on push. Reviewer edits inside `### Affected code` will be overwritten on re-push. Reviewer comments are never touched.
251
+ - **State (open/closed)** — remote wins. Updates the local finding's `github.state`. Surface in the dashboard so the auditor can decide whether to also reject the finding.
252
+ - **Comments** — pull-only. Hex never posts.
253
+
254
+ ## Error handling
255
+
256
+ - Per-issue errors are isolated — log to `errors[]`, continue.
257
+ - Rate limit (403 with "rate limit" in output): print "Rate-limited — sync resumes after <ISO time>." Stop the current phase.
258
+ - Network failures: print the gh error and stop the current phase. Already-completed phases stay persisted.
259
+
260
+ ## What this skill does NOT do
261
+
262
+ - Does not authenticate (use `gh auth login` once).
263
+ - Does not post comments (auditors discuss inside GitHub).
264
+ - Does not create labels (manual one-time setup; `gh issue create` errors if a label is missing).
265
+ - Does not delete remote issues.
266
+ - Does not push `rejected`, `unverified`, or `duplicate` findings.