Repository navigation
Description
Task
Refactor getCommandStatus() to pass query options through buildResourceUrl() instead of concatenating buildQueryString() output, for consistency with all other builder methods.
Finding Reference: F45 from Phase 5.5 Code Review
Severity: Low
Category: Design gap (pattern deviation)
Ownership: Ours
Problem Statement
In url_builder.ts, getCommandStatus() appends the query string via manual concatenation rather than passing options to buildResourceUrl():
// Current (getCommandStatus — concatenation):
getCommandStatus(id: string, options?: CommandStatusQueryOptions): string {
this.assertResourceAvailable('commands');
return this.buildResourceUrl('commands', id, 'status') + this.buildQueryString(options);
}All other methods pass options to buildResourceUrl() which internally calls buildQueryString():
// Established pattern (every other method):
getDataStreamObservations(id: string, options?: ObservationQueryOptions): string {
this.assertResourceAvailable('datastreams');
return this.buildResourceUrl('datastreams', id, 'observations', options);
}Impact: Zero functional impact — both approaches produce identical URLs. The deviation is a pattern consistency concern. Both code paths use the same buildQueryString() method internally.
Files to Create or Modify
| File | Action | Est. Lines | Purpose |
|---|---|---|---|
src/ogc-api/csapi/url_builder.ts |
Modify | ~2 | Change getCommandStatus() to pass options via buildResourceUrl() |
Proposed Fix
Option A: Modify getCommandStatus() to pass options as the 4th argument to buildResourceUrl() — requires verifying that buildResourceUrl() handles options correctly for sub-resource-of-per-ID paths (commands/{id}/status).
Option B: Leave as-is — the concatenation is functionally correct and arguably more explicit about what's happening.
Recommended: Option B (leave as-is) — See deferral rationale below.
Scope — What NOT to Touch
- ❌ Do NOT modify
buildResourceUrl()internals - ❌ Do NOT modify any other builder method signatures
- ❌ Do NOT modify files outside the "Files to Create or Modify" table above
- ❌ Do NOT refactor existing code unless required to complete this task
Acceptance Criteria
-
getCommandStatus()produces identical URLs before and after the change - All 1282 existing CSAPI tests still pass
- No lint errors
-
tsc --noEmitcompiles cleanly
Dependencies
Blocked by: Nothing
Blocks: Nothing
Operational Constraints
⚠️ MANDATORY: Before starting work on this issue, reviewdocs/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 pattern deviation, nothing more
- Minimal diffs: Prefer the smallest change that satisfies the acceptance criteria
References
| # | Document | What It Provides |
|---|---|---|
| 1 | Phase 5.5 Code Review | Finding F45 description and context |
| 2 | src/ogc-api/csapi/url_builder.ts |
Affected source file — getCommandStatus() at line ~2330 |
| 3 | src/ogc-api/csapi/url_builder.spec.ts |
Existing tests for getCommandStatus() |
Activity
Sam-Bolling commentedon Feb 21, 2026
Deferral Rationale — Acceptance Likelihood Assessment
From code review discussion:
An upstream maintainer reviewing a 2,300-line URL builder with 68+ methods is going to focus on:
The concatenation in
getCommandStatusis one line in one method. It produces correct output. It's tested. A reviewer would have to compare every method's internal delegation pattern to even notice it — and even then,buildResourceUrlalready accepts an optional 4thoptionsparameter, so it's not like the concatenation is hiding a missing capability. It's just thatgetCommandStatusbuilds a sub-sub-resource path (commands/{id}/status) and chose to append the query string manually rather than passing it through.What would improve acceptance likelihood:
Fixing F46 (type narrowing) and F47 (missing combined test) actually do more for acceptance — they show attention to detail in the areas reviewers do scan: type signatures and test completeness.
Bottom line: F46 and F47 improve acceptance odds. F45 doesn't move the needle.
docs: add deferred issues Phase 6 scope assessment
Sam-Bolling commentedon Mar 7, 2026
External Review Cross-Reference (2026-03-07)
An external senior developer independently rediscovered this finding during a code review of
clean-pr. Filed as code-review record:docs/code-review/015-duplicate-p3-get-command-status-inconsistent.md.Three notes for future triage:
1. Commit Origin
The inconsistency was introduced in commit
23126d4(Issue #106 — "Add missing Part 2 query option fields"). The originalgetCommandStatus(commitb1c08d4, Issue #13) had nooptionsparameter and simply calledbuildResourceUrl('commands', id, 'status'). When options support was added,buildQueryString(options)was concatenated instead of passingoptionsas the 4th argument tobuildResourceUrl.2. Auto-Resolution via #145
Issue #145 proposes a
build()wrapper that collapsesassertResourceAvailable+buildResourceUrlinto a single call. If #145 is implemented, this issue is resolved automatically —getCommandStatuswould become:Consider closing this as resolved if/when #145 lands.
3. Status Recommendation
No change to DEFERRED status — the external review validates the original F45 assessment but doesn't change the risk calculus (zero functional impact, consistency concern only).
docs: update P7 plan v1.3 — reflect issue splits (#141→#154+#155, #100→…
refactor(csapi): rewrite Observations/ControlStreams/Commands to buil…