Skip to content

feat: bound PSS/E dynamic output responses - #98

Open
BurhanAbdullah wants to merge 4 commits into
Power-Agent:mainfrom
BurhanAbdullah:feat/psse-dynamic-output-bounds
Open

BurhanAbdullah wants to merge 4 commits into
Power-Agent:mainfrom
BurhanAbdullah:feat/psse-dynamic-output-bounds

Conversation

@BurhanAbdullah

Copy link
Copy Markdown
Contributor

Summary

Follow up on #97 to bound the size of read_dynamic_output MCP responses.

Changes

  • Add a safe default cap of 10,000 time points.
  • Add max_points so callers can request a tighter response bound.
  • Apply deterministic, evenly spaced, endpoint-preserving sampling when the source exceeds the cap.
  • Preserve time-series/channel alignment by validating that all returned channels match the time-vector length.
  • Return num_points, total_points, downsampled, and the effective max_points so callers can see exactly how the response was handled.
  • Reject invalid max_points values before starting the PSS/E engine.
  • Update the PSS/E README with the new response-cap behavior.
  • Add regression coverage for explicit caps, the default cap, endpoint preservation, invalid inputs, and pre-engine validation.

Validation

The new tests use the existing fake dyntools path, so they do not require a licensed PSS/E installation.

This addresses the follow-up from #97: an unbounded request for all dynamic-output channels can otherwise produce an unnecessarily large MCP response.

This branch has not been deployed

No deployments
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