← all branches

feat/powerradar

needs attentionviewing older commit
87f8298 · incrementalPR #327reviewed 2026-07-22 16:59 UTC0H · 1M · 3L · 1I
The branch
Purpose
Add an automatic API-based PowerRadar (Centrica/Panoramic Power) metrics integration replacing the manual CSV path with native 5/15/60-min pull collection.
Goal
Headless OAuth password-grant auth against the /eigw energy-insights-gateway API; no MFA, no browser, no ECS session-runner.
Sub-goals
  • SG-1: Auth + transport engine (OAuth broker, chart-data client, WAF mitigation) — live-verified
  • SG-2: Manifest + catalog + provider enum + ARN registry entry
  • SG-3: Pure chart-to-batu translation (demand←consumption, solar_generation←generation, W passthrough, clip/dedupe/null-skip)
  • SG-4: Metrics handler (§9 multi-granularity, resilient skips, real transport tag) + 18 tests
  • SG-5: CDK stack (secrets-only IAM, Sol-Ark shape) + coordinator invoke-grant
  • SG-6: Live e2e (real device: 191 demand points at 15m/2d, 71 at 1h/3d)
  • SG-7: CLAUDE.md documentation fold-back
The changes (whole branch)
What
This incremental window (2 commits, 3 files) reflects a post-merge lockfile reconciliation after merging main. The branch diff vs main shows: new powerradar-api service (engine/auth/translation/handler/tests), integration manifest + catalog registration, secret_configurations provider enum, CDK stack + IAM + coordinator grant. All PowerRadar work was reviewed in prior iterations.
Why
Replaces the manual-CSV powerradar path with a fully headless pull worker that fits the existing Site Collection SFN model. Auth is simpler than planned — a Spring OAuth2 broker password grant returns the Cognito JWT directly with no MFA.
Areas
services/metrics/integrations/powerradar-api+14310packages/integration-manifests+1090packages/database+170infra/cdk+1773domains/core+21.branch+288315
Blast
26 files, ~2287 insertions / ~431 deletions. New standalone service package + manifest registration + CDK stack. No existing service code modified except CDK wiring and DB enum extension.
WAF/bot-detection: CloudFront on powerradar.energy requires browser-like headers; token cached 1h to avoid bursty fingerprint Auth is an unofficial Spring OAuth2 broker endpoint (webapi/webapisecret public client); sanctioned JSON-push Export Jobs alternative documented Exploration worker deferred (metrics-only, Sol-Ark precedent; 31 ER devices provisioned from legacy registry)
typecheck· no CI check results availabletests· no test CI availablecoderabbit· no .coderabbit.yaml

Findings · 4

correctness2

medium

constructs peer dep unsatisfied: 10.4.4 installed, aws-cdk-lib@2.260.0 requires ^10.5.0

infra/cdk/package.json

aws-cdk-lib@2.260.0 declares peerDependencies: { constructs: '^10.5.0' }. infra/cdk/package.json pins ^10.4.2, resolving to 10.4.4. pnpm installs the pair without strict-peer-deps set, so no install-time failure — but if CDK 2.260 calls any constructs API introduced in 10.5.x the failure surfaces as a TypeError at `cdk synth` time. Fix: bump constructs to ^10.5.0 in infra/cdk/package.json and regenerate the lockfile.

low

aws-cdk CLI devDep (^2.213.0) not aligned with aws-cdk-lib (^2.260.0)

infra/cdk/package.json

The devDependency aws-cdk was not bumped alongside the lib upgrade. CDK recommends keeping CLI and lib specifiers on the same minor to avoid cloud-assembly schema mismatches. Bump to ^2.260.0.

conventions1

low

paths.ts findings entry order doesn't match main.ts instantiation order

infra/cdk/src/lib/paths.ts

In paths.ts the service order is: billing → findings → utility (after core). In main.ts the workload-env loop instantiates: billing → findings → core. The orderings are inconsistent. Prior additions (billing, core) were kept in sync across the two files. Low risk but will confuse future readers correlating the two files.

improvement1

info

SSM param findings/sweep-fn-arn has no current consumer

infra/cdk/src/stacks/services/findings/findings-lambda.stack.ts

FindingsSweepFnArnParam writes findings/sweep-fn-arn to SSM, matching the pattern used by billing/metrics stacks whose ARN params feed downstream consumers. No other stack currently reads this param. Benign for now — pre-declares for a planned consumer. Worth a brief TODO comment noting the intended consumer so the dead param doesn't confuse a future reader.

History · 15 commits

  1. f34e4ceneeds attentionincremental0H · 1M · 3L2026-07-23 00:32
  2. 1bc8aedneeds attentionincremental0H · 2M · 3L2026-07-22 21:34
  3. 31e63bbneeds attentionincremental0H · 2M · 5L2026-07-22 20:53
  4. 482cb88safeincremental0H · 0M · 1L2026-07-22 17:56
  5. 9a73b79safeincremental0H · 0M · 0L2026-07-22 17:34
  6. 87f8298needs attentionincremental0H · 1M · 3L2026-07-22 16:59current
  7. 1e80096safeincremental0H · 0M · 1L2026-07-22 16:42
  8. 6ed65b4safeincremental0H · 1M · 3L2026-07-22 00:00
  9. 74a1131needs attentionfull0H · 7M · 12L2026-07-21 19:06
  10. 563252bneeds attentionincremental4H · 9M · 8L2026-07-21 18:32
  11. beced58needs attentionincremental0H · 3M · 3L2026-07-21 01:13
  12. 7fa8684needs attentionincremental4H · 9M · 7L2026-07-20 22:56
  13. 230784fneeds attentionfull2H · 11M · 14L2026-07-10 00:15
  14. b876b54needs attentionincremental2H · 2M · 5L2026-07-08 04:44
  15. ec4847fneeds attentionfull2H · 11M · 8L2026-07-08 03:32