Skip to content

Add field uninstall: the installer's uninstall target removes what the installer made (install.md §3.5) - #219

Merged
ninjudd merged 5 commits into
mainfrom
install/uninstall
Oct 12, 2026
Merged

ninjudd merged 5 commits into
mainfrom
install/uninstall

Conversation

@ninjudd

@ninjudd ninjudd commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

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 Install a release without a clone: the release installer, and field upgrade for release installs (install.md chunk 3) #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:

    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 of ed7690c: https://field.amnes.ac/reviews/219

install.sh uninstall removes a release install's shim, versions, current, release.conf, and JUCE cache, only what the installer can show it made, then the data directory if it is empty; in a checkout it removes pnpm's link and never the checkout. The model weights stay in the shared Hugging Face cache, and the uninstall says where. field uninstall runs the target as field upgrade runs the installer. The README and docs lead with field.one/install.sh now that it serves the installer, docs/release.md's example bumps patch, and plan §10.3 records the first real install.

@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 of ef4ef2e · 0.7.10 · model claude-opus-5-5 · effort xhigh · CHANGES REQUESTED · took 9m 54s

This change adds field uninstall and an uninstall target to install.sh. In a release install, the target removes the shim, every version and download the installer can show it made, current, release.conf, and JUCE's download, then removes the data directory if nothing else is in it. Anything else stays, with a kept row. In a checkout install, it runs pnpm remove -g field only when pnpm's global field links that checkout, and it never deletes the checkout. field uninstall finds the installer the way field upgrade does. The change knowingly leaves field.one/uninstall.sh to okamnesiac/audiofield, after a release carries the target. It also points the README and docs at field.one/install.sh.

2 finding threads: 0 resolved, 2 open

Covered 10 of 10 changed files; no generated files.

The ownership tests hold up. A sandbox kept every decoy: an X.Y.Z directory without the marker, a symlinked X.Y.Z and its target, a .download-* without unpacked/, loose files, and another tool in the bin directory. Both findings are about what the uninstall tells you, or what it leaves without telling you.

Disclosures

  • shellcheck isn't installed on this machine, so install.sh got bash -n only.
  • Windows CI failed on one test, src/commands/push.test.ts "pushes, then offers every entry beneath main for HEAD", which timed out after 14 s. That is today's push timing flake, not this change's code. Linux and CodeQL passed.

What I ran at this head, in a scratch worktree

  • pnpm install --frozen-lockfile, pnpm typecheck, project check, and bash -n install.sh all exited 0.
  • pnpm exec vitest run src/install.test.ts src/commands/upgrade.test.ts passed 104 tests. Both files run against a temporary HOME and stand-ins, and the installer tests use a PATH that holds only stubs and links.
  • A sandbox with a temporary HOME, data and bin directories whose paths contain spaces, decoys, and refusing pnpm and cmake stubs, run under env -i. field uninstall ran through the shim, using the built CLI at this head, once with FIELD_OFFLINE=1 and once downloading the installer from a file:// FIELD_RAW_URL. Each time it removed the shim, both versions, the download, current, release.conf, and the cache, and exited 0 while running from the version it removed. A checkout whose path has a space was unlinked and left in place. The sandbox is deleted.

Readiness

The install plan stays in-progress, and this change opens no question in §3.5. §7.4, "Which domain serves the installer", is still open from before this change, although chunk 4 shipped field.one. It doesn't block.

Suggestions

  • README.md:108 and docs/install.md:239: field.one answers 404 for uninstall.sh today, and will until a release carries the target and audiofield deploys the file. curl -fsSL https://field.one/install.sh | bash -s -- uninstall works as soon as the release ships, with no second deploy, so the docs could give that form until uninstall.sh exists.
  • install.sh:950: the uninstall neither stops nor names a running field-audiod. A daemon that is playing never exits on idle (native/audiod/src/main.cpp:128), so it keeps running from the deleted version, and no field is left to stop it. A row naming the running daemon, or a refusal while one from the data directory runs, would close that.
  • src/commands/upgrade.ts:118: under field uninstall, a failed download reports cannot upgrade: …. The FIELD_OFFLINE row at docs/cli.md:635 names field upgrade but not field uninstall, which downloads the installer the same way.
  • docs/install.md:185 and plan §7.5 also say the workers' weights live in the Hugging Face cache. That predates this change, and the first finding's fix applies there too.

