Files
mempalace-toolkit/contrib/systemd/mempalace-pi-session.service
T
joakimp 53d96adc65 docs(contrib): scheduling templates for mempalace-pi-session
Drop-in equivalents of the opencode templates for each scheduler
mechanism:

  systemd/mempalace-pi-session.{service,timer}
  launchd/se.jordbo.mempalace-pi-session.plist
  cron/mempalace-pi-session.cron

Schedule is staggered from the opencode jobs (Mon 03:00 -> Tue 03:00)
so machines running both don't race each other on the post-mine HNSW
repair step. Service unit uses ConditionPathExists=%h/.pi/agent/sessions
to no-op silently on machines that haven't used pi, matching the
opencode template's guard on ~/.local/share/opencode/opencode.db.

contrib/README.md grows a 'Templates at a glance' table so the set is
discoverable without reading the whole doc.
2026-05-05 08:48:33 +02:00

24 lines
1.0 KiB
Desktop File

[Unit]
Description=Mine pi coding-agent session history into MemPalace
Documentation=https://gitea.jordbo.se/joakimp/mempalace-toolkit
# Only run if pi has actually been used (avoids noise on idle machines)
ConditionPathExists=%h/.pi/agent/sessions
# Don't start if a previous run is still going
ConditionPathExists=!%t/mempalace-pi-session.lock
[Service]
Type=oneshot
# The wrapper writes to ~/.cache/mempalace-pi-session/ and the palace.
# Keep stdout/stderr in the journal — inspect with:
# journalctl --user -u mempalace-pi-session --since today
ExecStart=%h/.local/bin/mempalace-pi-session
# Belt-and-braces lock so two overlapping runs can't corrupt staging
ExecStartPre=/bin/sh -c 'touch %t/mempalace-pi-session.lock'
ExecStopPost=/bin/sh -c 'rm -f %t/mempalace-pi-session.lock'
# Protect against runaway runs. Pi sessions tend to be short/tactical so the
# corpus is much smaller than opencode's; 2h is generous headroom.
TimeoutStartSec=7200
# Low priority — this is background maintenance
Nice=10
IOSchedulingClass=idle