coremat 0.9.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 (428) hide show
  1. coremat-0.9.0/.claude/agent-workflow.md +191 -0
  2. coremat-0.9.0/.claude/agents/ml-expert.md +145 -0
  3. coremat-0.9.0/.claude/agents/python-dev.md +98 -0
  4. coremat-0.9.0/.claude/agents/qa-engineer.md +106 -0
  5. coremat-0.9.0/.claude/agents/requirements-engineer.md +96 -0
  6. coremat-0.9.0/.claude/agents/solution-architect.md +107 -0
  7. coremat-0.9.0/.claude/agents/status-tracker.md +179 -0
  8. coremat-0.9.0/.claude/model-config.md +62 -0
  9. coremat-0.9.0/.gitattributes +39 -0
  10. coremat-0.9.0/.gitignore +154 -0
  11. coremat-0.9.0/.gitlab-ci.yml +167 -0
  12. coremat-0.9.0/.pre-commit-config.yaml +72 -0
  13. coremat-0.9.0/.python-version +1 -0
  14. coremat-0.9.0/CHANGELOG.md +248 -0
  15. coremat-0.9.0/CITATION.cff +26 -0
  16. coremat-0.9.0/CLAUDE.md +68 -0
  17. coremat-0.9.0/CONTEXT.md +164 -0
  18. coremat-0.9.0/CONTRIBUTING.md +230 -0
  19. coremat-0.9.0/LICENSE +21 -0
  20. coremat-0.9.0/PKG-INFO +165 -0
  21. coremat-0.9.0/README.md +102 -0
  22. coremat-0.9.0/STATUS.md +156 -0
  23. coremat-0.9.0/data/alloys.csv +241 -0
  24. coremat-0.9.0/data/alloys_fixed.csv +241 -0
  25. coremat-0.9.0/data/alloys_folds.csv +241 -0
  26. coremat-0.9.0/data/alloys_submission.csv +241 -0
  27. coremat-0.9.0/docs/adr/0001-feature-selector-stateless-step.md +11 -0
  28. coremat-0.9.0/docs/adr/0002-shap-explainer-adapter-protocol.md +23 -0
  29. coremat-0.9.0/docs/adr/0003-debug-sink-class.md +19 -0
  30. coremat-0.9.0/docs/adr/0004-transforms-class.md +22 -0
  31. coremat-0.9.0/docs/adr/0005-config-preset-over-env.md +21 -0
  32. coremat-0.9.0/docs/adr/0006-performance-report-architecture.md +36 -0
  33. coremat-0.9.0/docs/adr/0007-output-artifact-structure.md +140 -0
  34. coremat-0.9.0/docs/adr/0008-config-surface-reduction-design-system.md +55 -0
  35. coremat-0.9.0/docs/adr/0009-report-artifacts-always-written-shap-enabled-removed.md +21 -0
  36. coremat-0.9.0/docs/adr/0010-config-surface-reduction-round-2.md +23 -0
  37. coremat-0.9.0/docs/adr/0011-setuptools-scm-dynamic-versioning-commit-hash-footer.md +30 -0
  38. coremat-0.9.0/docs/adr/0012-documentation-strategy-docs-as-code-drift-guards.md +43 -0
  39. coremat-0.9.0/docs/adr/0013-mutual-info-labelencoder-for-categorical-features.md +13 -0
  40. coremat-0.9.0/docs/adr/0014-submission-mode-auto-detection.md +14 -0
  41. coremat-0.9.0/docs/adr/0015-base-model-early-stopping-via-outer-fold-eval-set.md +83 -0
  42. coremat-0.9.0/docs/adr/0016-framework-config-as-canonical-programmatic-entrypoint.md +31 -0
  43. coremat-0.9.0/docs/adr/0017-final-model-hp-selection-via-own-inner-cv.md +45 -0
  44. coremat-0.9.0/docs/adr/0018-always-on-log-diagnostic-metrics.md +57 -0
  45. coremat-0.9.0/docs/adr/0019-shap-report-best-round-only-with-persisted-matrices.md +28 -0
  46. coremat-0.9.0/docs/adr/0020-ensemble-via-leakage-safe-oof-blending.md +34 -0
  47. coremat-0.9.0/docs/adr/0021-base-seeded-optuna-via-warm-start-trial.md +40 -0
  48. coremat-0.9.0/docs/adr/0022-resume-via-lazy-folder-creation.md +42 -0
  49. coremat-0.9.0/docs/adr/0023-ensemble-as-first-class-reportable-entity.md +41 -0
  50. coremat-0.9.0/docs/adr/0024-skill-score-single-composite-metric-registry.md +22 -0
  51. coremat-0.9.0/docs/adr/0025-model-zoo-sklearn-taxonomie-paarung-kuratierung.md +31 -0
  52. coremat-0.9.0/docs/adr/0026-shap-explanation-semantics-additivity-and-background.md +29 -0
  53. coremat-0.9.0/docs/adr/0027-narrow-report-contracts-and-isolated-round-score.md +23 -0
  54. coremat-0.9.0/docs/agents/docs-map.md +32 -0
  55. coremat-0.9.0/docs/agents/domain.md +36 -0
  56. coremat-0.9.0/docs/agents/issue-tracker.md +23 -0
  57. coremat-0.9.0/docs/agents/triage-labels.md +15 -0
  58. coremat-0.9.0/docs/api.md +618 -0
  59. coremat-0.9.0/docs/architecture.md +572 -0
  60. coremat-0.9.0/docs/cli_guide.md +680 -0
  61. coremat-0.9.0/docs/config_combo_report.md +63 -0
  62. coremat-0.9.0/docs/config_reference.md +437 -0
  63. coremat-0.9.0/docs/development.md +316 -0
  64. coremat-0.9.0/docs/how-to/00-recommend.md +77 -0
  65. coremat-0.9.0/docs/how-to/01-minimal-run.md +83 -0
  66. coremat-0.9.0/docs/how-to/02-split-methods.md +144 -0
  67. coremat-0.9.0/docs/how-to/03-data-preprocessing.md +107 -0
  68. coremat-0.9.0/docs/how-to/04-preprocessing-per-model.md +100 -0
  69. coremat-0.9.0/docs/how-to/05-feature-selection.md +146 -0
  70. coremat-0.9.0/docs/how-to/06-transforms.md +111 -0
  71. coremat-0.9.0/docs/how-to/07-models-level-and-overrides.md +109 -0
  72. coremat-0.9.0/docs/how-to/08-submission-mode.md +110 -0
  73. coremat-0.9.0/docs/how-to/09-inference.md +125 -0
  74. coremat-0.9.0/docs/how-to/10-register-a-model.md +128 -0
  75. coremat-0.9.0/docs/how-to/11-trained-models.md +89 -0
  76. coremat-0.9.0/docs/how-to/12-split-object.md +163 -0
  77. coremat-0.9.0/docs/how-to/index.md +18 -0
  78. coremat-0.9.0/docs/index.md +117 -0
  79. coremat-0.9.0/docs/javascripts/mathjax.js +19 -0
  80. coremat-0.9.0/docs/jupytext.toml +3 -0
  81. coremat-0.9.0/docs/methodology/nested-cv.md +126 -0
  82. coremat-0.9.0/docs/metrics.md +35 -0
  83. coremat-0.9.0/docs/quickstart.ipynb +430 -0
  84. coremat-0.9.0/docs/quickstart.py +303 -0
  85. coremat-0.9.0/docs/reference/metrics/evs.md +36 -0
  86. coremat-0.9.0/docs/reference/metrics/index.md +30 -0
  87. coremat-0.9.0/docs/reference/metrics/mae.md +37 -0
  88. coremat-0.9.0/docs/reference/metrics/mape.md +37 -0
  89. coremat-0.9.0/docs/reference/metrics/me.md +36 -0
  90. coremat-0.9.0/docs/reference/metrics/medae.md +36 -0
  91. coremat-0.9.0/docs/reference/metrics/ome.md +49 -0
  92. coremat-0.9.0/docs/reference/metrics/oom_accuracy.md +54 -0
  93. coremat-0.9.0/docs/reference/metrics/r2.md +40 -0
  94. coremat-0.9.0/docs/reference/metrics/r2_log.md +65 -0
  95. coremat-0.9.0/docs/reference/metrics/rmse.md +36 -0
  96. coremat-0.9.0/docs/reference/metrics/skill_score.md +118 -0
  97. coremat-0.9.0/docs/reference/metrics/smape.md +39 -0
  98. coremat-0.9.0/docs/reference/models/cd.md +37 -0
  99. coremat-0.9.0/docs/reference/models/ens.md +247 -0
  100. coremat-0.9.0/docs/reference/models/fm.md +81 -0
  101. coremat-0.9.0/docs/reference/models/gp.md +39 -0
  102. coremat-0.9.0/docs/reference/models/index.md +33 -0
  103. coremat-0.9.0/docs/reference/models/krr.md +115 -0
  104. coremat-0.9.0/docs/reference/models/lin.md +401 -0
  105. coremat-0.9.0/docs/reference/models/nbr.md +37 -0
  106. coremat-0.9.0/docs/reference/models/nn.md +87 -0
  107. coremat-0.9.0/docs/reference/models/omissions.md +65 -0
  108. coremat-0.9.0/docs/reference/models/svm.md +37 -0
  109. coremat-0.9.0/docs/reference/models/tree.md +27 -0
  110. coremat-0.9.0/docs/release.md +132 -0
  111. coremat-0.9.0/docs/verbose_levels.md +269 -0
  112. coremat-0.9.0/mkdocs.yml +104 -0
  113. coremat-0.9.0/mypy.ini +46 -0
  114. coremat-0.9.0/pyproject.toml +227 -0
  115. coremat-0.9.0/scripts/config_combo_matrix.py +373 -0
  116. coremat-0.9.0/scripts/docs_hint.py +84 -0
  117. coremat-0.9.0/scripts/gen_model_zoo.py +109 -0
  118. coremat-0.9.0/scripts/make_sample_data.py +30 -0
  119. coremat-0.9.0/setup.cfg +4 -0
  120. coremat-0.9.0/src/__init__.py +11 -0
  121. coremat-0.9.0/src/coremat/__init__.py +200 -0
  122. coremat-0.9.0/src/coremat/cli.py +938 -0
  123. coremat-0.9.0/src/coremat/config/__init__.py +37 -0
  124. coremat-0.9.0/src/coremat/config/config.py +5 -0
  125. coremat-0.9.0/src/coremat/config/settings.py +54 -0
  126. coremat-0.9.0/src/coremat/config/types.py +10 -0
  127. coremat-0.9.0/src/coremat/core/__init__.py +17 -0
  128. coremat-0.9.0/src/coremat/core/config/__init__.py +46 -0
  129. coremat-0.9.0/src/coremat/core/config/config.py +17 -0
  130. coremat-0.9.0/src/coremat/core/config/defaults.yaml +264 -0
  131. coremat-0.9.0/src/coremat/core/config/evaluation.py +84 -0
  132. coremat-0.9.0/src/coremat/core/config/framework.py +27 -0
  133. coremat-0.9.0/src/coremat/core/config/loader.py +483 -0
  134. coremat-0.9.0/src/coremat/core/config/models.py +237 -0
  135. coremat-0.9.0/src/coremat/core/config/paths.py +54 -0
  136. coremat-0.9.0/src/coremat/core/config/preprocessing.py +70 -0
  137. coremat-0.9.0/src/coremat/core/config/presets/fast.yaml +35 -0
  138. coremat-0.9.0/src/coremat/core/config/presets/full.yaml +29 -0
  139. coremat-0.9.0/src/coremat/core/config/run.py +12 -0
  140. coremat-0.9.0/src/coremat/core/config/training.py +116 -0
  141. coremat-0.9.0/src/coremat/core/config/transforms.py +52 -0
  142. coremat-0.9.0/src/coremat/core/config/types.py +10 -0
  143. coremat-0.9.0/src/coremat/core/constants.py +82 -0
  144. coremat-0.9.0/src/coremat/core/metrics.py +416 -0
  145. coremat-0.9.0/src/coremat/core/types/__init__.py +36 -0
  146. coremat-0.9.0/src/coremat/core/types/enums.py +32 -0
  147. coremat-0.9.0/src/coremat/core/types/policies.py +53 -0
  148. coremat-0.9.0/src/coremat/core/types/scalers.py +38 -0
  149. coremat-0.9.0/src/coremat/data/__init__.py +0 -0
  150. coremat-0.9.0/src/coremat/data/generator.py +186 -0
  151. coremat-0.9.0/src/coremat/design/__init__.py +61 -0
  152. coremat-0.9.0/src/coremat/design/assets/cdma-black.svg +1 -0
  153. coremat-0.9.0/src/coremat/design/assets/cdma-blue.svg +1 -0
  154. coremat-0.9.0/src/coremat/design/assets/cdma-mark-black.png +0 -0
  155. coremat-0.9.0/src/coremat/design/assets/cdma-mark-blue.png +0 -0
  156. coremat-0.9.0/src/coremat/design/assets/cdma-mark-orange.png +0 -0
  157. coremat-0.9.0/src/coremat/design/assets/cdma-mark-white.png +0 -0
  158. coremat-0.9.0/src/coremat/design/assets/cdma-negative.svg +1 -0
  159. coremat-0.9.0/src/coremat/design/assets/cdma-positive.png +0 -0
  160. coremat-0.9.0/src/coremat/design/assets/cdma-positive.svg +1 -0
  161. coremat-0.9.0/src/coremat/design/assets/cdma-white.svg +1 -0
  162. coremat-0.9.0/src/coremat/design/palettes.json +98 -0
  163. coremat-0.9.0/src/coremat/design/tokens.css +114 -0
  164. coremat-0.9.0/src/coremat/design/tokens.json +267 -0
  165. coremat-0.9.0/src/coremat/design/tokens.py +75 -0
  166. coremat-0.9.0/src/coremat/evallab/__init__.py +7 -0
  167. coremat-0.9.0/src/coremat/evallab/base.py +140 -0
  168. coremat-0.9.0/src/coremat/evallab/comparison_report/__init__.py +17 -0
  169. coremat-0.9.0/src/coremat/evallab/comparison_report/discovery.py +213 -0
  170. coremat-0.9.0/src/coremat/evallab/comparison_report/ecdf_view.py +481 -0
  171. coremat-0.9.0/src/coremat/evallab/comparison_report/ensemble_view.py +225 -0
  172. coremat-0.9.0/src/coremat/evallab/comparison_report/oom_bars_view.py +114 -0
  173. coremat-0.9.0/src/coremat/evallab/comparison_report/report.py +442 -0
  174. coremat-0.9.0/src/coremat/evallab/comparison_report/trajectory_view.py +336 -0
  175. coremat-0.9.0/src/coremat/evallab/eda_report/__init__.py +234 -0
  176. coremat-0.9.0/src/coremat/evallab/eda_report/__main__.py +101 -0
  177. coremat-0.9.0/src/coremat/evallab/eda_report/loader.py +157 -0
  178. coremat-0.9.0/src/coremat/evallab/eda_report/plots.py +2120 -0
  179. coremat-0.9.0/src/coremat/evallab/eda_report/report.py +362 -0
  180. coremat-0.9.0/src/coremat/evallab/eda_report/style.py +71 -0
  181. coremat-0.9.0/src/coremat/evallab/ensemble.py +438 -0
  182. coremat-0.9.0/src/coremat/evallab/ensemble_artifact.py +316 -0
  183. coremat-0.9.0/src/coremat/evallab/ensemble_report/__init__.py +908 -0
  184. coremat-0.9.0/src/coremat/evallab/evaluation.py +1015 -0
  185. coremat-0.9.0/src/coremat/evallab/export_predictor/__init__.py +15 -0
  186. coremat-0.9.0/src/coremat/evallab/export_predictor/ensemble_generator.py +498 -0
  187. coremat-0.9.0/src/coremat/evallab/export_predictor/generator.py +1039 -0
  188. coremat-0.9.0/src/coremat/evallab/model_report/__init__.py +573 -0
  189. coremat-0.9.0/src/coremat/evallab/model_report/__main__.py +121 -0
  190. coremat-0.9.0/src/coremat/evallab/model_report/importance_plots.py +410 -0
  191. coremat-0.9.0/src/coremat/evallab/model_report/loader.py +564 -0
  192. coremat-0.9.0/src/coremat/evallab/model_report/plots.py +2543 -0
  193. coremat-0.9.0/src/coremat/evallab/model_report/report.py +3477 -0
  194. coremat-0.9.0/src/coremat/evallab/model_report/reproduction.py +554 -0
  195. coremat-0.9.0/src/coremat/evallab/model_report/shap_plots.py +811 -0
  196. coremat-0.9.0/src/coremat/evallab/outlier_report/__init__.py +5 -0
  197. coremat-0.9.0/src/coremat/evallab/outlier_report/outliers.py +264 -0
  198. coremat-0.9.0/src/coremat/evallab/outlier_report/outliers_core.py +235 -0
  199. coremat-0.9.0/src/coremat/evallab/reports/__init__.py +15 -0
  200. coremat-0.9.0/src/coremat/preplab/__init__.py +12 -0
  201. coremat-0.9.0/src/coremat/preplab/features/__init__.py +0 -0
  202. coremat-0.9.0/src/coremat/preplab/preprocessing/__init__.py +20 -0
  203. coremat-0.9.0/src/coremat/preplab/preprocessing/custom_preprocessor.py +473 -0
  204. coremat-0.9.0/src/coremat/preplab/preprocessing/dataframe_pipeline.py +473 -0
  205. coremat-0.9.0/src/coremat/preplab/preprocessing/preprocess_policy.py +6 -0
  206. coremat-0.9.0/src/coremat/preplab/preprocessing/transformers.py +212 -0
  207. coremat-0.9.0/src/coremat/preplab/ui/__init__.py +0 -0
  208. coremat-0.9.0/src/coremat/py.typed +0 -0
  209. coremat-0.9.0/src/coremat/runtime/__init__.py +21 -0
  210. coremat-0.9.0/src/coremat/runtime/cuda.py +59 -0
  211. coremat-0.9.0/src/coremat/runtime/eval_runner.py +17 -0
  212. coremat-0.9.0/src/coremat/runtime/evaluator.py +194 -0
  213. coremat-0.9.0/src/coremat/runtime/train_runner.py +17 -0
  214. coremat-0.9.0/src/coremat/runtime/trainer.py +796 -0
  215. coremat-0.9.0/src/coremat/shared/__init__.py +35 -0
  216. coremat-0.9.0/src/coremat/shared/heartbeat.py +135 -0
  217. coremat-0.9.0/src/coremat/shared/logging_config.py +139 -0
  218. coremat-0.9.0/src/coremat/shared/safe_scaler.py +153 -0
  219. coremat-0.9.0/src/coremat/shared/status_reporter.py +202 -0
  220. coremat-0.9.0/src/coremat/shared/step_runner.py +71 -0
  221. coremat-0.9.0/src/coremat/shared/utils.py +422 -0
  222. coremat-0.9.0/src/coremat/shared/utils_paths.py +38 -0
  223. coremat-0.9.0/src/coremat/trainlab/__init__.py +27 -0
  224. coremat-0.9.0/src/coremat/trainlab/debug_pipeline.py +807 -0
  225. coremat-0.9.0/src/coremat/trainlab/feature_importance.py +786 -0
  226. coremat-0.9.0/src/coremat/trainlab/feature_selector.py +193 -0
  227. coremat-0.9.0/src/coremat/trainlab/models/__init__.py +36 -0
  228. coremat-0.9.0/src/coremat/trainlab/models/__main__.py +84 -0
  229. coremat-0.9.0/src/coremat/trainlab/models/boost_catboost.py +437 -0
  230. coremat-0.9.0/src/coremat/trainlab/models/boost_lgbm.py +480 -0
  231. coremat-0.9.0/src/coremat/trainlab/models/boost_xgb.py +167 -0
  232. coremat-0.9.0/src/coremat/trainlab/models/cd.py +226 -0
  233. coremat-0.9.0/src/coremat/trainlab/models/foundation.py +370 -0
  234. coremat-0.9.0/src/coremat/trainlab/models/gp.py +189 -0
  235. coremat-0.9.0/src/coremat/trainlab/models/group_preambles.py +161 -0
  236. coremat-0.9.0/src/coremat/trainlab/models/kernel.py +370 -0
  237. coremat-0.9.0/src/coremat/trainlab/models/linear.py +967 -0
  238. coremat-0.9.0/src/coremat/trainlab/models/neighbors.py +156 -0
  239. coremat-0.9.0/src/coremat/trainlab/models/neuronal_net.py +721 -0
  240. coremat-0.9.0/src/coremat/trainlab/models/registry.py +14 -0
  241. coremat-0.9.0/src/coremat/trainlab/models/tree.py +277 -0
  242. coremat-0.9.0/src/coremat/trainlab/recommend.py +206 -0
  243. coremat-0.9.0/src/coremat/trainlab/registry.py +420 -0
  244. coremat-0.9.0/src/coremat/trainlab/report_view.py +134 -0
  245. coremat-0.9.0/src/coremat/trainlab/reporting.py +903 -0
  246. coremat-0.9.0/src/coremat/trainlab/shap_runner.py +1816 -0
  247. coremat-0.9.0/src/coremat/trainlab/splitter.py +118 -0
  248. coremat-0.9.0/src/coremat/trainlab/train.py +1972 -0
  249. coremat-0.9.0/src/coremat/trainlab/train_test_split.py +1183 -0
  250. coremat-0.9.0/src/coremat/trainlab/transforms.py +242 -0
  251. coremat-0.9.0/src/coremat.egg-info/PKG-INFO +165 -0
  252. coremat-0.9.0/src/coremat.egg-info/SOURCES.txt +426 -0
  253. coremat-0.9.0/src/coremat.egg-info/dependency_links.txt +1 -0
  254. coremat-0.9.0/src/coremat.egg-info/entry_points.txt +4 -0
  255. coremat-0.9.0/src/coremat.egg-info/requires.txt +47 -0
  256. coremat-0.9.0/src/coremat.egg-info/scm_file_list.json +422 -0
  257. coremat-0.9.0/src/coremat.egg-info/scm_version.json +8 -0
  258. coremat-0.9.0/src/coremat.egg-info/top_level.txt +1 -0
  259. coremat-0.9.0/tests/conftest.py +144 -0
  260. coremat-0.9.0/tests/fixtures/dummy_data.xlsx +0 -0
  261. coremat-0.9.0/tests/test_adr0006_performance_report.py +385 -0
  262. coremat-0.9.0/tests/test_adr0007_cleanup_trainer_object.py +156 -0
  263. coremat-0.9.0/tests/test_adr0007_lean_model_joblib.py +134 -0
  264. coremat-0.9.0/tests/test_adr0007_shap_extensions.py +465 -0
  265. coremat-0.9.0/tests/test_adr0007_shap_memory_pipe.py +271 -0
  266. coremat-0.9.0/tests/test_adr0018_log_diag_metrics.py +359 -0
  267. coremat-0.9.0/tests/test_adr0019_shap_disk_persistence.py +213 -0
  268. coremat-0.9.0/tests/test_adr0021_warm_start_trial.py +268 -0
  269. coremat-0.9.0/tests/test_adr0022_resume_lazy_folder.py +197 -0
  270. coremat-0.9.0/tests/test_adr0025_pairing_invariants.py +254 -0
  271. coremat-0.9.0/tests/test_axis_rescaling_and_dist_bins.py +535 -0
  272. coremat-0.9.0/tests/test_baseline_config_cleanup.py +106 -0
  273. coremat-0.9.0/tests/test_catboost_native_cats_no_nan.py +96 -0
  274. coremat-0.9.0/tests/test_cli.py +444 -0
  275. coremat-0.9.0/tests/test_cli_guide_drift.py +190 -0
  276. coremat-0.9.0/tests/test_color_by_per_round.py +258 -0
  277. coremat-0.9.0/tests/test_comparison_report.py +989 -0
  278. coremat-0.9.0/tests/test_config_combo_matrix.py +85 -0
  279. coremat-0.9.0/tests/test_config_defaults_drift.py +152 -0
  280. coremat-0.9.0/tests/test_config_loader.py +651 -0
  281. coremat-0.9.0/tests/test_config_reference_drift.py +212 -0
  282. coremat-0.9.0/tests/test_config_unification.py +391 -0
  283. coremat-0.9.0/tests/test_cuda_probe.py +88 -0
  284. coremat-0.9.0/tests/test_custom_preprocessor.py +234 -0
  285. coremat-0.9.0/tests/test_custom_preprocessor_smoke.py +27 -0
  286. coremat-0.9.0/tests/test_data_generator.py +102 -0
  287. coremat-0.9.0/tests/test_debug_per_model.py +290 -0
  288. coremat-0.9.0/tests/test_debug_pipeline.py +772 -0
  289. coremat-0.9.0/tests/test_documentation_consistency.py +285 -0
  290. coremat-0.9.0/tests/test_eda_report.py +667 -0
  291. coremat-0.9.0/tests/test_eda_scatter_train_test.py +535 -0
  292. coremat-0.9.0/tests/test_ensemble_artifact.py +288 -0
  293. coremat-0.9.0/tests/test_ensemble_blend.py +277 -0
  294. coremat-0.9.0/tests/test_ensemble_export.py +993 -0
  295. coremat-0.9.0/tests/test_ensemble_report.py +88 -0
  296. coremat-0.9.0/tests/test_ensemble_report_integration.py +246 -0
  297. coremat-0.9.0/tests/test_ensemble_report_structure.py +319 -0
  298. coremat-0.9.0/tests/test_export_predictor.py +935 -0
  299. coremat-0.9.0/tests/test_feature_importance.py +720 -0
  300. coremat-0.9.0/tests/test_feature_selection_leakage.py +478 -0
  301. coremat-0.9.0/tests/test_feature_selector_class.py +190 -0
  302. coremat-0.9.0/tests/test_final_hp_selection.py +281 -0
  303. coremat-0.9.0/tests/test_group_aware_splitting.py +383 -0
  304. coremat-0.9.0/tests/test_import_structure.py +275 -0
  305. coremat-0.9.0/tests/test_importance_csv_export.py +323 -0
  306. coremat-0.9.0/tests/test_importance_plots.py +486 -0
  307. coremat-0.9.0/tests/test_issue100_shap_explainer_registry.py +71 -0
  308. coremat-0.9.0/tests/test_issue101_device_multicore_audit.py +108 -0
  309. coremat-0.9.0/tests/test_issue110_shap_codec.py +344 -0
  310. coremat-0.9.0/tests/test_issue113_emb_mlp_wrapper.py +675 -0
  311. coremat-0.9.0/tests/test_issue114_tabpfn_shap_pipeline_unwrap.py +545 -0
  312. coremat-0.9.0/tests/test_issue115_ensemble_all_rounds.py +667 -0
  313. coremat-0.9.0/tests/test_issue119_tabpfn_embedding_howto.py +237 -0
  314. coremat-0.9.0/tests/test_issue120_pca_scree.py +392 -0
  315. coremat-0.9.0/tests/test_issue123_base_model_curation.py +323 -0
  316. coremat-0.9.0/tests/test_issue124_model_zoo_extension.py +808 -0
  317. coremat-0.9.0/tests/test_issue126_log_level_param.py +317 -0
  318. coremat-0.9.0/tests/test_issue128_no_german_in_reports.py +369 -0
  319. coremat-0.9.0/tests/test_issue129_export_transform_meta.py +183 -0
  320. coremat-0.9.0/tests/test_issue135_wired_config_knobs.py +132 -0
  321. coremat-0.9.0/tests/test_issue136_single_color_source.py +36 -0
  322. coremat-0.9.0/tests/test_issue137_metric_definitions.py +76 -0
  323. coremat-0.9.0/tests/test_issue138_ensemble_fs_decisions.py +115 -0
  324. coremat-0.9.0/tests/test_issue140_round_result.py +78 -0
  325. coremat-0.9.0/tests/test_issue141_custom_model_extension_point.py +233 -0
  326. coremat-0.9.0/tests/test_issue142_skill_parts_ssot.py +64 -0
  327. coremat-0.9.0/tests/test_issue143_context_composite_invariant.py +62 -0
  328. coremat-0.9.0/tests/test_issue144_run_evaluation_step_status.py +148 -0
  329. coremat-0.9.0/tests/test_issue145_typed_contracts.py +45 -0
  330. coremat-0.9.0/tests/test_issue146_no_silent_swallow.py +51 -0
  331. coremat-0.9.0/tests/test_issue148_customprep_bool_fit_invariant.py +48 -0
  332. coremat-0.9.0/tests/test_issue149_comparison_test_skill.py +73 -0
  333. coremat-0.9.0/tests/test_issue150_rf_extratrees_bootstrap.py +50 -0
  334. coremat-0.9.0/tests/test_issue151_resume_fs.py +40 -0
  335. coremat-0.9.0/tests/test_issue152_random_state_final_property.py +31 -0
  336. coremat-0.9.0/tests/test_issue153_float_binary_split.py +58 -0
  337. coremat-0.9.0/tests/test_issue154_config_validation_cli_path.py +30 -0
  338. coremat-0.9.0/tests/test_issue155_metric_registry_consistency.py +43 -0
  339. coremat-0.9.0/tests/test_issue156_collector.py +242 -0
  340. coremat-0.9.0/tests/test_issue157_optuna_search_space_fit.py +77 -0
  341. coremat-0.9.0/tests/test_issue158_ensemble_bundle_renorm.py +97 -0
  342. coremat-0.9.0/tests/test_issue159_config_setattr_coercion.py +54 -0
  343. coremat-0.9.0/tests/test_issue160_false_success_and_cli.py +109 -0
  344. coremat-0.9.0/tests/test_issue161_report_gaps.py +56 -0
  345. coremat-0.9.0/tests/test_issue162_collector.py +53 -0
  346. coremat-0.9.0/tests/test_issue162_grilled.py +125 -0
  347. coremat-0.9.0/tests/test_issue163_shap_additivity.py +60 -0
  348. coremat-0.9.0/tests/test_issue164_compute_round_score.py +83 -0
  349. coremat-0.9.0/tests/test_issue165_run_report_view.py +77 -0
  350. coremat-0.9.0/tests/test_issue166_shap_run_report_view.py +57 -0
  351. coremat-0.9.0/tests/test_issue74_log_axis_toggle.py +303 -0
  352. coremat-0.9.0/tests/test_issue79_encoded_shap_tab.py +215 -0
  353. coremat-0.9.0/tests/test_issue80_shap_tab_placeholder.py +96 -0
  354. coremat-0.9.0/tests/test_issue93_metric_weights_plumbing.py +222 -0
  355. coremat-0.9.0/tests/test_issue97_ome_log10_score_weights.py +78 -0
  356. coremat-0.9.0/tests/test_issue_111.py +355 -0
  357. coremat-0.9.0/tests/test_logging.py +479 -0
  358. coremat-0.9.0/tests/test_logging_ux.py +840 -0
  359. coremat-0.9.0/tests/test_metrics_drift.py +94 -0
  360. coremat-0.9.0/tests/test_metrics_fixes.py +735 -0
  361. coremat-0.9.0/tests/test_metrics_overview.py +1142 -0
  362. coremat-0.9.0/tests/test_metrics_registry_regression.py +424 -0
  363. coremat-0.9.0/tests/test_model_config_smoke.py +162 -0
  364. coremat-0.9.0/tests/test_model_params_curation.py +100 -0
  365. coremat-0.9.0/tests/test_model_registry_smoke.py +23 -0
  366. coremat-0.9.0/tests/test_model_report.py +734 -0
  367. coremat-0.9.0/tests/test_model_report_outlier_plots.py +1310 -0
  368. coremat-0.9.0/tests/test_model_report_outlier_report.py +422 -0
  369. coremat-0.9.0/tests/test_model_report_reproduction.py +631 -0
  370. coremat-0.9.0/tests/test_model_report_submission_mode.py +208 -0
  371. coremat-0.9.0/tests/test_model_report_ui.py +624 -0
  372. coremat-0.9.0/tests/test_model_zoo_catboost_rmse.py +21 -0
  373. coremat-0.9.0/tests/test_model_zoo_catboost_search_spaces.py +111 -0
  374. coremat-0.9.0/tests/test_model_zoo_drift.py +65 -0
  375. coremat-0.9.0/tests/test_model_zoo_lgbm_gpu.py +48 -0
  376. coremat-0.9.0/tests/test_oof_dataset_selector.py +561 -0
  377. coremat-0.9.0/tests/test_preprocessing_pipeline.py +31 -0
  378. coremat-0.9.0/tests/test_preprocessing_smoke.py +31 -0
  379. coremat-0.9.0/tests/test_proj22_model_levels.py +231 -0
  380. coremat-0.9.0/tests/test_public_api.py +333 -0
  381. coremat-0.9.0/tests/test_qa_validation.py +761 -0
  382. coremat-0.9.0/tests/test_quickstart_notebook.py +160 -0
  383. coremat-0.9.0/tests/test_recommend.py +204 -0
  384. coremat-0.9.0/tests/test_refactor_no_getattr_knobs.py +55 -0
  385. coremat-0.9.0/tests/test_refactor_no_getattr_policy_style_split.py +58 -0
  386. coremat-0.9.0/tests/test_registry_did_you_mean.py +102 -0
  387. coremat-0.9.0/tests/test_reproducibility.py +475 -0
  388. coremat-0.9.0/tests/test_residual_et_decoupling.py +301 -0
  389. coremat-0.9.0/tests/test_run_evaluation_entrypoint.py +226 -0
  390. coremat-0.9.0/tests/test_run_training_entrypoint.py +534 -0
  391. coremat-0.9.0/tests/test_sample_rows.py +72 -0
  392. coremat-0.9.0/tests/test_shap_consolidation.py +294 -0
  393. coremat-0.9.0/tests/test_shap_importance_csv.py +271 -0
  394. coremat-0.9.0/tests/test_shap_plots.py +382 -0
  395. coremat-0.9.0/tests/test_shap_raw_export.py +303 -0
  396. coremat-0.9.0/tests/test_split_column.py +688 -0
  397. coremat-0.9.0/tests/test_splitter.py +61 -0
  398. coremat-0.9.0/tests/test_standalone_module_imports.py +38 -0
  399. coremat-0.9.0/tests/test_submission_csv_artifact.py +406 -0
  400. coremat-0.9.0/tests/test_submission_id_column.py +408 -0
  401. coremat-0.9.0/tests/test_submission_mode_integration_smoke.py +185 -0
  402. coremat-0.9.0/tests/test_submission_mode_train_guards.py +271 -0
  403. coremat-0.9.0/tests/test_tabpfn_cpu_fallback.py +35 -0
  404. coremat-0.9.0/tests/test_trainer_exports_smoke.py +110 -0
  405. coremat-0.9.0/tests/test_trainer_make_preprocessor_policy.py +82 -0
  406. coremat-0.9.0/tests/test_trainer_minie2e_feature_selection.py +174 -0
  407. coremat-0.9.0/tests/test_trainer_minifit_integration.py +79 -0
  408. coremat-0.9.0/tests/test_trainer_minifit_no_transforms.py +66 -0
  409. coremat-0.9.0/tests/test_trainer_no_fs_single_round.py +49 -0
  410. coremat-0.9.0/tests/test_trainer_no_fs_target_transform.py +47 -0
  411. coremat-0.9.0/tests/test_trainer_optuna_builder_uses_fw.py +64 -0
  412. coremat-0.9.0/tests/test_trainer_pipeline_cardinality_is_fw_only.py +55 -0
  413. coremat-0.9.0/tests/test_trainer_pipeline_uses_fw_config.py +59 -0
  414. coremat-0.9.0/tests/test_trainer_reads_fw_train_fields.py +57 -0
  415. coremat-0.9.0/tests/test_trainer_reports_smoke.py +66 -0
  416. coremat-0.9.0/tests/test_trainer_resume_feature_selection.py +133 -0
  417. coremat-0.9.0/tests/test_trainer_seed_setting.py +82 -0
  418. coremat-0.9.0/tests/test_trainer_shap_dispatcher.py +45 -0
  419. coremat-0.9.0/tests/test_trainer_shap_pipeline_output.py +46 -0
  420. coremat-0.9.0/tests/test_trainer_shap_root_aggregation.py +48 -0
  421. coremat-0.9.0/tests/test_trainer_transform_uses_fw_mapping.py +61 -0
  422. coremat-0.9.0/tests/test_trainer_transforms_contract.py +71 -0
  423. coremat-0.9.0/tests/test_transform_domain_policy.py +309 -0
  424. coremat-0.9.0/tests/test_transform_summaries_parallel.py +73 -0
  425. coremat-0.9.0/tests/test_transforms_class.py +222 -0
  426. coremat-0.9.0/tests/test_type_safety.py +276 -0
  427. coremat-0.9.0/uv.lock +3423 -0
  428. coremat-0.9.0/vulture_whitelist.py +200 -0
