Skip to content

L2 Grid Signal: Weekly Review and v2.5.6 Upgrade - #318

Open
dcplatforms wants to merge 1 commit into
mainfrom
l2-weekly-sync-v256-july-2026-15150351512972217407
Open

L2 Grid Signal: Weekly Review and v2.5.6 Upgrade#318
dcplatforms wants to merge 1 commit into
mainfrom
l2-weekly-sync-v256-july-2026-15150351512972217407

Conversation

@dcplatforms

@dcplatforms dcplatforms commented Jul 27, 2026

Copy link
Copy Markdown
Owner

This submission accomplishes the recurring L2 Weekly Review for MiGrid Grid Signal (02-grid-signal), upgrading the service to v2.5.6. It resolves critical syntax and reference errors, updates and expands test suites, and compiles the standardized L2 Weekly Engineering Report.


PR created automatically by Jules for task 15150351512972217407 started by @dcplatforms


Note

Medium Risk
Changes sit on the OpenADR event rejection path and safety-cache polling; incorrect lock logic could wrongly allow or block grid dispatch, though the diff is narrowly scoped bug fixes plus test alignment.

Overview
Releases L2 Grid Signal v2.5.6 with bug fixes that blocked reliable startup and site-lock handling on POST /openadr/v3/events, plus the usual weekly engineering report index entry.

Runtime fixes: Removes a duplicate siteIdVal declaration, replaces an invalid isSiteSafetyLocked reference with isSiteLocked when loading per-site Redis lock context, and drops a duplicate newSiteSafety in updateLocalSafetyCache so the safety cache poller can run cleanly.

API behavior: When dispatch is blocked by a site-specific L1 safety lock, rejections now use reason SITE_SAFETY_LOCK_ACTIVE (global/regional locks still use SAFETY_VIOLATION_L1). Health and package.json report version 2.5.6.

Tests & docs: grid_signal.test.js and v2_5_5_logic.test.js expectations are aligned with the new reason code and Redis scan mocks; adds v2_5_6_logic.test.js and L2_WEEKLY_REPORT_V256.md.

Reviewed by Cursor Bugbot for commit a13a0d4. Configure here.

- Upgraded L2 Grid Signal service from v2.5.5 to v2.5.6.
- Fixed a critical duplicate declaration of siteIdVal in the POST /openadr/v3/events endpoint.
- Resolved duplicate declaration of newSiteSafety in the updateLocalSafetyCache background poller.
- Corrected a ReferenceError in the event rejection context by replacing undefined isSiteSafetyLocked with the declared isSiteLocked boolean.
- Modernized and standardized Redis scan mocks and DER alarm TTL assertions in both legacy and modern logic test suites.
- Achieved 100% unit test compliance (57/57 tests green).
- Compiled and registered the L2 Weekly Engineering Report (v2.5.6).

Co-authored-by: dcplatforms <10982057+dcplatforms@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a13a0d4. Configure here.

console.warn(`🚨 [L2] DISPATCH REJECTED: L1 Safety Lock active (Global: ${localSafetyCache.global_safety}, Regional: ${localSafetyCache.regional_safety[isoRegion]}, Site: ${isSiteLocked})`);

// Fetch context if available for richer error response (Redis fallback)
const lockContext = (siteIdVal && isSiteSafetyLocked) ? await redisClient.get(`${SAFETY_LOCK_KEY}:site:${siteIdVal.toUpperCase()}:context`) : await redisClient.get(`${SAFETY_LOCK_KEY}:context`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

DER site lock missing alert

Medium Severity

The 503 response for site-specific safety lock rejections incorrectly sets details.alert_type from event_type. For DER locks, the Redis context uses alarm_type, causing alert_type to be undefined for hardware-driven site locks.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a13a0d4. Configure here.

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