Commit 99cd14e
Paul C
v22.7.1: Predictive Inbox — multi-cluster fixes + Run buttons + clearer cards
Three fixes/improvements on the v22.7.0 Predictive Inbox surface,
all driven by feedback from operators running multi-cluster setups.
1. Multi-cluster filter no longer empties the list
The cluster aggregator was indexing nodes by `peer.id` (the
locally-assigned cluster key) but each peer's predictive
orchestrator stamps proposals with `state.node_id` (the peer's
self_id from /etc/wolfstack/node_id). The frontend's
`clusterByNode[scope.node_id]` lookup therefore failed for every
peer's proposal, defaulted to "WolfStack", and the cluster filter
excluded everything when the operator narrowed to anything else.
Fix: build_cluster_response now uses `peer.self_id` (with
`peer.id` as fallback when self_id hasn't been reported yet) as
the canonical NodeAggregateStatus.node_id, matching the same id
the proposals already carry.
2. Card clarity — every finding shows runtime + server + resource
prominently. New `predictiveRuntimeBadge()` maps each finding_type
to a coloured runtime badge (DOCKER 🐳, LXC 📦, VM 💻, CERT 🔒,
BACKUP 💾, SSH 🔑, NETWORK 🌐, SERVICE ⚙️, HOST 🖥️). Card header now
reads cluster · 🖥️ hostname · `resource_id`, so a Docker
restart-loop finding shows up as DOCKER badge + the host's
hostname + the container name without having to read the title.
3. Run buttons that drop the operator straight into a terminal
- New endpoint: `GET /api/proposals/{id}/command/{idx}` returns
the analyzer's recommended command + resolved console target
(type+name) + remote node_id when the finding is on a peer.
Auth-gated; the command comes from the proposal store on disk,
never from URL parameters, so there's no shell-injection
surface from a crafted link.
- New ▶ Run button per command, alongside the existing 📋 Copy.
Clicking opens `console.html` connected to the right place:
* `docker:<name>` → docker exec into the container
* `lxc:<name>` → lxc-attach
* `vm:<name>:...` → VM serial console (qm/virsh/socat)
* everything else (host mounts, certs, backups, sshd) → host
shell on the node the finding lives on
Cross-node findings open via the existing remote-console proxy
(`?node_id=...`), so operators on cluster Node A can still run
commands surfacing from Node B without first navigating there.
- Comment lines (commands starting with `#`) only get Copy, not
Run — running a comment is silly.
- The console reuses the existing AI-action-id stuffing pattern:
fetch the command after WS connects, write it to the PTY's
stdin, leaving the operator at the interactive prompt for
follow-up.
Tests still 157 passing. Code-reviewer reviews from the v22.7.0
deltas remain in effect.1 parent fc119f5 commit 99cd14e
4 files changed
Lines changed: 228 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17323 | 17323 | | |
17324 | 17324 | | |
17325 | 17325 | | |
17326 | | - | |
17327 | | - | |
17328 | | - | |
17329 | | - | |
17330 | | - | |
17331 | | - | |
| 17326 | + | |
| 17327 | + | |
| 17328 | + | |
| 17329 | + | |
| 17330 | + | |
| 17331 | + | |
| 17332 | + | |
| 17333 | + | |
| 17334 | + | |
| 17335 | + | |
| 17336 | + | |
| 17337 | + | |
| 17338 | + | |
| 17339 | + | |
17332 | 17340 | | |
17333 | 17341 | | |
17334 | 17342 | | |
17335 | 17343 | | |
17336 | 17344 | | |
17337 | 17345 | | |
17338 | 17346 | | |
| 17347 | + | |
17339 | 17348 | | |
17340 | 17349 | | |
17341 | 17350 | | |
17342 | | - | |
| 17351 | + | |
17343 | 17352 | | |
17344 | 17353 | | |
17345 | 17354 | | |
| |||
17589 | 17598 | | |
17590 | 17599 | | |
17591 | 17600 | | |
| 17601 | + | |
| 17602 | + | |
| 17603 | + | |
| 17604 | + | |
| 17605 | + | |
| 17606 | + | |
| 17607 | + | |
| 17608 | + | |
| 17609 | + | |
| 17610 | + | |
| 17611 | + | |
| 17612 | + | |
| 17613 | + | |
| 17614 | + | |
| 17615 | + | |
| 17616 | + | |
| 17617 | + | |
| 17618 | + | |
| 17619 | + | |
| 17620 | + | |
| 17621 | + | |
| 17622 | + | |
| 17623 | + | |
| 17624 | + | |
| 17625 | + | |
| 17626 | + | |
| 17627 | + | |
| 17628 | + | |
| 17629 | + | |
| 17630 | + | |
| 17631 | + | |
| 17632 | + | |
| 17633 | + | |
| 17634 | + | |
| 17635 | + | |
| 17636 | + | |
| 17637 | + | |
| 17638 | + | |
| 17639 | + | |
| 17640 | + | |
| 17641 | + | |
| 17642 | + | |
| 17643 | + | |
| 17644 | + | |
| 17645 | + | |
| 17646 | + | |
| 17647 | + | |
| 17648 | + | |
| 17649 | + | |
| 17650 | + | |
| 17651 | + | |
| 17652 | + | |
| 17653 | + | |
| 17654 | + | |
| 17655 | + | |
| 17656 | + | |
| 17657 | + | |
| 17658 | + | |
| 17659 | + | |
| 17660 | + | |
| 17661 | + | |
| 17662 | + | |
| 17663 | + | |
| 17664 | + | |
| 17665 | + | |
| 17666 | + | |
| 17667 | + | |
| 17668 | + | |
| 17669 | + | |
| 17670 | + | |
| 17671 | + | |
| 17672 | + | |
| 17673 | + | |
| 17674 | + | |
| 17675 | + | |
| 17676 | + | |
| 17677 | + | |
| 17678 | + | |
| 17679 | + | |
| 17680 | + | |
| 17681 | + | |
| 17682 | + | |
| 17683 | + | |
| 17684 | + | |
| 17685 | + | |
| 17686 | + | |
| 17687 | + | |
| 17688 | + | |
| 17689 | + | |
| 17690 | + | |
| 17691 | + | |
| 17692 | + | |
| 17693 | + | |
| 17694 | + | |
17592 | 17695 | | |
17593 | 17696 | | |
17594 | 17697 | | |
| |||
22053 | 22156 | | |
22054 | 22157 | | |
22055 | 22158 | | |
| 22159 | + | |
22056 | 22160 | | |
22057 | 22161 | | |
22058 | 22162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
196 | 222 | | |
197 | 223 | | |
198 | 224 | | |
| |||
0 commit comments