From cd9fbc2091e5933a8abc6eef98290affcd9ed2d2 Mon Sep 17 00:00:00 2001 From: willsupernormal Date: Wed, 18 Mar 2026 22:01:43 +1100 Subject: [PATCH 1/2] Capsule tasks: single source of truth in _core/tasks.md Capsule companions no longer have their own task list. Tasks live in the walnut's _core/tasks.md under a capsule heading. Companion ## Tasks section replaced with a pointer. Prevents split source of truth where tasks exist in both places. Re-added deploy.sh (lost in force-push). Updated: templates/capsule/companion.md, rules/capsules.md Co-Authored-By: Claude Opus 4.6 (1M context) --- deploy.sh | 37 ++++++++++++++++++++ plugins/alive/rules/capsules.md | 4 +-- plugins/alive/templates/capsule/companion.md | 4 +-- 3 files changed, 40 insertions(+), 5 deletions(-) create mode 100755 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..a3c8969 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Deploy alive plugin from local clone to cache +# Usage: ./deploy.sh [--dry-run] + +set -euo pipefail + +SOURCE="$(cd "$(dirname "$0")/plugins/alive" && pwd)" +CACHE="$HOME/.claude/plugins/cache/alivecomputer/alive/1.0.1-beta" + +if [ ! -d "$SOURCE" ]; then + echo "ERROR: Source not found at $SOURCE" + exit 1 +fi + +if [ ! -d "$CACHE" ]; then + echo "ERROR: Cache not found at $CACHE" + exit 1 +fi + +DRY_RUN="" +if [ "${1:-}" = "--dry-run" ]; then + DRY_RUN="--dry-run" + echo "=== DRY RUN ===" +fi + +echo "Source: $SOURCE" +echo "Cache: $CACHE" +echo "" + +rsync -av --delete \ + --exclude='.git' \ + --exclude='.DS_Store' \ + $DRY_RUN \ + "$SOURCE/" "$CACHE/" + +echo "" +echo "Deployed $(date '+%Y-%m-%d %H:%M:%S')" diff --git a/plugins/alive/rules/capsules.md b/plugins/alive/rules/capsules.md index 0540310..45093e4 100644 --- a/plugins/alive/rules/capsules.md +++ b/plugins/alive/rules/capsules.md @@ -70,7 +70,7 @@ tags: [engineering, vendors] ### Body Sections - `## Context` — what this capsule is about, current state -- `## Tasks` — capsule-scoped checkboxes with @session_id attribution. Same syntax as walnut tasks.md. +- `## Tasks` — pointer to `_core/tasks.md`. Capsule tasks live in the walnut task list under a capsule heading, not in the companion. - `## Changelog` — every version after v0.1 gets a brief note about what changed - `## Work Log` — append-only. Each session adds its entry at the bottom. Never edit previous entries. @@ -165,7 +165,7 @@ If two capsules overlap, link them or spawn a third that synthesizes both. Only ### 2. Capsule-scoped tasks -`## Tasks` in companion body with checkbox + @session_id. `[~]` means actively being worked on. +Capsule tasks live in the walnut's `_core/tasks.md` under a heading matching the capsule name. Not in the companion. This prevents split source of truth. ### 3. Append-only work log diff --git a/plugins/alive/templates/capsule/companion.md b/plugins/alive/templates/capsule/companion.md index 92b6b8e..ee2fe2e 100644 --- a/plugins/alive/templates/capsule/companion.md +++ b/plugins/alive/templates/capsule/companion.md @@ -41,9 +41,7 @@ tags: [] ## Tasks -Capsule-scoped work items. Same syntax as walnut tasks.md. - -- [ ] Example task @session_id +Tasks for this capsule live in the walnut's `_core/tasks.md` under a capsule heading. Do not duplicate tasks here. ## Changelog From c76c008f111f596c0ba5ab796f4a7eb490b20866 Mon Sep 17 00:00:00 2001 From: willsupernormal Date: Thu, 19 Mar 2026 18:36:48 +1100 Subject: [PATCH 2/2] Inject _index.yaml into session context via additionalContext MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The world index was generated but never injected — the squirrel had no boot-time walnut registry. Session hook now reads .alive/_index.yaml and injects it wrapped in tags alongside the world key. This gives the squirrel immediate awareness of all walnuts, their phases, next actions, capsule counts, people, and links — without needing to scan the filesystem. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../alive/hooks/scripts/alive-session-new.sh | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/plugins/alive/hooks/scripts/alive-session-new.sh b/plugins/alive/hooks/scripts/alive-session-new.sh index a2e8e82..6ae3122 100755 --- a/plugins/alive/hooks/scripts/alive-session-new.sh +++ b/plugins/alive/hooks/scripts/alive-session-new.sh @@ -143,6 +143,15 @@ if [ -f "$WORLD_KEY_FILE" ]; then WORLD_KEY_CONTENT=$(cat "$WORLD_KEY_FILE") fi +# Read world index (.alive/_index.yaml) for injection — walnut registry +WORLD_INDEX_CONTENT="" +WORLD_INDEX_FILE="$WORLD_ROOT/.alive/_index.yaml" +if [ -f "$WORLD_INDEX_FILE" ]; then + WORLD_INDEX_CONTENT=" +$(cat "$WORLD_INDEX_FILE") +" +fi + # Capsule awareness injection CAPSULE_AWARENESS=" If you detect work with a deliverable or future audience — drafting for someone, iterating a document, building something to ship, send, or reference later — check: is there an active capsule? If not, invoke the capsule skill to offer creation. @@ -210,8 +219,12 @@ Model: $HOOK_MODEL $PREFS Rules: ${RULE_COUNT} loaded (${RULE_NAMES})" -# Escape and combine — world key + capsule awareness + tidy nudge + rules +# Escape and combine — world key + index + capsule awareness + tidy nudge + rules WORLD_KEY_ESCAPED=$(escape_for_json "$WORLD_KEY_CONTENT") +INDEX_ESCAPED="" +if [ -n "$WORLD_INDEX_CONTENT" ]; then + INDEX_ESCAPED=$(escape_for_json "$WORLD_INDEX_CONTENT") +fi CAPSULE_ESCAPED=$(escape_for_json "$CAPSULE_AWARENESS") TIDY_ESCAPED="" if [ -n "$TIDY_NUDGE" ]; then @@ -221,7 +234,11 @@ SESSION_MSG_ESCAPED=$(escape_for_json "$SESSION_MSG") PREAMBLE_ESCAPED=$(escape_for_json "$PREAMBLE") RUNTIME_ESCAPED=$(escape_for_json "$RUNTIME_RULES") -CONTEXT="${SESSION_MSG_ESCAPED}\n\n${WORLD_KEY_ESCAPED}\n\n${CAPSULE_ESCAPED}" +CONTEXT="${SESSION_MSG_ESCAPED}\n\n${WORLD_KEY_ESCAPED}" +if [ -n "$INDEX_ESCAPED" ]; then + CONTEXT="${CONTEXT}\n\n${INDEX_ESCAPED}" +fi +CONTEXT="${CONTEXT}\n\n${CAPSULE_ESCAPED}" if [ -n "$TIDY_ESCAPED" ]; then CONTEXT="${CONTEXT}\n\n${TIDY_ESCAPED}" fi