Skip to content

feat: Add single-result modes to Assets queries - #6040

Merged
kof merged 10 commits into
mainfrom
agent/assets-single-result-modes-6039
Aug 7, 2026
Merged

feat: Add single-result modes to Assets queries#6040
kof merged 10 commits into
mainfrom
agent/assets-single-result-modes-6039

Conversation

@kof

@kof kof commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Add many, one, first, and last result modes to Assets queries while keeping many as the backward-compatible default.
  • Return direct items for single-result modes, validate deterministic ordering, and report duplicate one matches as a structured MULTIPLE_RESULTS error.
  • Update Builder controls, preview/published runtime handling, SDK resource encoding, MCP/CLI guidance, generated contracts, and fixtures.

Implementation TODOs

  • Add result-mode schemas and core execution behavior.
  • Select single results before content hydration and preserve deterministic ID tie-breaking.
  • Add structured duplicate-match transport errors.
  • Update Builder controls and hide/reset pagination for single-result modes.
  • Keep existing settings first, then Output and Result, without a duplicate Return label.
  • Preserve legacy saved resources with an implicit many default.
  • Update preview, published runtime, SDK, protocol, MCP, and CLI behavior.
  • Regenerate runtime contracts, server metadata, CLI docs, and fixtures.
  • Review documentation impact and update the authoritative MCP/CLI guidance.
  • Add regression coverage and verify the new tests fail without the implementation.
  • Run the agent evaluation suite (not run; requires explicit user approval).

Compatibility and behavior

  • Existing queries without result continue to behave as many and retain the ID-keyed collection shape.
  • one returns an item or null, but fails when more than one asset matches.
  • first and last require explicit sorting; the existing asset-ID tie-breaker makes equal sort values deterministic.
  • Single-result modes ignore and do not persist pagination controls. Materialized collection queries remain collection-only; single-result queries execute dynamically.

Verification

  • Content engine typecheck and full test suite (291 tests).
  • Query builder, query-builder React, SDK, protocol, asset uploader, project build, Builder, and CLI targeted typechecks/tests.
  • Root lint.
  • MCP documentation tests, typecheck, sync check, and generated-doc checks.
  • Generated API contract checks.
  • Fixture generation pipeline.
  • Final focused content-engine regression run (53 tests).
  • Final DRY review: affected typechecks, focused tests, lint, package boundaries, generated checks, and fixtures.

Closes #6039

@kof
kof marked this pull request as ready for review August 7, 2026 13:01
@kof
kof merged commit 2ec78c1 into main Aug 7, 2026
32 of 34 checks passed
@kof
kof deleted the agent/assets-single-result-modes-6039 branch August 7, 2026 17:13
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.

Add single-result modes to Assets queries

1 participant