Skip to content

[P1] Lens silently rolls up aggregations to caller scope — same query returns per-foundation counts or zeros+TLF total with no warning #87

Description

@seberslinux

Summary

Lens silently changes aggregation behaviour based on the caller's scope. The same query, phrased two different ways, returns either correct per-foundation counts or all zeros plus one large TLF-level total — with no warning or indication that rollup occurred.

Observed behaviour

  • Query A (per-foundation phrasing) → correct per-foundation counts
  • Query B (equivalent intent, different phrasing) → all zeros + one aggregated TLF total

MCP returns aggregated values in cases where PCC holds per-foundation values. The caller has no way to know which behaviour they'll get.

Impact

Silent data corruption — callers receive wrong answers without any error or warning. Automation built on top of MCP can produce incorrect results without any indication of failure.

Location

Lens MCP — aggregation/scoping layer

Severity

P1 — silent incorrect results

Suggested fix

  1. Make aggregation rollup behaviour explicit and documented.
  2. Return a metadata field indicating whether the result is per-resource or rolled up.
  3. Or raise an error when the query intent is ambiguous.

Reported by Stephan Ebers — found while building NPS survey automation against the LFX APIs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions