Skip to content

The meta-skill that builds and improves all your skills, including itself. Watches your work sessions (autonomous or human-led), captures patterns, corrections and judgement calls, and turns them into skill improvements and new skill candidates for your review. Practical application of the Augmented Expertise methodology. Open source: CC BY 4.0.

Flag a pre-3.0 log.md that sits beside the observation directory

Eoghan Hennb6b025ff0ea2
diff --git a/SKILL.md b/SKILL.md
index 388830a..4900fb5 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -127,7 +127,7 @@ skill" (some upload paths keep only `SKILL.md`); its episodes do not run.
`references/environments.md` ("Claude Code Projects"). Then RUN the one
idempotent command in `references/observation-log.md` ("Workspace
creation"): it creates the four workspace artefacts and asserts each,
- and refuses a pre-3.0 `log.md` layout (load `references/migration.md`
+ and refuses a pre-3.0 `log.md`, alone or beside the directory (load `references/migration.md`
and convert first) — never create them by working down a list by hand.
Then the **starter-set reconciliation**, due whenever
`skill-observations/starter-principles-reviewed.txt` is absent or holds
diff --git a/references/environments.md b/references/environments.md
index 7ecf654..69001b7 100644
--- a/references/environments.md
+++ b/references/environments.md
@@ -926,7 +926,10 @@ version's trigger, including its session-start instruction. That defeats the
upgrade at the one activation tier that survives an unreachable config:
description matching now has two candidates competing for the same trigger,
one of them the file the upgrade just replaced. Back up **outside** the
-skills directory.
+skills directory. The same holds for any second copy the host loads — a
+user-owned copy beside an account-synced one: the older copy is a second
+writer in the old format (the scan's SPLIT STORE line is how it shows),
+so name each copy's version when more than one resolves.
**A hook registered by script path dies when the exec bit goes.** The
docs' example reads most naturally as naming the script directly:
diff --git a/references/migration.md b/references/migration.md
index f7b5651..1f9bd2a 100644
--- a/references/migration.md
+++ b/references/migration.md
@@ -1,14 +1,16 @@
# Migrating a pre-3.0 single-file log
-Load triggers: the Session Start Protocol finds a pre-3.0 `log.md` and no `observation-log/`
+Load triggers: the Session Start Protocol finds a pre-3.0 `log.md` — with no `observation-log/`, or beside one (a split store)
Upgrade-only. Versions before 3.0.0 kept every observation in one file,
`skill-observations/log.md`, with `### Observation N:` headers. Version
3.0.0 stores one file per observation under
`skill-observations/observation-log/`. This reference converts the former
into the latter, once, with the bundled script. Fresh 3.0 installs never
-need it; the Session Start Protocol loads it only when it finds a
-`log.md` and no `observation-log/` directory.
+need it; the Session Start Protocol loads it when it finds a `log.md`
+and no `observation-log/` directory — or a `log.md` beside a populated
+one (a SPLIT STORE: an older installed copy of the skill kept writing
+the legacy file after the migration; find and retire that copy first).
The conversion is a script rather than a procedure for one reason: a
script can be run in check-only mode over every log you have and its
@@ -134,6 +136,16 @@ it can be the Microsoft Store alias), use `py -3`.
second skill named inside a qualifier; pass it to the step 3 check of
the live log too.
+ **A split store is never converted into the populated directory.** The
+ converted files keep their legacy ids and the script overwrites a
+ same-named file, so a `log.md` written beside an existing
+ `observation-log/` is converted into a scratch `--out` directory, and
+ each converted file is then created in the live one through
+ `scripts/new-observation.sh --body <file> <slug>` with its `id:` line
+ replaced by `__ID__` first — the id is re-issued from the directory's
+ counter, never carried over, and the legacy number goes into the body
+ as "migrated from log.md #N" so a citation of it can still be traced.
+
6. **Verify twice: source fidelity, then target conformance.** The
report's file count must equal the number of `### Observation` headers
in `log.md`:
diff --git a/references/observation-log.md b/references/observation-log.md
index 40ff99d..35a7368 100644
--- a/references/observation-log.md
+++ b/references/observation-log.md
@@ -78,6 +78,7 @@ here: run this, do not work down the tree above by hand.
```bash
d="[ABSOLUTE PATH]/skill-observations" # the pinned path, quoted: it may contain a space; bash, not sh
[ -e "$d/log.md" ] && [ ! -d "$d/observation-log" ] && { echo "LEGACY log.md — run the migration (references/migration.md) before creating anything"; exit 1; }
+[ -e "$d/log.md" ] && [ -d "$d/observation-log" ] && { echo "SPLIT STORE — log.md holds $(grep -c '^### Observation ' "$d/log.md") observations not in observation-log/ (an older installed copy still writes the legacy file); migrate the remainder (references/migration.md), re-issuing ids from the directory's counter"; exit 1; }
c=; for x in observation-log observation-log/archive last-review-date.txt cross-cutting-principles.md; do [ -e "$d/$x" ] || c="$c${c:+,}$x"; done # what this run creates
mkdir -p "$d/observation-log/archive"
[ -e "$d/last-review-date.txt" ] || printf 'never\n' > "$d/last-review-date.txt" # the literal `never`, never a date: a date means a review actually ran
@@ -93,7 +94,10 @@ the `[ -e ]` guards make the command safe to re-run on an existing
workspace, which is what lets step 1 run it unconditionally rather than
deciding first whether setup is needed. The legacy guard runs first
because a created `observation-log/` would hide the one condition that
-identifies a pre-3.0 install. The principles stub is the header of the
+identifies a pre-3.0 install; the split-store guard beside it catches the
+install that was migrated and then kept writing `log.md` through an older
+copy the host still loads, which the first guard alone can never see
+again once the directory exists. The principles stub is the header of the
template in `skill-authoring.md` ("Principle Propagation"); change the two
together.
diff --git a/scripts/session-start-scan.sh b/scripts/session-start-scan.sh
index 0d421d0..ee0d36c 100755
--- a/scripts/session-start-scan.sh
+++ b/scripts/session-start-scan.sh
@@ -15,13 +15,14 @@
# (UNFILLED: a header whose title: is empty — the skeleton new-observation.sh
# writes at create time, a write in progress or abandoned; NOTE: id: … when
# a header's id does not read as its filename prefix); the counts
-# line (files, parsed, suspect, archive-suspect); a NOTE: pointer line when
+# line (files, parsed, suspect, archive-suspect); a SPLIT STORE line when a
+# pre-3.0 log.md sits beside the directory; a NOTE: pointer line when
# skill-observations/MOVED.md exists; a GAP line when the previous scan in
# checkpoints.log is 7 or more days old; the logs found under the root's
# parent; the active principles' headings; then the frontmatter of every
# numbered entry, each header followed by one `---` line; and LAST one
# `end of scan` line repeating the counts and how many finding lines
-# (NOTE / LOST ENTRIES / UNFILLED / GAP) stand above the entries. The findings open the
+# (NOTE / LOST ENTRIES / UNFILLED / SPLIT STORE / GAP) stand above the entries. The findings open the
# output and the summary closes it, so a view cut by `head` keeps the
# findings and one cut by `tail` keeps the summary and its finding count;
# neither replaces reading the output whole, which the summary line says.
@@ -127,7 +128,7 @@ a_sus=0; [ -d "$d/archive" ] && a_sus=$(LC_ALL=C find "$d/archive" -maxdepth 1 -
p="$root/skill-observations/cross-cutting-principles.md"
pa='/^(\140\140\140|~~~)/ {f=!f} f {next} /^## Active Principles/ {a=1; h=1; next} a && /^## / {a=0}'
pr=absent; [ -f "$p" ] && pr=$(awk "$pa"' a && /^### / {n++} END {print (h ? n+0 : "unparsed")}' "$p")
-# fx counts the finding lines (NOTE / LOST ENTRIES / UNFILLED / GAP) printed above the
+# fx counts the finding lines (NOTE / LOST ENTRIES / UNFILLED / SPLIT STORE / GAP) printed above the
# entries, for the end-of-scan line.
fx=0
[ "$pr" = unparsed ] && { echo "NOTE: the principles file has no '## Active Principles' heading — 'could not parse', not 'no principles'; read it directly"; fx=$((fx + 1)); }
@@ -159,6 +160,17 @@ idmis=$(printf '%s\n' "$hd" | sed -n 's/^I \(.*\) \(.*\)$/\1 (id: \2)/p' | LC_AL
[ "$suspect" -gt 0 ] || [ "$a_sus" -gt 0 ] && { echo "NOTE: $suspect of $n headers (and $a_sus in archive/) look like invalid YAML (an unquoted ': ', text after a closing quote, a value opening with a backtick, @ or %, an undefined escape, a colon in an unquoted list entry) — quote or fix them (File format)"; fx=$((fx + 1)); }
printf 'files: %s parsed: %s suspect (awk, a floor): %s archive-suspect: %s\n' "$n" "$parsed" "$suspect" "$a_sus"
+# --- split store: a pre-3.0 log.md beside the directory -----------------------
+# The creation command's LEGACY guard fires only when the directory is
+# absent, so a legacy file written AFTER the migration — by an older
+# installed copy the host still loads — sits beside the directory unseen.
+# Report it with its entry count; the creation command refuses on it too.
+lg="$root/skill-observations/log.md"
+if [ -e "$lg" ]; then
+ echo "SPLIT STORE — log.md holds $(grep -c '^### Observation ' "$lg" | tr -d ' ') observations not in observation-log/: an older installed copy of the skill still writes the legacy file; name each copy's version, then migrate the remainder (references/migration.md) with ids re-issued from this directory's counter"
+ fx=$((fx + 1))
+fi
+
# --- pointer: skill-observations/MOVED.md marks a root as abandoned ------------
# Left by a consolidation or a re-anchor (references/environments.md, "Before
# creating a log, search for one"). A session still anchored here is the one
@@ -215,6 +227,6 @@ rc=$?
# so output cut to its last lines still shows that there were findings to
# read; it is a pointer to the whole output, never its replacement.
st=; [ "$rc" -eq 0 ] || st="; content print exited $rc"
-printf 'end of scan — files: %s parsed: %s suspect: %s archive-suspect: %s principles: %s; finding lines above the entries (NOTE / LOST ENTRIES / UNFILLED / GAP): %s%s. Read the output whole: never cut it with head, tail or grep\n' \
+printf 'end of scan — files: %s parsed: %s suspect: %s archive-suspect: %s principles: %s; finding lines above the entries (NOTE / LOST ENTRIES / UNFILLED / SPLIT STORE / GAP): %s%s. Read the output whole: never cut it with head, tail or grep\n' \
"$n" "$parsed" "$suspect" "$a_sus" "$pr" "$fx" "$st"
exit "$rc"
diff --git a/scripts/validate-skill-bundle.py b/scripts/validate-skill-bundle.py
index 2e32765..7e19c20 100644
--- a/scripts/validate-skill-bundle.py
+++ b/scripts/validate-skill-bundle.py
@@ -1165,6 +1165,8 @@ SCAN_FIXTURES = [
"NOTE: id: does not read as the filename prefix", 1, ""),
("a zero-padded id reads as its prefix; only the wrong number is named", "padded", True, 0,
"after reading the body: 0004-d.md (id: 5)", 1, "0002-b.md (id"),
+ ("a pre-3.0 log.md beside the directory: SPLIT STORE with its count", "split", True, 0,
+ "SPLIT STORE — log.md holds 2 observations not in observation-log/", 1, ""),
]
@@ -1199,6 +1201,9 @@ def scan_case(scenario, pass_root):
if scenario == "moved":
(root / "skill-observations" / "MOVED.md").write_text(
"Moved to /new/root on 2026-01-01\r\n", encoding="utf-8")
+ if scenario == "split":
+ (root / "skill-observations" / "log.md").write_text(
+ "### Observation 1: A\n\n### Observation 2: B\n", encoding="utf-8")
env = {k: v for k, v in os.environ.items() if k != "TASK_OBSERVER_WORKSPACE"}
args = ["bash", str(SCAN_SCRIPT)] + ([str(root)] if pass_root else [])
r = subprocess.run(args, cwd=tmp, env=env, capture_output=True, text=True,