From 1105a9bd52adedaf54be04942837233dd8d4898c Mon Sep 17 00:00:00 2001 From: Mike Swanson Date: Tue, 26 May 2026 08:07:34 -0700 Subject: [PATCH] sync: auto-sync from GURU-5070 at 2026-05-26 08:07:31 Author: Mike Swanson Machine: GURU-5070 Timestamp: 2026-05-26 08:07:31 --- session-logs/2026-05-26-session.md | 103 +++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/session-logs/2026-05-26-session.md b/session-logs/2026-05-26-session.md index ffeb149..0f21710 100644 --- a/session-logs/2026-05-26-session.md +++ b/session-logs/2026-05-26-session.md @@ -338,3 +338,106 @@ echo | openssl s_client -connect mail.westerntire.com:993 -servername mail.weste - IX AutoSSL schedule: every 3 hours (confirmed from log dir timestamps) - cPanel UAPI: `uapi --user= SSL remove_autossl_excluded_domains domains=` (note: `domains=`, not `domain=`) - New cert details: CN=mail.westerntire.com, Let's Encrypt R13, 2026-05-26 → 2026-08-24, auto-renews ~2026-07-25 + +--- + +## Update: 08:06 PT — MSP Pricing review + Coord ToDo system + +### User +- **User:** Mike Swanson (mike) +- **Machine:** GURU-5070 +- **Role:** admin +- **Session span:** ~07:30–08:06 PT + +### Session Summary + +Resumed from a previous context window. Session began with a review of the MSP pricing project artifacts. The `wiki/projects/msp-pricing.md` article was read to get the project overview, followed by directory listing of `projects/msp-pricing/` to surface all artifacts: pricing docs, Python calculators, HTML price sheets, and marketing materials (Buyers Guide, OnePagers, PDFs). + +Reviewed `docs/web-email-hosting-pricing.md` in detail at the user's request. Made three targeted edits: clarified the ACG Position section to show $175/hr as the standard rate and $130–150/hr as the block time effective rate; removed the INKY reference from the Email Security platform line (moving away from INKY); and updated the Last Updated date from 2026-02-01 to 2026-05-26 in both the header and footer. + +Designed and implemented a new `coord_todos` feature for the coordination API. The feature adds a `coord_todos` table with per-user, per-machine, and per-project scoping, sub-task support via self-referencing `parent_id`, and an `auto_created` flag for Claude-generated items. A `for_user`/`for_machine` filter using OR-NULL logic was added to support the sync/save display use case (show items assigned to the current user OR unassigned). The sync.sh script was extended with a new Phase 7 that fetches and displays pending todos grouped by project after every sync. CLAUDE.md was updated with auto-creation behavior guidelines and natural language query patterns. + +A `due_at` datetime field was added as a follow-up in a second migration. The sync.sh display was updated to show `due:YYYY-MM-DDTHH:MM` alongside items that have a due date. Both migrations were run on the production server (172.16.3.30). A test todo was created for today at 14:00: "Client pricing audit: compare current pricing for active clients against the client pricing project" (project: msp-pricing, id: de50e82a). + +### Key Decisions + +- **Separate `for_user`/`for_machine` vs `assigned_to_user`/`assigned_to_machine` params:** Exact-match params kept for admin queries; OR-NULL variants added for sync/save use. This avoids silently hiding unassigned todos from the sync display. +- **`due_at` in the text initially, then added as a column:** The first todo was created with "2pm" in the text before the field existed. After adding `due_at`, the todo text was cleaned up and `due_at` set to `2026-05-26T14:00:00`. +- **Two separate migrations rather than one:** `due_at` was added as a follow-up after the initial todos migration was already deployed, keeping the migration history clean and atomic. +- **Sub-tasks explicit delete before parent in service:** MySQL/MariaDB without `foreign_key_checks=1` may not cascade FK deletes at the application level; the service explicitly deletes sub-tasks first to be safe across engine configurations. + +### Problems Encountered + +- **Alembic not in PATH on Windows:** `python -m alembic` and `alembic` both failed locally (no venv activated, no alembic in system Python). Resolved by running the migration via SSH on the server where `/opt/claudetools` has a venv with alembic installed. +- **Migration file only exists locally:** After writing the migration, the server had no copy. Resolved with `scp` before running `alembic upgrade head` on the server. +- **`systemctl restart` requires sudo on the server:** First restart attempt failed without sudo. Resolved by prepending `sudo`. + +### Configuration Changes + +| File | Change | +|---|---| +| `projects/msp-pricing/docs/web-email-hosting-pricing.md` | ACG rate clarified, INKY removed, dates updated | +| `api/models/coord_todo.py` | New: CoordTodo ORM model | +| `api/schemas/coord_todo.py` | New: CoordTodoCreate/Update/Response schemas | +| `api/services/coord_todo_service.py` | New: CRUD service with for_user/for_machine OR-NULL filters | +| `api/routers/coord_todos.py` | New: 5 REST endpoints | +| `api/main.py` | Registered coord_todos router at /api/coord/todos | +| `api/models/__init__.py` | Added CoordTodo import | +| `migrations/versions/20260526_120000_coord_todos.py` | New: creates coord_todos table | +| `migrations/versions/20260526_150000_coord_todos_due_at.py` | New: adds due_at column | +| `.claude/CLAUDE.md` | Auto-todo creation behavior + query patterns documented | +| `.claude/scripts/sync.sh` | Phase 7 added: pending todo display after sync | + +### Credentials & Secrets + +None new. + +### Infrastructure & Servers + +- **Coord API:** http://172.16.3.30:8001/api/coord/todos (new endpoint, live) +- **DB:** MariaDB 172.16.3.30:3306 — coord_todos table added, migrations 20260526_120000 + 20260526_150000 applied +- **API service:** claudetools-api.service on 172.16.3.30 — restarted twice during this session + +### Commands & Outputs + +```bash +# Run migration on server +ssh guru@172.16.3.30 "cd /opt/claudetools && source venv/bin/activate && alembic upgrade head" +# INFO: Running upgrade 20260512_120000 -> 20260526_120000, coord_todos +# INFO: Running upgrade 20260526_120000 -> 20260526_150000, coord_todos add due_at column + +# Smoke test +curl -s "http://172.16.3.30:8001/api/coord/todos?status_filter=all&limit=1" +# [] + +# Create test todo +curl -s -X POST "http://172.16.3.30:8001/api/coord/todos" \ + -H "Content-Type: application/json" \ + -d '{"text":"Client pricing audit...","project_key":"msp-pricing","assigned_to_user":"mike","created_by_user":"mike","created_by_machine":"GURU-5070","auto_created":false}' +# id: de50e82a-30d1-479b-bf9c-522ca223d2cc + +# Set due_at after field was added +curl -s -X PUT "http://172.16.3.30:8001/api/coord/todos/de50e82a-30d1-479b-bf9c-522ca223d2cc" \ + -H "Content-Type: application/json" \ + -d '{"due_at":"2026-05-26T14:00:00","text":"Client pricing audit: compare current pricing for active clients against the client pricing project"}' +``` + +### Pending / Incomplete Tasks + +- [ ] Add `/todo` slash command as convenience wrapper (deferred — natural language sufficient for now) +- [ ] Client pricing audit todo (id: de50e82a) due 2026-05-26 14:00 — compare active client pricing vs msp-pricing project docs +- [ ] HIGH: `fix/audit-2-remediation` branch (gururmm) — awaiting merge + deploy +- [ ] HIGH: macOS PKG installer — plan at `projects/msp-tools/guru-rmm/agent/MACOS_INSTALLATION_PLAN.md` +- [ ] HIGH: Kittle WS2025 EVAL license + Kittle-Design inbox rule (potential active compromise) +- [ ] MEDIUM: TGC-SERVER Hyper-V disposition (MAS90 VM) +- [ ] MEDIUM: Neptune SSL — monitor auto-renewal before 2026-05-31 +- [ ] MEDIUM: Syncro ticket #32199 (Western Tire) — bill when scope confirmed +- [ ] MEDIUM: Syncro "DNS Detail" field on Western Tire customer still says "Email is on Websvr" + +### Reference Information + +- Commits this session: `4be8903` (coord todos initial), `1c038c7` (due_at field) +- Coord todos API: `GET/POST/PUT/DELETE http://172.16.3.30:8001/api/coord/todos` +- Test todo id: `de50e82a-30d1-479b-bf9c-522ca223d2cc` (msp-pricing, due 14:00) +- MSP pricing artifacts: `projects/msp-pricing/` — docs, calculators, HTML sheets, marketing +- Western Tire Syncro ticket: #32199 (ID: 109325058) — not yet billed