|
| 1 | +# PyDevices Design Principles |
| 2 | + |
| 3 | +Org-wide standards that every PyDevices design — module, library, protocol |
| 4 | +surface, or tool — is measured against before it ships. Repo-specific |
| 5 | +conventions live in each repo; these apply everywhere. |
| 6 | + |
| 7 | +## 1. Completeness: no stranded endpoints |
| 8 | + |
| 9 | +> **Any pairing the protocols permit that the design does not deliver is a |
| 10 | +> defect in the design, not a feature request.** |
| 11 | +
|
| 12 | +If two endpoints speak the same protocol, they interoperate — full stop. |
| 13 | +A Bluetooth MIDI controller talks to a USB MIDI synthesizer; a USB DAW |
| 14 | +drives a wireless instrument; every input transport feeds the same event |
| 15 | +system and every MIDI transport the same message model, so the full mesh |
| 16 | +of pairings falls out of the architecture instead of being built pair by |
| 17 | +pair. Nobody reviewing a PyDevices design should ever be able to say |
| 18 | +"well, it *could* do this, but it doesn't." |
| 19 | + |
| 20 | +What this demands in practice: |
| 21 | + |
| 22 | +- **Design for the mesh, not the pair.** Policy — event mapping, message |
| 23 | + models, component graphs — lives once, in a shared layer, with each |
| 24 | + transport or backend a provider beneath it. When routing is the default |
| 25 | + outcome of the architecture, completeness is cheap; when it's a feature |
| 26 | + per pairing, it's already lost. |
| 27 | +- **Deliver what's possible; record what isn't, with the honest reason.** |
| 28 | + Some pairings are closed by silicon, by an upstream stack that doesn't |
| 29 | + exist yet, or by physics. Those exclusions are stated in the design |
| 30 | + document with their cause — "excluded by silicon, not policy" — never |
| 31 | + silently assumed. An undocumented gap is indistinguishable from an |
| 32 | + unfinished design. |
| 33 | +- **Prove it live.** Every claimed pairing is backed by a demonstration a |
| 34 | + stranger could watch. A matrix cell nobody has exercised is a claim, |
| 35 | + not a capability. |
| 36 | + |
| 37 | +This standard was first written down in the `btif` vision (2026-08-31) |
| 38 | +and applies retroactively to everything the organization ships: when a |
| 39 | +gap in an existing surface is found, it is triaged as a defect. |
| 40 | + |
| 41 | +## 2. Portability by tier |
| 42 | + |
| 43 | +Surfaces are as portable as the platforms allow, and honest about where |
| 44 | +they can't be: complete on the primary target, present everywhere it |
| 45 | +makes sense, and translated — not duplicated — where a sibling ecosystem |
| 46 | +already has its own excellent idioms. Exceptions are recorded in the |
| 47 | +design document, not assumed. |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +*New principles are added here when they've been proven in a shipped |
| 52 | +design, not before. Suggest one via |
| 53 | +[Discussions](https://github.com/PyDevices/pydevices/discussions).* |
0 commit comments