factorysemantics-mes 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (454) hide show
  1. factorysemantics_mes-0.1.0/.env.example +69 -0
  2. factorysemantics_mes-0.1.0/.github/CODEOWNERS +2 -0
  3. factorysemantics_mes-0.1.0/.github/ISSUE_TEMPLATE/bug.yml +49 -0
  4. factorysemantics_mes-0.1.0/.github/ISSUE_TEMPLATE/config.yml +11 -0
  5. factorysemantics_mes-0.1.0/.github/ISSUE_TEMPLATE/integration.yml +31 -0
  6. factorysemantics_mes-0.1.0/.github/ISSUE_TEMPLATE/plant-pack.yml +26 -0
  7. factorysemantics_mes-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +18 -0
  8. factorysemantics_mes-0.1.0/.github/dependabot.yml +16 -0
  9. factorysemantics_mes-0.1.0/.github/workflows/ci.yml +55 -0
  10. factorysemantics_mes-0.1.0/.github/workflows/dco.yml +26 -0
  11. factorysemantics_mes-0.1.0/.github/workflows/docs.yml +39 -0
  12. factorysemantics_mes-0.1.0/.github/workflows/release.yml +104 -0
  13. factorysemantics_mes-0.1.0/.github/workflows/scorecard.yml +28 -0
  14. factorysemantics_mes-0.1.0/.github/workflows/welcome.yml +23 -0
  15. factorysemantics_mes-0.1.0/.gitignore +67 -0
  16. factorysemantics_mes-0.1.0/CHANGELOG.md +53 -0
  17. factorysemantics_mes-0.1.0/CITATION.cff +12 -0
  18. factorysemantics_mes-0.1.0/CODE_OF_CONDUCT.md +108 -0
  19. factorysemantics_mes-0.1.0/CONTRIBUTING.md +75 -0
  20. factorysemantics_mes-0.1.0/GOVERNANCE.md +29 -0
  21. factorysemantics_mes-0.1.0/LICENSE +201 -0
  22. factorysemantics_mes-0.1.0/MAINTAINERS.md +10 -0
  23. factorysemantics_mes-0.1.0/NOTICE +35 -0
  24. factorysemantics_mes-0.1.0/PKG-INFO +372 -0
  25. factorysemantics_mes-0.1.0/README.md +118 -0
  26. factorysemantics_mes-0.1.0/ROADMAP.md +141 -0
  27. factorysemantics_mes-0.1.0/SECURITY.md +59 -0
  28. factorysemantics_mes-0.1.0/alembic/env.py +44 -0
  29. factorysemantics_mes-0.1.0/alembic/script.py.mako +25 -0
  30. factorysemantics_mes-0.1.0/alembic/versions/153379d6cf19_merge_cutlery_and_walkthrough_chains.py +21 -0
  31. factorysemantics_mes-0.1.0/alembic/versions/18af853fc5c4_initial_schema.py +326 -0
  32. factorysemantics_mes-0.1.0/alembic/versions/7c1e5a9d2b4f_serial_sequences.py +32 -0
  33. factorysemantics_mes-0.1.0/alembic/versions/9c4d2c836d05_add_user_passwords.py +32 -0
  34. factorysemantics_mes-0.1.0/alembic/versions/a1b2c3d4e5f6_agent_identity.py +41 -0
  35. factorysemantics_mes-0.1.0/alembic/versions/a1c5e83b7602_calendar_and_scheduling.py +79 -0
  36. factorysemantics_mes-0.1.0/alembic/versions/a7c1e93b5f20_roles_as_data.py +37 -0
  37. factorysemantics_mes-0.1.0/alembic/versions/a7c2e5d1b9f0_document_kind_steps_needs_walkthroughs.py +30 -0
  38. factorysemantics_mes-0.1.0/alembic/versions/b2c3d4e5f6a7_outbox_hardening.py +34 -0
  39. factorysemantics_mes-0.1.0/alembic/versions/b3f8d2a41c67_controlled_documents.py +49 -0
  40. factorysemantics_mes-0.1.0/alembic/versions/b7d2e9f4a1c3_unit_inspections.py +41 -0
  41. factorysemantics_mes-0.1.0/alembic/versions/b8f4d27e1a53_serialisation.py +68 -0
  42. factorysemantics_mes-0.1.0/alembic/versions/c2e9b74a3f81_gauges_and_calibration.py +66 -0
  43. factorysemantics_mes-0.1.0/alembic/versions/c3d4e5f6a7b8_triggers.py +63 -0
  44. factorysemantics_mes-0.1.0/alembic/versions/c4e8f1a2d5b6_serial_units_one_index.py +27 -0
  45. factorysemantics_mes-0.1.0/alembic/versions/c9e2a4b71d38_material_at_a_station.py +41 -0
  46. factorysemantics_mes-0.1.0/alembic/versions/d4a1c7e5b902_equipment_cost_center.py +28 -0
  47. factorysemantics_mes-0.1.0/alembic/versions/d4a7f10c8b52_component_may_enter_twice.py +43 -0
  48. factorysemantics_mes-0.1.0/alembic/versions/d4e5f6a7b8c9_recommended_adjustments.py +51 -0
  49. factorysemantics_mes-0.1.0/alembic/versions/e5f6a7b8c9d0_tag_values_latest_index.py +22 -0
  50. factorysemantics_mes-0.1.0/alembic/versions/e6b3c92d4f17_drop_the_old_bom_constraint.py +77 -0
  51. factorysemantics_mes-0.1.0/alembic/versions/e7b3c9d18a45_workorder_work_center.py +29 -0
  52. factorysemantics_mes-0.1.0/alembic/versions/f0a1b2c3d4e5_equipment_states_ended_index.py +27 -0
  53. factorysemantics_mes-0.1.0/alembic/versions/f2a8d31c6b74_routing_durations.py +52 -0
  54. factorysemantics_mes-0.1.0/alembic/versions/f7d1a58e2c94_preventive_maintenance.py +77 -0
  55. factorysemantics_mes-0.1.0/alembic.ini +4 -0
  56. factorysemantics_mes-0.1.0/config/line_layout.json +42 -0
  57. factorysemantics_mes-0.1.0/config/tag_map.json +7 -0
  58. factorysemantics_mes-0.1.0/config/tag_map_kepsim.json +97 -0
  59. factorysemantics_mes-0.1.0/config/tag_map_kepware.json +61 -0
  60. factorysemantics_mes-0.1.0/deploy/README.md +68 -0
  61. factorysemantics_mes-0.1.0/deploy/fsmes-autoloop.service +9 -0
  62. factorysemantics_mes-0.1.0/deploy/fsmes-autoloop.timer +11 -0
  63. factorysemantics_mes-0.1.0/deploy/fsmes-prod-plant@.service +20 -0
  64. factorysemantics_mes-0.1.0/deploy/promote.sh +89 -0
  65. factorysemantics_mes-0.1.0/docker/Dockerfile +13 -0
  66. factorysemantics_mes-0.1.0/docker/docker-compose.yml +111 -0
  67. factorysemantics_mes-0.1.0/docker/nginx.conf +29 -0
  68. factorysemantics_mes-0.1.0/docs/ARCHITECTURE.md +154 -0
  69. factorysemantics_mes-0.1.0/docs/LANDSCAPE.md +64 -0
  70. factorysemantics_mes-0.1.0/docs/agents/connect-mcp-client.md +59 -0
  71. factorysemantics_mes-0.1.0/docs/agents/evals.md +27 -0
  72. factorysemantics_mes-0.1.0/docs/agents/index.md +16 -0
  73. factorysemantics_mes-0.1.0/docs/agents/write-discipline.md +37 -0
  74. factorysemantics_mes-0.1.0/docs/ai/BUDGET.md +41 -0
  75. factorysemantics_mes-0.1.0/docs/ai/OBSERVABILITY.md +77 -0
  76. factorysemantics_mes-0.1.0/docs/decisions/0001-apache-2-with-dco.md +24 -0
  77. factorysemantics_mes-0.1.0/docs/decisions/0002-kernel-and-modules.md +24 -0
  78. factorysemantics_mes-0.1.0/docs/decisions/0003-one-mcp-server.md +23 -0
  79. factorysemantics_mes-0.1.0/docs/decisions/0004-never-invent-production.md +24 -0
  80. factorysemantics_mes-0.1.0/docs/decisions/0005-plain-html-no-build-step.md +23 -0
  81. factorysemantics_mes-0.1.0/docs/decisions/0006-sqlite-laptop-postgresql-plant.md +23 -0
  82. factorysemantics_mes-0.1.0/docs/decisions/0007-fresh-public-history.md +24 -0
  83. factorysemantics_mes-0.1.0/docs/decisions/0008-erp-connectors-are-modules.md +24 -0
  84. factorysemantics_mes-0.1.0/docs/decisions/TEMPLATE.md +23 -0
  85. factorysemantics_mes-0.1.0/docs/decisions/index.md +17 -0
  86. factorysemantics_mes-0.1.0/docs/design/STYLE.md +64 -0
  87. factorysemantics_mes-0.1.0/docs/design/backlog/README.md +82 -0
  88. factorysemantics_mes-0.1.0/docs/design/backlog/analysis-cards-scaling.md +32 -0
  89. factorysemantics_mes-0.1.0/docs/design/backlog/book-output-explicit-order.md +53 -0
  90. factorysemantics_mes-0.1.0/docs/design/backlog/clickable-kpi-tiles.md +68 -0
  91. factorysemantics_mes-0.1.0/docs/design/backlog/opc-integration-suite.md +46 -0
  92. factorysemantics_mes-0.1.0/docs/design/backlog/order-lifecycle-actions.md +52 -0
  93. factorysemantics_mes-0.1.0/docs/design/backlog/orders-creatable-materials.md +16 -0
  94. factorysemantics_mes-0.1.0/docs/design/backlog/orders-supervisor-filters.md +74 -0
  95. factorysemantics_mes-0.1.0/docs/design/backlog/review-orders.md +66 -0
  96. factorysemantics_mes-0.1.0/docs/design/backlog/review-station.md +66 -0
  97. factorysemantics_mes-0.1.0/docs/design/backlog/scrap-reason-codes.md +43 -0
  98. factorysemantics_mes-0.1.0/docs/design/backlog/sixty-machine-plant.md +55 -0
  99. factorysemantics_mes-0.1.0/docs/design/backlog/spc-capability-withheld.md +38 -0
  100. factorysemantics_mes-0.1.0/docs/design/backlog/station-spc.md +34 -0
  101. factorysemantics_mes-0.1.0/docs/design/backlog/station-view.md +52 -0
  102. factorysemantics_mes-0.1.0/docs/design/backlog/supervisor-drill-down.md +48 -0
  103. factorysemantics_mes-0.1.0/docs/design/backlog/ui-style-drift-bc58fb4f8e4d.md +29 -0
  104. factorysemantics_mes-0.1.0/docs/develop/index.md +30 -0
  105. factorysemantics_mes-0.1.0/docs/develop/your-first-module.md +66 -0
  106. factorysemantics_mes-0.1.0/docs/history/private-era.md +63 -0
  107. factorysemantics_mes-0.1.0/docs/hooks/generate.py +141 -0
  108. factorysemantics_mes-0.1.0/docs/index.md +68 -0
  109. factorysemantics_mes-0.1.0/docs/onboarding/GUIDE-ENGINEERING.md +101 -0
  110. factorysemantics_mes-0.1.0/docs/onboarding/GUIDE-IT.md +90 -0
  111. factorysemantics_mes-0.1.0/docs/onboarding/README.md +128 -0
  112. factorysemantics_mes-0.1.0/docs/onboarding/worksheet-example.csv +6 -0
  113. factorysemantics_mes-0.1.0/docs/onboarding/worksheet-template.csv +1 -0
  114. factorysemantics_mes-0.1.0/docs/operate/compatibility.md +20 -0
  115. factorysemantics_mes-0.1.0/docs/operate/deploy.md +73 -0
  116. factorysemantics_mes-0.1.0/docs/operate/erpnext.md +57 -0
  117. factorysemantics_mes-0.1.0/docs/operate/index.md +18 -0
  118. factorysemantics_mes-0.1.0/docs/operate/registry.md +59 -0
  119. factorysemantics_mes-0.1.0/docs/operate/security.md +26 -0
  120. factorysemantics_mes-0.1.0/docs/plant/first-line.md +63 -0
  121. factorysemantics_mes-0.1.0/docs/plant/index.md +15 -0
  122. factorysemantics_mes-0.1.0/docs/plant/never-invent-production.md +66 -0
  123. factorysemantics_mes-0.1.0/docs/plant/reading-oee.md +46 -0
  124. factorysemantics_mes-0.1.0/labs/cutlery/README.md +169 -0
  125. factorysemantics_mes-0.1.0/labs/cutlery/analysis/build_notebook.py +781 -0
  126. factorysemantics_mes-0.1.0/labs/cutlery/analysis/build_report.py +404 -0
  127. factorysemantics_mes-0.1.0/labs/cutlery/analysis/cutlery_run_analysis.ipynb +768 -0
  128. factorysemantics_mes-0.1.0/labs/cutlery/analysis/viz.py +295 -0
  129. factorysemantics_mes-0.1.0/labs/cutlery/build_config.py +273 -0
  130. factorysemantics_mes-0.1.0/labs/cutlery/fill_day.py +199 -0
  131. factorysemantics_mes-0.1.0/labs/cutlery/init.py +191 -0
  132. factorysemantics_mes-0.1.0/labs/cutlery/line.json +6872 -0
  133. factorysemantics_mes-0.1.0/labs/cutlery/make_tag_map.py +30 -0
  134. factorysemantics_mes-0.1.0/labs/cutlery/registry.toml +29 -0
  135. factorysemantics_mes-0.1.0/labs/cutlery/run_cutlery.py +378 -0
  136. factorysemantics_mes-0.1.0/labs/cutlery/tag_map.json +1252 -0
  137. factorysemantics_mes-0.1.0/labs/cutlery/walkthroughs/install_walkthroughs.py +70 -0
  138. factorysemantics_mes-0.1.0/labs/cutlery/walkthroughs/walkthroughs.json +231 -0
  139. factorysemantics_mes-0.1.0/labs/erpnext/seed_erpnext.py +328 -0
  140. factorysemantics_mes-0.1.0/labs/kepsim/.env.example +22 -0
  141. factorysemantics_mes-0.1.0/labs/kepsim/README.md +175 -0
  142. factorysemantics_mes-0.1.0/labs/kepsim/kepware_setup.py +239 -0
  143. factorysemantics_mes-0.1.0/labs/kepsim/line.json +302 -0
  144. factorysemantics_mes-0.1.0/labs/kepsim/scenario.md +17 -0
  145. factorysemantics_mes-0.1.0/labs/kepsim/setup_dsn.ps1 +40 -0
  146. factorysemantics_mes-0.1.0/labs/kepsim/verify_readback.py +255 -0
  147. factorysemantics_mes-0.1.0/labs/megafactory/build_config.py +118 -0
  148. factorysemantics_mes-0.1.0/labs/megafactory/full/build_config.py +352 -0
  149. factorysemantics_mes-0.1.0/labs/megafactory/full/init.py +17 -0
  150. factorysemantics_mes-0.1.0/labs/megafactory/full/line.json +3488 -0
  151. factorysemantics_mes-0.1.0/labs/megafactory/full/run_full.py +276 -0
  152. factorysemantics_mes-0.1.0/labs/megafactory/full/seed_breadth.py +422 -0
  153. factorysemantics_mes-0.1.0/labs/megafactory/full/surfaces.py +370 -0
  154. factorysemantics_mes-0.1.0/labs/megafactory/full/tag_map.json +1627 -0
  155. factorysemantics_mes-0.1.0/labs/megafactory/init.py +185 -0
  156. factorysemantics_mes-0.1.0/labs/megafactory/line.json +507 -0
  157. factorysemantics_mes-0.1.0/labs/megafactory/make_tag_map.py +64 -0
  158. factorysemantics_mes-0.1.0/labs/megafactory/registry.toml +36 -0
  159. factorysemantics_mes-0.1.0/labs/megafactory/run_spike.py +66 -0
  160. factorysemantics_mes-0.1.0/labs/megafactory/seed_breadth.py +63 -0
  161. factorysemantics_mes-0.1.0/labs/megafactory/tag_map.json +412 -0
  162. factorysemantics_mes-0.1.0/labs/multiplant/README.md +88 -0
  163. factorysemantics_mes-0.1.0/labs/multiplant/bottling/init.py +43 -0
  164. factorysemantics_mes-0.1.0/labs/multiplant/fsplant.ps1 +196 -0
  165. factorysemantics_mes-0.1.0/labs/multiplant/machining/line.json +165 -0
  166. factorysemantics_mes-0.1.0/labs/multiplant/machining/seed.py +156 -0
  167. factorysemantics_mes-0.1.0/labs/multiplant/machining/tag_map.json +53 -0
  168. factorysemantics_mes-0.1.0/labs/multiplant/plants.toml +30 -0
  169. factorysemantics_mes-0.1.0/mkdocs.yml +128 -0
  170. factorysemantics_mes-0.1.0/pyproject.toml +126 -0
  171. factorysemantics_mes-0.1.0/src/fsmes/__init__.py +11 -0
  172. factorysemantics_mes-0.1.0/src/fsmes/api/__init__.py +0 -0
  173. factorysemantics_mes-0.1.0/src/fsmes/api/app.py +344 -0
  174. factorysemantics_mes-0.1.0/src/fsmes/api/deps.py +119 -0
  175. factorysemantics_mes-0.1.0/src/fsmes/api/idempotency.py +77 -0
  176. factorysemantics_mes-0.1.0/src/fsmes/api/paging.py +59 -0
  177. factorysemantics_mes-0.1.0/src/fsmes/api/routers/__init__.py +0 -0
  178. factorysemantics_mes-0.1.0/src/fsmes/api/routers/adjustments.py +66 -0
  179. factorysemantics_mes-0.1.0/src/fsmes/api/routers/admin.py +176 -0
  180. factorysemantics_mes-0.1.0/src/fsmes/api/routers/analysis.py +78 -0
  181. factorysemantics_mes-0.1.0/src/fsmes/api/routers/assist.py +255 -0
  182. factorysemantics_mes-0.1.0/src/fsmes/api/routers/auth.py +86 -0
  183. factorysemantics_mes-0.1.0/src/fsmes/api/routers/coa.py +68 -0
  184. factorysemantics_mes-0.1.0/src/fsmes/api/routers/dashboard.py +213 -0
  185. factorysemantics_mes-0.1.0/src/fsmes/api/routers/design.py +130 -0
  186. factorysemantics_mes-0.1.0/src/fsmes/api/routers/documents.py +138 -0
  187. factorysemantics_mes-0.1.0/src/fsmes/api/routers/equipment.py +94 -0
  188. factorysemantics_mes-0.1.0/src/fsmes/api/routers/erp.py +26 -0
  189. factorysemantics_mes-0.1.0/src/fsmes/api/routers/execution.py +140 -0
  190. factorysemantics_mes-0.1.0/src/fsmes/api/routers/kpis.py +37 -0
  191. factorysemantics_mes-0.1.0/src/fsmes/api/routers/line.py +48 -0
  192. factorysemantics_mes-0.1.0/src/fsmes/api/routers/maintenance.py +146 -0
  193. factorysemantics_mes-0.1.0/src/fsmes/api/routers/masterdata.py +214 -0
  194. factorysemantics_mes-0.1.0/src/fsmes/api/routers/ops.py +191 -0
  195. factorysemantics_mes-0.1.0/src/fsmes/api/routers/quality.py +270 -0
  196. factorysemantics_mes-0.1.0/src/fsmes/api/routers/scheduling.py +92 -0
  197. factorysemantics_mes-0.1.0/src/fsmes/api/routers/serialization.py +123 -0
  198. factorysemantics_mes-0.1.0/src/fsmes/api/routers/system.py +75 -0
  199. factorysemantics_mes-0.1.0/src/fsmes/api/routers/triggers.py +96 -0
  200. factorysemantics_mes-0.1.0/src/fsmes/api/routers/workorders.py +240 -0
  201. factorysemantics_mes-0.1.0/src/fsmes/cli.py +1152 -0
  202. factorysemantics_mes-0.1.0/src/fsmes/config.py +109 -0
  203. factorysemantics_mes-0.1.0/src/fsmes/core/__init__.py +6 -0
  204. factorysemantics_mes-0.1.0/src/fsmes/core/oplock.py +67 -0
  205. factorysemantics_mes-0.1.0/src/fsmes/db.py +66 -0
  206. factorysemantics_mes-0.1.0/src/fsmes/demo_feed.py +94 -0
  207. factorysemantics_mes-0.1.0/src/fsmes/domain/__init__.py +117 -0
  208. factorysemantics_mes-0.1.0/src/fsmes/domain/adjustments.py +60 -0
  209. factorysemantics_mes-0.1.0/src/fsmes/domain/audit.py +32 -0
  210. factorysemantics_mes-0.1.0/src/fsmes/domain/calendar.py +75 -0
  211. factorysemantics_mes-0.1.0/src/fsmes/domain/common.py +15 -0
  212. factorysemantics_mes-0.1.0/src/fsmes/domain/documents.py +106 -0
  213. factorysemantics_mes-0.1.0/src/fsmes/domain/equipment.py +44 -0
  214. factorysemantics_mes-0.1.0/src/fsmes/domain/execution.py +77 -0
  215. factorysemantics_mes-0.1.0/src/fsmes/domain/gauges.py +73 -0
  216. factorysemantics_mes-0.1.0/src/fsmes/domain/idempotency.py +31 -0
  217. factorysemantics_mes-0.1.0/src/fsmes/domain/integration.py +54 -0
  218. factorysemantics_mes-0.1.0/src/fsmes/domain/maintenance.py +106 -0
  219. factorysemantics_mes-0.1.0/src/fsmes/domain/masterdata.py +198 -0
  220. factorysemantics_mes-0.1.0/src/fsmes/domain/quality.py +70 -0
  221. factorysemantics_mes-0.1.0/src/fsmes/domain/scheduling.py +67 -0
  222. factorysemantics_mes-0.1.0/src/fsmes/domain/serialization.py +133 -0
  223. factorysemantics_mes-0.1.0/src/fsmes/domain/timeseries.py +28 -0
  224. factorysemantics_mes-0.1.0/src/fsmes/domain/triggers.py +85 -0
  225. factorysemantics_mes-0.1.0/src/fsmes/domain/workorders.py +100 -0
  226. factorysemantics_mes-0.1.0/src/fsmes/integrations/__init__.py +0 -0
  227. factorysemantics_mes-0.1.0/src/fsmes/integrations/erp/__init__.py +0 -0
  228. factorysemantics_mes-0.1.0/src/fsmes/integrations/erp/b2mml.py +97 -0
  229. factorysemantics_mes-0.1.0/src/fsmes/integrations/erp/base.py +51 -0
  230. factorysemantics_mes-0.1.0/src/fsmes/integrations/erp/contract.py +122 -0
  231. factorysemantics_mes-0.1.0/src/fsmes/integrations/erp/erpnext_adapter.py +282 -0
  232. factorysemantics_mes-0.1.0/src/fsmes/integrations/erp/file_adapter.py +56 -0
  233. factorysemantics_mes-0.1.0/src/fsmes/integrations/erp/mock_erp.py +69 -0
  234. factorysemantics_mes-0.1.0/src/fsmes/integrations/erp/rest_adapter.py +22 -0
  235. factorysemantics_mes-0.1.0/src/fsmes/integrations/erp/sync.py +62 -0
  236. factorysemantics_mes-0.1.0/src/fsmes/integrations/opc/__init__.py +0 -0
  237. factorysemantics_mes-0.1.0/src/fsmes/integrations/opc/agent.py +859 -0
  238. factorysemantics_mes-0.1.0/src/fsmes/integrations/opc/csv_replay.py +521 -0
  239. factorysemantics_mes-0.1.0/src/fsmes/integrations/opc/inspect.py +192 -0
  240. factorysemantics_mes-0.1.0/src/fsmes/integrations/opc/security.py +126 -0
  241. factorysemantics_mes-0.1.0/src/fsmes/integrations/opc/simulator.py +101 -0
  242. factorysemantics_mes-0.1.0/src/fsmes/integrations/opc/tag_map.py +198 -0
  243. factorysemantics_mes-0.1.0/src/fsmes/integrations/opc/worksheet.py +171 -0
  244. factorysemantics_mes-0.1.0/src/fsmes/kernel/__init__.py +11 -0
  245. factorysemantics_mes-0.1.0/src/fsmes/kernel/common.py +27 -0
  246. factorysemantics_mes-0.1.0/src/fsmes/kernel/tags.py +56 -0
  247. factorysemantics_mes-0.1.0/src/fsmes/logging.py +72 -0
  248. factorysemantics_mes-0.1.0/src/fsmes/mcp/__init__.py +7 -0
  249. factorysemantics_mes-0.1.0/src/fsmes/mcp/adjustments.py +46 -0
  250. factorysemantics_mes-0.1.0/src/fsmes/mcp/coa.py +52 -0
  251. factorysemantics_mes-0.1.0/src/fsmes/mcp/equipment.py +73 -0
  252. factorysemantics_mes-0.1.0/src/fsmes/mcp/erp.py +30 -0
  253. factorysemantics_mes-0.1.0/src/fsmes/mcp/maintenance.py +96 -0
  254. factorysemantics_mes-0.1.0/src/fsmes/mcp/masterdata.py +112 -0
  255. factorysemantics_mes-0.1.0/src/fsmes/mcp/quality.py +84 -0
  256. factorysemantics_mes-0.1.0/src/fsmes/mcp/scheduling.py +76 -0
  257. factorysemantics_mes-0.1.0/src/fsmes/mcp/serialization.py +92 -0
  258. factorysemantics_mes-0.1.0/src/fsmes/mcp/triggers.py +60 -0
  259. factorysemantics_mes-0.1.0/src/fsmes/mcp_server.py +628 -0
  260. factorysemantics_mes-0.1.0/src/fsmes/plant.py +557 -0
  261. factorysemantics_mes-0.1.0/src/fsmes/py.typed +0 -0
  262. factorysemantics_mes-0.1.0/src/fsmes/seed.py +84 -0
  263. factorysemantics_mes-0.1.0/src/fsmes/seed_kepsim.py +184 -0
  264. factorysemantics_mes-0.1.0/src/fsmes/seed_line.py +116 -0
  265. factorysemantics_mes-0.1.0/src/fsmes/services/__init__.py +22 -0
  266. factorysemantics_mes-0.1.0/src/fsmes/services/adjustments.py +205 -0
  267. factorysemantics_mes-0.1.0/src/fsmes/services/agent.py +537 -0
  268. factorysemantics_mes-0.1.0/src/fsmes/services/ai_status.py +292 -0
  269. factorysemantics_mes-0.1.0/src/fsmes/services/analysis.py +515 -0
  270. factorysemantics_mes-0.1.0/src/fsmes/services/assistant.py +838 -0
  271. factorysemantics_mes-0.1.0/src/fsmes/services/audit.py +30 -0
  272. factorysemantics_mes-0.1.0/src/fsmes/services/auth.py +196 -0
  273. factorysemantics_mes-0.1.0/src/fsmes/services/calendar.py +204 -0
  274. factorysemantics_mes-0.1.0/src/fsmes/services/capabilities.py +116 -0
  275. factorysemantics_mes-0.1.0/src/fsmes/services/coa.py +419 -0
  276. factorysemantics_mes-0.1.0/src/fsmes/services/design.py +342 -0
  277. factorysemantics_mes-0.1.0/src/fsmes/services/design_triage.py +234 -0
  278. factorysemantics_mes-0.1.0/src/fsmes/services/documents.py +245 -0
  279. factorysemantics_mes-0.1.0/src/fsmes/services/drafting.py +144 -0
  280. factorysemantics_mes-0.1.0/src/fsmes/services/equipment.py +236 -0
  281. factorysemantics_mes-0.1.0/src/fsmes/services/erp.py +224 -0
  282. factorysemantics_mes-0.1.0/src/fsmes/services/execution.py +302 -0
  283. factorysemantics_mes-0.1.0/src/fsmes/services/gauges.py +185 -0
  284. factorysemantics_mes-0.1.0/src/fsmes/services/line.py +364 -0
  285. factorysemantics_mes-0.1.0/src/fsmes/services/maintenance.py +292 -0
  286. factorysemantics_mes-0.1.0/src/fsmes/services/masterdata.py +281 -0
  287. factorysemantics_mes-0.1.0/src/fsmes/services/quality.py +137 -0
  288. factorysemantics_mes-0.1.0/src/fsmes/services/retention.py +71 -0
  289. factorysemantics_mes-0.1.0/src/fsmes/services/scheduling.py +275 -0
  290. factorysemantics_mes-0.1.0/src/fsmes/services/serialization.py +745 -0
  291. factorysemantics_mes-0.1.0/src/fsmes/services/spc.py +217 -0
  292. factorysemantics_mes-0.1.0/src/fsmes/services/staging.py +108 -0
  293. factorysemantics_mes-0.1.0/src/fsmes/services/tags.py +401 -0
  294. factorysemantics_mes-0.1.0/src/fsmes/services/triggers.py +323 -0
  295. factorysemantics_mes-0.1.0/src/fsmes/services/walkthroughs.py +128 -0
  296. factorysemantics_mes-0.1.0/src/fsmes/services/workorders.py +279 -0
  297. factorysemantics_mes-0.1.0/src/fsmes/sim/__init__.py +17 -0
  298. factorysemantics_mes-0.1.0/src/fsmes/sim/agent_eval.py +264 -0
  299. factorysemantics_mes-0.1.0/src/fsmes/sim/autoloop.py +344 -0
  300. factorysemantics_mes-0.1.0/src/fsmes/sim/generate.py +715 -0
  301. factorysemantics_mes-0.1.0/src/fsmes/sim/mcp_server.py +440 -0
  302. factorysemantics_mes-0.1.0/src/fsmes/sim/operations.py +330 -0
  303. factorysemantics_mes-0.1.0/src/fsmes/sim/rollup.py +256 -0
  304. factorysemantics_mes-0.1.0/src/fsmes/sim/runner.py +481 -0
  305. factorysemantics_mes-0.1.0/src/fsmes/sim/score.py +252 -0
  306. factorysemantics_mes-0.1.0/src/fsmes/sim/store.py +194 -0
  307. factorysemantics_mes-0.1.0/src/fsmes/sim/sweep.py +140 -0
  308. factorysemantics_mes-0.1.0/src/fsmes/sim/triage.py +147 -0
  309. factorysemantics_mes-0.1.0/src/fsmes/sim/truth.py +131 -0
  310. factorysemantics_mes-0.1.0/src/fsmes/sim/ui_check.py +355 -0
  311. factorysemantics_mes-0.1.0/src/fsmes/web/adjustments.html +90 -0
  312. factorysemantics_mes-0.1.0/src/fsmes/web/adjustments.js +143 -0
  313. factorysemantics_mes-0.1.0/src/fsmes/web/admin.css +55 -0
  314. factorysemantics_mes-0.1.0/src/fsmes/web/admin.html +124 -0
  315. factorysemantics_mes-0.1.0/src/fsmes/web/admin.js +373 -0
  316. factorysemantics_mes-0.1.0/src/fsmes/web/analysis.css +140 -0
  317. factorysemantics_mes-0.1.0/src/fsmes/web/analysis.html +113 -0
  318. factorysemantics_mes-0.1.0/src/fsmes/web/analysis.js +268 -0
  319. factorysemantics_mes-0.1.0/src/fsmes/web/app.js +556 -0
  320. factorysemantics_mes-0.1.0/src/fsmes/web/assist-record.js +552 -0
  321. factorysemantics_mes-0.1.0/src/fsmes/web/assist.css +238 -0
  322. factorysemantics_mes-0.1.0/src/fsmes/web/assist.js +694 -0
  323. factorysemantics_mes-0.1.0/src/fsmes/web/coa.css +19 -0
  324. factorysemantics_mes-0.1.0/src/fsmes/web/coa.html +76 -0
  325. factorysemantics_mes-0.1.0/src/fsmes/web/coa.js +117 -0
  326. factorysemantics_mes-0.1.0/src/fsmes/web/common.js +390 -0
  327. factorysemantics_mes-0.1.0/src/fsmes/web/demo/kepsim-hour.json +1 -0
  328. factorysemantics_mes-0.1.0/src/fsmes/web/design.css +60 -0
  329. factorysemantics_mes-0.1.0/src/fsmes/web/design.js +215 -0
  330. factorysemantics_mes-0.1.0/src/fsmes/web/gauges.html +116 -0
  331. factorysemantics_mes-0.1.0/src/fsmes/web/gauges.js +150 -0
  332. factorysemantics_mes-0.1.0/src/fsmes/web/index.html +146 -0
  333. factorysemantics_mes-0.1.0/src/fsmes/web/instructions.css +81 -0
  334. factorysemantics_mes-0.1.0/src/fsmes/web/instructions.html +100 -0
  335. factorysemantics_mes-0.1.0/src/fsmes/web/instructions.js +309 -0
  336. factorysemantics_mes-0.1.0/src/fsmes/web/kit.js +176 -0
  337. factorysemantics_mes-0.1.0/src/fsmes/web/line/app.js +221 -0
  338. factorysemantics_mes-0.1.0/src/fsmes/web/line/feed.js +231 -0
  339. factorysemantics_mes-0.1.0/src/fsmes/web/line/flow.js +244 -0
  340. factorysemantics_mes-0.1.0/src/fsmes/web/line/parts.js +442 -0
  341. factorysemantics_mes-0.1.0/src/fsmes/web/line/robot.js +224 -0
  342. factorysemantics_mes-0.1.0/src/fsmes/web/line/scene.js +430 -0
  343. factorysemantics_mes-0.1.0/src/fsmes/web/line-page.js +144 -0
  344. factorysemantics_mes-0.1.0/src/fsmes/web/line.css +234 -0
  345. factorysemantics_mes-0.1.0/src/fsmes/web/line.html +106 -0
  346. factorysemantics_mes-0.1.0/src/fsmes/web/line3d.html +97 -0
  347. factorysemantics_mes-0.1.0/src/fsmes/web/machine.css +88 -0
  348. factorysemantics_mes-0.1.0/src/fsmes/web/machine.html +145 -0
  349. factorysemantics_mes-0.1.0/src/fsmes/web/machine.js +309 -0
  350. factorysemantics_mes-0.1.0/src/fsmes/web/machines.html +54 -0
  351. factorysemantics_mes-0.1.0/src/fsmes/web/machines.js +137 -0
  352. factorysemantics_mes-0.1.0/src/fsmes/web/maintenance.html +163 -0
  353. factorysemantics_mes-0.1.0/src/fsmes/web/maintenance.js +284 -0
  354. factorysemantics_mes-0.1.0/src/fsmes/web/masterdata.html +200 -0
  355. factorysemantics_mes-0.1.0/src/fsmes/web/masterdata.js +276 -0
  356. factorysemantics_mes-0.1.0/src/fsmes/web/ops.css +54 -0
  357. factorysemantics_mes-0.1.0/src/fsmes/web/ops.html +115 -0
  358. factorysemantics_mes-0.1.0/src/fsmes/web/ops.js +296 -0
  359. factorysemantics_mes-0.1.0/src/fsmes/web/orders.css +126 -0
  360. factorysemantics_mes-0.1.0/src/fsmes/web/orders.html +205 -0
  361. factorysemantics_mes-0.1.0/src/fsmes/web/orders.js +545 -0
  362. factorysemantics_mes-0.1.0/src/fsmes/web/quality.css +41 -0
  363. factorysemantics_mes-0.1.0/src/fsmes/web/quality.html +118 -0
  364. factorysemantics_mes-0.1.0/src/fsmes/web/quality.js +462 -0
  365. factorysemantics_mes-0.1.0/src/fsmes/web/schedule.html +130 -0
  366. factorysemantics_mes-0.1.0/src/fsmes/web/schedule.js +169 -0
  367. factorysemantics_mes-0.1.0/src/fsmes/web/spc.html +82 -0
  368. factorysemantics_mes-0.1.0/src/fsmes/web/spc.js +150 -0
  369. factorysemantics_mes-0.1.0/src/fsmes/web/station.css +88 -0
  370. factorysemantics_mes-0.1.0/src/fsmes/web/station.html +123 -0
  371. factorysemantics_mes-0.1.0/src/fsmes/web/station.js +354 -0
  372. factorysemantics_mes-0.1.0/src/fsmes/web/styles.css +436 -0
  373. factorysemantics_mes-0.1.0/src/fsmes/web/tags.html +75 -0
  374. factorysemantics_mes-0.1.0/src/fsmes/web/tags.js +141 -0
  375. factorysemantics_mes-0.1.0/src/fsmes/web/themes.css +104 -0
  376. factorysemantics_mes-0.1.0/src/fsmes/web/themes.js +50 -0
  377. factorysemantics_mes-0.1.0/src/fsmes/web/trace.html +121 -0
  378. factorysemantics_mes-0.1.0/src/fsmes/web/trace.js +200 -0
  379. factorysemantics_mes-0.1.0/src/fsmes/web/triggers.html +121 -0
  380. factorysemantics_mes-0.1.0/src/fsmes/web/triggers.js +175 -0
  381. factorysemantics_mes-0.1.0/src/fsmes/web/vendor/OrbitControls.js +1963 -0
  382. factorysemantics_mes-0.1.0/src/fsmes/web/vendor/README.md +46 -0
  383. factorysemantics_mes-0.1.0/src/fsmes/web/vendor/three.core.min.js +6 -0
  384. factorysemantics_mes-0.1.0/src/fsmes/web/vendor/three.module.min.js +6 -0
  385. factorysemantics_mes-0.1.0/tests/conftest.py +107 -0
  386. factorysemantics_mes-0.1.0/tests/test_adjustments.py +156 -0
  387. factorysemantics_mes-0.1.0/tests/test_agent.py +333 -0
  388. factorysemantics_mes-0.1.0/tests/test_agent_batching.py +363 -0
  389. factorysemantics_mes-0.1.0/tests/test_agent_eval.py +79 -0
  390. factorysemantics_mes-0.1.0/tests/test_ai_status.py +172 -0
  391. factorysemantics_mes-0.1.0/tests/test_analysis.py +323 -0
  392. factorysemantics_mes-0.1.0/tests/test_api.py +77 -0
  393. factorysemantics_mes-0.1.0/tests/test_assistant.py +204 -0
  394. factorysemantics_mes-0.1.0/tests/test_auth.py +69 -0
  395. factorysemantics_mes-0.1.0/tests/test_autoloop.py +170 -0
  396. factorysemantics_mes-0.1.0/tests/test_capabilities.py +246 -0
  397. factorysemantics_mes-0.1.0/tests/test_cli.py +27 -0
  398. factorysemantics_mes-0.1.0/tests/test_coa.py +87 -0
  399. factorysemantics_mes-0.1.0/tests/test_core_oplock.py +73 -0
  400. factorysemantics_mes-0.1.0/tests/test_cutlery.py +181 -0
  401. factorysemantics_mes-0.1.0/tests/test_design.py +178 -0
  402. factorysemantics_mes-0.1.0/tests/test_design_triage.py +171 -0
  403. factorysemantics_mes-0.1.0/tests/test_documents.py +184 -0
  404. factorysemantics_mes-0.1.0/tests/test_environments.py +124 -0
  405. factorysemantics_mes-0.1.0/tests/test_equipment_oee.py +75 -0
  406. factorysemantics_mes-0.1.0/tests/test_erp_contract.py +181 -0
  407. factorysemantics_mes-0.1.0/tests/test_erp_roundtrip.py +58 -0
  408. factorysemantics_mes-0.1.0/tests/test_erpnext.py +253 -0
  409. factorysemantics_mes-0.1.0/tests/test_execution.py +50 -0
  410. factorysemantics_mes-0.1.0/tests/test_file_erp.py +71 -0
  411. factorysemantics_mes-0.1.0/tests/test_hierarchy.py +172 -0
  412. factorysemantics_mes-0.1.0/tests/test_hold.py +95 -0
  413. factorysemantics_mes-0.1.0/tests/test_kepsim.py +305 -0
  414. factorysemantics_mes-0.1.0/tests/test_kernel_common.py +72 -0
  415. factorysemantics_mes-0.1.0/tests/test_line_api.py +312 -0
  416. factorysemantics_mes-0.1.0/tests/test_line_scoping.py +146 -0
  417. factorysemantics_mes-0.1.0/tests/test_maintenance.py +252 -0
  418. factorysemantics_mes-0.1.0/tests/test_mcp_parity.py +89 -0
  419. factorysemantics_mes-0.1.0/tests/test_mcp_product.py +344 -0
  420. factorysemantics_mes-0.1.0/tests/test_megafactory.py +159 -0
  421. factorysemantics_mes-0.1.0/tests/test_migrations_have_one_head.py +18 -0
  422. factorysemantics_mes-0.1.0/tests/test_onboarding.py +182 -0
  423. factorysemantics_mes-0.1.0/tests/test_paging.py +242 -0
  424. factorysemantics_mes-0.1.0/tests/test_plant_migrate.py +85 -0
  425. factorysemantics_mes-0.1.0/tests/test_plant_scale_lists.py +321 -0
  426. factorysemantics_mes-0.1.0/tests/test_plant_scale_ui.py +107 -0
  427. factorysemantics_mes-0.1.0/tests/test_plant_serve_only.py +36 -0
  428. factorysemantics_mes-0.1.0/tests/test_quality.py +22 -0
  429. factorysemantics_mes-0.1.0/tests/test_rollup.py +141 -0
  430. factorysemantics_mes-0.1.0/tests/test_route_coverage.py +95 -0
  431. factorysemantics_mes-0.1.0/tests/test_routing_depth.py +177 -0
  432. factorysemantics_mes-0.1.0/tests/test_scale.py +82 -0
  433. factorysemantics_mes-0.1.0/tests/test_scheduling_trace.py +254 -0
  434. factorysemantics_mes-0.1.0/tests/test_serial_scale.py +332 -0
  435. factorysemantics_mes-0.1.0/tests/test_sim.py +392 -0
  436. factorysemantics_mes-0.1.0/tests/test_spc_gauges.py +162 -0
  437. factorysemantics_mes-0.1.0/tests/test_store.py +153 -0
  438. factorysemantics_mes-0.1.0/tests/test_tag_fabric.py +202 -0
  439. factorysemantics_mes-0.1.0/tests/test_tag_fabric_review.py +208 -0
  440. factorysemantics_mes-0.1.0/tests/test_tags.py +217 -0
  441. factorysemantics_mes-0.1.0/tests/test_themes.py +98 -0
  442. factorysemantics_mes-0.1.0/tests/test_triage.py +74 -0
  443. factorysemantics_mes-0.1.0/tests/test_triggers.py +162 -0
  444. factorysemantics_mes-0.1.0/tests/test_ui_check.py +153 -0
  445. factorysemantics_mes-0.1.0/tests/test_walkthroughs.py +152 -0
  446. factorysemantics_mes-0.1.0/tests/test_washer_story.py +142 -0
  447. factorysemantics_mes-0.1.0/tests/test_web.py +341 -0
  448. factorysemantics_mes-0.1.0/tests/test_wip.py +147 -0
  449. factorysemantics_mes-0.1.0/tests/test_workorders.py +63 -0
  450. factorysemantics_mes-0.1.0/tests/ui/baselines/control-room.json +976 -0
  451. factorysemantics_mes-0.1.0/tests/ui/baselines/daylight.json +976 -0
  452. factorysemantics_mes-0.1.0/tests/ui/baselines/high-contrast.json +976 -0
  453. factorysemantics_mes-0.1.0/tests/ui/baselines/night-shift.json +976 -0
  454. factorysemantics_mes-0.1.0/uv.lock +1755 -0
@@ -0,0 +1,69 @@
1
+ # FactorySemantics MES configuration. Copy to .env and adjust; every value has a sane default.
2
+ # All settings are read from environment variables prefixed MES_ (or this file).
3
+
4
+ # --- Database -------------------------------------------------------------
5
+ # SQLite (default, zero-setup):
6
+ MES_DATABASE_URL=sqlite:///fsmes.db
7
+ # PostgreSQL (scale deployment, matches docker-compose):
8
+ # MES_DATABASE_URL=postgresql+psycopg://mes:mes@localhost:5432/mes_twin
9
+
10
+ # --- Logging --------------------------------------------------------------
11
+ MES_LOG_LEVEL=INFO
12
+ MES_LOG_DIR=logs
13
+
14
+ # --- API ------------------------------------------------------------------
15
+ MES_API_HOST=127.0.0.1
16
+ MES_API_PORT=8000
17
+
18
+ # --- OPC UA ---------------------------------------------------------------
19
+ # Endpoint the agent connects to. Points at the bundled simulator by default;
20
+ # change to your real PLC/gateway endpoint to leave twin mode.
21
+ MES_OPC_ENDPOINT=opc.tcp://127.0.0.1:4840/mes-twin/sim
22
+ MES_OPC_NAMESPACE=urn:mes-twin:sim
23
+ MES_TAG_MAP_FILE=config/tag_map.json
24
+ # The KepSim six-station line instead of the two demo machines:
25
+ # config/tag_map_kepsim.json played back by `fsmes run-opc-sim --replay`
26
+ # config/tag_map_kepware.json read from a real KEPServerEX (see labs/kepsim)
27
+
28
+ # Client security. Empty = anonymous and unencrypted, which is all the bundled
29
+ # simulator needs. A real server usually offers only SignAndEncrypt with a named
30
+ # user — Kepware does. The certificate is minted on first use.
31
+ # MES_OPC_SECURITY=Basic256Sha256,SignAndEncrypt
32
+ # MES_OPC_USER=Administrator
33
+ # MES_OPC_PASSWORD=
34
+ MES_OPC_CERT_DIR=certs
35
+ MES_OPC_APPLICATION_URI=urn:mes-twin:agent
36
+
37
+ # Where `fsmes run-opc-sim --replay` reads the generated KepSim tables from.
38
+ MES_REPLAY_DIR=labs/kepsim/out
39
+
40
+ # --- ERP integration ------------------------------------------------------
41
+ # rest = poll an ERP REST API (mock ERP by default) | file = B2MML-style file
42
+ # exchange via the inbox/outbox folders | erpnext = a real ERPNext/Frappe
43
+ # instance | off = no ERP sync
44
+ MES_ERP_MODE=rest
45
+ MES_ERP_BASE_URL=http://127.0.0.1:8001
46
+ MES_ERP_INBOX=erp_exchange/inbox
47
+ MES_ERP_OUTBOX=erp_exchange/outbox
48
+ MES_ERP_ARCHIVE=erp_exchange/archive
49
+ MES_ERP_POLL_SECONDS=5
50
+
51
+ # --- ERPNext (MES_ERP_MODE=erpnext) ---------------------------------------
52
+ # One bench can serve several sites on one port; the site is chosen by the Host
53
+ # header. Leave MES_ERPNEXT_SITE empty only if the bench serves a single site —
54
+ # on a shared one, the default site is somebody else's company.
55
+ MES_ERPNEXT_BASE_URL=http://localhost:8090
56
+ MES_ERPNEXT_SITE=mes.localhost
57
+ MES_ERPNEXT_USER=Administrator
58
+ MES_ERPNEXT_PASSWORD=admin # the Frappe dev-bench default; a real site uses the API key below
59
+ # Preferred for a long-running worker (ERPNext: User -> API Access -> generate):
60
+ # MES_ERPNEXT_API_KEY=
61
+ # MES_ERPNEXT_API_SECRET=
62
+ MES_ERPNEXT_COMPANY=ACME Beverages
63
+ # Post finished quantities as real Manufacture stock entries. Off records what
64
+ # the MES counted without moving ERPNext's stock.
65
+ MES_ERPNEXT_POST_STOCK_ENTRY=true
66
+
67
+ # --- Simulator ------------------------------------------------------------
68
+ # >1.0 makes the simulated plant run faster than real time (demo uses 4).
69
+ MES_SIM_SPEED=1.0
@@ -0,0 +1,2 @@
1
+ # Until module maintainers exist, everything is reviewed by the founding maintainer.
2
+ * @kalwei
@@ -0,0 +1,49 @@
1
+ name: Bug
2
+ description: Something the MES did that it should not have, or did not do that it should have.
3
+ labels: [bug]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Thanks. Please use the simulator to reproduce where you can, and never paste real plant data, tag names that identify a customer, or screenshots with company names.
9
+ - type: textarea
10
+ id: info
11
+ attributes:
12
+ label: fsmes info
13
+ description: Paste the output of `fsmes info` (version, install location, modules).
14
+ render: text
15
+ validations:
16
+ required: true
17
+ - type: dropdown
18
+ id: plant
19
+ attributes:
20
+ label: Simulated or real?
21
+ options:
22
+ - Simulated (fsmes demo, fsmes plant, fsmes score)
23
+ - Real plant (no data in this report)
24
+ validations:
25
+ required: true
26
+ - type: textarea
27
+ id: steps
28
+ attributes:
29
+ label: Steps to reproduce
30
+ validations:
31
+ required: true
32
+ - type: textarea
33
+ id: expected
34
+ attributes:
35
+ label: What you expected
36
+ validations:
37
+ required: true
38
+ - type: textarea
39
+ id: actual
40
+ attributes:
41
+ label: What happened instead
42
+ validations:
43
+ required: true
44
+ - type: textarea
45
+ id: logs
46
+ attributes:
47
+ label: Logs
48
+ description: Relevant lines from `logs/`, with anything identifying removed.
49
+ render: text
@@ -0,0 +1,11 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Question
4
+ url: https://github.com/factorysemantics/factorysemantics-mes/discussions/categories/q-a
5
+ about: Ask in Discussions — searchable, and someone else probably had it too.
6
+ - name: Idea or design change
7
+ url: https://github.com/factorysemantics/factorysemantics-mes/discussions/categories/ideas
8
+ about: Propose it in Ideas first; accepted ideas become decision records.
9
+ - name: Security vulnerability
10
+ url: https://github.com/factorysemantics/factorysemantics-mes/security/advisories/new
11
+ about: Never in a public issue. Use private reporting or security@factorysemantics.com.
@@ -0,0 +1,31 @@
1
+ name: Integration problem
2
+ description: The MES and another system (ERPNext, Kepware, an OPC UA server, an MCP client) do not agree.
3
+ labels: [integration]
4
+ body:
5
+ - type: input
6
+ id: partner
7
+ attributes:
8
+ label: The other system and its version
9
+ placeholder: ERPNext v16.3 / KEPServerEX 6.17 / Claude Desktop 1.x
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: info
14
+ attributes:
15
+ label: fsmes info
16
+ render: text
17
+ validations:
18
+ required: true
19
+ - type: textarea
20
+ id: fails
21
+ attributes:
22
+ label: What fails, exactly
23
+ description: The request or message on our side, and what came back. No credentials, no real data.
24
+ validations:
25
+ required: true
26
+ - type: textarea
27
+ id: config
28
+ attributes:
29
+ label: Relevant configuration
30
+ description: The MES_… settings involved, with secrets removed.
31
+ render: text
@@ -0,0 +1,26 @@
1
+ name: A plant needed a code change
2
+ description: House rule 4 says adding a plant is configuration, not code. If yours needed code, that is a bug — tell us which.
3
+ labels: [bug, from-the-field]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Describe the plant in the abstract (line shape, number of stations, what the PLCs expose). No company names, no real tag names.
9
+ - type: textarea
10
+ id: plant
11
+ attributes:
12
+ label: The plant, in the abstract
13
+ validations:
14
+ required: true
15
+ - type: textarea
16
+ id: change
17
+ attributes:
18
+ label: The code change it needed
19
+ description: What you had to edit under `src/` and why the tag map or plant pack could not express it.
20
+ validations:
21
+ required: true
22
+ - type: textarea
23
+ id: info
24
+ attributes:
25
+ label: fsmes info
26
+ render: text
@@ -0,0 +1,18 @@
1
+ ## What
2
+ <!-- one paragraph: what a user notices -->
3
+
4
+ ## House rules touched
5
+ - [ ] Never invent production — counters, resets, stale notifications handled
6
+ - [ ] Unknown ≠ zero — every KPI that can't be computed returns null with a reason
7
+ - [ ] Unlabelled stays unlabelled
8
+ - [ ] Config not code at plant boundaries — no plant literals in `src/`
9
+ - [ ] Tests named as prose
10
+ - [ ] Charts looked at with real (simulated) data
11
+
12
+ ## Simulated or real?
13
+ <!-- which plant this was run against (`fsmes score <plant>` / `fsmes demo`), and at what speed -->
14
+
15
+ ## Checklist
16
+ - [ ] `ruff check .` and `pytest` pass locally
17
+ - [ ] Every commit is signed off (`git commit -s`)
18
+ - [ ] No real plant data, employer or customer names anywhere in the change
@@ -0,0 +1,16 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: pip
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ groups:
8
+ python:
9
+ patterns: ["*"]
10
+ - package-ecosystem: github-actions
11
+ directory: /
12
+ schedule:
13
+ interval: weekly
14
+ groups:
15
+ actions:
16
+ patterns: ["*"]
@@ -0,0 +1,55 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_call:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ${{ matrix.os }}
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ # Windows is a first-class target, not an afterthought: this MES is
19
+ # expected to run on plant PCs, and the single-writer lock exists in
20
+ # its O_EXCL form precisely because there is no fcntl there.
21
+ os: [ubuntu-latest, windows-latest]
22
+ python-version: ["3.12", "3.13"]
23
+
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+
27
+ - uses: actions/setup-python@v5
28
+ with:
29
+ python-version: ${{ matrix.python-version }}
30
+
31
+ - name: Install
32
+ run: python -m pip install --upgrade pip && python -m pip install -e ".[dev,mcp,agent]"
33
+
34
+ - name: Lint
35
+ run: python -m ruff check .
36
+
37
+ - name: Test
38
+ run: python -m pytest
39
+
40
+ audit:
41
+ # Known-vulnerable pins. Advisory until the first public release has
42
+ # shaken it out; then it becomes required.
43
+ runs-on: ubuntu-latest
44
+ continue-on-error: true
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+ - uses: actions/setup-python@v5
48
+ with:
49
+ python-version: "3.13"
50
+ # Editable install and --skip-editable, without --strict: the package
51
+ # under test is not on PyPI at the version being built (or at all,
52
+ # before the first release), and pip-audit must not count that as a
53
+ # finding. Vulnerabilities in the dependencies still fail the job.
54
+ - run: python -m pip install --upgrade pip pip-audit && python -m pip install -e ".[mcp,agent,postgres]"
55
+ - run: python -m pip_audit --skip-editable
@@ -0,0 +1,26 @@
1
+ name: DCO
2
+
3
+ on:
4
+ pull_request:
5
+
6
+ permissions:
7
+ contents: read
8
+
9
+ jobs:
10
+ signoff:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ with:
15
+ fetch-depth: 0
16
+ - name: Every commit carries a Signed-off-by line
17
+ run: |
18
+ set -euo pipefail
19
+ missing=0
20
+ for sha in $(git rev-list ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}); do
21
+ if ! git show -s --format=%B "$sha" | grep -qE '^Signed-off-by: .+ <.+@.+>$'; then
22
+ echo "::error::commit $sha has no Signed-off-by line (git commit -s)"
23
+ missing=1
24
+ fi
25
+ done
26
+ exit $missing
@@ -0,0 +1,39 @@
1
+ name: Docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ tags: ["v*"]
7
+ pull_request:
8
+
9
+ permissions:
10
+ contents: write
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ with:
18
+ fetch-depth: 0
19
+ - uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.13"
22
+ - name: Install
23
+ run: python -m pip install --upgrade pip && python -m pip install -e ".[docs,mcp]"
24
+ - name: Build (strict — a broken link fails)
25
+ run: mkdocs build --strict
26
+ - name: Publish dev docs
27
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
28
+ run: |
29
+ git config user.name github-actions
30
+ git config user.email github-actions@github.com
31
+ mike deploy --push --update-aliases dev
32
+ - name: Publish release docs
33
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
34
+ run: |
35
+ git config user.name github-actions
36
+ git config user.email github-actions@github.com
37
+ v="${GITHUB_REF_NAME#v}"; mm="${v%.*}"
38
+ mike deploy --push --update-aliases "$mm" latest
39
+ mike set-default --push latest
@@ -0,0 +1,104 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ test:
12
+ uses: ./.github/workflows/ci.yml
13
+
14
+ build:
15
+ needs: test
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.13"
22
+ - run: python -m pip install --upgrade pip build
23
+ - run: python -m build
24
+ - name: The tag and the package agree
25
+ run: |
26
+ v="${GITHUB_REF_NAME#v}"
27
+ ls dist/ | grep -q "factorysemantics_mes-${v}-" || { echo "::error::tag $GITHUB_REF_NAME but wheel is $(ls dist/)"; exit 1; }
28
+ - uses: actions/upload-artifact@v4
29
+ with:
30
+ name: dist
31
+ path: dist/
32
+
33
+ pypi:
34
+ needs: build
35
+ runs-on: ubuntu-latest
36
+ environment: pypi
37
+ permissions:
38
+ id-token: write
39
+ steps:
40
+ - uses: actions/download-artifact@v4
41
+ with:
42
+ name: dist
43
+ path: dist/
44
+ - uses: pypa/gh-action-pypi-publish@release/v1
45
+
46
+ image:
47
+ needs: build
48
+ runs-on: ubuntu-latest
49
+ permissions:
50
+ contents: read
51
+ packages: write
52
+ id-token: write
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+ - uses: docker/setup-qemu-action@v3
56
+ - uses: docker/setup-buildx-action@v3
57
+ - uses: docker/login-action@v3
58
+ with:
59
+ registry: ghcr.io
60
+ username: ${{ github.actor }}
61
+ password: ${{ secrets.GITHUB_TOKEN }}
62
+ - id: meta
63
+ uses: docker/metadata-action@v5
64
+ with:
65
+ images: ghcr.io/factorysemantics/fsmes
66
+ tags: |
67
+ type=semver,pattern={{version}}
68
+ type=raw,value=latest
69
+ - uses: docker/build-push-action@v6
70
+ with:
71
+ context: .
72
+ file: docker/Dockerfile
73
+ platforms: linux/amd64,linux/arm64
74
+ push: true
75
+ tags: ${{ steps.meta.outputs.tags }}
76
+ labels: ${{ steps.meta.outputs.labels }}
77
+ - uses: sigstore/cosign-installer@v3
78
+ - name: Sign the image (keyless)
79
+ run: cosign sign --yes ghcr.io/factorysemantics/fsmes:${GITHUB_REF_NAME#v}
80
+ - uses: anchore/sbom-action@v0
81
+ with:
82
+ image: ghcr.io/factorysemantics/fsmes:${{ github.ref_name }}
83
+ artifact-name: sbom.spdx.json
84
+
85
+ github-release:
86
+ needs: [pypi, image]
87
+ runs-on: ubuntu-latest
88
+ permissions:
89
+ contents: write
90
+ steps:
91
+ - uses: actions/checkout@v4
92
+ - uses: actions/download-artifact@v4
93
+ with:
94
+ name: dist
95
+ path: dist/
96
+ - name: Release notes from CHANGELOG
97
+ run: |
98
+ v="${GITHUB_REF_NAME#v}"
99
+ awk -v v="$v" '$0 ~ "^## \\["v"\\]" {p=1; next} /^## \[/ {if(p) exit} p' CHANGELOG.md > notes.md
100
+ test -s notes.md || echo "See CHANGELOG.md." > notes.md
101
+ - uses: softprops/action-gh-release@v2
102
+ with:
103
+ body_path: notes.md
104
+ files: dist/*
@@ -0,0 +1,28 @@
1
+ name: Scorecard
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "17 4 * * 1"
6
+ push:
7
+ branches: [main]
8
+
9
+ permissions: read-all
10
+
11
+ jobs:
12
+ analysis:
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ security-events: write
16
+ id-token: write
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ with:
20
+ persist-credentials: false
21
+ - uses: ossf/scorecard-action@v2.4.4
22
+ with:
23
+ results_file: results.sarif
24
+ results_format: sarif
25
+ publish_results: true
26
+ - uses: github/codeql-action/upload-sarif@v3
27
+ with:
28
+ sarif_file: results.sarif
@@ -0,0 +1,23 @@
1
+ name: Welcome
2
+
3
+ on:
4
+ issues:
5
+ types: [opened]
6
+ pull_request_target:
7
+ types: [opened]
8
+
9
+ permissions:
10
+ issues: write
11
+ pull-requests: write
12
+
13
+ jobs:
14
+ first-interaction:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/first-interaction@v1
18
+ with:
19
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
20
+ issue-message: |
21
+ Thanks for the first issue. The maintainer reads everything and answers within a few days. If this is about a real plant, please make sure nothing in it identifies the plant or its owner — the simulator is the place to reproduce.
22
+ pr-message: |
23
+ Thanks for the first pull request. Checks: every commit signed off (`git commit -s`), `ruff` and `pytest` green, and the house-rules checklist in the template. The maintainer reviews within a few days.
@@ -0,0 +1,67 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ build/
6
+ dist/
7
+ .venv/
8
+ venv/
9
+
10
+ # Tooling caches
11
+ .pytest_cache/
12
+ .ruff_cache/
13
+ .mypy_cache/
14
+ .coverage
15
+ htmlcov/
16
+
17
+ # Claude Code worktrees
18
+ .claude/worktrees/
19
+ .claude/settings.local.json
20
+
21
+ # ---------------------------------------------------------------------------
22
+ # Plant data and secrets. These rules are deliberately WHOLESALE rather than an
23
+ # enumerated list of subdirectories: an enumerated rule goes stale silently the
24
+ # first time the code writes somewhere new. Learned on factorysemantics.com,
25
+ # where `drops/ curated/ mlflow/` were listed and the node had since started
26
+ # writing archive/ and audit/ that nothing covered.
27
+ # ---------------------------------------------------------------------------
28
+ data/
29
+ *.db
30
+ *.db-wal
31
+ *.db-shm
32
+ *.sqlite
33
+ *.sqlite3
34
+ *.parquet
35
+ logs/
36
+ *.log
37
+
38
+ # Secrets. `.env*` (not just `.env`) because a plain `.env` rule does not match
39
+ # an editor's `.env.bak` — which is a committable copy of a credentials file.
40
+ .env
41
+ .env.*
42
+ !.env.example
43
+ .secrets/
44
+ *.token
45
+ certs/
46
+ *.pem
47
+ *.key
48
+
49
+ # Generated simulator output
50
+ sim/out/
51
+
52
+ # ---------------------------------------------------------------------------
53
+ # Carried in from MES-TWIN at the merge. Same wholesale-over-enumerated rule as
54
+ # above: labs/**/out/ rather than naming each lab, because the enumerated form
55
+ # went stale the moment labs/multiplant/ started generating its own CSVs.
56
+ # ---------------------------------------------------------------------------
57
+ erp_exchange/
58
+ labs/**/out/
59
+ labs/**/certs/
60
+ labs/multiplant/.data/
61
+ labs/megafactory/.data/
62
+ labs/cutlery/.data/
63
+
64
+ # Docs site: generated reference pages and the built site
65
+ docs/reference/
66
+ docs/llms.txt
67
+ site/
@@ -0,0 +1,53 @@
1
+ # Changelog
2
+
3
+ All notable changes to FactorySemantics MES. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
5
+ SemVer, where `0.x` means the API may change with a note here.
6
+
7
+ Sections: **Added**, **Changed**, **Fixed**, and **Honesty** — anything that
8
+ changed what a number *means* (a KPI formula, a state mapping, a counter rule)
9
+ goes under Honesty with a migration line, so plant people can find it.
10
+
11
+ ## [Unreleased]
12
+
13
+ ## [0.1.0] — first public release
14
+
15
+ The first public version. The code was developed privately from 2026-08-28
16
+ to 2026-09-07 in 34 pull requests; [docs/history/private-era.md](docs/history/private-era.md)
17
+ lists them. Everything below is what a stranger gets on day one, and every
18
+ number in it comes from a simulated plant.
19
+
20
+ ### Added
21
+ - Kernel: master data, routings, work orders, dispatch, execution with lot
22
+ genealogy, an append-only audit trail, users and roles with capabilities.
23
+ - OPC UA connectivity: tag maps from an engineering worksheet, `opc-browse`
24
+ and `opc-verify`, a replay server for simulated lines, triggers as data, a
25
+ write-back *recommendation* queue with three guards, and certificates of
26
+ analysis at the end of the line.
27
+ - Downtime and OEE with an explicit *unknown* segment; shift calendars.
28
+ - Quality: inspections, holds, non-conformances, SPC with capability withheld
29
+ when the data cannot support it, a gauge register with calibration.
30
+ - Maintenance-lite, finite-capacity scheduling with promised dates,
31
+ serialisation and genealogy at ten million pieces a day (the cutlery lab).
32
+ - ERP: a typed per-operation contract with an outbox, a REST adapter, a
33
+ B2MML-flavoured file adapter, and an ERPNext connector registered as a
34
+ module (`fsmes.modules` entry point `erpnext`).
35
+ - The agent surface: an MCP server with 85 tools that go through the HTTP API
36
+ as the `AGENT` role, dry-run on every write, `on_behalf_of` and idempotency
37
+ keys; the floor assistant in the operator UI; recorded walkthroughs; agent
38
+ evals that ask whether an agent given only the tools can answer what the
39
+ plant knows.
40
+ - Operations: plants from a registry (`fsmes plant`), scored runs
41
+ (`fsmes score`) against the simulator's scripted truth, sweeps, a Docker
42
+ image and Compose file, systemd units for test and promoted environments.
43
+ - Documentation site (MkDocs), decision records, security policy, code of
44
+ conduct, governance.
45
+
46
+ ### Honesty
47
+ - Counters book production by delta only; a counter falling toward zero is a
48
+ reset and books nothing. OEE reports *unknown* rather than zero when the
49
+ MES was not watching. Unlabelled downtime is reported as unlabelled. These
50
+ are the house rules and they are tested.
51
+
52
+ [Unreleased]: https://github.com/factorysemantics/factorysemantics-mes/compare/v0.1.0...HEAD
53
+ [0.1.0]: https://github.com/factorysemantics/factorysemantics-mes/releases/tag/v0.1.0
@@ -0,0 +1,12 @@
1
+ cff-version: 1.2.0
2
+ title: FactorySemantics MES
3
+ message: If you use this software in research, please cite it as below.
4
+ type: software
5
+ authors:
6
+ - family-names: Kalwei
7
+ given-names: Scott
8
+ repository-code: https://github.com/factorysemantics/factorysemantics-mes
9
+ url: https://factorysemantics.com
10
+ license: Apache-2.0
11
+ version: 0.1.0
12
+ abstract: An open-source, modular, agent-native Manufacturing Execution System with OPC UA connectivity, honest OEE, quality with SPC and gauges, scheduling, traceability, an ERPNext connector and an MCP agent surface.