Skip to content

Install a release without a clone: the release installer, and field upgrade for release installs (install.md chunk 3) - #214

Merged
ninjudd merged 14 commits into
mainfrom
install/release-installer
Oct 11, 2026
Merged

ninjudd merged 14 commits into
mainfrom
install/release-installer

Conversation

@ninjudd

@ninjudd ninjudd commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Field can now be installed without a clone. Piped from curl, or downloaded by field upgrade, install.sh installs the newest release:

curl -fsSL https://raw.githubusercontent.com/okamnesiac/field/v0/install.sh | bash

Before this, install.sh installed only the checkout it sat in, and anywhere else it told you to clone. Field releases publish no binaries (install.md §7.1, so no JUCE binary is ever distributed), so a release install builds from source as a checkout install does. It reads the version from package.json at v0, downloads GitHub's archive of that version's immutable tag into ~/.local/share/field/<version>/, runs the same builds with the same prerequisite checks, and sets up again the model workers you had in the version it replaces. Only then does it switch current to the new version with one atomic rename. A failed download, build, or worker setup therefore leaves the installed version current, the installer says so, and it removes what it built of the version that failed. field is a two-line shim in ~/.local/bin that runs current/dist/cli.js, so an upgrade relinks nothing and a release install needs no pnpm global bin directory. The installer keeps the version an upgrade replaced and removes older ones. JUCE's download goes into a cache shared by every version (native/audiod/CMakeLists.txt reads FIELD_FETCHCONTENT_BASE_DIR), so an upgrade doesn't clone JUCE again. The installer refuses a version from before release installs, such as 0.2.0, because that version's own field upgrade runs its install.sh as a checkout's and could never move off it. It also refuses in a Windows shell such as Git Bash, and refuses a bin directory it cannot write, before anything changes. It lists, replaces, and removes only the versions and downloads it can show it made, so a FIELD_DATA_DIR that holds other things loses none of them to a prune, and a directory of someone else's where the new version goes stops the install. A version's own installer, and field upgrade, take the directory beside a current link as the data directory only when the version's directory is named X.Y.Z, so a release unpacked as field-0.2.0 beside another program's current installs to the default instead.

field upgrade tells the two kinds of install apart the same way the installer does. A checkout, with src/cli.ts and a .git beside the installer, runs its own install.sh, as before. A release install reads release.conf, which records the repository and ref it follows, downloads install.sh at that ref, and runs it with the same target. FIELD_REPO and FIELD_REF follow a fork or pin a release, and FIELD_REF=v0 field upgrade leaves a pin. Under FIELD_OFFLINE, field upgrade downloads nothing and runs the installed version's own install.sh instead. field upgrade status compares the installed version with the release and checks each piece is built.

Most of the code and tests came from the live-supercollider session (the 0f5468d and ea305dd work-in-progress commits), which handed chunk 3 over before finishing it. This session merged main, finished docs/install.md, and revised the README and the CLI manual to lead with the one-line install now that the repository is public. It also ran the end-to-end checks that had never finished. Plan §2.1, §3.2, §4, §5, §6, and a new §10 describe chunk 3 as built. §7.5 (workers are set up again in each version) and §7.6 (no install.ps1 here) are now decided. A Windows installer moves to windows-portability.md §7.2, so the question keeps an owner. §9 also records the first release, 0.2.0, as #208's review suggested. Two test changes keep the much larger src/install.test.ts honest under vitest. It yields one event-loop turn after each test, because a minute of synchronous spawnSync tests left the worker's onTaskUpdate reply unread until it timed out as an unhandled error, with every test passing. It also takes a 30-second timeout, which the yield makes enforceable.

field.one/install.sh (chunk 4, okamnesiac/audiofield) serves install.sh at v0, so it starts doing anything useful only once a release contains this change. Merge this, release it with the Release workflow (minor, so 0.3.0), and only then merge chunk 4.

Testing

From the repository root of a checkout of install/release-installer, after pnpm install --frozen-lockfile:

  1. pnpm exec vitest run src/install.test.ts src/commands/upgrade.test.ts src/release.test.ts should report 3 files and 113 tests passed, with no unhandled errors. src/install.test.ts runs the real install.sh under real bash (macOS's 3.2 locally, 5 in CI) with stand-ins for pnpm, cmake, the CLI, and the downloads, and covers both modes and every status row. If Errors 1 error with Timeout calling "onTaskUpdate" comes back, the event-loop yield in its afterEach is gone.

  2. The full gate, pnpm typecheck && pnpm build && pnpm test && project check, gave 91 files, 1258 passed and 1 skipped, and valid plans, at 2a9277a. Build the daemon first with ./install.sh audiod, because this change edits native/audiod/CMakeLists.txt, the merge of main brings daemon changes, and ./install.sh status reports audiod-stale until you do. The daemon tests need the current build. src/keys/routing-voice.test.ts plays through scsynth on your default output device. At ce42ef9 it heard a peak of 0.0033 against its 0.01 threshold, with AirPods Pro as the default output, and it passed again at 2a9277a with nothing changed that reaches it, so a failure there points at the audio device rather than at this change.

  3. The release installer end to end, without touching GitHub or your own ~/.local. This is the harness I ran, in full, from any directory:

    E2E=$(mktemp -d); W=<this checkout>
    export FIELD_DATA_DIR=$E2E/data FIELD_BIN_DIR=$E2E/bin FIELD_RAW_URL=file://$E2E/serve/raw FIELD_ARCHIVE_URL=file://$E2E/serve/github PATH=$E2E/bin:$PATH
    cut() { mkdir -p $E2E/work/field-$1 $E2E/serve/github/okamnesiac/field/archive/refs/tags $E2E/serve/raw/okamnesiac/field/v0
      git -C $W archive HEAD | tar -x -C $E2E/work/field-$1
      sed -i '' "s/\"version\": \"[^\"]*\"/\"version\": \"$1\"/" $E2E/work/field-$1/package.json
      COPYFILE_DISABLE=1 tar -czf $E2E/serve/github/okamnesiac/field/archive/refs/tags/v$1.tar.gz -C $E2E/work field-$1
      cp $E2E/work/field-$1/package.json $E2E/work/field-$1/install.sh $E2E/serve/raw/okamnesiac/field/v0/; rm -rf $E2E/work; }
    cut 0.90.0; curl -fsSL $FIELD_RAW_URL/okamnesiac/field/v0/install.sh | bash
    field --version | head -1
    cut 0.91.0; field upgrade
    field upgrade status
    FIELD_OFFLINE=1 FIELD_RAW_URL=file:///nonexistent field upgrade status

    Run verbatim, the first install took 254 seconds. It printed building field-audiod for the first time: CMake fetches JUCE and compiles it and ended with switched … current -> 0.90.0. field --version printed field 0.90.0 (not a git checkout). field upgrade printed + curl -fsSL file://…/v0/install.sh | bash, then building field-audiod for this version: CMake compiles JUCE from its download in …/data/cache/fetchcontent, installed 0.91.0 in 61 seconds, and switched current. status showed release-latest 0.91.0 is installed and previous 0.90.0 … kept to switch back to by hand. If the upgrade's building row says fetches JUCE again, the cache isn't working. The offline status prints + …/data/0.91.0/install.sh status and release okamnesiac/field v0 (offline; not compared), and exits 0. cannot upgrade: could not download the installer there means it still downloads offline. At 98dc9d5, with my copy of the harness, an upgrade from 0.91.0 to a 0.93.0 cut from this head took 63 seconds, and the offline status printed those rows. The run leaves everything under $E2E; delete it afterwards.

    A failed release, in the same shell afterwards:

    sed -i '' 's/"version": "0.91.0"/"version": "0.92.0"/' $E2E/serve/raw/okamnesiac/field/v0/package.json
    curl -fsSL $FIELD_RAW_URL/okamnesiac/field/v0/install.sh | bash; echo "exit $?"
    field --version | head -1

    There's no archive for 0.92.0, so the install exits 1 with install.sh: 0.92.0 did not install, so 0.91.0 stays current and field still runs it, and field --version still prints 0.91.0. ls -a $E2E/data shows no 0.92.0 and no .download-0.92.0. Output that switches current before the failure, or a .download-0.92.0 left behind, means the change is wrong. (I ran this case with my own copy of the same harness, pointing v0 at 0.92.0 and, at 98dc9d5, at 0.94.0, each with no archive.)

Not verified: Linux, a real install from GitHub, and pruning a third version by hand (the unit tests cover pruning). The first real install is the release that carries this change.

📽️ Projector summary of 2a9277a: https://field.amnes.ac/reviews/214

… the install plan's chunk 3

The README and the CLI manual lead with the one-line release install now that the repository is public, and docs/install.md drops the private-repository token passage and gains the release install's status rows and environment variables. Plan §2.1, §3.2, §4, §5, and §6 describe chunk 3 as built, §7.5 and §7.6 are decided, and windows-portability.md §7.2 takes over a Windows installer.
…ut vitest's worker

Plan §10 records the end-to-end runs: a cold release install in 258 s, an upgrade through field upgrade in 58 s with no JUCE clone, a re-run in a second, and a failed release leaving the old version current. §9 records the first release, 0.2.0. src/install.test.ts yields one event-loop turn after each test, because a minute of synchronous tests left vitest's onTaskUpdate reply unread until it timed out, and takes a 30-second timeout, which the yield makes enforceable.

@ninjudd ninjudd left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

📽️ Projector review · 0.7.8 · model claude-opus-5-5 · effort xhigh · CHANGES REQUESTED · took 34m 25s

This change lets you install Field without a clone. Piped from curl, or downloaded by field upgrade, install.sh reads the version that package.json names at the moving v0 tag, downloads GitHub's archive of that version's immutable tag into a directory of its own under ~/.local/share/field, builds it the way a checkout install builds, sets up again the workers the old version had, and only then switches the current link with one atomic rename. A two-line shim in ~/.local/bin runs whatever current names. field upgrade tells a release install from a checkout and downloads the newest installer for a release install. The change knowingly leaves a Windows installer to windows-portability.md §7.2 and the field.one URL to chunk 4, and no real install from GitHub or on Linux has run yet.

4 finding threads: 0 resolved, 4 open

Covered 11 of 11 changed files; none are generated.

  • Not run. shellcheck is not installed on this machine, so install.sh had only bash -n. Neither a real install from GitHub nor a Linux run was possible here, as the pull request also says.
  • CI. linux passes at 830f3ab. windows failed on two tests outside this change. punch-daemon.test.ts lost the daemon mid-way through a loop take, which is the race #203 describes and open #204 fixes. push.test.ts hit vitest's 5-second timeout, the Windows timeout that failed release.test.ts and knobs.test.ts on other branches today. The CMakeLists.txt change does nothing unless FIELD_FETCHCONTENT_BASE_DIR is set, and CI does not set it.
  • Readiness. The install plan is in-progress at priority now. This change decides §7.5 and §7.6, §7.2 was already answered, and §7.4, the domain that serves the installer, is an open question from before that chunk 4 owns. windows-portability is in-progress at now. This change adds an item to its §7.2 inventory, which no chunk has scheduled yet, so no new question blocks either plan.

Suggestions

  • install.sh:537 says the repository is private until chunk 4, and install.sh:517 says GITHUB_TOKEN is there so a maintainer can install while it is private. The repository is public now, so give the reason plan §3.2 gives: it matters only for a private fork.
  • install.sh:937: refuse on Windows when uname -s is MINGW*, MSYS*, or CYGWIN*, with the message field upgrade gives on win32. At the base, a piped run stopped on every platform with "run this from a Field checkout". Now Git Bash goes on into a release install that the README says does not run on Windows yet. I could not run it there, so I don't know how far it gets.
  • install.sh:736 and install.sh:582: match only names made of digits and dots, the X.Y.Z that release_version requires. The pattern [0-9]*.[0-9]*.[0-9]* also matches a name such as 2024.01.15 photos, so a FIELD_DATA_DIR pointed at a shared directory would have prune delete it.
  • install.sh:892: also check that the bin directory can be written, in require_shim_free. write_shim runs after the switch, so an unwritable FIELD_BIN_DIR, such as /usr/local/bin on Linux, fails with a bare "Permission denied" after current has moved, and before release.conf and pruning.
  • src/commands/upgrade.ts:153: the comment says a root that does not exist fails below, but without deps.installer such a root goes down the release path and installs into the default data directory. Delete the comment or make it say that.
  • docs/install.md:59: list git among a release install's prerequisites, because native/audiod/CMakeLists.txt clones JUCE with it and the release path checks only node, pnpm, cmake, curl, and tar.
  • README.md:119: this change drops pnpm remove -g field, which was the only removal step for a checkout install. Add it beside "Remove a release install" in docs/install.md.
  • docs/projects/install/readme.md:338 points at "the release-install bullet at the end of this list", but two more bullets now follow the shim bullet. Name the bullet instead.
  • docs/projects/install/readme.md:739: §10.2 says the tests cover every status row, but nothing asserts release-ahead, and the release-mode cli-missing, cli-unbuilt, ui-missing, and audiod-missing rows are asserted only in checkout mode. Add the tests or narrow the claim.

What was checked

  • A truncated download runs nothing. Every command is inside a function, and main "$@" is the last line. Before it, the script only assigns variables. A piped run under bash 3.2 sees an empty BASH_SOURCE, so it never takes the checkout path.
  • What the installer trusts. It uses HTTPS by default and reads v0 only for the version, which it holds to X.Y.Z. It downloads the vX.Y.Z archive and refuses one that does not hold exactly one directory whose package.json names that version. FIELD_REPO and FIELD_REF are held to the characters GitHub allows before either goes into a URL. GITHUB_TOKEN goes to curl on standard input, only for GitHub's own hosts over HTTPS, in both install.sh and upgrade.ts.
  • The switch. current changes only after the download, the builds, and the worker setup succeed. The new link is renamed over the old one with rename(2), so mv never moves it into the directory the old link names. A function that fails at the end of an || list still stops the script under set -e; I checked that in bash 3.2. The shim single-quotes its path, and an existing field that is not the shim stops the install before anything changes.
  • Pruning. It keeps the new version and the one it replaced, which is the one field upgrade is running from.
  • Docs. Every section the changed docs cite exists and says what they claim, the new anchors resolve, the §4 and §7 decisions are appended with the alternatives that lost, and the wrapping matches the text around each edit.
  • Tests. pnpm install --frozen-lockfile, pnpm typecheck, bash -n install.sh, and project check pass. project check warns only that the AGENTS.md section and the site workflow are older shapes, which is not this change. pnpm exec vitest run src/install.test.ts src/commands/upgrade.test.ts src/release.test.ts passed 103 tests in 3 files with no unhandled errors. Before running them, I read how both test files sandbox: install.test.ts replaces the whole environment with a temporary HOME and a PATH of stand-ins, and upgrade.test.ts serves file:// URLs to stand-in installers. The reproductions behind the threads ran in the same kind of sandbox, and I removed it afterwards.

Comment thread src/commands/upgrade.ts Resolved
Comment thread install.sh Resolved
Comment thread docs/cli.md Resolved
Comment thread docs/install.md Resolved
@ninjudd
ninjudd marked this pull request as draft October 11, 2026 20:52
…line

In a release install, field upgrade always downloaded the newest
install.sh, and nothing read FIELD_OFFLINE, so FIELD_OFFLINE=1 field
upgrade status failed offline with "could not download the installer"
instead of reaching the status row that says it compared nothing.
Offline, it now runs the install.sh inside the installed version, with
FIELD_DATA_DIR set, which reports and rebuilds without downloading.
…to switch back to

When a download, build, or worker setup failed, release_failed said so
and left <data>/<version> in place. kept_versions lists every version
directory beside current, so the next field upgrade status printed the
half-built version as "previous ..., kept to switch back to by hand",
and docs/install.md's ln -sfn would have switched to a build with no
field-audiod. The exit trap now removes the version's directory and its
download, never the one current names, since the next install deletes
and downloads a version that is not current anyway.
The help still read "run this field's install.sh from anywhere", and the
comment above it said the command runs the installer beside its
package. A release install downloads the newest release's installer
instead, so the help now gives docs/cli.md's wording, and the comment
says which installer each kind of install runs.
…uld not move off

docs/install.md offered v0.2.0 as the exact tag to pin to, and said
FIELD_REF=v0 field upgrade follows v0 again. 0.2.0's field upgrade runs
the install.sh beside its package, which takes any directory with
src/cli.ts as a checkout and never reads FIELD_REF, so an install pinned
to it could never return to v0, and its upgrade would run pnpm add -g on
the release directory.

The installer now refuses a version whose install.sh writes no shim,
before anything is built or switched. A pin to a later tag still holds,
as release.conf records it, and FIELD_REF=v0 field upgrade leaves it.
The docs name vX.Y.Z rather than 0.2.0, say what a pin does, and plan
§4 records the decision with the alternatives that lost, among them
Projector's one-command PROJECTOR_REF.
- Refuse a release install in a Windows shell (MINGW, MSYS, or Cygwin),
  naming the checkout steps, as field upgrade refuses on Windows. A piped
  run used to stop everywhere, and Git Bash now went on into an install
  nobody has run there.
- Treat only X.Y.Z directory names as versions when status lists them and
  prune removes them. The glob it used also matched a name such as
  "2024.01.15 photos" in a shared FIELD_DATA_DIR.
- Check that the bin directory can be written before anything changes,
  because the shim is written after the switch.
- Say GITHUB_TOKEN matters only for a private fork, now the repository
  is public, and make upgrade.ts's comment on a missing root say what
  happens to it.
- List git among a release install's prerequisites, document
  pnpm remove -g field for a checkout install, and name the shim bullet
  in plan §4 rather than "the bullet at the end of this list".
- Test the release-mode release-ahead, cli-missing, cli-unbuilt,
  ui-missing, audiod-missing, and audiod-override rows, so §10.2's claim
  of every status row holds.

@ninjudd ninjudd left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

📽️ Projector review · 0.7.9 · model claude-opus-5-5 · effort xhigh · CHANGES REQUESTED · took 10m 11s

This change lets you install Field without a clone. Piped from curl, or downloaded by field upgrade, install.sh reads the version that package.json names at the moving v0 tag, downloads GitHub's archive of that version's own tag into a directory of its own under ~/.local/share/field, builds it the way a checkout install builds, sets up again the workers the old version had, and only then switches the current link with one atomic rename. A short shim in ~/.local/bin runs whatever current names, and field upgrade downloads the newest installer for a release install. Since the last review at 830f3ab, the branch merged main cleanly and fixed the four findings: offline, field upgrade runs the installed version's own installer; a failed install removes what it built; field upgrade --help names both installers; and the installer refuses a release from before release installs, such as 0.2.0. It also took every suggestion, including a refusal in a Windows shell, a bin-directory check before the switch, and an X.Y.Z pattern for the versions it lists and prunes.

5 finding threads: 4 resolved, 1 open

Covered 12 of 12 changed files; none are generated.

  • Not run. shellcheck is not installed on this machine, so install.sh had only bash -n. Neither a real install from GitHub nor a Linux run was possible here.
  • The merge. f0f61de is exactly the tree git merge-tree builds from 830f3ab and e791a11, so the merge resolved nothing by hand. main changed six of this pull request's files, and the pull request's own diff in each is the same as before.
  • CI. linux and windows both pass at 98dc9d5.
  • Readiness. The install plan stays in-progress at priority now. This head adds one decision to §4, on pinning to an exact tag, with the alternatives that lost, and opens no question. §7.4, the domain that serves the installer, is still the open question from before, and chunk 4 owns it.

Suggestions

  • src/commands/upgrade.ts:28: installerPath() has no caller now but its own test, because upgrade() builds join(root, 'install.sh'). Remove it and its test, or have upgrade() call it.

What was checked

  • The earlier findings, at this head.
    • Offline. I called the built upgrade('status') from current with FIELD_OFFLINE=1: it downloaded nothing and ran <data>/0.2.0/install.sh status with FIELD_DATA_DIR set.
    • Failed install. With the test harness, a 0.3.0 install that failed in the daemon build left no 0.3.0/, and status printed no previous row.
    • Help. node dist/cli.js upgrade --help names a checkout's own install.sh or the newest release's.
    • Pin. v0.2.0's install.sh carries no $SHIM_MARKER, so download_release refuses it before anything builds, and the new test covers that.
  • The suggestions that were taken. The Windows refusal runs first in release_main, before release_init. The bin-directory check walks up to the nearest directory that exists, so a bin directory not made yet passes when its parent can be written. The comments on GITHUB_TOKEN and on a missing root now say what the code does.
  • Tests. pnpm install --frozen-lockfile, pnpm typecheck, bash -n install.sh, and project check pass. pnpm exec vitest run src/install.test.ts src/commands/upgrade.test.ts src/release.test.ts passed 110 tests in 3 files with no unhandled errors. The reproductions ran in a temporary copy of the harness and a throwaway data directory, and I removed both.

Comment thread install.sh Resolved
…rectory that holds other things

prune treated any directory named X.Y.Z as a Field version, so a first
install into a FIELD_DATA_DIR holding 3.11.4/bin/python3 deleted it and
printed "removed 3.11.4". download_release likewise deleted whatever
directory had the name of the version it installed.

A directory now counts as a version only when it is named X.Y.Z and its
install.sh carries the shim's marker, which download_release requires of
every version, and a download only when it is .download-X.Y.Z holding
the unpacked/ the installer makes. prune, kept_versions, and the exit
trap act on nothing else, and a directory in the way that is neither
stops the install with exit status 69 before anything changes. The plan
no longer promises that a shared directory loses nothing; the docs say
to give FIELD_DATA_DIR a directory of Field's own and what the installer
writes there.
upgrade() builds join(root, 'install.sh') from a root it can be handed,
so installerPath() had no caller left. Its test now checks packageRoot(),
which upgrade() does call, against the install.sh beside the package.

@ninjudd ninjudd left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

📽️ Projector review · 0.7.9 · model claude-opus-5-5 · effort xhigh · CLEAN · took 6m 00s

This change lets you install Field without a clone. Piped from curl, or downloaded by field upgrade, install.sh reads the version that package.json names at the moving v0 tag, downloads GitHub's archive of that version's own tag into a directory of its own under ~/.local/share/field, builds it the way a checkout install builds, sets up again the workers the old version had, and only then switches the current link with one atomic rename. A short shim in ~/.local/bin runs whatever current names, and field upgrade downloads the newest installer for a release install. Since the review at 98dc9d5, the installer treats a directory as one of its versions only when it is named X.Y.Z and its install.sh carries the shim's marker, and as one of its downloads only when it is .download-X.Y.Z holding unpacked/. It stops with exit status 69 before replacing anything else. installerPath(), which nothing called, is gone.

5 finding threads: 5 resolved, 0 open

Covered 12 of 12 changed files; none are generated.

  • Not run. shellcheck is not installed on this machine, so install.sh had only bash -n. Neither a real install from GitHub nor a Linux run was possible here.
  • CI. linux and windows both pass at ce42ef9.
  • Readiness. The install plan stays in-progress at priority now. This head rewrites §3.2 step 5 to describe what the installer removes, and opens no question. §7.4, the domain that serves the installer, is still the open question from before, and chunk 4 owns it.

Suggestions

  • install.sh:489: infer the data directory from a current link beside the script only when the script's own directory is named X.Y.Z, as a version's own copy is. In a temporary copy of the test harness, I unpacked a release as opt/field-0.2.0/ beside another program's opt/current -> 2.0.1 and ran its install.sh. It deleted nothing, but it installed into opt/, pointed that program's current at Field's 0.2.0, and wrote release.conf there. With the check, GitHub's field-0.2.0 directory falls through to the default data directory.

What was checked

  • The earlier finding, at this head. In a temporary copy of the test harness:
    • Shared directory. A first install into a FIELD_DATA_DIR holding 3.11.4/bin/python3 and notes/ left both and printed no removed row.
    • Foreign directories in the way. A 0.2.0/ of someone else's, and a .download-0.2.0/ without unpacked/, each stopped the install with exit status 69 and the "is in the way" message, with the directory intact.
    • Another program's current link. The case above deleted neither of the other program's directories.
    • I removed the harness copy afterwards.
  • The exit trap. release_failed now removes the new version only when it is a Field version and not the one current names, and the download only when it is Field's. require_version_free runs before INSTALLING is set or the trap is armed, so a refusal there removes nothing.
  • All earlier threads. I verified the four fixes from the first review again by the tests that cover them, and all five finding threads are resolved.
  • Tests. pnpm install --frozen-lockfile, pnpm typecheck, bash -n install.sh, and project check pass. pnpm exec vitest run src/install.test.ts src/commands/upgrade.test.ts src/release.test.ts passed 111 tests in 3 files with no unhandled errors. No reference to installerPath remains.

@ninjudd
ninjudd marked this pull request as ready for review October 11, 2026 22:42
@ninjudd
ninjudd marked this pull request as draft October 11, 2026 22:44
…her program's current link is left alone

A release's own install.sh took any directory with a current link beside
the script's as its data directory. Unpacked as GitHub names it,
opt/field-0.2.0/ beside another program's opt/current -> 2.0.1, it
installed into opt/, pointed that program's current at Field's 0.2.0,
and wrote release.conf there. field upgrade made the same inference from
its package's real path, and read that directory's release.conf.

Both now infer the data directory only when the version's own directory
is named X.Y.Z, as the installer names every version, and fall back to
the default otherwise.

@ninjudd ninjudd left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

📽️ Projector review · 0.7.9 · model claude-opus-5-5 · effort xhigh · CLEAN · incremental from ce42ef9 · took 4m 35s

Incremental review of the change since the full review of ce42ef9: +51 −10 lines in 5 files.

This push takes the last suggestion: install.sh and upgrade.ts infer the data directory from a current link only beside a directory named X.Y.Z. In a test-harness sandbox, a release unpacked as field-0.2.0 beside another program's current -> 2.0.1 left that link, wrote nothing beside it, and installed into the default directory. Each changed check has one caller, which runs on a resolved path. The 113 focused tests, pnpm typecheck, and CI on linux and windows pass.

@ninjudd
ninjudd marked this pull request as ready for review October 11, 2026 22:54
@ninjudd
ninjudd merged commit 03b4a4a into main Oct 11, 2026
7 checks passed
@ninjudd
ninjudd deleted the install/release-installer branch October 11, 2026 22:58
ninjudd added a commit that referenced this pull request Oct 12, 2026
…e installer made (install.md §3.5) (#219)

Field can now be installed with one command, so it should be removable
with one too. Until now, removing a release install meant `rm -rf
~/.local/share/field ~/.local/bin/field` from the docs, and removing a
checkout install meant knowing to run `pnpm remove -g field`. This adds
`field uninstall`, which runs the installer's new `uninstall` target the
same way `field upgrade` runs the installer. Like `field upgrade`, it
uses a checkout's own `install.sh`, or the newest release's.

In a release install, the target removes only what the installer can
show it made, using the same tests `prune` uses. That means the shim
when it carries the installer's marker and runs this data directory's
`current`, every version and download the installer made, `current`,
`release.conf`, and JUCE's download in `cache/fetchcontent`. It then
removes the data directory if nothing else is left in it. Anything else
in the data or bin directory stays, with a `kept` row, because
`FIELD_DATA_DIR` can point at a directory that holds other things. The
shim goes first, so `field` never runs a half-removed version. A shim
that runs another data directory stays, with a `kept` row naming that
directory, so an install made with `FIELD_DATA_DIR` keeps its `field`.
The model workers' weights stay where each worker keeps them, and the
uninstall names them per worker that was set up: ACE-Step's in
`FIELD_ACE_MODELS` or `~/.field/models/acestep` (about 10 GB), and
Chatterbox's in the Hugging Face cache, which other tools share. For an
install that follows a fork, the closing "to install again" row names
the fork's installer. In a checkout install, the target runs `pnpm
remove -g field` only when pnpm's global `field` links that checkout,
and never deletes the checkout.

`curl -fsSL https://field.one/uninstall.sh | bash` will be the way to
uninstall when `field` itself no longer runs. That is a static file in
okamnesiac/audiofield's `apps/field-one/public` that runs this target,
so the logic stays in the one versioned, tested installer. It can merge
only after a release that carries this change, because 0.3.0's installer
rejects `uninstall` as an unknown target. The README and
`docs/install.md` mention it, and field.one's page doesn't. Plan §3.5
records the design, with a §4 decision listing the alternatives that
lost: a second `uninstall.sh` here, and a TypeScript-only `field
uninstall`.

This change also brings a few lines up to date now that field.one serves
the installer. The README, `docs/install.md`, and `docs/cli.md` lead
with `curl -fsSL https://field.one/install.sh | bash`, and the
installer's header comment does too. `docs/release.md`'s example bumps
`patch`, since releases are patch bumps from here on. Plan §10.3 records
the first real install from GitHub (0.3.0, 255 s on a Mac). Plan §6
marks chunks 3 and 4 shipped and adds this one. field#218 also edits §6
and `install.sh`, so whichever of the two merges second needs `main`
merged in.

## Testing

From the repository root of a checkout of `install/uninstall`, after
`pnpm install --frozen-lockfile`:

1. Run `pnpm exec vitest run src/install.test.ts
src/commands/upgrade.test.ts`. It should report 110 tests passed, with
no unhandled errors. The new `install.sh uninstall` block runs the real
installer under bash 3.2 against stand-ins and checks these cases:
- **A full removal.** After two releases are installed, the shim, both
versions, `current`, `release.conf`, the cache, and the data directory
are all gone, and no pnpm or curl command runs.
- **Another tool's files.** A foreign `field` in the bin directory and
other things in the data directory, such as `3.11.4/bin/python3`, are
kept and named.
- **Model weights.** ACE-Step's directory and the Hugging Face cache
stay, each named only for a worker that was set up, at the paths
`FIELD_ACE_MODELS` and `HF_HUB_CACHE` move them to.
- **Another install's shim.** A shim that runs another data directory,
or that another install wrote over this one's, stays; so does one whose
exec line cannot be read. A shim written through a link to the data
directory, with a path that needs quoting, is removed.
   - **A fork.** The "install again" row names the fork's installer.
   - **Nothing installed.** The target says so and changes nothing.
- **A checkout install.** The target runs `pnpm remove -g field` for its
own link, and the checkout's files stay.
   - **Another checkout's link.** It's left alone.

`src/commands/upgrade.test.ts` checks that `field uninstall` hands the
installer `uninstall` and returns its exit status, and that it refuses
on Windows by naming `pnpm remove -g field`. If an uninstall test fails
with the data directory "kept" though it's empty, the tests' PATH has
lost `rmdir`, which this change adds to the harness's tool list.
2. At the first head, `ef4ef2e`, the full gate `pnpm typecheck && pnpm
build && pnpm test && project check` gave 91 files, 1277 passed and 1
skipped, no unhandled errors, and valid plans. At `9b9357d`, `pnpm
typecheck`, `project check`, and step 1 pass, and CI runs the full
suite.
3. To run it end to end, without GitHub or your own `~/.local`, use the
harness steps from #214's Testing section: set `FIELD_DATA_DIR`,
`FIELD_BIN_DIR`, `FIELD_RAW_URL`, and `FIELD_ARCHIVE_URL` to a temporary
directory, `cut` a version from this commit, install it, and then run:

   ```sh
   field uninstall
   ls "$FIELD_DATA_DIR" "$FIELD_BIN_DIR/field"
   ```

I upgraded a harness install from 0.93.0 to a stand-in 0.95.0 cut from
this commit, then ran `field uninstall` through its shim. It printed `+
curl -fsSL file://…/v0/install.sh | bash -s -- uninstall`, then `removed
…/bin/field`, `removed 0.93.0`, `removed 0.95.0`, `removed …/data`, and
`uninstalled to install again: curl -fsSL https://field.one/install.sh |
bash`, and exited 0. Both `ls` targets were gone. If `field` crashes
after removing its own version, or the data directory survives with
nothing foreign in it, the change is wrong.

Not run: `field uninstall` against your real `~/.local/share/field`.
That would remove your 0.3.0 install, which another session's tests
currently use through `FIELD_AUDIOD`.

<!-- projector-summary v=1 sha=ed7690c62511e57adeba6d039eec514f8e35ae57
-->
📽️ **Projector summary** of ed7690c: https://field.amnes.ac/reviews/219

This branch was previously deployed

1 inactive deployment
github-pages — 2a9277a8 Deployed Oct 11, 2026 by ninjudd via publish #162
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