Skip to content

Preserve setpoints and embryo positions#26

Open
ceej640 wants to merge 4 commits into
gently-project:developmentfrom
ceej640:ceej/fix-state-persistence
Open

Preserve setpoints and embryo positions#26
ceej640 wants to merge 4 commits into
gently-project:developmentfrom
ceej640:ceej/fix-state-persistence

Conversation

@ceej640

@ceej640 ceej640 commented May 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • update non-blocking temperature setpoint commands so read() and /api/temperature/set report the commanded setpoint immediately
  • preserve explicit position_coarse and position_fine when saving, resuming, and writing acquisition metadata
  • handle FileStore embryo calibration records whether calibration is already a dict or serialized JSON
  • add regression tests for temperature setpoint reporting and coarse/fine session persistence

Stacking

This branch is stacked on #23 so the full suite can collect. Once #23 merges into 0.22-dev, this PR should reduce to the state-persistence commit.

Verification

  • uv run pytest tests/test_session_manager.py tests/test_temperature_controller.py -q
  • uv run pytest -q
    • 558 passed, 4 skipped

@pskeshu

pskeshu commented Jun 1, 2026 via email

Copy link
Copy Markdown
Collaborator

@ceej640

ceej640 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

Yes, that is the right integration test, but I cannot run it from this environment unless the MQTT digital twin endpoint, topic schema, and credentials are available.

The current PR only tests the controller contract locally: after a non-blocking setpoint command, read() and the API report the commanded setpoint immediately. It does not prove the MQTT transport or Roland thermostat twin behavior.

A good follow-up would be a skipped-by-default integration test, gated behind something like --run-mqtt-digital-twin and environment variables for broker URL/topics. The test should:

  • connect to the thermostat digital twin
  • issue a temperature setpoint through the same Gently path used at runtime
  • verify the commanded setpoint is reflected immediately
  • observe the twin's reported state converge, or time out cleanly
  • verify the setpoint survives session save/resume metadata paths

That should stay out of the default suite, but it would be the right confirmation before relying on this against the real hardware-facing path.

@ceej640

ceej640 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

Follow-up implemented from this thread in commit df8dd77.

I added an opt-in MQTT thermostat digital-twin test hook. It is skipped by default and runs only when GENTLY_MQTT_THERMOSTAT_CONFIG is supplied as JSON or a config-file path. The test commands the same non-blocking setpoint path, verifies immediate setpoint readback, then waits for convergence or lock from the digital twin.

I could not run it against Roland's actual MQTT twin here because I do not have the endpoint/topic/credential config, but the test hook is now present.

Verification:

  • pytest tests/test_temperature_controller.py -q -p no:cacheprovider

@ceej640

ceej640 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

Follow-up added for the MQTT thermostat digital-twin request in commit dfdfc98.

What changed:

  • Added docs/mqtt-thermostat-digital-twin.md documenting the opt-in test hook configuration, topic expectations, run command, and the pass/fail contract.
  • The doc makes explicit that the default suite remains offline, and the MQTT test runs only when GENTLY_MQTT_THERMOSTAT_CONFIG is supplied.
  • It also states what I still could not verify here: Roland's actual MQTT broker endpoint, topics, and credentials were not available in this environment.

Verification:

  • pytest tests/test_temperature_controller.py -q -p no:cacheprovider

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