Skip to content

Phase D3a: rename the shared C API infrastructure to streamr* names#95

Merged
ptesavol merged 5 commits into
mainfrom
claude/d3a-streamr-api-rename
Jul 18, 2026
Merged

Phase D3a: rename the shared C API infrastructure to streamr* names#95
ptesavol merged 5 commits into
mainfrom
claude/d3a-streamr-api-rename

Conversation

@ptesavol

Copy link
Copy Markdown
Collaborator

Implements the renaming half of phase D3 (trackerless-network-completion-plan.md), resolving the naming decision deferred from the D1 review (PR #90), so the D3b wrapper extensions are written against the final names once.

Changes

  • New streamrcommon.h holds the infrastructure both APIs share, under neutral names: StreamrPeer (was struct Proxy), StreamrError (was Error; its proxy member becomes peer with the old spelling kept usable via an anonymous union — same storage, source-compatible), StreamrResult (was ProxyResult), streamrResultDelete, streamrInitLibrary, streamrCleanupLibrary.
  • streamrproxyclient.h keeps the old type names as typedef aliases and the old C symbols exported (delegating to the new ones), marked STREAMR_DEPRECATED for one release. The proxyClientNew/Delete/Connect/Publish calls keep their names — that API is genuinely about proxies.
  • streamrnode.h now uses the final names and drops its provisional-naming note.
  • Shared-library version 2.0.5 → 3.0.0, SOVERSION 2 → 3 (breaking release per the plan).
  • In-repo consumers updated to the final names: C++ wrapper header, Python wrapper bindings, integration/end-to-end/ts-interop tests. A dedicated test (StreamrProxyClientDeprecatedAliasTest.Pre30NamesStillWork) compiles against the deprecated aliases and pre-3.0 member spelling on purpose.

Validation

  • Full monorepo build green; streamr-libstreamrproxyclient lint green.
  • All 11 proxy-client integration tests + 9 streamrnode integration tests pass in the per-test-process mode CI uses (including the new alias test).
  • Observation while testing: running several tests in ONE process crashes in the second test — a pre-existing use-after-streamrCleanupLibrary() bug (getProxyClientApi() null deref, nothing re-inits), unaffected by this rename. Follow-up task filed.

Not in this PR (D3b, next)

Extending the language wrappers (C++, Swift, Kotlin, Python; Go decision) with the streamrNode* full-node API and per-wrapper round-trip tests.

🤖 Generated with Claude Code

ptesavol and others added 2 commits July 18, 2026 08:58
The proxy-prefixed shared infrastructure both APIs use moves to neutral
names in a new streamrcommon.h, per phase D3 of the completion plan (the
naming decision deferred from the D1 review):

- struct Proxy        -> struct StreamrPeer (StreamrEntryPoint stays as
                         an alias of it in streamrnode.h)
- struct Error        -> struct StreamrError; its 'proxy' member is now
                         'peer', with the old spelling kept usable
                         through an anonymous union (same storage)
- struct ProxyResult  -> struct StreamrResult
- proxyClientResultDelete   -> streamrResultDelete
- proxyClientInitLibrary    -> streamrInitLibrary
- proxyClientCleanupLibrary -> streamrCleanupLibrary

The old type names remain as typedef aliases and the old C symbols stay
exported (delegating to the new ones), marked deprecated for one
release, so existing proxy-API consumers keep compiling and linking. The
shared-library major version bumps to 3.0.0 (SOVERSION 3). The proxy
client calls (proxyClientNew/Delete/Connect/Publish) keep their names —
the API is about proxies; only the shared types in their signatures
changed spelling.

In-repo consumers (C++ wrapper header, Python wrapper bindings, the
integration/end-to-end/ts-interop tests) now use the final names, so the
D3b wrapper extensions are written against them once. A dedicated test
exercises the deprecated aliases and the pre-3.0 member spelling.

All 11 proxy-client integration tests and 9 streamrnode integration
tests pass in the per-test-process mode CI uses. (Running several tests
in ONE process crashes in the second test — a pre-existing library
re-init-after-cleanup bug, unaffected by the rename; follow-up filed.)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…#96)

- wrappers/cpp: new StreamrNode.hpp — RAII node wrapper (create/start/
  stop, joinStreamPart/leaveStreamPart, publish, subscribe with a
  std::function callback, neighborCount, setProxies), errors thrown as
  StreamrNodeError with a variant code, mirroring the existing
  StreamrProxyClient wrapper idioms. Subscription callbacks stay owned
  by the node until its destruction: the C API may still dispatch a
  message whose delivery already started when unsubscribe returns.
- wrappers/python: StreamrNode context manager over the streamrNode*
  ctypes bindings (same shape as ProxyClient); the message callback is
  bound with an explicit content length (payloads are opaque bytes).
  ctypes callback objects are kept alive until node deletion.
- Tests: StreamrNodeCppWrapperTest (two wrapper-created nodes form a
  stream-part topology and exchange a signed and an unsigned message;
  error mapping) wired into ctest with the streamrnode integration
  tests' 600 s budget, and the same round-trip in
  wrappers/python/tests/test_streamr_node.py with
  scripts/run-python-tests.sh staging the built library (pytest or
  direct run).
- StreamrProxyClient.hpp: one leftover deprecated-alias use
  (std::vector<Proxy>) moved to the final StreamrPeer name.

Local runs: cpp wrapper round-trip 2/2 in ~850 ms; python round-trip
green against the freshly built 3.0.0 dylib.

Swift (dist/ios-swift-package) and Kotlin (dist/android-library-module)
follow in the next increment together with the D2 mobile-platform
verification they depend on; the Go wrapper (wrappers/go, an
uninitialized submodule pointing at a separate repo) is proposed for
dropping from the D3 scope — decision left to review.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@ptesavol
ptesavol force-pushed the claude/d3a-streamr-api-rename branch from dd1c448 to c65035a Compare July 18, 2026 06:04
ptesavol and others added 2 commits July 18, 2026 12:39
Rebase fallout: #97 wrote ApiIsUsableAfterCleanupLibrary against the
pre-3.0 proxyClient* names, which this branch deprecates — the lint
step (deprecation warnings as errors) failed on every CI leg. The test
verifies the re-init contract, not the aliases, so it now uses the
final names; the dedicated deprecated-alias test keeps covering the old
ones.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The buildtree cache restores the newest previous tree on any key miss
and rebuilds incrementally. The repeated force-pushes on this branch fed
the legs an inconsistent restored state: ninja under-rebuilt, linking
the freshly named libstreamrproxyclient from a stale pre-rename object
(undefined streamrResultDelete/streamrInitLibrary in the wrapper test)
and failing dyndep generation in streamr-proto-rpc. Bumping the
generation forces one clean full build per leg and starts a fresh cache
lineage — the same documented remedy the v1 suffix itself came from.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the ci Pull requests that update Continuous Integration build label Jul 18, 2026
goproxyclient PR 1 (branch streamr-node-api, commit c500e43) adds the
full-node API to the Go wrapper — the last wrapper of phase D3b's
native-host set. The pointer references the pushed PR branch; advance it
to the merge commit when that PR lands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ptesavol

Copy link
Copy Markdown
Collaborator Author

Added the Go wrapper after all (overriding the drop proposal): goproxyclient#1 extends it with the streamrNode* API — full suite (existing proxy tests + new two-node round-trip) green in one process against the 3.0.0 library. The submodule pointer on this branch now references that PR branch; advance it to the merge commit once goproxyclient#1 lands. Note for release: the linux/darwin-amd64 embedded libraries in goproxyclient still need their 3.0.0 builds from the release pipeline.

@ptesavol
ptesavol merged commit 4a39d7d into main Jul 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Pull requests that update Continuous Integration build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant