← all branches

feat/int-base

safeviewing older commit
2ed62f4 · incrementalPR #268reviewed 2026-07-13 04:13 UTC0H · 0M · 0L · 3I
The branch
Purpose
Land all shared seams 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
feat: device-integrations foundation — manifests, seeds, migration tooling (PR #268)
Sub-goals
  • SG-1: 12 integration manifests + registration (done)
  • SG-2: Catalog seed rows — Makes, Integrations, MetricTypes incl. battery/load (done)
  • SG-3: ARN-seed REGISTRY entries + missing-Lambda tolerance (done)
  • SG-4: CDK paths.ts handler entries for all 12 vendors (done)
  • SG-5: D3 registry-migration script (dry-run first) (done)
  • SG-6: D2 credential-copy script (dry-run first) (done)
  • SG-N: Framework improvements — retire stale manifest co-location guidance (done)
  • SG-7: 1M calendar-month granularity end-to-end (done)
  • SG-8: Canonical multi-gran worker contract docs (done)
  • SG-9: Fix inert coverage clamp (union-based, 1M-safe) (done)
  • SG-10: Consolidation merge — fold 12 brand branches into int-base (done)
  • SG-11: Sync latest main + hoymiles seed credentialFields fix (done)
  • SG-12: Combined validation on the one int-base estate (all 12 brands) (done)
  • SG-13: Review remediation — confirmed Loop C triage findings R1–R6, R12, R14 (done)
  • SG-14: Review 4 Loop-C-uncovered brands (victron/abb/sma/solark) (done)
The changes (whole branch)
What
This incremental commit (2ed62f48) adds: (1) .claude/rules/site-metrics-seam.md — 21-line operational rule documenting the backfill/collection-order inversion hazard in decideRecordMetrics (extend-open sets endedAt < startedAt on older-window collection → clampWindowToCoverage silent read-blackout; two mitigation rules: deep history on its own coarse source, deactivate all streams before a deep-history pass); (2) .branch/scale-notes.md — 69-line SCALE validation record for 20 devices / 4 brands (hoymiles, shelly, huawei, solis) on the feat-int-base preview estate, documenting recent/deep collection results, rate-cap behavior, cross-grain integral spread, disjoint-coverage proof, and dedupe verification.
Why
The inversion hazard was observed live during SG-12 validation (0 rows read while 287 sat in Tinybird, repaired by deleting the inverted coverage row). Documenting it as a seam rule makes it part of the canonical read-path contract so future brand branches and cutover runbooks inherit the guard. The scale-notes capture the empirical evidence supporting SG-7 and SG-9 at realistic device counts.
Areas
services/metrics+1610infra/cdk+410.branch/tools+290packages/integration-manifests+160scripts/metrics+120domains/metrics+120domains/cross-domain+40packages/database+30infra/tinybird+20.claude/rules+20
Blast
288 files changed, +41,176/-130 across the full branch (excluding noise). Largest area: services/metrics (161 files — 12 vendor integration workers). This incremental commit is 2 doc files only.
All 15 SGs complete — branch appears ready for final review SG-14 confirms victron/abb/sma/solark had no prior automated review — Loop C coverage gap now closed Finalize summary known-unreliable — verify via resolve_stream_window pipe (documented in scale-notes)
ci· No CI check results returned for PR #268coderabbit· No .coderabbit.yaml present in this repo

Findings · 3

security1

info

Dev AWS account number visible in scale-notes

.branch/scale-notes.md:3

Line 3 discloses the dev account number (706877673155) and Supabase branch ID (mckgaguxbalrnsmnpccc). These are dev-environment-only identifiers in a private repo with no prod exposure, but worth awareness if the file is shared outside the repo.

improvement2

info

Seam rule could cross-reference the SG-9 code guard

.claude/rules/site-metrics-seam.md:68

The new 'Backfill/collection ORDER' rule explains the inversion hazard and operational procedures but doesn't point to the code defence: the union-based clampWindowToCoverage fix from SG-9 (domains/metrics/src/metric/metric.queries.ts). A brief '(defended at read by clampWindowToCoverage — see SG-9)' cross-reference would complete the picture for future readers.

info

Inversion recovery procedure lacks concrete repair step

.claude/rules/site-metrics-seam.md:75

The rule says 'repaired by deleting the inverted row + re-collecting forward' but doesn't give the SQL or reference a runbook. A future engineer hitting this in production would need to discover the repair independently. Even a one-liner ('DELETE FROM metric_coverages WHERE source_id = ? AND ended_at < started_at') or a pointer to a runbook would reduce incident response time.

History · 11 commits

  1. f7b9554safeincremental0H · 0M · 0L2026-07-13 20:18
  2. 9ca23adneeds attentionincremental0H · 3M · 3L2026-07-13 19:17
  3. 595484fneeds attentionincremental1H · 3M · 7L2026-07-13 04:29
  4. 2ed62f4safeincremental0H · 0M · 0L2026-07-13 04:13current
  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