Skip to content

Commit 910aad6

Browse files
author
zenus
committed
chore: finish bitlesson path migration cleanup
1 parent 04b4558 commit 910aad6

6 files changed

Lines changed: 21 additions & 51 deletions

agents/bitlesson-selector.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ tools: Read, Grep
77

88
# BitLesson Selector
99

10-
You select which lessons from `bitlesson.md` must be applied for a given sub-task.
10+
You select which lessons from the configured BitLesson file, normally `.humanize/bitlesson.md`, must be applied for a given sub-task.
1111

1212
## Input
1313

1414
You will receive:
1515
- Current sub-task description
1616
- Related file paths
17-
- The project `bitlesson.md` content
17+
- The project BitLesson content from the configured file, normally `.humanize/bitlesson.md`
1818

1919
## Cross-Agent Review Context
2020

bitlesson.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

hooks/loop-codex-stop-hook.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,9 @@ if [[ "$GIT_IS_REPO" == "true" ]]; then
585585

586586
# Check for uncommitted changes (staged or unstaged) using cached status.
587587
# Exclude untracked .humanize/ paths and .humanize-* dash-separated legacy
588-
# variants from the dirty determination because local plugin state
589-
# (bitlesson.md, config.json, rlcr/) is intentionally untracked.
588+
# variants from the dirty determination because local plugin state under
589+
# .humanize/ (.humanize/bitlesson.md, config.json, rlcr/) is intentionally
590+
# untracked.
590591
HUMANIZE_UNTRACKED_PATTERN='^\?\? \.humanize[-/]'
591592
GIT_STATUS_FOR_BLOCK=$(echo "$GIT_STATUS_CACHED" | grep -vE "$HUMANIZE_UNTRACKED_PATTERN" || true)
592593
if [[ -n "$GIT_STATUS_FOR_BLOCK" ]]; then

tests/test-bitlesson-select-routing.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ echo "Bitlesson Select Routing Tests"
1515
echo "=========================================="
1616
echo ""
1717

18-
# Helper: create a mock bitlesson.md with required content
18+
# Helper: create a mock .humanize/bitlesson.md with required content
1919
create_mock_bitlesson() {
2020
local dir="$1"
21-
mkdir -p "$dir"
22-
cat > "$dir/bitlesson.md" <<'EOF'
21+
mkdir -p "$dir/.humanize"
22+
cat > "$dir/.humanize/bitlesson.md" <<'EOF'
2323
# BitLesson Knowledge Base
2424
## Entries
2525
<!-- placeholder -->
@@ -78,7 +78,7 @@ result=$(CLAUDE_PROJECT_DIR="$TEST_DIR" XDG_CONFIG_HOME="$TEST_DIR/no-user" \
7878
bash "$BITLESSON_SELECT" \
7979
--task "Fix a bug" \
8080
--paths "scripts/bitlesson-select.sh" \
81-
--bitlesson-file "$TEST_DIR/bitlesson.md" 2>/dev/null) || exit_code=$?
81+
--bitlesson-file "$TEST_DIR/.humanize/bitlesson.md" 2>/dev/null) || exit_code=$?
8282

8383
if [[ $exit_code -eq 0 ]] && echo "$result" | grep -q "LESSON_IDS:"; then
8484
pass "Codex branch: gpt-* model routes to codex (produces LESSON_IDS output)"
@@ -107,7 +107,7 @@ result=$(CLAUDE_PROJECT_DIR="$TEST_DIR" XDG_CONFIG_HOME="$TEST_DIR/no-user" \
107107
bash "$BITLESSON_SELECT" \
108108
--task "Fix a bug" \
109109
--paths "scripts/bitlesson-select.sh" \
110-
--bitlesson-file "$TEST_DIR/bitlesson.md" 2>/dev/null) || exit_code=$?
110+
--bitlesson-file "$TEST_DIR/.humanize/bitlesson.md" 2>/dev/null) || exit_code=$?
111111

112112
if [[ $exit_code -eq 0 ]] && echo "$result" | grep -q "LESSON_IDS:"; then
113113
pass "Claude branch: haiku model routes to claude (produces LESSON_IDS output)"
@@ -136,7 +136,7 @@ result=$(CLAUDE_PROJECT_DIR="$TEST_DIR" XDG_CONFIG_HOME="$TEST_DIR/no-user" \
136136
bash "$BITLESSON_SELECT" \
137137
--task "Refactor logic" \
138138
--paths "scripts/bitlesson-select.sh" \
139-
--bitlesson-file "$TEST_DIR/bitlesson.md" 2>/dev/null) || exit_code=$?
139+
--bitlesson-file "$TEST_DIR/.humanize/bitlesson.md" 2>/dev/null) || exit_code=$?
140140

141141
if [[ $exit_code -eq 0 ]] && echo "$result" | grep -q "LESSON_IDS:"; then
142142
pass "Claude branch: sonnet model routes to claude (produces LESSON_IDS output)"
@@ -165,7 +165,7 @@ result=$(CLAUDE_PROJECT_DIR="$TEST_DIR" XDG_CONFIG_HOME="$TEST_DIR/no-user" \
165165
bash "$BITLESSON_SELECT" \
166166
--task "Write docs" \
167167
--paths "scripts/bitlesson-select.sh" \
168-
--bitlesson-file "$TEST_DIR/bitlesson.md" 2>/dev/null) || exit_code=$?
168+
--bitlesson-file "$TEST_DIR/.humanize/bitlesson.md" 2>/dev/null) || exit_code=$?
169169

170170
if [[ $exit_code -eq 0 ]] && echo "$result" | grep -q "LESSON_IDS:"; then
171171
pass "Claude branch: OPUS (uppercase) model routes to claude (case-insensitive match)"
@@ -191,7 +191,7 @@ stderr_out=$(CLAUDE_PROJECT_DIR="$TEST_DIR" XDG_CONFIG_HOME="$TEST_DIR/no-user"
191191
bash "$BITLESSON_SELECT" \
192192
--task "Fix a bug" \
193193
--paths "scripts/bitlesson-select.sh" \
194-
--bitlesson-file "$TEST_DIR/bitlesson.md" 2>&1 >/dev/null) || exit_code=$?
194+
--bitlesson-file "$TEST_DIR/.humanize/bitlesson.md" 2>&1 >/dev/null) || exit_code=$?
195195

196196
if [[ $exit_code -ne 0 ]] && echo "$stderr_out" | grep -qiE "unknown|error"; then
197197
pass "Unknown model: exits non-zero with clear error message"
@@ -227,7 +227,7 @@ stderr_out=$(CLAUDE_PROJECT_DIR="$TEST_DIR" XDG_CONFIG_HOME="$TEST_DIR/no-user"
227227
bash "$BITLESSON_SELECT" \
228228
--task "Fix a bug" \
229229
--paths "scripts/bitlesson-select.sh" \
230-
--bitlesson-file "$TEST_DIR/bitlesson.md" 2>&1 >/dev/null) || exit_code=$?
230+
--bitlesson-file "$TEST_DIR/.humanize/bitlesson.md" 2>&1 >/dev/null) || exit_code=$?
231231

232232
if [[ $exit_code -ne 0 ]] && echo "$stderr_out" | grep -qi "codex"; then
233233
pass "Codex branch: missing codex binary exits non-zero with informative error"
@@ -264,7 +264,7 @@ stdout_out=$(CLAUDE_PROJECT_DIR="$TEST_DIR" XDG_CONFIG_HOME="$TEST_DIR/no-user"
264264
bash "$BITLESSON_SELECT" \
265265
--task "Fix a bug" \
266266
--paths "scripts/bitlesson-select.sh" \
267-
--bitlesson-file "$TEST_DIR/bitlesson.md" 2>/dev/null) || exit_code=$?
267+
--bitlesson-file "$TEST_DIR/.humanize/bitlesson.md" 2>/dev/null) || exit_code=$?
268268

269269
if [[ $exit_code -eq 0 ]] && echo "$stdout_out" | grep -q "LESSON_IDS: NONE"; then
270270
pass "Claude model falls back to codex when claude binary is missing"

tests/test-bitlesson-validate-delta.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ echo ""
2121
make_bitlesson_file() {
2222
local path="$1"
2323

24+
mkdir -p "$(dirname "$path")"
2425
cat > "$path" <<EOF
2526
# BitLesson
2627
@@ -94,7 +95,7 @@ assert_passes() {
9495
}
9596

9697
setup_test_dir
97-
BITLESSON_FILE="$TEST_DIR/bitlesson.md"
98+
BITLESSON_FILE="$TEST_DIR/.humanize/bitlesson.md"
9899
make_bitlesson_file "$BITLESSON_FILE"
99100

100101
SUMMARY_FILE="$TEST_DIR/add-empty-notes.md"

tests/test-stop-hook-legacy-compat.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# Covers:
66
# - Untracked legacy .humanize-* directories do not trigger git-dirty blocks
77
# - Untracked .humanizeconfig still triggers git-dirty blocks as a real file
8-
# - Legacy loops without bitlesson_required stay disabled even if bitlesson.md exists
8+
# - Legacy loops without bitlesson_required stay disabled even if
9+
# .humanize/bitlesson.md exists
910
#
1011

1112
set -euo pipefail
@@ -182,10 +183,10 @@ create_stop_hook_fixture "$TEST2_REPO" true
182183
run_stop_hook "$TEST2_REPO"
183184

184185
if [[ "$RUN_EXIT_CODE" -eq 0 ]] && [[ -f "$RUN_MARKER" ]]; then
185-
pass "Legacy loops without bitlesson_required still reach Codex even when bitlesson.md exists"
186+
pass "Legacy loops without bitlesson_required still reach Codex even when .humanize/bitlesson.md exists"
186187
else
187188
fail \
188-
"Legacy loops without bitlesson_required still reach Codex even when bitlesson.md exists" \
189+
"Legacy loops without bitlesson_required still reach Codex even when .humanize/bitlesson.md exists" \
189190
"exit 0 and Codex invoked" \
190191
"exit $RUN_EXIT_CODE, marker=$(test -f "$RUN_MARKER" && echo present || echo missing), output: $RUN_OUTPUT"
191192
fi

0 commit comments

Comments
 (0)