Skip to content

feat(control): what happened, from the box's control journal - #118

Merged
frahlg merged 3 commits into
mainfrom
feat/control-journal
Nov 8, 2026
Merged

frahlg merged 3 commits into
mainfrom
feat/control-journal

Conversation

@frahlg

@frahlg frahlg commented Nov 8, 2026

Copy link
Copy Markdown
Member

Problem

FTW Core gained a control journal (srcfl/ftw#1982) so a warning can be explained after it has passed, and new control-feedback reasons (srcfl/ftw#1537, #1905, #1980). The web client had no words for several of them and nothing that showed the journal. On 8 November 2026 the owner's app warned that FTW was not in control (ordered 4.2 kW, delivered 1.2 kW) and afterwards nothing showed it.

Change

  • Words. control-feedback.js is vendored from the box; re-copied from srcfl/ftw@452ce620 with its digest re-recorded. That adds load_balancer_limit, charger_pilot_limit (with pilot_a, dynamic_limit_a), import_limit, one_phase and vehicle_declined. A test covers all 47 reasons Core emits.
  • What happened. The battery, solar and charger sheets show the home's warnings and alarms from the box's journal for the last 24 hours, ported from the iOS sheet: the time, the device, the live row's words, and "Asked for 4.2 kW charge, delivered 1.2 kW on average". A box without the journal (E_UNKNOWN_OP or 404) shows nothing and stops asking. It rereads every 30 s while a sheet is open and stays out of the launch chunk.
  • Simulator serves the journal and control_feedback rows.

Evidence

  • npm run verify exits 0: 1262 passed, 2 skipped; stats 48 passed. Entry bundle 83,050 of 90,000 bytes gzip. Registry and tokens match srcfl/ftw master's copies.
  • Headless Chromium against vite: no console errors. Battery and charger sheets checked in light and dark, on a phone width.

Paired with srcfl/ftw#1982 (merged) and srcfl/ftw-app#166.

🤖 Generated with Claude Code

frahlg and others added 2 commits November 8, 2026 09:05
Copy web/control-feedback.js from srcfl/ftw@452ce620 and record its
digest. The app gains load_balancer_limit, charger_pilot_limit with
pilot_a and dynamic_limit_a, import_limit, one_phase and vehicle_declined.
Core reports vehicle_not_requesting as following again, and the words
follow it. A test checks that every reason Core can emit has a sentence.

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The battery, solar and charger sheets now list the box's warnings,
alarms and notices from the last 24 hours, newest first, read from GET
/api/control/journal over the session. Each line has its time range, its
device, the live row's words and what was asked and delivered, as on the
iPhone. A box without the journal shows nothing, and the list stays out
of the launch chunk. The simulator serves one morning of the journal and
a control_feedback row for each device, so the demo shows both.

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T08:16:05.381660Z b978f67 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ftw-webapp addddbf Commit Preview URL

Branch Preview URL
Nov 08 2026, 08:17 AM

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b978f67bee

ℹ️ 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".

Comment thread src/lib/format/control-journal.ts Outdated
Comment on lines +153 to +154
if (DISPATCH_REASONS.has(span.reason) && blocks.some((b) => b.reason === span.reason && overlaps(b, span, nowMs))) return false
return !(span.reason === 'telemetry_stale' && quiet.some((q) => q.driver === span.driver && overlaps(q, span, nowMs)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require full time coverage before suppressing device warnings

When a device's telemetry_stale span extends beyond an overlapping source outage, this filter removes the entire device warning, including the period the source span does not explain. For example, a completed source outage overlapping an ongoing charger no_contact span produces only the historical “was not reporting” entry and hides the ongoing warning. The dispatch deduplication has the same partial-overlap problem. Only suppress spans whose full interval is covered by the replacement entries, or retain their uncovered portions.

Useful? React with 👍 / 👎.

A device line was dropped on any overlap with a dispatch block or a quiet
source. It now goes only when the block held for all of it, give or take
two samples, as on iOS. The list stops asking while the tab is hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@frahlg
frahlg merged commit 9cfbee4 into main Nov 8, 2026
3 checks passed
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