Skip to content

TKM-176: Receive and store a plugin package on the server - #265

Closed
JustKira wants to merge 3 commits into
feat/tkm-175-plugin-packfrom
feat/tkm-176-plugin-upload
Closed

JustKira wants to merge 3 commits into
feat/tkm-175-plugin-packfrom
feat/tkm-176-plugin-upload

Conversation

@JustKira

Copy link
Copy Markdown
Contributor

Summary

Workspace owners can upload a plugin without copying files onto the server.

PUT /plugins/{id}/package  x-tokamak-build-id: <manifest SHA-256>
  validate ZIP, manifest, every hash, API compatibility, and loaded dependencies
  stage the package beside the store
  prepare a catalog with only this plugin changed
  promote the package and publish through the existing reload path

The raw ZIP body is limited to 50 MiB and the unpacked contents to 200 MiB. Success returns {"status":"installed|updated|unchanged","id":"…","version":"…","buildId":"…"}. Package errors use the reload error shape, {"error":"…"} with code for index backfill failures. The body limit returns HTTP 413. Requests without owner access follow the reload route's authorization rules.

The server keeps the current ZIP and dist under <data>/plugins/<id>/ and recovers interrupted replacements on startup. Startup looks at the local index, stored packages, then --plugins, in that order. Uploads that would replace an indexed plugin are refused. Incompatible stored builds remain on disk and show as needs rebuild in GET /plugins. Public shared-server GET /health returns {"version":"…"}.

Two integration tests use HTTP and WebSocket against a real server with temporary storage. They cover installation, unchanged uploads, replacement, refusal and rollback, restart and row retention, and an unrelated plugin whose files change while its old build and action stay live.

Evidence

Before: the server had no package upload route and only loaded its configured installation and index.

After:

  • cargo test -p server --no-fail-fast -- --test-threads=2 — 192 passed; 0 failed; 2 ignored (summed across test targets). Plugin integration target: test result: ok. 15 passed; 0 failed; 0 ignored.
  • bash .ci/check.sh rust — test result: ok. 17 passed; 0 failed; 0 ignored for the server library.
  • bash .ci/check.sh lint — Tasks: 3 completed.
  • bash .ci/check.sh ts — Tasks: 10 completed for typecheck, Tasks: 7 completed for tests and web build, and 9 pass / 0 fail for release tests.
  • proto run bun -- test packages/cli/tests — 55 pass / 0 fail.

Merge Danger

Door: Two-way. The server change adds an endpoint and stores packages beside the database.

Blast Radius: Plugins. The existing reload route keeps its behavior; uploads change only the addressed build. Machine actions, sharing CLI commands, package removal, and window changes are outside this ticket.

@JustKira
JustKira changed the base branch from feat/tkm-172-doctor-report to feat/tkm-175-plugin-pack November 20, 2026 20:09
@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 64cdb26, and git fetch origin pull/265/head brings it back.

@JustKira JustKira closed this Nov 21, 2026
@JustKira
JustKira deleted the feat/tkm-176-plugin-upload 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