Let somebody extend this without forking it, and say when things die

Two of Section F.

Hooks are the pressure valve. "Can Panama also do X when the theme
changes" is now a five-line file in ~/.config/panama/hooks rather than
a fork, a feature request, or a patch somebody rebases forever. Each
name takes a single file and a .d directory so several things can react
without fighting over one, and a broken hook is reported and stepped
over: somebody's script must never cost a theme change, an upgrade or a
login. Wired at theme-set, post-upgrade and post-migrate. This is the
thirty-line version of the plugin host the upstream ledger defers, and
it has no API to keep stable beyond "we will run your script and tell
you what happened".

Testing it caught a real bug the reading would not have: run_one
captured the script path but never shifted it off, so every hook got
its own filename as $1 and the real arguments arrived one place late. A
hook reading $1 as the colour scheme got a path.

The crash watcher notices when a program dumps core and says so. Under
GNOME, ABRT does this; here nothing did, and applications died silently,
which is most of how "Linux is flaky" gets earned.

Once per program per session is the entire design, not a nicety. This
machine's portal backend crashes between eleven and sixty times a day,
and a notification per crash would be one every few minutes for
something nobody can act on. The first is news; the fortieth is why
people turn notifications off. The health page keeps the running count.

It waits for the notification server before reporting, because the
crash most worth hearing about is the one that took the shell with it,
and it names the executable rather than the kernel's comm field, which
truncates at fifteen characters. Verified against real segfaults.
This commit is contained in:
Gabriel Brown
2026-08-22 08:11:49 -04:00
parent 41dd91eb75
commit 7a5e990439
14 changed files with 499 additions and 2 deletions
+8 -1
View File
@@ -135,7 +135,7 @@ docs/ Settings reference, and the design specs behind the work
## Tests
148 of them, under `tests/`. Run the lot, or a subset by pattern:
150 of them, under `tests/`. Run the lot, or a subset by pattern:
```sh
panama test # everything
@@ -193,6 +193,13 @@ package, a `flatpak:` line is a Flathub id, `| Name` gives the menu something
readable, and an indented line belongs to the entry above it — which is how OBS
carries its sixteen plugin extensions as one thing to tick.
Hooks are the extension point: drop a script at `~/.config/panama/hooks/theme-set`
and it runs whenever the colour scheme changes, with the scheme and accent as
arguments. Same for `post-upgrade` and `post-migrate`, and a `<name>.d/`
directory beside each so several things can react without fighting over one
file. A broken hook is reported and stepped over, never fatal. Samples are
copied into place on install.
`panama migrate` applies repairs an installed machine has not had yet. Safe to
re-run: nothing is applied twice, and a machine with nothing waiting says so.