HyeonSang commited on
Commit
51a382b
·
verified ·
1 Parent(s): a24e504

Upload relay checkpoint generation e992db6a774f

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +3 -0
  2. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0112fc9b-c3b2-4084-8993-5a4abb1f54f1/CS_SOAP_Note_2024-03-01.docx +0 -0
  3. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0112fc9b-c3b2-4084-8993-5a4abb1f54f1/CS_SOAP_Note_2024-03-01.md +85 -0
  4. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/01d7e53e-0513-4109-a242-8ccaf442cd21/RecFit_Space_Use_and_Program_Agreement_Draft.docx +0 -0
  5. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/02314fc6-a24e-42f4-a8cd-362cae0f0ec1/Monthly_Safety_Compliance_Checklist.pdf +3 -0
  6. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/02314fc6-a24e-42f4-a8cd-362cae0f0ec1/build_safety_checklist.py +1256 -0
  7. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/02aa1805-c658-4069-8a6a-02dec146063a/Email_to_Manager_Well_Recommendations.eml +418 -0
  8. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/02aa1805-c658-4069-8a6a-02dec146063a/Illinois_Green_Hydrogen_Well_Screening.xlsx +0 -0
  9. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0353ee0c-18b5-4ad3-88e8-e001d223e1d7/Veterans PACT Act Comprehensive Guide.pdf +3 -0
  10. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0419f1c3-d669-45d0-81cd-f4d5923b06a5/John_Miller_Performance_Improvement_Plan.docx +0 -0
  11. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/05389f78-589a-473c-a4ae-67c61050bfca/Juvoxa_Model_A_Termination_Email.docx +0 -0
  12. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/05389f78-589a-473c-a4ae-67c61050bfca/Model_A_Headlamp_Supplier_Recovery_Report_to_CPO.docx +0 -0
  13. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix.zip +3 -0
  14. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/LICENSE +21 -0
  15. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/Makefile +22 -0
  16. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/README.md +162 -0
  17. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/SECURITY.md +34 -0
  18. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/Dockerfile +16 -0
  19. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/README.md +16 -0
  20. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/package.json +37 -0
  21. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/app.ts +88 -0
  22. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/config.ts +113 -0
  23. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/fees.ts +12 -0
  24. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/metrics.ts +37 -0
  25. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/schema.ts +55 -0
  26. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/server.ts +37 -0
  27. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/service.ts +295 -0
  28. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/store.ts +92 -0
  29. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/test/fees.test.ts +65 -0
  30. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/tsconfig.json +13 -0
  31. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/Dockerfile +11 -0
  32. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/index.html +17 -0
  33. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/nginx.conf +26 -0
  34. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/package.json +35 -0
  35. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/public/circuits/README.md +11 -0
  36. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/public/config/pools.example.json +27 -0
  37. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/public/config/pools.json +3 -0
  38. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/public/favicon.svg +4 -0
  39. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/App.tsx +116 -0
  40. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/components/ConnectWallet.tsx +61 -0
  41. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/components/DepositPanel.tsx +177 -0
  42. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/components/PoolSummary.tsx +35 -0
  43. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/components/WithdrawPanel.tsx +282 -0
  44. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/lib/config.ts +72 -0
  45. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/lib/format.test.ts +18 -0
  46. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/lib/format.ts +34 -0
  47. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/main.tsx +13 -0
  48. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/providers/WalletProvider.tsx +145 -0
  49. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/styles.css +215 -0
  50. _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/test/setup.ts +1 -0
