Commit Graph
12 Commits
Author SHA1 Message Date
jaredandClaude Opus 5.5 9f993dabf1 MCP v1: Thor's tools for Claude Code, behind Authelia OAuth (thor#1)
CI / Test (pytest) (pull_request) Successful in 1m13s
CI / Integration (MariaDB) (pull_request) Successful in 2m36s
CI / Security (bandit, pip-audit) (pull_request) Successful in 1m25s
CI / UI (screenshots) (pull_request) Failing after 8s
CI / Lint (flake8, house style) (pull_request) Successful in 58s
CI / Scan (secrets, workflows, shell, patterns) (pull_request) Failing after 1m26s
CI / Deploy (pull_request) Skipped
- thor/web/mcp.py: stateless Streamable HTTP at POST /mcp (JSON-RPC 2.0), RFC 9728 metadata at
  /.well-known/oauth-protected-resource[/mcp], 401 with resource_metadata. Tokens checked
  against Authelia's JWKS: RS256, iss, aud (this server), exp, typ at+jwt, client_id thor-mcp,
  scp array; group admin only; Remote-* headers never trusted; every tool call logged with the
  user.
- Read tools (thor:read): list_incidents, get_incident, what_covers, thor_status,
  list_known_conditions. Write tools (thor:write): add_known_condition, end_known_condition,
  attach_ticket, detach_ticket. Tools a token's scopes can't use aren't listed.
- Migration 4: incident_links (who attached which ticket to which incident). attach_ticket
  records an 'attach' action; in shadow nothing is sent, live sends a 'Root cause' comment.
