fix: approval-route ordering (missed by #6) + remove-offline-node action #7

Merged
james merged 2 commits from feat/remove-offline-node into main 2026-07-28 14:00:42 +00:00
Owner

Two changes, one of them a fix for a bug currently live on main.

1. Route-order fix (was missed by PR #6's merge)

GET /api/nodes/pending was declared after GET /api/nodes/:id, so Sinatra
matched pending as an :id → 404, and the "Nodes awaiting approval" section
never rendered. This fix (declaring the enrollment/approval routes before :id)
was pushed to PR #6 after it was merged, so it didn't ship — the approval UI is
currently broken on production. This PR carries it.

2. Remove-offline-node action

Clears a stale/offline node (e.g. the pre-keypair citadel duplicate left by the
identity migration) from the UI without touching the DB.

  • node_repository.delete removes the node row + its derived rows (node_files
    cache, queued node_commands).
  • DELETE /api/nodes/:id (session-authed, write role, main only) — refuses the
    main self-node (409). A still-live node just re-enrols as pending next check-in.
  • Nodes page: "Remove" button on offline, non-main node cards (confirm modal).

Full suite green — 1118 examples, 0 failures.

After merge: the approval section will work, and you can Remove the stale citadel
row once the real (keypair) citadel is approved.

🤖 Generated with Claude Code

Two changes, one of them a **fix for a bug currently live on `main`**. ## 1. Route-order fix (was missed by PR #6's merge) `GET /api/nodes/pending` was declared **after** `GET /api/nodes/:id`, so Sinatra matched `pending` as an `:id` → 404, and the **"Nodes awaiting approval"** section never rendered. This fix (declaring the enrollment/approval routes before `:id`) was pushed to PR #6 *after* it was merged, so it didn't ship — the approval UI is currently broken on production. This PR carries it. ## 2. Remove-offline-node action Clears a stale/offline node (e.g. the pre-keypair citadel duplicate left by the identity migration) from the UI without touching the DB. - `node_repository.delete` removes the node row + its derived rows (node_files cache, queued node_commands). - `DELETE /api/nodes/:id` (session-authed, write role, main only) — refuses the main self-node (409). A still-live node just re-enrols as pending next check-in. - Nodes page: "Remove" button on offline, non-main node cards (confirm modal). Full suite green — **1118 examples, 0 failures**. After merge: the approval section will work, and you can Remove the stale citadel row once the real (keypair) citadel is approved. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
GET /api/nodes/pending was being captured by GET /api/nodes/:id (id="pending"),
so the pending list always 404'd and the "Nodes awaiting approval" section never
appeared. Move the enrollment/approval routes above the :id routes (same fix the
overview endpoint already used) and add a regression test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(cluster): remove-offline-node action
All checks were successful
Build, Push & Deploy / build-and-push (pull_request) Has been skipped
Build, Push & Deploy / deploy (Media) (pull_request) Has been skipped
Build, Push & Deploy / deploy (citadel) (pull_request) Has been skipped
Build, Push & Deploy / test (pull_request) Successful in 1m3s
1786758b5b
Adds a "Remove" action so a stale/offline node (e.g. the pre-keypair citadel
duplicate left by the identity migration) can be cleared from the UI without
touching the DB.

- node_repository.delete removes the node row plus its derived rows
  (node_files browse cache, queued node_commands).
- DELETE /api/nodes/:id (session-authed, write role, main only) — refuses the
  main self-node (409). A still-live node just re-enrols as pending next check-in.
- Nodes page: "Remove" button on offline, non-main node cards (confirm modal).

Full suite green (1118 examples).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
james merged commit cfbfaf48d1 into main 2026-07-28 14:00:42 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
james/baktainer!7
No description provided.