A standard-library Python reference for rule-gated recommendations, explicit review, and traceable outcomes.
本仓库提供强约束推荐流程的文档和最小参考实现。src/rule_gate.py 使用符号化组件演示白名单、允许区间、组件冲突、设备可用性和容量检查。它不包含真实配方、浓度、设备参数,也不是生产级决策引擎。
| 内容 | 文件 |
|---|---|
| 店厂一体与规则资产流程 | workflows.md |
| 评估、匹配、约束与输出 Skill | skills.md |
| 受控 Prompt 与解释材料 | prompt-engineering.md |
| 产品设计与试点分析 | product-design.md、data-analysis.md |
| 规则门参考实现 | src/rule_gate.py |
候选输入依次经过白名单、允许区间、冲突、设备状态和容量检查。规则门只输出 APPROVED 或带原因的 REVIEW_REQUIRED,不会绕过人工审查。
- Python 3.10 或更高版本
- 不需要第三方 Python 包
- Git 仅在克隆仓库时需要
git clone https://github.com/ChrysFu/constrained-formulation-agent.git
cd constrained-formulation-agent
python3 --version项目直接使用 Python 标准库运行,因此不需要执行 pip install。
运行内置自检:
python3 src/rule_gate.py --self-test运行示例候选项:
python3 src/rule_gate.py候选项超出白名单或允许区间、触发组件冲突、设备不可用或超过容量时,结果为 REVIEW_REQUIRED;否则为 APPROVED。
python3 -m compileall -q src
python3 src/rule_gate.py --self-testGitHub Release 提供由 GitHub 自动生成的源码 ZIP 和 TAR.GZ。项目目前不发布独立可执行文件;下载源码后即可在受支持的 Python 环境中运行。
- Prompt 不能替代专业规则、授权流程或人工审核。
- 示例只解释控制流,不构成配方、医疗、合规或生产建议。
- 真实规则、设备数据、审计记录和批准流程必须由有权限的团队维护。
本项目采用 MIT License。
This repository provides documentation and a minimal reference implementation for a constrained recommendation workflow. src/rule_gate.py uses symbolic components to demonstrate allowlists, ranges, conflicts, device readiness, and capacity checks. It contains no real formulas, concentrations, device parameters, or production decision engine.
| Content | File |
|---|---|
| Store-to-factory and rule-asset workflow | workflows.md |
| Assessment, matching, constraint, and output Skills | skills.md |
| Controlled prompts and explanation material | prompt-engineering.md |
| Product design and pilot analysis | product-design.md, data-analysis.md |
| Rule-gate reference implementation | src/rule_gate.py |
Candidate input passes through allowlist, range, conflict, device-state, and capacity checks. The rule gate returns only APPROVED or REVIEW_REQUIRED with reasons and never bypasses human review.
- Python 3.10 or later
- No third-party Python packages
- Git is only required when cloning the repository
git clone https://github.com/ChrysFu/constrained-formulation-agent.git
cd constrained-formulation-agent
python3 --versionThe project runs directly on the Python standard library, so no pip install step is required.
Run the built-in self-test:
python3 src/rule_gate.py --self-testRun the example candidate:
python3 src/rule_gate.pyThe result is REVIEW_REQUIRED when a candidate falls outside the allowlist or permitted range, triggers a conflict, exceeds device capacity, or targets an unavailable device. Otherwise it is APPROVED.
python3 -m compileall -q src
python3 src/rule_gate.py --self-testGitHub Releases provides the source ZIP and TAR.GZ archives generated by GitHub. The project does not currently publish a standalone executable; download the source and run it in a supported Python environment.
- Prompts do not replace professional rules, authorization, or human review.
- The example explains control flow and is not formula, medical, compliance, or production advice.
- Authorized teams must maintain real rules, device data, audit records, and approvals.
This project is licensed under the MIT License.