feat/powerradar
needs attentionviewing older commit1bc8aed · incrementalPR #327reviewed 2026-07-22 21:34 UTC0H · 2M · 3L · 3I- 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
- 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+57−35services/metrics/integrations/powerradar-api+1290−0packages/integration-manifests+109−0packages/database+17−0infra/cdk+197−17domains/core+2−1
- Blast
- 30 files, ~1970 additions. CI/infra change is the incremental window; PowerRadar integration code landed in prior commits.
Findings · 8
correctness2
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.
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
ssm get-parameter errors silently swallowed — ThrottlingException treated as absent
.github/workflows/preview-provision.yml:920
$rtype interpolated directly into JMESPath --query string — latent injection point
.github/workflows/preview-provision.yml:925
Physical IDs and ARNs printed to GHA logs on heal
.github/workflows/preview-provision.yml:936
conventions1
Phase 5.5 group header says 'SFN-stack-owned' but heals from two distinct stacks
.github/workflows/preview-provision.yml:1027
improvement2
--overwrite on ssm put-parameter contradicts heal-only contract
.github/workflows/preview-provision.yml:935
Phase 1.5 / 5.5 / 6.5 suffix proliferation
.github/workflows/preview-provision.yml:962
History · 15 commits
- f34e4ceneeds attentionincremental0H · 1M · 3L2026-07-23 00:32
- 1bc8aedneeds attentionincremental0H · 2M · 3L2026-07-22 21:34current
- 31e63bbneeds attentionincremental0H · 2M · 5L2026-07-22 20:53
- 482cb88safeincremental0H · 0M · 1L2026-07-22 17:56
- 9a73b79safeincremental0H · 0M · 0L2026-07-22 17:34
- 87f8298needs attentionincremental0H · 1M · 3L2026-07-22 16:59
- 1e80096safeincremental0H · 0M · 1L2026-07-22 16:42
- 6ed65b4safeincremental0H · 1M · 3L2026-07-22 00:00
- 74a1131needs attentionfull0H · 7M · 12L2026-07-21 19:06
- 563252bneeds attentionincremental4H · 9M · 8L2026-07-21 18:32
- beced58needs attentionincremental0H · 3M · 3L2026-07-21 01:13
- 7fa8684needs attentionincremental4H · 9M · 7L2026-07-20 22:56
- 230784fneeds attentionfull2H · 11M · 14L2026-07-10 00:15
- b876b54needs attentionincremental2H · 2M · 5L2026-07-08 04:44
- ec4847fneeds attentionfull2H · 11M · 8L2026-07-08 03:32