Skip to content

MCPJVM-369: Public MCP query support for correlation_state #369

Description

@nimbly-dev

Description

Once SQLite-backed correlation state exists, Regression Suite needs a public MCP query surface for bounded inspection of persisted correlation information. This story exposes correlation_state through artifact_management as a query-oriented state surface for lookup by run, key type/value, plan, status, and correlation session.

This story should define the public request/response shape, filtering behavior, paging, sorting, and fail-closed behavior for correlation_state queries.

Scope

In scope:

  • Add correlation_state as a public artifact_management state surface
  • Expose query support for persisted correlation state
  • Support bounded filtering by projectName, planName, runId, status, keyType, keyValue, and correlationSessionId
  • Support deterministic paging and sorting for enterprise-scale correlation history
  • Keep the public surface query-oriented and read-only for runtime-owned rows

Out of scope:

  • Legacy migration/backfill action semantics
  • Watcher-specific query semantics
  • Storage implementation internals
  • Manual mutation of runtime-owned correlation rows

Acceptance Criteria

  • artifact_management supports public query access for correlation_state
  • Query behavior is bounded, deterministic, and fail-closed
  • Correlation-specific lookup fields are supported in the public contract
  • Paging and sorting are supported for large correlation histories
  • Response output is sufficient for agents/users to inspect bounded correlation state without loading full Artifact history by default

Implementation Notes

  • Keep correlation-state results focused on stable query fields rather than full raw timeline payload expansion by default.
  • Preserve deterministic lookup semantics for key/session-oriented enterprise debugging.

Testing

  • UT for correlation_state query validation and correlation-specific filter normalization
  • UT for paging/sorting behavior on correlation histories
  • IT for key/session/status-based correlation_state queries
  • IT for fail-closed behavior on invalid or contradictory query inputs

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions