Skip to content

feat(appproto): put EV charging on the wire, and let the flow hold still - #830

Merged
frahlg merged 1 commit into
masterfrom
ev-on-the-wire
Aug 5, 2026
Merged

frahlg merged 1 commit into
masterfrom
ev-on-the-wire

Conversation

@frahlg

@frahlg frahlg commented Aug 5, 2026

Copy link
Copy Markdown
Member

Two changes for the FTW app, both small and deliberate.

Field 10: ev_w

The summed charger draw, positive while charging — a charger consumes like
any other load. Frozen in meaning like fields 1–9, conditional in
presence like battery_soc: a site without a charger sends nothing, and
the app draws no EV node rather than a dead one holding an invented zero.
Charger drivers join the app's source table, so their freshness is visible
like everyone else's.

TestFrozenFieldIdsAreFrozen fired exactly as designed and was extended
deliberately, with the date and the reasoning in the test body.

static on <ftw-energy-flow>

The app paints a cached snapshot before it reconnects, and its rule is that
animation is a claim about now — a moving particle says power is flowing
at this moment. The new attribute pauses the CSS animations and never
starts the particle loop, while numbers and colours keep saying what they
said. The box's own dashboard never sets it, so nothing changes there.

The app vendors this component as-is (srcfl/ftw-webapp — "same components,
same views"), which is why the attribute lives upstream rather than in a
fork: one file, two consumers, no drift.

🤖 Generated with Claude Code

…s bucket

Two faults found by running the app's live test against a real box.

The plan killed the session. The optimizer plans 193 fifteen-minute slots,
which encode to ~17 kB; the largest bulk bucket is 16 kB. sendBulk returned
an error, and the uplink treats a handler error as a dead session — so
asking for the plan hung up the box, every time. The plan is now truncated
to the slots that fit, nearest first. The app shows twelve hours; slots two
days out are a guess about a guess.

History was never built. It now serves the app's tile protocol from the
energy ledger: the same geometry, tile ids and FNV-1a etags the app
computes — the reference values in the tests were generated by running the
app's own functions — so both ends meet on identical tiles and unchanged
ones are never resent. Ledger energy becomes mean power per bucket, site
signed: import minus export is the grid, generation negated is PV. A bucket
nothing metered is MISSING on the wire, never zero, and ranges past
retention are named as evicted gaps instead of served as silence.

The capability is advertised only when the provider exists, and a box
without state answers E_UNAVAILABLE scoped to the request — one chart says
"can't right now", the session lives on.

Co-Authored-By: Claude Opus 5 <[email protected]>
@frahlg
frahlg merged commit 836880d into master Aug 5, 2026
13 checks passed
@frahlg
frahlg deleted the ev-on-the-wire branch August 5, 2026 13:25
@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

https://github.com/srcfl/ftw/blob/754f0475d71da3dfae143b7d444bff292c2c3c90/go/internal/appproto/history.go#L231
P2 Badge Clamp evicted history before building tiles

When a 5m query is narrow enough to stay at 5m but falls outside the 30-day detailed retention, the code records a GapEvicted but still builds and sends every planned tile. The ledger can return hourly rollups for those old buckets, and buildTile then places each hourly average into a single 5m slot, so the app can receive misleading sparse 5m samples for a range that was declared evicted; clamp/skip the evicted part before calling buildTile.


https://github.com/srcfl/ftw/blob/754f0475d71da3dfae143b7d444bff292c2c3c90/go/internal/appproto/history.go#L199
P2 Badge Reject oversized history series lists

This validation accepts any non-empty q.Series, including duplicates or unknown names. Because each requested string becomes a full column in every HistChunk and bulk chunks are not split, a small query with roughly 30 repeated short series can produce a chunk over the 16 kB bulk bucket limit; sendBulk then returns an error, and the uplink drops the session instead of returning a request-scoped error. Limit the list to the supported history series and cap its length before planning.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant