Skip to content

test(conformance): expand golden-frame coverage#6

Open
Ameb8 wants to merge 6 commits into
device-context-protocol:devfrom
Ameb8:test/add-golden-frame-tests
Open

test(conformance): expand golden-frame coverage#6
Ameb8 wants to merge 6 commits into
device-context-protocol:devfrom
Ameb8:test/add-golden-frame-tests

Conversation

@Ameb8
Copy link
Copy Markdown

@Ameb8 Ameb8 commented May 21, 2026

What

Expand the DCP conformance golden-frame corpus with additional byte-level fixtures, and tighten the Python conformance runner so that optional UART wire bytes and CRC fields are asserted when present.

This also syncs the conformance README with the current fixture schema and adds the repository PR template to CONTRIBUTING.md.

Why

Downstream ports need more pinned protocol vectors for payload encoding, sequence-number bytes, explicit empty-map bodies, UART wrapping, and CRC behavior. These cases make the conformance corpus a stronger cross-language compatibility target without changing the protocol.

Spec impact

  • No spec impact (just code / docs / tests)
  • Changes wire format, manifest schema, or safety model — see RATIONALE.md
    for what we expect from this kind of change

Checklist

  • Tests added or updated
  • ruff check src tests passes locally
  • pytest passes locally
  • CHANGELOG.md updated under ## [Unreleased] (not updated: conformance test fixtures/docs only)
  • If a public API or CLI changed, the README and docs/RATIONALE.md are
    consistent with the new behavior

Ameb8 and others added 6 commits May 21, 2026 00:39
Add a golden-frame conformance case for a CALL frame whose CBOR body contains an explicit boolean and a short string.

This pins non-numeric scalar encoding byte-for-byte using the `set_enabled` intent with `{enabled: true, label: "ok"}` so ports can verify canonical CBOR output against the corpus.

Co-Authored-By: OpenAI GPT-5.4 <noreply@openai.com>
Add a golden-frame conformance case for a REPLY frame whose payload is encoded as an explicit CBOR empty map.

This complements the existing empty CALL coverage using a reply with `payload: {}` and `cbor_hex: "a0"` so ports verify that explicit empty reply bodies decode the same way.

Co-Authored-By: OpenAI GPT-5.4 <noreply@openai.com>
Add a golden-frame conformance case for an ERROR frame whose CBOR body carries multiple fields.

This extends the current single-field error coverage using the `unknown` intent with `{status: 4, message: "unknown", code: 404}` so ports must preserve the full error map.

Co-Authored-By: OpenAI GPT-5.4 <noreply@openai.com>
Add a golden-frame conformance case for an EVENT frame whose CBOR body contains unsigned integer boundary values.

This pins canonical integer encoding byte-for-byte using the `motion_detected` intent with `{min: 0, max: 255}` so ports verify both single-byte and one-byte-argument unsigned forms.

Co-Authored-By: OpenAI GPT-5.4 <noreply@openai.com>
Add a golden-frame conformance case for a CALL frame whose sequence number uses mixed high and low bytes.

This exercises big-endian sequence encoding using `seq: 0xff01` with the `set_color` intent and `{r: 255, g: 100, b: 0}` so ports cannot accidentally treat sequence bytes as little-endian.

Co-Authored-By: OpenAI GPT-5.4 <noreply@openai.com>
Extend the golden-frame conformance corpus so the optional `uart_wire_hex` and `crc16` fields are exercised by a real fixture instead of documented-only contract text.

Populate both fields on `call with three small ints`, then update the reference conformance runner to assert them when present. This pins the full frame CRC as well as the COBS-wrapped UART bytes emitted by `wrap(...)`, giving ports a concrete byte-for-byte target for framing behavior in addition to the existing header and CBOR-body checks.

Also sync the conformance README to the current `cbor_hex` schema and clarify that `uart_wire_hex` represents wrapped frame+CRC bytes without the trailing delimiter byte.

Co-Authored-By: OpenAI GPT-5.4 <noreply@openai.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.

1 participant