feat: reliability refactor — core/services layout, conformal UQ, MCDM…#1
Merged
Merged
Conversation
…, safe serialization, manifest, CI
Reorganizes the project around reusable modules and adds the reliability,
traceability, and security infrastructure referenced by the new help tab:
Core (CSTRChemIA/core/)
- safe_serialization: JSON + SHA-256 persistence for scalers, removes
pickle from the happy path (mitigates CWE-502)
- data_validation: ValidationReport dataclass, clean_dataset, explicit
bounds/flag checks; replaces silent median imputation with reporting
- model_manifest: ModelManifest dataclass + build/read/write +
verify_integrity for end-to-end artifact auditability (models.json)
- uncertainty: SplitConformalCalibrator (Vovk 2005), MC Dropout
(Gal & Ghahramani 2016), deep ensemble (Lakshminarayanan 2017),
predict_with_interval helper
- feature_engineering: 11 derived features with safe_div / log_clip
- constants, exceptions, i18n, logging, settings, types, units, utils
Optimization
- decision_methods: TOPSIS, VIKOR, PROMETHEE II, knee-point (L1-ASF),
consensus_ranking
- problem_v2: NSGA-II / NSGA-III problem with n_ieq_constr=5 native
constraint handling
Training
- train_xgboost_baseline: per-target XGBoost baseline on engineered features
- train_surrogate: ReduceLROnPlateau + ModelCheckpoint + --seed CLI,
writes manifest entries on completion
Services (CSTRChemIA/services/)
- model_registry (models.json precedence, verify_integrity)
- simulation_service, optimization_service, training_service,
data_file_service
API skeleton (CSTRChemIA/api/): FastAPI app + pydantic schemas for a
future headless deployment mode.
Tests
- CSTRChemIA/tests/: 46 pytest cases over the new core modules
- tests/: service and integration tests (mypy-typed, no TF required)
Tooling & deploy
- pyproject.toml (ruff, mypy, pytest config)
- .github/workflows/ci.yml (lint, typecheck, matrix tests, docker build)
- .pre-commit-config.yaml, .editorconfig, .dockerignore
- Dockerfile + Dockerfile.api + docker-compose.yml
- docs/ARCHITECTURE.md, docs/CONTRIBUTING.md, docs/DEPLOYMENT.md
- Makefile, README.md at repo root
UI
- assets/html_help/index.html rewritten: 20 sections, ~2000 lines,
full coverage of the modules above (sidebar, CSS tokens, callouts)
- layout_TAB.py: dashboard upgrade (Analytics tab, K-means, Hypervolume)
- custom.css: purple-theme refinements
Other
- requirements.txt: add keras-tuner>=1.4.0
- .gitignore: exclude .claude/ working directory
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…, safe serialization, manifest, CI
Reorganizes the project around reusable modules and adds the reliability, traceability, and security infrastructure referenced by the new help tab:
Core (CSTRChemIA/core/)
Optimization
Training
Services (CSTRChemIA/services/)
API skeleton (CSTRChemIA/api/): FastAPI app + pydantic schemas for a future headless deployment mode.
Tests
Tooling & deploy
UI
Other