← all branches

feat/powerradar

needs attentionviewing older commit
1bc8aed · incrementalPR #327reviewed 2026-07-22 21:34 UTC0H · 2M · 3L · 3I
The branch
Purpose
Add automatic API-based PowerRadar (Centrica/Panoramic Power) metrics integration replacing the manual-CSV path with native 5/15/60-min collection via the /eigw energy-insights-gateway API.
Goal
Headless pull worker with OAuth password-grant auth (no MFA, no browser); new powerradar-api is a second access path alongside the existing CSV powerradar worker.
Sub-goals
  • SG-1: Auth + transport engine + live probe
  • SG-2: Manifest + catalog + provider enum + ARN REGISTRY
  • SG-3: Pure translation layer + 13 unit tests
  • SG-4: Metrics handler (§9 multi-granularity, resilient skips) + 18 handler tests
  • SG-5: CDK stack + paths + main.ts + coordinator invoke grant
  • SG-6: Live worker e2e (191 demand points, solar correctly skipped on load-only device)
  • SG-7: Framework fold-back
The changes (whole branch)
What
Generalizes heal_param drift-repair bash function from SFN-only to multi-resource-type (S3, DDB, SQS, Lambda, SFN). Adds Phase 1.5 (pdfs-bucket + auth-cache-table), extends Phase 5.5 (batch-pipeline-arn, payment-status-batch-arn, jobs-queue-url), adds Phase 6.5 (zip-generator-fn-arn as Lambda ARN).
Why
Dev-account orphan sweep deleted SSM params while leaving CFN stacks standing — bootstrap failed forever. Previous fix only healed SFN params; this generalizes to all stack-owned param types.
Areas
.github/workflows/preview-provision.yml+5735services/metrics/integrations/powerradar-api+12900packages/integration-manifests+1090packages/database+170infra/cdk+19717domains/core+21
Blast
30 files, ~1970 additions. CI/infra change is the incremental window; PowerRadar integration code landed in prior commits.
CloudFront WAF/bot-detection: engine sends browser-like headers + caches token 1h — proven live Exploration worker deferred (metrics-only, Sol-Ark precedent) Post-merge step required: db:seed:integration-arns --only=powerradar-api + provision ER assets + SFN run + Tinybird verify
ci-checks· No CI check rollup available at review timecoderabbit· No .coderabbit.yaml in repo

Findings · 8

correctness2

medium

lambda-arn kind hardcodes 'us-east-1' — use $AWS_DEFAULT_REGION

.github/workflows/preview-provision.yml:933

ARN constructed as `arn:aws:lambda:us-east-1:${ACCOUNT_ID}:function:${phys}`. $AWS_DEFAULT_REGION is already set. Use it instead.

medium

awk '$1 ~ "^"p' should be '$1 == p' for exact logical-ID match

.github/workflows/preview-provision.yml:927

Regex startswith risks matching wrong resource if two share a prefix; metacharacters in prefix alter behavior. Use exact match $1 == p.

security3

low

ssm get-parameter errors silently swallowed — ThrottlingException treated as absent

.github/workflows/preview-provision.yml:920

low

$rtype interpolated directly into JMESPath --query string — latent injection point

.github/workflows/preview-provision.yml:925

info

Physical IDs and ARNs printed to GHA logs on heal

.github/workflows/preview-provision.yml:936

conventions1

low

Phase 5.5 group header says 'SFN-stack-owned' but heals from two distinct stacks

.github/workflows/preview-provision.yml:1027

improvement2

info

--overwrite on ssm put-parameter contradicts heal-only contract

.github/workflows/preview-provision.yml:935

info

Phase 1.5 / 5.5 / 6.5 suffix proliferation

.github/workflows/preview-provision.yml:962

History · 15 commits

  1. f34e4ceneeds attentionincremental0H · 1M · 3L2026-07-23 00:32
  2. 1bc8aedneeds attentionincremental0H · 2M · 3L2026-07-22 21:34current
  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:59
  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