Repository navigation
fix(mcp): expose safe measurement reasons and provenance - #43
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Oct 19, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The public MCP profile could report missing household load without the reason or the energy evidence needed to explain it.
measurement_diagnosticsnow 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_runandevents_listno longer appear in discovery while Core does not serve them. Cached calls return an explicit service-sideE_UNSUPPORTEDresult 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
bf80760fb4d11698ca09e76f22ce44cf347b78dfthrough 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 fullmake verifyand 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.