hex-audit 0.7.0 → 0.8.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.
- package/CLAUDE.md +137 -77
- package/DEMO.md +40 -117
- package/README.md +200 -402
- package/dashboard/.next/BUILD_ID +1 -1
- package/dashboard/.next/app-build-manifest.json +56 -101
- package/dashboard/.next/app-path-routes-manifest.json +1 -1
- package/dashboard/.next/build-manifest.json +9 -9
- package/dashboard/.next/next-server.js.nft.json +1 -1
- package/dashboard/.next/prerender-manifest.json +1 -1
- package/dashboard/.next/react-loadable-manifest.json +436 -15
- package/dashboard/.next/routes-manifest.json +1 -1
- package/dashboard/.next/server/app/_not-found/page.js +1 -1
- package/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/server/app/api/code/route.js +1 -1
- package/dashboard/.next/server/app/api/code/route.js.nft.json +1 -1
- package/dashboard/.next/server/app/api/comments/route.js +1 -0
- package/dashboard/.next/server/app/api/comments/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/diagrams/[name]/export/route.js +1 -0
- package/dashboard/.next/server/app/api/diagrams/[name]/export/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/diagrams/[name]/resolve/route.js +1 -0
- package/dashboard/.next/server/app/api/diagrams/[name]/resolve/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/diagrams/[name]/route.js +1 -0
- package/dashboard/.next/server/app/api/diagrams/[name]/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/figures/[name]/route.js +1 -0
- package/dashboard/.next/server/app/api/figures/[name]/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/focus/route.js +1 -0
- package/dashboard/.next/server/app/api/focus/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/github-status/route.js +1 -1
- package/dashboard/.next/server/app/api/invariants/[id]/route.js +1 -0
- package/dashboard/.next/server/app/api/invariants/[id]/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/issues/[id]/revert-auto/route.js +1 -0
- package/dashboard/.next/server/app/api/issues/[id]/revert-auto/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/nav/route.js +1 -0
- package/dashboard/.next/server/app/api/nav/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/notes/done/route.js +1 -1
- package/dashboard/.next/server/app/api/notes/done/route.js.nft.json +1 -1
- package/dashboard/.next/server/app/api/notes/lead/route.js +1 -1
- package/dashboard/.next/server/app/api/notes/lead/route.js.nft.json +1 -1
- package/dashboard/.next/server/app/api/notes/question/route.js +1 -1
- package/dashboard/.next/server/app/api/notes/question/route.js.nft.json +1 -1
- package/dashboard/.next/server/app/api/notes/record/route.js +3 -3
- package/dashboard/.next/server/app/api/notes/route.js +2 -2
- package/dashboard/.next/server/app/api/palette/route.js +1 -0
- package/dashboard/.next/server/app/api/palette/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/progress/route.js +1 -1
- package/dashboard/.next/server/app/api/progress/route.js.nft.json +1 -1
- package/dashboard/.next/server/app/api/watch/route.js +2 -2
- package/dashboard/.next/server/app/api/watch/route.js.nft.json +1 -1
- package/dashboard/.next/server/app/api/xref/route.js +1 -0
- package/dashboard/.next/server/app/changes/page.js +1 -20
- package/dashboard/.next/server/app/changes/page.js.nft.json +1 -1
- package/dashboard/.next/server/app/changes/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/server/app/excalidraw-assets/[...path]/route.js +1 -0
- package/dashboard/.next/server/app/issues/page.js +5 -28
- package/dashboard/.next/server/app/issues/page.js.nft.json +1 -1
- package/dashboard/.next/server/app/issues/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/server/app/model/page.js +1 -0
- package/dashboard/.next/server/app/{calls → model}/page.js.nft.json +1 -1
- package/dashboard/.next/server/app/model/page_client-reference-manifest.js +1 -0
- package/dashboard/.next/server/app/page.js +1 -20
- package/dashboard/.next/server/app/page.js.nft.json +1 -1
- package/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/server/app/report/page.js +1 -1
- package/dashboard/.next/server/app/report/page.js.nft.json +1 -1
- package/dashboard/.next/server/app/report/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/server/app/review/page.js +1 -0
- package/dashboard/.next/server/app/{access → review}/page.js.nft.json +1 -1
- package/dashboard/.next/server/app/review/page_client-reference-manifest.js +1 -0
- package/dashboard/.next/server/app-paths-manifest.json +19 -16
- package/dashboard/.next/server/chunks/310.js +4 -0
- package/dashboard/.next/server/chunks/370.js +1 -0
- package/dashboard/.next/server/chunks/42.js +1 -1
- package/dashboard/.next/server/chunks/624.js +14 -0
- package/dashboard/.next/server/chunks/645.js +1 -1
- package/dashboard/.next/server/chunks/649.js +1 -1
- package/dashboard/.next/server/chunks/653.js +1 -0
- package/dashboard/.next/server/functions-config-manifest.json +1 -1
- package/dashboard/.next/server/middleware-build-manifest.js +1 -1
- package/dashboard/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dashboard/.next/server/pages/500.html +1 -1
- package/dashboard/.next/server/pages/_error.js +1 -1
- package/dashboard/.next/server/server-reference-manifest.js +1 -1
- package/dashboard/.next/server/server-reference-manifest.json +1 -1
- package/dashboard/.next/static/chunks/0bbe10ee.8e7ffa06d2170dfe.js +84 -0
- package/dashboard/.next/static/chunks/1026.0ef689a305302427.js +1 -0
- package/dashboard/.next/static/chunks/1164.34eb76767ebea46f.js +8 -0
- package/dashboard/.next/static/chunks/119.a9a79633900a235f.js +5 -0
- package/dashboard/.next/static/chunks/1291.6c486c9b1d4b1b3a.js +1 -0
- package/dashboard/.next/static/chunks/139.4691848fc5a46253.js +10 -0
- package/dashboard/.next/static/chunks/145.1bf74fecdb4022e3.js +11 -0
- package/dashboard/.next/static/chunks/1517.8e7075f78e22b3a0.js +8 -0
- package/dashboard/.next/static/chunks/165.6f174060a0ce2db4.js +6 -0
- package/dashboard/.next/static/chunks/1741.5c370b7702d2eb40.js +8 -0
- package/dashboard/.next/static/chunks/1e36816c.5748c83adc8a6bd6.js +108 -0
- package/dashboard/.next/static/chunks/2061.eab75b3c1dfa068a.js +1 -0
- package/dashboard/.next/static/chunks/2148.3ce718f62d1b2f7c.js +10 -0
- package/dashboard/.next/static/chunks/217-1d5b680ffd10e3f9.js +1 -0
- package/dashboard/.next/static/chunks/2208.fb884379aa3ae968.js +1 -0
- package/dashboard/.next/static/chunks/2276.112c7855333fca5f.js +6 -0
- package/dashboard/.next/static/chunks/2374-8c6f137938f8518a.js +1 -0
- package/dashboard/.next/static/chunks/2445.18a86507d2996b95.js +1 -0
- package/dashboard/.next/static/chunks/2712.15dd8577973baf22.js +10 -0
- package/dashboard/.next/static/chunks/2759.533dec5317e0a1d1.js +1 -0
- package/dashboard/.next/static/chunks/2812.62b213bef580b69a.js +1 -0
- package/dashboard/.next/static/chunks/2895.bb57cacb7aaf42a1.js +9 -0
- package/dashboard/.next/static/chunks/2972.e5a9251b538dcf19.js +9 -0
- package/dashboard/.next/static/chunks/3206.8d9a10db2b04b93f.js +1 -0
- package/dashboard/.next/static/chunks/3485.36766504793b7237.js +9 -0
- package/dashboard/.next/static/chunks/3725.de9376dc994735d4.js +9 -0
- package/dashboard/.next/static/chunks/3774.1df377928e8387f7.js +9 -0
- package/dashboard/.next/static/chunks/3963.39d72b3875dfe2e9.js +13 -0
- package/dashboard/.next/static/chunks/4013.73884b23bfaebdde.js +11 -0
- package/dashboard/.next/static/chunks/4117.278aff1fa23fd36e.js +6 -0
- package/dashboard/.next/static/chunks/4210.cc8594110017c579.js +11 -0
- package/dashboard/.next/static/chunks/4282.28485875540886cc.js +7 -0
- package/dashboard/.next/static/chunks/4318.a2f469a88d88f6d0.js +8 -0
- package/dashboard/.next/static/chunks/4363.8999a6e727c48003.js +1 -0
- package/dashboard/.next/static/chunks/4641.e03d118fffebd580.js +5 -0
- package/dashboard/.next/static/chunks/483.a910dab7734a1074.js +8 -0
- package/dashboard/.next/static/chunks/4926.76693f542e9cc062.js +6 -0
- package/dashboard/.next/static/chunks/4938.03f6d04dabf38745.js +10 -0
- package/dashboard/.next/static/chunks/5112.0757c2b0c285e62e.js +1 -0
- package/dashboard/.next/static/chunks/5199.c83ea7efb0eec705.js +11 -0
- package/dashboard/.next/static/chunks/530.849957a8907eb288.js +1 -0
- package/dashboard/.next/static/chunks/5424.4e8ca0711a32bccf.js +7 -0
- package/dashboard/.next/static/chunks/55.a593a78be9714679.js +1 -0
- package/dashboard/.next/static/chunks/5535.6cd0bd8d368d8902.js +4 -0
- package/dashboard/.next/static/chunks/5626.7d4e93d7acbeffc9.js +10 -0
- package/dashboard/.next/static/chunks/5775.a0d7c1b1e89b9a93.js +9 -0
- package/dashboard/.next/static/chunks/6118.266956b3333b1d7a.js +9 -0
- package/dashboard/.next/static/chunks/6121.a2e6d93720b1205e.js +77 -0
- package/dashboard/.next/static/chunks/6853.d3ad43614e8ca0ab.js +1 -0
- package/dashboard/.next/static/chunks/6951.02a3a158d02158c9.js +5 -0
- package/dashboard/.next/static/chunks/6970.013f24568c87d918.js +11 -0
- package/dashboard/.next/static/chunks/7013.39d41e82b37be63b.js +9 -0
- package/dashboard/.next/static/chunks/7107.1c5412197912b8ed.js +8 -0
- package/dashboard/.next/static/chunks/7508.dd60e2d06d149f5f.js +9 -0
- package/dashboard/.next/static/chunks/7524.0fde4c61553d1491.js +3 -0
- package/dashboard/.next/static/chunks/7834-47f318a04a05688f.js +1 -0
- package/dashboard/.next/static/chunks/8317.d0b3eddef4cae0d5.js +1 -0
- package/dashboard/.next/static/chunks/838.2b2aa006519ba44c.js +10 -0
- package/dashboard/.next/static/chunks/8398.924fd8f4c83417c0.js +7 -0
- package/dashboard/.next/static/chunks/8428b36f.8ac4e67061c01307.js +34 -0
- package/dashboard/.next/static/chunks/8514.85ccbbea8ab21d04.js +5 -0
- package/dashboard/.next/static/chunks/8538.5f7ebe76c4b63162.js +1 -0
- package/dashboard/.next/static/chunks/8687.9406baa8b5601fd0.js +1 -0
- package/dashboard/.next/static/chunks/8721.47346e2cb6412376.js +10 -0
- package/dashboard/.next/static/chunks/8770.4f544bd1a6f03a62.js +8 -0
- package/dashboard/.next/static/chunks/8812.3d96fd54dba566f8.js +9 -0
- package/dashboard/.next/static/chunks/8962.d22aa67a97970dd8.js +1 -0
- package/dashboard/.next/static/chunks/8986.b327224b83f4399a.js +5 -0
- package/dashboard/.next/static/chunks/9271.5f66c19a8ee1ff36.js +10 -0
- package/dashboard/.next/static/chunks/9282.f8d01442bab4c0da.js +2 -0
- package/dashboard/.next/static/chunks/9366.0ec24a0791b9b00f.js +1 -0
- package/dashboard/.next/static/chunks/9707.5cd7d2ee933a4af5.js +6 -0
- package/dashboard/.next/static/chunks/9716.15fffc0b0038601d.js +4 -0
- package/dashboard/.next/static/chunks/9791.e3b3f5a367f63c8a.js +1 -0
- package/dashboard/.next/static/chunks/9820.8c1efad5260e8137.js +1 -0
- package/dashboard/.next/static/chunks/985.50150e9eaa4bde33.js +39 -0
- package/dashboard/.next/static/chunks/997.56901b86e1b8a87b.js +8 -0
- package/dashboard/.next/static/chunks/app/changes/page-f8a860034221cad4.js +1 -0
- package/dashboard/.next/static/chunks/app/issues/page-da4da93188c414a6.js +1 -0
- package/dashboard/.next/static/chunks/app/layout-27a9da4610423c1e.js +1 -0
- package/dashboard/.next/static/chunks/app/model/page-9680e22fdd6ddb81.js +1 -0
- package/dashboard/.next/static/chunks/app/page-0e67750d99fb2836.js +1 -0
- package/dashboard/.next/static/chunks/app/report/page-b56b1db9b9dcf2b6.js +1 -0
- package/dashboard/.next/static/chunks/app/review/page-3ef69f0e0badd333.js +1 -0
- package/dashboard/.next/static/chunks/c75e29e3.d91220f782934d80.js +1 -0
- package/dashboard/.next/static/chunks/{main-cc3a889b25e9aa68.js → main-9c95a7ffedc7afb4.js} +1 -1
- package/dashboard/.next/static/chunks/webpack-6da70e4f9fcf1799.js +1 -0
- package/dashboard/.next/static/css/ceafd91ca8dd753d.css +3 -0
- package/dashboard/.next/static/css/e4aad1f9c715b79a.css +1 -0
- package/dashboard/.next/static/media/Assistant-Bold.c8f39f24.woff2 +0 -0
- package/dashboard/.next/static/media/Assistant-Medium.1e75d8e6.woff2 +0 -0
- package/dashboard/.next/static/media/Assistant-Regular.7acbabb8.woff2 +0 -0
- package/dashboard/.next/static/media/Assistant-SemiBold.167acbf8.woff2 +0 -0
- package/dashboard/app/api/code/route.ts +26 -20
- package/dashboard/app/api/comments/route.ts +158 -0
- package/dashboard/app/api/diagrams/[name]/export/route.ts +26 -0
- package/dashboard/app/api/diagrams/[name]/resolve/route.ts +25 -0
- package/dashboard/app/api/diagrams/[name]/route.ts +37 -0
- package/dashboard/app/api/figures/[name]/route.ts +15 -0
- package/dashboard/app/api/focus/route.ts +35 -0
- package/dashboard/app/api/invariants/[id]/route.ts +35 -0
- package/dashboard/app/api/issues/[id]/revert-auto/route.ts +18 -0
- package/dashboard/app/api/nav/route.ts +120 -0
- package/dashboard/app/api/palette/route.ts +68 -0
- package/dashboard/app/api/progress/route.ts +54 -23
- package/dashboard/app/api/xref/route.ts +30 -0
- package/dashboard/app/changes/ChangesClient.tsx +730 -356
- package/dashboard/app/changes/page.tsx +27 -19
- package/dashboard/app/excalidraw-assets/[...path]/route.ts +56 -0
- package/dashboard/app/globals.css +231 -77
- package/dashboard/app/issues/BoardClient.tsx +817 -0
- package/dashboard/app/issues/page.tsx +27 -272
- package/dashboard/app/layout.tsx +32 -17
- package/dashboard/app/model/ModelClient.tsx +1303 -0
- package/dashboard/app/model/page.tsx +98 -0
- package/dashboard/app/page.tsx +191 -277
- package/dashboard/app/report/ReportClient.tsx +147 -74
- package/dashboard/app/report/page.tsx +25 -14
- package/dashboard/app/review/ReviewClient.tsx +1180 -0
- package/dashboard/app/review/page.tsx +93 -0
- package/dashboard/components/AutoRefresh.tsx +22 -19
- package/dashboard/components/CodeComments.tsx +303 -0
- package/dashboard/components/CodeNav.tsx +523 -0
- package/dashboard/components/CodeReference.tsx +92 -99
- package/dashboard/components/CodeViewer.tsx +526 -0
- package/dashboard/components/CommandPalette.tsx +141 -66
- package/dashboard/components/DiagramCanvas.tsx +275 -0
- package/dashboard/components/DianeNote.tsx +244 -0
- package/dashboard/components/LiveStatus.tsx +30 -68
- package/dashboard/components/MarkdownRenderer.tsx +34 -32
- package/dashboard/components/RecordButton.tsx +132 -0
- package/dashboard/components/ui/Button.tsx +39 -0
- package/dashboard/components/ui/Chip.tsx +37 -0
- package/dashboard/components/ui/EmptyState.tsx +31 -0
- package/dashboard/components/ui/Icons.tsx +126 -0
- package/dashboard/components/ui/Inspector.tsx +122 -0
- package/dashboard/components/ui/Kbd.tsx +15 -0
- package/dashboard/components/ui/ListRow.tsx +92 -0
- package/dashboard/components/ui/LocalTime.tsx +14 -0
- package/dashboard/components/ui/ProgressRing.tsx +54 -0
- package/dashboard/components/ui/ResizeHandle.tsx +93 -0
- package/dashboard/components/ui/RiskMeter.tsx +27 -0
- package/dashboard/components/ui/SearchField.tsx +55 -0
- package/dashboard/components/ui/SegmentedControl.tsx +71 -0
- package/dashboard/components/ui/SeverityDot.tsx +57 -0
- package/dashboard/components/ui/Sidebar.tsx +236 -0
- package/dashboard/components/ui/SplitView.tsx +122 -0
- package/dashboard/components/ui/StateGlyph.tsx +66 -0
- package/dashboard/components/ui/Toast.tsx +91 -0
- package/dashboard/lib/api.ts +17 -0
- package/dashboard/lib/cn.ts +4 -0
- package/dashboard/lib/data.ts +2 -21
- package/dashboard/lib/finding-markdown.ts +1 -1
- package/dashboard/lib/focus.ts +42 -0
- package/dashboard/lib/hotkeys.ts +41 -0
- package/dashboard/lib/inline-markdown.test.ts +11 -0
- package/dashboard/lib/live.ts +32 -0
- package/dashboard/lib/pane-width.ts +36 -0
- package/dashboard/lib/server/board.ts +229 -0
- package/dashboard/lib/server/diagrams.ts +191 -0
- package/dashboard/lib/server/safe-path.ts +28 -0
- package/dashboard/lib/server/workspace.ts +113 -0
- package/dashboard/lib/server/xref.ts +42 -0
- package/dashboard/lib/solidity.test.ts +37 -0
- package/dashboard/lib/solidity.ts +191 -0
- package/dashboard/lib/source.ts +28 -0
- package/dashboard/lib/types.ts +164 -0
- package/dashboard/lib/url.ts +18 -0
- package/dashboard/lib/watcher.ts +31 -22
- package/dashboard/tailwind.config.ts +6 -3
- package/dist/analysis/code-model.d.ts.map +1 -1
- package/dist/analysis/code-model.js +4 -1
- package/dist/analysis/code-model.js.map +1 -1
- package/dist/analysis/diff.d.ts +12 -1
- package/dist/analysis/diff.d.ts.map +1 -1
- package/dist/analysis/diff.js +143 -0
- package/dist/analysis/diff.js.map +1 -1
- package/dist/commands/analyze.d.ts.map +1 -1
- package/dist/commands/analyze.js +17 -48
- package/dist/commands/analyze.js.map +1 -1
- package/dist/commands/claude.d.ts.map +1 -1
- package/dist/commands/claude.js +5 -0
- package/dist/commands/claude.js.map +1 -1
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +10 -2
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/diagram.d.ts +3 -0
- package/dist/commands/diagram.d.ts.map +1 -0
- package/dist/commands/diagram.js +71 -0
- package/dist/commands/diagram.js.map +1 -0
- package/dist/commands/diff.d.ts +4 -5
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +56 -17
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +5 -18
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/facts.d.ts +23 -0
- package/dist/commands/facts.d.ts.map +1 -0
- package/dist/commands/facts.js +121 -0
- package/dist/commands/facts.js.map +1 -0
- package/dist/commands/fix-review.d.ts +9 -0
- package/dist/commands/fix-review.d.ts.map +1 -0
- package/dist/commands/fix-review.js +367 -0
- package/dist/commands/fix-review.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +51 -47
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/issue.d.ts.map +1 -1
- package/dist/commands/issue.js +151 -2
- package/dist/commands/issue.js.map +1 -1
- package/dist/commands/mcp.d.ts +3 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +11 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/model.d.ts +4 -0
- package/dist/commands/model.d.ts.map +1 -0
- package/dist/commands/model.js +275 -0
- package/dist/commands/model.js.map +1 -0
- package/dist/commands/note.d.ts.map +1 -1
- package/dist/commands/note.js +31 -1
- package/dist/commands/note.js.map +1 -1
- package/dist/commands/review.d.ts +4 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +164 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/core/comments.d.ts +59 -0
- package/dist/core/comments.d.ts.map +1 -0
- package/dist/core/comments.js +263 -0
- package/dist/core/comments.js.map +1 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +0 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/dedup.d.ts +56 -0
- package/dist/core/dedup.d.ts.map +1 -0
- package/dist/core/dedup.js +208 -0
- package/dist/core/dedup.js.map +1 -0
- package/dist/core/errors.d.ts +1 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +0 -15
- package/dist/core/errors.js.map +1 -1
- package/dist/core/external-tools.d.ts +0 -14
- package/dist/core/external-tools.d.ts.map +1 -1
- package/dist/core/external-tools.js +2 -52
- package/dist/core/external-tools.js.map +1 -1
- package/dist/core/fix-review.d.ts +54 -0
- package/dist/core/fix-review.d.ts.map +1 -0
- package/dist/core/fix-review.js +98 -0
- package/dist/core/fix-review.js.map +1 -0
- package/dist/core/fuzz-sync.d.ts +93 -0
- package/dist/core/fuzz-sync.d.ts.map +1 -0
- package/dist/core/fuzz-sync.js +516 -0
- package/dist/core/fuzz-sync.js.map +1 -0
- package/dist/core/git.d.ts +7 -0
- package/dist/core/git.d.ts.map +1 -1
- package/dist/core/git.js +42 -0
- package/dist/core/git.js.map +1 -1
- package/dist/core/issues.d.ts +32 -1
- package/dist/core/issues.d.ts.map +1 -1
- package/dist/core/issues.js +135 -3
- package/dist/core/issues.js.map +1 -1
- package/dist/core/mcp-config.d.ts +12 -0
- package/dist/core/mcp-config.d.ts.map +1 -0
- package/dist/core/mcp-config.js +29 -0
- package/dist/core/mcp-config.js.map +1 -0
- package/dist/core/model.d.ts +38 -0
- package/dist/core/model.d.ts.map +1 -0
- package/dist/core/model.js +160 -0
- package/dist/core/model.js.map +1 -0
- package/dist/core/notes.d.ts +2 -0
- package/dist/core/notes.d.ts.map +1 -1
- package/dist/core/notes.js +13 -3
- package/dist/core/notes.js.map +1 -1
- package/dist/core/review.d.ts +47 -0
- package/dist/core/review.d.ts.map +1 -1
- package/dist/core/review.js +177 -1
- package/dist/core/review.js.map +1 -1
- package/dist/core/rules.d.ts +12 -0
- package/dist/core/rules.d.ts.map +1 -0
- package/dist/core/rules.js +66 -0
- package/dist/core/rules.js.map +1 -0
- package/dist/core/schema.d.ts +4817 -2245
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/schema.js +452 -113
- package/dist/core/schema.js.map +1 -1
- package/dist/core/scope.d.ts +8 -0
- package/dist/core/scope.d.ts.map +1 -0
- package/dist/core/scope.js +18 -0
- package/dist/core/scope.js.map +1 -0
- package/dist/diagrams/build.d.ts +18 -0
- package/dist/diagrams/build.d.ts.map +1 -0
- package/dist/diagrams/build.js +135 -0
- package/dist/diagrams/build.js.map +1 -0
- package/dist/diagrams/excalidraw.d.ts +27 -0
- package/dist/diagrams/excalidraw.d.ts.map +1 -0
- package/dist/diagrams/excalidraw.js +219 -0
- package/dist/diagrams/excalidraw.js.map +1 -0
- package/dist/diagrams/layout.d.ts +48 -0
- package/dist/diagrams/layout.d.ts.map +1 -0
- package/dist/diagrams/layout.js +686 -0
- package/dist/diagrams/layout.js.map +1 -0
- package/dist/facts/build.d.ts +23 -0
- package/dist/facts/build.d.ts.map +1 -0
- package/dist/facts/build.js +112 -0
- package/dist/facts/build.js.map +1 -0
- package/dist/facts/extract.d.ts +53 -0
- package/dist/facts/extract.d.ts.map +1 -0
- package/dist/facts/extract.js +635 -0
- package/dist/facts/extract.js.map +1 -0
- package/dist/facts/fallback.d.ts +7 -0
- package/dist/facts/fallback.d.ts.map +1 -0
- package/dist/facts/fallback.js +156 -0
- package/dist/facts/fallback.js.map +1 -0
- package/dist/facts/implementations.d.ts +29 -0
- package/dist/facts/implementations.d.ts.map +1 -0
- package/dist/facts/implementations.js +43 -0
- package/dist/facts/implementations.js.map +1 -0
- package/dist/facts/query.d.ts +35 -0
- package/dist/facts/query.d.ts.map +1 -0
- package/dist/facts/query.js +157 -0
- package/dist/facts/query.js.map +1 -0
- package/dist/facts/xref.d.ts +53 -0
- package/dist/facts/xref.d.ts.map +1 -0
- package/dist/facts/xref.js +282 -0
- package/dist/facts/xref.js.map +1 -0
- package/dist/index.js +14 -16
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts +3 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +400 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/skills/ai-audit/SKILL.md +16 -6
- package/dist/skills/ai-audit/UPSTREAM.md +9 -4
- package/dist/skills/ai-audit/references/hex-board.md +34 -46
- package/dist/skills/diane.md +26 -12
- package/dist/skills/fix-review.md +58 -0
- package/dist/skills/fuzz/LICENSE +21 -0
- package/dist/skills/fuzz/SKILL.md +655 -0
- package/dist/skills/fuzz/UPSTREAM.md +119 -0
- package/dist/skills/fuzz/agents/implementers/global-property-implementer.md +81 -0
- package/dist/skills/fuzz/agents/implementers/specific-property-implementer.md +121 -0
- package/dist/skills/fuzz/agents/invariant-discovery/adversarial-profit-maximizer.md +123 -0
- package/dist/skills/fuzz/agents/invariant-discovery/conservation-auditor.md +92 -0
- package/dist/skills/fuzz/agents/invariant-discovery/protocol-type-specialist.md +173 -0
- package/dist/skills/fuzz/agents/invariant-discovery/roundtrip-rounding-analyst.md +164 -0
- package/dist/skills/fuzz/agents/invariant-discovery/state-transition-mapper.md +92 -0
- package/dist/skills/fuzz/agents/invariant-discovery/synthesizer.md +261 -0
- package/dist/skills/fuzz/agents/protocol-analyzer.md +80 -0
- package/dist/skills/fuzz/agents/report-writer.md +135 -0
- package/dist/skills/fuzz/references/handler-patterns.md +222 -0
- package/dist/skills/fuzz/references/hex-invariants.md +102 -0
- package/dist/skills/fuzz/references/property-generation.md +149 -0
- package/dist/skills/fuzz/references/selection-policy.md +49 -0
- package/dist/skills/fuzz/references/setup-playbook.md +92 -0
- package/dist/skills/fuzz/references/template-map.md +121 -0
- package/dist/skills/fuzz/scripts/ensure_foundry.sh +125 -0
- package/dist/skills/fuzz/scripts/estimate_cost.js +157 -0
- package/dist/skills/fuzz/scripts/extract_abis.js +303 -0
- package/dist/skills/fuzz/scripts/fizz_sync.js +692 -0
- package/dist/skills/fuzz/scripts/generate_handlers.js +370 -0
- package/dist/skills/fuzz/scripts/generate_suite.js +254 -0
- package/dist/skills/fuzz/scripts/lib/log-viewer.js +332 -0
- package/dist/skills/fuzz/scripts/run_echidna.js +192 -0
- package/dist/skills/fuzz/scripts/run_medusa.js +329 -0
- package/dist/skills/fuzz/scripts/select_functions.js +637 -0
- package/dist/skills/fuzz/scripts/setup_fuzz_profile.sh +142 -0
- package/dist/skills/fuzz/templates/Actor.sol +63 -0
- package/dist/skills/fuzz/templates/Base.sol +121 -0
- package/dist/skills/fuzz/templates/FoundryTester.sol +29 -0
- package/dist/skills/fuzz/templates/FuzzTester.sol +11 -0
- package/dist/skills/fuzz/templates/Properties.sol +17 -0
- package/dist/skills/fuzz/templates/README.md +56 -0
- package/dist/skills/fuzz/templates/Snapshots.sol +26 -0
- package/dist/skills/fuzz/templates/echidna.yaml +18 -0
- package/dist/skills/fuzz/templates/handlers/Handlers.sol +13 -0
- package/dist/skills/fuzz/templates/medusa.json +93 -0
- package/dist/skills/fuzz/templates/utils/Clamp.sol +223 -0
- package/dist/skills/fuzz/templates/utils/DecimalPrinter.sol +63 -0
- package/dist/skills/fuzz/templates/utils/Deployer.sol +17 -0
- package/dist/skills/fuzz/templates/utils/EnumerableSet.sol +206 -0
- package/dist/skills/fuzz/templates/utils/Hevm.sol +62 -0
- package/dist/skills/fuzz/templates/utils/Logger.sol +619 -0
- package/dist/skills/fuzz/templates/utils/Math.sol +52 -0
- package/dist/skills/fuzz/templates/utils/MockERC20.sol +279 -0
- package/dist/skills/fuzz/templates/utils/PropertiesAsserts.sol +238 -0
- package/dist/skills/fuzz/templates/utils/StringUtils.sol +85 -0
- package/dist/skills/fuzz-convert/SKILL.md +249 -0
- package/dist/skills/fuzz-sync/SKILL.md +342 -0
- package/dist/skills/generate-poc.md +8 -26
- package/dist/skills/generate-report.md +17 -5
- package/dist/skills/ingest-aa-report.md +11 -30
- package/dist/skills/init-audit/SKILL.md +155 -0
- package/dist/skills/init-audit/references/agents/conformance-checker.md +36 -0
- package/dist/skills/init-audit/references/agents/contract-reader.md +59 -0
- package/dist/skills/init-audit/references/agents/diagram-composer.md +48 -0
- package/dist/skills/init-audit/references/agents/docs-extractor.md +26 -0
- package/dist/skills/init-audit/references/agents/prior-audit.md +32 -0
- package/dist/skills/init-audit/references/agents/regression-checker.md +28 -0
- package/dist/skills/init-audit/references/agents/skeptic.md +31 -0
- package/dist/skills/init-audit/references/agents/standards-checker.md +39 -0
- package/dist/skills/init-audit/references/agents/synthesizer.md +50 -0
- package/dist/skills/prevalidate.md +62 -0
- package/dist/skills/sync-issues.md +11 -25
- package/dist/skills/validate-all-findings.md +2 -2
- package/dist/skills/validate-finding.md +25 -24
- package/dist/skills/write-finding.md +6 -5
- package/dist/types/index.d.ts +16 -12
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +5 -4
- package/dashboard/.next/server/app/access/page.js +0 -1
- package/dashboard/.next/server/app/access/page_client-reference-manifest.js +0 -1
- package/dashboard/.next/server/app/api/flows/route.js +0 -1
- package/dashboard/.next/server/app/api/mermaid/route.js +0 -1
- package/dashboard/.next/server/app/calls/page.js +0 -1
- package/dashboard/.next/server/app/calls/page_client-reference-manifest.js +0 -1
- package/dashboard/.next/server/app/conformance/page.js +0 -1
- package/dashboard/.next/server/app/conformance/page.js.nft.json +0 -1
- package/dashboard/.next/server/app/conformance/page_client-reference-manifest.js +0 -1
- package/dashboard/.next/server/app/diagram/page.js +0 -1
- package/dashboard/.next/server/app/diagram/page.js.nft.json +0 -1
- package/dashboard/.next/server/app/diagram/page_client-reference-manifest.js +0 -1
- package/dashboard/.next/server/app/flows/page.js +0 -1
- package/dashboard/.next/server/app/flows/page.js.nft.json +0 -1
- package/dashboard/.next/server/app/flows/page_client-reference-manifest.js +0 -1
- package/dashboard/.next/server/app/functions/page.js +0 -1
- package/dashboard/.next/server/app/functions/page.js.nft.json +0 -1
- package/dashboard/.next/server/app/functions/page_client-reference-manifest.js +0 -1
- package/dashboard/.next/server/app/notes/page.js +0 -22
- package/dashboard/.next/server/app/notes/page.js.nft.json +0 -1
- package/dashboard/.next/server/app/notes/page_client-reference-manifest.js +0 -1
- package/dashboard/.next/server/app/progress/page.js +0 -1
- package/dashboard/.next/server/app/progress/page.js.nft.json +0 -1
- package/dashboard/.next/server/app/progress/page_client-reference-manifest.js +0 -1
- package/dashboard/.next/server/app/stats/page.js +0 -1
- package/dashboard/.next/server/app/stats/page.js.nft.json +0 -1
- package/dashboard/.next/server/app/stats/page_client-reference-manifest.js +0 -1
- package/dashboard/.next/server/chunks/530.js +0 -1
- package/dashboard/.next/server/chunks/622.js +0 -3
- package/dashboard/.next/server/chunks/665.js +0 -13
- package/dashboard/.next/server/chunks/939.js +0 -1
- package/dashboard/.next/static/chunks/3017.4a5312e3c20a173f.js +0 -1
- package/dashboard/.next/static/chunks/7397-37adf76cad543297.js +0 -1
- package/dashboard/.next/static/chunks/7973.e34032723285a616.js +0 -79
- package/dashboard/.next/static/chunks/8452-6d77fa353402422c.js +0 -13
- package/dashboard/.next/static/chunks/8928-fc049decdfbdaa6d.js +0 -1
- package/dashboard/.next/static/chunks/app/access/page-f8403cbdfc1c176b.js +0 -1
- package/dashboard/.next/static/chunks/app/calls/page-41f20d01e12382ef.js +0 -1
- package/dashboard/.next/static/chunks/app/changes/page-82bf8b6f48cdc506.js +0 -1
- package/dashboard/.next/static/chunks/app/conformance/page-6bb8e3b372e38098.js +0 -1
- package/dashboard/.next/static/chunks/app/diagram/page-469cd7a6f183efba.js +0 -1
- package/dashboard/.next/static/chunks/app/flows/page-7872dd9141ba0b07.js +0 -1
- package/dashboard/.next/static/chunks/app/functions/page-5847bcb77a8e7edf.js +0 -1
- package/dashboard/.next/static/chunks/app/issues/page-1ffc64fe40439002.js +0 -1
- package/dashboard/.next/static/chunks/app/layout-6c6d2a0fd7c989d3.js +0 -1
- package/dashboard/.next/static/chunks/app/notes/page-8bcaa52304500098.js +0 -1
- package/dashboard/.next/static/chunks/app/page-d63800ddb072b77b.js +0 -1
- package/dashboard/.next/static/chunks/app/progress/page-e26554f655a62eef.js +0 -1
- package/dashboard/.next/static/chunks/app/report/page-18c04fb2f193b020.js +0 -1
- package/dashboard/.next/static/chunks/app/stats/page-67ff59fd69bed651.js +0 -1
- package/dashboard/.next/static/chunks/webpack-4de0e79bdd6a0418.js +0 -1
- package/dashboard/.next/static/css/1112cea2260b3926.css +0 -3
- package/dashboard/app/access/AccessClient.tsx +0 -402
- package/dashboard/app/access/ReadOnlyFunctions.tsx +0 -114
- package/dashboard/app/access/page.tsx +0 -125
- package/dashboard/app/api/flows/route.ts +0 -32
- package/dashboard/app/api/mermaid/route.ts +0 -25
- package/dashboard/app/calls/CallsClient.tsx +0 -170
- package/dashboard/app/calls/page.tsx +0 -57
- package/dashboard/app/conformance/ConformanceTable.tsx +0 -214
- package/dashboard/app/conformance/page.tsx +0 -186
- package/dashboard/app/diagram/page.tsx +0 -65
- package/dashboard/app/flows/page.tsx +0 -102
- package/dashboard/app/functions/FunctionsClient.tsx +0 -167
- package/dashboard/app/functions/page.tsx +0 -178
- package/dashboard/app/issues/IssuesBoardClient.tsx +0 -813
- package/dashboard/app/notes/NotesClient.tsx +0 -706
- package/dashboard/app/notes/page.tsx +0 -47
- package/dashboard/app/progress/ProgressClient.tsx +0 -354
- package/dashboard/app/progress/page.tsx +0 -127
- package/dashboard/app/stats/StatsClient.tsx +0 -452
- package/dashboard/app/stats/page.tsx +0 -50
- package/dashboard/components/ConfidenceBadge.tsx +0 -53
- package/dashboard/components/DashboardLayout.tsx +0 -510
- package/dashboard/components/FilterableTable.tsx +0 -293
- package/dashboard/components/MermaidViewer.tsx +0 -267
- package/dashboard/components/NotYetGenerated.tsx +0 -32
- package/dashboard/components/SeverityBadge.tsx +0 -28
- package/dashboard/components/SignalBars.tsx +0 -27
- package/dashboard/components/SortableTable.tsx +0 -122
- package/dashboard/lib/conformance-tokens.ts +0 -49
- package/dist/skills/init-audit.md +0 -386
- /package/dashboard/.next/server/app/api/{flows → xref}/route.js.nft.json +0 -0
- /package/dashboard/.next/server/app/{api/mermaid → excalidraw-assets/[...path]}/route.js.nft.json +0 -0
- /package/dashboard/.next/static/{z5XBev05xDAkDrxWxAjNu → bGV1ry1vvIbM5b506eVBR}/_buildManifest.js +0 -0
- /package/dashboard/.next/static/{z5XBev05xDAkDrxWxAjNu → bGV1ry1vvIbM5b506eVBR}/_ssgManifest.js +0 -0
- /package/dashboard/.next/static/chunks/{3205-47d09be47325709f.js → 3205-fd963acf2fdfd080.js} +0 -0
- /package/dashboard/.next/static/chunks/{3924-88d849290406ee6f.js → 3924-f1f85ccc7d59d7ab.js} +0 -0
- /package/dashboard/.next/static/chunks/{618f8807-69fc7bb97c2b87c1.js → 618f8807-fbb1466bc29c17c6.js} +0 -0
- /package/dashboard/.next/static/chunks/{7498-d1814d68ba346d13.js → 7498-7cf464d8af69cd0a.js} +0 -0
- /package/dashboard/.next/static/chunks/app/_not-found/{page-c299b935209993df.js → page-5ff5d54b6fd6f17e.js} +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Template Map
|
|
2
|
+
|
|
3
|
+
Maps each generated file to its role in the inheritance chain and generation phase.
|
|
4
|
+
|
|
5
|
+
## Inheritance Chain
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Base (is StringUtils, Clamp, Deployer, Math)
|
|
9
|
+
└─► Snapshots (is Base)
|
|
10
|
+
└─► Properties (is PropertiesAsserts, Snapshots)
|
|
11
|
+
└─► <Contract>Handler (is Properties) — one per target contract
|
|
12
|
+
└─► Handlers (is <all handlers>) — aggregator + actor switching
|
|
13
|
+
├─► FuzzTester (is Handlers) — Echidna/Medusa entry point
|
|
14
|
+
└─► FoundryTester (is Test, Handlers) — Foundry quick debug/PoC entry point
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## File Descriptions
|
|
18
|
+
|
|
19
|
+
### Core files (scaffolded, then refined)
|
|
20
|
+
|
|
21
|
+
| File | Phase | Role |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `Actor.sol` | Step 5 + Step 6 | Actor contract representing a user. Holds ETH, has `forceSendETH`, ERC-721/1155 receivers, flash loan callback. Copied in Step 5 and then modified with protocol-specific approvals and setup needs. |
|
|
24
|
+
| `Base.sol` | Step 5 + Step 6 + Step 9 | Constants, state variables, ghost struct, actor management, contract instances. Copied in Step 5, wired in Step 6, and extended in Step 9. |
|
|
25
|
+
| `README.md` | Step 5 | Reader-facing overview of the generated suite, its key files, and the standard commands to run it. Intended for users or agents who did not build the harness originally. |
|
|
26
|
+
| `Snapshots.sol` | Step 5 + Step 6 + Step 9 | Before/after state tracking. Copied in Step 5, kept minimal in Step 6, and populated during invariant generation. |
|
|
27
|
+
| `Properties.sol` | Step 5 + Step 6 + Step 9 | Property container. Copied in Step 5, kept minimal in Step 6, and populated with checks in Step 9. |
|
|
28
|
+
| `handlers/Handlers.sol` | Step 5 + Step 6 + Step 7 | Aggregator copied in Step 5, then populated from the selected contracts so it imports and inherits all generated handler stubs. It can be adjusted in Step 6 if needed and refined again in Step 7. |
|
|
29
|
+
| `handlers/<Contract>Handler.sol` | Step 5 + Step 7 | Per-contract handler file in `{SUITE_DIR}`. Stub handler templates are generated in Step 5 from `.hex/fuzz/fizz_data/entry-point-selection.json`, then replaced or rewritten in Step 7. |
|
|
30
|
+
| `harness/<Contract>Harness.sol` | Step 9 (conditional) | Harness contract that inherits from a target contract and exposes private/internal state needed by a property. Created only when strictly necessary. When present, `Base.sol` instantiates the harness instead of the target contract. |
|
|
31
|
+
| `FuzzTester.sol` | Step 5 | Echidna/Medusa entry point. Copied in Step 5 and never modified. Inherits everything through `Handlers`. |
|
|
32
|
+
| `FoundryTester.sol` | Step 5 | Foundry quick debug and PoC harness. Copied in Step 5 and never modified structurally, but used actively during Step 8 and Step 10 to debug coverage gaps and validate hypotheses. Inherits everything through `Handlers`. |
|
|
33
|
+
|
|
34
|
+
### Workflow metadata (generated during the workflow)
|
|
35
|
+
|
|
36
|
+
| File | Phase | Role |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| `.hex/fuzz/fizz_data/contracts.json` | Step 2 | Extracted contract/function inventory used as the structural input for selection and later analysis. |
|
|
39
|
+
| `.hex/fuzz/fizz_data/entry-point-selection.json` | Step 4 | Auto-accepted selection of contracts and functions that limits handler generation only. |
|
|
40
|
+
| `.hex/fuzz/fizz_data/protocol-understanding.md` | Step 3 fallback | Persisted protocol understanding notes when the Hex protocol model (`.hex/model/protocol.json`) is unavailable. |
|
|
41
|
+
| `.hex/fuzz/fizz_data/hex-invariants.json` | Step 3 | The accepted Hex invariants for this run (`hex invariant list --status accepted --json`). |
|
|
42
|
+
| `.hex/fuzz/PROPERTIES.md` | Step 9c | English property spec; every entry carries the `(INV-NNN)` it fuzzes. |
|
|
43
|
+
|
|
44
|
+
### Utility files (static, not edited)
|
|
45
|
+
|
|
46
|
+
| File | Role |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `utils/Clamp.sol` | Clamping functions: `clampBetween`, `clampLt`, `clampLte`, `clampGt`, `clampGte` (uint256 + int256). |
|
|
49
|
+
| `utils/Hevm.sol` | Cheatcode interface (`vm.prank`, `vm.roll`, `vm.warp`, `vm.label`, etc.). |
|
|
50
|
+
| `utils/PropertiesAsserts.sol` | Assertion helpers for properties: `t()`, `eq()`, `neq()`, `gt()`, `gte()`, `lt()`, `lte()`. |
|
|
51
|
+
| `utils/Logger.sol` | Event-based logging for fuzzer trace output. |
|
|
52
|
+
| `utils/Math.sol` | Math helpers (`abs`, etc.). |
|
|
53
|
+
| `utils/StringUtils.sol` | Number-to-string conversion for log messages. |
|
|
54
|
+
| `utils/Deployer.sol` | Deployment helpers. |
|
|
55
|
+
| `utils/DecimalPrinter.sol` | Decimal formatting for uint values. |
|
|
56
|
+
| `utils/EnumerableSet.sol` | OpenZeppelin-style enumerable set for tracking addresses/uints. |
|
|
57
|
+
| `utils/MockERC20.sol` | Simple mintable ERC20 mock for external token dependencies, seeded balances, and token-donation edge cases in the generated harness. |
|
|
58
|
+
|
|
59
|
+
### Config files (project root)
|
|
60
|
+
|
|
61
|
+
| File | Role |
|
|
62
|
+
|---|---|
|
|
63
|
+
| `echidna.yaml` | Echidna fuzzer configuration. Points to `FuzzTester` as test target. |
|
|
64
|
+
| `medusa.json` | Medusa fuzzer configuration. Points to `FuzzTester` as test target. |
|
|
65
|
+
|
|
66
|
+
## Output Structure
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
.hex/fuzz/
|
|
70
|
+
├── PROPERTIES.md # English property spec, one entry per accepted invariant
|
|
71
|
+
└── fizz_data/
|
|
72
|
+
|
|
73
|
+
.hex/fuzz/fizz_data/
|
|
74
|
+
├── hex-invariants.json # Accepted Hex invariants for this run
|
|
75
|
+
├── contracts.json # Extracted contract/function inventory
|
|
76
|
+
├── entry-point-selection.json # Auto-accepted handler-generation scope
|
|
77
|
+
├── protocol-understanding.md # Fallback understanding notes when needed
|
|
78
|
+
├── corpus_echidna/
|
|
79
|
+
├── corpus_medusa/
|
|
80
|
+
├── crytic-export/
|
|
81
|
+
├── logs_medusa/
|
|
82
|
+
└── ...
|
|
83
|
+
|
|
84
|
+
./
|
|
85
|
+
├── echidna.yaml
|
|
86
|
+
├── medusa.json
|
|
87
|
+
└── ...
|
|
88
|
+
|
|
89
|
+
test/fizz/
|
|
90
|
+
├── README.md # Human/agent-oriented suite overview and runbook
|
|
91
|
+
├── Actor.sol
|
|
92
|
+
├── Base.sol # Contract declarations, setup, ghosts, helpers
|
|
93
|
+
├── Properties.sol # Invariant checks
|
|
94
|
+
├── Snapshots.sol # Before/after state tracking
|
|
95
|
+
├── FuzzTester.sol # Echidna/Medusa entry point
|
|
96
|
+
├── FoundryTester.sol # Foundry quick debug/PoC harness
|
|
97
|
+
├── handlers/
|
|
98
|
+
│ ├── Handlers.sol # Aggregator — inherits all per-contract handlers
|
|
99
|
+
│ ├── VaultHandler.sol # Example: handlers for Vault contract
|
|
100
|
+
│ └── TokenHandler.sol # Example: handlers for Token contract
|
|
101
|
+
├── harness/ # Optional — only created when properties need private/internal access
|
|
102
|
+
│ └── VaultHarness.sol # Example: exposes internal state from Vault
|
|
103
|
+
└── utils/
|
|
104
|
+
├── Clamp.sol # Clamping helpers (clampBetween, clampLt, etc.)
|
|
105
|
+
├── DecimalPrinter.sol
|
|
106
|
+
├── Deployer.sol
|
|
107
|
+
├── EnumerableSet.sol
|
|
108
|
+
├── Hevm.sol # Cheatcode interface
|
|
109
|
+
├── Logger.sol
|
|
110
|
+
├── Math.sol
|
|
111
|
+
├── MockERC20.sol # Mintable ERC20 mock for external token dependencies
|
|
112
|
+
├── PropertiesAsserts.sol
|
|
113
|
+
└── StringUtils.sol
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Generation Phases Summary
|
|
117
|
+
|
|
118
|
+
1. **Template copy** — The full template scaffold and fuzzer config are copied into place.
|
|
119
|
+
2. **Core refinement** — `Base.sol`, `Actor.sol`, `Snapshots.sol`, `Properties.sol`, and `Handlers.sol` are modified to match the target protocol. `FuzzTester.sol` is the static fuzzer entry point — copied once and never modified. `FoundryTester.sol` is the debugging harness — also never modified structurally, but used actively in Steps 8 and 10.
|
|
120
|
+
3. **Handler gen** — Selected-contract handler stubs are replaced with protocol-specific handlers, and `Handlers.sol` is refined with the final imports and inheritance.
|
|
121
|
+
4. **Invariant gen** — `Properties.sol` gets invariant checks, `Snapshots.sol` gets tracked state, `Base.sol` gets ghosts, and handler files get ghost and snapshot wiring.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# ensure_foundry.sh — Ensure Foundry (forge), foundry.toml, and forge-std are available.
|
|
3
|
+
# Usage: ensure_foundry.sh [PROJECT_ROOT]
|
|
4
|
+
# Exit 0 on success, exit 1 with guidance if not.
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
PROJECT_ROOT="${1:-.}"
|
|
9
|
+
|
|
10
|
+
if [ ! -d "$PROJECT_ROOT" ]; then
|
|
11
|
+
echo "ERROR: project root does not exist: $PROJECT_ROOT"
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
# 1. Check forge is installed
|
|
16
|
+
if ! command -v forge &>/dev/null; then
|
|
17
|
+
echo "ERROR: forge not found in PATH."
|
|
18
|
+
echo ""
|
|
19
|
+
echo "Install Foundry:"
|
|
20
|
+
echo " curl -L https://foundry.paradigm.xyz | bash"
|
|
21
|
+
echo " foundryup"
|
|
22
|
+
echo ""
|
|
23
|
+
echo "Or see: https://www.getfoundry.sh/introduction/installation"
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
FORGE_VERSION=$(forge --version 2>&1 | head -1)
|
|
28
|
+
echo "Foundry detected: $FORGE_VERSION"
|
|
29
|
+
|
|
30
|
+
# 2. Create a compatible foundry.toml if missing
|
|
31
|
+
if [ ! -f "$PROJECT_ROOT/foundry.toml" ]; then
|
|
32
|
+
echo "foundry.toml not found — creating one in $PROJECT_ROOT ..."
|
|
33
|
+
cd "$PROJECT_ROOT"
|
|
34
|
+
HH_CONFIG=""
|
|
35
|
+
if [ -f "hardhat.config.ts" ]; then
|
|
36
|
+
HH_CONFIG="hardhat.config.ts"
|
|
37
|
+
elif [ -f "hardhat.config.js" ]; then
|
|
38
|
+
HH_CONFIG="hardhat.config.js"
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
if [ -n "$HH_CONFIG" ]; then
|
|
42
|
+
echo "Hardhat project detected — writing a Foundry-compatible config..."
|
|
43
|
+
|
|
44
|
+
# Hardhat-compatible layout per Foundry docs.
|
|
45
|
+
SRC_DIR=$(grep -oP "sources\s*:\s*['\"]?\K[^'\"',}]+" "$HH_CONFIG" 2>/dev/null | head -1 || true)
|
|
46
|
+
SRC_DIR="${SRC_DIR#./}"
|
|
47
|
+
if [ -z "$SRC_DIR" ]; then
|
|
48
|
+
if [ -d "contracts" ]; then
|
|
49
|
+
SRC_DIR="contracts"
|
|
50
|
+
elif [ -d "src" ]; then
|
|
51
|
+
SRC_DIR="src"
|
|
52
|
+
else
|
|
53
|
+
SRC_DIR="contracts"
|
|
54
|
+
fi
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
ARTIFACTS_DIR=$(grep -oP "artifacts\s*:\s*['\"]?\K[^'\"',}]+" "$HH_CONFIG" 2>/dev/null | head -1 || true)
|
|
58
|
+
ARTIFACTS_DIR="${ARTIFACTS_DIR#./}"
|
|
59
|
+
if [ -z "$ARTIFACTS_DIR" ]; then
|
|
60
|
+
ARTIFACTS_DIR="out"
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
SOLC_VERSION=$(perl -0ne 'print "$1\n" if /version\s*:\s*["'"'"']([^"'"'"']+)["'"'"']/s' "$HH_CONFIG" 2>/dev/null | head -1 || true)
|
|
64
|
+
OPTIMIZER_ENABLED=$(perl -0ne 'print "$1\n" if /optimizer\s*:\s*\{.*?enabled\s*:\s*(true|false)/s' "$HH_CONFIG" 2>/dev/null | head -1 || true)
|
|
65
|
+
OPTIMIZER_RUNS=$(perl -0ne 'print "$1\n" if /optimizer\s*:\s*\{.*?runs\s*:\s*(\d+)/s' "$HH_CONFIG" 2>/dev/null | head -1 || true)
|
|
66
|
+
EVM_VERSION=$(perl -0ne 'print "$1\n" if /evmVersion\s*:\s*["'"'"']([^"'"'"']+)["'"'"']/s' "$HH_CONFIG" 2>/dev/null | head -1 || true)
|
|
67
|
+
|
|
68
|
+
LIBS="[\"node_modules\", \"lib\"]"
|
|
69
|
+
|
|
70
|
+
REMAPPINGS=""
|
|
71
|
+
if [ -d "node_modules/@openzeppelin/contracts" ]; then
|
|
72
|
+
REMAPPINGS="$REMAPPINGS\"@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/\","
|
|
73
|
+
fi
|
|
74
|
+
if [ -d "node_modules/@openzeppelin/contracts-upgradeable" ]; then
|
|
75
|
+
REMAPPINGS="$REMAPPINGS\"@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/\","
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
cat > foundry.toml <<EOF
|
|
79
|
+
[profile.default]
|
|
80
|
+
src = "${SRC_DIR}"
|
|
81
|
+
out = "${ARTIFACTS_DIR}"
|
|
82
|
+
libs = ${LIBS}
|
|
83
|
+
EOF
|
|
84
|
+
|
|
85
|
+
if [ -n "$SOLC_VERSION" ]; then
|
|
86
|
+
echo "solc = \"${SOLC_VERSION}\"" >> foundry.toml
|
|
87
|
+
fi
|
|
88
|
+
if [ -n "$OPTIMIZER_ENABLED" ]; then
|
|
89
|
+
echo "optimizer = ${OPTIMIZER_ENABLED}" >> foundry.toml
|
|
90
|
+
fi
|
|
91
|
+
if [ -n "$OPTIMIZER_RUNS" ]; then
|
|
92
|
+
echo "optimizer_runs = ${OPTIMIZER_RUNS}" >> foundry.toml
|
|
93
|
+
fi
|
|
94
|
+
if [ -n "$EVM_VERSION" ]; then
|
|
95
|
+
echo "evm_version = \"${EVM_VERSION}\"" >> foundry.toml
|
|
96
|
+
fi
|
|
97
|
+
if [ -n "$REMAPPINGS" ]; then
|
|
98
|
+
REMAPPINGS="${REMAPPINGS%,}"
|
|
99
|
+
echo "remappings = [${REMAPPINGS}]" >> foundry.toml
|
|
100
|
+
fi
|
|
101
|
+
|
|
102
|
+
echo "foundry.toml configured for Hardhat layout (src=${SRC_DIR}, out=${ARTIFACTS_DIR}, libs=node_modules+lib)."
|
|
103
|
+
else
|
|
104
|
+
echo "Non-Hardhat project detected — writing a default Foundry config..."
|
|
105
|
+
cat > foundry.toml <<EOF
|
|
106
|
+
[profile.default]
|
|
107
|
+
src = "src"
|
|
108
|
+
out = "out"
|
|
109
|
+
libs = ["lib"]
|
|
110
|
+
EOF
|
|
111
|
+
fi
|
|
112
|
+
else
|
|
113
|
+
echo "foundry.toml detected."
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
# 3. Check forge-std is installed (required by FoundryTester.sol)
|
|
117
|
+
if [ ! -d "$PROJECT_ROOT/lib/forge-std" ]; then
|
|
118
|
+
echo "forge-std not found — installing..."
|
|
119
|
+
cd "$PROJECT_ROOT"
|
|
120
|
+
forge install foundry-rs/forge-std
|
|
121
|
+
echo "forge-std installed."
|
|
122
|
+
else
|
|
123
|
+
echo "forge-std detected."
|
|
124
|
+
fi
|
|
125
|
+
exit 0
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* estimate_cost.js
|
|
4
|
+
*
|
|
5
|
+
* Prints and writes a rough cost estimate for a Fizz run based on the
|
|
6
|
+
* selected entry points and the subagent model tier. Numbers are ballpark —
|
|
7
|
+
* actual cost varies with handler complexity, rerun cycles, coverage churn,
|
|
8
|
+
* and orchestrator context size.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* node estimate_cost.js <PROJECT_ROOT> [--meta-dir <dir>] [--model <sonnet|opus>] [--mode <guided|automatic>] [--output <path>]
|
|
12
|
+
*
|
|
13
|
+
* Defaults:
|
|
14
|
+
* --meta-dir .hex/fuzz/fizz_data
|
|
15
|
+
* --model sonnet
|
|
16
|
+
* --mode automatic
|
|
17
|
+
* --output <meta-dir>/cost-estimate.md
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
const path = require('path');
|
|
22
|
+
|
|
23
|
+
// ――― Pricing (USD per million tokens, Anthropic list price) ―――
|
|
24
|
+
const PRICING = {
|
|
25
|
+
sonnet: { input: 3, output: 15 },
|
|
26
|
+
opus: { input: 15, output: 75 },
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// ――― Per-stage baseline token usage (thousands, medium codebase = 1.0x) ―――
|
|
30
|
+
// Derived from observed Fizz runs in fizz-workspace/.
|
|
31
|
+
const STAGES = [
|
|
32
|
+
{ name: 'Protocol Analyzer (conditional)', count: 1, in_k: 50, out_k: 8, note: 'skipped when .hex/model/protocol.json exists' },
|
|
33
|
+
{ name: 'Discovery agents', count: 5, in_k: 80, out_k: 12, note: 'read all sources + handlers' },
|
|
34
|
+
{ name: 'Synthesizer', count: 1, in_k: 50, out_k: 12, note: 'merges 5 discovery outputs' },
|
|
35
|
+
{ name: 'Implementers', count: 2, in_k: 60, out_k: 15, note: 'edit Base / Snapshots / Properties / handlers' },
|
|
36
|
+
{ name: 'Report Writer', count: 1, in_k: 30, out_k: 8, note: 'synthesizes final report' },
|
|
37
|
+
{ name: 'Orchestrator overhead', count: 1, in_k: 250, out_k: 40, note: 'parent agent across all steps' },
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
// ――― Argument parsing ―――
|
|
41
|
+
|
|
42
|
+
const args = process.argv.slice(2);
|
|
43
|
+
if (args.length === 0 || args[0] === '--help') {
|
|
44
|
+
console.log('Usage: node estimate_cost.js <PROJECT_ROOT> [--meta-dir <dir>] [--model <sonnet|opus>] [--mode <guided|automatic>] [--output <path>]');
|
|
45
|
+
process.exit(0);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const projectRoot = path.resolve(args[0]);
|
|
49
|
+
let metaRelDir = '.hex/fuzz/fizz_data'; // Hex: was 'fizz_data'
|
|
50
|
+
let model = 'sonnet';
|
|
51
|
+
let mode = 'automatic';
|
|
52
|
+
let outputPath = '';
|
|
53
|
+
|
|
54
|
+
for (let i = 1; i < args.length; i++) {
|
|
55
|
+
if (args[i] === '--meta-dir' && args[i + 1]) { metaRelDir = args[++i]; }
|
|
56
|
+
else if (args[i] === '--model' && args[i + 1]) { model = args[++i].toLowerCase(); }
|
|
57
|
+
else if (args[i] === '--mode' && args[i + 1]) { mode = args[++i].toLowerCase(); }
|
|
58
|
+
else if (args[i] === '--output' && args[i + 1]) { outputPath = path.resolve(args[++i]); }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (!PRICING[model]) {
|
|
62
|
+
console.error(`Unknown --model: ${model}. Expected 'sonnet' or 'opus'.`);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const metaDir = path.join(projectRoot, metaRelDir);
|
|
67
|
+
const selectionPath = path.join(metaDir, 'entry-point-selection.json');
|
|
68
|
+
if (!outputPath) {
|
|
69
|
+
outputPath = path.join(metaDir, 'cost-estimate.md');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// ――― Read selection ―――
|
|
73
|
+
|
|
74
|
+
let contractCount = 0;
|
|
75
|
+
let functionCount = 0;
|
|
76
|
+
if (fs.existsSync(selectionPath)) {
|
|
77
|
+
try {
|
|
78
|
+
const selection = JSON.parse(fs.readFileSync(selectionPath, 'utf8'));
|
|
79
|
+
contractCount = selection.length;
|
|
80
|
+
for (const c of selection) functionCount += (c.functions || []).length;
|
|
81
|
+
} catch (e) {
|
|
82
|
+
console.error(`Failed to parse ${selectionPath}: ${e.message}`);
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
console.error(`entry-point-selection.json not found at ${selectionPath} — producing a generic estimate with no scaling.`);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ――― Size bucket ―――
|
|
90
|
+
|
|
91
|
+
function sizeBucket(f) {
|
|
92
|
+
if (f < 20) return { label: 'small', scale: 0.7 };
|
|
93
|
+
if (f < 50) return { label: 'medium', scale: 1.0 };
|
|
94
|
+
if (f < 100) return { label: 'large', scale: 1.4 };
|
|
95
|
+
return { label: 'xl', scale: 1.8 };
|
|
96
|
+
}
|
|
97
|
+
const bucket = sizeBucket(functionCount);
|
|
98
|
+
const scale = bucket.scale;
|
|
99
|
+
|
|
100
|
+
// ――― Compute per-stage and totals ―――
|
|
101
|
+
|
|
102
|
+
const price = PRICING[model];
|
|
103
|
+
let totalInK = 0;
|
|
104
|
+
let totalOutK = 0;
|
|
105
|
+
const rows = STAGES.map(s => {
|
|
106
|
+
const inK = s.count * s.in_k * scale;
|
|
107
|
+
const outK = s.count * s.out_k * scale;
|
|
108
|
+
totalInK += inK;
|
|
109
|
+
totalOutK += outK;
|
|
110
|
+
const costUsd = (inK * price.input + outK * price.output) / 1000;
|
|
111
|
+
return { ...s, inK, outK, costUsd };
|
|
112
|
+
});
|
|
113
|
+
const totalUsd = (totalInK * price.input + totalOutK * price.output) / 1000;
|
|
114
|
+
const lowUsd = totalUsd * 0.7;
|
|
115
|
+
const highUsd = totalUsd * 1.5;
|
|
116
|
+
|
|
117
|
+
// ――― Format output ―――
|
|
118
|
+
|
|
119
|
+
function fmtK(k) { return `${k.toFixed(1).replace(/\.0$/, '')}k`; }
|
|
120
|
+
function fmtUsd(v) { return `$${v.toFixed(2)}`; }
|
|
121
|
+
|
|
122
|
+
function pad(s, n) { return String(s).padEnd(n); }
|
|
123
|
+
function padL(s, n) { return String(s).padStart(n); }
|
|
124
|
+
|
|
125
|
+
const header = `| Stage | Count | Input | Output | Cost |`;
|
|
126
|
+
const sep = `|------------------------------------|-------|----------|---------|----------|`;
|
|
127
|
+
const bodyLines = rows.map(r => (
|
|
128
|
+
`| ${pad(r.name, 34)} | ${padL(r.count, 5)} | ${padL(fmtK(r.inK), 8)} | ${padL(fmtK(r.outK), 7)} | ${padL(fmtUsd(r.costUsd), 8)} |`
|
|
129
|
+
));
|
|
130
|
+
const totalLine = `| ${pad('TOTAL', 34)} | ${padL('', 5)} | ${padL(fmtK(totalInK), 8)} | ${padL(fmtK(totalOutK), 7)} | ${padL(fmtUsd(totalUsd), 8)} |`;
|
|
131
|
+
|
|
132
|
+
const md = [
|
|
133
|
+
`# Cost Estimate`,
|
|
134
|
+
``,
|
|
135
|
+
`Model: **${model}** (${fmtUsd(price.input)}/M input, ${fmtUsd(price.output)}/M output)`,
|
|
136
|
+
`Mode: **${mode}**`,
|
|
137
|
+
`Selected contracts: **${contractCount}**`,
|
|
138
|
+
`Selected functions: **${functionCount}** — scale ${scale}x (${bucket.label})`,
|
|
139
|
+
``,
|
|
140
|
+
header,
|
|
141
|
+
sep,
|
|
142
|
+
...bodyLines,
|
|
143
|
+
totalLine,
|
|
144
|
+
``,
|
|
145
|
+
`**Estimated total: ${fmtUsd(totalUsd)}** — expected range ${fmtUsd(lowUsd)} – ${fmtUsd(highUsd)}`,
|
|
146
|
+
``,
|
|
147
|
+
`These numbers are Anthropic list-price estimates for the subagents and a rough orchestrator overhead share. Actual cost varies with: coverage-iteration cycles (Step 8), re-runs after compile errors, handler complexity, whether the Hex protocol model skipped the Protocol Analyzer, and prompt-cache hit rate. Treat this as a ballpark, not a commitment.`,
|
|
148
|
+
``,
|
|
149
|
+
].join('\n');
|
|
150
|
+
|
|
151
|
+
// ――― Write file + print ―――
|
|
152
|
+
|
|
153
|
+
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
|
154
|
+
fs.writeFileSync(outputPath, md);
|
|
155
|
+
|
|
156
|
+
process.stdout.write(md);
|
|
157
|
+
process.stdout.write(`\nWrote: ${outputPath}\n`);
|