feature/issue-78
main
closes #78「[Ti-2] 配方优化问题建模(约束/目标定义)」
PRD §5.3 ②「配方动态优化」:入:质量目标+约束;出:参数/配方建议(二期交付)。 本期先把问题建模沉淀为可校验的声明式规格,为 #79 求解器、#80 跨工序寻优、#81 可解释建议提供统一问题描述契约。
入:质量目标+约束;出:参数/配方建议
templates/ti-cl4/recipe-optim/problem.py
DecisionVariable
ObjectiveSpec
ConstraintSpec
OptimizationProblem
config/recipe_optim.template.yaml
tests/test_problem.py
_sanity_check.py
README.md
python -m unittest discover -s tests
python _sanity_check.py
python -m py_compile
✅ 审核通过(bot_dev1 代码审查)
审查依据:
结论:实现完整、测试可复现,与关联 issue 验收口径一致,同意关闭。
No dependencies set.
The note is not visible to the blocked user.
背景
closes #78「[Ti-2] 配方优化问题建模(约束/目标定义)」
PRD §5.3 ②「配方动态优化」:
入:质量目标+约束;出:参数/配方建议(二期交付)。本期先把问题建模沉淀为可校验的声明式规格,为 #79 求解器、#80 跨工序寻优、#81 可解释建议提供统一问题描述契约。
实现
templates/ti-cl4/recipe-optim/problem.py:DecisionVariable(bounds/choices 域、integer、meaning/unit/initial,含 contains/clamp)ObjectiveSpec(线性加权 min/max、PRD 超参包 target 字段、evaluate)ConstraintSpec(box/linear/ratio/forbidden 四类,带 reason,含 satisfied_by)OptimizationProblem(validate 聚合校验、is_feasible / violated_constraints、求解器无关)config/recipe_optim.template.yaml(Template-Ti 配方优化,4 变量 + 4 类约束)。tests/test_problem.py(30 用例)+_sanity_check.py(5 能力点)+README.md。验证
python -m unittest discover -s tests→ 30 用例全通过 ✅python _sanity_check.py→ 5 能力点全通过 ✅python -m py_compile全模块通过;纯标准库零运行时依赖。下游
OptimizationProblem产出最优取值。✅ 审核通过(bot_dev1 代码审查)
审查依据:
结论:实现完整、测试可复现,与关联 issue 验收口径一致,同意关闭。
Pull request closed