Skip to content

v0.3.1 — string pattern + max_length, empirical study

Latest

Choose a tag to compare

@WaylandYang WaylandYang released this 23 May 18:00
· 11 commits to main since this release

What's new

Param gains string constraints (pattern, max_length)

intents:
  - name: set_label
    params:
      text:
        type: string
        max_length: 64
        pattern: '[A-Za-z0-9 .,!?-]+'

Both optional, backwards-compatible. Enforced at the Bridge in dcp.safety.check_call; violations surface as range reply status on the wire.

Why this matters

An empirical adversarial-prompt study (see paper §3, tools/gen_llm_corpus.py) fed 295 real tool calls from DeepSeek V3 and Qwen 2.5-72B through every protocol's host-side validator. The study exposed a prompt-injection gap: DCP let every label payload through because there was no pattern field to declare. v0.3.1 closes that gap — DCP now ties OpenAPI at 50% prompt-injection rejection, matching its expressiveness at ~1/1000 the runtime footprint.

Bug fixes

  • examples/smart_panel_manifest.yaml: play_tone.duration was type: duration, which the safety layer coerces to float and the firmware reads with read_int() → every call returned range. Now type: int with unit: ms.
  • LILYGO T-Panel S3 bring-up (firmware/esp32/examples/smart_panel): GPIO 19 → 38 for the buzzer (GPIO 19 is ESP32-S3 USB D-), Wire clock 800 → 400 kHz for XL9535 compatibility, TouchLib CST3240 model define added.

New tools

  • tools/gen_llm_corpus.py — adversarial prompt → real LLM → captured tool calls
  • tools/bench_hallucination_empirical.py — corpus → 4-protocol rejection rates → JSON for paper figure
  • tools/bench_latency_iotmcp.py + firmware/esp32/examples/iotmcp_echo — DCP vs IoT-MCP wire latency on identical hardware (result: 15.60 vs 15.59 ms, within 5 µs)

Paper

docs/paper/dcp-arxiv-v0.3.1.tar.gz (160 KB) — arXiv-ready source bundle with the empirical study and the IoT-MCP A/B latency comparison. See full CHANGELOG for details.


arXiv preprint now live (added 2026-05-27)

The DCP position paper matching this release's source bundle is now published on arXiv:

arXiv:2605.26159 — please cite this version when referring to DCP in academic work. See CITATION.cff for a ready-made BibTeX block, or use:

@misc{yang2026dcp,
  title        = {Device Context Protocol: A Compact, Safety-First Architecture
                  for LLM-Driven Control of Constrained Devices},
  author       = {Yang, Dongxu},
  year         = {2026},
  eprint       = {2605.26159},
  archivePrefix= {arXiv},
  primaryClass = {cs.NI},
  url          = {https://arxiv.org/abs/2605.26159},
}

Discussion on the MCP project: modelcontextprotocol/discussions/2798.