Files
Nomarchy/agent/JOURNAL.md
Bernardo Magri 5ea4f0c9ac
Some checks failed
Check / eval (push) Has been cancelled
feat(stability): default-on memory-pressure protection (earlyoom)
modules/nixos/oom.nix — running out of memory now kills the offending
process (with a desktop notification via systembus-notify) instead of
freezing the desktop for minutes until the kernel OOM killer fires.

earlyoom over systemd-oomd, deliberately: oomd kills whole cgroups,
and a Hyprland session runs as ONE scope (nothing here spawns per-app
systemd scopes, unlike GNOME) — under pressure oomd would take out the
entire desktop to save it. earlyoom kills the single largest process
before the thrash point. nixpkgs default-enables oomd in an inert
state (no slices monitored); it is disabled outright so there is one
owner. Session plumbing is --avoid-listed (unanchored — NixOS wrappers
rename comm to .foo-wrapped); no --prefer tuning, largest-RSS
selection already finds the hog. All mkDefault; opt out with
services.earlyoom.enable = false (README note added).

Verified: V0 (flake check) + V2 — new checks.oom-protection
runNixOSTest, executed: a chunked allocator (686 MB peak, 1 GB VM) is
SIGTERM'd by earlyoom in 0.1 s, a bystander unit survives (the
process-level granularity the module exists for), and systemd-oomd is
asserted inactive. 25 s runtime.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 09:45:21 +01:00

121 lines
6.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Journal — append-only iteration log
One entry per iteration, **newest first**. This is the loop's short-term
memory: the next session reads the last 35 entries to orient. Keep an
entry under ~15 lines; durable lessons go to MEMORY.md, not here.
Template:
```markdown
## YYYY-MM-DD — <task title> (<commit sha, or "no commit">)
- **Task:** which BACKLOG item (or QA sweep / bootstrap / escalation)
- **Did:** what changed, in 24 lines
- **Verified:** tier reached (V0/V1/V2) + the actual commands/checks run
- **Pending:** V3 queued? follow-ups filed? anything [stuck]?
- **Next suggestion:** what the following iteration should probably take
```
---
## 2026-07-04 — Memory-pressure protection shipped (loop iteration #3)
- **Task:** BACKLOG NOW#3 — default-on userspace OOM killer.
- **Did:** `modules/nixos/oom.nix`: earlyoom (mkDefault on, desktop
notifications, session-plumbing `--avoid` list, no `--prefer`) +
`systemd.oomd.enable = false`. Choice rationale: Hyprland session is
one cgroup scope → oomd's cgroup-level kill would nuke the desktop;
earlyoom is process-level. Found en route: nixpkgs default-enables
oomd *inert* (enable=true, all slice toggles false). README "beyond
the surface" note added.
- **Verified:** V0 (flake check) + **V2** — new `checks.oom-protection`
runNixOSTest, run for real: hog (chunked allocator, 686 MB peak in a
1 GB VM) SIGTERM'd by earlyoom in 0.1 s, bystander unit survived,
oomd asserted inactive. 25 s test, cheap enough for the suite.
- **Pending:** nothing hardware-specific (behavior fully VM-provable).
- **Next suggestion:** NOW#4 (btrfs-assistant override attempt). Also:
CI run #58 (the .gitea fix) was *running* at commit time — check its
outcome next tick; this push triggers #59.
## 2026-07-04 — CI fix: wrong workflow dir (correction to iteration #2)
- **Task:** Bernardo reported no run despite an active runner + shared
his compose file: the server is **Gitea** (gitea/act_runner), not
Forgejo — I'd shipped the workflow to `.forgejo/workflows/`, which
Gitea never reads. The legacy repo's `.gitea/workflows/` path was the
clue I under-weighted.
- **Did:** `git mv``.gitea/workflows/check.yml`; corrected the
Forgejo references in the workflow header, TESTING.md §1b, BACKLOG
item 20 (now: watch the first run; runner was never the problem);
MEMORY.md gains the Gitea-not-Forgejo line.
- **Verified:** the push of this commit is itself the test — the run
must appear; monitoring.
- **Pending:** first green run (item 20); runner-container memory
headroom is the watch-out.
## 2026-07-04 — CI checks-on-push shipped (loop iteration #2)
- **Task:** BACKLOG NOW#2 — Forgejo Actions workflow.
- **Did:** `.forgejo/workflows/check.yml` (push to main/v1 + dispatch):
flake check --no-build, theme-sync py_compile, bash -n over tracked
.sh. Scoped to the **eval tier** deliberately — API probing +
archaeology of the legacy `.gitea/workflows/check.yml` (57 runs on
this instance) showed the runner is an act_runner docker container
(no KVM/systemd), so the VM suite can't run there; a commented
`vm-checks` job documents the KVM-runner upgrade path. Legacy's
hard-won container gotchas (nixbld setup, sandbox=false for Stylix
IFD, Nix 2.31.5 pin) carried over verbatim. TESTING.md §1b added.
- **Verified:** V0 locally (same commands the workflow runs, minus the
container Nix install) + yq YAML parse. The real green run needs the
runner to be alive — **not confirmable from here** (runners API is
401 unauthenticated); watching the run after push.
- **Pending:** new `[human]` item 20 — confirm/re-register the runner;
stretch: a KVM runner unlocks the vm-checks job.
- **Next suggestion:** NOW#3 (memory-pressure protection).
## 2026-07-04 — Opt-in auto-commit shipped (loop iteration #1)
- **Task:** BACKLOG NOW#1 — auto-commit of state mutations (in-flake
state Phase 4). First autonomous /loop iteration.
- **Did:** `settings.autoCommit` live-read by nomarchy-theme-sync;
pathspec-limited commit of theme-state.json on apply/set (fires if flag
on before OR after the write → the off-toggle commits too); identity
fallback; same-value no-op; `bg` excluded. Menu: System Auto-commit
(instant, self-gated on `.git`). Rider: `get` prints booleans as JSON
`true`/`false`, fixing the stuck "Auto timezone (on/off)" menu label.
BACKLOG numbering switched to stable IDs (no renumbering).
- **Verified:** V0 (py_compile, flake check) + V1 (HM generation builds;
generated menu `bash -n`) + a 7-assertion sandbox git-repo round-trip
(enable/set/same-value/disable/post-disable/apply/identity-fallback).
- **Pending:** V3 queued in HARDWARE-QUEUE (on-machine toggle + apply).
- **Next suggestion:** NOW#2 (CI checks-on-push) — but its runner half
may need Bernardo to register a Forgejo runner; deliver the workflow
regardless.
## 2026-07-04 — Backlog revision pass (human-requested)
- **Task:** Bernardo asked for a philosophy-aligned revision of BACKLOG.md
("I'm sure I'm forgetting important items").
- **Did:** verified guessed gaps against the tree first (GC/optimise/boot
limit + all 21 previews already ship — dropped those ideas). Added the
confirmed gaps: CI-on-push promoted to NOW#2 (agents push to main now),
memory-pressure protection NOW#3 (nothing mitigates OOM; the release
bump died to one), viewers+mime defaults #8, update/rollback UX #9,
nomarchy-doctor #10, state-file validation #11, screen recording #12,
niceties batch #13 (idle-inhibit, low-battery notify, hyprpicker), OCR
in LATER; recovery runbook folded into the docs item; zram + default
browser added to Decisions.
- **Verified:** V0 (docs-only).
- **Pending:** Bernardo to sanity-check the new NOW ordering, esp. CI at
#2 and the two new Decisions.
- **Next suggestion:** unchanged — NOW#1 (opt-in auto-commit).
## 2026-07-04 — Bootstrap the loop infrastructure (this commit)
- **Task:** create `agent/` (human-requested): LOOP/GOALS/BACKLOG/
CONVENTIONS/MEMORY/HARDWARE-QUEUE/JOURNAL, root CLAUDE.md, README +
ROADMAP pointers.
- **Did:** reworked the forward half of docs/ROADMAP.md into the tiered
BACKLOG (5 NOW / 6 NEXT / LATER / Decisions); collected every pending
on-hardware check into HARDWARE-QUEUE.md; seeded MEMORY.md from the
ROADMAP's decision records.
- **Verified:** V0 (docs-only change; `nix flake check --no-build` run to
confirm the tree still evaluates).
- **Pending:** Bernardo to sanity-read GOALS.md pillars + BACKLOG tiering
— reorder freely, the order *is* the instruction.
- **Next suggestion:** BACKLOG NOW#1 (opt-in auto-commit — Phase 4 of
in-flake state, already the agreed next step).