diff --git a/echo-memory.plugin b/echo-memory.plugin index 0f9bf93..baa5797 100644 Binary files a/echo-memory.plugin and b/echo-memory.plugin differ diff --git a/echo-memory.plugin.src/.claude-plugin/plugin.json b/echo-memory.plugin.src/.claude-plugin/plugin.json index 69ad35c..640ca8c 100644 --- a/echo-memory.plugin.src/.claude-plugin/plugin.json +++ b/echo-memory.plugin.src/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "echo-memory", - "version": "0.4.0", + "version": "0.4.1", "description": "Persistent memory via the ECHO Obsidian vault over the Local REST API. Reads and writes notes across Claude/CoWork sessions using direct REST calls \u2014 no MCP server required. Jason's personal memory vault.", "author": { "name": "Jason" diff --git a/echo-memory.plugin.src/skills/echo-memory/SKILL.md b/echo-memory.plugin.src/skills/echo-memory/SKILL.md index fc9ea9a..ec04ed0 100644 --- a/echo-memory.plugin.src/skills/echo-memory/SKILL.md +++ b/echo-memory.plugin.src/skills/echo-memory/SKILL.md @@ -270,7 +270,7 @@ After substantive activity, write a one-line entry to today's daily note's `## A 1. Try to GET `journal/daily/YYYY-MM-DD.md`. 2. If 404 — PUT a fresh daily note from the template, then PATCH. -3. If 200 but `## Agent Log` is missing — POST `\n\n## Agent Log\n` to the file to add the heading, then PATCH. +3. If 200 but `## Agent Log` is missing — POST `\n\n## Agent Log\n` to the file to add the heading, then PATCH. **Detect the heading by grepping the raw markdown for an anchored `^## Agent Log` line — do NOT grep the document-map JSON, whose headings are full `::`-delimited paths (e.g. `"2026-06-07::Agent Log"`); a bare `"Agent Log"` match fails there and a duplicate heading gets appended.** 4. PATCH-append the entry under the target `::Agent Log` (the H1 of a daily note is the date, so that's the full target path). ```bash @@ -286,9 +286,11 @@ if [ "$HTTP" = "404" ]; then | curl -s -X PUT -H "$AUTH" -H "Content-Type: text/markdown" --data-binary @- "$DAILY" fi -# 3: ensure the `## Agent Log` heading exists -MAP=$(curl -s -H "$AUTH" -H "Accept: application/vnd.olrapi.document-map+json" "$DAILY") -if ! printf '%s' "$MAP" | grep -q '"Agent Log"'; then +# 3: ensure the `## Agent Log` heading exists. +# Grep the RAW markdown for an anchored heading line. Do NOT grep the document-map +# JSON: its headings are full "::"-delimited paths (e.g. "2026-06-07::Agent Log"), so a +# bare '"Agent Log"' match never matches and a DUPLICATE heading gets appended each time. +if ! curl -s -H "$AUTH" "$DAILY" | grep -q '^## Agent Log'; then printf '\n\n## Agent Log\n' | curl -s -X POST -H "$AUTH" -H "Content-Type: text/markdown" --data-binary @- "$DAILY" fi