Commit graph

20 commits

Author SHA1 Message Date
oskar c858dbcc7a docs(backlog): bug deploy-node.sh brak --build — deploy OK ale nowy kod nie wchodzi (cicha rozbieżność repo↔runtime) 2026-07-15 20:02:21 +02:00
oskar d5139c99ca fix(observer): checkpoint by timestamp not lexical path — lexically-smaller-but-newer events were silently skipped forever (poisoned node)
Per-node checkpoint now stores the last-processed event TIMESTAMP (int epoch)
instead of a file path compared lexically. A file is "new" iff its timestamp
(parsed from evt-<node>-<unixts>-<type>-<svc>.json, mtime fallback) exceeds the
node's checkpoint; processing is ordered by timestamp, not path.

Root cause (PIHA dead ~34d, 2026-07-12): a stray evt-unknown-<ts>-… file landed
in events/piha/, lexically greater than every evt-piha-… name. The lexical
checkpoint pinned there, so every genuinely newer piha event sorted "before" it
and was skipped forever. Event backlog grew to 7344 files, last_seen frozen,
shadow-read logged false SHADOW_LIVENESS_MISMATCH event=dead prom=up.

- _event_ts_from_path: filename epoch, mtime fallback; NEVER returns 0 for an
  existing file (0 == "older than checkpoint" == the poison).
- _checkpoint_ts_from_value: graceful migration of pre-fix path-string
  checkpoints (and the older last_processed_file format) to int epochs;
  unparseable → 0 (reprocess all — safe, process_event is idempotent on
  last_seen/world_state; bias to reprocess, never to skip).
- Preserved: quarantine of bad events, observer-source re-ingest guard.
- Regression tests (test_incident_lifecycle.py section 9): lexically-smaller-
  but-newer processed, unparseable name falls back to mtime (not wedged),
  ts-not-path ordering, both checkpoint-format migrations, helper units.

Separate bug filed in backlog (not fixed here): ha-diag-agent emits node=
"unknown" events (config.py node_name default) into another node's dir when
NODE_NAME reaches the compose volume path but not the app env — the source of
the poison file.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 15:55:38 +02:00
oskar f135365da5 docs(sesja): 2026-07-12 Deploy 2 OCR-worker DZIALA (split-host NFS) + backlog: nowe serwisy KB poza monitoringiem 2026-07-12 21:15:38 +02:00
oskar 196a99ffef fix(paperless-worker): celery command bypassed manage.py + missing shared scratch dir
Two config bugs found on the already-deployed split-host OCR worker
(module 3): (1) `command: celery ...` was routed through manage.py by
the image entrypoint because it didn't start with "/" — fixed with an
absolute gosu+celery path. (2) SCRATCH_DIR (/tmp/paperless) was not
shared over NFS like data/media/consume, so tasks picked up by
worker@SOLARIA instead of worker@PIHA failed with "File not found" —
fixed by adding a paperless_scratch NFS volume/bind mount on both
sides.

Verified live on PIHA + SOLARIA: test PDFs dropped into consume/ were
split across both workers, the SOLARIA-picked task completed OCR with
zero File not found errors, test documents cleaned up afterward.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-12 20:51:04 +02:00
oskar 52e412dba3 docs(backlog): bug checkpoint observera (leksykalne porównanie ścieżek zatruwa węzeł) + bug deploy-local.sh rozkłada control-plane na ghostach 2026-07-12 20:11:34 +02:00
oskar 84c1d40c9a docs(backlog): tech-debt — globalny porządek uid/gid/uprawnień floty (systemowy, historia incydentów + kierunek) 2026-07-10 23:11:38 +02:00
oskar 5daae77e2f feat(scripts): npm_api.py — CLI do zarzadzania npm PIHA+VPS przez REST API
token/list-hosts/list-certs/set-cert/create-host, dry-run domyslny dla
zmian (--apply wymagane), stdlib urllib (zero-dep). Adresy npm@VPS
przez Tailscale (100.95.58.48:81), NIE public IP.

