Skip to content

TKM-177: Remove a shared plugin and keep its data - #266

Closed
JustKira wants to merge 4 commits into
feat/tkm-176-plugin-uploadfrom
feat/tkm-177-plugin-remove
Closed

JustKira wants to merge 4 commits into
feat/tkm-176-plugin-uploadfrom
feat/tkm-177-plugin-remove

Conversation

@JustKira

@JustKira JustKira commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Owners can delete a shared plugin with DELETE /plugins/{id}. The server refuses when a loaded plugin depends on that ID. Otherwise it publishes a catalog that changes only that plugin, cancels its running actions, and removes the stored ZIP and unpacked files. Plugin tables and data files are preserved. If deleting the stored files fails, the server reports the error and keeps the shared build running.

  • No underlying copy: 200 {"id":"example","removed":true}. The plugin stays gone after restart.
  • Overrides a copy from --plugins: 200 {"id":"example","removed":false,"reverted":true,"buildId":"<sha256>"}. The server validates the folder build before changing anything. If it cannot load, the shared build and package stay in place.
  • Application errors use the same 400 {"error":"…"} shape as upload and reload, including unknown IDs, dependents, and plugins managed outside the data folder. Local index errors point to tokamak plugin remove <id>. Authentication and owner failures use the existing 401 and 403 responses.

Fallback discovery and artifact reads run on a blocking task. Discovery skips unreadable manifests, and both startup and removal exclude symlinks into the package store from the local plugin list.

The window already updates its views from the published catalog, so no window or CLI changes are needed.

Evidence

Before: upload and reload were available, but there was no DELETE route. After: HTTP and WebSocket integration tests cover both removal outcomes, action cancellation and isolation, re-sharing with retained rows, restart, and refused requests. Regression tests verify that a deletion error preserves the running and stored build, an unrelated broken manifest does not block removal, and package store symlinks are ignored at startup and during fallback discovery.

  • cargo test -p server --no-fail-fast -- --test-threads=2: 201 passed, 0 failed, 2 ignored across the full suite. Plugin integration suite: test result: ok. 24 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 87.13s
  • bash .ci/check.sh rust: test result: ok. 17 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 7.09s
  • bash .ci/check.sh lint: Tasks: 3 completed
  • proto run bun -- test packages/cli/tests: 60 pass, 0 fail

Known limits

If the built-in copy’s manifest.json has been deleted by hand while its other files remain, DELETE of the shared override removes the plugin instead of refusing.

Merge Danger

Door: Two-way. An owner can share the same package again and recover the previous rows.

Blast Radius: Server. Each successful request changes only the addressed plugin.

@JustKira

Copy link
Copy Markdown
Contributor Author

Closing without merging. The plugin shape, the server engine and sign-in are being decided again (Linear TKM-194 and TKM-195), and this work sits on top of them. Nothing is lost: the head commit is b7b366b, and git fetch origin pull/266/head brings it back.

@JustKira JustKira closed this Nov 21, 2026
@JustKira
JustKira deleted the feat/tkm-177-plugin-remove branch November 21, 2026 18:09
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