Skip to content

feat(api): add runtime auxiliary scale connections - #862

Merged
tadelv merged 2 commits into
decentespresso:mainfrom
MaxRink:feature/auxiliary-scale-connections
Sep 16, 2026
Merged

tadelv merged 2 commits into
decentespresso:mainfrom
MaxRink:feature/auxiliary-scale-connections

Conversation

@MaxRink

@MaxRink MaxRink commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds runtime-only auxiliary scale connections for issue #833. ScaleController remains the sole primary connection. A new registry owns auxiliary sessions by device ID, including independent snapshots, tare routing, pending/closing reservations, cancellation fencing, and cleanup after delayed connection completion.

Generic connect accepts optional connectionRole: omitted means primary and auxiliary explicitly selects an external auxiliary. Inventory reports local connectionRole. PUT /api/v1/scales/{id}/tare and ws/v1/scales/{id}/snapshot support both primary and auxiliary IDs; legacy singular routes remain primary-only. Bengle’s integrated scale remains the primary scale while explicit external auxiliary discovery and connect remain available. No dosing settings, purposes, endpoints, or persisted role assignment are introduced.

Linked Issue

Related #833.

This change depends on the shared opaque path component boundary from #858. The multi-device Skale consumer is #859; the first-stage single-device driver remains in #846.

Verification

  • Combined Linux Flutter gate for the current publication stack: 4,315 passed, 1 skipped, 0 failed; analyzer clean (48.0s). Source was unchanged during the gate.
  • Runtime passed Bengle’s integrated scale as primary and MockScale as auxiliary, including tare, addressed/raw WebSocket frames, disconnect handling, and unchanged preferences.

Impact

Adds public role-aware connection and per-ID API behavior, OpenAPI/WebSocket specification updates, device-management documentation, and runtime lifecycle state held in memory only. Existing primary ScaleController behavior and legacy primary routes remain compatible. No database migration is required.

Contributor Responsibility

AI-assisted development is allowed. The submitter remains responsible for the submitted work.

  • 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.

@tadelv tadelv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation direction looks sound and matches the architecture agreed on #833: ScaleController remains the only brewing/primary scale owner, auxiliaries are generic runtime-only sessions, the same physical ID cannot occupy both roles, Bengle keeps its integrated primary while allowing explicit external auxiliaries, and the new per-ID routes follow the opaque-ID boundary from #858. I did not find a substantiated code-level blocker in those paths.

There are still repository hard gates that prevent approval:

  1. The required Contributor Responsibility acknowledgement is still unchecked in the PR body. AGENTS.md makes the required PR-template fields a hard pre-PR gate, and the current Contribution policy job fails on exactly this. Because that job fails first, format/analyze/tests/build are currently skipped in GitHub CI.
  2. This is an external contribution (author_association: CONTRIBUTOR), and #833 currently has neither ready-for-agent nor ready-for-human. The contribution-policy workflow requires at least one referenced open issue with one of those labels. Related #833 is a valid reference, but after the acknowledgement is fixed the gate will still reject #833 until a maintainer marks the issue accepted (or the PR references another accepted issue).
  3. #858 has now merged to main, while this branch is still based on the pre-#858 main and carries the #858 stack in its PR diff. Please update the branch onto current main and rerun the checks so CI validates the actual auxiliary-scale change against the dependency that is now canonical.

Once those gates are cleared and the real CI run is green, I do not currently see another change I would require from the implementation.

@tadelv
tadelv force-pushed the feature/auxiliary-scale-connections branch from febec3f to aebf7af Compare September 16, 2026 09:15
@tadelv
tadelv marked this pull request as ready for review September 16, 2026 09:15
@tadelv tadelv closed this Sep 16, 2026
@tadelv tadelv reopened this Sep 16, 2026
@tadelv tadelv added this to the 0.8.7 milestone Sep 16, 2026 — with ChatGPT Codex Connector
@tadelv
tadelv merged commit f181612 into decentespresso:main Sep 16, 2026
8 of 10 checks passed
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.

2 participants