sync: auto-sync from GURU-5070 at 2026-06-05 15:07:30

Author: Mike Swanson
Machine: GURU-5070
Timestamp: 2026-06-05 15:07:30
This commit is contained in:
2026-06-05 15:07:37 -07:00
parent 59647ee666
commit 528bc9ce2f

View File

@@ -96,3 +96,39 @@ Dataforth: created AD1 MSP360 `Files` backup plan (via RMM); updated `clients/da
- Coord todos: unified audit_log `55806c36`; backup per-plan bug `7adaedc6` (folded into SPEC-026).
- Skills: `.claude/skills/agy/`, `.claude/skills/grok/`. Memory: `.claude/memory/feedback_no_manufactured_guardrails.md`.
- testuser_antigravity id `0b4f0b73-3ad0-4469-b885-cbbb8bede701`.
## Update: 22:06 PT — SPEC-027 User Management shipped + branch recovery
### Summary
Shipped SPEC-027 (admin user management) to production. Before committing, discovered the gururmm submodule HEAD was on `redesign/dashboard` (commit `ab3bed6`, a dashboard-redesign-docs commit from the separate `2026-06-05-rmm-dashboard-redesign-cdp` session), and that the reviewed SPEC-027 code was still uncommitted in the working tree — the redesign-docs commit had also landed on the `feat/spec-027-user-management` branch pointer. Recovered by checking out the SPEC-027 branch (carrying the uncommitted changes), `git reset --mixed origin/main` to un-commit the redesign docs (reverting them to untracked, preserved on `redesign/dashboard`), then staging only the 17 SPEC-027 files for a clean commit. Merged to main, built+deployed the server, applied migration 053, and validated the full flow live. Mike confirmed the redesign branch is intentional WIP — keeping it to finish the UI redesign first.
### Key Decisions
- Recovered SPEC-027 via `reset --mixed origin/main` rather than cherry-pick — the SPEC-027 changes were uncommitted working-tree state, so resetting the branch pointer off `ab3bed6` cleanly separated them from the redesign docs without touching the redesign branch.
- Created the validation target user with role `admin` (not `user`) so no org assignment was needed (admin roles reject org_ids) and the last-active-dev_admin disable guard did not apply.
- Bootstrapped the one required admin token by temporarily promoting the existing test account `testuser_antigravity` to `dev_admin` via a reversible DB UPDATE, logging in through the real `/auth/login`, then reverting to `user` — avoided handling any human's password or minting a JWT from the secret. Everything else ran through the live API.
- Confirmed runtime-sqlx only (no `query!`/`query_as!` macros) in the SPEC-027 files before triggering the `SQLX_OFFLINE=true` server build — no prepared cache needed; build would otherwise have failed on migration 053.
### Problems Encountered
- Submodule on wrong branch (`redesign/dashboard`) with SPEC-027 uncommitted — Gitea Agent correctly STOPPED on the precondition. Resolved with the reset-based recovery above; redesign work preserved.
- Build warned `update_user_fields`/`update_user_password`/`delete_user` "never used" — traced the PATCH/reset handlers; they call the `_tx` variants (`update_user_fields_tx`, `update_user_role_tx`, `bump_token_version_and_flag_tx`) the review required for FOR UPDATE atomicity. The non-tx helpers are dead leftovers (no security impact); flagged for deletion.
- Server deploy is NOT part of the agent webhook pipeline (that builds agents only) — server is `sudo /opt/gururmm/build-server.sh` on Saturn; ran it manually (self-contained: fetch/reset, change-gate, build, backup, deploy, restart, health-check + auto-rollback).
### Configuration Changes
- gururmm submodule: commit `8bcb024` (SPEC-027, 17 files), merge `7282020` to main; deployed SHA `3963c0c` (= merge + agent-pipeline auto-changelog commit).
- Server binary `/opt/gururmm/gururmm-server` v0.3.43 deployed; migration `053_user_management.sql` applied.
- `redesign/dashboard` branch (`ab3bed6`) preserved; redesign working-tree strays (Layout.tsx, index.css, package-lock.json, ContextTree/FunctionRail/InfrastructureSpine.tsx) left uncommitted on the feature branch for the redesign session to continue.
### Commands & Outputs
- Server build/deploy: `ssh guru@172.16.3.30 'sudo /opt/gururmm/build-server.sh'` → "Server build complete: v0.3.43" (released in 2m03s, healthy start).
- Migration check: `sudo -u postgres psql -d gururmm -tAc "SELECT version,success FROM _sqlx_migrations WHERE version=53;"``53|t`.
- Live validation harness (curl against http://172.16.3.30:3001/api): create→201, setup redeem→200, target login→200, pre-disable /auth/me→200, disable→200, post-disable /auth/me→403 (revoked), re-redeem setup token→400 (single-use). Cleanup: target deleted (204), testuser reverted to `user`, 0 orphan setup tokens.
### Pending / Incomplete Tasks (delta)
- SPEC-027 DONE (shipped + validated). Remaining LOW: run `#[sqlx::test]` DB suite in CI; org-level last-admin atomicity (pre-existing); delete the 3 dead non-tx user DB helpers.
- Task #15: finish UI redesign on `redesign/dashboard` (ab3bed6), then merge to main. Mike: redesign first.
- Still open: ask-gemini.sh review-diff large-payload (#11); VSS kill-switch wiring; stable agent rollout (VSS/compliance to client servers); unified audit_log (55806c36); rotate leaked MSP360 key; delete D:\tmp\agy_user_hash.txt.
### Reference
- Commits: SPEC-027 `8bcb024`, merge `7282020`, deployed `3963c0c`. Server v0.3.43. Migration 053 applied.
- Validation actor: testuser_antigravity (id 0b4f0b73-3ad0-4469-b885-cbbb8bede701), promoted/reverted dev_admin↔user.
- Coord: component gururmm/server → deployed v0.3.43.