Skip to content

M4 Energy and cloud clients, part B - #35

Merged
Bre77 merged 9 commits into
milestone/m4a-cloud-clientsfrom
milestone/m4b-energy
Nov 2, 2026
Merged

Bre77 merged 9 commits into
milestone/m4a-cloud-clientsfrom
milestone/m4b-energy

Conversation

@Bre77

@Bre77 Bre77 commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

M4 part B, stacked on milestone/m2-core-client.

Issues

Issue Commit subject Acceptance
ENG-11 PW-2 repin tesla-protocol to ~6.1.0 Done. tsc clean, priority 2^64 - 1 decodes, signed suites pass.
ENG-26 NRG-1 bound energy site REST parity Done. Verb, path, keys and envelope are tested per method.
ENG-43 NRG-2 EnergyDeviceSigner, signed transport Done. Reproduces EXPECTED_SIGNED_REQUEST, nine envelopes and one 30 s message from Python's signer. Non-RSA raises TypeError, no retry, device errors in HTTP 200 raise.
ENG-52 NRG-3 energy device commands Done.
ENG-55 NRG-4 dispatch and island mode, cloud path Done. Mocked tests only. Island commands go straight to _signed_command.
ENG-56 TLM-4 TeslemetryEnergySite, parsers Done.
ENG-59 TLM-5 wait_until_paired Done, on fake timers.

For review

  • No parent key fallback. As in Python's EnergySite, an omitted private_key means unsigned. Nothing reads the parent's rsa_private_key, and there is no false sentinel.
  • wait_until_paired options are milliseconds: timeout_ms and poll_interval_ms, and DEFAULT_PAIRING_TIMEOUT is 600000 and DEFAULT_PAIRING_POLL_INTERVAL is 5000. Python's are seconds, under the Node rule that times are milliseconds.
  • envelope is stricter than ts-proto: it raises TypeError on a dropped field, a bad timestamp or an unknown enum, matching Python's ParseDict, so a typo is never signed.
  • New file not in the design: src/energyparsers.ts holds the parsers free of protobuf, and src/teslemetryenergy.ts re-exports them, so TLM-4's "imports no protobuf" holds at module level.
  • pnpm-workspace.yaml is temporary. pnpm wrote it during the bump, to exempt 6.1.0 from minimumReleaseAge. Without it, pnpm install --frozen-lockfile passes on CI's pnpm 10 but fails on pnpm 12 with ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION, because pnpm 12's cutoff is 24 hours. Delete the file after 2026-11-03T02:56Z.
  • Validation: validate_dispatch_battery_power also rejects a boolean power, per document 07. Python's math.isfinite(True) passes it.

Not verified

Nothing here ran against a real site or gateway. ENG-52's optional read-only get_system_info was not run.

🤖 Generated with Claude Code

Bre77 and others added 7 commits November 2, 2026 13:15
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-43 / NRG-2)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/ NRG-4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ENG-56 / TLM-4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 56 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 89 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 7977b933-d591-4e6f-88d9-c2f977a2c37a
Commits

Reviewing files that changed from the base of the PR and between 0b51d57 and 609cba6.

Files ignored due to path filters: 1
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 28
  • .changeset/energy-device-commands.md
  • .changeset/energy-device-signer.md
  • .changeset/energy-dispatch-island.md
  • .changeset/energy-site-parity.md
  • .changeset/tesla-protocol-6-1.md
  • .changeset/teslemetry-energy-site.md
  • .changeset/wait-until-paired.md
  • AGENTS.md
  • README.md
  • package.json
  • pnpm-workspace.yaml
  • src/energy.ts
  • src/energyparsers.ts
  • src/energyspecific.ts
  • src/index.ts
  • src/signing/energy.ts
  • src/teslemetry.ts
  • src/teslemetryenergy.ts
  • test/energy-device-commands.test.ts
  • test/energy-dispatch-island.test.ts
  • test/energy-parsers.test.ts
  • test/energy-signed-transport.test.ts
  • test/energy-signing.test.ts
  • test/energy.test.ts
  • test/fixtures/energy-signing.ts
  • test/tesla-protocol.test.ts
  • test/teslemetry-energy.test.ts
  • test/wait-until-paired.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Bre77 and others added 2 commits November 2, 2026 13:30
… / NRG-2)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Bre77
Bre77 changed the base branch from milestone/m2-core-client to milestone/m4a-cloud-clients November 2, 2026 04:28
@Bre77
Bre77 added this pull request to stack #43 November 2, 2026 04:29
@Bre77
Bre77 merged commit 8622e55 into main Nov 2, 2026
4 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.

1 participant