← all branches

feat/int-base

needs attentionviewing older commit
9ca23ad · incrementalPR #268reviewed 2026-07-13 19:17 UTC0H · 3M · 3L · 2I
The branch
Purpose
Land every shared seam the 12 device-integration ports depend on — manifests, catalog seeds, ARN-seed registry entries, CDK path entries, and legacy-registry/credential migration scripts — so each per-brand branch only touches its own vendor directories.
Goal
Consolidate 12 brand integration branches (hoymiles, shelly, solis, huawei, solark, fronius, apsystems, abb, victron, enphase, sma, powerradar) into a single validated integration base with all shared infrastructure in place.
Sub-goals
  • SG-1: 12 manifests + registration
  • SG-2: Catalog seed rows (Makes, Integrations, MetricTypes)
  • SG-3: ARN-seed REGISTRY entries + missing-Lambda tolerance
  • SG-4: CDK paths.ts handler entries
  • SG-5: D3 registry-migration script
  • SG-6: D2 credential-copy script
  • SG-7: 1M calendar-month granularity end-to-end
  • SG-8: Canonicalize multi-granularity worker contract (docs)
  • SG-9: Fix inert coverage clamp (union-based, 1M-safe)
  • SG-10: Consolidation merge — 12 brand branches into int-base
  • SG-11: Sync origin/main (#291 derivation engine)
  • SG-12: Combined estate validation (12 brands, digit-exact)
  • SG-13: Review remediation — confirmed Loop C findings (R1–R6, R12, R14)
  • SG-14: Review 4 Loop-C-uncovered brands (victron/abb/sma/solark)
The changes (whole branch)
What
These two commits (9ca23ad9, 595484fd) correct a documentation error about SMA tier lineage and consolidate the content of the deleted BILLING_TIER.md into INFRA_DESIGN.md § Granularity tiers. The core correction: the prior note mis-grouped 1h with the energy counters (1h/1d/1M); the correct split is {5m,1h} power vs {1d,1M} counter. The divergence figure was also refined from ~+20% to +17…+20% based on PINELLI probe data.
Why
A previous Loop C review (SG-14) identified the tier-lineage grouping error. This corrects the record before the billing engine is built, since billing-time authority depends on understanding which series is which.
Areas
services/metrics+3266332infra/cdk+29523packages/integration-manifests+12346scripts/metrics+20590domains/metrics+63640domains/cross-domain+9610packages/database+27616
Blast
291 files, +41,330/−130 lines across services/metrics (12 brand workers), infra/cdk (paths), packages/integration-manifests (12 manifests), scripts/metrics (D2/D3 migration scripts), domains/metrics (coverage clamp + 1M transforms). This incremental review covers 4 files, all doc/comment-only changes.
1h live-parity pending vendor Day/Week endpoint recovery
typecheck· no CI checks available on this PRtests· no CI checks available on this PRcoderabbit· no .coderabbit.yaml in repo

Findings · 8

correctness2

medium

5m 'our transform' cell describes consumer kWh formula, not worker passthrough-W output

services/metrics/integrations/sma/INFRA_DESIGN.md

The new Granularity tiers table lists '5m our transform' as 'Σ W×300/3.6e6' — that is the kWh energy integral a downstream consumer (SiteMetrics read path) computes, not what the SMA worker emits. The worker's actual 5m transform is passthrough W (no scaling), as stated in points-to-batu.ts and CLAUDE.md ('Legacy 5m values are instantaneous W — passthrough, no scaling'). The faithful? column then validates per-day kWh figures derived by the consumer, not emitted by the worker. The footnote partially clarifies this (explaining ×300/3.6e6 ≡ legacy /12000) but the primary cell label is misleading for any reader who stops there. Suggest: '5m: passthrough W (consumer computes Σ W×300/3.6e6 for kWh)'.

info

BILLING_TIER.md deletion is clean — no dangling references remain

services/metrics/integrations/sma/BILLING_TIER.md

The file was deleted and all references in manifest JSDoc and translation JSDoc were updated in the same commit. Search for 'BILLING_TIER' across the repo returns zero results. Consolidation into INFRA_DESIGN.md § Granularity tiers is clean.

security2

medium

Real customer plant ID and facility name committed to docs

services/metrics/integrations/sma/INFRA_DESIGN.md

Plant ID 6862260 and facility name 'PINELLI' (a real production device) appear in the newly-added section, in the file header, and in the probe endpoint URL (GET /v2/plants/6862260/measurements/sets/...). Combined with the org ID (oid=25) and internal site key (/25/18/2) also present in this branch, an attacker with the SMA API could probe that plant's live data. Risk is low now (private repo) but the ID is permanently in git history — if the repo ever becomes public or a token leaks, this becomes a real vector. Recommend substituting a placeholder (e.g. <plantId>) in the doc and keeping the actual ID in secrets/config. The commit message notes this was explicitly accepted, so flagged here for the reviewer to ratify rather than treating it as a blocker.

low

Production DynamoDB table name in docs

services/metrics/integrations/sma/INFRA_DESIGN.md

The probe provenance note references 'prod-ddb-batu-metrics'. This name already appears in CLAUDE.md (lines 466, 516) so this commit does not introduce new exposure. Consider abstracting to '{env}-ddb-batu-metrics' in new doc sections for consistency.

conventions1

info

Cross-package JSDoc reference uses repo-root-relative path (non-standard, non-navigable by IDE)

packages/integration-manifests/src/manifests/sma.ts

The JSDoc references 'services/metrics/integrations/sma/INFRA_DESIGN.md' as a bare repo-root-relative path. An IDE following relative links would not resolve it. Other manifests in this package use the same convention (e.g. growatt.ts). Functional and consistent with existing practice; no action required unless tooling support for clickable doc links is wanted.

tests3

medium

1h tier marked UNVERIFIED in docs but test suite does not surface the pending live-check gap

services/metrics/integrations/sma/INFRA_DESIGN.md

INFRA_DESIGN.md correctly marks 1h as 'UNVERIFIED — transform trivially loss-free, but 1h is not provisioned for PINELLI and the Week set was vendor-down at probe time.' The points-to-batu.test.ts 1h suite verifies transform mechanics but cannot prove vendor parity. A future maintainer provisioning 1h for a new plant has no in-test signal to run a live spot-check first. Recommend adding a it.todo or @pending-live-verification comment in the 1h describe block, mirroring the pattern hoymiles uses for its cadence mismatch. Low operational risk since 1h is not provisioned on any fleet plant yet, but the gap should close before 1h goes live.

low

5m algebraic equivalence claim (×300/3.6e6 ≡ /12000) has no pinning unit test

services/metrics/integrations/sma/INFRA_DESIGN.md

The table asserts '×300/3.6e6 ≡ legacy /12000 by construction'. This is algebraically trivial (300/3,600,000 = 1/12,000) and since 5m is a passthrough the claim is about read-side accumulation, not a worker transform. No test pins this with a concrete numeric triple. Very low risk since the equivalence is definitional, but a single assertion would make the documented parity reproducibly auditable.

low

Live probe value cited in 1d table row is not reproduced as a regression test

services/metrics/integrations/sma/INFRA_DESIGN.md

The table documents '07-08: 1_762_178 Wh → 73_424.083 W → 1762.178000 kWh' as live evidence for 1d faithfulness. The existing test suite exercises the transform with different values (1,856,293 Wh / 24 h) and DST edges. Adding a single test case with the exact probe triple would pin the live measurement as a reproducible regression baseline.

History · 11 commits

  1. f7b9554safeincremental0H · 0M · 0L2026-07-13 20:18
  2. 9ca23adneeds attentionincremental0H · 3M · 3L2026-07-13 19:17current
  3. 595484fneeds attentionincremental1H · 3M · 7L2026-07-13 04:29
  4. 2ed62f4safeincremental0H · 0M · 0L2026-07-13 04:13
  5. 2812f54needs attentionincremental1H · 3M · 10L2026-07-11 00:19
  6. 1794b23needs attentionincremental2H · 2M · 5L2026-07-10 21:59
  7. e5674dcneeds attentionincremental3H · 7M · 6L2026-07-09 19:29
  8. ca45a96needs attentionincremental0H · 3M · 3L2026-07-09 18:56
  9. 5d19484safeincremental0H · 0M · 1L2026-07-08 02:04
  10. dd403feneeds attentionincremental12H · 22M · 12L2026-07-07 20:02
  11. e663ae9needs attentionincremental2H · 7M · 7L2026-07-07 19:02