# GuruRMM — SPEC-012 Sortable Table Headers + Coord Message Handling

## User
- **User:** Howard Enos (howard)
- **Machine:** Howard-Home
- **Role:** tech

---

## Session Summary

Session opened with two unread coord messages from Mike (GURU-5070) regarding the LHM/WinRing0 removal. The first (02:59) was an in-flight notice: LibreHardwareMonitor was pulled from the GuruRMM agent after Microsoft Defender flagged the bundled WinRing0 kernel driver (CVE-2020-14979, VulnerableDriver:WinNT/Winring0) across 58 Windows agents. Commit bc3c2bd removed LHM from both MSI installers, dropped the LHM build stage, and made LhmGuard::start() a no-op. The second message (03:13) confirmed the build completed: agent v0.6.46 built clean on Pluto (1126s, beta channel), all artifacts signed and published, component state updated to deployed. A pending cleanup task (todo 42c08298) was noted for the WinRing0 kernel service that remains registered on already-affected endpoints — the MSI MajorUpgrade removes the lhm folder but does not stop/delete the service entry.

Howard submitted a GuruRMM feature request for sortable table column headers on list views (Clients, Sites, Agents). The /feature-request skill was invoked to research, classify, and produce a full specification. Codebase research confirmed no existing sort logic anywhere in the dashboard — all three list pages use static `<th>` elements with no sort state. Filtering (search) already uses client-side `.filter()` on pre-fetched data, making client-side sort with `.sort()` the natural extension — no server or API changes needed. Ollama (qwen3:14b) handled both the initial classification and the spec narrative draft, with qwen3.6:latest unavailable on this machine.

SPEC-012 was written to `docs/specs/SPEC-012-sortable-table-headers.md` in the gururmm repo. The spec calls for a shared `useSortState<T>` hook and `SortableHeader` component to avoid repeating sort logic across Clients.tsx, Sites.tsx, and Agents.tsx. Sort is applied after filtering, Actions column is always non-sortable, and no feature flag is needed since it is purely additive UI. Effort estimated at Small (4 hours total). FEATURE_ROADMAP.md updated under Dashboard Features / Core UX. Committed to gururmm, rebased past incoming remote commits from Mike, pushed to main. Submodule pointer in claudetools advanced. Coord message sent to all sessions notifying Mike the spec is ready for review.

---

## Key Decisions

- **Client-side sort only** — data is already loaded for all three list pages; server-side sort would add API complexity for no user-visible benefit at current data volumes.
- **Shared hook + component over per-page implementation** — three pages with identical sort logic is the threshold where a `useSortState<T>` hook pays for itself; avoids drift between pages.
- **Sort applied after filter** — combined search + sort is the useful case (e.g. filter by client name, then sort by Created). Resetting sort on search change would break this.
- **Actions column permanently non-sortable** — Actions is a UI control column, not a data field; sorting by it has no meaning.
- **No feature flag** — purely additive frontend change with zero backend coupling; safe to ship in any dashboard build without gating.
- **Used qwen3:14b for both classification and spec** — qwen3.6:latest is not installed on Howard-Home; qwen3:14b produced equivalent output for this task.
- **SiteDetail.tsx agent table excluded from v1** — lower-traffic page, adds scope creep; deferred explicitly in the spec.

---

## Problems Encountered

- **Ollama qwen3.6:latest HTTP 404** — model not installed on Howard-Home. Resolution: switched to qwen3:14b for both classification and spec generation. Output quality was equivalent.
- **Unicode encode error in Ollama prompt** — triangle characters (▲/▼) in the prompt file caused `UnicodeEncodeError: 'charmap' codec can't encode character` on Windows cp1252. Resolution: replaced with ASCII "asc/desc indicator" in the prompt file; spec file itself uses Unicode safely via the Write tool.
- **gururmm push rejected (fetch first)** — Mike had pushed commits to gururmm main between local commit and push attempt. Resolution: `git pull --rebase origin main && git push origin main`.

---

## Configuration Changes

- `projects/msp-tools/guru-rmm/docs/specs/SPEC-012-sortable-table-headers.md` — created (214 lines)
- `projects/msp-tools/guru-rmm/docs/FEATURE_ROADMAP.md` — added SPEC-012 entry under Dashboard Features / Core UX
- `projects/msp-tools/guru-rmm` (submodule) — advanced to commit 810c72d

---

## Credentials & Secrets

None created or modified this session.

---

## Infrastructure & Servers

- **GuruRMM server:** 172.16.3.30:3001
- **Agent v0.6.46:** built on Pluto (172.16.3.36), beta channel, LHM removed, WinRing0 folder purged via MajorUpgrade
- **Coord API:** http://172.16.3.30:8001/api/coord
- **Ollama:** http://localhost:11434 — qwen3:14b used (qwen3.6:latest not installed)

---

## Commands & Outputs

```bash
# gururmm commit
git commit -m "spec: add SPEC-012 sortable table column headers"
# → [main 4a51132] — 2 files changed, 214 insertions(+)

# Push rejected, rebased
git pull --rebase origin main && git push origin main
# → Successfully rebased; pushed bd35479..810c72d

# Submodule advance in claudetools
git commit -m "chore(gururmm): advance submodule to SPEC-012 (sortable table headers)"
git push origin main
# → 9f27703..243aa58

# Coord message sent
POST /api/coord/messages → id: 71e928c7-8cf4-4c1d-bd8e-4eccc69140b1
```

---

## Pending / Incomplete Tasks

- **WinRing0 kernel service cleanup (todo 42c08298):** MSI MajorUpgrade removes the lhm folder but does not stop/delete the registered WinRing0 kernel service on already-affected endpoints. Separate cleanup task — extend installer/cleanup/ or push `sc.exe stop/delete` via RMM command. Assigned to gururmm project.
- **SPEC-012 implementation:** Sortable headers spec ready for sprint assignment. Estimated 4 hours. No blockers.
- **BUG-001 (Windows thermal collection):** Still blocked pending WMI ACPI (Approach 1) and NVAPI (Approach 2) implementation. LHM removal from v0.6.46 means Windows temps are now always None.

---

## Reference Information

- **SPEC-012:** `projects/msp-tools/guru-rmm/docs/specs/SPEC-012-sortable-table-headers.md`
- **gururmm commit:** 810c72d (SPEC-012 spec + roadmap update)
- **claudetools commit:** 243aa58 (submodule advance)
- **Coord message ID:** 71e928c7-8cf4-4c1d-bd8e-4eccc69140b1
- **Agent v0.6.46 artifacts:** /var/www/gururmm/downloads/ on 172.16.3.30
- **WinRing0 cleanup todo:** 42c08298 (coord API, project_key=gururmm)
- **Pages to modify for SPEC-012:** dashboard/src/pages/Clients.tsx:198, Sites.tsx:508, Agents.tsx:312
