Skip to content

feat(client)!: read releases through the coordinator - #660

Merged
karhu merged 6 commits into
tnet-157/11-read-coordinatorfrom
tnet-157/12-client-reads
Nov 10, 2026
Merged

karhu merged 6 commits into
tnet-157/11-read-coordinatorfrom
tnet-157/12-client-reads

Conversation

@karhu

@karhu karhu commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

The Stack

This stack covers refactoring the internal logic of how releases are resolved during read, download & build, in particular also in the context of parent releases / parent datasets. On top of that it refactors the public TimeNet APIs and CLI interfaces around these actions, to streamline the behavior across them.

This PR

Moves open(), load() and open_torch() of the client onto read_release().

Details

The client still opens a release through its own steps: _prepare(), _obtain() and _require_open() (TNET-157). #659 adds the read coordinator. This PR moves the client onto it.

  • open(), load() and open_torch() read through read_release(). A read opens each release where it is and copies nothing.
  • A local client asks its own registry first, then the registry that fetch_from names. If auto_build is set, it then asks the installed connectors. A remote client asks only its own registry and never builds.
  • _read_sources() maps fetch_from and auto_build onto that list of sources.
  • The error hints still name the two keywords. A missing release or payload source names each keyword that the call did not use. An access error on a local client with auto_build=False names auto_build=True.
  • _prepare(), _obtain() and _require_open() go away, and so does the before_fetch callback of prepare_local_copy(), which had no other caller.

Design decisions

  • The client reads in place, as the design asks. A copy into the local registry is the job of download(), which a later PR moves onto the same list.
  • Hints name a keyword only on a local client. A remote client cannot use fetch_from and never builds, so its errors name no keyword, except its hint to build the dataset locally.

Breaking changes

  • open(fetch_from=...) reads in place and copies nothing into the local registry.
  • A damaged local copy raises TimeNetFileError also with fetch_from, and the error has no repair hint.
  • "latest" (org/name@latest) is the highest version across the local registry, fetch_from and, with auto_build, the installed connectors. So a read can build a newer version that a connector declares.
  • Without a version, open(), load() and open_torch() read the newest version of the first source that serves the dataset. With @latest, they ask every source, so each registry must be reachable.
  • A payload source that the local registry lacks is read from fetch_from in place.
  • If auto_build is set, a registry that lists a release without serving it falls through to a build, also for a read.
  • The before_fetch argument of prepare_local_copy() is gone.

Stack

Changes later in the stack:

Merge message

feat(client)!: read releases through the coordinator

open(), load() and open_torch() read through read_release(), so a read
opens each release in place and copies nothing.

- A local client asks its own registry, then fetch_from, and then the
  installed connectors if auto_build is set. A remote client asks only
  its own registry and never builds.
- Error hints name each keyword that the call did not use.

BREAKING CHANGE: open(fetch_from=...) reads in place and no longer
copies into the local registry. A payload source that the local
registry lacks is also read from fetch_from in place.

BREAKING CHANGE: "latest" takes the highest version of every source,
so each registry must be reachable. With auto_build, the read can
build a newer version that a connector declares.

BREAKING CHANGE: A damaged local copy raises TimeNetFileError also
with fetch_from. prepare_local_copy() loses before_fetch.

@karhu
karhu added this pull request to stack #650 November 4, 2026 13:14
@karhu
karhu force-pushed the tnet-157/12-client-reads branch from 6a611d0 to 101f88c Compare November 4, 2026 13:16
@karhu
karhu force-pushed the tnet-157/12-client-reads branch from 101f88c to a25ce47 Compare November 4, 2026 13:34
@karhu
karhu force-pushed the tnet-157/12-client-reads branch from a25ce47 to 9993e86 Compare November 4, 2026 14:58
@karhu
karhu force-pushed the tnet-157/12-client-reads branch 3 times, most recently from f7264df to aba3694 Compare November 4, 2026 20:02
@karhu
karhu force-pushed the tnet-157/12-client-reads branch from 6ce6a2e to 409aaf2 Compare November 7, 2026 15:20
@karhu
karhu force-pushed the tnet-157/12-client-reads branch from 409aaf2 to 5d01262 Compare November 7, 2026 16:27
@karhu
karhu force-pushed the tnet-157/12-client-reads branch from 5d01262 to 0244b5f Compare November 7, 2026 17:40
@karhu
karhu force-pushed the tnet-157/12-client-reads branch from 0244b5f to 73b4b24 Compare November 7, 2026 22:40
@karhu
karhu force-pushed the tnet-157/12-client-reads branch from 73b4b24 to 4479e73 Compare November 9, 2026 13:56
@karhu
karhu force-pushed the tnet-157/12-client-reads branch from 4479e73 to 005c4ba Compare November 10, 2026 14:39

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings marked 🟡 are optional suggestions and need no follow-up push.

Comment thread packages/timenet/src/timenet/client.py Resolved
Comment thread packages/timenet/src/timenet/client.py Resolved
@karhu
karhu force-pushed the tnet-157/12-client-reads branch from 005c4ba to 175f32a Compare November 10, 2026 15:50

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No new blocking issues. 1 optional suggestion (a nit or a note on pre-existing code) was found and not posted. Nothing in this review needs a push before merging.

@karhu
karhu removed this pull request from stack #699 November 10, 2026 15:58
@karhu
karhu force-pushed the tnet-157/12-client-reads branch from 175f32a to 867cc8c Compare November 10, 2026 16:24
@karhu
karhu added this pull request to stack #772 November 10, 2026 16:24

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review found no issues

No high-confidence issues detected in this change.

open(), load() and open_torch() now read through read_release(), the
read coordinator. A read opens each release where it is and copies
nothing. A local client asks its own registry first, then the registry
that fetch_from names, then the installed connectors if auto_build is
set. A remote client asks only its own registry and never builds.

Without a version, a read takes the newest version of the first source
that serves the dataset. So a copy in the local registry answers, and
the read asks no other source and builds nothing. An empty version
string means the same. With org/x@latest or version="latest", a read
takes the highest version across all the sources.

_read_sources() maps fetch_from and auto_build onto that list of
sources. The error hints still name the two keywords. A missing release
or payload source names each keyword that the call did not use. An
access error on a local client with auto_build=False names
auto_build=True. A remote client keeps its hint to build the dataset
locally, and its other errors name no keyword.

_prepare(), _obtain() and _require_open() go away, and the client no
longer calls prepare_local_copy(). The before_fetch callback of
prepare_local_copy() had no other caller, so it goes too. No caller
passes pinned_by to plan_release_build() any more, so that parameter
goes as well.

BREAKING CHANGE: open(fetch_from=...) reads in place and copies nothing
into the local registry. A damaged local copy raises TimeNetFileError
also with fetch_from, and the error has no repair hint. "latest" is no
longer the same as no version. It is the highest version across the
local registry, fetch_from and, with auto_build, the installed
connectors. So a read of "latest" builds a newer version that a
connector declares, and it needs each registry to be reachable. A
payload source that the local registry lacks is read from fetch_from in
place. A registry that lists a release without serving it falls through
to a build when auto_build is set, also for a read. The message for a
missing release names each source, and the hint names
fetch_from=<registry> as a registry to read from. The before_fetch
argument of prepare_local_copy() is gone.

Part of TNET-157.
… glue

The comment on the read hints and the docstring of _read_sources now
start with "Glue:". They say that this code stays until the client takes
a list of sources.

Part of TNET-157.
The glue comment on the read hints and the glue note in the docstring of _read_sources() now
start with TODO(adrian), so a search finds each one that is left.

Part of TNET-157.
Say only what a caller of open(), load() and open_torch() needs to know.

Part of TNET-157.
Shorter docstrings for the code that this change adds or changes.

Part of TNET-157.
Drop tests that cannot fail or repeat other tests, and sharpen the rest.

Part of TNET-157.
@karhu
karhu force-pushed the tnet-157/12-client-reads branch from 867cc8c to a2fc3c4 Compare November 10, 2026 17:41
@karhu
karhu merged commit ada364a into main Nov 10, 2026
4 of 8 checks passed
@karhu
karhu deleted the tnet-157/12-client-reads branch November 10, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants