Skip to content

rust(feat): serve saved calculated channels from get_data - #737

Open
evan-sift wants to merge 6 commits into
rust/mcp-calculated-channelsfrom
rust/mcp-calculated-channel-data
Open

rust(feat): serve saved calculated channels from get_data#737
evan-sift wants to merge 6 commits into
rust/mcp-calculated-channelsfrom
rust/mcp-calculated-channel-data

Conversation

@evan-sift

@evan-sift evan-sift commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Description

get_data now serves saved calculated channels alongside raw channels. A name in channel_names with no raw-channel match on the asset resolves as an active saved calculated channel and is evaluated for the requested asset and run. A raw channel wins a shared name; channel_regex stays raw-only. Resolution works whether the caller identified the asset by asset_name or asset_id.

Saved-name lookup is scoped to the asset. A name matching more than one active calculated channel is reported as ambiguous, naming the colliding calculated channel ids, instead of silently picking one; a truncated lookup page fails explicitly rather than misreporting unseen names as unknown.

Partial resolution is explicit: channels that do not apply to the asset are named, with reasons, in unresolved_calculated_channels and in next_step; nothing is silently dropped. When nothing resolves, the call fails with the same message. Batch resolution verifies the echoed channel id on every response and hard-errors on a mismatch.

Surface note: this change extends get_data; it is not a resource and the list / create / update / archive quartet does not apply.

Stack note: the bundled agent skill and the 0.5.0 changelog for this whole stack land at the tip (#763).

Verification

  • cargo test -p sift_mcp on this branch: 350 passed, 0 failed. Coverage includes request construction, partial mapping, reordered and count-mismatched responses, name dedupe, unresolved reports surviving an empty data window, raw-path precedence, asset-scoped lookup, ambiguous-name reporting, and the truncation guard.
  • Live round trips against a development org (2026-08-18, before the asset-scoping rework): raw channel export unchanged, saved calculated channel export, and partial resolution reporting the inapplicable channel. The scoping and ambiguity behavior added since is pinned by tests.

@evan-sift evan-sift changed the title rust/mcp calculated channel data rust(feat): serve saved calculated channels from get_data Aug 19, 2026
@evan-sift
evan-sift force-pushed the rust/mcp-calculated-channels branch from 707b4f1 to 6881374 Compare August 26, 2026 07:55
@evan-sift
evan-sift force-pushed the rust/mcp-calculated-channel-data branch 2 times, most recently from ce38cc5 to b782ed0 Compare August 26, 2026 08:20
@evan-sift
evan-sift marked this pull request as ready for review August 26, 2026 08:21
@evan-sift
evan-sift requested a review from lineville August 26, 2026 08:21
Adds a resolution step to the calculated channel service: names are looked up
among active saved channels, then resolved through the API for a single asset
and optional run. Names that do not resolve come back reported instead of
dropped so a caller can name them.
A channel name with no raw channel on the asset is resolved as an active saved
calculated channel and queried with its resolved expression. Raw channels keep
precedence on a shared name, so the existing path is unchanged.

Channels that do not resolve are named in the result and in next_step, or in a
RESOURCE_NOT_FOUND when nothing requested can be served, instead of returning a
silently partial file. A calculated channel page carries no channel name, so its
column falls back to the query key.
…ed report on failure

Batch resolve responses are mapped by position, so compare the echoed
calculated channel id against the requested one and fail when they disagree; an
absent echo still falls back to position.

Drop repeated names before resolution: two queries sharing a channel key merge
into one column and repeat timestamps.

Carry the unresolved-channel report into a failed data query so an empty window
does not read as "the asset has no data" when part of the request never
resolved.
@evan-sift
evan-sift force-pushed the rust/mcp-calculated-channels branch from b26c94e to 0bbb0e9 Compare August 27, 2026 04:40
@evan-sift
evan-sift force-pushed the rust/mcp-calculated-channel-data branch from b782ed0 to bc3f432 Compare August 27, 2026 04:40

@lineville lineville left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good! Just the one non-blocking question on partial failures.

Comment thread rust/crates/sift_mcp/src/service/calculated_channels/mod.rs
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.

2 participants