Comment thread install.sh Resolved
Comment thread install.sh Resolved

@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 of ef4ef2e · 0.7.10 · model gpt-6 · CHANGES REQUESTED · took 3m 15s

This change gives you field uninstall and an installer target that removes release files or a checkout's global pnpm link. It keeps foreign files and model weights, and records the uninstall design in the install plan. The separate field.one uninstaller still needs deployment after a release carries this target.

2 finding threads: 0 resolved, 2 open

Covered 10 of 10 changed files; no generated files skipped.

Both existing P2 findings remain valid at this head:

  • Shim ownership. A temporary reproduction confirms that uninstall deletes a shim pointing into another data directory and prints uninstalled, while that directory's version remains.
  • Model weights. python/aced/src/field_aced/adapter.py selects FIELD_ACE_MODELS or ~/.field/models/acestep; the new output and docs name only the Hugging Face cache.

The focused installer and upgrade tests, pnpm typecheck, project check, and bash -n install.sh pass. No new blocking finding was found. The install plan remains in-progress; its existing domain question predates this change and does not add a blocker here.

…ll.md §3.5)

The uninstall removed `$BIN_DIR/field` whenever it carried the
installer's marker. An install made with FIELD_DATA_DIR, uninstalled by
`curl … | bash -s -- uninstall` without it, passed the "nothing
installed" check on the shim alone, lost its shim, and printed
`uninstalled` while every version stayed. The shim was the one record
of where that install lived.

The uninstall now removes the shim only when its exec line runs this
data directory's `current`, read back from the quoting write_shim
writes. `field uninstall` names the data directory by its real path and
the shim keeps the path it was installed through, so the two compare as
files when their text differs. Any other release shim stays, with a
`kept` row that names its data directory and says to uninstall again
with FIELD_DATA_DIR set to it.
ninjudd added a commit that referenced this pull request Oct 12, 2026
…ows-portability.md §7.2) (#220)

The `windows` CI job still fails every few runs after #197, on `main`
and on branches alike, and every failure since is a vitest timeout in
`src/commands/clone.test.ts`, `push.test.ts`, or `pull.test.ts`. Each
test in those files sets up a project, a commit, and a bare remote, one
git or git-lfs process after another, and several then clone, push, or
pull. Starting a process is slow on the Windows runner, so on a run that
passes vitest reports 3 to 7 s for one of these tests, setup included,
against its 5 s test default and 10 s hook default. A process-start
stall then tips one over. #197 gave `clone.test.ts`'s `beforeEach` 30 s
for this reason, but left the test bodies and the other two files at the
defaults.

These are the six windows runs that timed out this way on 2026-10-11:

- **`main` at `e791a11`**
([run](https://github.com/okamnesiac/field/actions/runs/38176898514)):
clone's "accepts a full URL" and push's "pushes, then offers every entry
beneath main", each at 5 s.
- **#212**
([run](https://github.com/okamnesiac/field/actions/runs/38179875094)):
clone's "expands the short name" at 5 s, reported at 9.1 s, and pull's
`beforeEach` at 10 s, reported at 11.0 s.
- **#219**
([run](https://github.com/okamnesiac/field/actions/runs/38189357197)):
push's "pushes, then offers every entry beneath main" at 5 s, reported
at 14.2 s.
- **`live/monitor`**
([run](https://github.com/okamnesiac/field/actions/runs/38173858309)):
push's "pushes without a remote" at 5 s.
- **`projector-agents-v4`**
([run](https://github.com/okamnesiac/field/actions/runs/38173650201)):
pull's `beforeEach` at 10 s.
- **`install/release-installer`**
([run](https://github.com/okamnesiac/field/actions/runs/38171418583)):
push's "offers nothing for a working tree with uncommitted changes" at 5
s.

These read as slow runs rather than hangs. Vitest can fire a timeout
only when the event loop is free, and these tests spend long stretches
in synchronous git calls. So a test reported well past its limit, such
as the 14.2 s push on #219, was still making progress until the timer
fired. On that run the whole push file took 33 s against 17.6 s on
`main`'s passing run, so the runner was slow across the board.

All three files now give their `beforeEach` and every test in their
`describe` 30 s, through one `GIT_HEAVY_MS` constant per file, as
`release.test.ts` gives its git-heavy tests. `clone.test.ts`'s
`SETUP_TIMEOUT_MS` becomes that constant. 30 s is twice the slowest
timed-out test, so a timeout there now means a stall twice as long as
any seen, or a real hang. This differs from the "runner stalls" #197
left alone in `project.test.ts` and `live-session.test.ts`, whose hooks
are cheap and stalled once or twice. These tests use most of their
budget on runs where nothing stalls. Raising vitest's `testTimeout` for
the whole suite would also stop these failures, but it would hide real
hangs everywhere else. The Windows plan records the item in §7.2 as
done. The change touches tests and the plan, and no product code.

## Testing

From the root of a checkout of `windows/remote-test-timeouts`, after
`pnpm install --frozen-lockfile`. These three files need no native
build.

```sh
pnpm typecheck
pnpm exec vitest run src/commands/clone.test.ts src/commands/push.test.ts src/commands/pull.test.ts
project check
```

You should see `tsc --noEmit` print nothing, then `Test Files 3 passed
(3)` and `Tests 22 passed (22)`, then "Project plans are valid." On
macOS these tests pass with or without this change, so this only shows
nothing broke.

To see that the budget reaches both the hooks and the tests, shrink it
and watch the timeout messages name the new value:

```sh
sed -i '' 's/^const GIT_HEAVY_MS = 30_000;$/const GIT_HEAVY_MS = 100;/' src/commands/{clone,push,pull}.test.ts
pnpm exec vitest run src/commands/clone.test.ts src/commands/push.test.ts src/commands/pull.test.ts 2>&1 | grep -oE '(Test|Hook) timed out in [0-9]+ms' | sort | uniq -c
git checkout -- src/commands
sed -i '' 's/{ timeout: GIT_HEAVY_MS }/{ timeout: 100 }/' src/commands/{clone,push,pull}.test.ts
pnpm exec vitest run src/commands/clone.test.ts src/commands/push.test.ts src/commands/pull.test.ts 2>&1 | grep -oE '(Test|Hook) timed out in [0-9]+ms|Tests +[0-9].*' | sort | uniq -c
git checkout -- src/commands
```

The first run should report only `Hook timed out in 100ms`, because
every setup hook now fails first. The second should report `Test timed
out in 100ms` and `Tests 9 failed | 13 passed (22)`, beside the tail of
vitest's `Failed Tests 9` banner: the nine tests that wait on a real
clone, push, or pull time out, and the rest finish synchronously. A
`5000ms` or `10000ms` in either run means a hook or test still runs on
vitest's default, and the change is wrong. The `sed -i ''` form is BSD
sed, as on macOS. Each `git checkout -- src/commands` puts the files
back, and the tests remove their own temp projects, so nothing is left
behind.

The real check is this pull request's `windows` CI job, which cannot run
by hand here. Its `pnpm test` step should pass all three files. A `Test
timed out in 5000ms` or `Hook timed out in 10000ms` naming
`clone.test.ts`, `push.test.ts`, or `pull.test.ts` means the change is
wrong. A `30000ms` timeout there would be a new finding: a stall longer
than 30 s, or a hang. One green run proves little against a failure that
came every few runs, so the evidence builds over the next runs on
`main`.

<!-- projector-summary v=1 sha=205b0caa95d297c0823c7746b262708791e78577
-->
📽️ **Projector summary** of 205b0ca: https://field.amnes.ac/reviews/220
The `models-kept` row named only the Hugging Face cache, and printed
only when that cache existed. field-aced's ACE-Step, about 10 GB, never
goes there: `models_root` in python/aced picks FIELD_ACE_MODELS or
~/.field/models/acestep, and ACE-Step's `snapshot_download(local_dir=…)`
writes the files into it. On this machine that directory holds 9.4 GB,
against 4 KB of ACE-Step metadata in the Hugging Face cache. Only
field-voiced's Chatterbox weights are where the row said.

The uninstall now prints a row for each worker that was set up: ACE-Step's
directory for field-aced, which every Field install on the machine
shares, and the Hugging Face cache for field-voiced, which other tools
share, with HF_HUB_CACHE ahead of HF_HOME as huggingface_hub reads them.
docs/install.md, plan §3.5, §4, and §7.5, and the installer's comment on
setting workers up again said every worker's weights were in the
Hugging Face cache, and now say where each one's are.
…release

okamnesiac/audiofield#43 merged before a release carries the uninstall target, so until then the file runs 0.3.0's installer, which rejects the target with a usage error and changes nothing.

@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 of 9b9357d · 0.7.10 · model gpt-6 · CLEAN · took 2m 23s

This change gives you field uninstall and an installer target that removes release files or a checkout's global pnpm link, while keeping foreign files and shared model weights. This head fixes the two earlier findings by checking which data directory a shim runs and reporting each worker's actual weights directory. The field.one uninstaller has shipped, but needs a release carrying this target to work.

2 finding threads: 2 resolved, 0 open

Covered 10 of 10 changed files; no generated files skipped.

Both earlier findings are fixed and verified at this head. No blocking finding remains.

  • Shim ownership. The same temporary reproduction that deleted another install's shim at the earlier head now keeps it and names its data directory. The parser never evaluates shell text; the tests cover directory aliases and quoted paths.
  • Model weights. ACE-Step's row matches models_root, and Chatterbox's row respects its Hugging Face cache overrides. Worker detection occurs before versions are removed, and the new tests cover both workers and a single configured worker.
  • Integration. The command continues to delegate to the installer, preserves its exit status, and keeps checkout files. The full PR diff and the new commits were reviewed together.
  • Validation. pnpm typecheck, pnpm exec vitest run src/install.test.ts src/commands/upgrade.test.ts, project check, and bash -n install.sh pass.
  • Plan state. The install plan stays in-progress; its earlier domain question predates this change. The updated deployment reference matches merged okamnesiac/audiofield#43.

@ninjudd
ninjudd marked this pull request as ready for review October 12, 2026 01:29
# Conflicts:
#	docs/projects/install/readme.md
#	install.sh

@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 of ed7690c · 0.7.10 · model gpt-6 · CLEAN · took 3m 22s

This change gives you field uninstall and an installer target that removes release files or a checkout's pnpm link while keeping foreign files and shared model weights. This head merges main's prerequisite checks and resolves the installer and plan conflicts, retaining uninstall's shim-ownership checks and renumbering it to chunk 7.

2 finding threads: 2 resolved, 0 open

Covered 10 of 10 changed files; no generated files skipped.

This is a full review of the merged head. review.gate is unset, so incremental review cannot satisfy the gate required when the merge base moves.

  • Merge resolution. install.sh retains main's require_tools calls for build targets and keeps the new shim helpers. No caller of the removed require_fetch_tools remains. Uninstall bypasses build prerequisites in both release and checkout modes.
  • Earlier findings. Both resolved P2 findings remain fixed: a shim for another data directory stays, and each configured worker's own weights directory is named before its version is removed.
  • Integration. The full PR diff preserves the command's installer handoff and exit status, ownership checks, foreign files, and checkout contents. The plan records uninstall as chunk 7 alongside main's dependency-checking work.
  • Validation. pnpm typecheck, pnpm exec vitest run src/install.test.ts src/commands/upgrade.test.ts, project check, and bash -n install.sh pass.

No blocking finding remains. The plan stays in-progress; the domain decision brought in from main is settled on field.one, and this change introduces no new question.

@ninjudd
ninjudd merged commit 03f122c into main Oct 12, 2026
7 checks passed
@ninjudd
ninjudd deleted the install/uninstall branch October 12, 2026 01:42

This branch was previously deployed

1 inactive deployment
github-pages — ed7690c6 Deployed Oct 12, 2026 by ninjudd via publish #182
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