Skip to content

feat: add connected Grinder domain and API (#889) - #896

Open
ODevStudio wants to merge 3 commits into
mainfrom
odev/issue-889-connected-grinder
Open

ODevStudio wants to merge 3 commits into
mainfrom
odev/issue-889-connected-grinder

Conversation

@ODevStudio

@ODevStudio ODevStudio commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add the transport-independent GrinderDevice domain and one selected connected grinder, using the existing plugin session/readiness lifecycle for both BLE-backed and network-created devices.
  • Add capability-gated operations, strict typed snapshots, generic device connection handling, and preferredGrinderDeviceId settings/backup support.
  • Add singular connected-grinder REST routes and a controller-bound snapshot WebSocket that survives disconnect/replacement; update API specs and documentation.
  • Cover both plugin paths with a shared contract suite and regressions for disconnect targeting, pending connection cancellation, snapshot adoption, and stale teardown completion.

Linked Issue

Fixes #889

Part of #890 (0.9.0 execution tracker): implements P0 release gate 2, the connected Grinder domain/API. The other release gates remain separate work.

Verification

  • flutter analyze: no issues found.
  • flutter test: 4,333 passed, 1 skipped.
  • Shared fake BLE/network Grinder contracts cover readiness, capabilities, sessions, inventory, generic connection, REST, and WebSocket replacement.
  • Running Windows app in simulated mode: inventory, connect, info/state, start/stop, setting, RPM, and disconnect returned expected responses; info returned 503 after disconnect.
  • The same live WebSocket stayed open across plugin v1-to-v2 replacement and resumed with the replacement's snapshot (5 to 7 frames).
  • Windows smoke used the installed VS2022/CMake 3.28 build toolchain because Flutter selected an older CMake 3.20 installation incompatible with Firebase's CMake 3.22 minimum. No tracked build configuration was changed for the workaround.
  • git diff --check: clean. Temporary smoke plugin and runtime processes were removed. No physical grinder was required.

Impact

  • Adds /api/v1/grinder/info, /api/v1/grinder/state, state start/stop PUTs, setting/RPM PUTs, and /ws/v1/grinder/snapshot.
  • Runtime deviceId and preferredGrinderDeviceId remain separate from persisted Grinder UUIDs and workflow grinderId. Existing plural /api/v1/grinders CRUD and the persisted Grinder model are unchanged.
  • Uses existing generation/session fencing and transport permission boundaries. Unknown/vendor snapshot fields and unsupported controls are rejected.
  • Includes no production drivers, presets, workflow synchronization, multiple selected grinders, or new scanner/reconnect scheduler. No database migration or new dependency.
  • Design rationale is archived in doc/plans/archive/connected-grinder/design.md; the temporary implementation plan was removed.

Contributor Responsibility

AI-assisted development is allowed. The submitter remains responsible for the submitted work. This draft leaves the personal attestation below for the human submitter to confirm.

  • I have reviewed and understand all changes in this PR and take responsibility for their correctness, security, behavior, licensing, and provenance, including any AI-assisted or AI-generated work.

Implement #889 using the existing plugin runtime for BLE and network grinders. Keep runtime identity separate from persisted equipment and verify session-safe controller, REST, and WebSocket behavior.
@ODevStudio
ODevStudio marked this pull request as ready for review September 17, 2026 18:58

This branch has not been deployed

No deployments
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.

Define connected Grinder domain and API for generic driver runtime v2

1 participant