From 60c2a4abec9da9648c1d4e068cdfb8b39abe6b52 Mon Sep 17 00:00:00 2001 From: Joakim Persson Date: Thu, 30 Apr 2026 11:14:15 +0000 Subject: [PATCH] install.sh: probe for mempalace wake-up protocol, warn if missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mempalace skill is only useful if an agent loads its wake-up protocol at session start. Without ~/.config/opencode/instructions/ mempalace.md, the skill is reachable but never auto-runs — agents forget to search before answering and to write a diary at wind-down. The failure mode is silent: no error, no warning, just gradual memory degradation. install.sh now probes for the file after its regular installation steps and prints an actionable warning if missing: ! Wake-up protocol NOT installed at /path/to/.../mempalace.md Without it, the mempalace skill is loadable but never auto- runs at session start. Install via the skillset repo: git clone .../skillset.git ~/skillset cd ~/skillset && ./deploy-skills.sh --bootstrap (if skillset is already cloned, just run the --bootstrap step) If the file is present: prints a matching success line. If the host doesn't even have ~/.config/opencode/, the check is skipped entirely (non-opencode machine → no warning to display). README Prerequisites gains a 4th bullet pointing at skillset's --bootstrap as the canonical source for the wake-up protocol, so anyone reading the docs without running install.sh also learns about the dependency. The wake-up file is shipped by skillset, not this toolkit. Rationale: the file bootstraps the 'mempalace' skill (which lives in skillset) and applies to any harness, not just opencode-plus-toolkit machines. Cross-referenced via the skillset gitea URL in both the installer message and the README. Smoke-tested present + missing scenarios on the reference box — cleanly detects both, does not hard-fail on missing. --- README.md | 1 + install.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/README.md b/README.md index dad227d..e243484 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ See [`ARCHITECTURE.md`](ARCHITECTURE.md) §6 for the full upstream roadmap. - [MemPalace](https://github.com/MemPalace/mempalace) CLI v3.3.3+ — **see [Installing mempalace itself](#installing-mempalace-itself-prerequisite) below if you haven't already**. - Python 3 (stdlib `sqlite3` only — no extra deps) - [opencode](https://github.com/anomalyco/opencode) with an active session DB at `~/.local/share/opencode/opencode.db` *(only needed for `mempalace-session`)* +- The mempalace **wake-up protocol** at `~/.config/opencode/instructions/mempalace.md` — without it, opencode loads the mempalace skill but never auto-runs it at session start, so most of mempalace's value is forfeited silently. Shipped by the [skillset repo](https://gitea.jordbo.se/joakimp/skillset); deploy via `./deploy-skills.sh --bootstrap` once per machine. `mempalace-toolkit/install.sh` probes for this file and warns if it's missing. ### Installing mempalace itself (prerequisite) diff --git a/install.sh b/install.sh index 02edb43..04e9c28 100755 --- a/install.sh +++ b/install.sh @@ -156,6 +156,36 @@ check_path() { esac } +# ── Verify the mempalace wake-up protocol is reachable ── +# The mempalace skill is only useful if the agent actually loads its +# wake-up protocol at session start. Opencode loads that from +# ~/.config/opencode/instructions/mempalace.md. Without this file, the +# skill is available but never auto-runs, and most of mempalace's value +# (search-before-speak, wind-down diary) is forfeited silently. +# +# The file is owned by the skillset repo, not this one — pointing users +# at skillset if they haven't run it there. Opencode-only: we skip this +# check if ~/.config/opencode doesn't exist (non-opencode host). +check_wake_up_protocol() { + local opencode_config="$HOME/.config/opencode" + [[ -d "$opencode_config" ]] || return 0 # not an opencode box → nothing to warn about + + local instr="$opencode_config/instructions/mempalace.md" + if [[ -e "$instr" ]]; then + ok "Wake-up protocol detected: $instr" + return 0 + fi + + warn "Wake-up protocol NOT installed at $instr" + printf ' Without it, the mempalace skill is loadable but never auto-runs\n' + printf ' at session start. Agents forget to search before answering and to\n' + printf ' write a diary entry at wind-down. Install via the skillset repo:\n' + printf ' git clone ssh://git@gitea.jordbo.se:2222/joakimp/skillset.git ~/skillset\n' + printf ' cd ~/skillset && ./deploy-skills.sh --bootstrap\n' + printf ' (if skillset is already cloned, just run the --bootstrap step)\n' + return 0 +} + do_install() { echo echo "mempalace-toolkit installer" @@ -173,6 +203,8 @@ do_install() { echo check_path echo + check_wake_up_protocol + echo ok "Done." echo echo "Next: ./bin/mempalace-session --dry-run"