Skip to content

feat(lattice): dispatch durable charge power intents - #4318

Open
mgazza wants to merge 2 commits into
feat/lattice-topology-provenancefrom
feat/lattice-charge-power-dispatcher
Open

feat(lattice): dispatch durable charge power intents#4318
mgazza wants to merge 2 commits into
feat/lattice-topology-provenancefrom
feat/lattice-charge-power-dispatcher

Conversation

@mgazza

@mgazza mgazza commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #4313 at exact commit ea3aa1b1. This adds the first default-off BatPred Lattice write path for battery.charge_power_limit:

  • uses exact provider-local topology provenance (docVersion, node, cap_ref, gw-local)
  • vendors the exact additive 0.3 control/result protobuf contract
  • persists command state before publication
  • correlates and validates terminal ACKs
  • reconciles timeout or UNKNOWN via result/get/<command_id> without another control write
  • permits the legacy setter only after definite NOT_APPLIED
  • fail-closes corrupt/restarted/ambiguous fallback state
  • subscribes to ACKs and routes charge-rate writes through the dispatcher only when both gates are enabled
  • emits structured path/result/fallback telemetry

Current gateway topology fragments remain 0.2; the scalar path accepts supported 0.2/0.3 topology provenance while using the additive 0.3 control wire. The future schedule_intent path will require a 0.3 topology contract.

Both flags default off:

  • lattice_control_enable
  • lattice_charge_power_limit_enable

Safety

  • Lattice and legacy writes are never issued in parallel.
  • UNKNOWN, publish failure, lost ACK, corrupt storage, and an interrupted legacy fallback cannot trigger another write.
  • Provider-local refs are validated before publish; merged or cloud refs never escape.
  • Exact duplicate ACKs are bounded to the active command; conflicting/unrelated ACKs are rejected.

Verification

  • focused dispatcher suite: 14/14
  • existing gateway runner: 246/246
  • pre-commit: all seven changed files pass
  • full quick runner was attempted but its web test cannot bind 0.0.0.0:5052 in the sandbox
  • GitNexus pre-commit scope check completed; affected gateway MQTT run path remains LOW risk

Tracks Predictive-Cloud-Ltd/predbat-saas-infra#552.
Depends on Predictive-Cloud-Ltd/lattice-spec#35 and Predictive-Cloud-Ltd/predbat-gateway#228.

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.

1 participant