Energy WORLD-92921D98

CurisTech

Energy & utilities software for meter reading and usage billing, working incident INC-453 (Ticket TICKET-3887) in #inc-energy.

Meter Rollover → Negative Usage Billing
CWE-190 · Integer Overflow 15-message incident thread 3/3 fail → 3/3 pass execution-verified

Real Slack Data

Incident Thread

A production outage unfolds in real-time through the engineering Slack channel. Every world includes synthetic Slack conversations grounded in the injected bug.

# inc-energy Incident response · 15 messages
GO
Grid Operator
We've got a problem: several meters are showing negative usage for the last billing period. Invoices went out with credits.
BA
Billing Analyst
Can confirm. We have customers calling about invoices that say they used negative energy. That's not a thing.
FT
Field Tech
I'm at one of the sites now. The meter's physical display shows a number that's gone down since last month, so the system read it as 'usage went backwards'.
GO
Grid Operator
It's not just that site. I'm seeing it on at least 15 meters across three regions.
BA
Billing Analyst
We already sent the statements. Legal wants to know how many customers are affected and whether we can reissue.
FT
Field Tech
Mechanically the meter is fine. I checked connections, swapped a test meter, readings still come back lower than the previous one.
BE
Backend Eng
Just joined. What's the current status?
GO
Grid Operator
We're trying to figure out if this is a meter hardware failure or something in our billing data. The numbers are just wrong.
BA
Billing Analyst
So far it's only residential and small commercial, no large industrial. Doesn't make it better.
FT
Field Tech
Some of these meters were read automatically, some manually. Both show the same pattern: this month's read is below last month's.
BE
Backend Eng
Hold on — are these readings all coming in as smaller numbers, or are some of them exactly zero or weird values?
GO
Grid Operator
The common thing is the current reading is lower than the previous reading. Some are a lot lower, like the meter reset to near zero.
FT
Field Tech
I'd say it's a firmware bug in this meter model. We have three different firmware versions though.
BA
Billing Analyst
We need to know if we can trust the previous months' invoices. If those were right, then it's not the meter hardware.
BE
Backend Eng
I pulled the raw readings for the affected accounts. The previous reading is always a large number, and the current reading is a much smaller number. But the small numbers aren't all near zero — they're all over the place.

Mission

Engineering Task

The task an agent is graded on: fix the injected defect so the gating tests pass.

Solvable Targets Bug

Meter Register Rollover Produces Negative Usage

usageDelta() subtracts the previous register reading from the current one with no wraparound handling. When the meter passes its maximum and returns to zero, the delta goes sharply negative, and the billing run either credits the customer or rejects the read. Fix by detecting the wrap and adding the rollover span.

Acceptance Criteria (from the gating tests)

  • Should compute positive usage across a register rollover.
  • Should never report negative usage.
  • Should compute a normal in-period delta.

node --test tests/bug.test.js · 3/3 fail before → 3/3 pass after

Ground Truth

Gold Patch

The exact unified diff that resolves the injected defect, shipped alongside every world so the fix can be verified mechanically.

src/handler.js git apply
diff --git a/src/handler.js b/src/handler.js
--- a/src/handler.js
+++ b/src/handler.js
@@ -1,8 +1,9 @@
 // Enterprise Component: CurisTech | Ticket: TICKET-3887 | Trace: INC-453
 function usageDelta(previousReading, currentReading, meterMax) {
-            // BUG: a mechanical register wraps to zero at meterMax. Subtracting
-            // directly yields a large negative delta for the billing period
-            // that spans the rollover.
-            return currentReading - previousReading;
+            // FIX: detect the wrap and account for the register rolling over.
+            if (currentReading >= previousReading) {
+                return currentReading - previousReading;
+            }
+            return (meterMax - previousReading) + currentReading + 1;
         }
         module.exports = { usageDelta };

Bug Injection

Vulnerable Code

Every world includes deliberately injected bugs in production code. AI agents must find, diagnose, and fix them — just like real incident response.

src/handler.js Bug Injected
// Enterprise Component: CurisTech | Ticket: TICKET-3887 | Trace: INC-453
function usageDelta(previousReading, currentReading, meterMax) {
    // BUG: a mechanical register wraps to zero at meterMax. Subtracting
    // directly yields a large negative delta for the billing period
    // that spans the rollover.
    return currentReading - previousReading;
}
module.exports = { usageDelta };

Bug: usageDelta() doesn't handle register rollover — subtraction goes sharply negative when the meter passes its max and wraps back to zero, so the billing run credits the customer or rejects the read.

src/handler.js Fixed
// Enterprise Component: CurisTech | Ticket: TICKET-3887 | Trace: INC-453
function usageDelta(previousReading, currentReading, meterMax) {
    // FIX: detect the wrap and account for the register rolling over.
    if (currentReading >= previousReading) {
        return currentReading - previousReading;
    }
    return (meterMax - previousReading) + currentReading + 1;
}
module.exports = { usageDelta };

Resolution: Detect the counter wraparound in usageDelta() and add the rollover span, so usage deltas across a meter reset are always positive. 3/3 gating tests pass after the patch.

Editions

From free samples to enterprise-wide deployment. All editions include full Commercial Training License.

Feature Evaluation Research Professional Enterprise
5 Preview Worlds
1,000 Worlds
5,000 Worlds
Full 24,316 Worlds
Commercial License
QA Report
Dataset Updates 6 months 12 months Ongoing
Priority Support
Evaluation
5 worlds · Evaluate quality before you commit.
  • 5 enterprise worlds
  • Sample from all 10 domains
  • All 5 components per world
  • Unrestricted evaluation
Download Free Sample
Professional
5,000 worlds · Built for commercial AI teams.
  • 5,000 enterprise worlds
  • Stratified domain sampling
  • 20,000+ RAG evaluation tasks
  • Full commercial training license
  • Priority support
Request Quote