+ docs/backlog.md: npm@VPS admin panel :81 publicznie osiagalny —
brak override ograniczajacego bind do mesh/localhost.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-10 14:57:42 +02:00
oskar 670fa7a5e4 docs(backlog): ghosty B wróciły + elasticsearch/diskover error na PIHA; Etap 0 (tor Prometheus→watchdog→Telegram) oznaczony jako udowodniony
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 18:34:38 +02:00
oskar bb9ddde91d docs(backlog): zamkniecia po reconie 2026-07-02 + followupy z rozbrajania min
Zamkniete: bug B (ghost kontenery — zniknely), pending poll-Prometheus-watchdog
(potwierdzony), miny #1/#2/#3 z inwentaryzacji. Dodane followupy: wpisy hostowe
forgejo/mosquitto, mem_limit mosquitto@VPS, mosquitto per-host (chelsty-infra),
broker :1883 w topology, pi-watchtower-1 restart-loop, alias lustro, mem_limit
fleet-prometheus. Ocena joplin-db postgres:18 zdezaktualizowana (PG18 GA).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 17:30:48 +02:00
oskar 6b35afd2ea docs(infra): egzekucja odchudzania PIHA — ES+diskover ubite (+1.0Gi), llm-gateway/immich zostają
Faza 2 modułu 0 po review Oskara: elasticsearch+diskover usunięte (compose down,
dane esdata zostawione na dysku), available 2.8Gi -> 3.8Gi, kryterium >=1.5Gi
spełnione. llm-gateway udokumentowany (własny router LLM -> Ollama@SOLARIA,
źródło tylko w /opt/llm-gateway — archiwizacja w backlogu); immich zostaje na
PIHA na stałe (24/7, SOLARIA sesyjna).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:44:57 +02:00
Oskar Kapala 727cb999ef docs(sesja): inwentaryzacja floty 2026-06-30 + dysk SATURN + safeclean; backlog 23 rozjazdy 2026-06-30 19:56:50 +02:00
Oskar Kapala 4055a8ffab docs(backlog): oznacz kroki 4+5 Prometheus jako ZROBIONE, dopisz tech-debt log PROMETHEUS_URL
Kroki 4 (reguły liveness d417000) i 5 (watchdog poll 62d6fc0) z planu monitoringu zamknięte.
Nowy wpis aktywny: brain-watchdog nie loguje PROMETHEUS_URL przy starcie — utrudnia weryfikację.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-30 19:29:24 +02:00
Oskar Kapala 831bbedffa docs(sesja): kapala.org → Cloudflare wildcard DNS-01, HA i Immich na mesh
Sesja 2026-06-30: migracja DNS kapala.org z 42.pl na Cloudflare, wildcard
*.kapala.org przez DNS-01, ha/immich.kapala.org przez NPM@PIHA mesh-only.

- nowy session log z root-cause buga "unrecognized name" (NPM duplikuje
  proxy_http_version przy Websockets ON) + wzorzec migracji usługi na mesh
- backlog: gotchas (NPM WS config, CF auto-proxy DKIM) + TODO (migracja
  okit.pl, foty renew, cleanup ha-ken add-on, stale ha.okit.pl)
- topology: nowa sekcja ingress (ha/immich → NPM@PIHA, wildcard cert)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 16:23:57 +02:00
Oskar Kapala 48107ef2c1 docs(backlog): zamknij deploy.sh vps bug + 2 nowe wpisy (prom-reload, chelsty node_exporter)
- 🔴 deploy.sh vps↔control-plane → Zamknięte (fix 3b71707, guard deploy-local.sh)
- krok 2 planu floty (targety 100.x) → ZROBIONE (7d4014e)
- NOWE: deploy-node.sh nie reloaduje config-driven serwisów (cicha rozbieżność deploy↔config)
- NOWE: zbadać chelsty/chelsty-infra node_exporter DOWN z VPS
- Problem B (ghost kontenery) pozostaje otwarty osobno

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 17:30:26 +02:00
Oskar Kapala 1529911012 docs(backlog): add anomaly-detection liveness idea (mózg learns per-node daily pattern) 2026-06-26 16:20:54 +02:00
oskar a17a11bc9d docs(backlog): add 2026-06-25 bugs (deploy.sh vps mina, ghost kontenery, supervisor bez akcji, phantom world-state); close flaky tests + env-file fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 16:30:51 +02:00
oskar afc0a52e3e docs(backlog): add Compose state-drift and flaky-test tech-debts from 2026-06-24
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 23:37:52 +02:00
oskar ed54c2777a docs(backlog): swap VPS DONE; sekcja planu Prometheus-as-truth floty
Swap 2-4GB na VPS -> Zamkniete (2026-06-22). Nowa sekcja planu monitoringu
floty (Prometheus pull up{}, osobny instance, bez Alertmanagera) z krokami.
Zastepuje szkic blackbox+Alertmanager z 2026-06-17.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 22:15:24 +02:00
Oskar Kapala a0bfd96870 docs: session 2026-06-11 — lustro ssh shipping fix + ha-diag-agent piha + backlog/flota-bomba
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 14:18:00 +02:00
Oskar Kapala 5c2516d097 docs: session 2026-06-09 + skill/backlog update
- docs/sessions/2026-06-09-flota-recovery-lustro-register.md: flota
  recovery (root cause aerbot group, 3 warstwy maskujące), lustro register
  stan+plan, fix-event-bloat i OOM pending, worktree gotcha
- docs/backlog.md: nowy plik — tech-debt tracker; wpisy: --omit-dir-times,
  oskar∈aerbot deklaratywnie, worktree per task, observer staleness
- .claude/skills/node-onboarding/SKILL.md: step table aktualizacja (PROVEN:
  20-base, 30-node-agent; WRITTEN: 40-register, 50-verify), 3 nowe gotchas
  (rsync perm, observer restart, worktree branch)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 20:38:35 +02:00