Skip to content

feat(setup): complete onboarding from a new box through MCP - #1747

Merged
frahlg merged 3 commits into
masterfrom
codex/mcp-full-onboarding-20261019
Oct 19, 2026
Merged

frahlg merged 3 commits into
masterfrom
codex/mcp-full-onboarding-20261019

Conversation

@frahlg

@frahlg frahlg commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

A new owner can start an empty box in measurement mode, claim it with a house password and continue setup through MCP. The box returns its full configuration schema and missing questions, keeps answers in a resumable draft, and supports explicit discovery, private connection tests and draft-bound MyUplink sign-in. The final control review binds the physical connection to the live meter and requires fresh measurements before restart.

Optional annual electricity and solar inputs improve cold-start estimates without creating history or discarding measured learning. Existing goal requests choose mode, planning style and car departure schedules while equipment control remains blocked. Access shows Cloud consent, pending requests, weekdays and the box time zone. A setup grant never accepts Cloud terms or creates owner access.

Paired with srcfl/ftw-cloud#44; this change uses existing setup.edit actions and introduces no wire or registry change. Minor capability requested by the owner. Keep the release beta and coordinate publication with the active release chat. No live box was updated for this PR.

Validation:

  • make verify: passed.
  • npm test: 864 passed.
  • Race tests for API, onboarding, drivers and load model: passed.
  • Regressions cover first-claim publication and full history open, lost locator recovery, exact revision/grant checks, private OAuth rotation, shared live token protection, secret masking, measurement command blocking, safe defaults and EV stop, annual accounting, whole-load versus separate heating without double counting, prior preservation on model reset and preservation of measured PV/load learning.
  • A real temporary process booted from an empty directory, restarted and accepted the test house password over LAN. A read-only UX agent reviewed the full flow. Browser checks covered desktop, mobile, dark/light settings, LAN login, Cloud-off code blocking and refusal of an unknown fuse rating. The owner inspected and approved all four final rendered views before merge.
  • An isolated Modbus simulator returned fresh measurements for the site meter and hybrid inverter. Connection probes passed; passive protocol logs contained reads only. Final control enablement stayed blocked until the exact saved revision was restarted, then status confirmed it was applied. Hardware verification correctly remained false.

Hardware commissioning and a complete novice trial through two live MCP clients remain beta acceptance work. A driver that needs an undeclared authentication/subscription write may need metadata changes before it can read in measurement mode. Local vendor fixtures do not establish vendor or physical-device support.

@frahlg
frahlg marked this pull request as ready for review October 19, 2026 07:58
@frahlg
frahlg merged commit c22aeb0 into master Oct 19, 2026
23 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T08:04:45.181671Z b9b9398 Draft marked ready
ℹ️ 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.

@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: b9b939850f

ℹ️ 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 go/internal/api/api.go
writeJSON(w, http.StatusUnprocessableEntity, map[string]string{"error": "Keep a positive main fuse while control is active. Save measurement mode, restart, then change unknown connection values."})
return
}
if oldCfg.MeasurementOnly() && !newCfg.MeasurementOnly() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Revalidate meter changes while control remains configured

After a measurement-only configuration is saved with measurement_only=false, the saved config changes immediately even though the runtime remains measurement-only until restart. A second POST /api/config before that restart—or a later edit while control is active—can change the site-meter endpoint or scaling while leaving the flag false, causing this condition to skip SetupControlReady. Since validation binds only the fuse digest and stored hardware identity, the restart can then enable dispatch using a meter configuration that was never measured or commissioned; run the readiness check whenever a control-enabled save changes the site-meter configuration, not only on the boolean transition.

Useful? React with 👍 / 👎.

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