Skip to content

Repository files navigation

Constrained Formulation Agent banner

Constrained Formulation Agent

A standard-library Python reference for rule-gated recommendations, explicit review, and traceable outcomes.

Python License Release

目录 / Table of Contents

简体中文

项目简介

本仓库提供强约束推荐流程的文档和最小参考实现。src/rule_gate.py 使用符号化组件演示白名单、允许区间、组件冲突、设备可用性和容量检查。它不包含真实配方、浓度、设备参数,也不是生产级决策引擎。

仓库内容

内容 文件
店厂一体与规则资产流程 workflows.md
评估、匹配、约束与输出 Skill skills.md
受控 Prompt 与解释材料 prompt-engineering.md
产品设计与试点分析 product-design.mddata-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-test

下载与发布

GitHub Release 提供由 GitHub 自动生成的源码 ZIP 和 TAR.GZ。项目目前不发布独立可执行文件;下载源码后即可在受支持的 Python 环境中运行。

使用边界

  • Prompt 不能替代专业规则、授权流程或人工审核。
  • 示例只解释控制流,不构成配方、医疗、合规或生产建议。
  • 真实规则、设备数据、审计记录和批准流程必须由有权限的团队维护。

许可证

本项目采用 MIT License

返回顶部

English

Overview

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.

Repository contents

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

Workflow and architecture

Constrained recommendation workflow

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.

Prerequisites and installation

  • 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 --version

The project runs directly on the Python standard library, so no pip install step is required.

Usage

Run the built-in self-test:

python3 src/rule_gate.py --self-test

Run the example candidate:

python3 src/rule_gate.py

The 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.

Validation

python3 -m compileall -q src
python3 src/rule_gate.py --self-test

Downloads and releases

GitHub 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.

Scope and safety

  • 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.

License

This project is licensed under the MIT License.

Back to top

About

A rule-constrained AI recommendation and production workflow for personalized blockchain services requiring whitelists, human review, traceability, and feedback.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages