Skip to content

[Case] Domux MCP Server — 智能家居安全 MCP 案例 - #28

Open
Kencoze wants to merge 6 commits into
iflytek:mainfrom
Kencoze:case/domux-mcp-server
Open

[Case] Domux MCP Server — 智能家居安全 MCP 案例#28
Kencoze wants to merge 6 commits into
iflytek:mainfrom
Kencoze:case/domux-mcp-server

Conversation

@Kencoze

@Kencoze Kencoze commented Aug 30, 2026

Copy link
Copy Markdown

Domux MCP Server — 从解析模型升级为智能家居标准能力层

案例概要

把 Domux 从「一个 NL→结构化槽位的解析模型」封装为标准 MCP Server,叠加:

  • Agent 身份认证(四级权限 + 高危二次确认 + 审计日志)
  • 家居风险评分引擎(四维评分)
  • 保险评核 API

关键成果

  • 组件自测: 92/92 断言通过
  • 高危操作拦截: 100% (4/4)
  • 推理合规率: 100% (50/50, Colab T4)
  • 端到端链路: 9 步全通

HF Discussion

https://huggingface.co/iFlytekOpenSource/Domux/discussions/6

复现

pip install -r requirements.txt
python test_server.py
python demo_2035_scenario.py

@FenjuFu

FenjuFu commented Aug 31, 2026

Copy link
Copy Markdown
Member

Reviewed against the HER Hack-Astron #4 acceptance criteria (comment only — winner selection stays with @FenjuFu).

Verified

  • HF Discussion is live and public: https://huggingface.co/iFlytekOpenSource/Domux/discussions/6
  • Self-contained under cases/domux-mcp-server/ (README + preview); no model weights redistributed ✓
  • Evidence scanned — no leaked tokens, API keys, IPs, or personal cache paths; the auth flow uses issued read-only tokens and a MockHA for the demo ✓
  • Account reputation OK — no cross-repo bounty spam ✓

Notes

  • The HF Discussion was opened by emanhk, while this PR is authored by Kencoze. If that's the same person across two handles, no problem — just flagging it for the record.
  • The headline results (92/92 component assertions, 4/4 high-risk interception, 50/50 reasoning compliance on Colab T4) are self-reported from test_server.py / demo_2035_scenario.py. They reproduce from the listed commands but were not independently re-run here.

Valid entry.

@FenjuFu

FenjuFu commented Sep 1, 2026

Copy link
Copy Markdown
Member

复核当前 HEAD 0bfd676 后,暂不能 approve,仍有以下阻塞项:

  1. PR 目前只提交了 README、preview.png 和 preview.txt;README 中的复现命令引用 requirements.txt、test_server.py、auth_middleware.py、home_risk_engine.py、ha_adapter.py、insurance_api.py 和 demo_2035_scenario.py,但这些文件均不在本 PR 中,也没有提供固定 commit 的公开源码链接。因此现有材料无法按文档复现。
  2. “50 次真实推理、格式合规 100%”目前只有四条示例输出和汇总数字,没有提交逐样本原始输出、运行日志或可复核的指标产物。这还不满足 HER Hack-Astron #4|Domux 智能家居真实使用案例挑战赛 #20 对真实运行证据与指标可复核性的要求。
  3. DCO 仍为 ACTION_REQUIRED:ab670ddb、718feb80、0bfd6769 三个提交都没有 Signed-off-by trailer。

请补齐实际可运行的源码与依赖(或提供固定到具体 commit 的公开源码,并确保命令可直接复现)、真实推理原始产物及指标计算材料,同时修复全部提交的 DCO。完成后可再次复审。

Kencoze and others added 4 commits September 3, 2026 01:24
Signed-off-by: Kencoze <Kencoze@users.noreply.github.com>
Signed-off-by: Kencoze <Kencoze@users.noreply.github.com>
Signed-off-by: Kencoze <Kencoze@users.noreply.github.com>
Add all source files (src/) and evidence (evidence/) to enable
full reproduction:
- MCP Server: test_server.py, server.py, backend.py, slots.py
- Auth & Risk: auth_middleware.py, home_risk_engine.py, ha_adapter.py
- Insurance & Demo: insurance_api.py, demo_2035_scenario.py
- Evidence: run logs, 50 inference results, sqlite snapshots

Signed-off-by: Kencoze <Kencoze@users.noreply.github.com>
@Kencoze
Kencoze force-pushed the case/domux-mcp-server branch from 0bfd676 to 9e275dc Compare September 2, 2026 17:25
@Kencoze

Kencoze commented Sep 2, 2026

Copy link
Copy Markdown
Author

Hi @FenjuFu, all three blocking items have been addressed:

  1. Source code added — complete src/ directory with 10 source files (server, auth middleware, risk engine, HA adapter, insurance API, demo scenario, etc.)
  2. Evidence attachedevidence/ directory with 50-inference run log, evaluation result JSON, and multiple sqlite snapshots
  3. DCO signed off — all 4 commits now have Signed-off-by, GitHub DCO check is passing

Please review when you get a chance. Thanks!

@FenjuFu

FenjuFu commented Sep 3, 2026

Copy link
Copy Markdown
Member

复核当前 HEAD 9e275dc。先确认已经解决的部分:源码已补入,DCO 与 CLA 均已通过;我在 Python 3.11 下以 UTF-8 模式复跑了 test_server.py、四个模块自测和 demo_2035_scenario.py,92 项断言及演示链路均能通过。

但对照 #20 的硬性验收标准,目前仍不能 approve,阻塞项如下:

  1. 真实模型运行来源与活动要求冲突。 evidence/domux_eval_result_20260826_204027.jsonmodel 明确写的是 iFlytekOpenSource/Domux (via ModelScope),而案例 frontmatter 写 downloadSource: huggingfaceHER Hack-Astron #4|Domux 智能家居真实使用案例挑战赛 #20 又明确要求从 Hugging Face 下载并运行固定 revision,ModelScope-only 不接受。请从 Hugging Face 固定 revision 实际下载、运行并重新提供产物;不能只修改元数据文字。
  2. 50 次 Transformers 推理仍不可复现。 当前提交没有生成该 JSON 的脚本或 notebook,也没有完整命令;src/backend.py 提供的是 vLLM/OpenAI-compatible JSON 路径,与证据中 transformers 5.8.0 + Gemma4ForConditionalGeneration 的管线和管道分隔输出不是同一条执行路径。请补充实际评测脚本及命令,包含模型加载、chat template/prompt、精度、生成参数、5×10 样本循环、warm-up 口径、延迟统计和格式合规计算。
  3. README 声明的证据文件缺失。 README 链接 evidence/run_logs/ 并声明含多轮 auth.db + insurance.db 快照,作者回复也称已提交多个 sqlite snapshots,但当前 PR 中没有该目录或这些文件。请补齐已脱敏产物,或删除链接并准确说明实际提交的证据范围。
  4. 示例会把授权 Token 写入日志。 insurance_api.py 支持 ?token=,同时 BaseHTTPRequestHandler.log_message() 会记录完整请求目标;本地自测实际输出了完整 ins_... Token。这与 HER Hack-Astron #4|Domux 智能家居真实使用案例挑战赛 #20 的隐私/安全要求及案例的安全叙事冲突。请移除查询参数凭据或在任何日志产生前可靠脱敏,优先只支持 Authorization: Bearer,并增加“日志中不出现 Token”的回归测试。

另有一个可移植性问题:README 的直接复现命令在 Windows 默认 GBK 控制台会因 emoji 触发 UnicodeEncodeError,需设置 UTF-8 模式才能运行。建议去掉控制台 emoji,或在 Windows 步骤中明确设置 UTF-8 并加入测试。

修正以上内容后可再次复审。DCO/CLA 当前无需再处理。

…al script, run_logs evidence

- insurance_api.py: bearer-only auth (no query token), sanitized log_message, add log-no-token regression test (18/18)
- eval/run_eval_transformers.py: reproducible HF fixed-revision eval (5x10, warmup, latency, compliance)
- README: Windows UTF-8 note, eval script command, evidence scope clarification
- evidence/run_logs: multi-run auth.db + insurance.db snapshots (redacted demo data)

Signed-off-by: Kencoze <Kencoze@users.noreply.github.com>
Signed-off-by: Kencoze <Kencoze@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants