Skip to content

feat(build)!: move the build CLI and build() onto the coordinator - #654

Merged
karhu merged 5 commits into
tnet-157/6-build-preparedfrom
tnet-157/7-build-cli
Nov 10, 2026
Merged

karhu merged 5 commits into
tnet-157/6-build-preparedfrom
tnet-157/7-build-cli

Conversation

@karhu

@karhu karhu commented Nov 3, 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 the timenet-build build command and timenet_connectors.build() onto the coordinator.

Details

The timenet-build build command and timenet_connectors.build() still plan and build through build_one(), next to the coordinator of #652 (TNET-157). A remote --out builds and publishes in one step, and there --force can overwrite a published version.

  • The build command and timenet_connectors.build() build through build_release().
  • A local --out gets the release in place.
  • A remote --out gets the release in two steps. First, the release builds into the default local registry with open_access_only set. So a release that does not declare access open fails before any download. Then copy_release() publishes the release and its payload sources.
  • If the remote registry already holds the version, nothing builds, and the command says so on stderr.
  • The parents now land in the local registry. Without --fetch-from, a remote --out copies the missing parents from the remote, as before. --fetch-from works with a remote --out too.
  • The build command shows its progress with progress_renderer() of feat(build)!: build one prepared release in the built-in backend #653, which shows the copy steps and the build steps. It is the only place that chooses between no output, text lines and live bars.
  • --isolation and --no-isolation set the new BuildOptions.isolation, which overrides TIMENET_ISOLATION for the build. The process environment does not change. --quiet also silences the isolated child.
  • timenet_connectors.build() accepts only the dataset ID that a card declares. It and the build command take the release that the card declares from builders.declared().

Design decisions

  • A remote --out is a local build plus a copy, and the copy never changes a published version. So --force with a remote --out that already holds the version is a usage error, before any download.
  • A copy step takes a parent with each payload source at every depth, as copy_release() in feat(registry)!: copy a release between registries #649 does. The old path copied only the direct payload sources. The registry to copy from can hold a payload source without its own payload sources. Then the copy now fails with TimeNetMissingParentError. Every registry must hold the payload sources of every release that it holds.
  • With isolation on, the parent shows each copy and build step, and the child shows its own downloads and shards.

Breaking changes

  • timenet_connectors.build() raises TimeNetDatasetNotFoundError, not LookupError, for a dataset ID that no card declares, such as timenet/hello_world. For another version, it raises TimeNetVersionUnavailableError, which is a TimeFValidationError.
  • --force with a remote --out that already holds the version is now a usage error. Before, it published the version again.

Stack

Changes later in the stack:

Merge message

feat(build)!: move the build CLI and build() onto the coordinator

The timenet-build build command and timenet_connectors.build() build
through build_release(), so they share one planner.

- A remote --out builds into the default local registry first, with
  open_access_only set, and then publishes with copy_release(). If the
  remote already holds the version, nothing builds.
- A copy step takes each payload source of a parent at every depth.
  Every registry must hold the payload sources of each of its
  releases.
- --isolation and --no-isolation set BuildOptions.isolation for the
  build and leave the environment unchanged.

BREAKING CHANGE: timenet_connectors.build() raises
TimeNetDatasetNotFoundError instead of LookupError for an unknown
dataset ID.

BREAKING CHANGE: --force with a remote --out that already holds the
version is a usage error. Before, it published the version again.

@karhu
karhu added this pull request to stack #650 November 3, 2026 23:39
@karhu karhu changed the title tnet 157/7 build cli feat(build)!: move the build CLI and build() onto the coordinator Nov 3, 2026
@karhu
karhu force-pushed the tnet-157/7-build-cli branch 2 times, most recently from 754f745 to 113a4ff Compare November 4, 2026 12:01
@karhu
karhu force-pushed the tnet-157/7-build-cli branch from 113a4ff to f0e1b90 Compare November 4, 2026 12:42
@karhu
karhu force-pushed the tnet-157/7-build-cli branch from f0e1b90 to 28d3ae1 Compare November 4, 2026 13:08
@karhu
karhu force-pushed the tnet-157/7-build-cli branch 2 times, most recently from 5af49f0 to aa7b22c Compare November 4, 2026 13:34
Comment thread docs/cli/build.md Resolved
@karhu
karhu force-pushed the tnet-157/7-build-cli branch from 2a4813f to ab1ed3c Compare November 6, 2026 07:54
@karhu
karhu removed this pull request from stack #650 November 6, 2026 08:09
@karhu
karhu added this pull request to stack #699 November 6, 2026 08:10
@karhu
karhu force-pushed the tnet-157/7-build-cli branch from ab1ed3c to 53b679c Compare November 6, 2026 13:54
@karhu
karhu force-pushed the tnet-157/7-build-cli branch 3 times, most recently from bba4d01 to ccb9474 Compare November 7, 2026 15:20
@karhu
karhu force-pushed the tnet-157/7-build-cli branch from ccb9474 to a313cb5 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.

@karhu
karhu force-pushed the tnet-157/7-build-cli branch from a313cb5 to 9230e79 Compare November 10, 2026 15:50
@karhu
karhu removed this pull request from stack #699 November 10, 2026 15:58

@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 completed

Nothing new to post: everything this review found is already covered by existing comments on this pull request or didn't merit a separate one.

@karhu
karhu force-pushed the tnet-157/7-build-cli branch from 9230e79 to 9d83fe4 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 completed

Nothing new to post: everything this review found is already covered by existing comments on this pull request or didn't merit a separate one.

The build command of timenet-build and timenet_connectors.build() now
build through build_release(). They no longer plan and build the parents
through build_one().

A local --out gets the release in place. A remote --out gets the release
in two steps. First, the release builds into the default local registry
with open_access_only set. So a release that does not declare access
open fails before any download. Then copy_release() publishes the
release and its payload sources. If the remote registry already holds
the version, nothing builds. --force is then a usage error, before
anything runs, because a published version never changes. The parents
now land in the local registry, so --fetch-from works with a remote
--out too. If nothing runs, the command prints one status line on stderr
that says so, unless --quiet is set.

The progress renderer of the CLI shows the copy steps as well as the
build steps. It is now the only place that chooses between no output,
text lines and live bars. With isolation on, the parent shows only the
copy steps, because the child shows its own build lines. --isolation and
--no-isolation set the new BuildOptions.isolation, which the backend
reads before TIMENET_ISOLATION. The environment of the process stays
as it is.

timenet_connectors.build() accepts only the dataset ID that a card
declares. It and the build command take the release that the card
declares from builders.declared(). build_release() checks the requested
version against the card.

A copy step of build_release() takes a parent with each payload source
at every depth, through copy_release(). build_one() copied only the
direct payload sources. So a copy now fails if the registry to copy from
holds a payload source without its own payload sources.

ConnectorBuilder.build() still calls build_one(), because the client
still uses it. So build_one() and the hidden --pinned-by option of build
stay. build_one() loses its narrate option, because nothing sets it now.

BREAKING CHANGE: timenet_connectors.build() raises
TimeNetDatasetNotFoundError, not LookupError, for a dataset ID that no
card declares, such as the module spelling timenet/hello_world. It
raises TimeNetVersionUnavailableError, a TimeFValidationError, for
another version. --force with a remote --out of timenet-build build
that already holds the version is a usage error.

Part of TNET-157.
…--out

The build command now sets BuildOptions.quiet from its --quiet option.
Since the built-in backend reads only that option, --quiet silences the
isolated child again. timenet_connectors.build() keeps the default, so
its child prints its build lines and downloads.

A remote --out without --fetch-from now copies a missing parent from the
remote registry into the local one. Before this stack, a build into the
remote registry found the parents there, so timenet-build build child
--out <remote> worked when the remote held the parent. Now it works
again, and only the child builds. --fetch-from still wins when it is
given. The help text names the default.

Part of TNET-157.
Say only what a caller of the build command and of build() 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/7-build-cli branch from 9d83fe4 to e84e86f Compare November 10, 2026 17:41
@karhu
karhu merged commit 2e253ee into main Nov 10, 2026
4 checks passed
@karhu
karhu deleted the tnet-157/7-build-cli 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