PHM Physics Check

io.github.PHM-Audit由 GitHub 账号 PHM-Audit 发布v1.0.1更新于 Nov 6, 2026

Deterministic physics plausibility checks for LLM outputs and robotics data. Offline, stdlib-only.

发布方自己的服务:check.tattoo: tattoo size and placement guide

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

AI 生成的概览

本地 MCP 服务器,对 LLM 文本、单个物理量和机器人数据做确定性的物理合理性检查,返回 PASS/WARN/FAIL 结论。

可以做什么
  • 检查含物理量的自由文本:单位一致性、光速与温度下限、质量/长度/能量非负、概率范围
  • 检查单个数值与单位是否符合物理定律
  • 校验机器人记录:四元数归一化、时间戳合理性、NaN/Inf 数值、单位标注缺失
  • 以结构化违规记录返回 PASS/WARN/FAIL 结论,结果可复现且完全离线
适用场景
当助手生成或审阅带物理量的文本、工程描述或机器人/具身智能数据集,需要一个确定性的合理性把关而非另一个模型的判断时适用。它是轻量的离线子集,并非完整物理引擎。
运行要求
以本地 stdio 进程运行,命令为 python3 -m phm_lite_check.mcp_server;需要 Python 3.8 及以上,无第三方依赖。从 GitHub 仓库或发布版 wheel 安装;无需 API 密钥、账号或网络访问。
安装前请注意
仅包含确定性的离线子集,专有深度检查被排除,文中提到的远程引擎端点并不包含在本包内。结论属于启发式合理性提示,WARN/FAIL 应视为需要人工复核的信号,而非权威物理验证。该包由社区提供,与其提供适配器的框架无隶属关系。

安装

在 SourceWeft 中

  1. 打开 控制台中的 PHM Physics Check,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

phm-lite-check

Deterministic physics plausibility checking for LLM outputs and robotics / embodied-AI datasets. Zero dependencies, pure standard library, Python >= 3.8.

This package is an independent, community-provided library: it is the offline subset of the PHM physical-judgment engine (proprietary core methods are intentionally excluded). A companion plugin (phm-physics-check) is listed on the Dify Marketplace.

Not affiliated with, endorsed by, or sponsored by LangChain, AutoGen, or Dify. Integration adapters are community-provided.

MCP server

This package doubles as a local MCP server (stdio transport). After installing, point your MCP client at:

python3 -m phm_lite_check.mcp_server

Exposing three tools: physics_text_check, physics_quantity_check, robotics_data_check.

What it checks

Text / quantities (check_text, full_check)

  • Dimensional / unit consistency (SI + common units)
  • Universal speed limit (c)
  • Absolute temperature floor (0 K)
  • Non-negativity of mass / length / energy
  • Probability range [0, 1]
  • Kinematic relations (free-fall family, tolerance-checked)
  • Conservation checks (energy / momentum, tolerance-checked)

Robotics records (check_robotics_record)

  • Quaternion normalization (|q| within tolerance of 1.0)
  • Timestamp sanity: monotonicity, duplicates, NaN/Inf, outlier gaps (possible frame loss)
  • NaN / Inf scan over numeric arrays
  • Unit annotation presence for common motion fields

Design guarantees

  • Deterministic: same input -> same output, always reproducible.
  • Zero dependencies: pure standard library; framework adapters import their host lazily.
  • Verdicts: PASS / WARN / FAIL with structured violation records.
  • No network calls: everything runs offline in-process.

NOTE: this package contains only the deterministic offline subset of the PHM physical-judgment engine. Proprietary core methods are intentionally excluded. (Deployment-specific deep checks are available separately via a configurable remote engine endpoint, not included in this package.)

Install

Option A — from the GitHub repo (no package index needed):

bash
pip install git+https://github.com/PHM-Audit/phm-lite-check

Option B — from a Release wheel (faster, no git clone):

bash
pip install https://github.com/PHM-Audit/phm-lite-check/releases/download/v1.0.0/phm_lite_check-1.0.0-py3-none-any.whl

Optional extras (once installed):

bash
pip install "phm-lite-check[langchain]"   # + langchain-core (adapter tests)pip install "phm-lite-check[autogen]"     # + autogen-agentchat

PyPI listing is planned; both options above work today.

Quickstart — library

python
from phm_lite_check import check_text, check_robotics_record
check_text("The drone descends at 450 km/h and confidence is 1.8.")# {"verdict": "FAIL", "violations": [...], ...}
check_robotics_record({    "quaternion": [1.395, 0.0, 0.0, 0.0],   # |q| >> 1 -> FAIL    "timestamps": [0.0, 0.1, 0.05],          # not monotonic -> FAIL    "position": [1.0, 2.0],                  # no unit annotated -> WARN})

Quickstart — LangChain

python
from phm_lite_check.integrations import langchain_tool
tools = langchain_tool.get_langchain_tools()   # 3 @tool callablesagent = create_react_agent(llm, tools)         # your usual wiring

Quickstart — AutoGen (v0.4+)

python
from autogen_agentchat.agents import AssistantAgentfrom phm_lite_check.integrations import autogen_tool
assistant = AssistantAgent(    name="checked_assistant",    model_client=...,                    # your model client    tools=autogen_tool.get_autogen_tools(),)

Tools exposed by both adapters

ToolInputChecks
physics_text_checkfree text with quantitiesunit consistency, limits, probabilities
physics_quantity_checkvalue + unitone quantity against physical law
robotics_data_checkJSON recordquaternions, timestamps, NaN/Inf, units

Tests

bash
pip install -e ".[dev]"pytest tests/ -q

License

MIT

来源:README.md,提交 5e32d2f

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:该软件包类型无法在沙箱中运行。

版本历史

1
  1. v1.0.1最新Nov 6, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Check 集成