Skip to content

fix(mcp): expose safe measurement reasons and provenance - #43

Merged
frahlg merged 2 commits into
mainfrom
codex/measurement-diagnostics-followup-20261019
Oct 19, 2026
Merged

frahlg merged 2 commits into
mainfrom
codex/measurement-diagnostics-followup-20261019

Conversation

@frahlg

@frahlg frahlg commented Oct 19, 2026

Copy link
Copy Markdown
Member

The public MCP profile could report missing household load without the reason or the energy evidence needed to explain it. measurement_diagnostics now provides five fixed read-only views: status, assets, energy, series catalogue and series. It retains Core's nulls, quality, reasons, interval metadata, Wh provenance, counts and source resolution. Charger/source/asset/metric names become grant-bound opaque selections. Unknown fields and text stay out; incomplete pages and failed reads return errors. The tool needs the existing owner-approved diagnostic grant and accepts no HTTP path, settings change, control or credential export.

diag_run and events_list no longer appear in discovery while Core does not serve them. Cached calls return an explicit service-side E_UNSUPPORTED result without reaching the box. Full technical API reads stay separate.

Fixes #42. Paired Core PR: srcfl/ftw#1746 (disabled charger warning and test fixture). CI runs the real Core handlers and temporary SQLite data from exact commit bf80760fb4d11698ca09e76f22ce44cf347b78df through OAuth, TLS, Noise and MCP. Missing/disabled EV sources retain their reason and association; an explicit repair restores live load while incomplete interval coverage stays unknown. Actual ledger provenance and stored series reach MCP without private identifiers.

Validation: full go vet ./..., go test -race ./..., dev-tag tests and import checks passed. Additional MCP race tests cover the paired Core path, grant refusal, HTTP failures, incomplete/malformed streams, private fields, unsafe arguments, unsupported operations and identifier separation. Core's full make verify and all 858 web tests passed.

Production Go growth: 337 net lines. This PR adds no new wire message, grant, release or deployment. It does not establish recovery in the reporting user's client or on physical equipment.

@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-19T05:49:23.253747Z 027ccde 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.

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.

Expose Core measurement-quality reasons and energy provenance through MCP diagnostics

1 participant