- Incident page lists attached tickets. PyJWT[crypto] added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:28:37 -05:00
jaredandClaude Opus 5.5 ab4b20d15f UI and API: Needs attention, incident pages, known conditions, /covering for Gandalf and hwmonDaemon
CI / Lint (flake8, house style) (pull_request) Successful in 56s
CI / Test (pytest) (pull_request) Successful in 53s
CI / Security (bandit, pip-audit) (pull_request) Successful in 1m8s
CI / Integration (MariaDB) (pull_request) Successful in 1m49s
CI / UI (screenshots) (pull_request) Failing after 1m7s
CI / Scan (secrets, workflows, shell, patterns) (pull_request) Successful in 1m58s
CI / Deploy (pull_request) Skipped
- thor/web/api.py: /api/incidents/covering (thor#1 pre-check), /api/incidents, /api/incident/<key>,
  machine keys by SHA-256 with optional source CIDRs, like Gandalf's (gandalf#68); 503 when the
  database is away so callers fail open. covered=true only when there is a ticket to comment on;
  shadow incidents are listed but never cover.
- thor/web/ui.py + templates: Needs attention (incidents, Thor itself, timeline-only, known
  conditions seen again, unexplained symptoms), incident page (what happened, also seen, what
  Thor sent or would have sent, ticket text), known conditions. Read-only; CSP with nonces;
  Authelia identity shown only when it comes from NPM. Mobile nav drawer.
- web_template v1.2 (8286bb2) vendored and checked against upstream in CI.
- docs/contract.md: the /covering contract for the Gandalf and hwmonDaemon sessions.
- scripts/ui_demo.py + scripts/screenshots.py, and a CI job that renders every page with replay
  data (desktop, mobile, dark, light) and uploads the screenshots.
- Fix: systemd-escaped cpusets (system-ceph\x2dosd.slice) were not recognised as Ceph; four of
  the 11-23 kills came from the OSD slice. Found while reviewing the screenshots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:23:43 -05:00
jared 6c2328c2b1 Phase 1, PR 3: reboots (#4), fencing and partitions, maintenance, known conditions, and the T2 to T4 replays (#7)
CI / Lint (flake8, house style) (push) Successful in 52s
CI / Test (pytest) (push) Successful in 54s
CI / Security (bandit, pip-audit) (push) Successful in 1m0s
CI / Integration (MariaDB) (push) Successful in 1m49s
CI / Scan (secrets, workflows, shell, patterns) (push) Successful in 1m17s
CI / Deploy (push) Successful in 18s
deploy-2026.11.26-7
2026-11-25 23:21:40 -05:00
jaredandClaude Opus 5.5 e70dee0ad8 Reboots, fencing and partitions, maintenance from Gandalf, known conditions; T2/T3/T4/DIMM replays
CI / Lint (flake8, house style) (pull_request) Successful in 54s
CI / Test (pytest) (pull_request) Successful in 55s
CI / Security (bandit, pip-audit) (pull_request) Successful in 56s
CI / Integration (MariaDB) (pull_request) Successful in 2m2s
CI / Scan (secrets, workflows, shell, patterns) (pull_request) Successful in 1m30s
CI / Deploy (pull_request) Skipped
- checks/reboots.py (thor#4): boot-time changes classified as planned (logind line),
  unexpected, or unknown (journal went quiet first); several together are one event.
- checks/cluster.py: HA fence lines, watchdog self-fences, corosync quorum loss: one host is
  'lost its cluster link and was fenced' (P2), two or more a cluster partition (P1).
- checks/maintenance.py: Gandalf suppressions (with ended ones) as a cause that never
  opens a ticket; everything under it goes on the timeline.
- Engine: higher causes first, lower causes they explain become symptoms; a higher cause
  found later absorbs pending ones and comments 'Root cause' on opened ones; host-scoped
  causes never explain another host's cause; incidents stay active while an attached host
  is still down; silent state changes are saved; notes join timeline-only incidents.
- Known conditions (migration 3, seeded): compute-storage-02 reboots and Ceph noout ->
  693930698, the old UPS battery. A match sends a note to that ticket instead of a new one.
- Replays: T2 0 tickets; T3 one P2 (fenced, cleared when the host is back); T4 one P1
  partition (storage-01's later fence and all reboots fold in); DIMM one note on 693930698.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:13:59 -05:00
jared fa9a4b0f78 Phase 1, PR 2: engine, memory check, symptoms, outbox, and the 11-23 replay (#6)
CI / Lint (flake8, house style) (push) Successful in 53s
CI / Test (pytest) (push) Successful in 51s
CI / Security (bandit, pip-audit) (push) Successful in 53s
CI / Integration (MariaDB) (push) Successful in 1m48s
CI / Scan (secrets, workflows, shell, patterns) (push) Successful in 1m56s
CI / Deploy (push) Successful in 11s
deploy-2026.11.26-5
2026-11-25 23:07:10 -05:00
jaredandClaude Opus 5.5 983ba27386 Engine, memory check, symptom checks, outbox, T1 replay
CI / Lint (flake8, house style) (pull_request) Successful in 50s
CI / Test (pytest) (pull_request) Successful in 52s
CI / Security (bandit, pip-audit) (pull_request) Successful in 1m1s
CI / Integration (MariaDB) (pull_request) Successful in 1m40s
CI / Scan (secrets, workflows, shell, patterns) (pull_request) Successful in 1m15s
CI / Deploy (pull_request) Skipped
- thor/engine.py: one incident per root cause. New causes held one cycle, symptoms attached
  to the highest cause they relate to (same host, or cluster-wide effects for causes that
  can stall the cluster), priority only rises, rate-limited refresh, cleared after 15 min.
- thor/checks/memory.py: node_vmstat_oom_kill + kernel oom-kill lines; global vs cgroup,
  victim and CT, trigger cpuset; P3 / P2 (loop) / P1 (Ceph or other hosts stalling).
- thor/checks/symptoms.py: scrape timeouts, pvestatd timeouts, Ceph alerts switching on.
- thor/outbox.py: live actions to Tinker with backoff; shadow actions are only recorded.
- Migration 2: incidents, actions, observations.
- PromQL/LogQL regex escaping fixed (found by recording against the real Prometheus).
- tests/replay.py + tests/fixtures/t1.json: 2026-11-23 replayed through the real monitor:
  exactly one ticket (P1 from the start: pvestatd timed out on three other hosts with the
  first kill), 15 symptoms as Also seen, cleared 06:18, Loki's 06:00 outage delays only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:02:10 -05:00
jared e676a8e658 Phase 1, PR 1: skeleton (config, source clients, DB, monitor loop, health, CI, deploy) (#5)
CI / Lint (flake8, house style) (push) Successful in 1m17s
CI / Test (pytest) (push) Successful in 1m17s
CI / Security (bandit, pip-audit) (push) Successful in 1m6s
CI / Integration (MariaDB) (push) Successful in 1m37s
CI / Scan (secrets, workflows, shell, patterns) (push) Successful in 1m8s
CI / Deploy (push) Successful in 13s
deploy-2026.11.26-3
2026-11-25 22:51:38 -05:00
jaredandClaude Opus 5.5 f3d0b5e11a Test: restart while the database is away still catches up once it answers (T2 order)
CI / Test (pytest) (pull_request) Successful in 52s
CI / Integration (MariaDB) (pull_request) Successful in 1m50s
CI / Security (bandit, pip-audit) (pull_request) Successful in 1m4s
CI / Lint (flake8, house style) (pull_request) Successful in 58s
CI / Scan (secrets, workflows, shell, patterns) (pull_request) Successful in 2m57s
CI / Deploy (pull_request) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 22:39:58 -05:00
jaredandClaude Opus 5.5 b0e240af50 Unit tests for the DB connection layer and Tinker error paths (coverage 95% without MariaDB)
CI / Lint (flake8, house style) (pull_request) Successful in 2m14s
CI / Test (pytest) (pull_request) Canceled after 0s
CI / Integration (MariaDB) (pull_request) Canceled after 0s
CI / Security (bandit, pip-audit) (pull_request) Canceled after 0s
CI / Scan (secrets, workflows, shell, patterns) (pull_request) Canceled after 0s
CI / Deploy (pull_request) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 22:36:13 -05:00
jaredandClaude Opus 5.5 379570bbdc CI modelled on Pulse, deploy script with rollback, bootstrap, README
- .gitea/workflows/ci.yml: flake8 + dash check, pytest (90% coverage floor), MariaDB
  integration tests, bandit, pip-audit, gitleaks, actionlint, shellcheck, zizmor, semgrep;
  main deploys through a signed webhook and waits for /health to report the commit.
- deploy/thor_deploy.sh: deploys an exact sha, installs units and nginx site when changed,
  rolls back unless /health reports the sha with a working database. Sandbox-tested.
- deploy/bootstrap.sh: idempotent first install on CT 173.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 22:35:28 -05:00
jaredandClaude Opus 5.5 eecb24297a Skeleton: config, source clients, DB migrations, monitor loop with blind tracking, health and metrics
Work in progress for thor#1 phase 1 (PR 1 of 6). Not yet pushed: CI workflow and deploy files still to add.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:32:07 -05:00
jaredandClaude Opus 5.5 4cdb54147e README: charter and boundaries with gandalf and hwmonDaemon
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 23:27:21 -05:00