Was: malformed event (bad JSON / truncated / corrupted bytes) wedged the node's checkpoint forever — every cycle re-tried, logged, never advanced past the bad file; all subsequent good events for that node lost. Now: first parse failure -> atomic os.replace to STATE_DIR/observer_failed_events/<node>/ with collision handling. Checkpoint advances, downstream events flow. Move failures themselves are logged but don't crash the loop. Complementary to yesterday's atomic_write_json fix (state files); this addresses the same race-pattern on event files instead. Regression test asserts: bad event quarantined to failed_events dir, removed from hot path, subsequent good event processed (node online), checkpoint moves to good event.
58 lines
2.5 KiB
Markdown
58 lines
2.5 KiB
Markdown
# Tech-debt backlog
|
|
|
|
Centralny tracker tech-długu i znanych usterek. Wpisy ze sesji — dodawaj z datą i kontekstem.
|
|
|
|
---
|
|
|
|
## Aktywne
|
|
|
|
### rsync `--omit-dir-times` (node-agent)
|
|
|
|
**Data**: 2026-06-09
|
|
**Źródło**: flota recovery session
|
|
**Objaw**: rsync exit code 23 po każdym push — `set-times` na katalogu `/opt/homelab/events/`
|
|
zwraca EPERM (oskar nie jest właścicielem katalogu; aerbot jest). Pliki są kopiowane poprawnie,
|
|
ale exit 23 zaśmieca logi i może maskować prawdziwe błędy.
|
|
**Fix**: dodać `--omit-dir-times` do wywołania `rsync` w `node-agent.py`.
|
|
**Lokalizacja**: `services/node-agent/src/node_agent.py` — wywołanie rsync w pętli push.
|
|
|
|
---
|
|
|
|
### Deklaratywny zapis `oskar ∈ aerbot` w manifeście VPS
|
|
|
|
**Data**: 2026-06-09
|
|
**Źródło**: flota recovery — root cause: oskar spoza grupy aerbot(1000) → rsync Permission denied
|
|
**Problem**: przynależność do grupy jest zarządzana ręcznie (`usermod -aG 1000 oskar` ad-hoc).
|
|
Brak gwarancji po przeinstalowaniu VPS lub zmianie usera.
|
|
**Fix**: dodać do `hosts/vps/host.yaml` lub `hosts/vps/capabilities.yaml` sekcję
|
|
`users: oskar: groups: [aerbot]` — i wyegzekwować w deploy/bootstrap skrypcie VPS.
|
|
Alternatywa: zmienić właściciela `/opt/homelab/events/` na `oskar:oskar` i zaktualizować
|
|
node-agent deploy skrypty.
|
|
|
|
---
|
|
|
|
### Rozdzielenie worktree per task (agent.sh)
|
|
|
|
**Data**: 2026-06-09
|
|
**Źródło**: sesja — `homelab-codex-ws-node-onboarding` używany raz dla `task/node-onboarding`,
|
|
raz dla `task/fix-event-bloat` przez ręczne `git checkout`.
|
|
**Problem**: jeden worktree współdzielony przez dwa branche = anty-wzorzec. `git branch`
|
|
mogło wskazywać zły branch; `+` w listingu = pozornie "w innym worktree" ale nieprawda.
|
|
Prowadzi do commitowania na złej gałęzi.
|
|
**Fix**: egzekwować — jeden task = jeden worktree (`agent.sh new <task-name>`). Przy wejściu
|
|
do worktree zawsze `git branch --show-current` i weryfikacja `.agent-task`.
|
|
Długoterminowo: `agent.sh new` powinien odmawiać jeśli żądana gałąź jest już sprawdzona.
|
|
|
|
---
|
|
|
|
## Zamknięte
|
|
|
|
### Observer staleness — martwy node pokazywany NOMINAL
|
|
|
|
**Data**: 2026-06-08 (złapane), status: OTWARTY w sensie implementacji
|
|
**Problem**: observer/supervisor trzyma ostatni znany stan; brak heartbeat TTL.
|
|
Chelsty-infra milczy, ale status NOMINAL podważa zaufanie do panelu.
|
|
**Fix**: heartbeat TTL → po przekroczeniu oznacz status `stale` lub `down`.
|
|
**Powiązane**: brain-watchdog ślepy na per-node freshness.
|
|
*(Otwarty jako TODO implementacyjny — przeniesiony z sesji 2026-06-08)*
|