# OIP-0022 draft folder

The proposal and, under `patches/`, the exact edits acceptance would make. Nothing here changes the protocol until the
editors accept the proposal and its patches are applied in the same change. The proposal requires OIP-0007 and OIP-0019;
the patches are made against the current tree, vendor neither draft and apply to the tree on their own (acceptance order
in the proposal).

| File | What it changes on acceptance |
|---|---|
| [`OIP-0022.md`](OIP-0022.md) | the proposal |
| `patches/spec.patch` | §5.5: one bullet after the section's first sentence naming the six bindings (no key word, so no requirement id changes) |
| `patches/bindings-common.patch` | the demo-binding helper of `tests/test_validate.py` made independent of the shipped bindings |
| `patches/bindings-lwm2m.patch` | `bindings/lwm2m/` (profile, manifest, `mapping.yaml` with the IPSO object, SenML unit, scale and CBOR label tables, `connector-mapping.json`, five positive and four negative examples), `tests/test_lwm2m_binding.py` |
| `patches/bindings-modbus.patch` | `bindings/modbus/` (profile, manifest, `mapping.yaml` with the register map, `register-map.schema.json`, `connector-mapping.json`, four positive and four negative examples), `tests/test_modbus_binding.py` |
| `patches/bindings-fdsn.patch` | `bindings/fdsn/` (profile, manifest, `mapping.yaml` with the miniSEED 3 header, flag and encoding tables, `connector-mapping.json`, the example StationXML document, five positive and four negative examples), `tests/test_fdsn_binding.py` |
| `patches/bindings-ais-adsb.patch` | `bindings/ais-adsb/` (profile, manifest, `mapping.yaml` with the AIS and extended squitter field and uncertainty tables, `connector-mapping.json`, five positive and four negative examples), `tests/test_ais_adsb_binding.py` |
| `patches/bindings-ccsds.patch` | `bindings/ccsds/` (profile, manifest, `mapping.yaml` with the primary header, time code and housekeeping layout, `connector-mapping.json`, six positive and four negative examples), `tests/test_ccsds_binding.py` |
| `patches/bindings-camara.patch` | `bindings/camara/` (profile, manifest, `mapping.yaml` with the outcome table, `connector-mapping.json`, five positive and four negative examples), `tests/test_camara_binding.py` |
| `patches/registers.patch` | `relations.yaml`: new rows `EXT-LWM2M`, `EXT-MODBUS`, `EXT-FDSN`, `EXT-AISADSB`, `EXT-CCSDS-SPP`, `EXT-CAMARA` at the end of `external`; `implements-edges.json` regenerated (47 edges); `requirements.yaml` regenerated (the §5.5 requirements gain the six cases) |
| `patches/cases.patch` | cases CT-NODE-100 to CT-NODE-105, one per binding, changed from manual to automated (kind `invariant`): `sdk/python/src/obsp/inv_oip0022.py` registers `binding-replay-<id>` (`obsp.golden.replay`: the implementer supplies the digest of the output its connector produced for each golden example, and the suite compares it with the golden output; a negative example must not give its claimed output), hooked in `conformance.py`; replay evidence for the six bindings in the OBSP-NODE example set and its negative set; `sdk/python/tests/test_inv_oip0022.py`. The attestations of the manual form are gone |

Apply all ten patches together (in any order): the registers name the binding folders, the bindings name the cases.

Overlaps with other drafts (each proposal applies on its own; whichever is accepted second resolves these):

- `registers.patch` regenerates `implements-edges.json` (the `count` line and the edge list) as OIP-0005, OIP-0006,
  OIP-0008, OIP-0009, OIP-0010 to OIP-0013 and OIP-0019 do, and appends to the end of `relations.yaml` as OIP-0005,
  OIP-0019 and others do: append the rows and run `python3 tools/build_edges.py` and `python3 tools/requirements.py`.
  `requirements.yaml` gains case ids in the §5.5 entries that OIP-0019 also extends (union of both lists).
- `EXT-CCSDS-SPP` sits beside OIP-0010's proposed `EXT-CCSDS-CFDP`; no id collides.
- The `tests/test_validate.py` hunk of `bindings-common.patch` is the same text as OIP-0009's and OIP-0019's; the
  second one accepted drops it.
- The spec bullet sits on lines no other draft edits. The invariant module is its own file and is hooked in `conformance.py`
  beside the other drafts' hooks (each is one import and one `INVARIANTS.update`).
- Case ids CT-NODE-100 to CT-NODE-105 are used by no other draft or by the 0.2 integration series.

## What stays manual

Nothing of the six cases is left to attestation. One clause is not shown by documents and is not checked by the suite: that a
Modbus connector issues no write function (CT-NODE-101; a read-only connector has no output to compare). The replay checks the
connector on the golden inputs only; behaviour on other inputs is not tested.

## On acceptance after the drafts it builds on

The binding tests vendor the shared checks on purpose: OIP-0019's helper `tests/connector_golden.py` is not in the
current tree, and each draft's patches must apply and pass on their own. When OIP-0019 is accepted first (the
acceptance order of the integration series), the six tests drop their copies and use `connector_golden.GoldenChecks`
with a mixin `DecoderChecks` (decoder digest, output vocabularies, mapping rows), and the helper's `AMENDMENT` takes this
proposal's schemes, missing-data reason and empty-fields rule. The 0.5 integration series does this at step 23.

Check that every patch still applies to the current tree: `python3 -m unittest tests.test_validate -k draft_patches`.
