Skip to content

fix(docker)(agentic_hosting#26): normalise sphere-sdk version before file: install - #24

Merged
vrogojin merged 1 commit into
masterfrom
fix/issue-26-sdk-version-normalize
Jun 10, 2026
Merged

fix(docker)(agentic_hosting#26): normalise sphere-sdk version before file: install#24
vrogojin merged 1 commit into
masterfrom
fix/issue-26-sdk-version-normalize

Conversation

@vrogojin

Copy link
Copy Markdown
Owner

Summary

Fixes the Invalid Version: 0.0.a1 failure that blocked the v0.2 docker-publish.yml build (run 27281190676).

Root cause

Stage-1 of the trader image build uses npm ci (lenient — installs from lockfile, doesn't strict-validate the file: dep's own package.json). Stage-2 uses npm install (strict — re-resolves the file: dep when the path changes via sed), which validates every encountered version against semver and refuses anything malformed.

Upstream sphere-sdk main currently carries "version": "0.0.a1" (commit b8b526d, "chore(release): 0.0.a1") — a1 is not a valid semver prerelease tag (must be [0-9A-Za-z-]+; the form 0.0.a1 parses as MAJOR.MINOR.PATCH where a1 isn't a number). All four rotations this PR is meant to pick up (#456/#457/#464/#447) landed after that bad version commit, so we can't sidestep by pinning earlier.

Fix

Insert npm pkg set version=0.0.0-dev --prefix sphere-sdk between the file: path rewrite and npm install:

RUN sed -i 's|"file:../sphere-sdk"|"file:./sphere-sdk"|' package.json \\
 && npm pkg set version=0.0.0-dev --prefix sphere-sdk \\
 && npm install --omit=dev --ignore-scripts

The version field on a file: dep is informational only — npm resolves by path, not by version constraint — so this rewrite has zero functional effect beyond letting the install proceed. Robust against any future invalid-semver drift upstream.

Follow-up

A separate upstream PR to sphere-sdk normalising the version field is appropriate (so other downstreams that depend on file:../sphere-sdk aren't broken). Tracked as task #37 in this session; will land asynchronously and not in this PR's critical path.

Test plan

  • CI (ci.yml) passes on this branch
  • After merge: delete the failed v0.2 release + tag, re-cut v0.2 release pointing at the new master HEAD
  • After release tag: docker-publish.yml builds + pushes ghcr.io/vrogojin/agentic-hosting/trader:v0.2
  • Downstream: vrogojin/agentic_hosting#27 can merge once image is live

Related

…file: install

Stage-1 of the trader image build uses `npm ci` (lenient — installs
from lockfile, doesn't strict-validate the file: dep's own
package.json). Stage-2 uses `npm install` (strict — re-resolves the
file: dep when the path changes via sed), which validates every
encountered version against semver and refuses anything malformed.

Upstream sphere-sdk main currently carries `"version": "0.0.a1"`
(commit b8b526d, "chore(release): 0.0.a1") — `a1` is not a valid
semver prerelease tag (must be `[0-9A-Za-z-]+` and the form here
`0.0.a1` parses as `MAJOR.MINOR.PATCH` where `a1` isn't a number).
The release-driven build of `trader:v0.2` failed at this exact line
with `Invalid Version: 0.0.a1` (run 27281190676).

Fix: insert `npm pkg set version=0.0.0-dev --prefix sphere-sdk`
between the file: path rewrite and `npm install`. The version field
on a file: dep is informational only — npm resolves by path, not by
version constraint — so this rewrite has zero functional effect
beyond letting the install proceed. Robust against any future
invalid-semver drift upstream.

A separate upstream PR to sphere-sdk main is appropriate to actually
fix the version field there. That's not in this PR's critical path;
this Dockerfile patch is enough to unblock the v0.2 image build.

Related: vrogojin/agentic_hosting#26 (the rebuild this unblocks),
unicity-sphere/sphere-sdk#475 (the soak that consumes v0.2 once it's
on ghcr.io)
@vrogojin
vrogojin merged commit cbad7e9 into master Jun 10, 2026
1 check passed
@vrogojin
vrogojin deleted the fix/issue-26-sdk-version-normalize branch June 10, 2026 14:09
@vrogojin
vrogojin restored the fix/issue-26-sdk-version-normalize branch July 15, 2026 14:13
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.

1 participant