Skip to content

fix(self): self upgrade fetches the newest build on its channel, verifies it, and upgrades every devlore program in the prefix - #1001

Merged
David-Noble-at-work merged 2 commits into
developfrom
fix/947-self-upgrade-fetches-nothing-it
Oct 1, 2026
Merged

David-Noble-at-work merged 2 commits into
developfrom
fix/947-self-upgrade-fetches-nothing-it

Conversation

@David-Noble-at-work

@David-Noble-at-work David-Noble-at-work commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Lane 20 of #949, alone (ruled 2026-09-29: "We'll four PRs: A, B, #959, and then C."). The rulings of 2026-09-30 are in the plan: "all programs together"; "a build keeps its own channel. the channel is stamped into the binary explicitly"; two channels, "develop and release"; "we will use githubs prerelease flag"; "we should use their word: --prerelease"; auto-upgrade stays with #83.

  • The channel, stamped: every binary carries Channel (develop or release) and Prerelease. Develop builds are develop; builds from main and release/* are release with pre-releases; a v* tag is release without. The build's stamp proof checks them; --version and version report them.
  • What a run installs, first to last: --from <archive>, --channel <develop|release>, a DEVLORE_VERSION pin, self.channel, the stamp. --prerelease comes with whichever decides. One --channel switches, and the installed builds keep the switch; self.channel and self.prerelease are the standing override.
  • Finding the release: release reads /releases/latest; develop, and release with --prerelease, read the list and each release body's Ref: line (10 pages at most). Downloads use the public links; GH_TOKEN goes only to api.github.com.
  • Verified before anything is unpacked: the checksums line by exact name, and GitHub's own digest. Unpacking is contained (absolute names, .. and symlinks refused) in scratch that goes on every exit, Ctrl+C included.
  • The suite upgrades together: lore, star and writ, as the prefix owns them by manifest, plus the running program. For each, the upgrade places the binary itself, then runs that program's own self install, so a release published before this change installs too. Already current is a no-op; --dry-run verifies and changes nothing; devlore-test and renamed binaries are refused.
  • A running binary is replaced, never rewritten: bin/<name>.new, renamed over the target; on Windows the running .exe goes aside to .exe.old, recorded so the next install retires it. A manifest that can't be written now fails the install.
  • Releases are tagged at the commit they were built from (gh release create --target <sha>): a build from main would otherwise be tagged on develop's head.

Also: the runner relays a child's narration as notes, serialized (a race found by -race); #944's plan takes its last three boxes and is complete.

  • Plan — docs/plans/fix/947-self-upgrade-fetches-nothing-it.md. It stays active: its last boxes are this machine's convergence and the follow-up issues.

Resolves #947

Test plan

  • Unit tests, each failing first: the precedence; every lookup path with its request count; the token on API requests only; checksum and digest refusals; contained unpacking; the suite, its refusals and the no-op; --from; --dry-run; interrupts; each GitHub error; replacing a running binary (fails with "text file busy" against the old code; runs on the required Windows test legs)
  • TestSelfUpgradeScenario: a real install upgraded from the installed copy, fixture stamped v0.0.0-scenario.1, byte-equal binaries, every manifest, Windows' .exe.old, and a no-op second run
  • Live, from a scratch prefix on linux-arm64: a build of this branch upgraded lore, star and writ to v0.1.0-dev.20260930194506 anonymously, verified; TMPDIR empty after; the owner's programs untouched
  • make test, make test-scenario; make vet-all and make lint-all on linux, darwin and windows, 0 issues; star lint go; star lint shell; the guides' frontmatter; make regenerate changes nothing
  • After the merge: this machine takes the merge's pre-release through the installer; on the next one, writ self upgrade moves all three, and a second run is a no-op

Time

Marker UTC Elapsed
opened (first commit) 2026-09-30T20:58:18Z —
submitted (PR opened) 2026-10-01T19:19:15Z 22.3 h after opened
merged 2026-10-01T19:32:49Z 0.2 h after submitted; 22.6 h in all

Computed by the algorithm of noblefactor-ops#188 at merge.

…s channel

self upgrade resolves a channel (develop or release; --prerelease adds
the release channel's pre-releases, by GitHub's own flag), finds the
newest release on it, verifies the archive against its checksums file
and GitHub's digest, and upgrades every devlore program in the prefix
together: it places each binary by rename, then hands the program to
its own self install. The channel is stamped into every binary and
overridden by --channel or self.channel. Resolves #947 when done; lane
20 of #949. The owner's rulings of 2026-09-30 are recorded in the plan.

Claude-Session: https://claude.ai/code/session_01DuNfZFyfxBoD9pdaiDEMrY
…fies it, and upgrades every devlore program in the prefix

self upgrade fetched nothing: it re-installed the running binary over
itself. Now it finds a release, verifies it, and upgrades the suite.

The channel. Every binary is stamped with its channel, develop or
release, and whether it takes the release channel's pre-releases (by
GitHub's own flag): develop builds are develop, builds from main and
release/* are release with pre-releases, a v* tag is release without.
The build proves the stamp binds, and --version and version report it.
What a run installs is decided first to last by --from, --channel, a
DEVLORE_VERSION pin, the shared self.channel setting, and the stamp;
--prerelease comes with whichever decides. One --channel switches, and
the new binaries keep the switch.

The release. release reads GitHub's /releases/latest; develop, and
release with --prerelease, read the release list and each body's Ref:
line, 10 pages at most. Assets come from their public download links;
GH_TOKEN goes only to api.github.com. The archive must match its
checksums line and GitHub's digest before anything is unpacked, into a
contained scratch directory that goes on every exit, Ctrl+C included.

The suite. lore, star and writ, as the prefix owns them by manifest,
plus the program running, upgrade together. For each, the upgrade
places the binary itself, then runs that program's own self install,
so a build published before this change installs too. Already current
is a no-op; --from installs a local archive; --dry-run verifies and
changes nothing. devlore-test and renamed binaries are refused.

A running binary is replaced by writing bin/<name>.new and renaming it
over the target; on Windows the running .exe is renamed aside to
.exe.old first, recorded so the next install retires it. A manifest
that can't be written now fails the install. Releases are tagged at
the commit they were built from (--target).

TestSelfUpgradeScenario upgrades a real install from the installed copy
on all six scenario legs. #944's plan takes its last three boxes and is
complete.

Resolves #947

Claude-Session: https://claude.ai/code/session_01DuNfZFyfxBoD9pdaiDEMrY
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.

self upgrade fetches nothing: it re-runs self install from the running binary, so no machine can move to a newer build

1 participant