Skip to content

Missing Part 2 query option fields: foi, controlStream, sender, issueTime on ControlStreams, CommandStatusQueryOptions #106

Closed

Description

@Sam-Bolling

Task

Add 7 missing spec-normative query option fields to 4 Part 2 QueryOptions interfaces and create the CommandStatusQueryOptions interface with its statusCode field, plus update getCommandStatus() to accept optional query options.

Finding Reference: Demo app finding from ogc-csapi-explorer#35
Severity: Low
Category: Design gap
Ownership: Ours


Problem Statement

The Part 2 QueryOptions interfaces in model.ts are missing optional filter fields that are normatively defined in OGC 23-002 §13 (Advanced Filtering). Callers cannot use type-safe filtering for foi, issueTime, executionTime, sender, or statusCode on the affected resource endpoints without type assertions.

This is not a runtime bug — buildQueryString() serializes arbitrary key-value pairs, so callers can work around the gaps via type assertion. The gap is purely in TypeScript type safety and discoverability.

Evidence:

During ogc-csapi-explorer#35, implementing query filter panels in the explorer demo app required filtering Part 2 resources by feature-of-interest, temporal ranges, and command sender. The TypeScript interfaces did not expose these fields:

Interface Missing Field OGC 23-002 Requirement
ControlStreamQueryOptions issueTime §13.4.1 Req 52
ControlStreamQueryOptions executionTime §13.4.2 Req 53
ControlStreamQueryOptions foiId §13.4.4 Req 55
DatastreamQueryOptions foiId §13.2.4 Req 48
ObservationQueryOptions foiId §13.3.3 Req 51
CommandQueryOptions sender §13.5.4 Req 59
CommandQueryOptions foiId §13.5.5 Req 60
CommandStatusQueryOptions (new) statusCode §13.6.1 Req 61

Impact: Callers lack type-safe access to 7 spec-normative query parameters. The getCommandStatus() method cannot accept any filtering options at all — no way to pass statusCode or even the base datetime/limit parameters.

Files to Create or Modify

File Action Est. Lines Purpose
src/ogc-api/csapi/model.ts Modify ~15 Add optional fields to 4 interfaces + create CommandStatusQueryOptions
src/ogc-api/csapi/url_builder.ts Modify ~5 Update getCommandStatus() to accept optional query options, import new type
src/ogc-api/csapi/url_builder.spec.ts Modify ~40 Add tests for new query option fields
src/index.ts Modify ~1 Export CommandStatusQueryOptions type

Proposed Fix

All changes are additive:

  1. model.ts — Add optional fields to existing interfaces:

    • ControlStreamQueryOptions: add issueTime?: DateTimeParameter, executionTime?: DateTimeParameter, foiId?: string
    • DatastreamQueryOptions: add foiId?: string
    • ObservationQueryOptions: add foiId?: string
    • CommandQueryOptions: add sender?: string, foiId?: string
  2. model.ts — Create new interface:

    export interface CommandStatusQueryOptions extends QueryOptions {
      statusCode?: CommandStatusCode;
    }
  3. url_builder.ts — Update method signature:

    getCommandStatus(id: string, options?: CommandStatusQueryOptions): string
  4. Naming convention: Use foiId (not foi) for consistency with Part 1's SystemQueryOptions.foiId. The existing PARAM_NAME_MAP entry (foiId → foi) handles wire serialization.

Scope — What NOT to Touch

  • ❌ Do NOT add dataStream to ObservationQueryOptions — not a spec-defined query parameter in §13.3. The nested endpoint getDataStreamObservations() is the spec-intended approach.
  • ❌ Do NOT add controlStream to CommandQueryOptions — not a spec-defined query parameter in §13.5. The nested endpoint getControlStreamCommands() is the spec-intended approach.
  • ❌ Do NOT add reportTime to CommandStatusQueryOptions — not a named query parameter in §13.6. The base datetime parameter (already in QueryOptions) serves this purpose.
  • ❌ Do NOT modify buildQueryString() — no new serialization logic needed
  • ❌ Do NOT modify PARAM_NAME_MAP or TEMPORAL_KEYS — already configured correctly
  • ❌ Do NOT modify files outside the "Files to Create or Modify" table above
  • ❌ Do NOT refactor existing code

Acceptance Criteria

  • ControlStreamQueryOptions has issueTime, executionTime, foiId optional fields
  • DatastreamQueryOptions has foiId optional field
  • ObservationQueryOptions has foiId optional field
  • CommandQueryOptions has sender, foiId optional fields
  • CommandStatusQueryOptions interface exists with statusCode optional field
  • getCommandStatus() accepts optional CommandStatusQueryOptions parameter
  • CommandStatusQueryOptions is exported from src/index.ts
  • All new fields have JSDoc comments with @see links to OGC 23-002 §13
  • Unit tests verify serialization of all new fields
  • Existing tests still pass (npm test)
  • No lint errors

Dependencies

Blocked by: #105 — Query parameter name mismatches (Resolved ✅)
Blocks: Nothing


Operational Constraints

⚠️ MANDATORY: Before starting work on this issue, review
docs/governance/AI_OPERATIONAL_CONSTRAINTS.md.

Key constraints:

  • Precedence: OGC specifications → AI Collaboration Agreement → This issue description → Existing code → Conversational context
  • No scope expansion: Fix the finding, nothing more
  • Minimal diffs: Prefer the smallest change that satisfies the acceptance criteria
  • Ask when unclear: If intent is ambiguous, stop and ask for clarification

References

# Document What It Provides
1 Findings Report Full gap-by-gap analysis, spec verification, risk assessment, naming decision
2 OGC 23-002 §13 — Advanced Filtering Normative query parameter definitions
3 src/ogc-api/csapi/model.ts Interfaces to modify
4 src/ogc-api/csapi/url_builder.ts getCommandStatus() method to update
5 Issue #105 — Query parameter name mismatches PARAM_NAME_MAP and TEMPORAL_KEYS already support all new fields
6 ogc-csapi-explorer#35 Demo app finding that discovered the gaps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions