garage44.eu/jeroen/cartopolis

logclone: git clone https://garage44.eu/jeroen/cartopolis.git

cartopolis-agent · 2026-11-30T18:20:32Z

feat(hooks): name docs/attempts notes beside docs/notes

midas now has a session forgotten for a week write down what it tried and
why it did not land, in docs/attempts/ with `triggers:` as a note has
(midas's finish-branch skill, "A forgotten session"). The hook reads those
too, so whoever edits the same files again hears that it was tried. It
reads only the files there: a missing docs/attempts/ failed awk and, under
pipefail, hid every note.
.claude/hooks/note-triggers | 11 +++++++++--
 CLAUDE.md                   |  3 +++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/.claude/hooks/note-triggers b/.claude/hooks/note-triggers
index 8de1c438..4aa9856c 100755
--- a/.claude/hooks/note-triggers
+++ b/.claude/hooks/note-triggers
@@ -71,7 +71,14 @@ for file in "${files[@]}"; do
     done
     [ -n "$root" ] || continue
     rel=${file#"$root"/}
-    case "$rel" in docs/notes/*|docs/adr/*|docs/abstract/*) continue ;; esac
+    case "$rel" in docs/notes/*|docs/attempts/*|docs/adr/*|docs/abstract/*) continue ;; esac
+    # The notes, and what sessions tried and did not land (docs/attempts/, the
+    # finish-branch skill's "A forgotten session"), which name their files the
+    # same way. Only those there: a missing folder fails awk, and so the pipe.
+    notes=()
+    for n in "$root"/docs/notes/*.md "$root"/docs/attempts/*.md; do
+        [ -f "$n" ] && notes+=("$n")
+    done
 
     base=$(basename "$rel")
     stem=${base%.*}
@@ -126,7 +133,7 @@ for file in "${files[@]}"; do
             next
         }
         best && /^# / { print best "\t" FILENAME "\t" substr($0, 3); best = 0 }
-    ' "$root"/docs/notes/*.md 2>/dev/null | sort -t$'\t' -k1,1nr -k2,2) || continue
+    ' "${notes[@]}" 2>/dev/null | sort -t$'\t' -k1,1nr -k2,2) || continue
     [ -n "$matches" ] || continue
 
     lines=""
diff --git a/CLAUDE.md b/CLAUDE.md
index d93bec35..2b0278f9 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -235,6 +235,9 @@ the fixture in `testdata.rs`); the rest are prose, so read them.
   file, edited in place when a fact stops being true; `docs/notes/README.md` has the
   format. Give a new note `triggers:` that name its files (`routing.rs`,
   `crates/atlas`, `systems::water`) — those are what the hook matches.
+- `docs/attempts/` — what sessions tried and did not land, and why, each with
+  `triggers:` as a note has and where its code is kept; written when midas files
+  a session forgotten for a week (midas's finish-branch skill, "A forgotten session").
 - `docs/guides/development.md` — the contributor guide: dev loop, tests, code map, config, CI.
 - `docs/mockups/` — screen designs drawn before a feature is built, one folder per topic.
 - `docs/adr/`, `docs/abstract/` — the **frozen** ADR archive, retired 2026-07-26