Model support
Adding a Blade model
Each model needs its own device checks, captures, tests, and recovery plan.
- Record the identity. Add the model name and number, VID/PID, supported firmware, HID usage, report lengths, and a reliable host check. Never store the laptop serial number.
- Find the read-only interfaces. Exactly one intended interface must match. Reject missing, blocked, ambiguous, or mismatched devices.
- Start with queries. Decode safe identity, thermal, fan, battery, lighting, and firmware reads before testing setters. Include malformed and unknown responses.
- Capture each control. Follow the safe testing guide for every value and power state. Do not copy a fixture from another model because it looks similar.
- Expose only verified controls. Missing evidence means fewer controls, not a guessed default.
- Keep model differences isolated. Reuse names such as performance preset and lighting effect, but keep byte-level differences in the model protocol code.
- Test safety and recovery. Unknown models must receive zero writes. Test reconnect, sleep and resume, service restart, power changes, malformed replies, other controllers, restoration, and long runs.
- Document the result. Add a model-specific protocol table with the exact firmware scope and reviewed core revision.
Suggested code shape
Identity
Stores VID/PID, HID usage, report lengths, product identity, and supported firmware.
Catalog
Contains the reviewed fixtures and typed commands for this model.
Protocol
Builds reports for typed operations and validates every reply.
Capabilities
Returns only the controls supported by the exact device, firmware, queries, and fixtures.
Acceptance checks
- Zero writes to an unknown PID, wrong model identity, wrong usage tuple, wrong feature-report length, or ambiguous matching interface.
- All setters have independent restoration evidence.
- Readback limits are shown clearly.
- Both the UI and service enforce power-source limits.
- Service restart, device reconnect, sleep/resume, and external-controller changes do not cause write loops.
- The diagnostic export remains redacted for the new model.
Core integration map
| Layer | Contributor responsibility | Failure behavior |
| Identity | Add a per-model descriptor for model number, VID/PID, validated BIOS or firmware scope, usage tuples, and exact report lengths. | Any mismatch, missing match, or multiple matching interfaces produces no writable device. |
| Envelope | Reuse a report codec only when status, transaction, class, ID, payload length, checksum, report ID, padding, and terminator behavior are proven identical. | Malformed or semantically unknown responses are rejected, never normalized to a default. |
| Queries | Add typed request builders and command-specific response decoders before depending on a state in policy or UI. | An unavailable or unknown query removes the capability or power-state decision. |
| Setters | Add one semantic action per sanitized fixture, with independent readback or an explicit one-shot-only response contract and restoration evidence. | No raw class/ID/payload API is added; absent evidence means absent capability. |
| Capabilities | Expose the intersection of exact identity, admitted commands, readable state, power constraints, and controller-ownership rules. | The new model can safely support fewer features than an older model. |
| Documentation | Add a model-specific table and the reviewed core revision. Keep response shapes symbolic unless exact bytes are needed to explain the contract. | Docs never authorize a command that core does not already admit. |
Before opening a pull request
- Include sanitized fixtures, decoder tests, negative identity tests, typed integration tests, and an interactive validation summary.
- Document getters and setters separately, including accepted response lengths and value bounds.
- State whether confirmation comes from exact readback, generic state, visual observation, or a one-shot response.
- Link the documentation change and the reviewed
openblade-core revision.
- List unsupported and setter-only behavior.
- Keep raw captures and local logs private.