OpenRiot v7.9.39 — The Machine Remembers Itself

“The construct was waking up wrong. It was waking up blind — no windows where windows should be, no warm light on the screen when the sun went down. It was locking the doors on its way out and asking for a password before the lights died. And somewhere in the login.conf, a single number — 65536 — was telling the kernel to refuse entry. Not to the Feds. To us. Because 1024 file descriptors per process was the deal the kernel made, and 65536 was a promise it could never keep. We fixed the wake-up. We fixed the memory. We fixed the login. The construct now opens its eyes and sees exactly what it saw before the power went out.” — The OpenRiot Crew, somewhere in the Sprawl, v7.9.39


Release Overview

This release is about foundations. Not new features, not flash — the fundamentals of waking up, remembering, and letting the user in. We spent the cycle fixing things that should have worked from day one but didn’t. The shutdown no longer demands a password. The windows come back where you left them, all of them, with their exact geometry. The night light actually turns on when you log in. And we killed a login.conf change that was bricking user logins — because 65,536 file descriptors per process in the default class is a promise the kernel can’t keep, and it will refuse to let you in rather than pretend it can.

The Zed port advanced another five rounds. The construct now compiles fast (no more 90-minute full recompiles), the menus work, the title bar renders, and the “p” character is gone. FD exhaustion at the system level got fixed properly — not by breaking login.conf, but by a targeted kern.maxfiles bump that the kernel can actually honor. The diff is clean. The patches apply in a single pass.

The Feds would have just shipped the login.conf breakage and blamed the user. We don’t.


🚪 CRITICAL: The Login That Wasn’t

Round 15 of the Zed port set openfiles-max=65536 and openfiles-cur=4096 in the default login class — 64× and 8× the OpenBSD defaults of 1024 and 512. On paper, this lets ulimit -n 524288 work so Zed can scan large worktrees. In practice, the kernel looks at that number, checks what it can actually deliver per-process, and if the answer is “not that,” it refuses the login entirely. Normal users get a black screen and a kernel message. They cannot log in. Root can. Everyone else is locked out.

This is not a config tweak. This is a broken machine.

We removed the entire login.conf sed block. The OpenBSD defaults are correct for the default class. The kern.maxfiles=65536 sysctl stays because it’s system-wide — the kernel sets aside the capacity and processes pull from the pool. No login gate. No bricked sessions. The Zed wrapper’s ulimit still works because the pool has the headroom. The construct opens its doors.

The coredump=0 sed also got nuked. It was appending duplicate coredump=0: entries on every install run. The current login.conf had forty copies. Forty. The Turing Police would call this “redundant hardening.” We call it a sed that didn’t check before it wrote.


🔒 The Password Before the Void

Shutdown and reboot previously called lock.Lock() — i3lock with the full password prompt — before executing shutdown -p now or shutdown -r now. You clicked “Shut Down,” the screen locked, and you had to type your password to complete the power-off. Then the machine turned off and the lock went with it. Pointless. Annoying. Wrong.

The lock is gone. Click shutdown, the windows close gracefully, the layout saves, and the machine powers off. No password. No ritual. The construct trusts you to leave.


🪟 The Dead Channels Light Up

Two bugs in window save/restore, both fundamental.

The save was saving nothing. GracefulShutdown called gracefulCloseWindows() (kills all windows) before SaveLayout() (queries the i3 tree). By the time the snapshot ran, the tree was empty. Every shutdown produced an empty window-snapshot.json. Every restart had nothing to restore. The save now runs before the close. The snapshot has teeth.

The restore was launching half the windows. The launch loop used a launched[key] dedup map — if you had three terminal windows, only one terminal process launched on restore. The other two windows were simply lost. The dedup is gone. Every window in the snapshot gets its own launch. The restore now polls the i3 tree for up to 15 seconds, waiting for the expected count of each window class to appear, instead of hoping a 3-second sleep was enough. Slow-starting apps no longer get left behind.

Floating windows get their exact position and size. Tiling windows return to their workspace. The construct wakes where it fell.


