Repository navigation
Description
Phase 8 Task
Task ID: B1
Title: Finding 019 — DataStream → Datastream Method Rename
Source: Senior dev code review #2
Severity: P2-Major (locked decision: straight rename, no aliases)
Category: API Design / Naming
Ownership: Ours (CSAPI module — csapi/url_builder.ts and its specs)
Phase 8 phase: B — API Surface Refinements
Goal
Single coherent spelling across the whole CSAPI module. After this task, git grep "DataStream" -- 'src/ogc-api/csapi/' returns 0 matches (modulo Datastream substring matches). Method names match the existing Datastream type, parseDatastream parser, and 'datastreams' resource constant. Aligns with the OGC spec, which writes "Datastream" as one word.
Acceptance criterion (from P8-contribution-goal-and-definition.md): B3 — single coherent Datastream spelling.
Locked Decision
⚠️ This decision is locked. Do not re-litigate in this issue. Surface deviations to the user; do not silently re-decide.
Decision: Option A — straight rename, no aliases. Decided April 28, 2026 (recorded in the finding's frontmatter decision: 'Option A — straight rename').
Rationale: PR #136 has not been merged upstream. The CSAPI feature set (including all *DataStream* methods) is not present in any released version of ogc-client, so there are no downstream consumers whose code would break. "Breaking change" framing only applies when a library has shipped to users; here, the only "consumer" is the unmerged PR itself.
Option B (aliased + @deprecated) is rejected — would ship two names for every method on a feature set that has never been released, creating permanent cruft and inviting maintainer pushback ("who is this deprecation cycle for?"). Option C (status quo) is rejected — the reviewer correctly identified this as the most legitimate consistency finding in the report.
Locked in:
- P8-contribution-goal-and-definition.md §3 — Phase 8 design rails (no
@deprecatedin Phase 8) - P8-implementation-guide.md §3 — execution-level rails
docs/code-review/019-pending-p2-method-naming-datastream-vs-datastream.md— Decision section, dated April 28, 2026
Problem Statement
The CSAPI public surface uses two different capitalizations of "datastream" across closely related identifiers:
- Methods (camelCase, capital S):
getDataStream,getDataStreams,createDataStream,updateDataStream,deleteDataStream,getDataStreamSchema,getDataStreamObservations,getDataStreamSystems,getDataStreamProcedures,getDataStreamHistory,getSystemDataStreams,createDataStreamForSystem,getProcedureDataStreams. - Types and parsers (lowercase s):
Datastream,DatastreamCollection,DatastreamQueryOptions,DatastreamSchemaResponse,parseDatastream,parseDatastreamSchemaResponse, and the resource type constant'datastreams'.
A consumer who calls builder.getDataStream('id') and then searches for parseDataStream will not find it — the parser is parseDatastream. ControlStream is consistent across methods/types/parsers; only DataStream/Datastream is split.
Affected code:
src/ogc-api/csapi/url_builder.ts— all 13 method names useDataStreamsrc/ogc-api/csapi/model.ts— types useDatastream(correct; do not touch)src/ogc-api/csapi/formats/part2.ts— parsers useparseDatastream(correct; do not touch)src/ogc-api/csapi/index.ts— barrel re-exports both spellings (touch only the method-name re-exports if any)
Impact: Onboarding friction; consumers cannot discover the parser by typing the method name's prefix. Pure DX/consistency issue; no runtime correctness bug.
Files to Modify
| File | Action | Est. Lines | Purpose |
|---|---|---|---|
src/ogc-api/csapi/url_builder.ts |
Modify | ~25 | 13 method declarations + any internal this.* callsites |
src/ogc-api/csapi/url_builder.spec.ts |
Modify | ~80 | Every test case — describe blocks and method invocations |
src/ogc-api/csapi/factory.spec.ts |
Modify | ~5 | If it references method names |
src/ogc-api/csapi/integration/*.spec.ts |
Modify | ~20 | Any integration tests that call these methods |
src/ogc-api/csapi/index.ts |
Modify | ~5 | Barrel re-exports if any method names appear |
app/Demo.vue |
Modify | ~5 | Demo app references (under our control; outside src/, but kept consistent) |
app/examples/edr.ts |
Verify | ~0 | Only if it references CSAPI methods (unlikely; check) |
13 methods to rename (verbatim from implementation guide):
| Old name | New name |
|---|---|
getDataStreams |
getDatastreams |
getDataStream |
getDatastream |
createDataStream |
createDatastream |
updateDataStream |
updateDatastream |
deleteDataStream |
deleteDatastream |
getDataStreamSchema |
getDatastreamSchema |
getDataStreamObservations |
getDatastreamObservations |
getDataStreamSystems |
getDatastreamSystems |
getDataStreamProcedures |
getDatastreamProcedures |
getDataStreamHistory |
getDatastreamHistory |
getSystemDataStreams |
getSystemDatastreams |
createDataStreamForSystem |
createDatastreamForSystem |
getProcedureDataStreams |
getProcedureDatastreams |
Cross-reference P8-implementation-guide §4.2 for the canonical files-modified list. If you find yourself adding a file that isn't in the implementation guide, stop — surface the question.
Implementation Approach
Pull the canonical mechanical execution from P8-implementation-guide §4.2.
Mechanical execution (verbatim from the guide):
- In
url_builder.ts, rename declarations one at a time using VS Code's rename-symbol (F2). Each rename auto-updates internal call sites and direct callers in spec files via the language server. - After all 13 renames complete, run
git grep -n "DataStream" -- 'src/ogc-api/csapi/'— expect zero matches. - Run
npx tsc --noEmit— fix any consumer call sites the rename-symbol missed. - Run
npm run test:browser src/ogc-api/csapi/url_builder.spec.ts— fix any test references the rename-symbol missed. - Run
npm run test:browser(all browser tests) andnpm run test:nodeto catch any remaining missed callsites. - Run
npx prettier --writeon the modified files before commit.
No alias layer, no @deprecated tags. Per locked decision: PR #136 unmerged ⇒ no consumers ⇒ "breaking change" framing does not apply. Adding deprecated aliases creates permanent cruft for users that don't exist.
Test impact: ~13 spec describe blocks renamed; method invocations in test bodies updated. No new test cases needed for the rename itself.
Scope — What NOT to Touch
- ❌ Do NOT modify files outside the "Files to Modify" table above
- ❌ Do NOT touch
Datastreamtypes inmodel.ts,parseDatastreaminformats/part2.ts, or the'datastreams'resource constant — they are already correct - ❌ Do NOT add
@deprecatedaliases for the oldDataStreamnames (Option B — explicitly rejected) - ❌ Do NOT add
@deprecatedtags anywhere in Phase 8 (locked decision; PR unmerged ⇒ no consumers) - ❌ Do NOT change method signatures, return types, or runtime behavior — names only
- ❌ Do NOT bundle Task A4's pagination JSDoc work into this PR — A4 is its own task (recommended sequencing: B1 first, then A4 against the renamed methods)
- ❌ Do NOT change
ControlStream*method names — they are already consistent and out of scope - ❌ Do NOT touch
CSAPICollectionReftyping (Task A2),availableResourcestyping (Task A3), error-throwing patterns (Task B2), or factory shape (Task D1) - ❌ Do NOT absorb consumer-side ergonomic helpers (Phase 8 hard scope fence; Closed (wontfix): library is spec-correct; server-side root cause tracked at connected-systems-go#11; institutional knowledge preserved in references.md #168 / Closed (wontfix): heuristic coordinate extraction not adopted; architecturally correct path tracked at #171 #169 stay closed wontfix)
- ❌ Do NOT re-open a Phase 8 deferred finding (020, 025, 026) or a deferred CS-Go issue (Future-enhancement (deferred): async-iterator helpers for paginated CSAPI list methods — out-of-scope until upstream broadens scope #170, Deferred enhancement: SWE Common–aware result-vector extraction (out-of-scope until upstream broadens scope) #171) inside this task
Acceptance Criteria
- All 13 method declarations renamed in
src/ogc-api/csapi/url_builder.tsper the table above (see closing comment: a 14th method,getPropertyDataStreams, was also renamed to satisfy the zero-grep acceptance gate; not enumerated in the impl-guide table — appears to be an audit oversight) - All internal
this.*callsites updated (rename-symbol handles these automatically) - All test files updated:
url_builder.spec.ts,factory.spec.ts,integration/*.spec.ts - Barrel re-exports in
src/ogc-api/csapi/index.tsupdated if any method names appear -
app/Demo.vuereferences updated (none found; no edit required) -
git grep -n "DataStream" -- 'src/ogc-api/csapi/'returns 0 matches (moduloDatastreamsubstring matches inside type names, parser names, and the resource constant) - No
@deprecatedaliases or shims for the old names - No method signatures, return types, or runtime behavior changed — names only
- All modified files pass
npx prettier --check -
npm run typecheckexits 0 -
npm run lintexits 0 -
npm run test:browserexits 0 — pre-existing Windows-only worker-timeout failures (4 suites / 83 tests inhttp-utils,wms/endpoint,wmts/endpoint,wfs/endpoint); identical to A2/A3 baseline. No regression introduced by B1. -
npm run test:nodeexits 0
Acceptance Gate (verification command)
The Phase 8 roadmap defines a specific verification command for this task (P8-ROADMAP §Phase B Task B1). Paste the output of these commands on the issue before closing:
# 1. Confirm the rename is total — should return 0 lines
git grep -n "DataStream" -- 'src/ogc-api/csapi/'
# Expected: zero matches (any matches indicate either a missed rename or an
# incidental Datastream-substring hit; inspect each result before passing)
# 2. Confirm there are no @deprecated aliases for the old names
git grep -n "@deprecated" -- src/ogc-api/csapi/
# Expected: zero matches related to the rename (Phase 8 forbids @deprecated)
# 3. Type-check + targeted spec
npm run typecheck
npm run test:browser -- src/ogc-api/csapi/url_builder.spec.ts
# 4. Full upstream QA suite (must mirror .github/workflows/qa.yml)
npm run format:check
npm run typecheck
npm run lint
npm run test:browser
npm run test:nodeExpected output:
git grep "DataStream"returns 0 matchesgit grep "@deprecated"returns 0 rename-related matches- All five upstream QA commands exit 0
- Targeted
url_builder.spec.tsrun exits 0
Dependencies
Mandatory. Walk the P8-ROADMAP dependency graph and fill in every applicable row.
Blocked by: Nothing within Phase 8 (B1 is independent of Phase A; can run in parallel)
Blocks:
- Task A4 (pagination JSDoc on list methods) — soft dependency only; A4 should run after B1 to avoid double-touching the same JSDoc blocks. Either order works mechanically.
- Task D1 (factory + endpoint refactor) — D1 should land on the final method names, eliminating one whole class of last-minute fix-ups. (D1 is also blocked by A2; B1 is one of two prerequisites.)
Related: Task A1 (the worked example in the new module docblock uses the post-renamegetDatastreamsname); Task A4 (sequencing — see "Blocks")
Roadmap dependency row: P8-ROADMAP §Phase B Task B1: "Effort: Mechanical (~1 hour). Risk: Low (rename-symbol + tsc gates catch every call site). Dependencies: None within Phase 8 (independent of Phase A); should land before Task A4 finalization."
References
| # | Document | What It Provides |
|---|---|---|
| 1 | P8-contribution-goal-and-definition.md | Phase 8 goal, scope, acceptance criteria, locked decisions |
| 2 | P8-implementation-guide.md §4.2 | Authoritative execution-level guide (this task) |
| 3 | P8-ROADMAP.md §Phase B Task B1 | Task ordering, dependencies, acceptance gate |
| 4 | docs/code-review/019-pending-p2-method-naming-datastream-vs-datastream.md |
Authoritative "why" for this finding + locked decision |
| 5 | src/ogc-api/csapi/url_builder.ts |
Receives the 13 method renames |
| 6 | src/ogc-api/csapi/url_builder.spec.ts / factory.spec.ts / integration/*.spec.ts |
Receive matching describe-block + invocation renames |
| 7 | src/ogc-api/csapi/index.ts |
Barrel — touch only if method names are re-exported |
| 8 | src/ogc-api/csapi/model.ts / formats/part2.ts |
Already-correct Datastream types/parsers — DO NOT touch |
| 9 | app/Demo.vue |
Demo app references — kept consistent |
Activity
Sam-Bolling commentedon Apr 29, 2026
Workflow & Closing Step (applies to this issue)
When working this issue, follow this workflow exactly:
git commit+git push origin <branch>). Verify withgit statusthat the working tree is clean andgit log origin/<branch>..HEADis empty.Acceptance-gate scrub: NO manual review
Any prior wording in this issue body that asks for a "manual review confirmation paragraph", "manual review paragraph", "human review", or any other free-form prose-confirmation gate is rescinded. The acceptance gate is the set of automated commands listed under Acceptance Gate (verification command) — exit codes only, no manual-review prose. If any such manual-review wording appears in the original body of this issue, treat it as a no-op and ignore it.
If the original verification block called for a "manual review confirmation" step, the corrected gate is:
npx prettier --checkinvocations exit 0.npm runQA invocations (format:check,typecheck,lint,test:browser,test:node) exit 0.phase-8HEAD prior to this task's commit) — paste a one-linegit stash; npx jest <suite>; git stash popreproduction in the closing comment.For PR-page verification gates that previously called for "manual / browser" inspection of
pull/136, replace with API-based verification using the GitHub MCP tools (mcp_io_github_git_pull_request_read,mcp_io_github_git_list_commits) — no browser, no manual screenshotting.refactor(csapi): rename DataStream -> Datastream throughout module (B…
Sam-Bolling commentedon Apr 29, 2026
Closing summary — Task B1 / Finding 019 complete
Commit:
f3ebcbconphase-8(11 files changed, 125 insertions(+), 125 deletions(-))Deviation from the locked task surface
The impl-guide table in P8-implementation-guide §4.2 and the body of this issue both list 13 methods to rename. The actual codebase contains a 14th structurally identical method,
getPropertyDataStreams(declared atsrc/ogc-api/csapi/url_builder.ts:1462,1468and called 4× inurl_builder.spec.ts).The acceptance gate is unambiguous:
git grep "DataStream" -- 'src/ogc-api/csapi/'must return zero matches. Skipping the 14th method would have failed that gate. The locked decision is about strategy (rename, no aliases), not the enumeration. The 14th method was therefore renamed togetPropertyDatastreams. The omission appears to be an audit oversight in the original finding write-up; surfacing it here for the record rather than silently re-deciding.Methods renamed (14)
getDataStreamsgetDatastreamsgetDataStreamgetDatastreamcreateDataStreamcreateDatastreamupdateDataStreamupdateDatastreamdeleteDataStreamdeleteDatastreamgetDataStreamSchemagetDatastreamSchemagetDataStreamObservationsgetDatastreamObservationsgetDataStreamSystemsgetDatastreamSystemsgetDataStreamProceduresgetDatastreamProceduresgetDataStreamHistorygetDatastreamHistorygetSystemDataStreamsgetSystemDatastreamscreateDataStreamForSystemcreateDatastreamForSystemgetProcedureDataStreamsgetProcedureDatastreamsgetPropertyDataStreamsgetPropertyDatastreamsAlso normalized incidental
DataStreamreferences in JSDoc, comments, and spec describe blocks across the csapi module.Files modified (11)
src/ogc-api/csapi/url_builder.ts— 14 declarations + JSDoc + commentssrc/ogc-api/csapi/url_builder.spec.ts— describe blocks + invocationssrc/ogc-api/csapi/integration/discovery.spec.tssrc/ogc-api/csapi/integration/navigation.spec.tssrc/ogc-api/csapi/integration/observation.spec.tssrc/ogc-api/csapi/factory.ts— JSDoc onlysrc/ogc-api/csapi/index.ts— barrel JSDoc onlysrc/ogc-api/csapi/model.ts— JSDoc onlysrc/ogc-api/csapi/formats/geojson.ts— JSDoc onlysrc/ogc-api/csapi/formats/part2.ts— JSDoc onlysrc/ogc-api/csapi/formats/swecommon/parser.ts— JSDoc onlyfactory.spec.ts(in the impl-guide table) andapp/Demo.vue/app/examples/edr.tscontained noDataStreamreferences — no edits required.Acceptance gates
npm run test:browser— 4 suites / 83 tests fail with the pre-existing Windows-only worker-timeout pattern (src/shared/http-utils.spec.ts,src/wms/endpoint.spec.ts,src/wmts/endpoint.spec.ts,src/wfs/endpoint.spec.ts). 1710 passed; 174.695 s. Identical to the A2/A3 baseline. No regression introduced by B1.Deviation from locked decision: none on strategy; one enumeration deviation (14th method) documented above.
Closing as completed.
examples: rename DataStream -> Datastream (B1 / Phase 8)