From 037e14dacc04e0ea61e031969c5121cad26b9b65 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Fri, 26 Jun 2026 13:27:57 +0200 Subject: [PATCH] test(lib): behavioral end-to-end check doc for coupled-capitalize Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01W9sqAwZxBMZSynZoVrEJhd --- lib/tests/run-behavioral.md | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 lib/tests/run-behavioral.md diff --git a/lib/tests/run-behavioral.md b/lib/tests/run-behavioral.md new file mode 100644 index 0000000..80b3225 --- /dev/null +++ b/lib/tests/run-behavioral.md @@ -0,0 +1,45 @@ +# Behavioral check — coupled-capitalize, end-to-end + +The deterministic suite (`run-deterministic.sh`, T1–T7) proves `memory-commit.sh` +in isolation. This is the in-vivo whole-chain check: a real dev-flow shape — +code commit, then capitalize writes memory, then the include commits it — with +dangling code present, proving the memory commit is coupled AND surgical. + +## Scenario (run on a throwaway repo) + +```bash +R="$(mktemp -d)"; cd "$R" +git init -q && git config user.email t@t.t && git config user.name t +mkdir -p .claude/memory .claude/tasks src +printf 'baseline\n' > .claude/memory/decisions.md +git add -A && git commit -qm baseline + +# 1) the flow commits CODE +printf 'feature code\n' > src/feature.txt +git add -- src/feature.txt && git commit -qm "feat: the feature" +code_hash="$(git rev-parse --short HEAD)" + +# 2) capitalize writes the approved entry (referencing the code hash) + journal +printf '\n## BDR-099 — example\n- Reference: commit %s\n' "$code_hash" >> .claude/memory/decisions.md +printf -- '- did the thing\n' >> .claude/tasks/TODO.md + +# 3) a code file is left dangling (must NOT be embarked) +printf 'WIP do not commit\n' > src/dangling.txt + +# 4) the include commits the memory surgically +mem_hash="$(bash "$HOME/.claude/lib/memory-commit.sh" commit "chore(memory): BDR-099 — example")" +``` + +## Expected (assert) + +- Exactly TWO commits after baseline: the code commit, then the memory commit. +- The memory commit (`$mem_hash`) contains ONLY `.claude/memory/decisions.md` + and `.claude/tasks/TODO.md` — never `src/feature.txt` (already committed) or + `src/dangling.txt` (WIP). +- `src/dangling.txt` is still untracked after the memory commit. +- `$mem_hash` (the memory commit) ≠ `$code_hash` (anchored inside the entry). + +If all hold, the chain is coupled (memory committed in the same breath as the +flow) and surgical (no dangling code embarked). This mirrors what feat / hotfix / +bugfix / commit-change do via their capitalize step, and what ship-feature / +init-project do before FINISH.