Skip to content

fix(native): verify a bundle that has no worker for this host - #1977

Merged
frahlg merged 1 commit into
masterfrom
energyplan-linux-only-bundle
Nov 6, 2026
Merged

frahlg merged 1 commit into
masterfrom
energyplan-linux-only-bundle

Conversation

@frahlg

@frahlg frahlg commented Nov 6, 2026

Copy link
Copy Markdown
Member

Problem and result

optimizer/native/verify.py skips the worker handshake only on hosts it does
not know. On a known host whose worker the bundle leaves out, it fails before
checking anything else: with a bundle that ships only the two required Linux
workers (darwin-arm64 is already optional in OPTIONAL_PLATFORMS), a Mac
runs make native-solver-check and gets KeyError: 'darwin-arm64'.

The next Energyplan bundle may ship only the required Linux workers. With this
change, a host without its own worker verifies every bundled file and skips
execution. That is what the verifier already does on unsupported hosts.
--host-binary prints nothing there, so make native-solver-test takes its
existing "Native execution tests skipped" branch.

Scope and safety

  • verify.py: one condition changes from host is None to
    host not in manifest["artifacts"]. Bundle integrity, the required-platform
    check and the source boundary are unchanged and still run first.
  • Today's bundle still contains all three workers, so behaviour on every host
    is unchanged until a bundle without the macOS worker lands.
  • README: one sentence on the skip. A changeset is included.
  • No overlap with open PRs touching optimizer/native/.

Verification

  • New test test_linux_only_bundle_skips_execution_on_darwin_host: a Darwin
    arm64 host with a Linux-only bundle. Before the fix it fails with
    KeyError: 'darwin-arm64'. After the fix it passes, the handshake is not
    run, and --host-binary prints nothing.
  • python3 -m unittest discover -s optimizer/native -p verify_test.py:
    13 tests OK.
  • make native-solver-check on linux-arm64: "Verified Energyplan 0.6.0:
    3 platforms; linux-arm64 handshake passed".
  • make verify: vet + test + build clean.

Checklist

  • The change follows VISION.md and one selected scope.
  • I checked overlapping PRs and coordinated shared files/contracts.
  • Relevant checks cover the changed behaviour and failure paths.
  • A human reviewed changed UI in a browser, or no UI changed.
  • A Changeset is included, or the change is exempt.
  • Every commit has a DCO sign-off.

🤖 Generated with Claude Code

verify.py skipped execution only on hosts it does not know. On a known
host whose worker the bundle leaves out, such as macOS when only the
required Linux workers ship, it failed with a KeyError instead of
checking the bundle. It now verifies every file and skips execution on
any host without its own worker; --host-binary prints nothing there, so
make native-solver-test skips the process tests as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T14:17:04.127553Z a2cde01 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@frahlg
frahlg merged commit ec8ce36 into master Nov 6, 2026
20 checks passed
@frahlg frahlg mentioned this pull request Nov 6, 2026
6 tasks done
frahlg added a commit that referenced this pull request Nov 6, 2026
Bundle the worker from srcfl/energyplan 847936a (0.7.0, tag v0.7.0-beta.1)
for linux-arm64 and linux-amd64. The macOS worker is no longer bundled;
#1977 lets verify.py check such a bundle and skip execution on a Mac. The
worker lists demand_elapsed_hours, so Core (#1966) sends it the demand
hour in progress and the day's completed peak in that day's group, and
the native demand test now requires the feature.

The contract describes the feature and the demand-charge fields, each
call's time limit since #1968, the batteries' total recovery rule and
optional reply diagnostics, and it stays identical to Energyplan's copy.
The worker version pins and the README follow. Licenses and forecast
schemas are unchanged; the notices list two more microlp modifications.
Protocol v1 is unchanged.

Signed-off-by: Fredrik Ahlgren <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@frahlg
frahlg deleted the energyplan-linux-only-bundle branch November 11, 2026 09:16
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