Skip to content

v3.51.0: superadmin can permanently delete a task from the cockpit (dashboard 0.26.0) - #139

Merged
puretensor merged 1 commit into
mainfrom
feat/superadmin-delete
Oct 19, 2026
Merged

puretensor merged 1 commit into
mainfrom
feat/superadmin-delete

Conversation

@puretensor

Copy link
Copy Markdown
Owner

What

The cockpit at ptask.tail07f9ef.ts.net, including its iOS home-screen app, could dismiss a task but never delete it. The task drawer (desktop panel and phone bottom sheet) now has Delete permanently for a task in any status: open, done or dismissed.

How

  • POST /api/tasks/<id>/delete shells pt rm --yes -- PT-N. It is tombstoned, so sync clients drop the task. The sidecar looks up the PT-N first, because pt rm reads a uuid as an open-task title and would miss closed tasks.
  • Superadmin-only, like approval decisions. The tailnet also carries the fleet's agents, so the request needs X-PTask-Decide-Token = PTASK_DASH_DECIDE_TOKEN. Without it the sidecar answers 403 decide_token_required or decide_disabled.
  • /api/config reports superadmin, so the button only shows where the token is configured. The cockpit asks for confirmation first, asks for the token once, and keeps it in localStorage.
  • The Rust pt serve dashboard does not get this button, because its config has no superadmin. Machine clients can already delete with task_delete on /sync.

Verification

  • 9 new sidecar tests in dashboard/tests/test_delete.py. All 124 Python and 24 Node dashboard tests pass.
  • End to end against real pt 3.50.6 on a scratch DB: a request without the token got 403. With the token, a done task was deleted by uuid, leaving a task.deleted tombstone attributed to dashboard.
  • Browser at 375×812 (iPhone size) against a local scratch copy: the button shows in the bottom sheet as a 44px touch target. The full flow worked: confirm, token prompt, delete, token stored, sheet closed, board refreshed. A dismissed task was deleted from the Recent view, and Cancel sent no request.

Deploy note

Production has no PTASK_DASH_DECIDE_TOKEN yet. It goes in ~/puretensor-tasks/.dashboard.env, the PureTensor instance only, and in Vaultwarden.

🤖 Generated with Claude Code

…ashboard 0.26.0)

The cockpit (and its iOS home-screen app) could dismiss a task but never
delete it. The task drawer, desktop panel and phone bottom sheet alike, now
has "Delete permanently" for a task in any status: open, done or dismissed.

- POST /api/tasks/<id>/delete shells `pt rm --yes -- PT-N` (tombstoned, so
  sync clients drop it). The sidecar looks up the PT-N first: `pt rm` reads
  a uuid as an open-task title and would miss closed tasks.
- Superadmin-only, like approval decisions: the tailnet also carries the
  fleet's agents, so it needs X-PTask-Decide-Token = PTASK_DASH_DECIDE_TOKEN
  (403 decide_token_required / decide_disabled otherwise).
- /api/config reports superadmin, so the button only shows where the token
  is configured. The cockpit confirms first, asks for the token once and
  keeps it in localStorage.
- Not on the Rust pt serve dashboard (no superadmin in its config); machine
  clients already have task_delete on /sync.

CI unblock: deny.toml ignores RUSTSEC-2026-0367/0368/0369 (zip 7.2.0,
published this month, failing cargo-deny on main too). All three are in
zip's extract(); our only zip user, candle-core 0.10.2 (native-ml), reads
entries by name and never extracts. The fix is zip >= 9 and candle 0.11.0
still pins zip ^8.6, so there is no upgrade path yet.

Tests: 9 new sidecar tests (any status by uuid or PT-N, token gate, disabled
without a strong token, bad ids never reach pt, cross-origin, pt failure,
markup); 124 Python + 24 Node dashboard tests pass. End to end against real
pt 3.50.6 on a scratch DB: a done task deleted by uuid, task.deleted
tombstone attributed to dashboard. Phone-size UI checked in a browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@puretensor
puretensor force-pushed the feat/superadmin-delete branch from 48dfd75 to c576b58 Compare October 19, 2026 11:59
@puretensor
puretensor merged commit 715d04b into main Oct 19, 2026
5 checks passed
@puretensor
puretensor deleted the feat/superadmin-delete branch October 19, 2026 13:21
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