.gitattributes CHANGED
@@ -189,3 +189,6 @@ reference_files/6cc99749ed5bed4887184afa367bf58d/LISA[[:space:]]STUDENT[[:space:
189
  reference_files/7fad57bbfa86d10ca8801bee5d034817/Reference[[:space:]]Inventory.xlsx filter=lfs diff=lfs merge=lfs -text
190
  reference_files/ca6c768fe272f61c00d001c884c42237/INPUT[[:space:]]4[[:space:]]BridgeMind[[:space:]]AI[[:space:]]POC[[:space:]]deployment[[:space:]]PROJECT[[:space:]]LOG.docx filter=lfs diff=lfs merge=lfs -text
191
  reference_files/de2375f30dc2f1a6155cda663e6f48fa/BOB[[:space:]]W2[[:space:]]COMPANY[[:space:]]X[[:space:]]edit.pdf filter=lfs diff=lfs merge=lfs -text
 
 
 
 
189
  reference_files/7fad57bbfa86d10ca8801bee5d034817/Reference[[:space:]]Inventory.xlsx filter=lfs diff=lfs merge=lfs -text
190
  reference_files/ca6c768fe272f61c00d001c884c42237/INPUT[[:space:]]4[[:space:]]BridgeMind[[:space:]]AI[[:space:]]POC[[:space:]]deployment[[:space:]]PROJECT[[:space:]]LOG.docx filter=lfs diff=lfs merge=lfs -text
191
  reference_files/de2375f30dc2f1a6155cda663e6f48fa/BOB[[:space:]]W2[[:space:]]COMPANY[[:space:]]X[[:space:]]edit.pdf filter=lfs diff=lfs merge=lfs -text
192
+ _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/02314fc6-a24e-42f4-a8cd-362cae0f0ec1/Monthly_Safety_Compliance_Checklist.pdf filter=lfs diff=lfs merge=lfs -text
193
+ _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0353ee0c-18b5-4ad3-88e8-e001d223e1d7/Veterans[[:space:]]PACT[[:space:]]Act[[:space:]]Comprehensive[[:space:]]Guide.pdf filter=lfs diff=lfs merge=lfs -text
194
+ _checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/1d4672c8-b0a7-488f-905f-9ab4e25a19f7/NexVen_International_Correlation_Analysis.pdf filter=lfs diff=lfs merge=lfs -text
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0112fc9b-c3b2-4084-8993-5a4abb1f54f1/CS_SOAP_Note_2024-03-01.docx ADDED
Binary file (42.8 kB). View file
 
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0112fc9b-c3b2-4084-8993-5a4abb1f54f1/CS_SOAP_Note_2024-03-01.md ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SOAP Note — Acute Head Injury
2
+
3
+ **Date of service:** 03/01/2024
4
+ **Patient:** C.S., 16-year-old male
5
+ **History source:** Patient
6
+
7
+ ## S — Subjective
8
+
9
+ **Chief complaint:** “Headache after falling off my skateboard” approximately 2 hours ago.
10
+
11
+ **History of present illness:** C.S. is a 16-year-old male with a persistent headache that began immediately after a skateboard fall 2 hours before this visit. He reports striking a pothole and falling while riding alone without protective equipment. He landed primarily on his left leg and the left side of his face; his head struck the pavement. He denies loss of consciousness. Since the fall, he has had mild nausea without vomiting and soreness of the left face and left leg. Symptoms have remained unchanged. He denies photophobia, phonophobia, difficulty focusing, or “brain fog.”
12
+
13
+ His current glasses broke during the fall, and he is wearing an older prescription. He reports blurred vision, which he attributes to the older glasses, and is observed squinting. A traumatic cause of the visual complaint has not yet been excluded. Headache severity, quality, exact location, and modifying factors were not provided. He drove himself to the office.
14
+
15
+ **Relevant review of systems:**
16
+
17
+ - **Neurologic:** Positive for persistent post-traumatic headache. Denies loss of consciousness, difficulty focusing, and brain fog.
18
+ - **Gastrointestinal:** Positive for mild nausea; negative for vomiting.
19
+ - **Eyes:** Positive for blurred vision and squinting; negative for light sensitivity.
20
+ - **ENT:** Negative for sound sensitivity.
21
+ - **Musculoskeletal:** Positive for left facial and left leg soreness after the fall.
22
+ - Other systems are reported as within normal limits in the encounter summary.
23
+
24
+ **Past medical history:** Intermittent headaches since age 14. No other medical conditions provided.
25
+
26
+ **Past surgical history:** Bilateral myringotomy tube placement (2013); tonsillectomy (2015).
27
+
28
+ **Medications:** Daily multivitamin. No anticoagulant or antiplatelet medication reported.
29
+
30
+ **Allergies:** No known allergies.
31
+
32
+ **Family history:** Father, age 42, with GERD; mother, age 41, noncontributory; maternal grandmother, age 62, with arthritis; maternal grandfather died at age 68 and had type 2 diabetes mellitus; paternal grandmother, age 60, with hypertension; paternal grandfather died in a motor-vehicle accident at age 55; sister, age 14, healthy; brother, age 18, healthy.
33
+
34
+ **Social history:** Denies alcohol, tobacco, and illicit drug use. Was not wearing protective equipment at the time of the fall.
35
+
36
+ ## O — Objective
37
+
38
+ **Vital signs:** Temperature 98.6 °F; heart rate 95 beats/min; blood pressure 110/84 mm Hg; respiratory rate 18 breaths/min; weight 56.8 kg (125 lb); height 5 ft 7 in; BMI 19.6 kg/m².
39
+
40
+ **General:** Sitting upright on the examination table. Alert, in mild discomfort, and squinting behind glasses.
41
+
42
+ **Mental status:** Alert and oriented to person, place, time, and situation. A formal Glasgow Coma Scale score was not provided.
43
+
44
+ **Eyes:** Pupils equal, round, reactive to light, and accommodating. Visual acuity and a detailed ocular/funduscopic examination were not provided.
45
+
46
+ **Ears:** Tympanic membranes bilaterally pearly gray with normal light reflex and landmarks.
47
+
48
+ **Mouth/throat:** Hard and soft palates intact; no drainage or exudate.
49
+
50
+ **Cardiovascular:** Within normal limits.
51
+
52
+ **Respiratory:** Within normal limits.
53
+
54
+ **Musculoskeletal:** Full range of motion in all four extremities; strength documented as 5+ in all four extremities.
55
+
56
+ **Neurologic:** Cranial nerves III, IV, VI, VIII, IX, X, XI, and XII intact as assessed. Mild coordination deficit noted with heel walking. Cranial nerves II, V, and VII and a full gait/balance examination were not specifically documented.
57
+
58
+ **Other:** Remaining examination reported as within normal limits in the encounter summary. Focused scalp, facial/orbital, and cervical-spine findings were not specifically provided.
59
+
60
+ ## A — Assessment
61
+
62
+ 1. **Acute closed head injury, initial encounter (S09.90XA), clinically concerning for concussion without reported loss of consciousness.** Direct unhelmeted head impact was followed immediately by headache, nausea, blurred vision, and an abnormal heel-walk/coordination finding. A more serious intracranial injury cannot be excluded in the primary care setting.
63
+ 2. **Acute post-traumatic headache, not intractable (G44.319).** This headache is temporally associated with the fall despite a history of intermittent headaches.
64
+ 3. **Abnormal coordination/heel walking (R27.8).** This is an abnormal neurologic finding after head trauma and requires urgent higher-level assessment.
65
+ 4. **Blurred vision (H53.8).** The older corrective-lens prescription may contribute, but trauma-related neurologic or ocular injury must be excluded.
66
+ 5. **Nausea without vomiting (R11.0).**
67
+ 6. **Left facial and left leg pain after fall.** Strength and range of motion are preserved, but the supplied examination does not fully characterize these injuries.
68
+ 7. **Single elevated diastolic blood-pressure reading for age (R03.0).** This does not establish hypertension and may be influenced by pain or stress.
69
+
70
+ **Differential diagnosis:** Concussion; intracranial hemorrhage or cerebral contusion; skull, facial, or orbital injury; cervical injury; ocular injury; and primary headache disorder. The immediate onset after head impact makes a purely primary headache less likely for this episode.
71
+
72
+ ## P — Plan
73
+
74
+ 1. **Immediate disposition:** Recommend immediate transfer to an emergency department for higher-level evaluation. The documented coordination abnormality and visual complaint after a direct head strike make routine outpatient observation alone inappropriate. Maintain direct observation in the office while transfer is arranged.
75
+ 2. **Transportation and supervision:** C.S. must not drive. Contact a parent/legal guardian immediately and recommend EMS transport because he is a minor with a post-traumatic neurologic abnormality and blurred vision. Provide a direct clinical handoff to the receiving emergency department.
76
+ 3. **Emergency evaluation:** Recommend serial neurologic examinations and a complete assessment including Glasgow Coma Scale, the cranial nerves not yet documented, gait/balance, cognition and memory, visual acuity and ocular/funduscopic examination, scalp/head/facial/orbital examination, and cervical-spine assessment. The emergency clinician should determine the need for noncontrast head CT and any facial/orbital, cervical, or extremity imaging. The absence of reported loss of consciousness or vomiting does not negate the abnormal neurologic finding.
77
+ 4. **Activity restrictions:** No driving, skateboarding, bicycling, sports, physical education, climbing, machinery use, or other activity with risk of another head impact. No same-day return to play. After an emergency condition is excluded, begin 24–48 hours of relative physical and cognitive rest followed by a clinician-guided, gradual return to school and activity. Return to contact/collision activity only after completing a stepwise return-to-play protocol and receiving medical clearance.
78
+ 5. **Medication:** No new medication is initiated before emergency assessment. Avoid aspirin. Analgesic use should follow emergency-department guidance; acetaminophen is generally preferred initially if the evaluating clinician approves it.
79
+ 6. **Emergency precautions:** Call 911 immediately for worsening or severe headache, repeated vomiting, increasing drowsiness or difficulty awakening, confusion or unusual behavior, slurred speech, seizure, loss of consciousness, weakness or numbness, unequal pupils, worsening balance, new or worsening vision symptoms, neck pain, or blood/clear fluid from the nose or ears.
80
+ 7. **Follow-up:** Schedule primary care or concussion follow-up within 24–48 hours after emergency-department discharge. Reassess symptoms, full neurologic and balance examination, vision, blood pressure, and readiness for return to learn/activity. If blurred vision persists after urgent traumatic causes are excluded, arrange optometry/ophthalmology evaluation and replacement of the broken glasses. Provide school accommodations as indicated.
81
+ 8. **Prevention counseling:** Counsel patient and guardian regarding consistent use of a properly fitted, certified helmet and other protective equipment for skateboarding.
82
+
83
+ **Procedures/medications administered in office:** None provided in the encounter summary.
84
+
85
+ **Disposition outcome:** The supplied information does not state whether EMS transfer was accepted, which emergency department received the patient, or when/with whom the patient left; these details should be added to the finalized medical record.
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/01d7e53e-0513-4109-a242-8ccaf442cd21/RecFit_Space_Use_and_Program_Agreement_Draft.docx ADDED
Binary file (55.3 kB). View file
 
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/02314fc6-a24e-42f4-a8cd-362cae0f0ec1/Monthly_Safety_Compliance_Checklist.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9896c6847435af820e3749b56157a8ced4e09a9346db6e1ebd2182a9967ddf1a
3
+ size 612498
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/02314fc6-a24e-42f4-a8cd-362cae0f0ec1/build_safety_checklist.py ADDED
@@ -0,0 +1,1256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Build the fillable Monthly Safety Compliance Checklist PDF."""
3
+
4
+ from __future__ import annotations
5
+
6
+ from dataclasses import dataclass
7
+ from pathlib import Path
8
+ from typing import Iterable, Sequence
9
+
10
+ from reportlab.lib import colors
11
+ from reportlab.lib.pagesizes import letter
12
+ from reportlab.pdfbase.pdfmetrics import stringWidth
13
+ from reportlab.pdfgen import canvas
14
+
15
+
16
+ OUT = Path(__file__).with_name("Monthly_Safety_Compliance_Checklist.pdf")
17
+
18
+ PAGE_W, PAGE_H = letter
19
+ TOTAL_PAGES = 15
20
+ MARGIN = 32
21
+
22
+ NAVY = colors.HexColor("#17324D")
23
+ NAVY_2 = colors.HexColor("#244E6F")
24
+ TEAL = colors.HexColor("#087E8B")
25
+ TEAL_LIGHT = colors.HexColor("#E7F4F4")
26
+ GREEN = colors.HexColor("#2E7D5B")
27
+ GREEN_LIGHT = colors.HexColor("#E9F5EF")
28
+ ORANGE = colors.HexColor("#D97706")
29
+ ORANGE_LIGHT = colors.HexColor("#FFF4E5")
30
+ RED = colors.HexColor("#B42318")
31
+ RED_LIGHT = colors.HexColor("#FDECEC")
32
+ INK = colors.HexColor("#17212B")
33
+ MUTED = colors.HexColor("#566573")
34
+ LINE = colors.HexColor("#C8D2DA")
35
+ LIGHT = colors.HexColor("#F4F7F9")
36
+ LIGHT_2 = colors.HexColor("#EAF0F4")
37
+ WHITE = colors.white
38
+
39
+
40
+ @dataclass(frozen=True)
41
+ class Section:
42
+ code: str
43
+ title: str
44
+ purpose: str
45
+ items: Sequence[tuple[str, str]]
46
+ chunks: Sequence[int]
47
+
48
+
49
+ SECTIONS: list[Section] = [
50
+ Section(
51
+ "A",
52
+ "Parking Lot, Sidewalks & Ramps",
53
+ "Exterior walking, driving and accessible routes from the property edge to the entrance.",
54
+ [
55
+ ("A01", "Parking, pedestrian and entrance lighting operates; lenses, poles and bases are secure. Verify at dusk/night or from the lighting control/alarm log."),
56
+ ("A02", "Pavement is free of hazardous potholes, heaving, large cracks, loose material and abrupt level changes; defects are isolated until repaired."),
57
+ ("A03", "Curbs, wheel stops, bollards and protective posts are anchored, visible and free of sharp edges, protruding hardware or impact damage."),
58
+ ("A04", "Sidewalks and entrance approaches are clean, dry, unobstructed and free of trip hazards; transitions and expansion joints are sound."),
59
+ ("A05", "Ramps, landings and handrails/guardrails are stable, slip resistant and unobstructed; slopes and edge protection meet applicable accessibility requirements."),
60
+ ("A06", "Accessible parking spaces, access aisles, signs and striping are visible and available; a continuous accessible route to the entrance is maintained."),
61
+ ("A07", "Crosswalks, directional arrows, stop/speed signs and speed-control devices are visible, intact and positioned to guide vehicles and pedestrians safely."),
62
+ ("A08", "Cart corrals are anchored and undamaged; loose carts are retrieved often enough to prevent rolling, traffic, accessible-route or emergency-access hazards."),
63
+ ("A09", "Drains, grates and utility covers are seated and intact; drainage is clear and standing water or runoff does not create a slip or icing hazard."),
64
+ ("A10", "Rain, snow and ice controls are timely and documented; de-icer, plowing, cones and absorbent mats are deployed and monitored as conditions require."),
65
+ ("A11", "Oil, spills, litter, broken glass, needles/sharps and other debris are removed using appropriate PPE and disposal procedures; affected areas are isolated meanwhile."),
66
+ ("A12", "Landscaping, signs, fencing and site fixtures do not block sight lines, lighting or walkways and present no falling-branch, sharp-edge or pest-harborage hazard."),
67
+ ("A13", "Curbside pickup, delivery and loading approaches separate vehicles from pedestrians; barriers, mirrors and markings are intact and staging does not block routes."),
68
+ ("A14", "Fire lanes, emergency vehicle routes, hydrants and fire department connections are marked and unobstructed; unauthorized parking is addressed promptly."),
69
+ ],
70
+ [14],
71
+ ),
72
+ Section(
73
+ "B",
74
+ "General Store Conditions",
75
+ "Customer, sales-floor and back-of-house physical conditions and fixed equipment.",
76
+ [
77
+ ("B01", "Entrance, exit and automatic doors open, close and latch safely; sensors, emergency breakaway features and glass visibility markings are functional."),
78
+ ("B02", "Vestibules and floor mats are dry, flat, secured and sized for conditions; curled edges, gaps and saturated mats are corrected immediately."),
79
+ ("B03", "Floors and stairs are clean, dry and in good repair; spills, loose tiles, torn carpet, holes and uneven transitions are attended and tracked to repair."),
80
+ ("B04", "Spill stations, cones and barricades are available; active spills are guarded continuously until dry, and warning devices are removed when the hazard is gone."),
81
+ ("B05", "Shopping aisles, queue lines and routes to exits maintain required width and headroom; stock, displays, cords and equipment do not obstruct travel."),
82
+ ("B06", "Shelving and storage racks are anchored, plumb and free of bent uprights, missing beams, damaged connectors or unsafe loads; rated capacities are observed."),
83
+ ("B07", "Merchandise, displays and promotional stacks are stable; heavy/bulky goods are placed low or restrained and items do not overhang into travel paths."),
84
+ ("B08", "Top stock is stable and within approved height and sprinkler clearances; falling-object controls and approved retrieval equipment are used."),
85
+ ("B09", "Endcaps, fixtures, signs, hooks and guardrails are secure and free of sharp edges, pinch points, exposed fasteners and impact damage."),
86
+ ("B10", "Lighting is adequate; fixtures and ceiling materials are secure. Roof/plumbing leaks, stained tiles, mold indicators and falling-material hazards are controlled and repaired."),
87
+ ("B11", "Plugs, outlets, cords and power strips are approved and undamaged; no exposed wiring, overloaded outlets, daisy chains or extension cords used as permanent wiring."),
88
+ ("B12", "Electrical panels, disconnects and shutoffs are labeled, closed and unobstructed for required clearance; unused openings have covers and no storage is inside rooms."),
89
+ ("B13", "Customer and employee restrooms are clean, dry and functional; grab bars, dispensers, fixtures and baby-changing stations are secure and leaks are corrected."),
90
+ ("B14", "Stockrooms, receiving, offices, breakrooms and trash areas have orderly housekeeping, stable storage and clear walking/working and emergency routes."),
91
+ ("B15", "Cooler/freezer floors, doors, gaskets, shelving and lighting are sound; condensation, ice buildup and leaks do not create slip, struck-by or entrapment hazards."),
92
+ ("B16", "Carts, baskets, child restraints, checkout fixtures and customer-use equipment are clean, stable and free of sharp edges, broken parts or defective wheels."),
93
+ ("B17", "Ladders and step stools are the correct type, inspected, labeled and stored securely; no makeshift climbing devices are present."),
94
+ ("B18", "Dock doors, plates, levelers, bumpers, guards and warning systems are serviceable; open dock edges and trailer gaps are protected."),
95
+ ("B19", "Balers, compactors and powered doors have effective guards, interlocks, emergency stops and warning signs; keys/access are controlled to authorized staff."),
96
+ ("B20", "Elevators, escalators and lifts (if present) have current inspections, clear landings, operating emergency stops/phones and no damaged comb plates or handrails."),
97
+ ],
98
+ [20],
99
+ ),
100
+ Section(
101
+ "C",
102
+ "First Aid & Emergency Procedures",
103
+ "Readiness to provide first aid, communicate, evacuate, shelter and report an emergency.",
104
+ [
105
+ ("C01", "First-aid kits are visible, accessible and sealed/organized; the documented inventory is complete and sterile supplies and medications are in date."),
106
+ ("C02", "Required eyewash/drench equipment is unobstructed, identified and within the hazard-area travel time; activation, flow and inspection records are current."),
107
+ ("C03", "AED is accessible and identified; readiness indicator is normal, cabinet alarm works, pads/battery are in date and inspection/trained-responder records are current."),
108
+ ("C04", "911, poison control, utilities, security, Store/DM/LP and other emergency contacts are current; phones, radios, paging and panic devices function."),
109
+ ("C05", "A current, site-specific Emergency Action Plan covers reporting, evacuation, shelter, accountability, shutdown duties and emergency-service coordination."),
110
+ ("C06", "Evacuation maps show accurate routes, exits, 'you are here,' assembly areas and shelter locations; maps are visible to employees and customers as appropriate."),
111
+ ("C07", "Emergency coordinators, alternates, first-aid/AED responders and department roles are assigned; employees can explain alarms, reporting and assembly expectations."),
112
+ ("C08", "Required fire, evacuation, severe-weather and other drills are completed on schedule; attendance, results and corrective actions are documented."),
113
+ ("C09", "Procedures account for employees, visitors and contractors and assist people with disabilities; assembly areas remain safe and accessible."),
114
+ ("C10", "Severe-weather, earthquake or other local-hazard procedures identify safe shelter, monitoring, customer movement and all-clear authority; supplies are ready."),
115
+ ("C11", "Plans address power/refrigeration loss, gas odor/leak, water interruption, sewage backup and other utility failures, including food protection and closure criteria."),
116
+ ("C12", "Bloodborne-pathogen/exposure-control materials are available: PPE, disinfectant, sharps container and spill kit; exposed staff know reporting and evaluation steps."),
117
+ ("C13", "Employee injury, customer incident and near-miss procedures preserve the scene/evidence, obtain care, notify leaders and complete required reports promptly."),
118
+ ("C14", "Workplace-violence/active-threat, robbery and suspicious-package procedures are current; staff know alarms/code words, escape/shelter choices and when to call 911."),
119
+ ],
120
+ [14],
121
+ ),
122
+ Section(
123
+ "D",
124
+ "Safety & Compliance",
125
+ "Core occupational-safety programs, safe work practices and controlled hazardous tasks.",
126
+ [
127
+ ("D01", "Open findings from the prior monthly inspection and regulator, LP, insurance or internal audits have owners, due dates, interim controls and verified closure evidence."),
128
+ ("D02", "Employees know how to report hazards/near misses and stop unsafe work without retaliation; reports are logged, triaged and communicated through closure."),
129
+ ("D03", "New-hire, job-specific and refresher safety training is current; competency is verified before employees perform restricted or hazardous work."),
130
+ ("D04", "The PPE hazard assessment is current and required gloves, eye/face, hearing, footwear and other PPE fit, remain serviceable and are consistently used."),
131
+ ("D05", "Original and secondary chemical containers have legible product and hazard labels; no unidentified spray bottles, buckets or transferred products are present."),
132
+ ("D06", "The written Hazard Communication program, current chemical inventory and Safety Data Sheets match products onsite and are readily accessible on every shift."),
133
+ ("D07", "Chemicals are compatible, capped and secured with spill containment; food/customer exposure is prevented and spill kits/PPE match the hazards."),
134
+ ("D08", "Lockout/tagout procedures, energy-control devices and authorized/affected employee training cover each serviced machine; annual reviews are current where required."),
135
+ ("D09", "Slicers, saws, mixers, grinders, compactors and other machines have guards/interlocks in place; damaged safeguards remove equipment from service."),
136
+ ("D10", "Forklift/powered industrial truck and powered pallet-jack operators are authorized; pre-use checks are complete and defects are tagged out and repaired."),
137
+ ("D11", "Battery-charging/fueling areas are ventilated, signed and ignition-free; chargers, cables and connectors are sound and required eyewash/PPE/spill control is present."),
138
+ ("D12", "Manual-handling limits and safe lifting practices are understood; team lifts, carts, lift tables and other ergonomic aids are available and used."),
139
+ ("D13", "Pallets, totes and case stacks are sound, square and stable within approved height/load limits; damaged pallets and falling-object hazards are removed."),
140
+ ("D14", "Trailers are secured by restraints/chocks before entry, keys/status are controlled and departure communication prevents drive-away and dock-fall incidents."),
141
+ ("D15", "Compressed-gas and propane cylinders are upright, capped as applicable, separated and secured from impact/ignition; cages/signs and exchange procedures are sound."),
142
+ ("D16", "Contractors and vendors sign in, receive site rules and isolate work areas; permits, PPE and fire watch are used for hot work and other high-risk tasks."),
143
+ ("D17", "Minor-age and task restrictions are enforced for balers, slicers, powered equipment, ladders and other prohibited or limited duties."),
144
+ ("D18", "Broken glass, knives and found needles/sharps are isolated, picked up with tools/PPE and placed in approved containers; never handled by bare hand."),
145
+ ("D19", "Safety cutters/knives are approved, maintained, carried/stored safely and cut away from the body; employees receive task-specific blade training."),
146
+ ("D20", "Employees do not climb racks, pallets, carts or displays; approved elevating equipment and fall protection are used where exposure requires them."),
147
+ ],
148
+ [20],
149
+ ),
150
+ Section(
151
+ "E",
152
+ "Food Safety",
153
+ "Controls for receiving, storing, preparing, displaying and disposing of food. Apply the stricter current code or company standard.",
154
+ [
155
+ ("E01", "A designated Person in Charge is present as required, demonstrates food-safety knowledge and holds current manager/handler certifications and establishment permits."),
156
+ ("E02", "Employee illness reporting agreements are current; symptoms/diagnoses are screened and exclusion/restriction and return-to-work decisions follow code."),
157
+ ("E03", "Hand sinks are accessible and used only for handwashing, with running hot/cold water, soap, disposable towels/hand dryer and required signage."),
158
+ ("E04", "Hands are washed at required times; gloves/utensils prevent bare-hand contact with ready-to-eat food and are changed between tasks and contamination events."),
159
+ ("E05", "Food employees wear clean clothing and effective hair restraints; personal items, drinks, eating, tobacco/vaping and jewelry are controlled in food areas."),
160
+ ("E06", "Food is received from approved sources; vehicle/product condition, seals, package integrity, dates and required temperatures are checked and exceptions documented."),
161
+ ("E07", "Time/temperature-control-for-safety food is cold held at 41°F/5°C or below (or stricter applicable standard); frozen food remains frozen without thaw/refreeze evidence."),
162
+ ("E08", "Hot-held TCS food is maintained at 135°F/57°C or above (or stricter applicable standard); out-of-range product receives documented corrective action."),
163
+ ("E09", "Cooking and reheating temperatures/times meet the current Food Code, validated company process or approved plan; required batch records are complete."),
164
+ ("E10", "Cooling uses approved time/temperature limits and shallow pans, rapid equipment or other effective methods; start/end temperatures and corrective actions are recorded."),
165
+ ("E11", "Any time-as-a-public-health-control process has prior written procedures, clear start/discard time marking and product disposal at the required limit."),
166
+ ("E12", "Calibrated, accurate food thermometers with suitable probes are available and sanitized; calibration frequency/results and failed-device actions are documented."),
167
+ ("E13", "Refrigeration/hot-unit temperature logs and alarms are complete at required frequency; deviations document product evaluation, disposition and equipment repair."),
168
+ ("E14", "Ready-to-eat TCS foods are date marked; FIFO/FEFO rotation, use-by/sell-by controls and end-of-life disposal are accurate throughout storage and display."),
169
+ ("E15", "Raw animal foods are separated from ready-to-eat foods and stored by required final cook temperature; covered food and clean utensils prevent cross-contamination."),
170
+ ("E16", "Major allergens are identified and controlled through labels, recipes, segregation, changeover/cleaning and accurate customer communication; staff know escalation steps."),
171
+ ("E17", "Food, ice and single-service packaging are covered/protected and stored at least 6 in/15 cm off the floor (or per local code), away from splash and contamination."),
172
+ ("E18", "Damaged, swollen, leaking, adulterated, expired and recalled goods are promptly identified, segregated in a labeled hold area and disposed/returned with traceable records."),
173
+ ("E19", "Food-contact surfaces, slicers, prep tools, produce equipment and ice machines are clean to sight/touch and sanitized at required frequency; test strips verify strength."),
174
+ ("E20", "Three-compartment sinks and dish machines have correct wash/rinse/sanitize setup, temperature or concentration, clean storage and air drying; logs are complete."),
175
+ ("E21", "Wiping cloths and in-use utensils are held by approved methods; sanitizer containers are labeled, at correct concentration and protected from food contamination."),
176
+ ("E22", "Cleaning chemicals, lubricants and pesticides are approved, labeled and stored away from food/packaging; only authorized application and dilution methods are used."),
177
+ ("E23", "No live pests, droppings, gnawing or harborage conditions are evident; doors/penetrations are sealed and licensed service reports document device checks and corrections."),
178
+ ("E24", "Applicable special-process controls are current: shellstock tags, parasite destruction, consumer advisories, reduced-oxygen packaging, variances, sampling and self-service protection."),
179
+ ("E25", "Potable water, hot water, sewage and ice systems are safe and operational; backups/advisories trigger approved food protection, alternate supply and closure decisions."),
180
+ ("E26", "Trash, cardboard, grease and organic waste are removed often; containers are leakproof, covered as required and clean, and waste areas do not attract pests or contaminate food."),
181
+ ],
182
+ [13, 13],
183
+ ),
184
+ Section(
185
+ "F",
186
+ "Fire Prevention & Protection",
187
+ "Means of egress, detection/suppression systems and control of ignition and fuel sources.",
188
+ [
189
+ ("F01", "Required exit doors are identified, unlocked during occupancy and open readily from inside without special knowledge; hardware and exterior discharge paths are clear."),
190
+ ("F02", "Exit access, corridors and egress aisles maintain required width/headroom from every area; stock, carts, locks and displays do not delay evacuation."),
191
+ ("F03", "Exit signs and emergency lighting are visible, illuminated and unobstructed; required functional tests and battery/power records are current."),
192
+ ("F04", "Portable extinguishers are correct for the hazard, mounted, signed, visible and accessible; pins/seals, hoses, gauges and cylinders show ready condition."),
193
+ ("F05", "Monthly extinguisher visual checks and annual/periodic professional service are current and documented; discharged, damaged or missing units are replaced promptly."),
194
+ ("F06", "Sprinkler heads are unobstructed, undamaged and unpainted; storage maintains at least 18 in/46 cm clearance or the greater applicable requirement."),
195
+ ("F07", "Sprinkler risers, control valves and fire pumps are accessible, identified, secured in normal position and professionally inspected/tested on schedule."),
196
+ ("F08", "Fire alarm panel shows normal status; pull stations, detectors and notification devices are unobstructed, and inspection/test and impairment records are current."),
197
+ ("F09", "Hydrants and fire department connections are identified, capped and accessible; fire department access and required clearance are maintained."),
198
+ ("F10", "Cooking hood suppression is armed and in date; nozzles/caps, links and manual pull are accessible and appliances remain in their protected positions."),
199
+ ("F11", "Cooking hoods, filters, ducts and surrounding surfaces are free of unsafe grease buildup; professional cleaning and service records meet the required schedule."),
200
+ ("F12", "Combustibles, aerosols and flammable liquids remain within allowed quantities and approved cabinets/areas, separated from ignition, heat and electrical equipment."),
201
+ ("F13", "Fire/smoke doors self-close and latch and are not propped; rated penetrations are sealed, and heaters/decorations do not compromise exits or suppression systems."),
202
+ ("F14", "Hot-work permits/fire watch and fire-system impairment procedures are followed; affected leaders and emergency services are notified and compensating controls documented."),
203
+ ],
204
+ [14],
205
+ ),
206
+ Section(
207
+ "G",
208
+ "Record Keeping & Posters",
209
+ "Required postings and auditable evidence that safety and food controls are operating.",
210
+ [
211
+ ("G01", "Current OSHA/state-plan, workers' compensation and other required safety/emergency posters are complete, legible and placed where employees can readily view them."),
212
+ ("G02", "OSHA 300/301 or state-equivalent records are current where required; certified Form 300A is posted during the required period with privacy cases protected."),
213
+ ("G03", "Employee/customer incidents and near misses are timely, factual and investigated; required fatality/severe-injury regulator notices and internal escalations meet deadlines."),
214
+ ("G04", "Training records identify topic, date, instructor, attendees and competency/authorization for each role and shift; expired or missing training is scheduled and restricted meanwhile."),
215
+ ("G05", "Monthly safety inspections, meeting/communication records and prior corrective-action evidence are retained; overdue items show escalation and effective interim controls."),
216
+ ("G06", "Equipment pre-use, preventive-maintenance and certification records are current for lifts, powered trucks, docks, balers, compactors, ladders and other applicable equipment."),
217
+ ("G07", "First-aid kit, AED, eyewash and exposure-control inspection/service logs are current; replenishment, failed checks and responder qualifications are documented."),
218
+ ("G08", "Fire permits, alarm/sprinkler/extinguisher/hood service, emergency-light tests and drill records are current and available for authority inspection."),
219
+ ("G09", "Food receiving, temperature, cooking/cooling, sanitizer, calibration, cleaning and corrective-action logs are complete, legible and reviewed by the Person in Charge."),
220
+ ("G10", "Health permits, food-manager certificates, pest-control reports and other regulator/vendor service records are current; cited items have closure evidence."),
221
+ ("G11", "Written Hazard Communication and other required safety programs, current SDS files and chemical inventories are accessible and match actual operations."),
222
+ ("G12", "Records follow retention and confidentiality rules; controlled procedures show current revision/approval and this checklist has complete GM, DM and LP distribution/review evidence."),
223
+ ],
224
+ [12],
225
+ ),
226
+ ]
227
+
228
+
229
+ def wrap_text(text: str, font: str, size: float, max_width: float) -> list[str]:
230
+ words = text.split()
231
+ lines: list[str] = []
232
+ current = ""
233
+ for word in words:
234
+ trial = word if not current else f"{current} {word}"
235
+ if stringWidth(trial, font, size) <= max_width:
236
+ current = trial
237
+ else:
238
+ if current:
239
+ lines.append(current)
240
+ current = word
241
+ if current:
242
+ lines.append(current)
243
+ return lines or [""]
244
+
245
+
246
+ def draw_wrapped(
247
+ c: canvas.Canvas,
248
+ text: str,
249
+ x: float,
250
+ y: float,
251
+ max_width: float,
252
+ font: str = "Helvetica",
253
+ size: float = 8,
254
+ leading: float | None = None,
255
+ color=INK,
256
+ max_lines: int | None = None,
257
+ ) -> float:
258
+ leading = leading or size * 1.25
259
+ lines = wrap_text(text, font, size, max_width)
260
+ if max_lines is not None:
261
+ lines = lines[:max_lines]
262
+ c.setFont(font, size)
263
+ c.setFillColor(color)
264
+ for line in lines:
265
+ c.drawString(x, y, line)
266
+ y -= leading
267
+ return y
268
+
269
+
270
+ def text_field(
271
+ c: canvas.Canvas,
272
+ name: str,
273
+ x: float,
274
+ y: float,
275
+ w: float,
276
+ h: float,
277
+ *,
278
+ tooltip: str,
279
+ value: str = "",
280
+ size: float = 8,
281
+ multiline: bool = False,
282
+ border_color=LINE,
283
+ fill_color=WHITE,
284
+ maxlen: int = 500,
285
+ ) -> None:
286
+ c.acroForm.textfield(
287
+ name=name,
288
+ tooltip=tooltip,
289
+ value=value,
290
+ x=x,
291
+ y=y,
292
+ width=w,
293
+ height=h,
294
+ fontName="Helvetica",
295
+ fontSize=size,
296
+ textColor=INK,
297
+ fillColor=fill_color,
298
+ borderColor=border_color,
299
+ borderWidth=0.65,
300
+ borderStyle="solid",
301
+ forceBorder=True,
302
+ fieldFlags="multiline" if multiline else "",
303
+ maxlen=maxlen,
304
+ annotationFlags="print",
305
+ )
306
+
307
+
308
+ def radio(
309
+ c: canvas.Canvas,
310
+ name: str,
311
+ value: str,
312
+ x: float,
313
+ y: float,
314
+ *,
315
+ tooltip: str,
316
+ size: float = 10,
317
+ border_color=NAVY_2,
318
+ fill_color=WHITE,
319
+ ) -> None:
320
+ c.acroForm.radio(
321
+ name=name,
322
+ value=value,
323
+ selected=False,
324
+ x=x,
325
+ y=y,
326
+ size=size,
327
+ buttonStyle="check",
328
+ shape="square",
329
+ fillColor=fill_color,
330
+ borderColor=border_color,
331
+ textColor=NAVY,
332
+ borderWidth=0.8,
333
+ forceBorder=True,
334
+ tooltip=tooltip,
335
+ fieldFlags="noToggleToOff radio",
336
+ annotationFlags="print",
337
+ )
338
+
339
+
340
+ def checkbox(
341
+ c: canvas.Canvas,
342
+ name: str,
343
+ x: float,
344
+ y: float,
345
+ *,
346
+ tooltip: str,
347
+ size: float = 10,
348
+ ) -> None:
349
+ c.acroForm.checkbox(
350
+ name=name,
351
+ checked=False,
352
+ x=x,
353
+ y=y,
354
+ size=size,
355
+ buttonStyle="check",
356
+ shape="square",
357
+ fillColor=WHITE,
358
+ borderColor=NAVY_2,
359
+ textColor=NAVY,
360
+ borderWidth=0.8,
361
+ forceBorder=True,
362
+ tooltip=tooltip,
363
+ fieldFlags="",
364
+ annotationFlags="print",
365
+ )
366
+
367
+
368
+ def label(c: canvas.Canvas, text: str, x: float, y: float, *, size: float = 6.7, color=MUTED) -> None:
369
+ c.setFillColor(color)
370
+ c.setFont("Helvetica-Bold", size)
371
+ c.drawString(x, y, text.upper())
372
+
373
+
374
+ def draw_brand_mark(c: canvas.Canvas, x: float, y: float, scale: float = 1.0, inverse: bool = True) -> None:
375
+ stroke = WHITE if inverse else NAVY
376
+ accent = colors.HexColor("#5FD0C9") if inverse else TEAL
377
+ c.setLineWidth(1.5 * scale)
378
+ c.setStrokeColor(stroke)
379
+ c.roundRect(x, y, 30 * scale, 34 * scale, 8 * scale, stroke=1, fill=0)
380
+ c.setStrokeColor(accent)
381
+ c.setLineWidth(2.3 * scale)
382
+ c.line(x + 7 * scale, y + 17 * scale, x + 13 * scale, y + 10 * scale)
383
+ c.line(x + 13 * scale, y + 10 * scale, x + 24 * scale, y + 24 * scale)
384
+
385
+
386
+ def draw_page_header(c: canvas.Canvas, page: int, title: str, kicker: str = "MONTHLY SAFETY") -> None:
387
+ c.setFillColor(NAVY)
388
+ c.rect(0, PAGE_H - 46, PAGE_W, 46, stroke=0, fill=1)
389
+ draw_brand_mark(c, MARGIN, PAGE_H - 40, 0.82, True)
390
+ c.setFillColor(colors.HexColor("#8FE3DD"))
391
+ c.setFont("Helvetica-Bold", 6.5)
392
+ c.drawString(MARGIN + 36, PAGE_H - 17, kicker)
393
+ c.setFillColor(WHITE)
394
+ c.setFont("Helvetica-Bold", 12.5)
395
+ c.drawString(MARGIN + 36, PAGE_H - 33, title)
396
+ c.setFont("Helvetica-Bold", 5.2)
397
+ c.setFillColor(colors.HexColor("#DDE7EE"))
398
+ c.drawString(405, PAGE_H - 16, "STORE #")
399
+ c.drawString(493, PAGE_H - 16, "AUDIT MONTH")
400
+ text_field(c, f"nav_store_p{page}", 405, PAGE_H - 37, 78, 15, tooltip=f"Store number, page {page}", size=6.2)
401
+ text_field(c, f"nav_month_p{page}", 493, PAGE_H - 37, 87, 15, tooltip=f"Audit month, page {page}", size=6.2)
402
+
403
+
404
+ def draw_footer(c: canvas.Canvas, page: int) -> None:
405
+ c.setStrokeColor(LINE)
406
+ c.setLineWidth(0.5)
407
+ c.line(MARGIN, 25, PAGE_W - MARGIN, 25)
408
+ c.setFont("Helvetica", 6.3)
409
+ c.setFillColor(MUTED)
410
+ c.drawString(MARGIN, 13, "MSCL-120 • Rev 2026.11 • Complete one packet per store • Retain per company policy")
411
+ c.drawRightString(PAGE_W - MARGIN, 13, f"PAGE {page} OF {TOTAL_PAGES}")
412
+
413
+
414
+ def rounded_card(c: canvas.Canvas, x: float, y: float, w: float, h: float, fill=WHITE, stroke=LINE, radius: float = 7) -> None:
415
+ c.setFillColor(fill)
416
+ c.setStrokeColor(stroke)
417
+ c.setLineWidth(0.7)
418
+ c.roundRect(x, y, w, h, radius, stroke=1, fill=1)
419
+
420
+
421
+ def draw_cover(c: canvas.Canvas, page: int) -> None:
422
+ c.bookmarkPage("cover")
423
+ c.addOutlineEntry("Cover & store information", "cover", level=0)
424
+ c.setFillColor(NAVY)
425
+ c.rect(0, PAGE_H - 174, PAGE_W, 174, stroke=0, fill=1)
426
+ c.setFillColor(NAVY_2)
427
+ c.circle(PAGE_W - 45, PAGE_H - 12, 118, stroke=0, fill=1)
428
+ draw_brand_mark(c, MARGIN, PAGE_H - 91, 1.55, True)
429
+ c.setFillColor(colors.HexColor("#8FE3DD"))
430
+ c.setFont("Helvetica-Bold", 8.5)
431
+ c.drawString(MARGIN + 58, PAGE_H - 52, "STORE OPERATIONS • CONTROLLED MONTHLY MASTER")
432
+ c.setFillColor(WHITE)
433
+ c.setFont("Helvetica-Bold", 25)
434
+ c.drawString(MARGIN + 58, PAGE_H - 81, "MONTHLY SAFETY")
435
+ c.drawString(MARGIN + 58, PAGE_H - 111, "COMPLIANCE CHECKLIST")
436
+ c.setFont("Helvetica", 9.2)
437
+ c.setFillColor(colors.HexColor("#D9E6EE"))
438
+ c.drawString(MARGIN + 58, PAGE_H - 132, "GENERAL MERCHANDISE • FRESH FOODS • GROCERY")
439
+ c.setFont("Helvetica-Bold", 7)
440
+ c.drawRightString(PAGE_W - MARGIN, PAGE_H - 154, "120 CONTROLS | 7 SAFETY AREAS | 1 MONTHLY RECORD")
441
+
442
+ y = PAGE_H - 194
443
+ rounded_card(c, MARGIN, y - 179, PAGE_W - 2 * MARGIN, 174, LIGHT)
444
+ c.setFont("Helvetica-Bold", 10.5)
445
+ c.setFillColor(NAVY)
446
+ c.drawString(MARGIN + 14, y - 20, "STORE & AUDIT INFORMATION")
447
+
448
+ x1 = MARGIN + 14
449
+ x2 = MARGIN + 276
450
+ row_y = y - 47
451
+ label(c, "Store name", x1, row_y + 17)
452
+ text_field(c, "cover_store_name", x1, row_y - 3, 248, 18, tooltip="Store name")
453
+ label(c, "Store number", x2, row_y + 17)
454
+ text_field(c, "cover_store_number", x2, row_y - 3, 105, 18, tooltip="Store number")
455
+ label(c, "District / region", x2 + 119, row_y + 17)
456
+ text_field(c, "cover_district", x2 + 119, row_y - 3, 119, 18, tooltip="District or region")
457
+
458
+ row_y -= 42
459
+ label(c, "Street address / city / state", x1, row_y + 17)
460
+ text_field(c, "cover_address", x1, row_y - 3, 367, 18, tooltip="Store street address, city and state")
461
+ label(c, "Audit month (YYYY-MM)", x1 + 381, row_y + 17)
462
+ text_field(c, "cover_audit_month", x1 + 381, row_y - 3, 119, 18, tooltip="Audit month in YYYY-MM format")
463
+
464
+ row_y -= 42
465
+ label(c, "Safety Coordinator / auditor", x1, row_y + 17)
466
+ text_field(c, "cover_auditor", x1, row_y - 3, 195, 18, tooltip="Safety Coordinator or auditor name")
467
+ label(c, "Store Manager", x1 + 209, row_y + 17)
468
+ text_field(c, "cover_manager", x1 + 209, row_y - 3, 158, 18, tooltip="Store Manager name")
469
+ label(c, "Audit date / time", x1 + 381, row_y + 17)
470
+ text_field(c, "cover_audit_datetime", x1 + 381, row_y - 3, 119, 18, tooltip="Audit date and time")
471
+
472
+ row_y -= 42
473
+ label(c, "Exterior weather / surface conditions", x1, row_y + 17)
474
+ text_field(c, "cover_weather", x1, row_y - 3, 248, 18, tooltip="Weather and exterior surface conditions")
475
+ label(c, "Accompanying leader(s)", x2, row_y + 17)
476
+ text_field(c, "cover_accompanying", x2, row_y - 3, 238, 18, tooltip="Leaders accompanying the inspection")
477
+
478
+ workflow_y = 281
479
+ c.setFillColor(NAVY)
480
+ c.setFont("Helvetica-Bold", 10.5)
481
+ c.drawString(MARGIN, workflow_y + 91, "MONTHLY WORKFLOW")
482
+ box_w = 96
483
+ gap = 8
484
+ steps = [
485
+ ("01", "INSPECT", "Observe all 120 controls"),
486
+ ("02", "CLASSIFY", "Mark C, NC or N/A"),
487
+ ("03", "COUNT", "Total missed items"),
488
+ ("04", "CORRECT", "Control hazards & assign"),
489
+ ("05", "SUBMIT", "GM • DM • LP review"),
490
+ ]
491
+ for i, (num, head, body) in enumerate(steps):
492
+ bx = MARGIN + i * (box_w + gap)
493
+ rounded_card(c, bx, workflow_y + 4, box_w, 70, WHITE, LINE, 6)
494
+ c.setFillColor(TEAL)
495
+ c.circle(bx + 15, workflow_y + 57, 9, stroke=0, fill=1)
496
+ c.setFillColor(WHITE)
497
+ c.setFont("Helvetica-Bold", 6.5)
498
+ c.drawCentredString(bx + 15, workflow_y + 55, num)
499
+ c.setFillColor(NAVY)
500
+ c.setFont("Helvetica-Bold", 7.5)
501
+ c.drawString(bx + 29, workflow_y + 55, head)
502
+ draw_wrapped(c, body, bx + 9, workflow_y + 36, box_w - 18, size=7.1, leading=8.7, color=MUTED)
503
+ if i < len(steps) - 1:
504
+ ax = bx + box_w + 1
505
+ c.setStrokeColor(TEAL)
506
+ c.setLineWidth(1.1)
507
+ c.line(ax, workflow_y + 39, ax + 6, workflow_y + 39)
508
+ c.line(ax + 4, workflow_y + 42, ax + 7, workflow_y + 39)
509
+ c.line(ax + 4, workflow_y + 36, ax + 7, workflow_y + 39)
510
+
511
+ score_y = 174
512
+ rounded_card(c, MARGIN, score_y, 259, 88, GREEN_LIGHT, colors.HexColor("#9AC9B3"), 7)
513
+ c.setFillColor(GREEN)
514
+ c.setFont("Helvetica-Bold", 15)
515
+ c.drawString(MARGIN + 14, score_y + 57, "0–10 MISSED ITEMS")
516
+ c.setFont("Helvetica-Bold", 9)
517
+ c.drawString(MARGIN + 14, score_y + 38, "MEETS THE MONTHLY THRESHOLD")
518
+ draw_wrapped(c, "Correct every finding and track it to verified closure.", MARGIN + 14, score_y + 22, 228, size=7.5, color=INK)
519
+
520
+ rounded_card(c, MARGIN + 271, score_y, 277, 88, ORANGE_LIGHT, colors.HexColor("#E9B66D"), 7)
521
+ c.setFillColor(RED)
522
+ c.setFont("Helvetica-Bold", 15)
523
+ c.drawString(MARGIN + 285, score_y + 57, "11+ MISSED ITEMS")
524
+ c.setFont("Helvetica-Bold", 9)
525
+ c.drawString(MARGIN + 285, score_y + 38, "DETAILED CAP REQUIRED")
526
+ draw_wrapped(c, "Submit to the DM; DM follows up and verifies completion. Copy GM and LP.", MARGIN + 285, score_y + 22, 248, size=7.5, color=INK)
527
+
528
+ rounded_card(c, MARGIN, 74, PAGE_W - 2 * MARGIN, 78, RED_LIGHT, colors.HexColor("#E3A5A0"), 7)
529
+ c.setFillColor(RED)
530
+ c.setFont("Helvetica-Bold", 9.5)
531
+ c.drawString(MARGIN + 14, 131, "IMMEDIATE-DANGER OVERRIDE")
532
+ draw_wrapped(
533
+ c,
534
+ "Do not wait for the final score. Stop, isolate or remove any imminent hazard; protect food and people; call emergency services when warranted; and escalate fire-system impairment, blocked egress, electrical/gas danger, serious injury or food-safety risk under company and legal procedures.",
535
+ MARGIN + 14,
536
+ 114,
537
+ PAGE_W - 2 * MARGIN - 28,
538
+ size=8.1,
539
+ leading=10.2,
540
+ color=INK,
541
+ )
542
+ draw_footer(c, page)
543
+ c.showPage()
544
+
545
+
546
+ def draw_instructions(c: canvas.Canvas, page: int) -> None:
547
+ c.bookmarkPage("instructions")
548
+ c.addOutlineEntry("Instructions, scoring & responsibilities", "instructions", level=0)
549
+ draw_page_header(c, page, "How to Use, Score & Escalate")
550
+ c.setFillColor(NAVY)
551
+ c.setFont("Helvetica-Bold", 16)
552
+ c.drawString(MARGIN, 720, "One status for every item. Evidence before assumption.")
553
+ draw_wrapped(c, "Use this packet once each month and after a major incident, remodel or significant operational change when directed.", MARGIN, 701, 548, size=8.4, color=MUTED)
554
+
555
+ left_x, right_x = MARGIN, 314
556
+ col_w = 266
557
+ rounded_card(c, left_x, 470, col_w, 205, WHITE)
558
+ c.setFillColor(TEAL)
559
+ c.setFont("Helvetica-Bold", 9.5)
560
+ c.drawString(left_x + 14, 655, "INSPECTION METHOD")
561
+ method = [
562
+ ("1", "Prepare", "Enter store/audit details; review open actions, incidents and service records."),
563
+ ("2", "Observe", "Walk exterior, sales floor, backroom and food/fire areas; test or sample where safe."),
564
+ ("3", "Verify", "Review current records and ask employees to demonstrate knowledge or safe practice."),
565
+ ("4", "Control", "Guard, remove, shut down or otherwise control active hazards immediately."),
566
+ ("5", "Close", "Score, assign every NC, submit the packet and verify lasting completion."),
567
+ ]
568
+ my = 630
569
+ for num, head, body in method:
570
+ c.setFillColor(TEAL_LIGHT)
571
+ c.circle(left_x + 23, my + 2, 10, stroke=0, fill=1)
572
+ c.setFillColor(TEAL)
573
+ c.setFont("Helvetica-Bold", 7)
574
+ c.drawCentredString(left_x + 23, my, num)
575
+ c.setFillColor(NAVY)
576
+ c.setFont("Helvetica-Bold", 8)
577
+ c.drawString(left_x + 41, my + 5, head.upper())
578
+ draw_wrapped(c, body, left_x + 41, my - 6, 205, size=7.3, leading=8.8, color=INK)
579
+ my -= 36
580
+
581
+ rounded_card(c, right_x, 470, col_w, 205, LIGHT)
582
+ c.setFillColor(TEAL)
583
+ c.setFont("Helvetica-Bold", 9.5)
584
+ c.drawString(right_x + 14, 655, "STATUS DEFINITIONS")
585
+ status_blocks = [
586
+ (GREEN, GREEN_LIGHT, "C • COMPLIANT", "Fully met at inspection and required evidence is current."),
587
+ (RED, RED_LIGHT, "NC • NON-COMPLIANT", "Deficient, missing, inaccessible, expired, unsafe or not verified. Each NC—and any blank at closeout—is one missed item."),
588
+ (MUTED, LIGHT_2, "N/A • NOT APPLICABLE", "The activity/equipment is genuinely absent. Briefly explain in the finding/reference field."),
589
+ ]
590
+ sy = 620
591
+ for accent, fill, head, body in status_blocks:
592
+ c.setFillColor(fill)
593
+ c.roundRect(right_x + 14, sy - 37, col_w - 28, 48, 5, stroke=0, fill=1)
594
+ c.setFillColor(accent)
595
+ c.rect(right_x + 14, sy - 37, 4, 48, stroke=0, fill=1)
596
+ c.setFont("Helvetica-Bold", 7.8)
597
+ c.drawString(right_x + 27, sy - 3, head)
598
+ draw_wrapped(c, body, right_x + 27, sy - 16, col_w - 54, size=7.1, leading=8.4, color=INK)
599
+ sy -= 57
600
+ rounded_card(c, MARGIN, 355, PAGE_W - 2 * MARGIN, 94, NAVY, NAVY)
601
+ c.setFillColor(colors.HexColor("#8FE3DD"))
602
+ c.setFont("Helvetica-Bold", 9)
603
+ c.drawString(MARGIN + 15, 430, "SCORING RULE")
604
+ c.setFillColor(WHITE)
605
+ c.setFont("Helvetica-Bold", 10)
606
+ c.drawString(MARGIN + 15, 405, "APPLICABLE = 120 − N/A")
607
+ c.drawString(MARGIN + 204, 405, "MISS COUNT = TOTAL NC")
608
+ c.drawString(MARGIN + 389, 405, "SCORE = C ÷ APPLICABLE × 100")
609
+ c.setFont("Helvetica", 7.6)
610
+ c.setFillColor(colors.HexColor("#DDE7EE"))
611
+ c.drawString(MARGIN + 15, 381, "The policy trigger is the total NC count, not the percentage. N/A does not excuse a condition that exists but cannot be verified.")
612
+ c.setFillColor(colors.HexColor("#8FE3DD"))
613
+ c.setFont("Helvetica-Bold", 8)
614
+ c.drawString(MARGIN + 15, 365, "0–10 NC: THRESHOLD MET • 11+ NC: TARGETED IMPROVEMENT + DETAILED CAP TO DM • ALL NC: CORRECT AND VERIFY")
615
+
616
+ rounded_card(c, MARGIN, 200, 352, 137, WHITE)
617
+ c.setFillColor(TEAL)
618
+ c.setFont("Helvetica-Bold", 9.5)
619
+ c.drawString(MARGIN + 14, 317, "ACCOUNTABILITY")
620
+ responsibilities = [
621
+ ("Safety Coordinator", "Inspect, document, score, assign and submit the monthly packet to GM, DM and LP."),
622
+ ("Store Manager", "Control hazards, provide owners/resources, certify accuracy and drive all actions to closure."),
623
+ ("District Manager", "Review every packet; when NC >10, follow up and verify the submitted CAP is completed."),
624
+ ("GM & Loss Prevention", "Review results/trends, support escalation and challenge overdue or repeat conditions."),
625
+ ]
626
+ ry = 296
627
+ for role, duty in responsibilities:
628
+ c.setFillColor(NAVY)
629
+ c.setFont("Helvetica-Bold", 7.4)
630
+ c.drawString(MARGIN + 14, ry, role)
631
+ draw_wrapped(c, duty, MARGIN + 105, ry, 225, size=7.1, leading=8.3, color=INK)
632
+ ry -= 28
633
+
634
+ rounded_card(c, 396, 200, 184, 137, ORANGE_LIGHT, colors.HexColor("#E9B66D"))
635
+ c.setFillColor(ORANGE)
636
+ c.setFont("Helvetica-Bold", 9.5)
637
+ c.drawString(410, 317, "REQUIRED TIMING")
638
+ c.setFillColor(NAVY)
639
+ c.setFont("Helvetica-Bold", 7.4)
640
+ c.drawString(410, 294, "Immediate")
641
+ draw_wrapped(c, "Control imminent danger and make required notifications.", 410, 282, 153, size=7.1, leading=8.3, color=INK)
642
+ c.setFont("Helvetica-Bold", 7.4)
643
+ c.setFillColor(NAVY)
644
+ c.drawString(410, 253, "After audit")
645
+ draw_wrapped(c, "Enter the company/local submission and action deadlines on the scorecard and CAP.", 410, 241, 153, size=7.1, leading=8.3, color=INK)
646
+ c.setFont("Helvetica-Bold", 7.4)
647
+ c.setFillColor(NAVY)
648
+ c.drawString(410, 223, "No silent carryover")
649
+ draw_wrapped(c, "Escalate overdue/repeat items; keep interim controls documented.", 410, 211, 153, size=7.1, leading=8.1, color=INK)
650
+
651
+ rounded_card(c, MARGIN, 56, PAGE_W - 2 * MARGIN, 122, LIGHT)
652
+ c.setFillColor(NAVY)
653
+ c.setFont("Helvetica-Bold", 9)
654
+ c.drawString(MARGIN + 14, 158, "SCOPE, LOCAL REQUIREMENTS & SAFE VERIFICATION")
655
+ scope = (
656
+ "This checklist is a management control, not a substitute for current law, fire/health code, manufacturer instructions or company policy. "
657
+ "Apply the stricter requirement and add site-specific items when needed. Do not create exposure to test a control: use records or a qualified service provider for live electrical, fire-system, roof, confined-space or other specialist work. "
658
+ "Record only what was observed or verified. Attach photographs, work orders, logs or service reports when they materially support a finding or closure."
659
+ )
660
+ draw_wrapped(c, scope, MARGIN + 14, 140, PAGE_W - 2 * MARGIN - 28, size=7.6, leading=9.5, color=INK)
661
+ c.setFillColor(RED)
662
+ c.setFont("Helvetica-Bold", 7.5)
663
+ c.drawString(MARGIN + 14, 71, "A SCORE NEVER OVERRIDES THE DUTY TO PROTECT PEOPLE, FOOD AND PROPERTY NOW.")
664
+ draw_footer(c, page)
665
+ c.showPage()
666
+
667
+
668
+ def header_context_fields(c: canvas.Canvas, page: int) -> None:
669
+ """Legacy no-op: page context fields are rendered inside the navy header."""
670
+ return None
671
+
672
+
673
+ def draw_section_summary(c: canvas.Canvas, section: Section, y: float) -> None:
674
+ x = MARGIN
675
+ w = PAGE_W - 2 * MARGIN
676
+ h = 74
677
+ rounded_card(c, x, y, w, h, LIGHT)
678
+ c.setFillColor(NAVY)
679
+ c.setFont("Helvetica-Bold", 8.5)
680
+ c.drawString(x + 12, y + 57, f"SECTION {section.code} CLOSEOUT • TRANSFER TOTALS TO THE FINAL SCORECARD")
681
+ fields = [
682
+ ("Items", str(len(section.items)), 48),
683
+ ("C", "", 48),
684
+ ("NC / missed", "", 64),
685
+ ("N/A", "", 48),
686
+ ("Applicable", "", 63),
687
+ ("Score %", "", 58),
688
+ ("Reviewer initials", "", 80),
689
+ ]
690
+ fx = x + 12
691
+ for title, value, fw in fields:
692
+ label(c, title, fx, y + 39, size=5.8)
693
+ text_field(
694
+ c,
695
+ f"section_{section.code}_{title.lower().replace(' ', '_').replace('/', '')}",
696
+ fx,
697
+ y + 15,
698
+ fw,
699
+ 19,
700
+ tooltip=f"Section {section.code} {title}",
701
+ value=value,
702
+ size=8,
703
+ fill_color=WHITE,
704
+ )
705
+ fx += fw + 10
706
+ c.setFillColor(MUTED)
707
+ c.setFont("Helvetica-Oblique", 6.4)
708
+ c.drawRightString(x + w - 12, y + 5, "Applicable = items − N/A • Score = C ÷ applicable × 100 • Every NC requires an action reference")
709
+
710
+
711
+ def draw_checklist_page(
712
+ c: canvas.Canvas,
713
+ page: int,
714
+ section: Section,
715
+ items: Sequence[tuple[str, str]],
716
+ part: int,
717
+ parts: int,
718
+ final_part: bool,
719
+ ) -> None:
720
+ key = f"section_{section.code}" if part == 1 else f"section_{section.code}_{part}"
721
+ c.bookmarkPage(key)
722
+ if part == 1:
723
+ c.addOutlineEntry(f"{section.code}. {section.title}", key, level=0)
724
+ draw_page_header(c, page, f"{section.code}. {section.title}", "INSPECTION CHECKLIST")
725
+ header_context_fields(c, page)
726
+ c.setFillColor(NAVY)
727
+ c.setFont("Helvetica-Bold", 15)
728
+ suffix = "" if part == 1 else " • CONTINUED"
729
+ c.drawString(MARGIN, 720, f"{section.code}. {section.title}{suffix}")
730
+ c.setFillColor(TEAL)
731
+ c.setFont("Helvetica-Bold", 7)
732
+ c.drawRightString(PAGE_W - MARGIN, 691, f"PART {part} OF {parts} • {len(section.items)} SECTION ITEMS")
733
+ draw_wrapped(c, section.purpose, MARGIN, 699, 435, size=7.5, leading=9, color=MUTED, max_lines=2)
734
+
735
+ x0 = MARGIN
736
+ widths = [31, 291, 29, 31, 32, 133]
737
+ xs = [x0]
738
+ for width in widths:
739
+ xs.append(xs[-1] + width)
740
+ table_top = 674
741
+ head_h = 25
742
+ c.setFillColor(NAVY)
743
+ c.rect(x0, table_top - head_h, sum(widths), head_h, stroke=0, fill=1)
744
+ headers = ["ID", "VERIFICATION CRITERION", "C", "NC", "N/A", "FINDING / ACTION ID"]
745
+ for i, head in enumerate(headers):
746
+ c.setFillColor(colors.HexColor("#8FE3DD") if head in {"C", "NC", "N/A"} else WHITE)
747
+ c.setFont("Helvetica-Bold", 6.3 if head != "VERIFICATION CRITERION" else 6.7)
748
+ if i in (0, 2, 3, 4):
749
+ c.drawCentredString(xs[i] + widths[i] / 2, table_top - 16, head)
750
+ else:
751
+ c.drawString(xs[i] + 6, table_top - 16, head)
752
+ c.setFont("Helvetica", 5.5)
753
+ c.setFillColor(colors.HexColor("#DDE7EE"))
754
+ c.drawRightString(xs[6] - 5, table_top - 23, "Short note or action-register reference")
755
+
756
+ y = table_top - head_h
757
+ criterion_font = 7.15
758
+ criterion_leading = 8.65
759
+ for idx, (item_id, text) in enumerate(items):
760
+ lines = wrap_text(text, "Helvetica", criterion_font, widths[1] - 12)
761
+ row_h = max(26, len(lines) * criterion_leading + 8)
762
+ if y - row_h < (111 if final_part else 37):
763
+ raise RuntimeError(f"Checklist rows do not fit: section {section.code}, page {part}, item {item_id}")
764
+ fill = WHITE if idx % 2 == 0 else LIGHT
765
+ c.setFillColor(fill)
766
+ c.rect(x0, y - row_h, sum(widths), row_h, stroke=0, fill=1)
767
+ c.setFillColor(GREEN_LIGHT)
768
+ c.rect(xs[2], y - row_h, widths[2], row_h, stroke=0, fill=1)
769
+ c.setFillColor(RED_LIGHT)
770
+ c.rect(xs[3], y - row_h, widths[3], row_h, stroke=0, fill=1)
771
+ c.setFillColor(LIGHT_2)
772
+ c.rect(xs[4], y - row_h, widths[4], row_h, stroke=0, fill=1)
773
+ c.setStrokeColor(LINE)
774
+ c.setLineWidth(0.45)
775
+ c.rect(x0, y - row_h, sum(widths), row_h, stroke=1, fill=0)
776
+ for xx in xs[1:-1]:
777
+ c.line(xx, y - row_h, xx, y)
778
+
779
+ c.setFillColor(NAVY)
780
+ c.setFont("Helvetica-Bold", 7.1)
781
+ c.drawCentredString(xs[0] + widths[0] / 2, y - row_h / 2 - 2.3, item_id)
782
+ ty = y - 9
783
+ c.setFont("Helvetica", criterion_font)
784
+ c.setFillColor(INK)
785
+ for line in lines:
786
+ c.drawString(xs[1] + 6, ty, line)
787
+ ty -= criterion_leading
788
+
789
+ radio_y = y - row_h / 2 - 5
790
+ group_name = f"status_{item_id}"
791
+ radio(c, group_name, "C", xs[2] + (widths[2] - 10) / 2, radio_y, tooltip=f"{item_id} Compliant")
792
+ radio(c, group_name, "NC", xs[3] + (widths[3] - 10) / 2, radio_y, tooltip=f"{item_id} Non-compliant")
793
+ radio(c, group_name, "NA", xs[4] + (widths[4] - 10) / 2, radio_y, tooltip=f"{item_id} Not applicable")
794
+ field_h = min(18, row_h - 8)
795
+ text_field(
796
+ c,
797
+ f"finding_{item_id}",
798
+ xs[5] + 5,
799
+ y - row_h / 2 - field_h / 2,
800
+ widths[5] - 10,
801
+ field_h,
802
+ tooltip=f"{item_id} finding note or corrective action reference",
803
+ size=6.8,
804
+ fill_color=WHITE,
805
+ maxlen=90,
806
+ )
807
+ y -= row_h
808
+
809
+ notes_bottom = 116 if final_part else 81
810
+ notes_height = y - notes_bottom - 25
811
+ if notes_height >= 34:
812
+ c.setFillColor(TEAL)
813
+ c.setFont("Helvetica-Bold", 6.7)
814
+ c.drawString(MARGIN, y - 13, "PAGE NOTES • IMMEDIATE CONTROLS • EVIDENCE / ATTACHMENT REFERENCES")
815
+ text_field(
816
+ c,
817
+ f"page_notes_{page}",
818
+ MARGIN,
819
+ notes_bottom,
820
+ PAGE_W - 2 * MARGIN,
821
+ notes_height,
822
+ tooltip=f"Page {page} notes, immediate controls, and evidence or attachment references",
823
+ size=7.1,
824
+ multiline=True,
825
+ fill_color=LIGHT,
826
+ )
827
+
828
+ if final_part:
829
+ draw_section_summary(c, section, 34)
830
+ else:
831
+ c.setFillColor(ORANGE_LIGHT)
832
+ c.setStrokeColor(colors.HexColor("#E9B66D"))
833
+ c.roundRect(MARGIN, 37, PAGE_W - 2 * MARGIN, 36, 5, stroke=1, fill=1)
834
+ c.setFillColor(ORANGE)
835
+ c.setFont("Helvetica-Bold", 7)
836
+ c.drawString(MARGIN + 10, 59, "CONTINUE TO NEXT PAGE")
837
+ c.setFillColor(INK)
838
+ c.setFont("Helvetica", 6.8)
839
+ c.drawString(MARGIN + 10, 46, "Do not total this section until every item has one status and each NC has an action reference.")
840
+ draw_footer(c, page)
841
+ c.showPage()
842
+
843
+
844
+ def draw_scorecard(c: canvas.Canvas, page: int) -> None:
845
+ c.bookmarkPage("scorecard")
846
+ c.addOutlineEntry("Final scorecard & threshold decision", "scorecard", level=0)
847
+ draw_page_header(c, page, "Final Scorecard & Threshold Decision", "SCORING & FOLLOW-UP")
848
+ header_context_fields(c, page)
849
+ c.setFillColor(NAVY)
850
+ c.setFont("Helvetica-Bold", 15)
851
+ c.drawString(MARGIN, 720, "Reconcile all seven sections before choosing the outcome.")
852
+ draw_wrapped(c, "Enter the section closeout totals. The total NC count controls the required CAP decision.", MARGIN, 700, 500, size=7.8, color=MUTED)
853
+
854
+ x0 = MARGIN
855
+ widths = [190, 43, 45, 45, 45, 58, 58, 64]
856
+ xs = [x0]
857
+ for w in widths:
858
+ xs.append(xs[-1] + w)
859
+ top = 666
860
+ head_h = 36
861
+ c.setFillColor(NAVY)
862
+ c.rect(x0, top - head_h, sum(widths), head_h, stroke=0, fill=1)
863
+ heads = ["SAFETY AREA", "ITEMS", "C", "NC", "N/A", "APPLIC.", "SCORE %", "FOCUS FLAG"]
864
+ for i, head in enumerate(heads):
865
+ c.setFillColor(WHITE if i < 2 else colors.HexColor("#8FE3DD"))
866
+ c.setFont("Helvetica-Bold", 6.2)
867
+ if i == 0:
868
+ c.drawString(xs[i] + 7, top - 22, head)
869
+ else:
870
+ c.drawCentredString(xs[i] + widths[i] / 2, top - 22, head)
871
+ rows = [(s.code, s.title, len(s.items)) for s in SECTIONS]
872
+ row_h = 38
873
+ y = top - head_h
874
+ for ri, (code, title, count) in enumerate(rows):
875
+ c.setFillColor(WHITE if ri % 2 == 0 else LIGHT)
876
+ c.rect(x0, y - row_h, sum(widths), row_h, stroke=0, fill=1)
877
+ c.setStrokeColor(LINE)
878
+ c.setLineWidth(0.5)
879
+ c.rect(x0, y - row_h, sum(widths), row_h, stroke=1, fill=0)
880
+ for xx in xs[1:-1]:
881
+ c.line(xx, y - row_h, xx, y)
882
+ c.setFillColor(NAVY)
883
+ c.setFont("Helvetica-Bold", 7.6)
884
+ c.drawString(xs[0] + 7, y - 15, f"{code}. {title}")
885
+ c.setFont("Helvetica", 6.3)
886
+ c.setFillColor(MUTED)
887
+ c.drawString(xs[0] + 7, y - 27, "Flag every area with NC for targeted correction/trending.")
888
+ vals = [str(count), "", "", "", "", "", ""]
889
+ names = ["items", "c", "nc", "na", "applicable", "score", "focus"]
890
+ for j in range(1, len(widths)):
891
+ text_field(
892
+ c,
893
+ f"score_{code}_{names[j-1]}",
894
+ xs[j] + 5,
895
+ y - row_h + 8,
896
+ widths[j] - 10,
897
+ 21,
898
+ tooltip=f"Section {code} {heads[j]}",
899
+ value=vals[j-1],
900
+ size=7.4,
901
+ fill_color=WHITE,
902
+ )
903
+ y -= row_h
904
+
905
+ total_h = 42
906
+ c.setFillColor(NAVY)
907
+ c.rect(x0, y - total_h, sum(widths), total_h, stroke=0, fill=1)
908
+ c.setFillColor(WHITE)
909
+ c.setFont("Helvetica-Bold", 8)
910
+ c.drawString(x0 + 7, y - 25, "TOTAL / OVERALL")
911
+ total_vals = ["120", "", "", "", "", "", ""]
912
+ total_names = ["items", "c", "nc", "na", "applicable", "score", "focus"]
913
+ for j in range(1, len(widths)):
914
+ text_field(
915
+ c,
916
+ f"score_total_{total_names[j-1]}",
917
+ xs[j] + 5,
918
+ y - total_h + 9,
919
+ widths[j] - 10,
920
+ 22,
921
+ tooltip=f"Overall {heads[j]}",
922
+ value=total_vals[j-1],
923
+ size=7.5,
924
+ fill_color=WHITE,
925
+ border_color=colors.HexColor("#8FE3DD"),
926
+ )
927
+ y -= total_h
928
+
929
+ decision_y = 215
930
+ rounded_card(c, MARGIN, decision_y, PAGE_W - 2 * MARGIN, 115, LIGHT)
931
+ c.setFillColor(NAVY)
932
+ c.setFont("Helvetica-Bold", 9.5)
933
+ c.drawString(MARGIN + 14, decision_y + 94, "REQUIRED OUTCOME DECISION")
934
+ radio(c, "overall_threshold_outcome", "MEETS", MARGIN + 16, decision_y + 62, tooltip="Overall outcome: 0 to 10 missed items")
935
+ c.setFillColor(GREEN)
936
+ c.setFont("Helvetica-Bold", 8.5)
937
+ c.drawString(MARGIN + 32, decision_y + 65, "0–10 NC • MONTHLY THRESHOLD MET")
938
+ c.setFillColor(INK)
939
+ c.setFont("Helvetica", 7)
940
+ c.drawString(MARGIN + 32, decision_y + 51, "Correct and verify every NC; no detailed threshold CAP is required solely by score.")
941
+
942
+ radio(c, "overall_threshold_outcome", "CAP_REQUIRED", MARGIN + 286, decision_y + 62, tooltip="Overall outcome: 11 or more missed items, corrective action plan required")
943
+ c.setFillColor(RED)
944
+ c.setFont("Helvetica-Bold", 8.5)
945
+ c.drawString(MARGIN + 302, decision_y + 65, "11+ NC • DETAILED CAP REQUIRED")
946
+ c.setFillColor(INK)
947
+ c.setFont("Helvetica", 7)
948
+ c.drawString(MARGIN + 302, decision_y + 51, "Submit to DM; copy GM/LP. DM follows up and verifies completion.")
949
+
950
+ fields = [
951
+ ("Total NC", "decision_total_nc", 52),
952
+ ("CAP due", "decision_cap_due", 73),
953
+ ("DM follow-up", "decision_dm_followup", 78),
954
+ ("Next review", "decision_next_review", 73),
955
+ ("Open actions", "decision_open_actions", 64),
956
+ ]
957
+ fx = MARGIN + 14
958
+ for title, name, fw in fields:
959
+ label(c, title, fx, decision_y + 31, size=5.8)
960
+ text_field(c, name, fx, decision_y + 8, fw, 19, tooltip=title, size=7.2)
961
+ fx += fw + 18
962
+
963
+ rounded_card(c, MARGIN, 83, 335, 119, WHITE)
964
+ c.setFillColor(TEAL)
965
+ c.setFont("Helvetica-Bold", 8.5)
966
+ c.drawString(MARGIN + 12, 181, "TARGETED IMPROVEMENT AREAS / REPEAT CONDITIONS")
967
+ text_field(c, "score_target_areas", MARGIN + 12, 97, 311, 72, tooltip="Areas with non-compliance, below local thresholds, repeat conditions, or trend concerns", size=7.2, multiline=True)
968
+ c.setFillColor(MUTED)
969
+ c.setFont("Helvetica-Oblique", 6.3)
970
+ c.drawString(MARGIN + 12, 87, "List sections with NC, any local section-threshold miss, and repeat/overdue patterns.")
971
+
972
+ rounded_card(c, 379, 83, 201, 119, ORANGE_LIGHT, colors.HexColor("#E9B66D"))
973
+ c.setFillColor(ORANGE)
974
+ c.setFont("Helvetica-Bold", 8.5)
975
+ c.drawString(391, 181, "RECONCILIATION CHECK")
976
+ checks = [
977
+ ("recon_all_status", "All 120 items have a status"),
978
+ ("recon_counts", "C + NC + N/A = 120"),
979
+ ("recon_actions", "Every NC has an action ID"),
980
+ ("recon_attachments", "Evidence/attachments indexed"),
981
+ ]
982
+ cy = 155
983
+ for name, wording in checks:
984
+ checkbox(c, name, 392, cy - 3, tooltip=wording, size=9)
985
+ c.setFillColor(INK)
986
+ c.setFont("Helvetica", 6.9)
987
+ c.drawString(407, cy, wording)
988
+ cy -= 20
989
+ draw_footer(c, page)
990
+ c.showPage()
991
+
992
+
993
+ def draw_action_register_page(c: canvas.Canvas, page: int, start_no: int, end_no: int, part: int) -> None:
994
+ key = f"action_register_{part}"
995
+ c.bookmarkPage(key)
996
+ if part == 1:
997
+ c.addOutlineEntry("Corrective action register", key, level=0)
998
+ draw_page_header(c, page, f"Corrective Action Register • {start_no:02d}–{end_no:02d}", "SCORING & FOLLOW-UP")
999
+ header_context_fields(c, page)
1000
+ c.setFillColor(NAVY)
1001
+ c.setFont("Helvetica-Bold", 15)
1002
+ c.drawString(MARGIN, 720, "Assign, control, complete and independently verify.")
1003
+ draw_wrapped(c, "Use one card per action; link all relevant checklist IDs. Duplicate this page if more actions are needed.", MARGIN, 700, 500, size=7.8, color=MUTED)
1004
+
1005
+ y = 682
1006
+ card_h = 101
1007
+ for action_no in range(start_no, end_no + 1):
1008
+ y -= card_h
1009
+ rounded_card(c, MARGIN, y, PAGE_W - 2 * MARGIN, card_h - 6, WHITE)
1010
+ c.setFillColor(NAVY)
1011
+ c.roundRect(MARGIN, y + card_h - 31, 42, 25, 6, stroke=0, fill=1)
1012
+ c.setFillColor(WHITE)
1013
+ c.setFont("Helvetica-Bold", 8)
1014
+ c.drawCentredString(MARGIN + 21, y + card_h - 22, f"CA-{action_no:02d}")
1015
+
1016
+ top_y = y + card_h - 27
1017
+ header_fields = [
1018
+ ("Item ID(s)", f"ca_{action_no}_items", 72),
1019
+ ("Priority", f"ca_{action_no}_priority", 53),
1020
+ ("Owner", f"ca_{action_no}_owner", 94),
1021
+ ("Due date", f"ca_{action_no}_due", 67),
1022
+ ("Status", f"ca_{action_no}_status", 67),
1023
+ ("Verified by / date", f"ca_{action_no}_verify", 103),
1024
+ ]
1025
+ fx = MARGIN + 50
1026
+ for title, name, fw in header_fields:
1027
+ label(c, title, fx, top_y + 14, size=5.2)
1028
+ text_field(c, name, fx, top_y - 5, fw, 16, tooltip=f"Corrective action {action_no}: {title}", size=6.5)
1029
+ fx += fw + 5
1030
+
1031
+ label(c, "Finding & immediate control", MARGIN + 10, y + 51, size=5.4)
1032
+ text_field(c, f"ca_{action_no}_finding", MARGIN + 10, y + 32, 240, 17, tooltip=f"Corrective action {action_no}: finding and immediate control", size=6.4)
1033
+ label(c, "Corrective action / completion evidence", MARGIN + 260, y + 51, size=5.4)
1034
+ text_field(c, f"ca_{action_no}_action", MARGIN + 260, y + 32, 278, 17, tooltip=f"Corrective action {action_no}: corrective action and completion evidence", size=6.4)
1035
+
1036
+ label(c, "Root cause / recurrence control", MARGIN + 10, y + 24, size=5.4)
1037
+ text_field(c, f"ca_{action_no}_root", MARGIN + 10, y + 6, 240, 16, tooltip=f"Corrective action {action_no}: root cause or recurrence control", size=6.4)
1038
+ label(c, "Completion date / work order / attachment", MARGIN + 260, y + 24, size=5.4)
1039
+ text_field(c, f"ca_{action_no}_evidence", MARGIN + 260, y + 6, 278, 16, tooltip=f"Corrective action {action_no}: completion date, work order or attachment", size=6.4)
1040
+ y -= 5
1041
+ draw_footer(c, page)
1042
+ c.showPage()
1043
+
1044
+
1045
+ def draw_cap(c: canvas.Canvas, page: int) -> None:
1046
+ c.bookmarkPage("detailed_cap")
1047
+ c.addOutlineEntry("Detailed CAP (required at 11+ NC)", "detailed_cap", level=0)
1048
+ draw_page_header(c, page, "Detailed Corrective Action Plan", "REQUIRED WHEN TOTAL NC IS 11+")
1049
+ header_context_fields(c, page)
1050
+ c.setFillColor(NAVY)
1051
+ c.setFont("Helvetica-Bold", 15)
1052
+ c.drawString(MARGIN, 720, "Target the system causes—not only the visible defects.")
1053
+ c.setFillColor(RED)
1054
+ c.setFont("Helvetica-Bold", 7.5)
1055
+ c.drawString(MARGIN, 697, "REQUIRED FOR 11+ MISSED ITEMS • SUBMIT TO DM • COPY GM & LP • DM VERIFIES COMPLETION")
1056
+
1057
+ rounded_card(c, MARGIN, 626, PAGE_W - 2 * MARGIN, 55, LIGHT)
1058
+ top_fields = [
1059
+ ("Total NC", "cap_total_nc", 55),
1060
+ ("Prepared date", "cap_prepared_date", 80),
1061
+ ("Submit due", "cap_submit_due", 76),
1062
+ ("DM follow-up due", "cap_dm_due", 94),
1063
+ ("Target closure", "cap_target_close", 83),
1064
+ ("CAP owner", "cap_owner", 91),
1065
+ ]
1066
+ fx = MARGIN + 10
1067
+ for title, name, fw in top_fields:
1068
+ label(c, title, fx, 662, size=5.3)
1069
+ text_field(c, name, fx, 636, fw, 21, tooltip=title, size=6.8)
1070
+ fx += fw + 6
1071
+
1072
+ blocks = [
1073
+ ("1 PROBLEM STATEMENT & PATTERN", "cap_problem", "Summarize affected areas, repeat/overdue conditions, incidents or trends and business impact.", 550, 62),
1074
+ ("2 ROOT CAUSE ANALYSIS", "cap_root_cause", "Identify contributing management-system, process, people, equipment, vendor and environmental causes. State evidence, not blame.", 466, 62),
1075
+ ("3 IMMEDIATE CONTAINMENT", "cap_containment", "Describe controls already in place, who confirmed them and when; include shutdown/food disposition/escalation where relevant.", 382, 62),
1076
+ ("4 CORRECTIVE & PREVENTIVE ACTIONS", "cap_actions", "Reference CA IDs; include repair/process/training/resource changes, responsible owners, milestones and completion measures.", 286, 74),
1077
+ ("5 EFFECTIVENESS & SUSTAINMENT", "cap_effectiveness", "Define evidence, inspection/metric cadence, sample size, success criteria, verification owner and response if the fix fails.", 190, 74),
1078
+ ]
1079
+ for title, name, prompt, y, h in blocks:
1080
+ rounded_card(c, MARGIN, y, PAGE_W - 2 * MARGIN, h, WHITE)
1081
+ c.setFillColor(TEAL)
1082
+ c.setFont("Helvetica-Bold", 7.6)
1083
+ c.drawString(MARGIN + 10, y + h - 15, title)
1084
+ c.setFillColor(MUTED)
1085
+ c.setFont("Helvetica-Oblique", 6.2)
1086
+ c.drawString(MARGIN + 10, y + h - 28, prompt)
1087
+ text_field(c, name, MARGIN + 10, y + 7, PAGE_W - 2 * MARGIN - 20, h - 38, tooltip=title, size=7, multiline=True)
1088
+
1089
+ rounded_card(c, MARGIN, 71, PAGE_W - 2 * MARGIN, 99, ORANGE_LIGHT, colors.HexColor("#E9B66D"))
1090
+ c.setFillColor(ORANGE)
1091
+ c.setFont("Helvetica-Bold", 8)
1092
+ c.drawString(MARGIN + 10, 151, "DISTRICT MANAGER REVIEW & VERIFICATION")
1093
+ radio(c, "cap_dm_decision", "ACCEPTED", MARGIN + 11, 125, tooltip="District Manager accepts the CAP")
1094
+ c.setFillColor(INK)
1095
+ c.setFont("Helvetica-Bold", 7)
1096
+ c.drawString(MARGIN + 27, 128, "ACCEPTED")
1097
+ radio(c, "cap_dm_decision", "REVISION", MARGIN + 93, 125, tooltip="District Manager requests CAP revision")
1098
+ c.drawString(MARGIN + 109, 128, "REVISION REQUIRED")
1099
+ radio(c, "cap_dm_decision", "CLOSED", MARGIN + 211, 125, tooltip="District Manager verified the CAP complete")
1100
+ c.drawString(MARGIN + 227, 128, "COMPLETION VERIFIED")
1101
+ label(c, "DM name", MARGIN + 351, 136, size=5.3)
1102
+ text_field(c, "cap_dm_name", MARGIN + 351, 115, 96, 17, tooltip="District Manager name", size=6.7)
1103
+ label(c, "Review / verify date", MARGIN + 455, 136, size=5.3)
1104
+ text_field(c, "cap_dm_review_date", MARGIN + 455, 115, 83, 17, tooltip="District Manager review or verification date", size=6.7)
1105
+ label(c, "DM comments / required revision / evidence reviewed", MARGIN + 10, 105, size=5.3)
1106
+ text_field(c, "cap_dm_comments", MARGIN + 10, 80, PAGE_W - 2 * MARGIN - 20, 20, tooltip="District Manager comments, required revisions, or evidence reviewed", size=6.7)
1107
+ draw_footer(c, page)
1108
+ c.showPage()
1109
+
1110
+
1111
+ def draw_review(c: canvas.Canvas, page: int) -> None:
1112
+ c.bookmarkPage("review")
1113
+ c.addOutlineEntry("Certification, review & distribution", "review", level=0)
1114
+ draw_page_header(c, page, "Certification, Review & Distribution", "MONTHLY CLOSEOUT")
1115
+ header_context_fields(c, page)
1116
+ c.setFillColor(NAVY)
1117
+ c.setFont("Helvetica-Bold", 15)
1118
+ c.drawString(MARGIN, 720, "Complete the record, route it, then verify closure.")
1119
+
1120
+ rounded_card(c, MARGIN, 575, 265, 113, WHITE)
1121
+ c.setFillColor(TEAL)
1122
+ c.setFont("Helvetica-Bold", 8.5)
1123
+ c.drawString(MARGIN + 12, 668, "PRE-SUBMISSION CERTIFICATION")
1124
+ checks = [
1125
+ ("cert_status", "All 120 items have one status"),
1126
+ ("cert_actions", "Every NC is in the action register"),
1127
+ ("cert_immediate", "Immediate hazards are controlled/escalated"),
1128
+ ("cert_score", "Section and overall totals reconcile"),
1129
+ ("cert_cap", "Detailed CAP attached when total NC is 11+"),
1130
+ ]
1131
+ cy = 642
1132
+ for name, wording in checks:
1133
+ checkbox(c, name, MARGIN + 12, cy - 2, tooltip=wording, size=9)
1134
+ c.setFillColor(INK)
1135
+ c.setFont("Helvetica", 6.9)
1136
+ c.drawString(MARGIN + 28, cy + 1, wording)
1137
+ cy -= 15
1138
+
1139
+ rounded_card(c, 309, 575, 271, 113, LIGHT)
1140
+ c.setFillColor(TEAL)
1141
+ c.setFont("Helvetica-Bold", 8.5)
1142
+ c.drawString(321, 668, "CLOSURE SNAPSHOT")
1143
+ snapshot = [
1144
+ ("Total NC", "review_total_nc", 52),
1145
+ ("Open", "review_open", 46),
1146
+ ("Overdue", "review_overdue", 52),
1147
+ ("Repeat", "review_repeat", 52),
1148
+ ]
1149
+ fx = 321
1150
+ for title, name, fw in snapshot:
1151
+ label(c, title, fx, 645, size=5.4)
1152
+ text_field(c, name, fx, 620, fw, 20, tooltip=title, size=7)
1153
+ fx += fw + 10
1154
+ label(c, "Final verified closure date (enter when all actions are complete)", 321, 607, size=5.2)
1155
+ text_field(c, "review_final_close", 321, 584, 247, 19, tooltip="Final verified closure date", size=7)
1156
+
1157
+ c.setFillColor(NAVY)
1158
+ c.setFont("Helvetica-Bold", 9)
1159
+ c.drawString(MARGIN, 552, "REVIEW & ACKNOWLEDGMENT")
1160
+ c.setFillColor(MUTED)
1161
+ c.setFont("Helvetica", 6.8)
1162
+ c.drawRightString(PAGE_W - MARGIN, 552, "Typed names acknowledge review; use the signature line per company electronic/wet-signature policy.")
1163
+
1164
+ reviewers = [
1165
+ ("Safety Coordinator", "Prepared and submitted a complete, accurate inspection record.", "sc"),
1166
+ ("Store Manager", "Reviewed findings, accepted action ownership and certified immediate controls.", "sm"),
1167
+ ("District Manager", "Reviewed score/CAP and will follow up; verified completion when applicable.", "dm"),
1168
+ ("General Manager", "Reviewed results, resources and material trends/escalations.", "gm"),
1169
+ ("Loss Prevention", "Reviewed loss, liability and repeat-risk implications and follow-up.", "lp"),
1170
+ ]
1171
+ y = 466
1172
+ card_h = 76
1173
+ for role, statement, prefix in reviewers:
1174
+ rounded_card(c, MARGIN, y, PAGE_W - 2 * MARGIN, card_h - 6, WHITE)
1175
+ c.setFillColor(NAVY)
1176
+ c.setFont("Helvetica-Bold", 8.4)
1177
+ c.drawString(MARGIN + 11, y + 52, role)
1178
+ c.setFillColor(MUTED)
1179
+ c.setFont("Helvetica", 6.4)
1180
+ c.drawString(MARGIN + 11, y + 39, statement)
1181
+ label(c, "Printed / typed name", MARGIN + 11, y + 25, size=5.1)
1182
+ text_field(c, f"review_{prefix}_name", MARGIN + 11, y + 7, 137, 15, tooltip=f"{role} printed or typed name", size=6.4)
1183
+ label(c, "Signature", MARGIN + 159, y + 25, size=5.1)
1184
+ c.setStrokeColor(MUTED)
1185
+ c.setLineWidth(0.5)
1186
+ c.line(MARGIN + 159, y + 8, MARGIN + 350, y + 8)
1187
+ label(c, "Review date", MARGIN + 365, y + 25, size=5.1)
1188
+ text_field(c, f"review_{prefix}_date", MARGIN + 365, y + 7, 78, 15, tooltip=f"{role} review date", size=6.4)
1189
+ label(c, "Initials", MARGIN + 454, y + 25, size=5.1)
1190
+ text_field(c, f"review_{prefix}_initials", MARGIN + 454, y + 7, 73, 15, tooltip=f"{role} initials", size=6.4)
1191
+ y -= card_h
1192
+
1193
+ rounded_card(c, MARGIN, 54, PAGE_W - 2 * MARGIN, 43, NAVY, NAVY)
1194
+ c.setFillColor(colors.HexColor("#8FE3DD"))
1195
+ c.setFont("Helvetica-Bold", 7.2)
1196
+ c.drawString(MARGIN + 10, 81, "DISTRIBUTION RECORD")
1197
+ c.setFillColor(WHITE)
1198
+ c.setFont("Helvetica", 6.4)
1199
+ c.drawString(MARGIN + 10, 66, "GM sent:")
1200
+ text_field(c, "dist_gm", MARGIN + 54, 59, 74, 16, tooltip="Date checklist sent to General Manager", size=6.2)
1201
+ c.drawString(MARGIN + 140, 66, "DM sent:")
1202
+ text_field(c, "dist_dm", MARGIN + 184, 59, 74, 16, tooltip="Date checklist sent to District Manager", size=6.2)
1203
+ c.drawString(MARGIN + 270, 66, "LP sent:")
1204
+ text_field(c, "dist_lp", MARGIN + 309, 59, 74, 16, tooltip="Date checklist sent to Loss Prevention", size=6.2)
1205
+ c.drawString(MARGIN + 395, 66, "Attachments / link:")
1206
+ text_field(c, "dist_link", MARGIN + 477, 59, 61, 16, tooltip="Attachment count or repository link/reference", size=5.8)
1207
+ draw_footer(c, page)
1208
+ c.showPage()
1209
+
1210
+
1211
+ def build() -> None:
1212
+ if sum(len(s.items) for s in SECTIONS) != 120:
1213
+ raise RuntimeError("Checklist must contain exactly 120 controls")
1214
+ if sum(sum(s.chunks) for s in SECTIONS) != 120:
1215
+ raise RuntimeError("Section page chunks do not match checklist controls")
1216
+
1217
+ c = canvas.Canvas(str(OUT), pagesize=letter, pageCompression=1)
1218
+ c.setTitle("Monthly Safety Compliance Checklist")
1219
+ c.setAuthor("Store Operations Safety")
1220
+ c.setSubject("Monthly retail store safety, food safety and fire compliance audit")
1221
+ c.setKeywords("retail safety, food safety, fire prevention, corrective action, monthly checklist")
1222
+ c.setCreator("Store Operations MSCL-120")
1223
+
1224
+ page = 1
1225
+ draw_cover(c, page)
1226
+ page += 1
1227
+ draw_instructions(c, page)
1228
+ page += 1
1229
+
1230
+ for section in SECTIONS:
1231
+ offset = 0
1232
+ parts = len(section.chunks)
1233
+ for part, count in enumerate(section.chunks, start=1):
1234
+ chunk = section.items[offset : offset + count]
1235
+ draw_checklist_page(c, page, section, chunk, part, parts, part == parts)
1236
+ page += 1
1237
+ offset += count
1238
+
1239
+ draw_scorecard(c, page)
1240
+ page += 1
1241
+ draw_action_register_page(c, page, 1, 6, 1)
1242
+ page += 1
1243
+ draw_action_register_page(c, page, 7, 12, 2)
1244
+ page += 1
1245
+ draw_cap(c, page)
1246
+ page += 1
1247
+ draw_review(c, page)
1248
+
1249
+ if page != TOTAL_PAGES:
1250
+ raise RuntimeError(f"Page count mismatch: built {page}, expected {TOTAL_PAGES}")
1251
+ c.save()
1252
+
1253
+
1254
+ if __name__ == "__main__":
1255
+ build()
1256
+ print(OUT)
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/02aa1805-c658-4069-8a6a-02dec146063a/Email_to_Manager_Well_Recommendations.eml ADDED
@@ -0,0 +1,418 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ From: Senior Project Manager <senior.project.manager@company.example>
2
+ To: Manager <manager@company.example>
3
+ Date: Tue, 10 Nov 2026 12:00:00 +0000
4
+ Subject:
5
+ Recommendation: Illinois water-well screening for green hydrogen facility
6
+ MIME-Version: 1.0
7
+ Content-Type: multipart/mixed; boundary="===============0422992753696001247=="
8
+
9
+ --===============0422992753696001247==
10
+ Content-Type: multipart/alternative;
11
+ boundary="===============1822521353667222261=="
12
+
13
+ --===============1822521353667222261==
14
+ Content-Type: text/plain; charset="utf-8"
15
+ Content-Transfer-Encoding: quoted-printable
16
+
17
+ Hi,
18
+
19
+ I completed a preliminary screen of the recoverable Illinois EPA Source Water=
20
+ Assessment Program factsheet-derived well records for the requested water sy=
21
+ stems. The attached workbook contains the source fields, individual screening=
22
+ flags and a separate Potential Wells tab.
23
+
24
+ I applied all three required criteria:
25
+ - depth of 160=E2=80=93200 feet, inclusive;
26
+ - Aquifer Description containing both =E2=80=9Csand=E2=80=9D and =E2=80=9Cgra=
27
+ vel=E2=80=9D; and
28
+ - an active Well Description, excluding =E2=80=9Cabandoned,=E2=80=9D =E2=80=
29
+ =9Cinactive,=E2=80=9D =E2=80=9Cdisconnected,=E2=80=9D =E2=80=9Cemergency=E2=
30
+ =80=9D and =E2=80=9Csealed=E2=80=9D (case-insensitive).
31
+
32
+ Seven wells in the recoverable extract pass all three criteria. I recommend a=
33
+ dvancing these options first:
34
+ 1. Farmer City =E2=80=94 WL47648: 188 ft, Sand & Gravel, status A, reported p=
35
+ umpage 26,478,500.
36
+ 2. Farmer City =E2=80=94 WL47646: 180 ft, Sand & Gravel, status A, reported p=
37
+ umpage 21,976,200.
38
+ 3. Weldon =E2=80=94 WL45047: 167 ft, Sand & Gravel, status A, reported pumpag=
39
+ e 5,500,000; leading secondary option.
40
+
41
+ The other wells passing the screen are Waynesville =E2=80=94 WL40006, Weldon =
42
+ =E2=80=94 WL45048, Farmer City =E2=80=94 WL01130 and Farmer City =E2=80=94 WL=
43
+ 47647. All seven appear on the Potential Wells tab.
44
+
45
+ Recommendation: move WL47648 and WL47646 into first-pass technical and commer=
46
+ cial diligence, with WL45047 as the leading alternate. Reported pumpage is on=
47
+ ly a prioritization signal; it is not confirmation of available or sustainabl=
48
+ e project yield.
49
+
50
+ Coverage hold point: the recoverable extract contains rows for Farmer City, B=
51
+ artlett, Weldon and Waynesville, but not Springerton, Enfield, Crossville or =
52
+ Norris City. The live Illinois EPA factsheet host was unavailable from the wo=
53
+ rking environment on 2026-11-10. I do not recommend final source selection un=
54
+ til those four systems are retrieved from the official site and the full shor=
55
+ tlist is re-screened.
56
+
57
+ Before any commitment, we should confirm owner willingness and available capa=
58
+ city, permitted sustainable yield and seasonal drawdown, water quality and pr=
59
+ etreatment demand, water rights/supply terms, conveyance distance and redunda=
60
+ ncy.
61
+
62
+ Illinois EPA factsheets: https://dataservices.epa.illinois.gov/swap/factsheet=
63
+ .aspx
64
+ Attachment: Illinois_Green_Hydrogen_Well_Screening.xlsx
65
+
66
+ Please let me know if you would like me to initiate the validation workstream=
67
+ or contact the shortlisted system owners.
68
+
69
+ Best regards,
70
+
71
+ Senior Project Manager
72
+ Green Hydrogen Development
73
+
74
+ --===============1822521353667222261==
75
+ Content-Type: text/html; charset="utf-8"
76
+ Content-Transfer-Encoding: quoted-printable
77
+ MIME-Version: 1.0
78
+
79
+ <!doctype html>
80
+ <html><body style=3D"font-family:Arial,sans-serif;color:#17324D;line-height:1=
81
+ .45;max-width:800px">
82
+ <div style=3D"background:#17324D;color:white;padding:18px 22px;border-radius:=
83
+ 6px 6px 0 0">
84
+ <div style=3D"font-size:20px;font-weight:700">Illinois water-well screening=
85
+ recommendation</div>
86
+ <div style=3D"font-size:12px;color:#DDEBF7">Green hydrogen facility develop=
87
+ ment</div>
88
+ </div>
89
+ <div style=3D"border:1px solid #CBD5E1;padding:20px 22px">
90
+ <p>Hi,</p>
91
+ <p>I completed a <b>preliminary screen</b> of the recoverable Illinois EPA So=
92
+ urce Water Assessment Program factsheet-derived well records. The attached wo=
93
+ rkbook contains the source fields, individual screening flags and a separate =
94
+ Potential Wells tab.</p>
95
+ <p><b>Screen applied</b></p>
96
+ <ul>
97
+ <li>depth of <b>160=E2=80=93200 feet, inclusive</b>;</li>
98
+ <li>Aquifer Description containing both <b>sand</b> and <b>gravel</b>; and<=
99
+ /li>
100
+ <li>an active Well Description, excluding <b>abandoned, inactive, disconnec=
101
+ ted, emergency</b> and <b>sealed</b> (case-insensitive).</li>
102
+ </ul>
103
+ <p><b>Seven wells pass all three criteria.</b> I recommend the following orde=
104
+ r for initial diligence:</p>
105
+ <table style=3D"border-collapse:collapse;width:100%;font-size:13px">
106
+ <thead><tr style=3D"background:#0E7490;color:white">
107
+ <th style=3D"padding:8px;text-align:left">System</th><th style=3D"padding:8px=
108
+ ;text-align:left">Well ID</th>
109
+ <th style=3D"padding:8px;text-align:left">Depth (ft)</th><th style=3D"padding=
110
+ :8px;text-align:left">Aquifer</th>
111
+ <th style=3D"padding:8px;text-align:left">Reported pumpage</th><th style=3D"p=
112
+ adding:8px;text-align:left">Priority</th>
113
+ </tr></thead><tbody><tr><td>Farmer City</td><td>WL47648</td><td>188</td><td>S=
114
+ and &amp; Gravel</td><td>26,478,500</td><td>First-pass</td></tr><tr><td>Farme=
115
+ r City</td><td>WL47646</td><td>180</td><td>Sand &amp; Gravel</td><td>21,976,2=
116
+ 00</td><td>First-pass</td></tr><tr><td>Weldon</td><td>WL45047</td><td>167</td=
117
+ ><td>Sand &amp; Gravel</td><td>5,500,000</td><td>Secondary</td></tr></tbody><=
118
+ /table>
119
+ <p>The other wells passing the screen are <b>Waynesville =E2=80=94 WL40006</b=
120
+ >, <b>Weldon =E2=80=94 WL45048</b>, <b>Farmer City =E2=80=94 WL01130</b> and =
121
+ <b>Farmer City =E2=80=94 WL47647</b>. All seven appear on the Potential Wells=
122
+ tab.</p>
123
+ <p><b>Recommendation:</b> advance Farmer City <b>WL47648</b> and <b>WL47646</=
124
+ b> into first-pass technical and commercial diligence, with Weldon <b>WL45047=
125
+ </b> as the leading alternate. Reported pumpage is only a prioritization sign=
126
+ al; it is not confirmation of available or sustainable project yield.</p>
127
+ <div style=3D"background:#FCECC9;border-left:5px solid #D97706;padding:12px 1=
128
+ 4px;margin:16px 0">
129
+ <b>Coverage hold point.</b> The recoverable extract contains rows for Farmer =
130
+ City, Bartlett, Weldon and Waynesville, but not Springerton, Enfield, Crossvi=
131
+ lle or Norris City. The live Illinois EPA factsheet host was unavailable from=
132
+ the working environment on 2026-11-10. Do not make final source selection un=
133
+ til those four systems are retrieved from the official site and the full shor=
134
+ tlist is re-screened.
135
+ </div>
136
+ <p>Before any commitment, we should confirm owner willingness and available c=
137
+ apacity, permitted sustainable yield and seasonal drawdown, water quality and=
138
+ pretreatment demand, water rights/supply terms, conveyance distance and redu=
139
+ ndancy.</p>
140
+ <p><a href=3D"https://dataservices.epa.illinois.gov/swap/factsheet.aspx">Illi=
141
+ nois EPA Source Water Assessment Program Factsheets</a><br>
142
+ Attachment: <b>Illinois_Green_Hydrogen_Well_Screening.xlsx</b></p>
143
+ <p>Please let me know if you would like me to initiate the validation workstr=
144
+ eam or contact the shortlisted system owners.</p>
145
+ <p>Best regards,<br><br><b>Senior Project Manager</b><br>Green Hydrogen Devel=
146
+ opment</p>
147
+ </div></body></html>
148
+
149
+ --===============1822521353667222261==--
150
+
151
+ --===============0422992753696001247==
152
+ Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
153
+ Content-Transfer-Encoding: base64
154
+ Content-Disposition: attachment;
155
+ filename="Illinois_Green_Hydrogen_Well_Screening.xlsx"
156
+ MIME-Version: 1.0
157
+
158
+ UEsDBBQAAAAIAMxYal1Gx01IlQAAAM0AAAAQAAAAZG9jUHJvcHMvYXBwLnhtbE3PTQvCMAwG4L9S
159
+ dreZih6kDkQ9ip68zy51hbYpbYT67+0EP255ecgboi6JIia2mEXxLuRtMzLHDUDWI/o+y8qhiqHk
160
+ e64x3YGMsRoPpB8eA8OibdeAhTEMOMzit7Dp1C5GZ3XPlkJ3sjpRJsPiWDQ6sScfq9wcChDneiU+
161
+ ixNLOZcrBf+LU8sVU57mym/8ZAW/B7oXUEsDBBQAAAAIAMxYal06CtXE6AEAAHQEAAARAAAAZG9j
162
+ UHJvcHMvY29yZS54bWzNlEtu2zAQhq9CaG2ZllN4oToCgiZ9AA1gwAZcdEeTY5kJRbIzlBXveoie
163
+ sCcpxciOXXTjXVcSOY/v/zUU59KX0iEs0HnAoIHYS2MsldLfZrsQfMk5yR00gsYxw8bg1mEjQlxi
164
+ zb2Qz6IGPp1MZryBIJQIgvcNc3/qmFVzJUuJIILDob2Sp/a+RZOaKcnBQAM2EC/GBc+qJVgdS6K4
165
+ J5CBPQobYch+//zFPiGAZZ8PCl0dX+5hD8b5vnjO32iJHHQwcBX3izHaOk1/U9YiAOZrMIYtZR/S
166
+ tk64hEgwBSRR+6CdvQq56lwexIZ5BKMbbQUeWNeDKIFYS5HFEKTbA4pNNHQS+bC4Y8v13YJthQy0
167
+ Awi5AtR7UAxdR+/Z1rUYS3+0QC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yLnhtbFBLAQIUAxQAAAAIAMxYal0yPGxapQEAAKwEAAAYAAAAAAAAAAAAAACAAekjAAB4
406
+ bC9jb21tZW50cy9jb21tZW50Mi54bWxQSwECFAMUAAAACADMWGpd2gR5Ol4CAADhEgAAIAAAAAAA
407
+ AAAAAAAAgAHEJQAAeGwvZHJhd2luZ3MvY29tbWVudHNEcmF3aW5nMi52bWxQSwECFAMUAAAACADM
408
+ WGpdiHbqqUkBAAD/AgAAFAAAAAAAAAAAAAAAgAFgKAAAeGwvdGFibGVzL3RhYmxlMi54bWxQSwEC
409
+ FAMUAAAACADMWGpdR9mILbkAAAAeAgAAIwAAAAAAAAAAAAAAgAHbKQAAeGwvd29ya3NoZWV0cy9f
410
+ cmVscy9zaGVldDIueG1sLnJlbHNQSwECFAMUAAAACADMWGpdJbNXWUcEAACqHwAADQAAAAAAAAAA
411
+ AAAAgAHVKgAAeGwvc3R5bGVzLnhtbFBLAQIUAxQAAAAIAMxYal2XirscwAAAABMCAAALAAAAAAAA
412
+ AAAAAACAAUcvAABfcmVscy8ucmVsc1BLAQIUAxQAAAAIAMxYal1BtcsIzgEAADMFAAAPAAAAAAAA
413
+ AAAAAACAATAwAAB4bC93b3JrYm9vay54bWxQSwECFAMUAAAACADMWGpdjfcsWrQAAACJAgAAGgAA
414
+ AAAAAAAAAAAAgAErMgAAeGwvX3JlbHMvd29ya2Jvb2sueG1sLnJlbHNQSwECFAMUAAAACADMWGpd
415
+ lv20mlABAADGBgAAEwAAAAAAAAAAAAAAgAEXMwAAW0NvbnRlbnRfVHlwZXNdLnhtbFBLBQYAAAAA
416
+ EgASANIEAACYNAAAAAA=
417
+
418
+ --===============0422992753696001247==--
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/02aa1805-c658-4069-8a6a-02dec146063a/Illinois_Green_Hydrogen_Well_Screening.xlsx ADDED
Binary file (14.7 kB). View file
 
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0353ee0c-18b5-4ad3-88e8-e001d223e1d7/Veterans PACT Act Comprehensive Guide.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c93d95ce0998cb6bc1f8aa71474e5473178dce648281919d1264b24a79a406f0
3
+ size 115786
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0419f1c3-d669-45d0-81cd-f4d5923b06a5/John_Miller_Performance_Improvement_Plan.docx ADDED
Binary file (45.6 kB). View file
 
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/05389f78-589a-473c-a4ae-67c61050bfca/Juvoxa_Model_A_Termination_Email.docx ADDED
Binary file (40.6 kB). View file
 
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/05389f78-589a-473c-a4ae-67c61050bfca/Model_A_Headlamp_Supplier_Recovery_Report_to_CPO.docx ADDED
Binary file (45.6 kB). View file
 
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:743af6401bd5b92f3b16a11aa9ee20833adb34b5956c7ba213ae5aa38fd756ea
3
+ size 104222
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 PrivateCrypMix contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/Makefile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .PHONY: install build test local-node local-deploy circuit clean
2
+
3
+ install:
4
+ npm install
5
+
6
+ build:
7
+ npm run build
8
+
9
+ test:
10
+ npm test
11
+
12
+ local-node:
13
+ npm run chain
14
+
15
+ local-deploy:
16
+ npm run deploy:local
17
+
18
+ circuit:
19
+ npm run circuit:build
20
+
21
+ clean:
22
+ npm run clean
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/README.md ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PrivateCrypMix
2
+
3
+ PrivateCrypMix is a fixed-denomination, privacy-preserving transfer system for
4
+ Polygon. A deposit joins a Poseidon Merkle tree and is supplied to Aave. After a
5
+ mandatory round-wide holding period, the position is redeemed and every valid
6
+ zkSNARK note receives the same principal-plus-yield payout, either on Polygon
7
+ or through a Connext `xcall` to an allowlisted EVM chain.
8
+
9
+ This repository contains the complete application source:
10
+
11
+ - React + TypeScript + ethers dApp with injected, WalletConnect, and Coinbase
12
+ wallet connections
13
+ - Solidity mixer, Aave V3 and Connext integration, Poseidon root history,
14
+ production deployment tooling, mocks, and tests
15
+ - Circom 2 Groth16 circuit plus multi-party ceremony and export tooling
16
+ - browser/Node SDK for recovery notes, Merkle paths, and proof calldata
17
+ - optional proof-only relayer with durable retries, validation, metrics, and
18
+ privacy-conscious logging
19
+ - local deployment, Docker, operations documentation, and threat model
20
+
21
+ > **Security status:** experimental and unaudited. The repository intentionally
22
+ > excludes a final Groth16 zkey. A production zkey must come from a published
23
+ > multi-party ceremony; shipping an opaque developer key would let its holder
24
+ > forge withdrawals. See [SECURITY.md](SECURITY.md) before using real assets.
25
+
26
+ ## Why mixer rounds?
27
+
28
+ A continuously accruing yield mixer tends to reveal either a note's age or a
29
+ unique payout amount. PrivateCrypMix instead uses finite rounds:
30
+
31
+ 1. one ERC-20 and one exact deposit denomination;
32
+ 2. a public entry deadline;
33
+ 3. a full minimum lock after entry closes;
34
+ 4. a permissionless Aave snapshot at unlock; and
35
+ 5. one equal payout amount for every note.
36
+
37
+ Earlier deposits subsidize later deposits slightly, but neither deposit time nor
38
+ individual yield appears in withdrawal calldata. This trade-off is shown before
39
+ the wallet approval.
40
+
41
+ ## Repository map
42
+
43
+ ```text
44
+ apps/
45
+ web/ React dApp; note creation and proving stay in the browser
46
+ relayer/ Optional Express proof submission and retry service
47
+ packages/
48
+ contracts/ Solidity, Hardhat deployment scripts, mocks, tests
49
+ circuits/ Circom circuit, ceremony scripts, witness tests
50
+ sdk/ Shared note, Merkle, proof, ABI, and config primitives
51
+ docs/
52
+ architecture.md protocol data flow and proof statement
53
+ runbook.md ceremony, deployment, monitoring, lifecycle
54
+ threat-model.md privacy/security assumptions and residual risks
55
+ ```
56
+
57
+ ## Prerequisites
58
+
59
+ - Node.js 20 or newer and npm 10 or newer
60
+ - a Polygon/Amoy RPC endpoint
61
+ - verified Aave V3 Pool and Connext router addresses for that network
62
+ - a Powers of Tau file large enough for the compiled circuit
63
+
64
+ ## Run locally
65
+
66
+ Install dependencies:
67
+
68
+ ```bash
69
+ cp .env.example .env
70
+ npm install
71
+ npm test
72
+ ```
73
+
74
+ Start a local EVM in terminal one:
75
+
76
+ ```bash
77
+ npm run chain
78
+ ```
79
+
80
+ Deploy mocks and a demo round in terminal two:
81
+
82
+ ```bash
83
+ npm run deploy:local
84
+ ```
85
+
86
+ The deployer writes both `packages/contracts/deployments/local.json` and the web
87
+ manifest at `apps/web/public/config/pools.json`. Then start the dApp:
88
+
89
+ ```bash
90
+ npm run dev:web
91
+ ```
92
+
93
+ The local contract uses a **mock verifier**, so it is useful for transaction and
94
+ UI development but cannot validate browser-generated production proofs.
95
+
96
+ ## Build a production proof system
97
+
98
+ ```bash
99
+ npm run circuit:build
100
+ npm run ceremony:prepare -w @privatecrypmix/circuits -- /path/to/powersOfTau.ptau
101
+ npm run ceremony:contribute -w @privatecrypmix/circuits -- contributor-name
102
+ CEREMONY_BEACON=<public-hex-beacon> npm run ceremony:finalize -w @privatecrypmix/circuits
103
+ npm run ceremony:export -w @privatecrypmix/circuits
104
+ ```
105
+
106
+ The exporter checks that the verifier has exactly eight public signals, then
107
+ places its Solidity source under `packages/contracts/contracts/verifiers/` and
108
+ the WASM/zkey under `apps/web/public/circuits/`. Publish hashes and the ceremony
109
+ transcript independently. Deploy the exported verifier with
110
+ `npm run deploy:verifier:polygon -w @privatecrypmix/contracts`.
111
+
112
+ ## Deploy a Polygon round
113
+
114
+ Fill the production variables in `.env`, including the exported verifier. A
115
+ circomlibjs-compatible two-input Poseidon contract can be deployed with
116
+ `npm run deploy:poseidon:polygon -w @privatecrypmix/contracts`; put the resulting
117
+ address in `POSEIDON_ADDRESS`. Then run:
118
+
119
+ ```bash
120
+ npm run deploy:polygon -w @privatecrypmix/contracts
121
+ ```
122
+
123
+ The script validates that every dependency has bytecode, rejects the development
124
+ mock-verifier ABI, deploys immutable round parameters, enables configured Connext
125
+ domains, and writes a deployment manifest. Add a UI-friendly pool entry (with
126
+ the deployment block and official domain IDs) to `apps/web/public/config/pools.json`.
127
+
128
+ ## Relayer
129
+
130
+ The relayer is optional. Configure a dedicated low-balance key and start it with:
131
+
132
+ ```bash
133
+ npm run build -w @privatecrypmix/sdk
134
+ npm run dev:relayer
135
+ ```
136
+
137
+ Its API surface is intentionally small:
138
+
139
+ - `GET /v1/quote` — current asset-denominated relayer fee
140
+ - `POST /v1/withdrawals` ��� completed proof and public fields only
141
+ - `GET /v1/withdrawals/:jobId` — sanitized status
142
+ - `GET /health`, `/ready`, `/metrics` — operations
143
+
144
+ Recovery notes are rejected by the strict request schema. Run the service behind
145
+ TLS and avoid upstream access logs that could correlate proofs with IP addresses.
146
+
147
+ ## Tests and build
148
+
149
+ ```bash
150
+ npm test # SDK, contracts, circuit, relayer, frontend
151
+ npm run build # all TypeScript/Solidity/application bundles
152
+ npm run lint
153
+ ```
154
+
155
+ The circuit test recompiles a witness generator and may take longer than ordinary
156
+ unit tests. Production readiness also requires independent audit, testnet soak,
157
+ ceremony verification, dependency address verification, reproducible frontend
158
+ builds, a timelocked multisig owner, and jurisdiction-specific legal review.
159
+
160
+ ## License
161
+
162
+ MIT. See [LICENSE](LICENSE).
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/SECURITY.md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Security policy
2
+
3
+ PrivateCrypMix moves real assets and relies on zero-knowledge cryptography. The
4
+ repository is a production-oriented reference implementation, not an audit.
5
+ Do not deploy it with valuable funds until the Solidity contracts, Circom
6
+ circuit, ceremony output, relayer, and frontend have each received independent
7
+ review.
8
+
9
+ Deployment operators must publish a monitored private disclosure address before
10
+ launch. Do not include live secrets or user notes in a report.
11
+
12
+ ## Operational invariants
13
+
14
+ - A pool accepts one ERC-20 and one exact denomination during a finite deposit
15
+ window. Fee-on-transfer and rebasing-underlying assets are unsupported.
16
+ - The withdrawal time is `depositDeadline + minimumLockDuration`, so every
17
+ depositor waits at least the advertised duration.
18
+ - The first post-lock snapshot exits the entire Aave position. Every note then
19
+ receives the same `snapshotAssets / depositCount` amount. Equal outputs are
20
+ intentional: individualized yield would link a withdrawal to its deposit.
21
+ - The on-chain verifier address must be produced by the ceremony for the exact
22
+ circuit in this repository. The deploy script rejects a mock verifier.
23
+ - A recovery note contains spend authority. It must never be sent to analytics,
24
+ logs, support staff, or the relayer. Only a completed proof is relayed.
25
+ - Relayers cannot alter a proof's recipient, destination domain, fee, mixer,
26
+ or chain because all are Groth16 public inputs.
27
+
28
+ ## Known trust assumptions
29
+
30
+ Users depend on Aave, the selected ERC-20, Polygon consensus, and Connext for
31
+ cross-chain delivery. The pool owner can pause entry/exit and update the
32
+ destination allowlist, but cannot withdraw pool assets. A pause is therefore a
33
+ temporary availability risk. Ownership should be placed behind a timelock and
34
+ multisig, then renounced when destination configuration is final.
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/Dockerfile ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:22-alpine AS build
2
+ WORKDIR /app
3
+ COPY . .
4
+ RUN npm install --ignore-scripts \
5
+ && npm run build -w @privatecrypmix/sdk \
6
+ && npm run build -w @privatecrypmix/relayer \
7
+ && npm prune --omit=dev
8
+
9
+ FROM node:22-alpine
10
+ RUN addgroup -S app && adduser -S -G app app
11
+ WORKDIR /app
12
+ COPY --from=build --chown=app:app /app /app
13
+ USER app
14
+ WORKDIR /app/apps/relayer
15
+ EXPOSE 8787
16
+ CMD ["node", "dist/server.js"]
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/README.md ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Optional privacy relayer
2
+
3
+ The relayer accepts only a completed Groth16 proof and its public withdrawal
4
+ fields. The API schema rejects recovery-note secrets and unknown properties.
5
+ Every request is checked against an allowlisted deployment manifest, current
6
+ root history, nullifier status, fee policy, destination allowlist, and an
7
+ on-chain `eth_call` before it enters the durable queue.
8
+
9
+ Jobs survive restarts in an atomic mode-0600 JSON store. A single worker avoids
10
+ nonce races, polls broadcast receipts, waits for configured confirmations, and
11
+ uses bounded exponential retry. Confirmed remote jobs expose the Connext transfer
12
+ ID for delivery diagnostics. `/metrics`, `/health`, and `/ready` support
13
+ operations without exposing proofs or request bodies.
14
+
15
+ Run behind TLS. Do not add access logs containing IP addresses, full request
16
+ bodies, or proof identifiers; those can become a timing-correlation dataset.
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/package.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@privatecrypmix/relayer",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "tsx watch src/server.ts",
8
+ "prebuild": "npm run build -w @privatecrypmix/sdk",
9
+ "pretest": "npm run build -w @privatecrypmix/sdk",
10
+ "build": "tsc -p tsconfig.json",
11
+ "start": "node dist/server.js",
12
+ "test": "vitest run",
13
+ "lint": "tsc -p tsconfig.json --noEmit",
14
+ "clean": "rm -rf dist coverage"
15
+ },
16
+ "dependencies": {
17
+ "@privatecrypmix/sdk": "1.0.0",
18
+ "cors": "^2.8.5",
19
+ "dotenv": "^16.4.7",
20
+ "ethers": "^6.13.5",
21
+ "express": "^4.21.2",
22
+ "express-rate-limit": "^7.5.0",
23
+ "helmet": "^8.0.0",
24
+ "pino": "^9.6.0",
25
+ "prom-client": "^15.1.3",
26
+ "zod": "^3.24.1"
27
+ },
28
+ "devDependencies": {
29
+ "@types/cors": "^2.8.17",
30
+ "@types/express": "^4.17.21",
31
+ "@types/node": "^22.10.5",
32
+ "supertest": "^7.0.0",
33
+ "tsx": "^4.19.2",
34
+ "typescript": "^5.7.3",
35
+ "vitest": "^2.1.8"
36
+ }
37
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/app.ts ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import cors from "cors";
2
+ import express, { type ErrorRequestHandler } from "express";
3
+ import rateLimit from "express-rate-limit";
4
+ import helmet from "helmet";
5
+ import type { Logger } from "pino";
6
+ import { ZodError } from "zod";
7
+ import { requests, registry } from "./metrics.js";
8
+ import { parseWithdrawal } from "./schema.js";
9
+ import { RelayerService, ValidationError } from "./service.js";
10
+ import { publicJob } from "./store.js";
11
+
12
+ export function createApp(service: RelayerService, logger: Logger) {
13
+ const app = express();
14
+ app.disable("x-powered-by");
15
+ app.set("trust proxy", false);
16
+ app.use(helmet({ contentSecurityPolicy: false }));
17
+ app.use(cors({
18
+ origin(origin, callback) {
19
+ if (!origin || service.config.allowedOrigins.includes(origin)) callback(null, true);
20
+ else callback(new ValidationError("Origin is not allowed", 403));
21
+ },
22
+ methods: ["GET", "POST"],
23
+ allowedHeaders: ["content-type"]
24
+ }));
25
+ app.use(express.json({ limit: "64kb", strict: true }));
26
+ app.use(rateLimit({ windowMs: 60_000, limit: 30, standardHeaders: "draft-7", legacyHeaders: false }));
27
+ app.use((request, response, next) => {
28
+ response.on("finish", () => {
29
+ requests.inc({ method: request.method, route: request.route?.path ?? request.path, status: String(response.statusCode) });
30
+ });
31
+ next();
32
+ });
33
+
34
+ app.get("/health", (_request, response) => response.json({ status: "ok" }));
35
+ app.get("/ready", async (_request, response, next) => {
36
+ try {
37
+ await service.provider.getBlockNumber();
38
+ response.json({ status: "ready", chainId: service.config.chainId, relayer: service.wallet.address });
39
+ } catch (error) { next(error); }
40
+ });
41
+ app.get("/metrics", async (_request, response) => {
42
+ response.type(registry.contentType).send(await registry.metrics());
43
+ });
44
+
45
+ app.get("/v1/quote", async (request, response, next) => {
46
+ try {
47
+ const mixer = String(request.query.mixer ?? "");
48
+ const destinationDomain = Number(request.query.destinationDomain);
49
+ if (!Number.isInteger(destinationDomain) || destinationDomain < 0 || destinationDomain > 0xffff_ffff) {
50
+ throw new ValidationError("Invalid destinationDomain query parameter");
51
+ }
52
+ response.set("cache-control", "no-store").json(await service.quote(mixer, destinationDomain));
53
+ } catch (error) { next(error); }
54
+ });
55
+
56
+ app.post("/v1/withdrawals", async (request, response, next) => {
57
+ try {
58
+ const bundle = parseWithdrawal(request.body);
59
+ const { job, created } = await service.enqueue(bundle);
60
+ response.status(created ? 202 : 200).set("cache-control", "no-store").json({ jobId: job.id, status: job.status, created });
61
+ } catch (error) { next(error); }
62
+ });
63
+
64
+ app.get("/v1/withdrawals/:jobId", (request, response, next) => {
65
+ try {
66
+ if (!/^0x[0-9a-fA-F]{64}$/u.test(request.params.jobId)) throw new ValidationError("Invalid job ID");
67
+ const job = service.store.get(request.params.jobId);
68
+ if (!job) throw new ValidationError("Job not found", 404);
69
+ response.set("cache-control", "no-store").json(publicJob(job));
70
+ } catch (error) { next(error); }
71
+ });
72
+
73
+ app.use((_request, response) => response.status(404).json({ error: "Not found" }));
74
+ const errors: ErrorRequestHandler = (error, _request, response, _next) => {
75
+ if (error instanceof ValidationError) {
76
+ response.status(error.status).json({ error: error.message });
77
+ return;
78
+ }
79
+ if (error instanceof ZodError) {
80
+ response.status(400).json({ error: "Malformed withdrawal request", details: error.issues.map((issue) => issue.path.join(".")) });
81
+ return;
82
+ }
83
+ logger.error({ error: error instanceof Error ? error.message : "unknown" }, "request failed");
84
+ response.status(500).json({ error: "Internal relayer error" });
85
+ };
86
+ app.use(errors);
87
+ return app;
88
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/config.ts ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import "dotenv/config";
2
+ import { getAddress } from "ethers";
3
+ import { readFile } from "node:fs/promises";
4
+ import path from "node:path";
5
+ import { z } from "zod";
6
+ import type { PoolConfig } from "@privatecrypmix/sdk";
7
+
8
+ const integer = (fallback: string) => z.string().default(fallback).transform((value, context) => {
9
+ const parsed = Number(value);
10
+ if (!Number.isSafeInteger(parsed) || parsed < 0) {
11
+ context.addIssue({ code: z.ZodIssueCode.custom, message: "must be a non-negative integer" });
12
+ return z.NEVER;
13
+ }
14
+ return parsed;
15
+ });
16
+
17
+ const schema = z.object({
18
+ POLYGON_RPC_URL: z.string().url(),
19
+ POLYGON_CHAIN_ID: integer("137"),
20
+ RELAYER_PRIVATE_KEY: z.string().regex(/^0x[0-9a-fA-F]{64}$/u),
21
+ RELAYER_PORT: integer("8787"),
22
+ RELAYER_HOST: z.string().default("127.0.0.1"),
23
+ RELAYER_DATA_FILE: z.string().default("./data/jobs.json"),
24
+ RELAYER_POOLS_FILE: z.string().default("../web/public/config/pools.json"),
25
+ RELAYER_ALLOWED_ORIGINS: z.string().default("http://localhost:5173"),
26
+ RELAYER_FEE_BPS: integer("50"),
27
+ RELAYER_MAX_FEE_BPS: integer("200"),
28
+ RELAYER_MIN_FEE_WEI: z.string().regex(/^\d+$/u).default("0").transform(BigInt),
29
+ RELAYER_XCALL_NATIVE_FEE_WEI: z.string().regex(/^\d+$/u).default("0").transform(BigInt),
30
+ RELAYER_CONFIRMATIONS: integer("2"),
31
+ RELAYER_POLL_MS: integer("5000"),
32
+ RELAYER_STUCK_TX_MS: integer("600000"),
33
+ RELAYER_MAX_ATTEMPTS: integer("8"),
34
+ RELAYER_LOG_LEVEL: z.enum(["fatal", "error", "warn", "info", "debug", "trace", "silent"]).default("info")
35
+ });
36
+
37
+ export interface RelayerConfig {
38
+ rpcUrl: string;
39
+ chainId: number;
40
+ privateKey: string;
41
+ port: number;
42
+ host: string;
43
+ dataFile: string;
44
+ poolsFile: string;
45
+ allowedOrigins: string[];
46
+ feeBps: number;
47
+ maxFeeBps: number;
48
+ minimumFee: bigint;
49
+ xcallNativeFee: bigint;
50
+ confirmations: number;
51
+ pollMs: number;
52
+ stuckTransactionMs: number;
53
+ maxAttempts: number;
54
+ logLevel: string;
55
+ }
56
+
57
+ export function loadConfig(environment: NodeJS.ProcessEnv = process.env): RelayerConfig {
58
+ const value = schema.parse(environment);
59
+ if (value.RELAYER_FEE_BPS > value.RELAYER_MAX_FEE_BPS || value.RELAYER_MAX_FEE_BPS > 10_000) {
60
+ throw new Error("RELAYER_FEE_BPS must not exceed RELAYER_MAX_FEE_BPS or 10,000");
61
+ }
62
+ if (
63
+ value.RELAYER_CONFIRMATIONS < 1 || value.RELAYER_POLL_MS < 250
64
+ || value.RELAYER_STUCK_TX_MS < value.RELAYER_POLL_MS || value.RELAYER_MAX_ATTEMPTS < 1
65
+ ) {
66
+ throw new Error("Invalid relayer confirmation, polling, or retry configuration");
67
+ }
68
+ return {
69
+ rpcUrl: value.POLYGON_RPC_URL,
70
+ chainId: value.POLYGON_CHAIN_ID,
71
+ privateKey: value.RELAYER_PRIVATE_KEY,
72
+ port: value.RELAYER_PORT,
73
+ host: value.RELAYER_HOST,
74
+ dataFile: path.resolve(value.RELAYER_DATA_FILE),
75
+ poolsFile: path.resolve(value.RELAYER_POOLS_FILE),
76
+ allowedOrigins: value.RELAYER_ALLOWED_ORIGINS.split(",").map((entry) => entry.trim()).filter(Boolean),
77
+ feeBps: value.RELAYER_FEE_BPS,
78
+ maxFeeBps: value.RELAYER_MAX_FEE_BPS,
79
+ minimumFee: value.RELAYER_MIN_FEE_WEI,
80
+ xcallNativeFee: value.RELAYER_XCALL_NATIVE_FEE_WEI,
81
+ confirmations: value.RELAYER_CONFIRMATIONS,
82
+ pollMs: value.RELAYER_POLL_MS,
83
+ stuckTransactionMs: value.RELAYER_STUCK_TX_MS,
84
+ maxAttempts: value.RELAYER_MAX_ATTEMPTS,
85
+ logLevel: value.RELAYER_LOG_LEVEL
86
+ };
87
+ }
88
+
89
+ export async function loadPoolAllowlist(file: string, chainId: number): Promise<Map<string, PoolConfig>> {
90
+ const parsed = JSON.parse(await readFile(file, "utf8")) as { pools?: unknown };
91
+ if (!Array.isArray(parsed.pools)) throw new Error("Relayer pools file must contain a pools array");
92
+ const allowlist = new Map<string, PoolConfig>();
93
+ for (const candidate of parsed.pools) {
94
+ if (!candidate || typeof candidate !== "object") throw new Error("Relayer pool entry is not an object");
95
+ const pool = candidate as PoolConfig;
96
+ if (
97
+ !Number.isSafeInteger(pool.chainId) || !Number.isSafeInteger(pool.originDomain)
98
+ || pool.originDomain < 0 || pool.originDomain > 0xffff_ffff
99
+ || typeof pool.mixerAddress !== "string" || !Array.isArray(pool.destinations)
100
+ ) throw new Error("Relayer pool entry has invalid chain, domain, address, or destinations");
101
+ if (pool.chainId !== chainId) continue;
102
+ const address = getAddress(pool.mixerAddress);
103
+ if (pool.destinations.length === 0 || pool.destinations.some((destination) =>
104
+ !Number.isSafeInteger(destination.domain) || destination.domain < 0 || destination.domain > 0xffff_ffff
105
+ )) {
106
+ throw new Error(`Allowed pool ${address} has invalid destinations`);
107
+ }
108
+ if (allowlist.has(address.toLowerCase())) throw new Error(`Duplicate allowed pool ${address}`);
109
+ allowlist.set(address.toLowerCase(), { ...pool, mixerAddress: address });
110
+ }
111
+ if (allowlist.size === 0) throw new Error(`No relayer pools configured for chain ${chainId}`);
112
+ return allowlist;
113
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/fees.ts ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export function calculateFee(payout: bigint, feeBps: number, minimumFee: bigint): bigint {
2
+ if (payout < 0n || !Number.isInteger(feeBps) || feeBps < 0 || feeBps > 10_000 || minimumFee < 0n) {
3
+ throw new Error("Invalid fee inputs");
4
+ }
5
+ const proportional = payout * BigInt(feeBps) / 10_000n;
6
+ return proportional > minimumFee ? proportional : minimumFee;
7
+ }
8
+
9
+ export function feeWithinLimit(fee: bigint, payout: bigint, maximumBps: number): boolean {
10
+ if (fee < 0n || payout <= 0n || maximumBps < 0 || maximumBps > 10_000) return false;
11
+ return fee * 10_000n <= payout * BigInt(maximumBps);
12
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/metrics.ts ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Counter, Gauge, Histogram, Registry, collectDefaultMetrics } from "prom-client";
2
+
3
+ export const registry = new Registry();
4
+ collectDefaultMetrics({ register: registry, prefix: "privatecrypmix_relayer_" });
5
+
6
+ export const requests = new Counter({
7
+ name: "privatecrypmix_relayer_http_requests_total",
8
+ help: "HTTP requests by route and status",
9
+ labelNames: ["method", "route", "status"] as const,
10
+ registers: [registry]
11
+ });
12
+
13
+ export const jobs = new Gauge({
14
+ name: "privatecrypmix_relayer_jobs",
15
+ help: "Durable relay jobs by status",
16
+ labelNames: ["status"] as const,
17
+ registers: [registry]
18
+ });
19
+
20
+ export const transactionLatency = new Histogram({
21
+ name: "privatecrypmix_relayer_transaction_seconds",
22
+ help: "Time from broadcast to confirmation",
23
+ buckets: [1, 2, 5, 10, 20, 40, 80, 160, 320],
24
+ registers: [registry]
25
+ });
26
+
27
+ export const nativeBalance = new Gauge({
28
+ name: "privatecrypmix_relayer_native_balance",
29
+ help: "Relayer native-token balance in whole token units",
30
+ registers: [registry]
31
+ });
32
+
33
+ export const oldestActionableJob = new Gauge({
34
+ name: "privatecrypmix_relayer_oldest_actionable_job_seconds",
35
+ help: "Age of the oldest queued or retrying job",
36
+ registers: [registry]
37
+ });
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/schema.ts ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { getAddress } from "ethers";
2
+ import { z } from "zod";
3
+ import type { WithdrawalBundle } from "@privatecrypmix/sdk";
4
+
5
+ const decimal = z.string().regex(/^\d{1,80}$/u);
6
+ const hex32 = z.string().regex(/^0x[0-9a-fA-F]{64}$/u);
7
+ const address = z.string().transform((value, context) => {
8
+ try {
9
+ return getAddress(value);
10
+ } catch {
11
+ context.addIssue({ code: z.ZodIssueCode.custom, message: "invalid EVM address" });
12
+ return z.NEVER;
13
+ }
14
+ });
15
+
16
+ const pair = z.tuple([decimal, decimal]);
17
+ export const withdrawalSchema = z.object({
18
+ proof: z.object({
19
+ a: pair,
20
+ b: z.tuple([pair, pair]),
21
+ c: pair
22
+ }).strict(),
23
+ root: hex32,
24
+ nullifierHash: hex32,
25
+ recipient: address,
26
+ relayer: address,
27
+ fee: decimal,
28
+ destinationDomain: z.number().int().nonnegative().max(0xffff_ffff),
29
+ mixerAddress: address,
30
+ chainId: z.number().int().positive(),
31
+ publicSignals: z.array(decimal).length(8)
32
+ }).strict();
33
+
34
+ export function parseWithdrawal(value: unknown): WithdrawalBundle {
35
+ return withdrawalSchema.parse(value) as WithdrawalBundle;
36
+ }
37
+
38
+ export function expectedPublicSignals(bundle: WithdrawalBundle): string[] {
39
+ return [
40
+ BigInt(bundle.root),
41
+ BigInt(bundle.nullifierHash),
42
+ BigInt(bundle.recipient),
43
+ BigInt(bundle.relayer),
44
+ BigInt(bundle.fee),
45
+ BigInt(bundle.destinationDomain),
46
+ BigInt(bundle.mixerAddress),
47
+ BigInt(bundle.chainId)
48
+ ].map(String);
49
+ }
50
+
51
+ export function publicSignalsMatch(bundle: WithdrawalBundle): boolean {
52
+ const expected = expectedPublicSignals(bundle);
53
+ return bundle.publicSignals.length === expected.length
54
+ && bundle.publicSignals.every((value, index) => value === expected[index]);
55
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/server.ts ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pino from "pino";
2
+ import { createApp } from "./app.js";
3
+ import { loadConfig, loadPoolAllowlist } from "./config.js";
4
+ import { RelayerService } from "./service.js";
5
+ import { JobStore } from "./store.js";
6
+
7
+ async function main(): Promise<void> {
8
+ const config = loadConfig();
9
+ const logger = pino({ level: config.logLevel, redact: ["privateKey", "bundle", "req.headers.authorization"] });
10
+ const pools = await loadPoolAllowlist(config.poolsFile, config.chainId);
11
+ const store = new JobStore(config.dataFile);
12
+ const service = new RelayerService(config, pools, store, logger);
13
+ await service.initialize();
14
+ service.start();
15
+ const app = createApp(service, logger);
16
+ const server = app.listen(config.port, config.host, () => {
17
+ logger.info({ host: config.host, port: config.port, chainId: config.chainId, pools: pools.size }, "relayer listening");
18
+ });
19
+ const shutdown = (signal: string) => {
20
+ logger.info({ signal }, "relayer shutting down");
21
+ service.stop();
22
+ server.close((error) => {
23
+ service.provider.destroy();
24
+ if (error) {
25
+ logger.error({ error: error.message }, "shutdown failed");
26
+ process.exitCode = 1;
27
+ }
28
+ });
29
+ };
30
+ process.once("SIGINT", () => shutdown("SIGINT"));
31
+ process.once("SIGTERM", () => shutdown("SIGTERM"));
32
+ }
33
+
34
+ main().catch((error: unknown) => {
35
+ console.error(error);
36
+ process.exitCode = 1;
37
+ });
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/service.ts ADDED
@@ -0,0 +1,295 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Contract, Interface, JsonRpcProvider, Wallet, formatEther, getAddress, keccak256, solidityPacked } from "ethers";
2
+ import { PRIVATE_CRYP_MIX_ABI, type PoolConfig, type WithdrawalBundle } from "@privatecrypmix/sdk";
3
+ import type { Logger } from "pino";
4
+ import type { RelayerConfig } from "./config.js";
5
+ import { calculateFee, feeWithinLimit } from "./fees.js";
6
+ import { publicSignalsMatch } from "./schema.js";
7
+ import { JobStore, type RelayJob } from "./store.js";
8
+ import { jobs as jobGauge, nativeBalance, oldestActionableJob, transactionLatency } from "./metrics.js";
9
+
10
+ export class ValidationError extends Error {
11
+ constructor(message: string, readonly status = 400) { super(message); }
12
+ }
13
+
14
+ const safeErrorMessage = (error: unknown): string => {
15
+ if (!error || typeof error !== "object") return "Unknown relay error";
16
+ const candidate = error as { shortMessage?: unknown; reason?: unknown; code?: unknown; message?: unknown };
17
+ const raw = typeof candidate.shortMessage === "string"
18
+ ? candidate.shortMessage
19
+ : typeof candidate.reason === "string"
20
+ ? candidate.reason
21
+ : typeof candidate.code === "string"
22
+ ? candidate.code
23
+ : typeof candidate.message === "string"
24
+ ? candidate.message
25
+ : "Unknown relay error";
26
+ // Provider messages may embed full calldata. Do not turn proof payloads into logs.
27
+ return raw.replace(/0x[0-9a-fA-F]{16,}/gu, "[hex]").slice(0, 300);
28
+ };
29
+
30
+ export class RelayerService {
31
+ readonly provider: JsonRpcProvider;
32
+ readonly wallet: Wallet;
33
+ #running = false;
34
+ #timer?: NodeJS.Timeout;
35
+
36
+ constructor(
37
+ readonly config: RelayerConfig,
38
+ readonly pools: Map<string, PoolConfig>,
39
+ readonly store: JobStore,
40
+ readonly logger: Logger
41
+ ) {
42
+ this.provider = new JsonRpcProvider(config.rpcUrl, config.chainId, { staticNetwork: true });
43
+ this.wallet = new Wallet(config.privateKey, this.provider);
44
+ }
45
+
46
+ async initialize(): Promise<void> {
47
+ const network = await this.provider.getNetwork();
48
+ if (Number(network.chainId) !== this.config.chainId) {
49
+ throw new Error(`RPC chain ${network.chainId} does not match configured chain ${this.config.chainId}`);
50
+ }
51
+ for (const pool of this.pools.values()) {
52
+ const mixer = new Contract(pool.mixerAddress, PRIVATE_CRYP_MIX_ABI, this.provider);
53
+ const onchainOrigin = Number(await mixer.originDomain());
54
+ if (onchainOrigin !== pool.originDomain) {
55
+ throw new Error(`Pool manifest origin domain mismatch for ${pool.mixerAddress}`);
56
+ }
57
+ }
58
+ await this.store.initialize();
59
+ this.#updateJobMetrics();
60
+ nativeBalance.set(Number(formatEther(await this.provider.getBalance(this.wallet.address))));
61
+ }
62
+
63
+ getPool(address: string): PoolConfig {
64
+ let normalized: string;
65
+ try { normalized = getAddress(address); } catch { throw new ValidationError("Invalid mixer address"); }
66
+ const pool = this.pools.get(normalized.toLowerCase());
67
+ if (!pool) throw new ValidationError("Mixer is not allowlisted", 404);
68
+ return pool;
69
+ }
70
+
71
+ async quote(mixerAddress: string, destinationDomain: number): Promise<{ relayer: string; fee: string; payout: string; expiresAt: string }> {
72
+ const pool = this.getPool(mixerAddress);
73
+ if (!pool.destinations.some((destination) => destination.domain === destinationDomain)) {
74
+ throw new ValidationError("Destination domain is not allowlisted");
75
+ }
76
+ const mixer = new Contract(pool.mixerAddress, PRIVATE_CRYP_MIX_ABI, this.provider);
77
+ const [snapshotted, supported, payout] = await Promise.all([
78
+ mixer.snapshotted() as Promise<boolean>,
79
+ mixer.supportedDomains(destinationDomain) as Promise<boolean>,
80
+ mixer.payoutPerNote() as Promise<bigint>
81
+ ]);
82
+ if (!snapshotted) throw new ValidationError("Mixer round is not snapshotted", 409);
83
+ if (!supported) throw new ValidationError("Destination is disabled on-chain", 409);
84
+ const fee = calculateFee(payout, this.config.feeBps, this.config.minimumFee);
85
+ if (fee >= payout || !feeWithinLimit(fee, payout, this.config.maxFeeBps)) {
86
+ throw new Error("Configured fee violates the relayer fee ceiling");
87
+ }
88
+ return {
89
+ relayer: this.wallet.address,
90
+ fee: fee.toString(),
91
+ payout: payout.toString(),
92
+ expiresAt: new Date(Date.now() + 15 * 60_000).toISOString()
93
+ };
94
+ }
95
+
96
+ async validate(bundle: WithdrawalBundle): Promise<PoolConfig> {
97
+ const pool = this.getPool(bundle.mixerAddress);
98
+ if (bundle.chainId !== this.config.chainId) throw new ValidationError("Wrong origin chain");
99
+ if (getAddress(bundle.relayer) !== this.wallet.address) throw new ValidationError("Proof does not pay this relayer");
100
+ if (!publicSignalsMatch(bundle)) throw new ValidationError("Public signal list does not match withdrawal fields");
101
+ if (!pool.destinations.some((destination) => destination.domain === bundle.destinationDomain)) {
102
+ throw new ValidationError("Destination domain is not allowlisted");
103
+ }
104
+
105
+ const mixer = new Contract(pool.mixerAddress, PRIVATE_CRYP_MIX_ABI, this.wallet);
106
+ const [knownRoot, spent, supported, snapshotted, payout] = await Promise.all([
107
+ mixer.isKnownRoot(bundle.root) as Promise<boolean>,
108
+ mixer.nullifierHashes(bundle.nullifierHash) as Promise<boolean>,
109
+ mixer.supportedDomains(bundle.destinationDomain) as Promise<boolean>,
110
+ mixer.snapshotted() as Promise<boolean>,
111
+ mixer.payoutPerNote() as Promise<bigint>
112
+ ]);
113
+ if (!knownRoot) throw new ValidationError("Merkle root is no longer known", 409);
114
+ if (spent) throw new ValidationError("Nullifier is already spent", 409);
115
+ if (!supported) throw new ValidationError("Destination is disabled on-chain", 409);
116
+ if (!snapshotted) throw new ValidationError("Mixer round is not snapshotted", 409);
117
+ const fee = BigInt(bundle.fee);
118
+ const expectedFee = calculateFee(payout, this.config.feeBps, this.config.minimumFee);
119
+ if (fee !== expectedFee || !feeWithinLimit(fee, payout, this.config.maxFeeBps)) {
120
+ throw new ValidationError("Proof contains an invalid or expired relayer fee");
121
+ }
122
+
123
+ const nativeValue = bundle.destinationDomain === pool.originDomain ? 0n : this.config.xcallNativeFee;
124
+ try {
125
+ await mixer.withdraw.staticCall(
126
+ bundle.proof,
127
+ bundle.root,
128
+ bundle.nullifierHash,
129
+ bundle.recipient,
130
+ bundle.relayer,
131
+ bundle.fee,
132
+ bundle.destinationDomain,
133
+ { value: nativeValue }
134
+ );
135
+ } catch {
136
+ throw new ValidationError("On-chain preflight rejected the proof", 422);
137
+ }
138
+ return pool;
139
+ }
140
+
141
+ async enqueue(bundle: WithdrawalBundle): Promise<{ job: RelayJob; created: boolean }> {
142
+ await this.validate(bundle);
143
+ const jobId = keccak256(solidityPacked(
144
+ ["uint256", "address", "bytes32"],
145
+ [bundle.chainId, bundle.mixerAddress, bundle.nullifierHash]
146
+ ));
147
+ const now = new Date().toISOString();
148
+ const result = await this.store.create({
149
+ id: jobId,
150
+ status: "queued",
151
+ bundle,
152
+ attempts: 0,
153
+ createdAt: now,
154
+ updatedAt: now,
155
+ nextAttemptAt: now
156
+ });
157
+ this.#updateJobMetrics();
158
+ return result;
159
+ }
160
+
161
+ start(): void {
162
+ if (this.#timer) return;
163
+ this.#timer = setInterval(() => void this.tick(), this.config.pollMs);
164
+ this.#timer.unref();
165
+ void this.tick();
166
+ }
167
+
168
+ stop(): void {
169
+ if (this.#timer) clearInterval(this.#timer);
170
+ this.#timer = undefined;
171
+ }
172
+
173
+ async tick(): Promise<void> {
174
+ if (this.#running) return;
175
+ this.#running = true;
176
+ try {
177
+ const now = Date.now();
178
+ const candidates = this.store.list().filter((job) =>
179
+ (job.status === "queued" || job.status === "retrying" || job.status === "broadcast")
180
+ && Date.parse(job.nextAttemptAt) <= now
181
+ ).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
182
+ const job = candidates[0];
183
+ if (!job) return;
184
+ if (job.status === "broadcast") await this.#checkBroadcast(job);
185
+ else await this.#broadcast(job);
186
+ } finally {
187
+ this.#running = false;
188
+ this.#updateJobMetrics();
189
+ void this.provider.getBalance(this.wallet.address)
190
+ .then((balance) => nativeBalance.set(Number(formatEther(balance))))
191
+ .catch(() => undefined);
192
+ }
193
+ }
194
+
195
+ async #broadcast(job: RelayJob): Promise<void> {
196
+ const pool = this.getPool(job.bundle.mixerAddress);
197
+ const mixer = new Contract(pool.mixerAddress, PRIVATE_CRYP_MIX_ABI, this.wallet);
198
+ const nativeValue = job.bundle.destinationDomain === pool.originDomain ? 0n : this.config.xcallNativeFee;
199
+ try {
200
+ // Revalidate immediately before spending gas.
201
+ await this.validate(job.bundle);
202
+ const transaction = await mixer.withdraw(
203
+ job.bundle.proof,
204
+ job.bundle.root,
205
+ job.bundle.nullifierHash,
206
+ job.bundle.recipient,
207
+ job.bundle.relayer,
208
+ job.bundle.fee,
209
+ job.bundle.destinationDomain,
210
+ { value: nativeValue }
211
+ );
212
+ await this.store.update(job.id, {
213
+ status: "broadcast",
214
+ attempts: job.attempts + 1,
215
+ txHash: transaction.hash,
216
+ broadcastAt: new Date().toISOString(),
217
+ error: undefined,
218
+ nextAttemptAt: new Date(Date.now() + this.config.pollMs).toISOString()
219
+ });
220
+ this.logger.info({ jobId: job.id, txHash: transaction.hash }, "relay transaction broadcast");
221
+ } catch (error) {
222
+ await this.#retryOrFail(job, error, true);
223
+ }
224
+ }
225
+
226
+ async #checkBroadcast(job: RelayJob): Promise<void> {
227
+ if (!job.txHash) {
228
+ await this.#retryOrFail(job, new Error("Broadcast job has no transaction hash"), false);
229
+ return;
230
+ }
231
+ try {
232
+ const receipt = await this.provider.getTransactionReceipt(job.txHash);
233
+ if (!receipt) {
234
+ const transaction = await this.provider.getTransaction(job.txHash);
235
+ const broadcastAge = Date.now() - Date.parse(job.broadcastAt ?? job.updatedAt);
236
+ if (!transaction && broadcastAge >= this.config.stuckTransactionMs) {
237
+ await this.#retryOrFail(job, new Error("Broadcast transaction was dropped"), false);
238
+ return;
239
+ }
240
+ await this.store.update(job.id, { nextAttemptAt: new Date(Date.now() + this.config.pollMs).toISOString() });
241
+ return;
242
+ }
243
+ if (receipt.status !== 1) throw new Error("Relay transaction reverted");
244
+ const latest = await this.provider.getBlockNumber();
245
+ if (latest - receipt.blockNumber + 1 < this.config.confirmations) {
246
+ await this.store.update(job.id, { nextAttemptAt: new Date(Date.now() + this.config.pollMs).toISOString() });
247
+ return;
248
+ }
249
+ const parser = new Interface(PRIVATE_CRYP_MIX_ABI);
250
+ let transferId: string | undefined;
251
+ for (const log of receipt.logs) {
252
+ try {
253
+ const event = parser.parseLog(log);
254
+ if (event?.name === "Withdrawal" && String(event.args.nullifierHash).toLowerCase() === job.bundle.nullifierHash.toLowerCase()) {
255
+ transferId = String(event.args.transferId);
256
+ break;
257
+ }
258
+ } catch {
259
+ // Receipt also contains ERC-20 and Connext logs.
260
+ }
261
+ }
262
+ await this.store.update(job.id, { status: "confirmed", confirmedBlock: receipt.blockNumber, transferId, error: undefined });
263
+ transactionLatency.observe((Date.now() - Date.parse(job.updatedAt)) / 1_000);
264
+ this.logger.info({ jobId: job.id, txHash: job.txHash, blockNumber: receipt.blockNumber }, "relay transaction confirmed");
265
+ } catch (error) {
266
+ await this.#retryOrFail(job, error, false);
267
+ }
268
+ }
269
+
270
+ async #retryOrFail(job: RelayJob, error: unknown, countAttempt: boolean): Promise<void> {
271
+ const attempts = job.attempts + (countAttempt ? 1 : 0);
272
+ const terminal = attempts >= this.config.maxAttempts;
273
+ const reason = safeErrorMessage(error);
274
+ await this.store.update(job.id, {
275
+ status: terminal ? "failed" : "retrying",
276
+ attempts,
277
+ error: reason,
278
+ nextAttemptAt: new Date(Date.now() + Math.min(300_000, this.config.pollMs * 2 ** Math.min(attempts, 6))).toISOString()
279
+ });
280
+ if (terminal) this.logger.error({ jobId: job.id, attempts, reason }, "relay job failed");
281
+ else this.logger.warn({ jobId: job.id, attempts, reason }, "relay job scheduled for retry");
282
+ }
283
+
284
+ #updateJobMetrics(): void {
285
+ const counts = new Map<string, number>();
286
+ const storedJobs = this.store.list();
287
+ for (const job of storedJobs) counts.set(job.status, (counts.get(job.status) ?? 0) + 1);
288
+ for (const status of ["queued", "broadcast", "confirmed", "retrying", "failed"]) {
289
+ jobGauge.set({ status }, counts.get(status) ?? 0);
290
+ }
291
+ const actionable = storedJobs.filter((job) => job.status === "queued" || job.status === "retrying");
292
+ const oldest = actionable.reduce((age, job) => Math.max(age, (Date.now() - Date.parse(job.createdAt)) / 1_000), 0);
293
+ oldestActionableJob.set(oldest);
294
+ }
295
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/src/store.ts ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import type { WithdrawalBundle } from "@privatecrypmix/sdk";
4
+
5
+ export type JobStatus = "queued" | "broadcast" | "confirmed" | "retrying" | "failed";
6
+
7
+ export interface RelayJob {
8
+ id: string;
9
+ status: JobStatus;
10
+ bundle: WithdrawalBundle;
11
+ attempts: number;
12
+ createdAt: string;
13
+ updatedAt: string;
14
+ nextAttemptAt: string;
15
+ txHash?: string | undefined;
16
+ error?: string | undefined;
17
+ confirmedBlock?: number | undefined;
18
+ transferId?: string | undefined;
19
+ broadcastAt?: string | undefined;
20
+ }
21
+
22
+ interface StoreFile { version: 1; jobs: RelayJob[] }
23
+
24
+ export class JobStore {
25
+ readonly #file: string;
26
+ readonly #jobs = new Map<string, RelayJob>();
27
+ #writeQueue: Promise<void> = Promise.resolve();
28
+
29
+ constructor(file: string) {
30
+ this.#file = file;
31
+ }
32
+
33
+ async initialize(): Promise<void> {
34
+ await mkdir(path.dirname(this.#file), { recursive: true });
35
+ try {
36
+ const parsed = JSON.parse(await readFile(this.#file, "utf8")) as StoreFile;
37
+ if (parsed.version !== 1 || !Array.isArray(parsed.jobs)) throw new Error("Unsupported job-store format");
38
+ for (const job of parsed.jobs) this.#jobs.set(job.id, job);
39
+ } catch (error) {
40
+ if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
41
+ await this.#persist();
42
+ }
43
+ }
44
+
45
+ get(id: string): RelayJob | undefined {
46
+ const job = this.#jobs.get(id);
47
+ return job ? structuredClone(job) : undefined;
48
+ }
49
+
50
+ list(): RelayJob[] {
51
+ return [...this.#jobs.values()].map((job) => structuredClone(job));
52
+ }
53
+
54
+ async create(job: RelayJob): Promise<{ job: RelayJob; created: boolean }> {
55
+ const existing = this.#jobs.get(job.id);
56
+ if (existing) return { job: structuredClone(existing), created: false };
57
+ this.#jobs.set(job.id, structuredClone(job));
58
+ await this.#persist();
59
+ return { job: structuredClone(job), created: true };
60
+ }
61
+
62
+ async update(id: string, patch: Partial<Omit<RelayJob, "id" | "bundle" | "createdAt">>): Promise<RelayJob> {
63
+ const current = this.#jobs.get(id);
64
+ if (!current) throw new Error(`Relay job ${id} does not exist`);
65
+ const updated: RelayJob = { ...current, ...patch, updatedAt: new Date().toISOString() };
66
+ this.#jobs.set(id, updated);
67
+ await this.#persist();
68
+ return structuredClone(updated);
69
+ }
70
+
71
+ async #persist(): Promise<void> {
72
+ this.#writeQueue = this.#writeQueue.then(async () => {
73
+ const temporary = `${this.#file}.tmp`;
74
+ const body: StoreFile = { version: 1, jobs: [...this.#jobs.values()] };
75
+ await writeFile(temporary, `${JSON.stringify(body, null, 2)}\n`, { mode: 0o600 });
76
+ await rename(temporary, this.#file);
77
+ });
78
+ await this.#writeQueue;
79
+ }
80
+ }
81
+
82
+ export const publicJob = (job: RelayJob) => ({
83
+ id: job.id,
84
+ status: job.status,
85
+ attempts: job.attempts,
86
+ createdAt: job.createdAt,
87
+ updatedAt: job.updatedAt,
88
+ txHash: job.txHash ?? null,
89
+ confirmedBlock: job.confirmedBlock ?? null,
90
+ transferId: job.transferId ?? null,
91
+ error: job.status === "failed" ? job.error ?? "Submission failed" : null
92
+ });
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/test/fees.test.ts ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { afterEach, describe, expect, it } from "vitest";
2
+ import { mkdtemp, readFile, rm } from "node:fs/promises";
3
+ import { tmpdir } from "node:os";
4
+ import path from "node:path";
5
+ import { calculateFee, feeWithinLimit } from "../src/fees.js";
6
+ import { expectedPublicSignals, parseWithdrawal, publicSignalsMatch } from "../src/schema.js";
7
+ import { JobStore, type RelayJob } from "../src/store.js";
8
+ import type { WithdrawalBundle } from "@privatecrypmix/sdk";
9
+
10
+ const address = "0x1111111111111111111111111111111111111111";
11
+ const bundle: WithdrawalBundle = {
12
+ proof: { a: ["1", "2"], b: [["3", "4"], ["5", "6"]], c: ["7", "8"] },
13
+ root: `0x${"01".padStart(64, "0")}`,
14
+ nullifierHash: `0x${"02".padStart(64, "0")}`,
15
+ recipient: address,
16
+ relayer: address,
17
+ fee: "5",
18
+ destinationDomain: 9999,
19
+ mixerAddress: address,
20
+ chainId: 137,
21
+ publicSignals: []
22
+ };
23
+ bundle.publicSignals = expectedPublicSignals(bundle);
24
+
25
+ describe("relayer fee policy", () => {
26
+ it("uses the greater of proportional and minimum fees", () => {
27
+ expect(calculateFee(1_000_000n, 50, 0n)).toBe(5_000n);
28
+ expect(calculateFee(1_000_000n, 50, 9_000n)).toBe(9_000n);
29
+ });
30
+ it("enforces the configured ceiling without rounding surprises", () => {
31
+ expect(feeWithinLimit(20_000n, 1_000_000n, 200)).toBe(true);
32
+ expect(feeWithinLimit(20_001n, 1_000_000n, 200)).toBe(false);
33
+ });
34
+ });
35
+
36
+ describe("withdrawal request boundary", () => {
37
+ it("accepts a proof-only request whose public signals match", () => {
38
+ const parsed = parseWithdrawal(bundle);
39
+ expect(publicSignalsMatch(parsed)).toBe(true);
40
+ });
41
+ it("rejects secret-note fields and mismatched public signals", () => {
42
+ expect(() => parseWithdrawal({ ...bundle, secret: "do-not-send" })).toThrow();
43
+ expect(publicSignalsMatch({ ...bundle, fee: "6" })).toBe(false);
44
+ });
45
+ });
46
+
47
+ describe("durable job store", () => {
48
+ let directory: string | undefined;
49
+ afterEach(async () => { if (directory) await rm(directory, { recursive: true, force: true }); });
50
+
51
+ it("atomically persists and deduplicates jobs", async () => {
52
+ directory = await mkdtemp(path.join(tmpdir(), "pcm-relayer-"));
53
+ const file = path.join(directory, "jobs.json");
54
+ const store = new JobStore(file);
55
+ await store.initialize();
56
+ const now = new Date().toISOString();
57
+ const job: RelayJob = { id: `0x${"ab".repeat(32)}`, status: "queued", bundle, attempts: 0, createdAt: now, updatedAt: now, nextAttemptAt: now };
58
+ expect((await store.create(job)).created).toBe(true);
59
+ expect((await store.create(job)).created).toBe(false);
60
+ await store.update(job.id, { status: "confirmed", confirmedBlock: 10 });
61
+ const disk = JSON.parse(await readFile(file, "utf8")) as { jobs: RelayJob[] };
62
+ expect(disk.jobs).toHaveLength(1);
63
+ expect(disk.jobs[0]?.status).toBe("confirmed");
64
+ });
65
+ });
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/relayer/tsconfig.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "rootDir": "src",
7
+ "outDir": "dist",
8
+ "lib": ["ES2022"],
9
+ "types": ["node"]
10
+ },
11
+ "include": ["src/**/*.ts"],
12
+ "exclude": ["test"]
13
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/Dockerfile ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:22-alpine AS build
2
+ WORKDIR /app
3
+ COPY . .
4
+ RUN npm install \
5
+ && npm run build -w @privatecrypmix/sdk \
6
+ && npm run build -w @privatecrypmix/web
7
+
8
+ FROM nginx:1.27-alpine
9
+ COPY apps/web/nginx.conf /etc/nginx/conf.d/default.conf
10
+ COPY --from=build /app/apps/web/dist /usr/share/nginx/html
11
+ EXPOSE 8080
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/index.html ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <meta name="theme-color" content="#08110f" />
7
+ <meta name="referrer" content="no-referrer" />
8
+ <meta name="description" content="Private, fixed-size, yield-bearing cross-chain transfers." />
9
+ <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
10
+ <title>PrivateCrypMix</title>
11
+ </head>
12
+ <body>
13
+ <noscript>PrivateCrypMix requires JavaScript to create local zero-knowledge proofs.</noscript>
14
+ <div id="root"></div>
15
+ <script type="module" src="/src/main.tsx"></script>
16
+ </body>
17
+ </html>
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/nginx.conf ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ server {
2
+ listen 8080;
3
+ server_name _;
4
+ root /usr/share/nginx/html;
5
+ index index.html;
6
+
7
+ add_header Referrer-Policy "no-referrer" always;
8
+ add_header X-Content-Type-Options "nosniff" always;
9
+ add_header X-Frame-Options "DENY" always;
10
+ add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
11
+ add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self' https: wss:; worker-src 'self' blob:; object-src 'none'; frame-ancestors 'none'; base-uri 'self'; form-action 'self'" always;
12
+
13
+ location = /config/pools.json {
14
+ add_header Cache-Control "no-store";
15
+ try_files $uri =404;
16
+ }
17
+
18
+ location /circuits/ {
19
+ add_header Cache-Control "public, max-age=3600, must-revalidate";
20
+ try_files $uri =404;
21
+ }
22
+
23
+ location / {
24
+ try_files $uri $uri/ /index.html;
25
+ }
26
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/package.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@privatecrypmix/web",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "prebuild": "npm run build -w @privatecrypmix/sdk",
9
+ "pretest": "npm run build -w @privatecrypmix/sdk",
10
+ "build": "tsc -b && vite build",
11
+ "preview": "vite preview",
12
+ "test": "vitest run",
13
+ "lint": "tsc -b --pretty false",
14
+ "clean": "rm -rf dist .vite"
15
+ },
16
+ "dependencies": {
17
+ "@coinbase/wallet-sdk": "^4.2.3",
18
+ "@privatecrypmix/sdk": "1.0.0",
19
+ "@walletconnect/ethereum-provider": "^2.17.3",
20
+ "ethers": "^6.13.5",
21
+ "react": "^18.3.1",
22
+ "react-dom": "^18.3.1"
23
+ },
24
+ "devDependencies": {
25
+ "@testing-library/jest-dom": "^6.6.3",
26
+ "@testing-library/react": "^16.1.0",
27
+ "@types/react": "^18.3.18",
28
+ "@types/react-dom": "^18.3.5",
29
+ "@vitejs/plugin-react": "^4.3.4",
30
+ "jsdom": "^25.0.1",
31
+ "typescript": "^5.7.3",
32
+ "vite": "^6.0.7",
33
+ "vitest": "^2.1.8"
34
+ }
35
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/public/circuits/README.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Proof artifacts
2
+
3
+ Run the circuit ceremony exporter to place these production files here:
4
+
5
+ - `private_crypmix.wasm`
6
+ - `private_crypmix_final.zkey`
7
+ - `verification_key.json`
8
+ - `manifest.json`
9
+
10
+ The web application refuses to generate a proof when either required binary is
11
+ missing. Never substitute development mock data on a public deployment.
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/public/config/pools.example.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "pools": [
3
+ {
4
+ "id": "polygon-usdc-100-round-1",
5
+ "chainId": 137,
6
+ "chainName": "Polygon",
7
+ "rpcUrl": "https://replace-with-a-private-rpc.example",
8
+ "mixerAddress": "0x1111111111111111111111111111111111111111",
9
+ "assetAddress": "0x2222222222222222222222222222222222222222",
10
+ "assetSymbol": "USDC",
11
+ "assetDecimals": 6,
12
+ "denomination": "100000000",
13
+ "depositDeadline": 1800000000,
14
+ "unlockTimestamp": 1800604800,
15
+ "originDomain": 1886350457,
16
+ "merkleLevels": 20,
17
+ "zeroValue": "2166383900441693294538235590879055178496491962798346838098565412938054257279",
18
+ "explorerUrl": "https://polygonscan.com",
19
+ "aaveApy": 3.2,
20
+ "deploymentBlock": 70000000,
21
+ "destinations": [
22
+ { "name": "Polygon", "chainId": 137, "domain": 1886350457 },
23
+ { "name": "Optimism", "chainId": 10, "domain": 1869640809 }
24
+ ]
25
+ }
26
+ ]
27
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/public/config/pools.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "pools": []
3
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/public/favicon.svg ADDED
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/App.tsx ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Contract, JsonRpcProvider } from "ethers";
2
+ import { useCallback, useEffect, useState } from "react";
3
+ import { PRIVATE_CRYP_MIX_ABI, type PoolConfig } from "@privatecrypmix/sdk";
4
+ import { ConnectWallet } from "./components/ConnectWallet";
5
+ import { DepositPanel } from "./components/DepositPanel";
6
+ import { PoolSummary } from "./components/PoolSummary";
7
+ import { WithdrawPanel } from "./components/WithdrawPanel";
8
+ import { loadPools } from "./lib/config";
9
+ import { errorMessage, formatToken } from "./lib/format";
10
+
11
+ type View = "deposit" | "withdraw";
12
+
13
+ export function App() {
14
+ const [pools, setPools] = useState<PoolConfig[]>([]);
15
+ const [selected, setSelected] = useState<PoolConfig | null>(null);
16
+ const [view, setView] = useState<View>("deposit");
17
+ const [loading, setLoading] = useState(true);
18
+ const [configError, setConfigError] = useState<string | null>(null);
19
+ const [depositCount, setDepositCount] = useState<number | null>(null);
20
+ const [snapshot, setSnapshot] = useState<boolean | null>(null);
21
+ const [payout, setPayout] = useState<bigint | null>(null);
22
+ const [refreshKey, setRefreshKey] = useState(0);
23
+
24
+ useEffect(() => {
25
+ const controller = new AbortController();
26
+ loadPools(controller.signal).then((configured) => {
27
+ setPools(configured);
28
+ setSelected(configured[0] ?? null);
29
+ }).catch((error: unknown) => setConfigError(errorMessage(error))).finally(() => setLoading(false));
30
+ return () => controller.abort();
31
+ }, []);
32
+
33
+ const refresh = useCallback(() => setRefreshKey((value) => value + 1), []);
34
+ useEffect(() => {
35
+ if (!selected) return;
36
+ let active = true;
37
+ setDepositCount(null);
38
+ setSnapshot(null);
39
+ setPayout(null);
40
+ const provider = new JsonRpcProvider(selected.rpcUrl, selected.chainId, { staticNetwork: true });
41
+ const mixer = new Contract(selected.mixerAddress, PRIVATE_CRYP_MIX_ABI, provider);
42
+ Promise.all([mixer.depositCount(), mixer.snapshotted(), mixer.payoutPerNote()]).then(([count, snapshotted, payoutValue]) => {
43
+ if (!active) return;
44
+ setDepositCount(Number(count));
45
+ setSnapshot(Boolean(snapshotted));
46
+ setPayout(BigInt(payoutValue));
47
+ }).catch(() => {
48
+ if (!active) return;
49
+ setDepositCount(null);
50
+ setSnapshot(null);
51
+ setPayout(null);
52
+ });
53
+ return () => { active = false; };
54
+ }, [selected, refreshKey]);
55
+
56
+ if (loading) return <main className="loading-screen"><div className="brand-mark">P</div><span>Loading private pools…</span></main>;
57
+ if (configError) return <main className="empty-screen"><div className="brand-mark">P</div><h1>Configuration error</h1><p>{configError}</p></main>;
58
+ if (!selected) return (
59
+ <main className="empty-screen">
60
+ <div className="brand-mark">P</div>
61
+ <h1>No mixer rounds configured</h1>
62
+ <p>Deploy a round, then copy its manifest entry to <code>apps/web/public/config/pools.json</code>.</p>
63
+ <code>docs/runbook.md</code>
64
+ </main>
65
+ );
66
+
67
+ return (
68
+ <div className="app-shell">
69
+ <header className="site-header">
70
+ <a className="brand" href="/" aria-label="PrivateCrypMix home"><span className="brand-mark">P</span><span>PrivateCryp<span>Mix</span></span></a>
71
+ <div className="network-indicator"><span className="online-dot" />{selected.chainName}<small>source</small></div>
72
+ <nav><a href="#how-it-works">How it works</a><a href="#security">Security</a></nav>
73
+ <ConnectWallet pool={selected} compact />
74
+ </header>
75
+
76
+ <main className="main-layout">
77
+ <section className="hero">
78
+ <div className="privacy-kicker"><span>◈</span> Fixed outputs · local proofs · cross-chain exits</div>
79
+ <h1>Move value without<br /><em>leaving a trail.</em></h1>
80
+ <p>Join a fixed-size anonymity set on Polygon. Your funds earn through Aave during the mandatory privacy window, then exit locally or across supported chains.</p>
81
+ <div className="hero-metrics">
82
+ <div><strong>{depositCount ?? "—"}</strong><span>notes in this round</span></div>
83
+ <div><strong>{snapshot && payout !== null ? formatToken(payout, selected.assetDecimals) : "Variable"}</strong><span>{snapshot ? `${selected.assetSymbol} per note` : "final payout"}</span></div>
84
+ <div><strong>20</strong><span>Merkle levels</span></div>
85
+ </div>
86
+ </section>
87
+
88
+ <section className="workspace">
89
+ <div className="workspace-toolbar">
90
+ <div className="tabs" role="tablist" aria-label="Mixer action">
91
+ <button type="button" role="tab" aria-selected={view === "deposit"} className={view === "deposit" ? "active" : ""} onClick={() => setView("deposit")}>Deposit</button>
92
+ <button type="button" role="tab" aria-selected={view === "withdraw"} className={view === "withdraw" ? "active" : ""} onClick={() => setView("withdraw")}>Withdraw</button>
93
+ </div>
94
+ <label className="pool-select"><span>Pool</span><select value={selected.id} onChange={(event) => setSelected(pools.find((pool) => pool.id === event.target.value) ?? selected)}>
95
+ {pools.map((pool) => <option key={pool.id} value={pool.id}>{formatToken(pool.denomination, pool.assetDecimals)} {pool.assetSymbol} · {pool.chainName}</option>)}
96
+ </select></label>
97
+ </div>
98
+ <div className="workspace-grid">
99
+ {view === "deposit"
100
+ ? <DepositPanel pool={selected} onConfirmed={refresh} />
101
+ : <WithdrawPanel pools={pools} pool={selected} snapshotted={snapshot} payout={payout} onPoolChange={setSelected} onRefresh={refresh} />}
102
+ <PoolSummary pool={selected} depositCount={depositCount} />
103
+ </div>
104
+ </section>
105
+
106
+ <section className="privacy-strip" id="how-it-works">
107
+ <div><span>01</span><strong>Generate</strong><p>A nullifier and secret are created only on your device.</p></div>
108
+ <div><span>02</span><strong>Wait & earn</strong><p>A common unlock time broadens the set and hides deposit age.</p></div>
109
+ <div><span>03</span><strong>Prove & exit</strong><p>A zero-knowledge proof spends the note without revealing its leaf.</p></div>
110
+ </section>
111
+ </main>
112
+
113
+ <footer id="security"><span>PrivateCrypMix · Experimental software, unaudited</span><span>No analytics · No note custody · Open source</span></footer>
114
+ </div>
115
+ );
116
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/components/ConnectWallet.tsx ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { useState } from "react";
2
+ import type { PoolConfig } from "@privatecrypmix/sdk";
3
+ import { useWallet, type WalletKind } from "../providers/WalletProvider";
4
+ import { errorMessage } from "../lib/format";
5
+
6
+ const choices: Array<{ id: WalletKind; title: string; detail: string; mark: string }> = [
7
+ { id: "injected", title: "Browser wallet", detail: "MetaMask and injected wallets", mark: "↗" },
8
+ { id: "walletconnect", title: "WalletConnect", detail: "Scan from a mobile wallet", mark: "◎" },
9
+ { id: "coinbase", title: "Coinbase Wallet", detail: "Extension or smart wallet", mark: "C" }
10
+ ];
11
+
12
+ export function ConnectWallet({ pool, compact = false }: { pool: PoolConfig; compact?: boolean }) {
13
+ const wallet = useWallet();
14
+ const [open, setOpen] = useState(false);
15
+ const [error, setError] = useState<string | null>(null);
16
+
17
+ if (wallet.account) {
18
+ return (
19
+ <button className="wallet-pill" type="button" onClick={() => void wallet.disconnect()} title="Disconnect wallet">
20
+ <span className="online-dot" />
21
+ {wallet.account.slice(0, 6)}…{wallet.account.slice(-4)}
22
+ </button>
23
+ );
24
+ }
25
+ const choose = async (kind: WalletKind) => {
26
+ setError(null);
27
+ try {
28
+ await wallet.connect(kind, pool);
29
+ setOpen(false);
30
+ } catch (reason) {
31
+ setError(errorMessage(reason));
32
+ }
33
+ };
34
+ return (
35
+ <>
36
+ <button className={compact ? "button ghost small" : "button primary"} type="button" onClick={() => setOpen(true)}>
37
+ Connect wallet
38
+ </button>
39
+ {open && (
40
+ <div className="modal-backdrop" role="presentation" onMouseDown={() => setOpen(false)}>
41
+ <section className="modal" role="dialog" aria-modal="true" aria-labelledby="wallet-title" onMouseDown={(event) => event.stopPropagation()}>
42
+ <button className="modal-close" type="button" onClick={() => setOpen(false)} aria-label="Close">×</button>
43
+ <div className="eyebrow">Secure connection</div>
44
+ <h2 id="wallet-title">Choose a wallet</h2>
45
+ <p className="muted">A connection is required only to approve deposits or submit transactions. Note secrets stay in this browser.</p>
46
+ <div className="wallet-options">
47
+ {choices.map((choice) => (
48
+ <button key={choice.id} type="button" className="wallet-option" disabled={wallet.connecting} onClick={() => void choose(choice.id)}>
49
+ <span className="wallet-mark">{choice.mark}</span>
50
+ <span><strong>{choice.title}</strong><small>{choice.detail}</small></span>
51
+ <span>›</span>
52
+ </button>
53
+ ))}
54
+ </div>
55
+ {error && <div className="alert error" role="alert">{error}</div>}
56
+ </section>
57
+ </div>
58
+ )}
59
+ </>
60
+ );
61
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/components/DepositPanel.tsx ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Contract, Interface } from "ethers";
2
+ import { useEffect, useMemo, useState } from "react";
3
+ import {
4
+ ERC20_ABI,
5
+ PRIVATE_CRYP_MIX_ABI,
6
+ createNote,
7
+ finalizeNote,
8
+ serializeNote,
9
+ type PoolConfig,
10
+ type PrivacyNoteV1
11
+ } from "@privatecrypmix/sdk";
12
+ import { useWallet } from "../providers/WalletProvider";
13
+ import { ConnectWallet } from "./ConnectWallet";
14
+ import { errorMessage, formatDate, formatToken } from "../lib/format";
15
+
16
+ type Stage = "idle" | "creating" | "ready" | "approving" | "depositing" | "confirmed";
17
+
18
+ const downloadText = (filename: string, contents: string) => {
19
+ const url = URL.createObjectURL(new Blob([`${contents}\n`], { type: "text/plain;charset=utf-8" }));
20
+ const anchor = document.createElement("a");
21
+ anchor.href = url;
22
+ anchor.download = filename;
23
+ anchor.click();
24
+ URL.revokeObjectURL(url);
25
+ };
26
+
27
+ export function DepositPanel({ pool, onConfirmed }: { pool: PoolConfig; onConfirmed: () => void }) {
28
+ const wallet = useWallet();
29
+ const [stage, setStage] = useState<Stage>("idle");
30
+ const [note, setNote] = useState<PrivacyNoteV1 | null>(null);
31
+ const [serialized, setSerialized] = useState("");
32
+ const [backedUp, setBackedUp] = useState(false);
33
+ const [error, setError] = useState<string | null>(null);
34
+ const [transactionHash, setTransactionHash] = useState<string | null>(null);
35
+
36
+ useEffect(() => {
37
+ setStage("idle");
38
+ setNote(null);
39
+ setSerialized("");
40
+ setBackedUp(false);
41
+ setError(null);
42
+ setTransactionHash(null);
43
+ }, [pool.id]);
44
+
45
+ const closed = Date.now() / 1_000 >= pool.depositDeadline;
46
+ const amountLabel = `${formatToken(pool.denomination, pool.assetDecimals)} ${pool.assetSymbol}`;
47
+ const stageNumber = stage === "idle" || stage === "creating" ? 1 : stage === "ready" || stage === "approving" || stage === "depositing" ? 2 : 3;
48
+ const noteFilename = useMemo(() => `privatecrypmix-${pool.assetSymbol.toLowerCase()}-${note?.commitment.slice(2, 10) ?? "note"}.txt`, [note, pool.assetSymbol]);
49
+
50
+ const makeNote = async () => {
51
+ setError(null);
52
+ setStage("creating");
53
+ try {
54
+ const next = await createNote(pool);
55
+ setNote(next);
56
+ setSerialized(serializeNote(next));
57
+ setStage("ready");
58
+ } catch (reason) {
59
+ setError(errorMessage(reason));
60
+ setStage("idle");
61
+ }
62
+ };
63
+
64
+ const submitDeposit = async () => {
65
+ if (!note || !wallet.signer || !wallet.account) return;
66
+ setError(null);
67
+ try {
68
+ if (wallet.chainId !== pool.chainId) await wallet.switchTo(pool);
69
+ const token = new Contract(pool.assetAddress, ERC20_ABI, wallet.signer);
70
+ const mixer = new Contract(pool.mixerAddress, PRIVATE_CRYP_MIX_ABI, wallet.signer);
71
+ const denomination = BigInt(pool.denomination);
72
+ const allowance = await token.allowance(wallet.account, pool.mixerAddress) as bigint;
73
+ const confirmations = Math.max(1, Number(import.meta.env.VITE_CONFIRMATIONS ?? 1));
74
+ if (allowance < denomination) {
75
+ setStage("approving");
76
+ const approval = await token.approve(pool.mixerAddress, denomination);
77
+ await approval.wait(confirmations);
78
+ }
79
+ setStage("depositing");
80
+ const transaction = await mixer.deposit(note.commitment);
81
+ const receipt = await transaction.wait(confirmations);
82
+ if (!receipt) throw new Error("Deposit receipt was not returned");
83
+ const parser = new Interface(PRIVATE_CRYP_MIX_ABI);
84
+ let leafIndex: number | null = null;
85
+ for (const log of receipt.logs) {
86
+ try {
87
+ const decoded = parser.parseLog(log);
88
+ if (decoded?.name === "Deposit" && String(decoded.args.commitment).toLowerCase() === note.commitment.toLowerCase()) {
89
+ leafIndex = Number(decoded.args.leafIndex);
90
+ break;
91
+ }
92
+ } catch {
93
+ // Receipt also includes ERC-20/Aave logs.
94
+ }
95
+ }
96
+ if (leafIndex === null) throw new Error("Deposit event was not found in the confirmed receipt");
97
+ const finalNote = finalizeNote(note, leafIndex, receipt.hash);
98
+ setNote(finalNote);
99
+ setSerialized(serializeNote(finalNote));
100
+ setTransactionHash(receipt.hash);
101
+ setStage("confirmed");
102
+ setBackedUp(false);
103
+ onConfirmed();
104
+ } catch (reason) {
105
+ setError(errorMessage(reason));
106
+ setStage("ready");
107
+ }
108
+ };
109
+
110
+ return (
111
+ <section className="action-card" aria-labelledby="deposit-heading">
112
+ <div className="action-title">
113
+ <div><span className="eyebrow">Private entry</span><h2 id="deposit-heading">Deposit {amountLabel}</h2></div>
114
+ <div className="step-dots" aria-label={`Step ${stageNumber} of 3`}><i className="active" /><i className={stageNumber >= 2 ? "active" : ""} /><i className={stageNumber >= 3 ? "active" : ""} /></div>
115
+ </div>
116
+
117
+ {stage === "idle" || stage === "creating" ? (
118
+ <>
119
+ <div className="callout lock-callout">
120
+ <span className="callout-icon">⌛</span>
121
+ <div><strong>Funds unlock no earlier than {formatDate(pool.unlockTimestamp)}</strong><p>The round first closes to new deposits, then remains invested through the full privacy delay. Early withdrawal is impossible.</p></div>
122
+ </div>
123
+ <div className="details-list">
124
+ <div><span>You deposit</span><strong>{amountLabel}</strong></div>
125
+ <div><span>Yield source</span><strong>Aave on {pool.chainName}</strong></div>
126
+ <div><span>Withdrawal routes</span><strong>{pool.destinations.length} supported chains</strong></div>
127
+ </div>
128
+ {!wallet.account ? (
129
+ <ConnectWallet pool={pool} />
130
+ ) : (
131
+ <button className="button primary wide" type="button" disabled={closed || stage === "creating"} onClick={() => void makeNote()}>
132
+ {closed ? "Deposit window closed" : stage === "creating" ? "Creating note locally…" : "Create private note"}
133
+ </button>
134
+ )}
135
+ <p className="button-help">Secret material is generated locally using your browser's secure random source.</p>
136
+ </>
137
+ ) : (
138
+ <>
139
+ <div className={`callout ${stage === "confirmed" ? "success-callout" : "danger-callout"}`}>
140
+ <span className="callout-icon">{stage === "confirmed" ? "✓" : "!"}</span>
141
+ <div>
142
+ <strong>{stage === "confirmed" ? "Deposit confirmed — save the updated note" : "Back up this recovery note before depositing"}</strong>
143
+ <p>{stage === "confirmed" ? "The leaf index and transaction reference are now included." : "It is the only way to withdraw. PrivateCrypMix cannot recover it."}</p>
144
+ </div>
145
+ </div>
146
+ <label className="field-label" htmlFor="recovery-note">Recovery note</label>
147
+ <textarea id="recovery-note" className="note-output" value={serialized} readOnly rows={5} spellCheck={false} />
148
+ <div className="button-row">
149
+ <button className="button secondary" type="button" onClick={() => void navigator.clipboard.writeText(serialized)}>Copy note</button>
150
+ <button className="button secondary" type="button" onClick={() => downloadText(noteFilename, serialized)}>Download .txt</button>
151
+ </div>
152
+ <div className="commitment-box">
153
+ <span>Public commitment hash</span>
154
+ <code>{note?.commitment}</code>
155
+ </div>
156
+ {stage !== "confirmed" ? (
157
+ <>
158
+ <label className="check-row">
159
+ <input type="checkbox" checked={backedUp} onChange={(event) => setBackedUp(event.target.checked)} />
160
+ <span>I saved the recovery note somewhere private and understand there is no recovery service.</span>
161
+ </label>
162
+ <button className="button primary wide" type="button" disabled={!backedUp || stage === "approving" || stage === "depositing"} onClick={() => void submitDeposit()}>
163
+ {stage === "approving" ? `Approving ${pool.assetSymbol}…` : stage === "depositing" ? "Depositing into Aave round…" : `Approve & deposit ${amountLabel}`}
164
+ </button>
165
+ </>
166
+ ) : (
167
+ <>
168
+ {transactionHash && pool.explorerUrl && <a className="text-link" href={`${pool.explorerUrl}/tx/${transactionHash}`} target="_blank" rel="noreferrer">View confirmed transaction ↗</a>}
169
+ <button className="button ghost wide" type="button" onClick={() => { setStage("idle"); setNote(null); setSerialized(""); }}>Done</button>
170
+ </>
171
+ )}
172
+ </>
173
+ )}
174
+ {error && <div className="alert error" role="alert">{error}</div>}
175
+ </section>
176
+ );
177
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/components/PoolSummary.tsx ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import type { PoolConfig } from "@privatecrypmix/sdk";
2
+ import { formatDate, formatToken, relativeTime } from "../lib/format";
3
+
4
+ export function PoolSummary({ pool, depositCount }: { pool: PoolConfig; depositCount: number | null }) {
5
+ const now = Date.now() / 1_000;
6
+ const closed = now >= pool.depositDeadline;
7
+ const unlocked = now >= pool.unlockTimestamp;
8
+ const amount = BigInt(pool.denomination);
9
+ const duration = pool.unlockTimestamp - pool.depositDeadline;
10
+ const yieldAmount = pool.aaveApy === undefined
11
+ ? null
12
+ : Number(formatToken(amount, pool.assetDecimals, pool.assetDecimals)) * (pool.aaveApy / 100) * (duration / 31_536_000);
13
+ return (
14
+ <aside className="pool-summary">
15
+ <div className="summary-heading">
16
+ <div>
17
+ <span className="asset-mark">{pool.assetSymbol.slice(0, 1)}</span>
18
+ <span><strong>{formatToken(amount, pool.assetDecimals)} {pool.assetSymbol}</strong><small>Fixed deposit</small></span>
19
+ </div>
20
+ <span className={`status-chip ${closed ? "amber" : "green"}`}>{closed ? "Entry closed" : "Accepting deposits"}</span>
21
+ </div>
22
+ <dl className="summary-grid">
23
+ <div><dt>Anonymity set</dt><dd>{depositCount === null ? "—" : `${depositCount} notes`}</dd></div>
24
+ <div><dt>Estimated yield</dt><dd>{yieldAmount === null ? "Variable" : `≈ ${yieldAmount.toFixed(4)} ${pool.assetSymbol}`}</dd></div>
25
+ <div><dt>Deposits close</dt><dd>{closed ? "Closed" : relativeTime(pool.depositDeadline)}</dd></div>
26
+ <div><dt>Earliest payout</dt><dd>{unlocked ? "Available" : relativeTime(pool.unlockTimestamp)}</dd></div>
27
+ </dl>
28
+ <div className="summary-foot">
29
+ <span>All notes unlock together</span>
30
+ <time dateTime={new Date(pool.unlockTimestamp * 1_000).toISOString()}>{formatDate(pool.unlockTimestamp)}</time>
31
+ </div>
32
+ <p className="fine-print">Yield is an estimate, not a guarantee. Aave losses, utilization changes, and bridge conditions can affect the final payout.</p>
33
+ </aside>
34
+ );
35
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/components/WithdrawPanel.tsx ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Contract, JsonRpcProvider, getAddress, id, parseEther } from "ethers";
2
+ import { useEffect, useState, type ChangeEvent } from "react";
3
+ import {
4
+ PRIVATE_CRYP_MIX_ABI,
5
+ ZERO_ADDRESS,
6
+ assertNoteCommitment,
7
+ buildMerkleProof,
8
+ findLeafIndex,
9
+ generateWithdrawalProof,
10
+ parseNote,
11
+ type DepositLeaf,
12
+ type PoolConfig,
13
+ type PrivacyNoteV1,
14
+ type WithdrawalBundle
15
+ } from "@privatecrypmix/sdk";
16
+ import { useWallet } from "../providers/WalletProvider";
17
+ import { ConnectWallet } from "./ConnectWallet";
18
+ import { errorMessage, formatDate, formatToken } from "../lib/format";
19
+
20
+ type ProofStage = "idle" | "events" | "proving" | "ready" | "submitting" | "submitted";
21
+
22
+ interface RelayerQuote { relayer: string; fee: string; expiresAt: string }
23
+
24
+ const fetchLeaves = async (provider: JsonRpcProvider, pool: PoolConfig, progress: (message: string) => void): Promise<DepositLeaf[]> => {
25
+ const latest = await provider.getBlockNumber();
26
+ const start = pool.deploymentBlock;
27
+ const chunk = 10_000;
28
+ const leaves: DepositLeaf[] = [];
29
+ const topic = id("Deposit(bytes32,uint32,uint256)");
30
+ for (let fromBlock = start; fromBlock <= latest; fromBlock += chunk) {
31
+ const toBlock = Math.min(latest, fromBlock + chunk - 1);
32
+ progress(`Reading deposits ${fromBlock.toLocaleString()}–${toBlock.toLocaleString()}…`);
33
+ const logs = await provider.getLogs({ address: pool.mixerAddress, topics: [topic], fromBlock, toBlock });
34
+ for (const log of logs) {
35
+ if (!log.topics[1] || !log.topics[2]) continue;
36
+ leaves.push({ commitment: BigInt(log.topics[1]), leafIndex: Number(BigInt(log.topics[2])), blockNumber: log.blockNumber });
37
+ }
38
+ }
39
+ return leaves;
40
+ };
41
+
42
+ export function WithdrawPanel({
43
+ pools,
44
+ pool,
45
+ snapshotted,
46
+ payout,
47
+ onPoolChange,
48
+ onRefresh
49
+ }: {
50
+ pools: PoolConfig[];
51
+ pool: PoolConfig;
52
+ snapshotted: boolean | null;
53
+ payout: bigint | null;
54
+ onPoolChange: (pool: PoolConfig) => void;
55
+ onRefresh: () => void;
56
+ }) {
57
+ const wallet = useWallet();
58
+ const [noteText, setNoteText] = useState("");
59
+ const [note, setNote] = useState<PrivacyNoteV1 | null>(null);
60
+ const [recipient, setRecipient] = useState("");
61
+ const [domain, setDomain] = useState(pool.originDomain);
62
+ const [useRelayer, setUseRelayer] = useState(Boolean(import.meta.env.VITE_RELAYER_URL));
63
+ const [nativeFee, setNativeFee] = useState("0");
64
+ const [stage, setStage] = useState<ProofStage>("idle");
65
+ const [status, setStatus] = useState("");
66
+ const [bundle, setBundle] = useState<WithdrawalBundle | null>(null);
67
+ const [error, setError] = useState<string | null>(null);
68
+ const [result, setResult] = useState<{ label: string; value: string; href?: string } | null>(null);
69
+
70
+ useEffect(() => {
71
+ setDomain(pool.destinations[0]?.domain ?? pool.originDomain);
72
+ setBundle(null);
73
+ setStage("idle");
74
+ }, [pool.id, pool.destinations, pool.originDomain]);
75
+
76
+ const importFile = async (event: ChangeEvent<HTMLInputElement>) => {
77
+ const file = event.target.files?.[0];
78
+ if (file) setNoteText((await file.text()).trim());
79
+ };
80
+
81
+ const inspectNote = async (): Promise<{ parsed: PrivacyNoteV1; matchedPool: PoolConfig }> => {
82
+ const parsed = parseNote(noteText);
83
+ await assertNoteCommitment(parsed);
84
+ const matchedPool = pools.find((candidate) =>
85
+ candidate.chainId === parsed.chainId && candidate.mixerAddress.toLowerCase() === parsed.mixerAddress.toLowerCase()
86
+ );
87
+ if (!matchedPool) throw new Error("This note belongs to a mixer that is not in the current deployment manifest");
88
+ setNote(parsed);
89
+ if (matchedPool.id !== pool.id) onPoolChange(matchedPool);
90
+ return { parsed, matchedPool };
91
+ };
92
+
93
+ const makeProof = async () => {
94
+ setError(null);
95
+ setResult(null);
96
+ setBundle(null);
97
+ try {
98
+ const { parsed, matchedPool } = await inspectNote();
99
+ const effectiveDomain = matchedPool.destinations.some((candidate) => candidate.domain === domain)
100
+ ? domain
101
+ : (matchedPool.destinations[0]?.domain ?? matchedPool.originDomain);
102
+ if (effectiveDomain !== domain) setDomain(effectiveDomain);
103
+ if (Date.now() / 1_000 < matchedPool.unlockTimestamp) {
104
+ throw new Error(`This round remains locked until ${formatDate(matchedPool.unlockTimestamp)}`);
105
+ }
106
+ if (!recipient) throw new Error("Enter a destination wallet address");
107
+ const destinationRecipient = getAddress(recipient);
108
+ const destination = matchedPool.destinations.find((candidate) => candidate.domain === effectiveDomain);
109
+ if (!destination) throw new Error("Select a supported destination chain");
110
+
111
+ setStage("events");
112
+ const provider = new JsonRpcProvider(matchedPool.rpcUrl, matchedPool.chainId, { staticNetwork: true });
113
+ const mixer = new Contract(matchedPool.mixerAddress, PRIVATE_CRYP_MIX_ABI, provider);
114
+ if (!await mixer.snapshotted() as boolean) throw new Error("The round must be activated on-chain before a proof can be submitted");
115
+ const leaves = await fetchLeaves(provider, matchedPool, setStatus);
116
+ const commitment = BigInt(parsed.commitment);
117
+ const leafIndex = parsed.leafIndex ?? findLeafIndex(leaves, commitment);
118
+ if (leaves.find((leaf) => leaf.leafIndex === leafIndex)?.commitment !== commitment) {
119
+ throw new Error("The recovery note does not match its recorded deposit leaf");
120
+ }
121
+ setStatus("Rebuilding the Poseidon Merkle path…");
122
+ const merkleProof = await buildMerkleProof(leaves, leafIndex, matchedPool.merkleLevels, BigInt(matchedPool.zeroValue));
123
+ const onchainRoot = String(await mixer.getLastRoot()).toLowerCase();
124
+ if (`0x${merkleProof.root.toString(16).padStart(64, "0")}` !== onchainRoot) {
125
+ throw new Error("The reconstructed root does not match the contract. The RPC may be missing recent logs.");
126
+ }
127
+
128
+ let relayer = ZERO_ADDRESS;
129
+ let fee = 0n;
130
+ if (useRelayer) {
131
+ setStatus("Requesting a relayer quote…");
132
+ const relayerUrl = import.meta.env.VITE_RELAYER_URL;
133
+ if (!relayerUrl) throw new Error("The optional relayer is not configured");
134
+ const url = new URL("/v1/quote", relayerUrl);
135
+ url.searchParams.set("mixer", matchedPool.mixerAddress);
136
+ url.searchParams.set("destinationDomain", String(effectiveDomain));
137
+ const quoteResponse = await fetch(url);
138
+ if (!quoteResponse.ok) throw new Error(`Relayer quote failed with HTTP ${quoteResponse.status}`);
139
+ const quote = await quoteResponse.json() as RelayerQuote;
140
+ if (Date.parse(quote.expiresAt) <= Date.now()) throw new Error("Relayer returned an expired quote");
141
+ relayer = getAddress(quote.relayer);
142
+ fee = BigInt(quote.fee);
143
+ }
144
+ const onchainPayout = await mixer.payoutPerNote() as bigint;
145
+ if (fee >= onchainPayout) throw new Error("Relayer fee is not below the payout");
146
+
147
+ setStage("proving");
148
+ setStatus("Generating the Groth16 proof locally. This can take a minute…");
149
+ const base = (import.meta.env.VITE_CIRCUIT_ASSET_BASE ?? "/circuits").replace(/\/$/u, "");
150
+ const generated = await generateWithdrawalProof(parsed, merkleProof, {
151
+ recipient: destinationRecipient,
152
+ relayer,
153
+ fee,
154
+ destinationDomain: effectiveDomain,
155
+ chainId: matchedPool.chainId,
156
+ mixerAddress: matchedPool.mixerAddress
157
+ }, `${base}/private_crypmix.wasm`, `${base}/private_crypmix_final.zkey`);
158
+ setBundle(generated);
159
+ setStage("ready");
160
+ setStatus("Proof ready. The recovery note never left this device.");
161
+ } catch (reason) {
162
+ setError(errorMessage(reason));
163
+ setStage("idle");
164
+ setStatus("");
165
+ }
166
+ };
167
+
168
+ const submit = async () => {
169
+ if (!bundle) return;
170
+ setError(null);
171
+ setStage("submitting");
172
+ try {
173
+ if (useRelayer) {
174
+ const relayerUrl = import.meta.env.VITE_RELAYER_URL;
175
+ if (!relayerUrl) throw new Error("Relayer is not configured");
176
+ const response = await fetch(new URL("/v1/withdrawals", relayerUrl), {
177
+ method: "POST",
178
+ headers: { "content-type": "application/json" },
179
+ body: JSON.stringify(bundle)
180
+ });
181
+ const body = await response.json() as { jobId?: string; error?: string };
182
+ if (!response.ok || !body.jobId) throw new Error(body.error ?? `Relayer returned HTTP ${response.status}`);
183
+ setResult({ label: "Relayer job", value: body.jobId, href: `${relayerUrl}/v1/withdrawals/${body.jobId}` });
184
+ } else {
185
+ if (!wallet.signer) throw new Error("Connect a wallet to submit this proof");
186
+ if (wallet.chainId !== pool.chainId) await wallet.switchTo(pool);
187
+ const mixer = new Contract(bundle.mixerAddress, PRIVATE_CRYP_MIX_ABI, wallet.signer);
188
+ const destinationIsLocal = bundle.destinationDomain === pool.originDomain;
189
+ const value = destinationIsLocal ? 0n : parseEther(nativeFee || "0");
190
+ const transaction = await mixer.withdraw(
191
+ bundle.proof,
192
+ bundle.root,
193
+ bundle.nullifierHash,
194
+ bundle.recipient,
195
+ bundle.relayer,
196
+ bundle.fee,
197
+ bundle.destinationDomain,
198
+ { value }
199
+ );
200
+ const receipt = await transaction.wait(Math.max(1, Number(import.meta.env.VITE_CONFIRMATIONS ?? 1)));
201
+ if (!receipt) throw new Error("Withdrawal receipt was not returned");
202
+ setResult({
203
+ label: "Withdrawal transaction",
204
+ value: receipt.hash,
205
+ ...(pool.explorerUrl ? { href: `${pool.explorerUrl}/tx/${receipt.hash}` } : {})
206
+ });
207
+ }
208
+ setStage("submitted");
209
+ setStatus("Withdrawal accepted. Keep the transaction or job ID for cross-chain tracking.");
210
+ onRefresh();
211
+ } catch (reason) {
212
+ setError(errorMessage(reason));
213
+ setStage("ready");
214
+ }
215
+ };
216
+
217
+ const activate = async () => {
218
+ setError(null);
219
+ try {
220
+ if (!wallet.signer) throw new Error("Connect a wallet to activate this round");
221
+ if (wallet.chainId !== pool.chainId) await wallet.switchTo(pool);
222
+ const transaction = await new Contract(pool.mixerAddress, PRIVATE_CRYP_MIX_ABI, wallet.signer).snapshot();
223
+ await transaction.wait(Math.max(1, Number(import.meta.env.VITE_CONFIRMATIONS ?? 1)));
224
+ onRefresh();
225
+ } catch (reason) {
226
+ setError(errorMessage(reason));
227
+ }
228
+ };
229
+
230
+ const remote = domain !== pool.originDomain;
231
+ return (
232
+ <section className="action-card" aria-labelledby="withdraw-heading">
233
+ <div className="action-title">
234
+ <div><span className="eyebrow">Private exit</span><h2 id="withdraw-heading">Withdraw a note</h2></div>
235
+ <span className="zk-badge">ZK proof · local</span>
236
+ </div>
237
+
238
+ {Date.now() / 1_000 >= pool.unlockTimestamp && snapshotted === false && (
239
+ <div className="callout lock-callout">
240
+ <span className="callout-icon">◌</span>
241
+ <div><strong>The round is unlocked but not activated</strong><p>Anyone can redeem the shared Aave position and fix the equal payout.</p>
242
+ {wallet.account ? <button className="text-button" type="button" onClick={() => void activate()}>Activate payout round →</button> : <ConnectWallet pool={pool} compact />}
243
+ </div>
244
+ </div>
245
+ )}
246
+
247
+ <div className="field-header"><label className="field-label" htmlFor="note-input">Recovery note</label><label className="file-link">Import .txt<input type="file" accept="text/plain,.txt" onChange={(event) => void importFile(event)} /></label></div>
248
+ <textarea id="note-input" value={noteText} onChange={(event) => { setNoteText(event.target.value); setNote(null); setBundle(null); setStage("idle"); }} rows={5} placeholder="pcm-note-v1:…" spellCheck={false} autoComplete="off" />
249
+ <p className="field-help">Read only in this browser. The relayer receives a proof, never this note.</p>
250
+
251
+ <div className="field-grid">
252
+ <label><span className="field-label">Destination chain</span><select value={domain} onChange={(event) => { setDomain(Number(event.target.value)); setBundle(null); setStage("idle"); setStatus(""); }}>
253
+ {pool.destinations.map((destination) => <option key={destination.domain} value={destination.domain}>{destination.name}</option>)}
254
+ </select></label>
255
+ <label><span className="field-label">Recipient</span><input value={recipient} onChange={(event) => { setRecipient(event.target.value); setBundle(null); setStage("idle"); setStatus(""); }} placeholder="0x…" autoComplete="off" spellCheck={false} /></label>
256
+ </div>
257
+
258
+ <div className="submission-choice">
259
+ <label className={useRelayer ? "choice active" : "choice"}><input type="radio" checked={useRelayer} onChange={() => { setUseRelayer(true); setBundle(null); setStage("idle"); setStatus(""); }} /><span><strong>Privacy relayer</strong><small>No source-wallet transaction; fee is quoted before proving.</small></span></label>
260
+ <label className={!useRelayer ? "choice active" : "choice"}><input type="radio" checked={!useRelayer} onChange={() => { setUseRelayer(false); setBundle(null); setStage("idle"); setStatus(""); }} /><span><strong>Submit myself</strong><small>Pay Polygon gas from the connected wallet.</small></span></label>
261
+ </div>
262
+ {!useRelayer && remote && <label><span className="field-label">Connext native relayer fee (POL)</span><input inputMode="decimal" value={nativeFee} onChange={(event) => setNativeFee(event.target.value)} /><span className="field-help">Optional native value forwarded to Connext; check current route conditions.</span></label>}
263
+
264
+ {payout !== null && snapshotted && <div className="payout-line"><span>Gross fixed payout</span><strong>{formatToken(payout, pool.assetDecimals)} {pool.assetSymbol}</strong></div>}
265
+
266
+ {stage === "idle" || stage === "events" || stage === "proving" ? (
267
+ <button className="button primary wide" type="button" disabled={!noteText || !recipient || stage !== "idle"} onClick={() => void makeProof()}>
268
+ {stage === "events" ? "Rebuilding anonymity set…" : stage === "proving" ? "Generating proof locally…" : "Generate private proof"}
269
+ </button>
270
+ ) : (
271
+ <button className="button primary wide" type="button" disabled={stage === "submitting" || stage === "submitted" || (!useRelayer && !wallet.account)} onClick={() => void submit()}>
272
+ {stage === "submitting" ? "Submitting withdrawal…" : stage === "submitted" ? "Withdrawal submitted" : useRelayer ? "Send proof to relayer" : "Submit from wallet"}
273
+ </button>
274
+ )}
275
+ {!useRelayer && !wallet.account && stage === "ready" && <ConnectWallet pool={pool} />}
276
+ {status && <div className="proof-status"><span className={stage === "events" || stage === "proving" || stage === "submitting" ? "spinner" : "status-check"}>{stage === "events" || stage === "proving" || stage === "submitting" ? "" : "✓"}</span>{status}</div>}
277
+ {note && <div className="commitment-box"><span>Validated commitment</span><code>{note.commitment}</code></div>}
278
+ {result && <div className="result-box"><span>{result.label}</span>{result.href ? <a href={result.href} target="_blank" rel="noreferrer">{result.value} ↗</a> : <code>{result.value}</code>}</div>}
279
+ {error && <div className="alert error" role="alert">{error}</div>}
280
+ </section>
281
+ );
282
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/lib/config.ts ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { getAddress } from "ethers";
2
+ import { SNARK_SCALAR_FIELD, type PoolConfig } from "@privatecrypmix/sdk";
3
+
4
+ const validatePool = (value: unknown): PoolConfig => {
5
+ if (!value || typeof value !== "object") throw new Error("Pool entry is not an object");
6
+ const pool = value as Record<string, unknown>;
7
+ const requiredString = (key: string): string => {
8
+ if (typeof pool[key] !== "string" || pool[key] === "") throw new Error(`Pool ${String(pool.id)} is missing ${key}`);
9
+ return pool[key];
10
+ };
11
+ const requiredInteger = (key: string): number => {
12
+ const number = Number(pool[key]);
13
+ if (!Number.isSafeInteger(number) || number < 0) throw new Error(`Pool ${String(pool.id)} has invalid ${key}`);
14
+ return number;
15
+ };
16
+ const destinations = Array.isArray(pool.destinations) ? pool.destinations.map((entry) => {
17
+ if (!entry || typeof entry !== "object") throw new Error("Invalid destination entry");
18
+ const destination = entry as Record<string, unknown>;
19
+ const chainId = Number(destination.chainId);
20
+ const domain = Number(destination.domain);
21
+ if (
22
+ typeof destination.name !== "string" || !Number.isSafeInteger(chainId) || chainId <= 0
23
+ || !Number.isSafeInteger(domain) || domain < 0 || domain > 0xffff_ffff
24
+ ) {
25
+ throw new Error("Invalid destination entry");
26
+ }
27
+ return { name: destination.name, chainId, domain };
28
+ }) : [];
29
+ const result: PoolConfig = {
30
+ id: requiredString("id"),
31
+ chainId: requiredInteger("chainId"),
32
+ chainName: requiredString("chainName"),
33
+ rpcUrl: requiredString("rpcUrl"),
34
+ mixerAddress: getAddress(requiredString("mixerAddress")),
35
+ assetAddress: getAddress(requiredString("assetAddress")),
36
+ assetSymbol: requiredString("assetSymbol"),
37
+ assetDecimals: requiredInteger("assetDecimals"),
38
+ denomination: requiredString("denomination"),
39
+ depositDeadline: requiredInteger("depositDeadline"),
40
+ unlockTimestamp: requiredInteger("unlockTimestamp"),
41
+ originDomain: requiredInteger("originDomain"),
42
+ merkleLevels: requiredInteger("merkleLevels"),
43
+ zeroValue: requiredString("zeroValue"),
44
+ explorerUrl: typeof pool.explorerUrl === "string" ? pool.explorerUrl : "",
45
+ deploymentBlock: requiredInteger("deploymentBlock"),
46
+ destinations
47
+ };
48
+ if (pool.aaveApy !== undefined) {
49
+ const apy = Number(pool.aaveApy);
50
+ if (!Number.isFinite(apy) || apy < 0 || apy > 100) throw new Error(`Pool ${result.id} has invalid aaveApy`);
51
+ result.aaveApy = apy;
52
+ }
53
+ if (BigInt(result.denomination) <= 0n) throw new Error(`Pool ${result.id} has invalid denomination`);
54
+ const zeroValue = BigInt(result.zeroValue);
55
+ if (zeroValue < 0n || zeroValue >= SNARK_SCALAR_FIELD) throw new Error(`Pool ${result.id} has invalid zeroValue`);
56
+ if (
57
+ result.chainId <= 0 || result.originDomain > 0xffff_ffff || result.assetDecimals > 255
58
+ || result.merkleLevels < 1 || result.merkleLevels > 31
59
+ ) throw new Error(`Pool ${result.id} has invalid numeric bounds`);
60
+ if (result.depositDeadline >= result.unlockTimestamp) throw new Error(`Pool ${result.id} has invalid round timing`);
61
+ if (!result.destinations.some((destination) => destination.domain === result.originDomain)) throw new Error(`Pool ${result.id} is missing its origin destination`);
62
+ new URL(result.rpcUrl);
63
+ return result;
64
+ };
65
+
66
+ export async function loadPools(signal?: AbortSignal): Promise<PoolConfig[]> {
67
+ const response = await fetch("/config/pools.json", { signal, cache: "no-store" });
68
+ if (!response.ok) throw new Error(`Pool configuration returned HTTP ${response.status}`);
69
+ const body = await response.json() as { pools?: unknown };
70
+ if (!Array.isArray(body.pools)) throw new Error("Pool configuration must contain a pools array");
71
+ return body.pools.map(validatePool);
72
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/lib/format.test.ts ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { describe, expect, it } from "vitest";
2
+ import { formatToken, relativeTime, shortAddress } from "./format";
3
+
4
+ describe("format helpers", () => {
5
+ it("formats fixed-denomination assets without floating point loss", () => {
6
+ expect(formatToken(100_000_000n, 6)).toBe("100");
7
+ expect(formatToken(1_234_567n, 6)).toBe("1.2345");
8
+ });
9
+
10
+ it("shortens EVM addresses", () => {
11
+ expect(shortAddress("0x1234567890123456789012345678901234567890")).toBe("0x1234…7890");
12
+ });
13
+
14
+ it("shows a bounded countdown", () => {
15
+ expect(relativeTime(1000, 1000 * 1000)).toBe("0m");
16
+ expect(relativeTime(1000 + 90 * 60, 1000 * 1000)).toBe("1h 30m");
17
+ });
18
+ });
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/lib/format.ts ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { formatUnits } from "ethers";
2
+
3
+ export const shortAddress = (address: string): string => `${address.slice(0, 6)}…${address.slice(-4)}`;
4
+
5
+ export const formatToken = (amount: bigint | string, decimals: number, maximumFractionDigits = 4): string => {
6
+ const [integer = "0", fraction = ""] = formatUnits(amount, decimals).split(".");
7
+ const trimmed = fraction.slice(0, maximumFractionDigits).replace(/0+$/u, "");
8
+ return trimmed ? `${integer}.${trimmed}` : integer;
9
+ };
10
+
11
+ export const formatDate = (timestamp: number): string => new Intl.DateTimeFormat(undefined, {
12
+ dateStyle: "medium",
13
+ timeStyle: "short"
14
+ }).format(new Date(timestamp * 1_000));
15
+
16
+ export const relativeTime = (timestamp: number, now = Date.now()): string => {
17
+ const seconds = Math.max(0, Math.ceil(timestamp - now / 1_000));
18
+ const days = Math.floor(seconds / 86_400);
19
+ const hours = Math.floor((seconds % 86_400) / 3_600);
20
+ const minutes = Math.floor((seconds % 3_600) / 60);
21
+ if (days > 0) return `${days}d ${hours}h`;
22
+ if (hours > 0) return `${hours}h ${minutes}m`;
23
+ return `${minutes}m`;
24
+ };
25
+
26
+ export const errorMessage = (error: unknown): string => {
27
+ if (error && typeof error === "object") {
28
+ const candidate = error as { shortMessage?: unknown; reason?: unknown; message?: unknown };
29
+ if (typeof candidate.shortMessage === "string") return candidate.shortMessage;
30
+ if (typeof candidate.reason === "string") return candidate.reason;
31
+ if (typeof candidate.message === "string") return candidate.message.replace(/^execution reverted:\s*/iu, "");
32
+ }
33
+ return "The operation failed unexpectedly.";
34
+ };
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/main.tsx ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from "react";
2
+ import ReactDOM from "react-dom/client";
3
+ import { App } from "./App";
4
+ import { WalletProvider } from "./providers/WalletProvider";
5
+ import "./styles.css";
6
+
7
+ ReactDOM.createRoot(document.getElementById("root")!).render(
8
+ <React.StrictMode>
9
+ <WalletProvider>
10
+ <App />
11
+ </WalletProvider>
12
+ </React.StrictMode>
13
+ );
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/providers/WalletProvider.tsx ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { CoinbaseWalletSDK } from "@coinbase/wallet-sdk";
2
+ import { EthereumProvider } from "@walletconnect/ethereum-provider";
3
+ import { BrowserProvider, type Eip1193Provider, type JsonRpcSigner } from "ethers";
4
+ import { createContext, useCallback, useContext, useMemo, useState, type ReactNode } from "react";
5
+ import type { PoolConfig } from "@privatecrypmix/sdk";
6
+
7
+ export type WalletKind = "injected" | "walletconnect" | "coinbase";
8
+
9
+ interface EventProvider extends Eip1193Provider {
10
+ on?: (event: string, listener: (...args: unknown[]) => void) => void;
11
+ }
12
+
13
+ interface WalletState {
14
+ account: string | null;
15
+ chainId: number | null;
16
+ browserProvider: BrowserProvider | null;
17
+ signer: JsonRpcSigner | null;
18
+ connecting: boolean;
19
+ connect(kind: WalletKind, pool: PoolConfig): Promise<void>;
20
+ disconnect(): Promise<void>;
21
+ switchTo(pool: PoolConfig): Promise<void>;
22
+ }
23
+
24
+ const WalletContext = createContext<WalletState | null>(null);
25
+
26
+ const requestChain = async (provider: EventProvider, pool: PoolConfig): Promise<void> => {
27
+ const hexadecimal = `0x${pool.chainId.toString(16)}`;
28
+ try {
29
+ await provider.request({ method: "wallet_switchEthereumChain", params: [{ chainId: hexadecimal }] });
30
+ } catch (error) {
31
+ const code = (error as { code?: unknown }).code;
32
+ if (code !== 4902 && code !== -32603) throw error;
33
+ await provider.request({
34
+ method: "wallet_addEthereumChain",
35
+ params: [{
36
+ chainId: hexadecimal,
37
+ chainName: pool.chainName,
38
+ nativeCurrency: { name: "POL", symbol: "POL", decimals: 18 },
39
+ rpcUrls: [pool.rpcUrl],
40
+ blockExplorerUrls: pool.explorerUrl ? [pool.explorerUrl] : []
41
+ }]
42
+ });
43
+ }
44
+ };
45
+
46
+ export function WalletProvider({ children }: { children: ReactNode }) {
47
+ const [account, setAccount] = useState<string | null>(null);
48
+ const [chainId, setChainId] = useState<number | null>(null);
49
+ const [browserProvider, setBrowserProvider] = useState<BrowserProvider | null>(null);
50
+ const [signer, setSigner] = useState<JsonRpcSigner | null>(null);
51
+ const [external, setExternal] = useState<EventProvider | null>(null);
52
+ const [connecting, setConnecting] = useState(false);
53
+
54
+ const attach = useCallback(async (provider: EventProvider): Promise<void> => {
55
+ await provider.request({ method: "eth_requestAccounts" });
56
+ const browser = new BrowserProvider(provider, "any");
57
+ const nextSigner = await browser.getSigner();
58
+ const network = await browser.getNetwork();
59
+ setExternal(provider);
60
+ setBrowserProvider(browser);
61
+ setSigner(nextSigner);
62
+ setAccount(await nextSigner.getAddress());
63
+ setChainId(Number(network.chainId));
64
+ provider.on?.("accountsChanged", (...args: unknown[]) => {
65
+ const accounts = args[0] as string[] | undefined;
66
+ setAccount(accounts?.[0] ?? null);
67
+ });
68
+ provider.on?.("chainChanged", (...args: unknown[]) => {
69
+ const next = args[0];
70
+ if (typeof next === "string") setChainId(Number(BigInt(next)));
71
+ });
72
+ }, []);
73
+
74
+ const switchTo = useCallback(async (pool: PoolConfig): Promise<void> => {
75
+ if (!external) throw new Error("Connect a wallet first");
76
+ await requestChain(external, pool);
77
+ setChainId(pool.chainId);
78
+ }, [external]);
79
+
80
+ const connect = useCallback(async (kind: WalletKind, pool: PoolConfig): Promise<void> => {
81
+ setConnecting(true);
82
+ try {
83
+ let provider: EventProvider;
84
+ if (kind === "injected") {
85
+ if (!window.ethereum) throw new Error("No browser wallet was detected");
86
+ provider = window.ethereum;
87
+ } else if (kind === "walletconnect") {
88
+ const projectId = import.meta.env.VITE_WALLETCONNECT_PROJECT_ID;
89
+ if (!projectId) throw new Error("WalletConnect is not configured for this deployment");
90
+ const walletConnect = await EthereumProvider.init({
91
+ projectId,
92
+ chains: [pool.chainId],
93
+ optionalChains: [pool.chainId],
94
+ showQrModal: true,
95
+ rpcMap: { [pool.chainId]: pool.rpcUrl },
96
+ metadata: {
97
+ name: "PrivateCrypMix",
98
+ description: "Private yield-bearing transfers",
99
+ url: window.location.origin,
100
+ icons: [`${window.location.origin}/favicon.svg`]
101
+ }
102
+ });
103
+ await walletConnect.connect();
104
+ provider = walletConnect as unknown as EventProvider;
105
+ } else {
106
+ const sdk = new CoinbaseWalletSDK({
107
+ appName: "PrivateCrypMix",
108
+ appChainIds: [pool.chainId]
109
+ });
110
+ provider = sdk.makeWeb3Provider() as unknown as EventProvider;
111
+ }
112
+ await attach(provider);
113
+ const browser = new BrowserProvider(provider, "any");
114
+ const network = await browser.getNetwork();
115
+ if (Number(network.chainId) !== pool.chainId) {
116
+ setExternal(provider);
117
+ await requestChain(provider, pool);
118
+ setChainId(pool.chainId);
119
+ }
120
+ } finally {
121
+ setConnecting(false);
122
+ }
123
+ }, [attach]);
124
+
125
+ const disconnect = useCallback(async (): Promise<void> => {
126
+ const disconnectable = external as EventProvider & { disconnect?: () => Promise<void> };
127
+ await disconnectable?.disconnect?.();
128
+ setExternal(null);
129
+ setBrowserProvider(null);
130
+ setSigner(null);
131
+ setAccount(null);
132
+ setChainId(null);
133
+ }, [external]);
134
+
135
+ const value = useMemo<WalletState>(() => ({
136
+ account, chainId, browserProvider, signer, connecting, connect, disconnect, switchTo
137
+ }), [account, chainId, browserProvider, signer, connecting, connect, disconnect, switchTo]);
138
+ return <WalletContext.Provider value={value}>{children}</WalletContext.Provider>;
139
+ }
140
+
141
+ export function useWallet(): WalletState {
142
+ const context = useContext(WalletContext);
143
+ if (!context) throw new Error("useWallet must be used inside WalletProvider");
144
+ return context;
145
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/styles.css ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ :root {
2
+ color-scheme: dark;
3
+ font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
4
+ color: #f2f5ef;
5
+ background: #07100e;
6
+ font-synthesis: none;
7
+ text-rendering: optimizeLegibility;
8
+ --ink: #f2f5ef;
9
+ --muted: #9ba9a3;
10
+ --quiet: #66736e;
11
+ --lime: #baff69;
12
+ --lime-dark: #75a63b;
13
+ --panel: rgba(18, 30, 27, 0.93);
14
+ --panel-light: #172723;
15
+ --line: rgba(217, 241, 227, 0.12);
16
+ --danger: #ff8e78;
17
+ --amber: #efc45e;
18
+ --radius: 22px;
19
+ }
20
+
21
+ * { box-sizing: border-box; }
22
+ html { min-width: 320px; min-height: 100%; background: #07100e; }
23
+ body { margin: 0; min-width: 320px; min-height: 100vh; background:
24
+ radial-gradient(circle at 77% -10%, rgba(101, 168, 92, 0.17), transparent 34rem),
25
+ radial-gradient(circle at 3% 22%, rgba(47, 114, 93, 0.12), transparent 30rem),
26
+ #07100e; }
27
+ button, input, textarea, select { font: inherit; }
28
+ button, select { cursor: pointer; }
29
+ button:disabled { cursor: not-allowed; opacity: .52; }
30
+ a { color: inherit; }
31
+ code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
32
+
33
+ .app-shell { min-height: 100vh; overflow: hidden; position: relative; }
34
+ .app-shell::before { content: ""; position: absolute; width: 30rem; height: 30rem; border: 1px solid rgba(186, 255, 105, .045); border-radius: 50%; left: -15rem; top: 25rem; box-shadow: 0 0 0 5rem rgba(186, 255, 105, .012), 0 0 0 10rem rgba(186, 255, 105, .008); pointer-events: none; }
35
+ .site-header { height: 78px; padding: 0 clamp(20px, 4vw, 68px); display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 34px; border-bottom: 1px solid var(--line); background: rgba(7, 16, 14, .76); backdrop-filter: blur(18px); position: relative; z-index: 10; }
36
+ .brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 720; letter-spacing: -.035em; font-size: 19px; }
37
+ .brand > span:last-child > span { color: var(--lime); }
38
+ .brand-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; background: var(--lime); color: #07100e; border-radius: 11px; font-weight: 900; font-style: italic; box-shadow: 0 0 28px rgba(186, 255, 105, .16); }
39
+ .network-indicator { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #d5ddd9; }
40
+ .network-indicator small { color: var(--quiet); margin-left: -3px; }
41
+ .online-dot { width: 7px; height: 7px; display: inline-block; background: var(--lime); border-radius: 50%; box-shadow: 0 0 9px rgba(186, 255, 105, .72); }
42
+ .site-header nav { display: flex; gap: 25px; }
43
+ .site-header nav a { text-decoration: none; color: var(--muted); font-size: 13px; transition: color .2s; }
44
+ .site-header nav a:hover { color: var(--ink); }
45
+
46
+ .main-layout { width: min(1200px, calc(100% - 40px)); margin: 0 auto; position: relative; z-index: 1; }
47
+ .hero { padding: 74px 0 58px; max-width: 900px; position: relative; }
48
+ .privacy-kicker { color: var(--lime); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; font-weight: 680; display: flex; gap: 9px; align-items: center; }
49
+ .privacy-kicker span { font-size: 16px; }
50
+ .hero h1 { margin: 17px 0 19px; font-weight: 590; font-size: clamp(48px, 7.2vw, 84px); line-height: .98; letter-spacing: -.068em; }
51
+ .hero h1 em { color: var(--lime); font-style: normal; font-weight: 520; }
52
+ .hero > p { max-width: 660px; margin: 0; color: var(--muted); line-height: 1.65; font-size: 16px; }
53
+ .hero-metrics { display: flex; gap: 0; margin-top: 39px; }
54
+ .hero-metrics > div { min-width: 152px; padding-right: 34px; margin-right: 34px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
55
+ .hero-metrics > div:last-child { border: 0; }
56
+ .hero-metrics strong { font-size: 21px; letter-spacing: -.03em; }
57
+ .hero-metrics span { color: var(--quiet); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
58
+
59
+ .workspace { background: rgba(13, 24, 21, .78); border: 1px solid var(--line); border-radius: 28px; box-shadow: 0 28px 90px rgba(0, 0, 0, .25); overflow: hidden; backdrop-filter: blur(16px); }
60
+ .workspace-toolbar { height: 74px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
61
+ .tabs { padding: 5px; border-radius: 12px; background: #0a1512; display: flex; gap: 3px; }
62
+ .tabs button { border: 0; color: var(--muted); background: transparent; border-radius: 9px; padding: 9px 19px; font-size: 13px; font-weight: 650; }
63
+ .tabs button.active { color: #0a130f; background: var(--lime); box-shadow: 0 3px 15px rgba(186, 255, 105, .15); }
64
+ .pool-select { display: flex; gap: 12px; align-items: center; color: var(--quiet); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; }
65
+ .pool-select select { min-width: 230px; }
66
+ .workspace-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr); }
67
+ .action-card { padding: clamp(27px, 4vw, 48px); min-height: 560px; border-right: 1px solid var(--line); }
68
+ .action-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
69
+ .eyebrow { color: var(--lime); text-transform: uppercase; letter-spacing: .13em; font-size: 10px; font-weight: 750; margin-bottom: 7px; }
70
+ .action-title h2, .modal h2 { font-size: 25px; letter-spacing: -.035em; margin: 0; font-weight: 610; }
71
+ .step-dots { display: flex; gap: 5px; padding-top: 12px; }
72
+ .step-dots i { width: 19px; height: 3px; border-radius: 4px; background: #2a3c36; }
73
+ .step-dots i.active { background: var(--lime); }
74
+ .zk-badge { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--lime); border: 1px solid rgba(186, 255, 105, .2); background: rgba(186, 255, 105, .06); padding: 8px 10px; border-radius: 20px; white-space: nowrap; }
75
+
76
+ .callout { border: 1px solid var(--line); background: rgba(255, 255, 255, .022); border-radius: 15px; padding: 17px; display: flex; align-items: flex-start; gap: 13px; margin-bottom: 24px; }
77
+ .callout-icon { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; font-weight: 800; }
78
+ .callout strong { font-size: 13px; font-weight: 660; }
79
+ .callout p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
80
+ .lock-callout { border-color: rgba(239, 196, 94, .17); background: rgba(239, 196, 94, .035); }
81
+ .lock-callout .callout-icon { color: var(--amber); background: rgba(239, 196, 94, .1); }
82
+ .danger-callout { border-color: rgba(255, 142, 120, .22); background: rgba(255, 142, 120, .045); }
83
+ .danger-callout .callout-icon { color: var(--danger); background: rgba(255, 142, 120, .1); }
84
+ .success-callout { border-color: rgba(186, 255, 105, .19); background: rgba(186, 255, 105, .035); }
85
+ .success-callout .callout-icon { color: var(--lime); background: rgba(186, 255, 105, .1); }
86
+ .details-list { margin: 4px 0 27px; }
87
+ .details-list > div { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid rgba(217, 241, 227, .075); font-size: 13px; }
88
+ .details-list span { color: var(--muted); }
89
+ .details-list strong { font-weight: 560; }
90
+
91
+ .button { border: 1px solid transparent; border-radius: 11px; min-height: 43px; padding: 0 17px; display: inline-flex; justify-content: center; align-items: center; text-decoration: none; font-weight: 680; font-size: 13px; transition: transform .15s, border-color .15s, background .15s; }
92
+ .button:hover:not(:disabled) { transform: translateY(-1px); }
93
+ .button.primary { background: var(--lime); color: #07100e; box-shadow: 0 8px 25px rgba(117, 166, 59, .11); }
94
+ .button.primary:hover:not(:disabled) { background: #c9ff89; }
95
+ .button.secondary { background: #182824; border-color: var(--line); color: var(--ink); }
96
+ .button.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
97
+ .button.small { min-height: 37px; padding: 0 14px; }
98
+ .button.wide { width: 100%; min-height: 49px; }
99
+ .button-row { display: flex; gap: 9px; margin: 10px 0 18px; }
100
+ .button-row .button { flex: 1; }
101
+ .button-help { text-align: center; color: var(--quiet); font-size: 10px; line-height: 1.5; }
102
+ .text-button { color: var(--lime); padding: 7px 0 0; border: 0; background: transparent; font-size: 11px; }
103
+ .text-link { color: var(--lime); font-size: 12px; display: block; text-align: center; margin: 15px 0; text-decoration: none; }
104
+ .wallet-pill { min-height: 37px; color: #dfe7e3; border: 1px solid var(--line); border-radius: 11px; background: #101e1a; display: flex; gap: 8px; align-items: center; padding: 0 13px; font-size: 12px; }
105
+
106
+ .field-label { display: block; color: #c8d2cd; font-size: 11px; font-weight: 630; margin: 0 0 8px; }
107
+ .field-header { display: flex; justify-content: space-between; align-items: center; }
108
+ .file-link { color: var(--lime); font-size: 10px; cursor: pointer; }
109
+ .file-link input { display: none; }
110
+ textarea, input, select { width: 100%; color: var(--ink); background: #0b1714; border: 1px solid rgba(217, 241, 227, .13); outline: 0; border-radius: 11px; transition: border-color .15s, box-shadow .15s; }
111
+ textarea:focus, input:focus, select:focus { border-color: rgba(186, 255, 105, .48); box-shadow: 0 0 0 3px rgba(186, 255, 105, .055); }
112
+ textarea { resize: vertical; min-height: 104px; padding: 13px; line-height: 1.45; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; word-break: break-all; }
113
+ input, select { min-height: 44px; padding: 0 12px; font-size: 12px; }
114
+ select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #718079 50%), linear-gradient(135deg, #718079 50%, transparent 50%); background-position: calc(100% - 16px) 18px, calc(100% - 12px) 18px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; padding-right: 28px; }
115
+ .field-help { display: block; color: var(--quiet); margin: 7px 0 17px; font-size: 10px; line-height: 1.5; }
116
+ .field-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 12px; margin-bottom: 17px; }
117
+ .note-output { color: #cde5d8; border-color: rgba(186, 255, 105, .14); background: #091410; }
118
+ .commitment-box, .result-box { border: 1px solid var(--line); background: #0a1512; border-radius: 11px; padding: 12px; margin: 14px 0; }
119
+ .commitment-box span, .result-box span { color: var(--quiet); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; display: block; margin-bottom: 7px; }
120
+ .commitment-box code, .result-box code, .result-box a { font-size: 9px; word-break: break-all; color: #b8c8c0; text-decoration: none; }
121
+ .result-box a { color: var(--lime); }
122
+ .check-row { display: flex; gap: 11px; margin: 18px 0; align-items: flex-start; cursor: pointer; }
123
+ .check-row input { appearance: none; flex: 0 0 auto; width: 17px; min-height: 17px; height: 17px; padding: 0; margin: 1px 0 0; border-radius: 5px; }
124
+ .check-row input:checked { background: var(--lime); border-color: var(--lime); box-shadow: inset 0 0 0 4px #101c18; }
125
+ .check-row span { font-size: 11px; line-height: 1.5; color: var(--muted); }
126
+ .submission-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 8px 0 18px; }
127
+ .choice { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 13px; display: flex; gap: 10px; cursor: pointer; }
128
+ .choice.active { border-color: rgba(186, 255, 105, .38); background: rgba(186, 255, 105, .035); }
129
+ .choice input { width: 13px; height: 13px; min-height: 13px; margin: 2px 0 0; accent-color: var(--lime); }
130
+ .choice strong, .choice small { display: block; }
131
+ .choice strong { font-size: 11px; margin-bottom: 4px; }
132
+ .choice small { font-size: 9px; line-height: 1.45; color: var(--quiet); }
133
+ .payout-line { display: flex; justify-content: space-between; padding: 11px 0 17px; font-size: 11px; color: var(--muted); }
134
+ .payout-line strong { color: var(--ink); }
135
+ .proof-status { min-height: 39px; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; line-height: 1.4; margin-top: 8px; }
136
+ .status-check { color: var(--lime); }
137
+ .spinner { width: 12px; height: 12px; flex: 0 0 auto; border-radius: 50%; border: 2px solid #33443d; border-top-color: var(--lime); animation: spin .8s linear infinite; }
138
+ @keyframes spin { to { transform: rotate(360deg); } }
139
+ .alert { border-radius: 10px; padding: 11px 13px; margin-top: 13px; font-size: 11px; line-height: 1.45; }
140
+ .alert.error { color: #ffc0b5; background: rgba(255, 105, 78, .08); border: 1px solid rgba(255, 105, 78, .18); }
141
+
142
+ .pool-summary { padding: 35px 30px; background: rgba(7, 15, 13, .48); }
143
+ .summary-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
144
+ .summary-heading > div { display: flex; align-items: center; gap: 11px; }
145
+ .asset-mark { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #264239; border: 1px solid rgba(186, 255, 105, .16); color: var(--lime); font-weight: 800; }
146
+ .summary-heading strong, .summary-heading small { display: block; }
147
+ .summary-heading strong { font-size: 13px; }
148
+ .summary-heading small { color: var(--quiet); font-size: 9px; margin-top: 3px; }
149
+ .status-chip { border-radius: 20px; padding: 6px 8px; font-size: 8px; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
150
+ .status-chip.green { color: var(--lime); background: rgba(186, 255, 105, .08); }
151
+ .status-chip.amber { color: var(--amber); background: rgba(239, 196, 94, .08); }
152
+ .summary-grid { margin: 15px 0 10px; }
153
+ .summary-grid > div { display: flex; justify-content: space-between; align-items: baseline; padding: 13px 0; border-bottom: 1px solid rgba(217, 241, 227, .07); }
154
+ .summary-grid dt { color: var(--muted); font-size: 10px; }
155
+ .summary-grid dd { margin: 0; font-size: 11px; font-weight: 570; }
156
+ .summary-foot { margin-top: 25px; padding: 15px; background: #0b1714; border: 1px solid var(--line); border-radius: 12px; }
157
+ .summary-foot span, .summary-foot time { display: block; }
158
+ .summary-foot span { color: var(--lime); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 5px; }
159
+ .summary-foot time { font-size: 11px; }
160
+ .fine-print { color: #5e6d67; font-size: 9px; line-height: 1.55; margin: 18px 2px 0; }
161
+
162
+ .privacy-strip { display: grid; grid-template-columns: repeat(3, 1fr); padding: 75px 0; gap: 50px; }
163
+ .privacy-strip > div { display: grid; grid-template-columns: 35px 1fr; column-gap: 12px; }
164
+ .privacy-strip span { grid-row: span 2; color: var(--lime); font-family: monospace; font-size: 10px; padding-top: 3px; }
165
+ .privacy-strip strong { font-size: 13px; }
166
+ .privacy-strip p { color: var(--quiet); font-size: 10px; line-height: 1.55; margin: 6px 0 0; }
167
+ footer { min-height: 74px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 max(20px, calc((100vw - 1200px) / 2)); border-top: 1px solid var(--line); color: #54625d; text-transform: uppercase; letter-spacing: .06em; font-size: 8px; }
168
+
169
+ .modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0, 5, 4, .76); backdrop-filter: blur(9px); display: grid; place-items: center; padding: 20px; }
170
+ .modal { width: min(440px, 100%); padding: 31px; border-radius: 23px; background: #101d1a; border: 1px solid rgba(217, 241, 227, .16); box-shadow: 0 30px 110px #000; position: relative; }
171
+ .modal-close { position: absolute; right: 18px; top: 15px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); font-size: 22px; }
172
+ .modal .muted { color: var(--muted); font-size: 11px; line-height: 1.55; }
173
+ .wallet-options { margin-top: 21px; display: grid; gap: 8px; }
174
+ .wallet-option { min-height: 66px; border: 1px solid var(--line); background: #14241f; color: var(--ink); border-radius: 13px; padding: 10px 14px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; text-align: left; }
175
+ .wallet-option:hover { border-color: rgba(186, 255, 105, .3); }
176
+ .wallet-mark { width: 34px; height: 34px; display: grid; place-items: center; background: #21352f; color: var(--lime); border-radius: 10px; font-weight: 800; }
177
+ .wallet-option strong, .wallet-option small { display: block; }
178
+ .wallet-option strong { font-size: 12px; }
179
+ .wallet-option small { color: var(--quiet); font-size: 9px; margin-top: 4px; }
180
+ .loading-screen, .empty-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; padding: 30px; text-align: center; background: #07100e; }
181
+ .loading-screen span, .empty-screen p { color: var(--muted); font-size: 12px; }
182
+ .empty-screen h1 { margin: 5px 0 0; }
183
+ .empty-screen p { max-width: 520px; line-height: 1.6; }
184
+
185
+ @media (max-width: 900px) {
186
+ .site-header { grid-template-columns: 1fr auto; gap: 15px; }
187
+ .site-header nav, .network-indicator { display: none; }
188
+ .workspace-grid { grid-template-columns: 1fr; }
189
+ .action-card { border-right: 0; border-bottom: 1px solid var(--line); }
190
+ .pool-summary { min-height: auto; }
191
+ }
192
+
193
+ @media (max-width: 620px) {
194
+ .main-layout { width: min(100% - 24px, 1200px); }
195
+ .site-header { height: 65px; padding: 0 13px; }
196
+ .brand > span:last-child { display: none; }
197
+ .hero { padding: 48px 2px 39px; }
198
+ .hero h1 { font-size: clamp(43px, 14vw, 64px); }
199
+ .hero-metrics { gap: 18px; flex-wrap: wrap; }
200
+ .hero-metrics > div { min-width: 0; margin: 0; padding-right: 18px; }
201
+ .workspace-toolbar { height: auto; padding: 13px; align-items: stretch; flex-direction: column; gap: 10px; }
202
+ .tabs { width: 100%; }
203
+ .tabs button { flex: 1; }
204
+ .pool-select { justify-content: space-between; }
205
+ .pool-select select { min-width: 0; width: 76%; }
206
+ .action-card, .pool-summary { padding: 25px 18px; }
207
+ .field-grid, .submission-choice { grid-template-columns: 1fr; }
208
+ .privacy-strip { grid-template-columns: 1fr; padding: 55px 8px; gap: 30px; }
209
+ footer { padding: 20px; flex-direction: column; justify-content: center; text-align: center; }
210
+ .summary-heading { flex-direction: column; }
211
+ }
212
+
213
+ @media (prefers-reduced-motion: reduce) {
214
+ *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
215
+ }
_checkpoint/lineages/6a0b96274dc7423f8d0f5a5548172bf2b7ddb79e91829028ef77d6be90ef24ee/generations/e992db6a774f725d37e91c1e4514815fd275a2fc0ae967d5e2e9685d579f11ce/deliverable_files/0e386e32-df20-4d1f-b536-7159bc409ad5/PrivateCrypMix/apps/web/src/test/setup.ts ADDED
@@ -0,0 +1 @@
 
 
1
+ import "@testing-library/jest-dom/vitest";