Skip to content

L2 Grid Signal v2.5.5 Stability and Test Fixes#309

Open
dcplatforms wants to merge 1 commit into
mainfrom
jules-297416676816633732-a44149c8
Open

L2 Grid Signal v2.5.5 Stability and Test Fixes#309
dcplatforms wants to merge 1 commit into
mainfrom
jules-297416676816633732-a44149c8

Conversation

@dcplatforms

@dcplatforms dcplatforms commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Resolved critical startup-blocking duplicate declarations of siteIdVal and newSiteSafety, corrected undefined isSiteSafetyLocked ReferenceError, and synchronized test assertions and lock TTL inside services/02-grid-signal microservice, achieving 100% test suite pass rate (53/53 tests green).


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


Note

Medium Risk
Touches dispatch rejection and safety-lock TTL on the OpenADR path; behavior change is intentional (shorter DER locks, distinct rejection reason) but affects grid dispatch when sites are locked.

Overview
Fixes startup-blocking issues in L2 Grid Signal by removing duplicate siteIdVal and newSiteSafety declarations and using isSiteLocked (not isSiteSafetyLocked) when loading site-specific lock context on dispatch rejection.

DER alarm site locks from DER_ALARM_REPORTED now use a 900s TTL (was 1800s), matching other safety locks and tests. Integration/unit tests expect SITE_SAFETY_LOCK_ACTIVE for site-level rejections instead of SAFETY_VIOLATION_L1, and updateLocalSafetyCache tests match the current Redis scan flow. The v2.5.5 weekly report doc is refreshed (test count, release notes).

Reviewed by Cursor Bugbot for commit ef9f560. Configure here.

…ssertions

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 ef9f560. 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 alert type missing in details

Medium Severity

After the site-lock context lookup fix, rejections for DER-driven site locks load site Redis context that stores alarm_type and reason, but the 503 payload still sets details.alert_type from details.event_type only, so DER site rejections can return an empty alert_type even when alarm metadata exists.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ef9f560. 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