# OIP-0027 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-0006 and OIP-0008
for the shape it encodes and the conventions it follows; the patches are made against the current tree and apply to it
on their own.

| File | What it changes on acceptance |
|---|---|
| [`OIP-0027.md`](OIP-0027.md) | the proposal |
| `patches/spec.patch` | §4.2 rows CompactContext and EvidenceBatch; §6 row for the constrained link; §7.1 row `OBSP-NODE-CONSTRAINED`; new §7.5 with NC-1 to NC-11; `registers/requirements.yaml` regenerated (81 requirements) |
| `patches/registers.patch` | profile `OBSP-NODE-CONSTRAINED` (join, observe, time) in `registers/conformance-profiles.yaml` and `conformance/suite.yaml`; `join` gains `compact-context` and `observe` gains `evidence-batch` in `registers/functions.yaml`; new `registers/compact-keys.yaml` (generated); Makefile target `compact` (own `.PHONY` line, `PROFILES` and `check` untouched) |
| `patches/schemas-fixtures.patch` | new schemas `compact-context` and `evidence-batch`; the profile id added to the `conformance-claim`, `conformance-report` and `participant-manifest` enumerations (inserted after `OBSP-NODE`); CDDL in `schemas/cddl/` (5 files); 4 positive and 28 negative fixtures; example sets `conformance/examples/OBSP-NODE-CONSTRAINED/` and `conformance/examples/negative/OBSP-NODE-CONSTRAINED/` |
| `patches/cases-invariants.patch` | cases CT-NODE-140 to CT-NODE-148; `sdk/python/src/obsp/compact.py` (deterministic CBOR, Ed25519, key tables and converter, expansion, evidence batch, SenML), `compact_gen.py` (generator and checker of the vectors, examples and fixtures), `constrained.py` (five invariants), merged into the runner's table by `conformance.py` after `run_case`; 41 unit tests in `sdk/python/tests/test_compact.py` and 21 in `tests/test_compact_profile.py` |
| `patches/vectors.patch` | `conformance/vectors/compact/` (messages, batch, round trip, SenML, two contexts), computed by `python3 -m obsp.compact gen-all` |

Apply the patches in the order of the table, all five before `make check` (each applies to the current tree on its own;
the registers refer to the schemas, cases and vectors). Acceptance removes `patches/`.

The vectors, examples, fixtures and `registers/compact-keys.yaml` are generated and compared: `python3 -m obsp.compact
gen-all` writes them, `make compact` checks them and runs the profile's example sets. Neither command needs a
dependency beyond the repository's own.

Interplay with the other drafts. Each draft's patches apply to the current tree on their own, and so do these. With
these applied, other drafts' patches fail where they edit the same anchors, which is inherent to adding a profile or a
specification section:

- `spec.patch` inserts §7.5 before "## 8. Security model" and a row in each of the §4.2, §6 and §7.1 tables, where
  OIP-0010 to OIP-0013 and OIP-0017 also insert; the proposal accepted second is rebased by hand (the section number
  7.5 is free today; the others use 7.3 and 7.4);
- `registers/requirements.yaml` is generated: the proposal accepted second regenerates it with
  `python3 tools/requirements.py`;
- the three profile enumerations: this proposal inserts its id after `OBSP-NODE`, not at the end of the list, so it does
  not collide with drafts that append;
- `registers.patch` and `conformance.py` change lines that other profile drafts also change (the merge of invariants
  after `run_case`, the profile list of `conformance/suite.yaml`).

`registers/implements-edges.json` is unchanged (the relation rows to add are listed in the proposal).

## On acceptance after the drafts it builds on

Once OIP-0008's algorithm register is in the tree, `evidence-batch` joins object class `observation` as
`signatureMember: planned`: `gatewaySignature` is the COSE_Sign1 of the compact form, not yet the envelope, and a later
proposal moves it there. The 0.5 integration series does this at step 28.

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