🌙 The Warm Light Returns

The night light toggle saved its state to disk. The polybar icon showed “on.” But the actual color temperature never changed after login because sct 4000 was never called at startup. You had to toggle it off and on again to get the warm light back.

nightlight.Restore() now runs 4 seconds after i3 starts. It reads the saved state from ~/.config/openriot/nightlight.state and fires sct 4000 if night light was on during the previous session. The screen is warm when you sit down. The polybar icon tells the truth.


⚡ Sysctl Error Handling

setSysctlIfChanged in the HDMI module previously ignored read errors — if a sysctl node didn’t exist, the read returned empty string, the comparison failed, and the write fired doas sysctl name=value against a non-existent MIB. The kernel logged “second level name is invalid” to dmesg. The write now skips when the read returns an error. The logs are quieter. The HDMI toggle still works.


🔧 Zed: Rounds 11 Through 15

Five more rounds in the ongoing war with the editor.

Round 11 (full recompile): The aws-lc-sys cache clearing block triggered a full 90-minute recompile on every build. Removed because aws-lc-sys v0.40.0 no longer panics on AWS_LC_SYS_NO_ASM. Incremental builds now complete in 1-2 minutes when only workspace crates change.

Round 12 (show_menus): The title bar rendered after the CSD fix but File/Edit/View menus stayed hidden. Root cause: show_menus in application_menu.rs checked the user setting show_menus: false (default). Patched to always return true on non-macOS.

Round 13 (diff cleanup): Removed duplicate patch entries. Fixed CSD line numbers to match clean source. All patches now apply cleanly in a single pass without “unexpected end of file.”

Round 14 (extensions): ulimit -n 524288 raised in the wrapper to stop extensions from reinstalling endlessly due to fd exhaustion.

Round 15 (fd exhaustion, system level): kern.maxfiles=65536 added to /etc/sysctl.conf. System-wide, no login gate. The wrapper’s ulimit takes effect after a fresh login because the kernel pool has the capacity.

The field report (docs/OpenBSD-Zed.md) documents all five rounds plus the login.conf lesson learned. The known issues table now shows title bar, menus, and the “p” character as resolved.


🧾 Files Changed

File Change
source/window/snapshot.go FIXSaveLayout() moved
  before gracefulCloseWindows();
  removed lock.Lock() from
  GracefulShutdown(); removed
  launched[key] dedup in restore;
  replaced 3s sleep with 15s polling
install/packages.yaml FIX — removed login.conf sed
  block (openfiles-max=65536
  bricked logins); kept
  kern.maxfiles=65536 sysctl
source/nightlight/nightlight.go NEWRestore() runs sct
  on login if state was on
source/commands/commands.go NEW--night-light-restore
config/i3/config --night-light-restore in autostart
source/display/hdmi.go FIXgetSysctl returns
  error; setSysctlIfChanged skips
  write when read fails
scripts/zed.sh REMOVED — aws-lc-sys cache
  clearing block (no longer needed);
  added MAP_STACK patches for 4
  crates; fixed EINVAL on
  PROT_NONE + MAP_STACK
scripts/zed-patch.diff Added show_menus bypass; cleaned
  duplicate entries; fixed CSD
  line number offsets
docs/OpenBSD-Zed.md Documents Rounds 11-15; updated
  known issues table; added login
  .conf lesson learned

🗣️ Final Words

“The Feds think the machine forgets. They think every reboot is a fresh start, a clean slate, a chance to reconfigure. They’re wrong. The machine remembers everything — every window, every workspace, every pixel of floating geometry. It remembers the warm light of the screen when the sun goes down. It remembers its own doors and keeps them open. The shutdown doesn’t ask for a password because there’s nothing left to protect. The login doesn’t refuse entry because the kernel made a promise it can keep. The construct wakes up right. The construct wakes up whole. And somewhere in the Sprawl, the night light is the right color.” — The OpenRiot Crew, at 3 AM, after the login.conf sed died, v7.9.39