Absorb search filter params + real metadata shape across six SDKs (#399)

Merged
JE
4mo ago
+2441-342

Absorbs BC3 #12361 ("Search API: query-faithful params and root cache", merged f0d9387a58) — the settled search filter surface — into the Smithy model and all six SDKs. Flips spec/api-gaps/search-filter-additions.md to absorbed-in-sdk.

Stacked on #403 (upstream-sync/repin). Review/merge #403 first; this PR targets chore/upstream-sync-bc3.

Contract added

SearchInput gains, on the existing GET /search.json:

  • arrays type_names[], bucket_ids[], creator_ids[] (bracketed @httpQuery wire names)
  • scalars file_type, exclude_chat, since
  • deprecated singulars type, bucket_id, creator_id (@deprecated)

SearchMetadata replaced with the real GET /searches/metadata.json shape: recording_search_types / file_search_types (SearchType {key, value}) + five default_*_label fields.

Array wire encoding (Approach A)

Rack's permit(bucket_ids: []) only parses the bracketed repeated form (bucket_ids[]=1&bucket_ids[]=2); comma-joined and bare-repeated are dropped. The bracketed wire name lives only in the @httpQuery trait — each owned generator strips [] from the public identifier and emits the bracketed key on the wire, except Ruby (Faraday's NestedParamsEncoder re-adds [], so it emits the stripped key). Go maps the fields onto the generated client, which owns the wire via form:"bucket_ids[]" tags — no URL rewriting in the hand-written service. Per-SDK wire tests assert the decoded query (arrays + scalars + singulars) and the absence of bare/double-bracketed keys; Go drives both the generated request and the public wrapper; Python covers sync + async.

SearchType.key — required-and-nullable

BC3 always emits key, with null for the default "everything"/"all files" option. Smithy has no native required-nullable, so the OpenAPI models it (via smithy-build.json jsonAdd) as type: ["string","null"] + key in required. Typed surfaces preserve null: Go *string (json:"key"), TS string | null, Python str | None, Swift let key: String? with generated Codable that rejects a missing key and round-trips nil → "key": null.

⚠️ Breaking changes (pre-1.0 SDK)

  • TS SearchSearchOptions.sort union created_at → recency. created_at was never a valid API value; this corrects a wrong type. Source-breaking only for the generated TS service union; all other SDKs expose plain string.
  • SearchMetadata.projects + SearchProject removed across all SDKs. The field was fictional (the API never returned it); retaining it misled consumers. Replaced with the real metadata shape.

Both are documented in the absorbed gap doc.

Canary

Adds a Search entry driving type_names[] + since in live-my-surface.json. Honesty note: the live assertion vocabulary proves 2xx + schema validity only, not that BC5 respects the filter — this is acceptance/decoding coverage (documented in the entry). Pairwise BC4↔BC5 model retained (PR #394 not yet merged).

Also corrects the stale timelines/searches route note (that route does not exist in bc3) and drops its allowlist record.

Verification

make check → exit 0 (lint-actions, all six SDK suites, conformance, drift, api-gaps, behavior-model, version syncs, canary-compare).


Summary by cubic

Adds query-faithful search filters and the real metadata shape to all six SDKs. Implements bracketed array query encoding with cross-SDK tests and a live canary, switches sort to “recency,” and removes the stale timelines/searches allowlist entry.

  • New Features

    • GET /search.json now accepts type_names[], bucket_ids[], creator_ids[], file_type, exclude_chat, and since (last_7_days | last_30_days | last_90_days | last_12_months | forever). Deprecated type, bucket_id, creator_id remain.
    • Replaces metadata with recording_search_types and file_search_types (SearchType { key (nullable), value }) plus default_*_label fields; key: null is preserved across Go/TS/Python/Swift/Kotlin/Ruby.
    • Bracketed array wire encoding across SDKs with identifier/wire-name split; empty arrays are omitted to avoid emitting bare []. Per-SDK tests assert array encoding and metadata decode; a live canary drives type_names[] + since with pagination capped.
  • Migration

    • TypeScript: SearchSearchOptions.sort is now "best_match" | "recency" (was "created_at").
    • Removes SearchMetadata.projects and SearchProject; use the new metadata fields.
    • Prefer the new filters (type_names[], bucket_ids[], creator_ids[], etc.); the singulars are deprecated.