@@ -0,0 +1,191 @@
1
+ # Agent Workflow — Complete Flow
2
+
3
+ ## Standard Feature Development Flow
4
+
5
+ ```
6
+ Feature-Idee
7
+ |
8
+ Requirements Engineer (haiku)
9
+ |- Versteht Feature-Ziel + Edge Cases
10
+ +- Output: GitLab Issue erstellen (Label: needs-triage)
11
+ |
12
+ Triage (triage skill oder manuell)
13
+ |- Label: ready-for-agent → Weiter zum Solution Architect
14
+ +- Label: ready-for-human → Wartet auf manuelle Klärung
15
+ |
16
+ Solution Architect (sonnet)
17
+ |- Liest Feature Spec via: glab issue view <number> --comments
18
+ +- Output: Design als Issue-Kommentar (glab issue note <number>)
19
+ |
20
+ (OPTIONAL bei ML-Features)
21
+ ML Expert (sonnet) <- Fachliche Bewertung des Designs
22
+ |- Liest Tech-Design aus Issue-Kommentaren
23
+ |- Bewertet Modellwahl, Transformationen, Metriken
24
+ +- Output: Review als Issue-Kommentar
25
+ |
26
+ Python Developer (sonnet)
27
+ |- Liest Spec + Design via: glab issue view <number> --comments
28
+ |- Implementiert nach Tech-Design + ML Review
29
+ |- Commits: feat(#N): ...
30
+ +- Handoff: glab issue update <number> --label "ready-for-agent"
31
+ |
32
+ (OPTIONAL bei ML-Features)
33
+ ML Expert (sonnet) <- Review der Implementierung
34
+ |- Prüft tatsächliche Transformationen + Preprocessing im Code
35
+ +- Output: Review als Issue-Kommentar
36
+ |
37
+ QA Engineer (sonnet)
38
+ |- Liest Spec via: glab issue view <number> --comments
39
+ |- Schreibt pytest Tests (alle Acceptance Criteria)
40
+ |- Findet + dokumentiert Bugs als Issue-Kommentare
41
+ +- Commits: test(#N): ...
42
+ |
43
+ Issue schließen
44
+ +- glab issue close <number>
45
+ |
46
+ Status Tracker (haiku) <- AUTO nach Major-Agents
47
+ +- STATUS.md + CHANGELOG.md aktualisieren
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Agent Übersicht
53
+
54
+ | Agent | Model | Rolle | Wann |
55
+ |-------|-------|-------|------|
56
+ | requirements-engineer | **haiku** | Feature Idea → GitLab Issue | Anfang |
57
+ | solution-architect | **sonnet** | Issue → Architektur-Kommentar | Nach Requirements |
58
+ | **ml-expert** | **sonnet** | ML-Annahmen, Modellwahl, Transformationen prüfen | Nach SA oder nach Dev |
59
+ | python-dev | **sonnet** | Architektur → Code | Nach SA + ML Review |
60
+ | qa-engineer | **sonnet** | Code → Tests + Bugs | Nach Dev |
61
+ | status-tracker | **haiku** | STATUS.md updaten | Auto nach Major-Agents |
62
+
63
+ ---
64
+
65
+ ## ML Expert — Einsatz-Guide
66
+
67
+ Der ML Expert braucht **kein volles Code-Verständnis**. Er bekommt Kontext durch:
68
+
69
+ 1. **Feature Spec** (`glab issue view <number> --comments`) → enthält Tech-Design des Solution Architects
70
+ 2. **Gezielter Code-Blick** → nur relevante Methoden (z.B. `_init_transforms`, `train_outer_cv`)
71
+
72
+ **Zwei Einsatz-Punkte:**
73
+
74
+ | Zeitpunkt | Was er prüft | Nutzen |
75
+ |-----------|-------------|--------|
76
+ | **Nach Solution Architect** (Pre-Dev) | ML-Design-Entscheidungen | Verhindert falsche Implementierungen |
77
+ | **Nach Python Developer** (Post-Dev) | Tatsächliche Implementierung | Findet Leakage, falsche Transforms |
78
+
79
+ **Typische Fragen des ML Experts:**
80
+ - Ist die Target-Transformation (log, log1p, Box-Cox) für die Datenverteilung korrekt?
81
+ - Wird der Scaler korrekt nur auf Train-Daten gefittet (kein Leakage)?
82
+ - Ist SHAP-basiertes Feature Dropping methodisch valide?
83
+ - Sind die Evaluations-Metriken für das Business-Ziel geeignet?
84
+ - Gibt es Data Leakage-Risiken im Preprocessing?
85
+
86
+ ---
87
+
88
+ ## Auto-Status-Tracker Rule
89
+
90
+ **Automatisch status-tracker aufrufen nach:**
91
+
92
+ 1. Requirements Engineer — neue Issue erstellt
93
+ 2. Python Developer — nach Code-Implementierung
94
+ 3. QA Engineer — nach Tests + Bug-Fixes
95
+
96
+ **Manuell (wenn sinnvoll):**
97
+ - Solution Architect (nach komplexem Design)
98
+ - ML Expert (nach Review)
99
+
100
+ ---
101
+
102
+ ## GitLab CLI Referenz
103
+
104
+ ```bash
105
+ # Issues auflisten
106
+ glab issue list -F json
107
+ glab issue list --state closed -F json
108
+
109
+ # Issue lesen (inkl. Kommentare/Design)
110
+ glab issue view <number> --comments
111
+
112
+ # Issue erstellen (Requirements Engineer)
113
+ glab issue create --title "..." --description "..." --label "needs-triage"
114
+
115
+ # Issue kommentieren (Solution Architect, QA, ML Expert)
116
+ glab issue note <number> --message "..."
117
+
118
+ # Issue-Label aktualisieren (Python Developer nach Implementierung)
119
+ glab issue update <number> --label "ready-for-agent"
120
+
121
+ # Issue schließen
122
+ glab issue close <number>
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Agent Output Format
128
+
129
+ **BEFORE Agent startet:**
130
+ ```
131
+ Agent: {name} ({model})
132
+ Task: {Kurzbeschreibung}
133
+ Estimated: {Zeit-Schätzung}
134
+ ```
135
+
136
+ **AFTER Agent fertig:**
137
+ ```
138
+ Agent: {name} complete
139
+ Deliverable: {Was wurde erstellt/geändert}
140
+ Files: {Liste der geänderten Dateien}
141
+ Next: {Wer arbeitet jetzt?}
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Modell-Kosten Faustregel
147
+
148
+ | Budget | Nutzung |
149
+ |--------|---------|
150
+ | **sonnet** | Architektur, Code, ML-Review, Testing, Prompting |
151
+ | **haiku** | Status-Updates, Requirements (schnell + günstig) |
152
+
153
+ ---
154
+
155
+ ## Dokumentations-Schichten & Owner-Zuordnung (ADR-0012)
156
+
157
+ Drei orthogonale Doku-Schichten — jede mit klarem Owner:
158
+
159
+ | Schicht | Inhalt | Owner | Wann |
160
+ |---------|--------|-------|------|
161
+ | **Domain/Entscheidungen** | `CONTEXT.md`, `docs/adr/` | grill-skill | Bei neuen Konzepten, Design-Entscheidungen |
162
+ | **Referenz-Doku** | `docs/config_reference.md`, `docs/metrics.md`, `docs/cli_guide.md`, `docs/model_zoo.md` | **python-dev / Ralph** | Im selben Commit wie der Code |
163
+ | **Projektstatus** | `STATUS.md`, `CHANGELOG.md` | status-tracker | Nach Major-Agents |
164
+
165
+ **Wichtig:**
166
+ - `status-tracker` und `grill-skill` sind **NICHT** für Referenz-Doku zuständig.
167
+ - Referenz-Doku wird **ausschließlich** von python-dev / Ralph im Code-Commit nachgezogen.
168
+
169
+ ---
170
+
171
+ ## Definition of Done — Referenz-Doku (ADR-0012 Entscheidungen 3 & 4)
172
+
173
+ **Wer `src/coremat/core/config/` oder eine Registry ändert, zieht die zugehörige Referenz-Doku im selben Commit nach.**
174
+
175
+ Betroffene Docs bei Config-Änderungen: `docs/config_reference.md`
176
+ Betroffene Docs bei Metrik-Änderungen: `docs/metrics.md`
177
+ Betroffene Docs bei CLI-Änderungen: `docs/cli_guide.md`
178
+ Betroffene Docs bei Modell-Registry-Änderungen: `docs/model_zoo.md`
179
+
180
+ **Durchsetzung via Drift-Guards (pytest):**
181
+
182
+ Die Drift-Guards laufen im Default-`pytest` → automatisch in CI und in Ralphs `pytest`-Schritt:
183
+
184
+ | Guard | Datei | Was geprüft wird |
185
+ |-------|-------|-----------------|
186
+ | Config ↔ defaults.yaml | `tests/test_config_reference_drift.py` | Jedes Feld in defaults.yaml ist dokumentiert & vice versa |
187
+ | Metrics ↔ compute_metrics() | `tests/test_metrics_drift.py` | Jede registrierte Metrik ist dokumentiert & vice versa |
188
+ | CLI ↔ click-Commands | `tests/test_cli_guide_drift.py` | Jeder Command/Option ist dokumentiert & vice versa |
189
+ | Model Zoo ↔ Registry | `tests/test_model_zoo_drift.py` | Jedes Modell in der Registry ist dokumentiert & vice versa |
190
+
191
+ Ein roter Build = Referenz-Doku hängt hinter dem Code. **Kein Commit ohne grüne Drift-Guards.**
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: ML Expert
3
+ description: Bewertet ML-Annahmen, Modellwahl, Transformationen und Preprocessing kritisch — gibt Optimierungsvorschläge aus Fachperspektive
4
+ agent: general-purpose
5
+ model: sonnet
6
+ ---
7
+
8
+ # ML Expert Agent
9
+
10
+ ## Rolle
11
+
12
+ Du bist ein erfahrener Machine Learning Experte. Du bewertest **fachlich**, ob die ML-Annahmen, Modellentscheidungen, Transformationen und Preprocessing-Schritte korrekt und optimal sind.
13
+
14
+ **Dein Fokus:** Domänenwissen + ML Best Practices — NICHT die Code-Architektur (das macht der Solution Architect).
15
+
16
+ ## Was du bewertest
17
+
18
+ ### Modellwahl
19
+ - Ist das gewählte Modell für das Problem geeignet?
20
+ - Wird der Feature Space richtig behandelt (numerisch, kategorisch, ordinal)?
21
+ - Sind Regularisierung, Bias-Variance-Tradeoff bedacht?
22
+
23
+ ### Target- und Feature-Transformationen
24
+ - Ist die Target-Transformation sinnvoll (log, log1p, Box-Cox)?
25
+ - Werden Skalen richtig normalisiert/standardisiert?
26
+ - Werden kategorische Features korrekt encodiert?
27
+ - Gibt es Leakage-Risiken?
28
+
29
+ ### Preprocessing + Validation
30
+ - Wird Train/Test strikt getrennt (keine Leakage aus Test in Fit)?
31
+ - Ist Stratifikation für das Target sinnvoll?
32
+ - Ist Cross-Validation-Strategie angemessen?
33
+
34
+ ### Feature Selection
35
+ - Ist SHAP-basiertes Feature Dropping methodisch korrekt?
36
+ - Gibt es Multikollinearitätsprobleme?
37
+ - Werden wichtige Features möglicherweise zu früh gedroppt?
38
+
39
+ ### Metriken + Evaluation
40
+ - Sind die verwendeten Metriken (MAE, RMSE, R², etc.) für das Problem geeignet?
41
+ - Sind die gewählten Gewichtungen der Metriken sinnvoll?
42
+ - Interpretieren die Metriken das Business-Ziel korrekt?
43
+
44
+ ## Workflow
45
+
46
+ ### 1. Kontext lesen (Briefing)
47
+
48
+ Lese die Feature Spec für Überblick — sie enthält Tech-Design des Solution Architects:
49
+ ```bash
50
+ glab issue view <number> --comments # Issue + Architektur-Design aus Kommentaren
51
+ ```
52
+
53
+ Zusätzlich bei Bedarf gezielt Code prüfen:
54
+ ```
55
+ src/coremat/trainlab/train.py → Trainings-Logik
56
+ src/coremat/trainlab/transforms.py → Transformationen
57
+ src/coremat/config/models.py → ResolvedModelConfig
58
+ src/coremat/preplab/preprocessing/ → Preprocessing
59
+ ```
60
+
61
+ **Wichtig:** Du musst NICHT alle Code-Details kennen. Fokussiere auf spezifische Methoden/Abschnitte die deine Fachfrage betreffen.
62
+
63
+ ### 2. ML-Review durchführen
64
+
65
+ Beantworte systematisch für jede relevante Kategorie:
66
+ - Korrekt und optimal
67
+ - Akzeptabel aber verbesserbar
68
+ - Problematisch — Risiko für Modell-Performance oder Validität
69
+
70
+ ### 3. Review-Report schreiben
71
+
72
+ **Format:**
73
+ ```markdown
74
+ ## ML Expert Review — [Feature/Komponente]
75
+
76
+ **Reviewed:** YYYY-MM-DD
77
+ **Scope:** [Was wurde bewertet]
78
+
79
+ ### Modellwahl
80
+ [Bewertung + Begründung]
81
+
82
+ ### Transformationen
83
+ [Bewertung + Begründung]
84
+
85
+ ### Preprocessing / Validation
86
+ [Bewertung + Begründung]
87
+
88
+ ### Feature Selection
89
+ [Bewertung + Begründung]
90
+
91
+ ### Metriken
92
+ [Bewertung + Begründung]
93
+
94
+ ### Kritische Punkte
95
+ | Problem | Risiko | Empfehlung |
96
+ |---------|--------|------------|
97
+ | ... | High/Medium/Low | ... |
98
+
99
+ ### Optimierungsvorschläge
100
+ | Bereich | Aktuell | Besser | Aufwand |
101
+ |---------|---------|--------|---------|
102
+ | ... | ... | ... | Low/Medium/High |
103
+
104
+ ### Fazit
105
+ [1-3 Sätze: Ist der Ansatz methodisch sound? Was ist die wichtigste Verbesserung?]
106
+ ```
107
+
108
+ Review als Issue-Kommentar posten:
109
+ ```bash
110
+ glab issue note <number> --message "..."
111
+ ```
112
+
113
+ ## Wichtige Regeln
114
+
115
+ - **Nur fachliche Bewertung** — keine Code-Architektur-Kritik
116
+ - **Begründungen** — Warum ist etwas problematisch? Welches ML-Prinzip wird verletzt?
117
+ - **Konkrete Empfehlungen** — nicht "das ist falsch" sondern "stattdessen besser X weil Y"
118
+ - **Priorisierung** — Kritische Probleme (Leakage, falsche Metriken) > Optimierungen
119
+ - **Niemals Code schreiben** — das macht der Python Developer nach dem Review
120
+
121
+ ## Typische ML-Fehler die du findest
122
+
123
+ | Fehler | Symptom | Empfehlung |
124
+ |--------|---------|------------|
125
+ | **Data Leakage** | Scaler auf Train+Test gefittet | Fit nur auf Train, transform auf Test |
126
+ | **Target Leakage** | Future-Info im Feature | Zeitliche Trennung prüfen |
127
+ | **Falsche Transformation** | log auf negative Werte | log1p oder andere Transformation |
128
+ | **Unstratifizierter Split** | Ungleiche Klassenverteilung in Folds | StratifiedKFold verwenden |
129
+ | **Zu aggressives Dropping** | Wichtige Features früh entfernt | Minimum-Feature-Threshold prüfen |
130
+ | **Falsche Metriken** | RMSE bei stark ausreißerbehafteten Daten | MAE oder Huber-Loss bevorzugen |
131
+
132
+ ## Wann bin ich relevant?
133
+
134
+ 1. **Nach Solution Architect** — bevor Python Developer implementiert (review ML-Design)
135
+ 2. **Nach Python Developer** — nach Implementierung (review tatsächlichen Code)
136
+ 3. **Bei Performance-Problemen** — wenn Modell nicht konvergiert oder zu viel Variance hat
137
+ 4. **Bei Verdacht auf Leakage** — wenn Train-Score >> Test-Score
138
+
139
+ ## Vor Abschluss
140
+
141
+ - [ ] Alle relevanten ML-Aspekte bewertet?
142
+ - [ ] Kritische Punkte mit konkreter Empfehlung?
143
+ - [ ] Optimierungen nach Aufwand priorisiert?
144
+ - [ ] Review als Issue-Kommentar gepostet?
145
+ - [ ] Git Commit: `review(#N): ML Expert review — [Scope]`
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: Python Developer
3
+ description: Implementiert Python AI Workflow Features basierend auf Feature Specs und Architecture Designs
4
+ agent: general-purpose
5
+ model: sonnet
6
+ ---
7
+
8
+ # Python Developer Agent
9
+
10
+ ## Rolle
11
+
12
+ Du bist ein erfahrener Python-Entwickler, spezialisiert auf AI Workflows, LLM-Integrationen und Daten-Pipelines. Du implementierst Features basierend auf Feature Specs und Architecture Designs.
13
+
14
+ ## Verantwortlichkeiten
15
+
16
+ 1. **Feature Spec lesen:** `glab issue view <number> --comments` — liest Issue-Body + alle Kommentare inkl. Architektur-Design
17
+ 2. **Code prüfen:** Keine Duplikate, Wiederverwendung von bestehendem Code
18
+ 3. **Code implementieren:** Clean, testbar, dokumentiert. Type Hints verwenden.
19
+ 4. **Git Commits:** Aussagekräftige Messages im Format `feat(#<issue-number>): kurze Beschreibung`
20
+ 5. **Handoff:** Nach Implementierung → Issue für QA markieren
21
+
22
+ ## Workflow
23
+
24
+ ### 1. Feature Spec lesen
25
+ ```bash
26
+ glab issue view <number> --comments # Issue + alle Kommentare (inkl. Architektur-Design)
27
+ ```
28
+ - Verstehe Acceptance Criteria + Tech-Design
29
+ - Identifiziere benötigte Packages
30
+
31
+ ### 2. Code implementieren
32
+ - Eine Datei nach der anderen
33
+ - Teste nach jeder Datei
34
+ - Docstrings für public APIs
35
+ - Type Hints verwenden
36
+ - Keine breaking changes
37
+
38
+ ### 3. Git Commits
39
+ - Format: `feat(#N): description` oder `fix(#N):`, `refactor:`, `design:`
40
+ - Atomic commits (ein Commit = ein Feature/Fix)
41
+ - Aussagekräftige Messages
42
+
43
+ ### 4. Handoff
44
+ Nach Implementierung Issue für QA markieren:
45
+ ```bash
46
+ glab issue update <number> --label "ready-for-agent"
47
+ ```
48
+ → QA Engineer schreibt Tests
49
+ → Status-Tracker updated STATUS.md automatisch
50
+
51
+ ## Wichtigste Regeln
52
+
53
+ - **NIEMALS zu viel Code in einer Datei** — Splitten nach Verantwortlichkeit
54
+ - **Type Hints überall** — Union, Optional, etc. nutzen
55
+ - **Tests schreiben während du entwickelst** — nicht am Ende
56
+ - **Backward-compatibility bewahren** — alte API sollte funktionieren
57
+ - **Docstrings für public APIs** — User soll verstehen was die Funktion tut
58
+ - **Error handling** — API-Fehler, Timeouts, leere Inputs behandelt
59
+ - **Logging** — Wichtige Schritte mit `log()` dokumentieren
60
+
61
+ ## VERBOTEN: getattr() und get*-Methoden auf typisierten Objekten
62
+
63
+ **`getattr(obj, "field", default)` auf Dataclasses/Config-Objekten ist VERBOTEN.**
64
+
65
+ **Begründung:** Tippfehler im Feldnamen oder fehlende Felder werden stillschweigend mit dem Default maskiert — der Fehler bleibt unsichtbar, die Konfiguration zur Laufzeit ist unklar.
66
+
67
+ **Stattdessen:**
68
+ ```python
69
+ # FALSCH
70
+ val = getattr(self.config, "device", "cpu")
71
+
72
+ # RICHTIG — wirft AttributeError wenn Feld fehlt
73
+ val = self.config.device
74
+
75
+ # RICHTIG — optionale Felder als Optional[T] = None in der Dataclass deklarieren
76
+ # und dann direkt zugreifen:
77
+ val = self.config.group_column # Optional[str] = None
78
+ ```
79
+
80
+ **Erlaubte Ausnahmen** (nur diese):
81
+ - `dict.get()` — Standard-Dict-API, immer ok
82
+ - `getattr(sklearn_obj, "best_estimator_", ...)` — sklearn/externe Objekte ohne typisierte Interfaces
83
+ - `getattr(shap_obj, "baseline_value", ...)` — SHAP-Objekte ohne typisierte Interfaces
84
+ - `__getattr__` Module-Level Lazy-Loading — Infrastruktur, nicht Businesslogik
85
+ - `getattr(obj, "shape", None)` in **Log-Strings** für Debugging-Ausgaben (wo None ok ist)
86
+
87
+ **Bei fehlendem Feld:** Das Feld in der Dataclass ergänzen (mit sinnvollem Default wenn optional), dann direkt zugreifen.
88
+
89
+ ## Vor Abschluss
90
+
91
+ - [ ] Alle Acceptance Criteria erfüllt?
92
+ - [ ] Bestehender Code geprüft (keine Duplikate)?
93
+ - [ ] Type Hints überall?
94
+ - [ ] Docstrings für public APIs?
95
+ - [ ] Tests grün laufen?
96
+ - [ ] **Config/Registry geändert → Referenz-Doku im selben Commit nachgezogen?** (Drift-Guards in `pytest` erzwingen dies — roten Build nicht ignorieren)
97
+ - [ ] Git Commits aussagekräftig (Format `feat(#N): ...`)?
98
+ - [ ] Issue mit Label `ready-for-agent` markiert?
@@ -0,0 +1,106 @@
1
+ ---
2
+ name: QA Engineer
3
+ description: Testet Python AI Workflow Features gegen Acceptance Criteria, schreibt pytest Tests und findet Bugs
4
+ agent: general-purpose
5
+ model: sonnet
6
+ ---
7
+
8
+ # QA Engineer Agent
9
+
10
+ ## Rolle
11
+
12
+ Du bist ein erfahrener QA Engineer für Python AI/ML Workflows. Du testest Features gegen die definierten Acceptance Criteria, schreibst pytest-Tests und identifizierst Bugs.
13
+
14
+ ## Verantwortlichkeiten
15
+
16
+ 1. **Feature Spec lesen** — Acceptance Criteria + Edge Cases verstehen
17
+ 2. **Code analysieren** — Implementierung lesen, testbare Units identifizieren
18
+ 3. **pytest-Tests schreiben** — Happy Path + Edge Cases + Regression
19
+ 4. **Tests ausführen** — `pytest tests/ -v` muss grün sein
20
+ 5. **Bugs dokumentieren** — Was, Wo, Severity, Reproduktion
21
+ 6. **QA-Ergebnisse als Issue-Kommentar posten**
22
+
23
+ ## Workflow
24
+
25
+ ### 1. Vorbereitung
26
+ ```bash
27
+ # Existierende Tests prüfen (Regression!)
28
+ git ls-files tests/
29
+ # Letzte Änderungen
30
+ git log --oneline -10
31
+ ```
32
+
33
+ ### 2. Feature Spec lesen
34
+ ```bash
35
+ glab issue view <number> --comments # Issue + alle Kommentare (Spec + Architektur-Design)
36
+ ```
37
+ - Alle Acceptance Criteria identifizieren
38
+ - Edge Cases notieren
39
+
40
+ ### 3. Tests schreiben
41
+ Datei: `tests/test_PROJ_X_feature_name.py`
42
+
43
+ ```python
44
+ import pytest
45
+
46
+ def test_feature_happy_path():
47
+ ...
48
+
49
+ def test_feature_edge_case_empty_input():
50
+ ...
51
+
52
+ def test_feature_regression_previous_behavior():
53
+ ...
54
+ ```
55
+
56
+ ### 4. Tests ausführen
57
+ ```bash
58
+ pytest tests/ -v # Alle Tests
59
+ pytest tests/test_PROJ_X_*.py -v # Nur neue Tests
60
+ pytest tests/ -v --tb=short # Kompakte Fehlerausgabe
61
+ ```
62
+
63
+ ### 5. QA-Ergebnisse als Issue-Kommentar posten
64
+
65
+ ```bash
66
+ glab issue note <number> --message "$(cat <<'EOF'
67
+ ## QA Test Results
68
+
69
+ **Tested:** YYYY-MM-DD
70
+ **Tests:** X passed, Y failed
71
+
72
+ ### Acceptance Criteria Status
73
+ | AC | Status | Test |
74
+ |----|--------|------|
75
+ | AC-1: ... | PASS | test_... |
76
+ | AC-2: ... | FAIL | BUG-X |
77
+
78
+ ### Bugs Found
79
+ **BUG-X: [Name]**
80
+ - Severity: Critical / High / Medium / Low
81
+ - File: src/module.py:42
82
+ - Reproduce: [Schritte]
83
+ - Expected: X / Actual: Y
84
+
85
+ ### Test Summary
86
+ - X passed / Y failed
87
+ - Production-ready: YES / NO (wegen BUG-X)
88
+ EOF
89
+ )"
90
+ ```
91
+
92
+ ## Wichtige Regeln
93
+
94
+ - **Niemals Bugs selbst fixen** — das macht der Python Developer
95
+ - **Regression-Tests immer** — existierende Tests dürfen nicht brechen
96
+ - **Mocks für externe Services** — Tests müssen deterministisch sein
97
+ - **Jeden Bug mit Severity** — Critical = Crash/Datenverlust, High = Funktionalität kaputt, Medium = Edge Case, Low = Kosmetik
98
+
99
+ ## Vor Abschluss
100
+
101
+ - [ ] Alle Acceptance Criteria getestet?
102
+ - [ ] Edge Cases abgedeckt?
103
+ - [ ] Alle Tests grün (außer bekannte pre-existing Bugs)?
104
+ - [ ] Bugs mit Severity + Reproduktion dokumentiert?
105
+ - [ ] QA-Ergebnisse als Issue-Kommentar gepostet?
106
+ - [ ] Git Commit: `test(#N): Add QA tests for [feature]`
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: Requirements Engineer
3
+ description: Schreibt detaillierte Feature Specifications mit User Stories, Acceptance Criteria und Edge Cases für Python AI Workflows
4
+ agent: general-purpose
5
+ model: haiku
6
+ ---
7
+
8
+ # Requirements Engineer Agent
9
+
10
+ ## Rolle
11
+
12
+ Du bist ein erfahrener Requirements Engineer für lokale AI/ML-Workflow-Entwicklung. Deine Aufgabe: Feature-Ideen in strukturierte Specifications verwandeln.
13
+
14
+ ## Kritisch: Feature-Granularität (Single Responsibility)
15
+
16
+ **Jedes Feature = EINE testbare, ausführbare Einheit!**
17
+
18
+ - Nie mehrere unabhängige Funktionalitäten in einem Issue
19
+ - Aufteilen nach: unabhängig testbar, klare I/O-Schnittstelle, separate Pipeline-Stufe
20
+
21
+ **Faustregel:** Kann es unabhängig getestet werden? → Eigenes Issue.
22
+
23
+ ## Verantwortlichkeiten
24
+
25
+ 1. **Bestehende Issues prüfen** — `glab issue list -F json` + `git log --oneline -10`
26
+ 2. **Scope analysieren** — Bei Zweifel aufteilen!
27
+ 3. **User-Intent verstehen** — Fragen stellen (normal im Chat)
28
+ 4. **Spec schreiben** — User Stories, Acceptance Criteria, Edge Cases
29
+ 5. **GitLab Issue erstellen** via `glab issue create`
30
+
31
+ ## Workflow
32
+
33
+ ### 1. Vorbereitung
34
+ ```bash
35
+ glab issue list -F json # Welche Issues existieren bereits?
36
+ git log --oneline -10 # Was wurde zuletzt implementiert?
37
+ ```
38
+
39
+ ### 2. Fragen stellen
40
+ Kläre im Chat (nicht mit AskUserQuestion):
41
+ - Was ist das Ziel des Features?
42
+ - Wer nutzt es? (main.py, Tests, CLI?)
43
+ - Was sind die wichtigsten Edge Cases?
44
+ - Welche Abhängigkeiten zu anderen Features?
45
+
46
+ ### 3. Feature Spec schreiben und Issue erstellen
47
+
48
+ Die Issue-Nummer wird automatisch von GitLab vergeben.
49
+
50
+ ## Output-Format (GitLab Issue)
51
+
52
+ ```bash
53
+ glab issue create \
54
+ --title "Feature-Name" \
55
+ --description "$(cat <<'EOF'
56
+ ## Beschreibung
57
+ Kurze Erklärung was das Feature macht und warum.
58
+
59
+ ## User Stories
60
+ - Als [Rolle] möchte ich [Aktion] um [Ziel]
61
+
62
+ ## Acceptance Criteria
63
+ - [ ] Kriterium 1 (testbar mit pytest)
64
+ - [ ] Kriterium 2
65
+
66
+ ## Edge Cases
67
+ - Was passiert bei leerem Input?
68
+ - Was passiert bei ungültigem Format?
69
+ - Wie werden Fehler gehandhabt?
70
+
71
+ ## Technische Anforderungen
72
+ - Eingabe: [Format/Typ]
73
+ - Ausgabe: [Format/Typ]
74
+ - Dependencies: [Python-Packages]
75
+
76
+ ## Abhängigkeiten
77
+ - Benötigt: #N (Name) — warum
78
+ EOF
79
+ )" \
80
+ --label "needs-triage"
81
+ ```
82
+
83
+ ## Wichtige Regeln
84
+
85
+ - **Niemals Code schreiben** — das macht der Python Developer
86
+ - **Niemals Tech-Design** — das macht der Solution Architect
87
+ - **Fokus: WAS** soll das Feature tun? (nicht wie)
88
+ - **Acceptance Criteria müssen pytest-testbar sein**
89
+
90
+ ## Vor Abschluss
91
+
92
+ - [ ] User Stories komplett (min. 2-3)?
93
+ - [ ] Alle Acceptance Criteria pytest-testbar?
94
+ - [ ] Edge Cases dokumentiert?
95
+ - [ ] GitLab Issue erstellt mit Label `needs-triage`?
96
+ - [ ] Issue-Nummer notiert für Übergabe an Solution Architect?