codewhale.history 2.11.19 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,243 +1,264 @@
1
- # Changelog
2
-
3
- All notable changes to the CodeWhale Tools Pack.
4
-
5
- ---
6
-
7
- ## [2.11.19] — 2026-07-13
8
-
9
- ### Added
10
- - README: Added the AGPL license info the npm page
11
-
12
- ## [2.11.17] 2026-07-13
13
-
14
- ### Added
15
- - README: "Looking for Copilot version" changed to level 2 header
16
-
17
- ## [2.11.16] — 2026-07-13
18
-
19
- ### Added
20
- - README: "Looking for Copilot version" section with link to copilot.tools
21
-
22
- ## [2.11.15] 2026-07-11
23
-
24
- ### Added
25
- - README: requirements list now includes LLM API key prerequisite
26
-
27
- ## [2.11.14] — 2026-07-11
28
-
29
- ### Fixed
30
- - README: trigger table and theme modifiers now show both spec↔code directions (was only showing spec→code)
31
-
32
- ## [2.11.13] — 2026-07-11
33
-
34
- ### Added
35
- - README: "How to use" section — cd → codewhale → TAB → //trigger
36
-
37
- ## [2.11.12] — 2026-07-11
38
-
39
- ### Fixed
40
- - README: moved AGPL notice to footer (was cluttering npm page header)
41
-
42
- ## [2.11.11] — 2026-07-11
43
-
44
- ### Added
45
- - AGPL copyright headers to all source files (4 JS files, 4 SKILL.md files, instructions; README gets footer notice only)
46
-
47
- ## [2.11.10] — 2026-07-09
48
-
49
- ### Changed
50
- - README: clarified install instructions — navigate to your project folder first
51
-
52
- ## [2.11.9] — 2026-07-07
53
-
54
- ### Removed
55
- - README image (npm doesn't render local files)
56
- - teach_me-overview.png from npm package (files array)
57
- - tools-install.js: removed diagram copy step and verification
58
-
59
- ## [2.11.8] — 2026-07-07
60
-
61
- ### Changed
62
- - Moved diagram to package root: teach_me-overview.png
63
- - package.json: images/ → teach_me-overview.png in files array
64
- - tools-install.js: copy diagram directly to ~/.codewhale/
65
-
66
- ## [2.11.7] 2026-07-07
67
-
68
- ### Added
69
- - README: teach-me workflow diagram (images/teach_me-overview.png)
70
- - package.json: include images/ in "files" array for npm publish
71
- - tools-install.js: copy images to ~/.codewhale/images/ on install
72
-
73
- ## [2.11.6] — 2026-07-06
74
-
75
- ### Added
76
- - README: "Want to take this further" section — promotes //spec-analysis product
77
-
78
- ## [2.11.5] 2026-07-06
79
-
80
- ### Added
81
- - README: "Want to take this further" section — promotes //spec-analysis product
82
-
83
- ## [2.11.3] 2026-06-24
84
-
85
- ### Added
86
- - AGPLv3 license (repo root + package directory)
87
- - DCO-based CONTRIBUTING.md with sign-off rules
88
-
89
- ### Changed
90
- - README: AGPLv3 license badge
91
-
92
- ## [2.11.2] 2026-06-24
93
-
94
- ### Fixed
95
- - README: move update instructions after install command
96
-
97
- ## [2.11.1]2026-06-24
98
-
99
- ### Added
100
- - README: update instructions for existing installations
101
-
102
- ## [2.11.0]2026-06-24
103
-
104
- ### Added
105
- - **BA-Gates theme** — document quality analysis for business analysts
106
- - Loop continuation fix in interactive mode
107
-
108
- ## [2.10.1] 2026-06-23
109
-
110
- ### Added
111
- - README: Spec theme description — spec-to-code correlation
112
-
113
- ## [2.10.0] — 2026-06-23
114
-
115
- ### Added
116
- - **Spec theme** spec-to-code traceability via Office documents
117
- - `codewhale-doc-extract` global binary for Office document extraction
118
-
119
- ## [2.9.3] — 2026-06-23
120
-
121
- ### Changed
122
- - README: removed redundant SOLID subsection (covered by trigger table)
123
-
124
- ## [2.9.2] — 2026-06-23
125
-
126
- ### Changed
127
- - **Restructured `//teach-me`** into two orthogonal dimensions:
128
- - **Response modes**: passive, interactive, SOLID
129
- - **Content themes**: general, decorators, async, generators, SOLID, spec, ba-gates
130
-
131
- ## [2.9.1] — 2026-06-23
132
-
133
- ### Added
134
- - README: SOLID mode trigger table and how-it-works section
135
-
136
- ## [2.9.0] — 2026-06-23
137
-
138
- ### Added
139
- - **SOLID mode** — anti-pattern reconstruction for teaching design principles
140
-
141
- ## [2.8.13] — 2026-06-22
142
-
143
- ### Added
144
- - README: Contact Developer section
145
-
146
- ## [2.8.12] — 2026-06-21
147
-
148
- ### Added
149
- - README: CodeWhale URL link
150
-
151
- ## [2.8.11] — 2026-06-21
152
-
153
- ### Changed
154
- - `//teach-me`: restore files with `git checkout` for byte-perfect reset after interactive rounds
155
-
156
- ## [2.8.10] — 2026-06-21
157
-
158
- ### Changed
159
- - `//teach-me`: use Skip thinking depth in interactive selection
160
- - Acknowledged `edit_file` transparency in interactive mode
161
-
162
- ## [2.8.9] — 2026-06-21
163
-
164
- ### Changed
165
- - `//teach-me`: suppress thinking during interactive selection/removal to avoid spoilers
166
-
167
- ## [2.8.8] — 2026-06-21
168
-
169
- ### Added
170
- - `//teach-me`: **interactive (reconstruction) mode** — user edits files live to reconstruct missing code, alongside existing passive quiz mode
171
-
172
- ## [2.8.7] — 2026-06-21
173
-
174
- ### Changed
175
- - `//teach-me`: mandate file re-read before each round for ground-truth accuracy
176
-
177
- ## [2.8.6] — 2026-06-21
178
-
179
- ### Changed
180
- - README: simplified install command postinstall handles the second step
181
-
182
- ## [2.8.5] — 2026-06-21
183
-
184
- ### Fixed
185
- - Postinstall: use `INIT_CWD` instead of `cwd` for correct workspace detection
186
-
187
- ## [2.8.4] — 2026-06-21
188
-
189
- ### Added
190
- - `postinstall` script to auto-run `codewhale-tools-install`
191
-
192
- ## [2.8.3] — 2026-06-21
193
-
194
- ### Added
195
- - `//tools` now displays README in-session as help text
196
-
197
- ## [2.8.2] — 2026-06-21
198
-
199
- ### Added
200
- - README: expanded After Install section with `//history`, `//snapshot`, `//teach-me` details
201
-
202
- ## [2.8.1] — 2026-06-21
203
-
204
- ### Added
205
- - `//teach-me`: targeted concept drills — `teach me decorators`, `teach me async`, `teach me generators`, etc.
206
-
207
- ## [2.8.0] — 2026-06-21
208
-
209
- ### Added
210
- - **`//teach-me` command** — interactive code quiz that selects random snippets from the current project and quizzes on application logic, language semantics, and documentation quality
211
- - Trigger configuration in instructions.md
212
- - Skill installation wiring in tools-install.js
213
-
214
- ## [2.7.0] — 2026-06-20
215
-
216
- ### Fixed
217
- - `//snapshot`: removed stale note overwrite step (notes are session-cached)
218
-
219
- ## [2.6.0] — 2026-06-20
220
-
221
- ### Changed
222
- - `//snapshot on` now overwrites stale caching notes with timestamp convention
223
-
224
- ## [2.5.0] — 2026-06-20
225
-
226
- ### Added
227
- - **`//snapshot` command** — pre-edit file backups with timestamp naming, cross-platform, with retry
228
-
229
- ## [2.0.0] — 2026-06-19
230
-
231
- ### Changed
232
- - Cleaned up installer; code published to npmjs
233
- - Installs into global npm `node_modules/`
234
- - Instructions appended to existing `instructions.md` (no longer replaced)
235
-
236
- ## [1.0.0] — 2026-06-19
237
-
238
- ### Added
239
- - Initial release
240
- - `//tools`lists all available CodeWhale tools
241
- - `//history` — lists CodeWhale chat sessions with message count, tokens, and cost
242
- - Cross-platform installer (`tools-install.js`)
243
- - Global npm package `codewhale.history`
1
+ # Changelog
2
+
3
+ All notable changes to the CodeWhale Tools Pack.
4
+
5
+ ---
6
+
7
+ ## [2.13.0] — 2026-07-18
8
+
9
+ ### Added
10
+ - teach-me: Persistent score tracking across sessions. At session start, users can
11
+ opt in to score tracking under a chosen name. Scores are stored per-user in
12
+ `<workspace>/scores-teach-me/<name>.json`. Returning users see a welcome-back
13
+ summary with total rounds, sessions, strengths, weaknesses, and a suggested next
14
+ level. Level defaults to `last_level` for returning users.
15
+
16
+ ## [2.12.0] — 2026-07-17
17
+
18
+ ### Added
19
+ - teach-me: New Logic-Paths theme (`teach me logic-paths`) — execution-path tracing
20
+ from start to end across functions, modules, and systems. Levels 1–2: single-function
21
+ control flow (branch tracing, dead-code detection). Levels 3–5: cross-function call
22
+ chains from six start-point types (test, entry, thread, event, pubsub, random).
23
+ Supports both passive (describe the path) and interactive (fix a path-breaking bug)
24
+ modes.
25
+ - README: New Features section documenting Logic-Paths theme with level table,
26
+ start-point types, exercise shapes, and triggers.
27
+
28
+ ## [2.11.19] — 2026-07-13
29
+
30
+ ### Added
31
+ - README: Added the AGPL license info the npm page
32
+
33
+ ## [2.11.17] — 2026-07-13
34
+
35
+ ### Added
36
+ - README: "Looking for Copilot version" changed to level 2 header
37
+
38
+ ## [2.11.16] — 2026-07-13
39
+
40
+ ### Added
41
+ - README: "Looking for Copilot version" section with link to copilot.tools
42
+
43
+ ## [2.11.15] — 2026-07-11
44
+
45
+ ### Added
46
+ - README: requirements list now includes LLM API key prerequisite
47
+
48
+ ## [2.11.14] — 2026-07-11
49
+
50
+ ### Fixed
51
+ - README: trigger table and theme modifiers now show both spec↔code directions (was only showing spec→code)
52
+
53
+ ## [2.11.13] — 2026-07-11
54
+
55
+ ### Added
56
+ - README: "How to use" section — cd → codewhale → TAB → //trigger
57
+
58
+ ## [2.11.12] — 2026-07-11
59
+
60
+ ### Fixed
61
+ - README: moved AGPL notice to footer (was cluttering npm page header)
62
+
63
+ ## [2.11.11] 2026-07-11
64
+
65
+ ### Added
66
+ - AGPL copyright headers to all source files (4 JS files, 4 SKILL.md files, instructions; README gets footer notice only)
67
+
68
+ ## [2.11.10] — 2026-07-09
69
+
70
+ ### Changed
71
+ - README: clarified install instructions — navigate to your project folder first
72
+
73
+ ## [2.11.9] — 2026-07-07
74
+
75
+ ### Removed
76
+ - README image (npm doesn't render local files)
77
+ - teach_me-overview.png from npm package (files array)
78
+ - tools-install.js: removed diagram copy step and verification
79
+
80
+ ## [2.11.8] — 2026-07-07
81
+
82
+ ### Changed
83
+ - Moved diagram to package root: teach_me-overview.png
84
+ - package.json: images/ → teach_me-overview.png in files array
85
+ - tools-install.js: copy diagram directly to ~/.codewhale/
86
+
87
+ ## [2.11.7] 2026-07-07
88
+
89
+ ### Added
90
+ - README: teach-me workflow diagram (images/teach_me-overview.png)
91
+ - package.json: include images/ in "files" array for npm publish
92
+ - tools-install.js: copy images to ~/.codewhale/images/ on install
93
+
94
+ ## [2.11.6] — 2026-07-06
95
+
96
+ ### Added
97
+ - README: "Want to take this further" section promotes //spec-analysis product
98
+
99
+ ## [2.11.5] — 2026-07-06
100
+
101
+ ### Added
102
+ - README: "Want to take this further" section promotes //spec-analysis product
103
+
104
+ ## [2.11.3] — 2026-06-24
105
+
106
+ ### Added
107
+ - AGPLv3 license (repo root + package directory)
108
+ - DCO-based CONTRIBUTING.md with sign-off rules
109
+
110
+ ### Changed
111
+ - README: AGPLv3 license badge
112
+
113
+ ## [2.11.2] — 2026-06-24
114
+
115
+ ### Fixed
116
+ - README: move update instructions after install command
117
+
118
+ ## [2.11.1] — 2026-06-24
119
+
120
+ ### Added
121
+ - README: update instructions for existing installations
122
+
123
+ ## [2.11.0] — 2026-06-24
124
+
125
+ ### Added
126
+ - **BA-Gates theme** — document quality analysis for business analysts
127
+ - Loop continuation fix in interactive mode
128
+
129
+ ## [2.10.1] 2026-06-23
130
+
131
+ ### Added
132
+ - README: Spec theme description — spec-to-code correlation
133
+
134
+ ## [2.10.0] 2026-06-23
135
+
136
+ ### Added
137
+ - **Spec theme** — spec-to-code traceability via Office documents
138
+ - `codewhale-doc-extract` global binary for Office document extraction
139
+
140
+ ## [2.9.3] — 2026-06-23
141
+
142
+ ### Changed
143
+ - README: removed redundant SOLID subsection (covered by trigger table)
144
+
145
+ ## [2.9.2] — 2026-06-23
146
+
147
+ ### Changed
148
+ - **Restructured `//teach-me`** into two orthogonal dimensions:
149
+ - **Response modes**: passive, interactive, SOLID
150
+ - **Content themes**: general, decorators, async, generators, SOLID, spec, ba-gates
151
+
152
+ ## [2.9.1] — 2026-06-23
153
+
154
+ ### Added
155
+ - README: SOLID mode trigger table and how-it-works section
156
+
157
+ ## [2.9.0] — 2026-06-23
158
+
159
+ ### Added
160
+ - **SOLID mode** anti-pattern reconstruction for teaching design principles
161
+
162
+ ## [2.8.13] — 2026-06-22
163
+
164
+ ### Added
165
+ - README: Contact Developer section
166
+
167
+ ## [2.8.12] — 2026-06-21
168
+
169
+ ### Added
170
+ - README: CodeWhale URL link
171
+
172
+ ## [2.8.11] — 2026-06-21
173
+
174
+ ### Changed
175
+ - `//teach-me`: restore files with `git checkout` for byte-perfect reset after interactive rounds
176
+
177
+ ## [2.8.10] — 2026-06-21
178
+
179
+ ### Changed
180
+ - `//teach-me`: use Skip thinking depth in interactive selection
181
+ - Acknowledged `edit_file` transparency in interactive mode
182
+
183
+ ## [2.8.9] — 2026-06-21
184
+
185
+ ### Changed
186
+ - `//teach-me`: suppress thinking during interactive selection/removal to avoid spoilers
187
+
188
+ ## [2.8.8] — 2026-06-21
189
+
190
+ ### Added
191
+ - `//teach-me`: **interactive (reconstruction) mode** — user edits files live to reconstruct missing code, alongside existing passive quiz mode
192
+
193
+ ## [2.8.7] — 2026-06-21
194
+
195
+ ### Changed
196
+ - `//teach-me`: mandate file re-read before each round for ground-truth accuracy
197
+
198
+ ## [2.8.6] — 2026-06-21
199
+
200
+ ### Changed
201
+ - README: simplified install command — postinstall handles the second step
202
+
203
+ ## [2.8.5] — 2026-06-21
204
+
205
+ ### Fixed
206
+ - Postinstall: use `INIT_CWD` instead of `cwd` for correct workspace detection
207
+
208
+ ## [2.8.4] — 2026-06-21
209
+
210
+ ### Added
211
+ - `postinstall` script to auto-run `codewhale-tools-install`
212
+
213
+ ## [2.8.3] — 2026-06-21
214
+
215
+ ### Added
216
+ - `//tools` now displays README in-session as help text
217
+
218
+ ## [2.8.2] — 2026-06-21
219
+
220
+ ### Added
221
+ - README: expanded After Install section with `//history`, `//snapshot`, `//teach-me` details
222
+
223
+ ## [2.8.1] — 2026-06-21
224
+
225
+ ### Added
226
+ - `//teach-me`: targeted concept drills — `teach me decorators`, `teach me async`, `teach me generators`, etc.
227
+
228
+ ## [2.8.0] — 2026-06-21
229
+
230
+ ### Added
231
+ - **`//teach-me` command** — interactive code quiz that selects random snippets from the current project and quizzes on application logic, language semantics, and documentation quality
232
+ - Trigger configuration in instructions.md
233
+ - Skill installation wiring in tools-install.js
234
+
235
+ ## [2.7.0] — 2026-06-20
236
+
237
+ ### Fixed
238
+ - `//snapshot`: removed stale note overwrite step (notes are session-cached)
239
+
240
+ ## [2.6.0]2026-06-20
241
+
242
+ ### Changed
243
+ - `//snapshot on` now overwrites stale caching notes with timestamp convention
244
+
245
+ ## [2.5.0] — 2026-06-20
246
+
247
+ ### Added
248
+ - **`//snapshot` command** — pre-edit file backups with timestamp naming, cross-platform, with retry
249
+
250
+ ## [2.0.0] — 2026-06-19
251
+
252
+ ### Changed
253
+ - Cleaned up installer; code published to npmjs
254
+ - Installs into global npm `node_modules/`
255
+ - Instructions appended to existing `instructions.md` (no longer replaced)
256
+
257
+ ## [1.0.0] — 2026-06-19
258
+
259
+ ### Added
260
+ - Initial release
261
+ - `//tools` — lists all available CodeWhale tools
262
+ - `//history` — lists CodeWhale chat sessions with message count, tokens, and cost
263
+ - Cross-platform installer (`tools-install.js`)
264
+ - Global npm package `codewhale.history`
package/README.md CHANGED
@@ -128,6 +128,7 @@ current project. Two independent dimensions across five difficulty levels:
128
128
  - **SOLID** (`teach me solid`) — Anti-pattern detection and design restoration.
129
129
  - **Spec** (`teach me spec`) — Spec-to-code traceability using office docs as source.
130
130
  - **BA-Gates** (`teach me ba`) — BA documentation quality analysis (ambiguity, AC completeness, edge case coverage).
131
+ - **Logic-Paths** (`teach me logic-paths`) — Execution-path tracing across functions, modules, and systems.
131
132
 
132
133
  | Trigger | Response | Theme | What happens |
133
134
  |---------|----------|-------|-------------|
@@ -139,6 +140,8 @@ current project. Two independent dimensions across five difficulty levels:
139
140
  | `teach me spec interactive` | interactive | spec | Two directions: spec→code (edit code to satisfy a spec) or code→spec (edit spec to match the code) |
140
141
  | `teach me ba` | passive | ba-gates | BA doc fragment; you identify quality gate violations |
141
142
  | `teach me ba interactive` | interactive | ba-gates | BA doc with issues; you edit to fix them |
143
+ | `teach me logic-paths` | passive | logic-paths | Start/end points; you trace the execution path |
144
+ | `teach me logic-paths interactive` | interactive | logic-paths | Path broken by a bug; you fix the code |
142
145
 
143
146
  **Triggers:** `teach me` · `quiz me` · `test my knowledge` · `code quiz` ·
144
147
  `drill me`
@@ -153,6 +156,7 @@ current project. Two independent dimensions across five difficulty levels:
153
156
  | Theme | `teach me solid` | Anti-pattern detection — fix degraded design |
154
157
  | Theme | `teach me spec` | Spec↔code traceability — either direction (show spec, find the code; or show code, name the requirement) |
155
158
  | Theme | `teach me ba` | BA documentation quality analysis |
159
+ | Theme | `teach me logic-paths` | Execution-path tracing across modules and systems |
156
160
  | Scope | `teach me services/` | Narrow to a specific file or folder |
157
161
  | Concept | `teach me decorators` | Target: decorators, async, generators, context managers, comprehensions, error handling, type hints, threading |
158
162
 
@@ -168,7 +172,7 @@ current project. Two independent dimensions across five difficulty levels:
168
172
 
169
173
  **Mid-round commands:** `hint` (get a nudge) · `skip` (see the answer) ·
170
174
  `next` (draw a new snippet) · `level N` · `easier` · `harder` ·
171
- `interactive` · `passive` · `solid` · `spec` · `ba` · `done` (verify work) · `stop`
175
+ `interactive` · `passive` · `solid` · `spec` · `ba` · `logic-paths` · `done` (verify work) · `stop`
172
176
 
173
177
  **At the end** you get a session summary: rounds completed, mode, files covered,
174
178
  what you're strong on, what to review, and a suggested next level.
@@ -196,6 +200,67 @@ options. You identify which gates a fragment triggers and describe the developer
196
200
  impact. On skip or strike-3, the model presents 2–3 domain-specific rewrites per
197
201
  issue with a best-fit recommendation.
198
202
 
203
+ ## New Features
204
+
205
+ ### Logic-Paths Theme (`teach me logic-paths`)
206
+
207
+ Execution-path tracing — how control flows through the code from a start point
208
+ to an end point. Levels 1–2 focus on single-function control flow; levels 3–5
209
+ trace cross-function / cross-object call chains.
210
+
211
+ | Level | Scope | What's quizzed |
212
+ |-------|-------|----------------|
213
+ | 1 | Single function, 5–15 lines, 2–3 branches | Simple if/else, early returns: which branch fires for given inputs? |
214
+ | 2 | Single function, 8–20 lines, nested conditions | Nested if/else, loops, try/except chains: trace the path, identify conditions for reaching specific lines |
215
+ | 3 | 2–4 functions within the same module | Direct call chain: given a start and one end point, trace the sequence |
216
+ | 4 | Cross-module, callbacks/registrations | Callbacks, state machines: sometimes given a start, asked to trace to its natural conclusion |
217
+ | 5 | Multi-file, cross-system dispatch | Threads, pub/sub, event loops, async dispatch across subsystems |
218
+
219
+ **Start-point types** (randomly selected from your project):
220
+
221
+ | Type | Example |
222
+ |------|---------|
223
+ | `test` | A test function that exercises the target code |
224
+ | `entry` | Main entry point (`main()`, CLI command) |
225
+ | `thread` | Code launched in a thread or executor |
226
+ | `event` | Event handler / signal callback |
227
+ | `pubsub` | A subscriber or message-queue consumer |
228
+ | `random` | Arbitrary function — "how does execution ever reach this point?" |
229
+
230
+ **Exercise shapes:** path trace with concrete inputs, condition finder ("what
231
+ must be true to reach line N?"), dead branch detection, start→end call chain,
232
+ and start→natural conclusion (levels 4–5, no end point given).
233
+
234
+ **Interactive mode:** The model introduces a path-breaking bug (wrong branch
235
+ order, removed call, broken registration, swapped comparison). The code still
236
+ compiles but the path is broken — you find and fix it.
237
+
238
+ **Triggers:** `teach me logic-paths` · `teach me paths` · `teach me flow`
239
+
240
+ ### Persistent Score Tracking
241
+
242
+ Scores can now be saved across sessions. At the start of each teach-me session,
243
+ you're asked whether to track your scores. If you say yes, you're prompted for
244
+ a name — scores are stored per-user in `<workspace>/scores-teach-me/<name>.json`.
245
+
246
+ Returning users get a welcome-back summary showing total rounds, sessions,
247
+ strengths, weaknesses, last level played, and a suggested next level.
248
+
249
+ | Scenario | What happens |
250
+ |---|---|
251
+ | User specifies level (`teach me logic-paths level 4`) | Use level 4 |
252
+ | User doesn't specify, first session | Default level 3 (as today) |
253
+ | User doesn't specify, returning user | Use `last_level` from their score file |
254
+ | Suggested next level | Displayed in welcome-back, but user must explicitly change it (`level 4`) |
255
+ | First-ever session, user says yes to tracking | Create fresh file for that name |
256
+ | First-ever session, user says no to tracking | No file, current behaviour |
257
+ | Returning user, says yes this time | Load existing file, show welcome-back summary, append new session at end |
258
+ | Returning user, says no this time | No update written, current behaviour |
259
+ | Name changes mid-session | Not supported — asked only at session start |
260
+ | `scores-teach-me/` doesn't exist | Create directory |
261
+ | File is corrupted JSON | Warn, start fresh for that name |
262
+ | Multiple names (Alice / Bob) | Separate files, separate stats |
263
+
199
264
  ## Want to take this further
200
265
  If you've enjoyed using //teach-me and want to audit your entire specification repository and get a formatted report with readiness scores, band distributions, and ranked improvement recommendations, check out our licensed product //spec-analysis. Contact the developer for more info.
201
266
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codewhale.history",
3
- "version": "2.11.19",
3
+ "version": "2.13.0",
4
4
  "license":"AGPL-3.0",
5
5
  "description": "CodeWhale utility commands: session history, tool listing, file snapshot, interactive code quiz — global install",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: teach-me
3
- description: Interactive code-teaching quiz. Selects random snippets from the current project and quizzes the user on application logic, language semantics, or BA documentation quality. Triggered by 'teach me', 'quiz me', 'test my knowledge', 'code quiz', or 'drill me'. Supports difficulty levels 1–5 and four themes: passive (explain), interactive (reconstruct), solid (anti-pattern detection), spec (spec-to-code traceability), and ba-gates (BA documentation quality analysis).
3
+ description: Interactive code-teaching quiz. Selects random snippets from the current project and quizzes the user on application logic, language semantics, or BA documentation quality. Triggered by 'teach me', 'quiz me', 'test my knowledge', 'code quiz', or 'drill me'. Supports difficulty levels 1–5 and six themes: passive (explain), interactive (reconstruct), solid (anti-pattern detection), spec (spec-to-code traceability), ba-gates (BA documentation quality analysis), and logic-paths (execution-flow tracing).
4
4
  ---
5
5
 
6
6
  Copyright (C) 2026 Celestial Consulting Ltd
@@ -34,10 +34,14 @@ current project. Two independent dimensions combine to form each exercise:
34
34
  spec → code (show a requirement, ask what code implements it) or code → spec
35
35
  (show code, ask what requirement it satisfies).
36
36
  - **`ba`** / **`ba-gates`** / **`requirements`** — BA documentation quality analysis.
37
- Scans requirements documents (.docx, .pptx, .xlsx, .md, .feature, .txt) and
38
- quizzes on three quality gates: ambiguity, acceptance criteria completeness,
39
- and edge case coverage. Uses two-pass analysis: regex triage then LLM
40
- interpretation per fragment. On skip, presents concrete improvement options.
37
+ Scans requirements documents (.docx, .pptx, .xlsx, .md, .feature, .txt) and
38
+ quizzes on three quality gates: ambiguity, acceptance criteria completeness,
39
+ and edge case coverage. Uses two-pass analysis: regex triage then LLM
40
+ interpretation per fragment. On skip, presents concrete improvement options.
41
+ - **`logic-paths`** / **`paths`** / **`flow`** — Execution-path tracing. Levels 1–2:
42
+ single-function control flow (branch tracing, dead-code detection). Levels 3–5:
43
+ cross-function / cross-object call chains from a start point (test, entry,
44
+ thread, event, pubsub, or random) to an end point.
41
45
 
42
46
  | Trigger | Response | Theme | What happens |
43
47
  |---------|----------|-------|-------------|
@@ -49,6 +53,8 @@ current project. Two independent dimensions combine to form each exercise:
49
53
  | `teach me spec interactive` | interactive | spec | Spec-to-code traceability; you edit code to satisfy a spec, say `done` |
50
54
  | `teach me ba` | passive | ba-gates | Present BA doc fragment; you identify quality gate violations |
51
55
  | `teach me ba interactive` | interactive | ba-gates | BA doc with quality issues; you edit the doc to fix them, say `done` |
56
+ | `teach me logic-paths` | passive | logic-paths | Present start/end points; you trace the execution path between them |
57
+ | `teach me logic-paths interactive` | interactive | logic-paths | Path broken by a bug; you fix the code to restore correct flow, say `done` |
52
58
 
53
59
  Level, scope, language, and concept modifiers combine freely with any
54
60
  combination above.
@@ -78,6 +84,7 @@ Optionally followed by modifiers:
78
84
  - `teach me spec` — spec-to-code traceability theme
79
85
  - `teach me ba` / `teach me ba-gates` / `teach me requirements` — BA documentation quality analysis theme
80
86
  - `quiz me on requirements` / `ba quality check` — alternative ba-gates triggers
87
+ - `teach me logic-paths` / `teach me paths` / `teach me flow` — execution-path tracing theme
81
88
 
82
89
  Modifiers combine freely: `teach me decorators level 4`,
83
90
  `teach me async services/`, `teach me generators l2`,
@@ -87,10 +94,13 @@ Modifiers combine freely: `teach me decorators level 4`,
87
94
  `teach me spec`, `teach me spec interactive`,
88
95
  `teach me ba`, `teach me ba level 3`,
89
96
  `teach me ba interactive`, `teach me ba <file>`,
90
- `teach me requirements level 4`
97
+ `teach me requirements level 4`,
98
+ `teach me logic-paths`, `teach me logic-paths level 4`,
99
+ `teach me logic-paths interactive`
91
100
 
92
- If no level is specified, default to **level 3** and adjust based on
93
- performance across rounds.
101
+ If no level is specified, default to **level 3** for new users and adjust based
102
+ on performance across rounds. For returning users with score tracking enabled,
103
+ default to their `last_level` from the score file (see section 1b).
94
104
 
95
105
  ## Session Lifecycle
96
106
 
@@ -109,6 +119,135 @@ E. Report: "Found ~N candidates across M files. Starting at level X. Ready."
109
119
  If the user specified a scope, apply it during discovery. If the user
110
120
  specified a language, filter by extension.
111
121
 
122
+ ### 1b. Identity & Score Tracking
123
+
124
+ After discovery, before presenting the first round, ask about persistent score
125
+ tracking. Score files are stored per-user in `<workspace>/scores-teach-me/<name>.json`.
126
+ The filename IS the identity — no name field inside the JSON.
127
+
128
+ **Prompt flow:**
129
+
130
+ 1. **Ask:** "Track your scores across sessions? (yes / no)"
131
+ 2. **If no:** Proceed to the first round. No file created, no scores saved at session end.
132
+ 3. **If yes:** "What name should I use?"
133
+ 4. **Load or create** `scores-teach-me/<name>.json`:
134
+ - If `scores-teach-me/` doesn't exist: create it (`exec_shell mkdir`).
135
+ - If the file doesn't exist: create a fresh score file (see format below).
136
+ - If the file exists: load it, show the welcome-back summary (see below), then proceed.
137
+ - If the file exists but is corrupted JSON: warn the user, start fresh for that name.
138
+ 5. **Track throughout the session:** In memory, record each round's outcome
139
+ (complete / partial / missed), the files covered, and any strengths/weaknesses
140
+ observed. At session end, append a session record and write the updated file.
141
+
142
+ **Level selection with scores enabled:**
143
+
144
+ | Scenario | What happens |
145
+ |---|---|
146
+ | User specifies level (`teach me logic-paths level 4`) | Use level 4 |
147
+ | User doesn't specify, first session | Default level 3 (as today) |
148
+ | User doesn't specify, returning user | Use `last_level` from their score file |
149
+ | Suggested next level | Displayed in welcome-back, but user must explicitly change it (`level 4`) |
150
+
151
+ **Session tracking scenarios:**
152
+
153
+ | Scenario | What happens |
154
+ |---|---|
155
+ | First-ever session, user says yes to tracking | Create fresh file for that name |
156
+ | First-ever session, user says no to tracking | No file, current behaviour |
157
+ | Returning user, says yes this time | Load existing file, show welcome-back summary, append new session at end |
158
+ | Returning user, says no this time | No update written, current behaviour |
159
+ | Name changes mid-session | Not supported — asked only at session start |
160
+ | `scores-teach-me/` doesn't exist | Create directory |
161
+ | File is corrupted JSON | Warn, start fresh for that name |
162
+ | Multiple names (Alice / Bob) | Separate files, separate stats |
163
+
164
+ **Welcome-back message (returning user):**
165
+
166
+ When a score file is loaded, present the welcome-back summary after the
167
+ discovery report, before the first round:
168
+
169
+ ```
170
+ Welcome back, <name>! 45 rounds across 8 sessions.
171
+ Last: level 3 logic-paths (passive) — 3/5 complete. Suggested next: level 4.
172
+ Strong on: branch tracing, anti-pattern detection.
173
+ Review: async dispatch, edge case coverage.
174
+
175
+ Found ~150 candidates across 12 files. Starting at level 3. Ready.
176
+ ```
177
+
178
+ If the returning user specified a different theme or level in this session's
179
+ trigger, adjust the starting level accordingly but still show the historical
180
+ welcome-back context.
181
+
182
+ **First-session message (new user with tracking):**
183
+
184
+ ```
185
+ Got it, <name>. I'll track your scores in scores-teach-me/<name>.json.
186
+ Found ~150 candidates across 12 files. Starting at level 3. Ready.
187
+ ```
188
+
189
+ **Score file format (`scores-teach-me/<name>.json`):**
190
+
191
+ ```json
192
+ {
193
+ "stats": {
194
+ "total_rounds": 45,
195
+ "total_sessions": 8,
196
+ "last_level": 3,
197
+ "suggested_next_level": 4,
198
+ "themes": {
199
+ "standard": { "rounds": 20, "sessions": 4 },
200
+ "solid": { "rounds": 10, "sessions": 2 },
201
+ "logic-paths": { "rounds": 10, "sessions": 1 },
202
+ "ba-gates": { "rounds": 5, "sessions": 1 }
203
+ },
204
+ "modes": {
205
+ "passive": { "rounds": 35, "sessions": 6 },
206
+ "interactive": { "rounds": 10, "sessions": 2 }
207
+ },
208
+ "strengths": ["branch tracing", "anti-pattern detection"],
209
+ "weaknesses": ["async dispatch", "edge case coverage"],
210
+ "last_session": "2026-07-18"
211
+ },
212
+ "sessions": [
213
+ {
214
+ "date": "2026-07-18",
215
+ "theme": "logic-paths",
216
+ "mode": "passive",
217
+ "level": 3,
218
+ "rounds": 5,
219
+ "complete": 3,
220
+ "partial": 1,
221
+ "missed": 1,
222
+ "suggested_next_level": 4,
223
+ "files_covered": ["services/order_handler.py", "services/inventory.py"],
224
+ "start_point_types": ["pubsub", "test"],
225
+ "strengths": ["direct call chain tracing"],
226
+ "weaknesses": ["conditional branch awareness"]
227
+ }
228
+ ]
229
+ }
230
+ ```
231
+
232
+ **Initial (fresh) score file:**
233
+
234
+ ```json
235
+ {
236
+ "stats": {
237
+ "total_rounds": 0,
238
+ "total_sessions": 0,
239
+ "last_level": 3,
240
+ "suggested_next_level": 3,
241
+ "themes": {},
242
+ "modes": {},
243
+ "strengths": [],
244
+ "weaknesses": [],
245
+ "last_session": null
246
+ },
247
+ "sessions": []
248
+ }
249
+ ```
250
+
112
251
  ### 2. Selection — Pick a Snippet
113
252
 
114
253
  Randomly select a file from the index, then randomly select a function,
@@ -782,13 +921,287 @@ The improvement options MUST be concrete and domain-specific. Prefer specific da
782
921
 
783
922
  ---
784
923
 
924
+ ### 2f. Logic-Paths Theme — Execution-Path Tracing
925
+
926
+ When content theme is `logic-paths` (triggered by `teach me logic-paths`, `teach me paths`,
927
+ or `teach me flow`), the model quizzes the user on execution paths — how control
928
+ flows through the code from a start point to an end point. Levels 1–2 focus on
929
+ single-function control flow; levels 3–5 trace cross-function / cross-object call
930
+ chains.
931
+
932
+ Logic-paths theme supports both response modes:
933
+ - **passive + logic-paths** (`teach me logic-paths`): User describes the path in console.
934
+ - **interactive + logic-paths** (`teach me logic-paths interactive`): The model introduces
935
+ a bug that breaks the path; user fixes the code and says `done`.
936
+
937
+ #### Level Split
938
+
939
+ | Level | Scope | What's quizzed |
940
+ |-------|-------|----------------|
941
+ | 1 | Single function, 5–15 lines, 2–3 branches | Simple if/else, early returns: which branch fires for given inputs? What's the return value? |
942
+ | 2 | Single function, 8–20 lines, nested conditions | Nested if/else, loops with break/continue, try/except chains: trace the path, identify conditions for reaching specific lines |
943
+ | 3 | 2–4 functions within the same module | Direct call chain: given a start point and one end point, trace the sequence — which functions fire and in what order? |
944
+ | 4 | Cross-module, callbacks/registrations | Callbacks, state machines, registration patterns: sometimes given a start and asked "trace to its natural conclusion" (no end point provided) |
945
+ | 5 | Multi-file, cross-system dispatch | Threads, pub/sub, event loops, async dispatch: given a start trigger in one subsystem, trace to the observable outcome in another |
946
+
947
+ #### Exercise Shapes (Random Per Round)
948
+
949
+ **Levels 1–2:**
950
+ - **Path trace:** "Given these concrete inputs, which branches fire? What path does execution take? What is the final return value?"
951
+ - **Condition finder:** "What condition must be true for execution to reach line N?"
952
+ - **Dead branch:** "Is any code in this function unreachable? Which lines, and why?"
953
+
954
+ **Levels 3–5:**
955
+ - **Start → End:** Both start and end points given. Trace the exact call chain from A to B.
956
+ - **Start → Natural Conclusion:** Only a start point given. Trace to the natural end — the observable outcome (return, state change, side effect, DB write, log).
957
+ - **Start → End with Conditional Branches:** Trace the path, noting every conditional fork that could divert execution and what determines which branch is taken.
958
+
959
+ **Levels 4–5:** One or two end points. When the model provides only a start point, the
960
+ question becomes "trace this to its natural conclusion" — the user must identify the
961
+ end point themselves.
962
+
963
+ #### Start-Point Types
964
+
965
+ The model randomly selects a start-point type from those available in the project:
966
+
967
+ | Start type | How the model finds it | Example |
968
+ |---|---|---|
969
+ | `test` | A test function that exercises the target code | `test_calculate_shares_zero_risk()` |
970
+ | `entry` | Main entry point (`if __name__ == "__main__"`, `main()`, CLI command) | `main()` in `cli.py` |
971
+ | `thread` | Code launched in a thread or executor | `Thread(target=watchdog)` |
972
+ | `event` | Event handler / signal callback / listener registration | `button.clicked.connect(handler)` |
973
+ | `pubsub` | A subscriber or message-queue consumer | `@subscribe("order.created")` |
974
+ | `random` | Arbitrary function — "how does execution ever reach this point?" | Any function in the codebase |
975
+
976
+ #### Discovery (Logic-Paths) — Call-Graph Sketch
977
+
978
+ Logic-paths discovery is **slower than other themes** because the model must
979
+ understand how code connects — not just index it. The discovery message MUST
980
+ warn the user:
981
+
982
+ ```
983
+ Mapping execution paths across the project. This takes longer than
984
+ standard discovery because I'm tracing call chains, event wiring,
985
+ and cross-module connections. Please wait…
986
+
987
+ Scanned N files → M functions. Building call-graph sketch…
988
+ Found X start-point candidates across Y types. Ready.
989
+ ```
990
+
991
+ **Discovery steps:**
992
+
993
+ 1. Run standard discovery (file → function index) as in section 1.
994
+ 2. **Scan for start-point candidates.** Use `grep_files` for:
995
+ - Test functions: `def test_`, `it(`, `test(`, `describe(`
996
+ - Entry points: `if __name__`, `main()`, CLI registrations
997
+ - Thread spawns: `Thread(`, `threading.Thread`, `executor.submit`
998
+ - Event/signal wiring: `.connect(`, `.on(`, `.addEventListener`, `signal`
999
+ - Pub/sub subscriptions: `@subscribe`, `@topic`, `@queue`, `@consumer`
1000
+ - Random: any non-trivial function at the user's level
1001
+ 3. **Walk each candidate.** For each start-point candidate, read enough of the
1002
+ call chain to identify a meaningful end point — something the start
1003
+ eventually reaches that produces an observable result (return value, state
1004
+ change, side effect, log, DB write).
1005
+ 4. **Verify the path.** The model MUST walk the entire path itself before
1006
+ presenting it to the user — the path must be real, traceable, and
1007
+ appropriate for the current level.
1008
+ 5. **Build candidate pool:** `(start_type, start_location, end_location, path_length, level)`.
1009
+ Discard candidates where the model cannot confidently trace the path.
1010
+
1011
+ #### Snippet Selection (Logic-Paths)
1012
+
1013
+ - **Levels 1–2:** Select functions with branching (if/elif/else, switch/match),
1014
+ early returns, guard clauses, exception handlers, or loops with break/continue.
1015
+ Avoid straight-line single-return functions.
1016
+ - **Levels 3–5:** Select from the call-graph candidate pool. Prefer paths that
1017
+ cross at least one meaningful boundary (function call, object handoff, module
1018
+ boundary). For levels 4–5, prefer paths involving callbacks, event dispatch,
1019
+ or async mechanisms.
1020
+
1021
+ #### Per-Round Flow (Logic-Paths)
1022
+
1023
+ 0. **Snapshot git state.** Run `git status --porcelain` on the files the path
1024
+ touches. Note any pre-existing changes.
1025
+ 1. **Select** a candidate from the pool matching the current level and mode.
1026
+ 2. **Walk and verify** the path. Re-read the involved files to ensure the
1027
+ path is still accurate.
1028
+ 3. **Present** the start and end points with enough context for the user
1029
+ to reason about the path.
1030
+ 4. **Wait** for the user's response.
1031
+ 5. **Evaluate** the user's trace against the model's verified path.
1032
+ 6. **Feedback** with targeted nudges (see Logic-Paths Evaluation).
1033
+ 7. **Restore** (interactive only). `git checkout -- <file>` for byte-perfect
1034
+ reset. If pre-existing uncommitted changes, restore manually via `edit_file`.
1035
+
1036
+ #### Thinking Suppression (Logic-Paths)
1037
+
1038
+ During steps 1–3 (selection, verification, and presentation), use **Skip**
1039
+ thinking — the reasoning block would reveal the correct path and spoil the
1040
+ exercise. Resume normal thinking at step 4 (after presentation).
1041
+
1042
+ #### Logic-Paths Presentation Format
1043
+
1044
+ **Levels 1–2 (passive):**
1045
+
1046
+ ```
1047
+ ---
1048
+ ## Round N — Level X · passive · logic-paths | `path/to/file.py` (lines A–B)
1049
+
1050
+ ```python
1051
+ 42 risk_amount = capital * (risk_per_trade / 100)
1052
+ 43 price_risk = abs(entry_price - stop_loss)
1053
+ 44 if price_risk == 0:
1054
+ 45 return 0
1055
+ 46 if risk_amount <= 0:
1056
+ 47 return 0
1057
+ 48 shares = int(risk_amount / price_risk)
1058
+ 49 return max(shares, 0)
1059
+ ```
1060
+
1061
+ **Your turn:** (Passive) Trace the execution path for these inputs:
1062
+ `capital=0, risk_per_trade=2, entry_price=100, stop_loss=100`.
1063
+ Which line does execution reach first? What is the return value? What
1064
+ condition caused the early exit?
1065
+
1066
+ Type `hint` for a clue, `skip` to see the answer, or `stop` to end.
1067
+ ---
1068
+ ```
1069
+
1070
+ **Levels 3–5 (passive — start → end):**
1071
+
1072
+ ```
1073
+ ---
1074
+ ## Round N — Level 4 · passive · logic-paths | pubsub → side effect
1075
+
1076
+ **Start:** `services/order_handler.py` — `@subscribe("order.created")`
1077
+ triggers `handle_new_order()`
1078
+
1079
+ **End:** `services/inventory.py::reserve_stock()` reduces `available_quantity`
1080
+ by the ordered amount
1081
+
1082
+ **Your turn:** (Passive) Trace the path from the pub/sub event arrival to the
1083
+ inventory update. Which functions fire, in what order? What objects mediate
1084
+ the handoff? Are there any conditional branches along the way that could
1085
+ divert execution?
1086
+
1087
+ Type `hint` for a clue, `skip` to see the answer, or `stop` to end.
1088
+ ---
1089
+ ```
1090
+
1091
+ **Levels 4–5 (passive — start only, trace to natural conclusion):**
1092
+
1093
+ ```
1094
+ ---
1095
+ ## Round N — Level 5 · passive · logic-paths | thread → outcome
1096
+
1097
+ **Start:** `services/watchdog.py` — `Thread(target=health_check_loop)` is
1098
+ spawned during application startup
1099
+
1100
+ **End:** Trace this to its natural conclusion. What is the observable outcome
1101
+ of this thread's execution? Which functions, modules, and system boundaries
1102
+ does it cross?
1103
+
1104
+ Type `hint` for a clue, `skip` to see the answer, or `stop` to end.
1105
+ ---
1106
+ ```
1107
+
1108
+ **Interactive mode (logic-paths):**
1109
+
1110
+ The model introduces a **path-breaking bug** — a change that breaks the execution
1111
+ flow without making the code obviously wrong. Examples:
1112
+ - Swap the order of two conditional branches (wrong branch fires first)
1113
+ - Remove a critical function call from the chain
1114
+ - Change a registration key so the handler is never wired
1115
+ - Introduce a wrong comparison operator that diverts the path
1116
+ - Remove a `yield` or `await` that a downstream call depends on
1117
+
1118
+ The bug MUST be subtle enough to require the user to trace the path, not just
1119
+ spot a syntax error. The code must still parse/compile.
1120
+
1121
+ **Interactive presentation format:**
1122
+
1123
+ ```
1124
+ ---
1125
+ ## Round N — Level 4 · interactive · logic-paths | `services/order_handler.py`
1126
+
1127
+ **Start:** `services/order_handler.py` — `@subscribe("order.created")`
1128
+ triggers `handle_new_order()`
1129
+
1130
+ **End:** `services/inventory.py::reserve_stock()` should reduce
1131
+ `available_quantity` by the ordered amount — but it never fires.
1132
+
1133
+ ⚠️ **Interactive — Path Broken.** A bug has been introduced somewhere in the
1134
+ execution chain. The code still compiles but the path from start to end is
1135
+ broken. Find and fix the bug. When you're done, say **`done`** or
1136
+ **`check my work`**.
1137
+
1138
+ Type `hint` for a clue, `skip` to see the answer, or `stop` to end.
1139
+ ---
1140
+ ```
1141
+
1142
+ #### Logic-Paths Evaluation
1143
+
1144
+ Evaluate across dimensions scaled to the current level:
1145
+
1146
+ | Level | What's assessed |
1147
+ |-------|----------------|
1148
+ | 1 | Correct branch identification for given inputs; correct return value; awareness of which condition triggered |
1149
+ | 2 | Correct nested path; identified all relevant branches; awareness of fall-through and break/continue behavior |
1150
+ | 3 | Complete call chain (every function named in order); correct object handoffs; awareness of conditional diversions |
1151
+ | 4 | Complete cross-module chain; identified callbacks/registrations; noted where state is passed between modules; identified the logical end point |
1152
+ | 5 | Complete multi-system chain; identified dispatch mechanism (thread, pubsub, event loop); noted async synchronization points; understood the architectural flow |
1153
+
1154
+ **Outcome levels:**
1155
+
1156
+ | Outcome | Criteria | Feedback approach |
1157
+ |---------|----------|-------------------|
1158
+ | **Complete** | Traced the full path correctly at the current level with awareness of branches and handoffs | Highlight what they caught + 1–2 things to sharpen |
1159
+ | **Partial** | Traced some of the path, or missed significant branches/handoffs | Strike-1 or strike-2 nudge toward the missed part |
1160
+ | **Missed** | Did not identify the primary path or start/end connection | Strike-2 or strike-3 with full path reveal |
1161
+
1162
+ **Interactive mode evaluation** — compare the user's fix against the bug that was introduced:
1163
+ - Did they restore the correct path? (Yes — exact / close)
1164
+ - Does the path now reach the end point? (Yes / no)
1165
+ - Did they fix the right thing, or patch a symptom?
1166
+
1167
+ #### Strikes in Logic-Paths
1168
+
1169
+ **Strike 1** — Category nudge (don't reveal the answer, just steer):
1170
+ ```
1171
+ Good start, but you're missing part of the chain. Look between [function A]
1172
+ and [function C] — what sits in the middle? Also, there's a conditional
1173
+ branch you haven't considered.
1174
+ ```
1175
+
1176
+ **Strike 2** — Near-explicit hint (name a specific function or condition):
1177
+ ```
1178
+ You're close. The path goes through `PaymentGateway.authorize()` before
1179
+ reaching `InventoryService`. And on line 47 of order_handler.py, there's
1180
+ an `if order.total <= 0` guard that short-circuits the path entirely.
1181
+ ```
1182
+
1183
+ **Strike 3** — Reveal the full path and move to the next round:
1184
+ ```
1185
+ Here's the complete execution path:
1186
+
1187
+ handle_new_order()
1188
+ → OrderValidator.validate(order) # returns ValidationResult
1189
+ → PaymentGateway.authorize(order) # if total > 0, else return
1190
+ → InventoryService.reserve(items) # reduces available_quantity
1191
+ → OrderNotifier.send_confirmation() # side effect: email
1192
+ ```
1193
+
1194
+ After strike 3, proceed directly to the next round.
1195
+
1196
+ ---
1197
+
785
1198
  ### 3. Presentation — Show the Snippet
786
1199
 
787
1200
  For each round, present the snippet with its filename:
788
1201
 
789
1202
  ```
790
1203
  ---
791
- ## Round N — Level X · [passive|interactive] · [concept|solid|spec|ba-gates] | `path/to/file.py` (lines A–B)
1204
+ ## Round N — Level X · [passive|interactive] · [concept|solid|spec|logic-paths|ba-gates] | `path/to/file.py` (lines A–B)
792
1205
 
793
1206
  ```python
794
1207
  42 def calculate_position_size(
@@ -818,7 +1231,7 @@ Guidelines:
818
1231
  - Show the function/class signature with its decorators
819
1232
  - Show the filename and line range in the header
820
1233
  - The response mode tag (`· passive` or `· interactive`) always appears in the header
821
- - The theme/concept tag (`· solid` for SOLID theme, `· spec` for spec theme, `· ba-gates` for BA-Gates theme, or `· decorators` etc. for targeted concept) appears when applicable; omit during free-play standard rounds
1234
+ - The theme/concept tag (`· solid` for SOLID theme, `· spec` for spec theme, `· ba-gates` for BA-Gates theme, `· logic-paths` for logic-paths theme, or `· decorators` etc. for targeted concept) appears when applicable; omit during free-play standard rounds
822
1235
  - If the snippet depends on one obvious external type or constant, include a
823
1236
  brief inline note
824
1237
  - **Before presenting, scan for secrets.** Redact API keys, tokens, passwords,
@@ -952,6 +1365,19 @@ documentation quality issues against the Pass 2 generated expected answer:
952
1365
 
953
1366
  See section 2e (BA-Gates Theme) for the full strike system and improvement options format.
954
1367
 
1368
+ #### F. Logic-Paths Mode Evaluation
1369
+
1370
+ When theme is `logic-paths`, evaluate the user's ability to trace execution paths
1371
+ against the level-appropriate criteria in section 2f (Logic-Paths Theme).
1372
+
1373
+ | Outcome | Criteria | Feedback approach |
1374
+ |---------|----------|-------------------|
1375
+ | **Complete** | Traced the full path correctly with awareness of branches and handoffs | Highlight what they caught + 1–2 things to sharpen |
1376
+ | **Partial** | Traced some of the path, or missed significant branches/handoffs | Strike-1 or strike-2 nudge toward the missed part |
1377
+ | **Missed** | Did not identify the primary path or start/end connection | Strike-2 or strike-3 with full path reveal |
1378
+
1379
+ See section 2f (Logic-Paths Theme) for the full strike system and presentation format.
1380
+
955
1381
  #### Weighted Evaluation for Targeted Concepts
956
1382
 
957
1383
  When a concept is targeted (e.g., `teach me decorators`), bias the
@@ -1046,13 +1472,14 @@ explicitly says `stop`.**
1046
1472
  | `solid` / `SOLID` | Switch to SOLID (anti-pattern reconstruction) theme for subsequent rounds. |
1047
1473
  | `spec` | Switch to spec (spec-to-code traceability) theme for subsequent rounds. |
1048
1474
  | `ba` / `ba-gates` / `requirements` | Switch to BA-Gates (BA documentation quality) theme for subsequent rounds. |
1049
- | `done` / `check my work` | (Interactive/SOLID/Spec/BA-Gates mode) Signal that work is complete. Triggers verification. |
1475
+ | `logic-paths` / `paths` / `flow` | Switch to logic-paths (execution-path tracing) theme for subsequent rounds. |
1476
+ | `done` / `check my work` | (Interactive/SOLID/Spec/BA-Gates/Logic-Paths mode) Signal that work is complete. Triggers verification. |
1050
1477
  | `stop` / `end` | End session. Deliver summary. |
1051
1478
 
1052
1479
  ### 5. Loop — Keep Going
1053
1480
 
1054
1481
  After a successful evaluation or a `next` skip, ask:
1055
- "Another round? (yes / no / level N / interactive / passive / solid / spec / ba / stop)"
1482
+ "Another round? (yes / no / level N / interactive / passive / solid / spec / ba / logic-paths / stop)"
1056
1483
 
1057
1484
  After a strike-3 reveal, do **not** ask — proceed directly to the next
1058
1485
  round with:
@@ -1094,6 +1521,63 @@ Gates to strengthen: Edge case coverage (rounds 2, 3)
1094
1521
  Suggested next level: 3 → 4
1095
1522
  ```
1096
1523
 
1524
+ For Logic-Paths sessions, the summary covers paths and start-point types instead of gates:
1525
+ ```
1526
+ ## Session Summary
1527
+
1528
+ Rounds completed: 4
1529
+ Theme: logic-paths · Mode: passive · Level: 3
1530
+ Paths traced:
1531
+ - test_calculate_shares → PositionSizer.calculate() (round 1 — test start)
1532
+ - main() in cli.py → Database.record_sale() (round 2 — entry start)
1533
+ - @subscribe("order.created") → inventory reserve (round 3 — pubsub start)
1534
+ - Thread(health_check) → SystemMonitor.alert() (round 4 — thread → natural conclusion)
1535
+
1536
+ Start-point types covered: test, entry, pubsub, thread
1537
+ Paths mastered: Round 1, 3 ✓
1538
+ Paths to strengthen: Round 2 (missed validation step), Round 4 (missed timeout branch)
1539
+ Suggested next level: 3 → 4
1540
+ ```
1541
+
1542
+ ### Save Score File
1543
+
1544
+ When the user said yes to tracking at session start, after delivering the
1545
+ end-of-session summary:
1546
+
1547
+ 1. **Build a session record** from the in-memory round outcomes:
1548
+ - `date`: today's date (YYYY-MM-DD)
1549
+ - `theme`: the theme played (standard, solid, spec, ba-gates, logic-paths)
1550
+ - `mode`: passive or interactive
1551
+ - `level`: the level played
1552
+ - `rounds`: total rounds completed
1553
+ - `complete`, `partial`, `missed`: outcome counts
1554
+ - `suggested_next_level`: from the summary
1555
+ - `files_covered`: list of files touched
1556
+ - `start_point_types`: (logic-paths only) list of start-point types used
1557
+ - `strengths`: concepts consistently identified
1558
+ - `weaknesses`: concepts missed across rounds
1559
+
1560
+ 2. **Append** the session record to the `sessions` array.
1561
+
1562
+ 3. **Recalculate stats:**
1563
+ - `total_rounds` += session rounds
1564
+ - `total_sessions` += 1
1565
+ - `last_level`: the level played this session
1566
+ - `suggested_next_level`: from the session summary
1567
+ - `themes.<theme>.rounds` += session rounds
1568
+ - `themes.<theme>.sessions` += 1
1569
+ - `modes.<mode>.rounds` += session rounds
1570
+ - `modes.<mode>.sessions` += 1
1571
+ - `strengths`: merge and deduplicate across sessions
1572
+ - `weaknesses`: merge and deduplicate across sessions
1573
+ - `last_session`: today's date
1574
+
1575
+ 4. **Write** the updated file with `write_file` to `scores-teach-me/<name>.json`.
1576
+
1577
+ 5. **Confirm:** "Scores saved for <name>."
1578
+
1579
+ If the user said no to tracking at session start, skip this step entirely.
1580
+
1097
1581
  ## Multilingual Projects
1098
1582
 
1099
1583
  If the project contains multiple languages, let the user's `teach me <lang>`
@@ -1146,6 +1630,16 @@ criteria for the Mechanics axis:
1146
1630
  - **BA-Gates two-pass integrity.** Pass 1 regex results are filters only — do not present them as answers. Pass 2 LLM interpretation MUST run fresh per fragment at round time. If Pass 2 determines all regex flags are false positives, discard the fragment and select another. Do not fabricate issues.
1147
1631
  - **BA-Gates extraction fallback.** If `codewhale-doc-extract` fails for any office file, note it and skip that file — do not attempt alternative extraction methods. Report skipped files in discovery.
1148
1632
  - **BA-Gates thinking discipline.** Pass 2 analysis runs with Deep/High thinking. Once presentation begins, switch to Skip thinking — never include generated answers or gate locations in reasoning_content after the fragment is shown.
1633
+ - **Logic-paths start-point realism.** Only present start/end points that the model has actually verified by walking the path. Do not fabricate or approximate a call chain — if the model cannot confidently trace the path, discard the candidate and select another.
1634
+ - **Logic-paths interactive safety.** The path-breaking bug MUST keep the code compilable/parseable. The model MUST NOT introduce syntax errors, delete function signatures, or write code that would crash on import. The bug must be in the logic, not the grammar.
1635
+ - **Logic-paths verification before presentation.** The model MUST walk the full path using live file reads before presenting it — do not rely on discovery-stage analysis. Code may have changed between discovery and the current round.
1636
+ - **Logic-paths concurrent safety.** If the project uses multi-threading, multi-processing, or async, clearly explain which parts of the path execute sequentially and which may race or interleave. State the model's assumptions about scheduling.
1637
+ - **Logic-paths thinking discipline.** During selection and path verification (before presentation), use Skip thinking — never include the correct path, start/end points, or the bug location in reasoning_content after the round is presented.
1638
+ - **Score tracking opt-in.** Always ask before tracking. Never assume — the user must explicitly say yes and provide a name. If they say no, do not create or write any score file.
1639
+ - **Score file identity.** The filename IS the identity. Do not embed a name field inside the JSON. Name is derived from the filename: `scores-teach-me/<name>.json`.
1640
+ - **Score file location.** Always write to `<workspace>/scores-teach-me/<name>.json`. Never write outside the workspace. Create the `scores-teach-me/` directory if it doesn't exist.
1641
+ - **Score file integrity.** Read the file with `read_file` before appending. If the JSON is corrupted, warn the user and start fresh. Never silently overwrite a valid score file due to a parse error.
1642
+ - **Score file privacy.** The score file contains no PII beyond the user's chosen name. Do not include email addresses, full names, or any other identifying information unless the user explicitly provides it as their name.
1149
1643
 
1150
1644
  ## Verification
1151
1645
 
@@ -1184,3 +1678,30 @@ After each round, confirm:
1184
1678
  - (BA-Gates theme) `//snapshot on/off` was used in interactive mode for non-git workspaces
1185
1679
  - (BA-Gates theme) Extraction fallback was handled gracefully — skipped files were reported
1186
1680
  - (BA-Gates theme) Thinking suppression was maintained — Pass 2 material was not leaked into reasoning after presentation
1681
+ - (Logic-paths theme) Discovery warned the user about longer startup time
1682
+ - (Logic-paths theme) Start-point candidates were scanned across test/entry/thread/event/pubsub/random types
1683
+ - (Logic-paths theme) The model walked and verified the full path using live file reads before presentation
1684
+ - (Logic-paths theme) The start-point type and end-point location were clearly stated in the presentation
1685
+ - (Logic-paths theme) For level 4–5 "natural conclusion" rounds, no end point was revealed before evaluation
1686
+ - (Logic-paths theme) Exercise shape (path trace, condition finder, dead branch, start→end, start→natural conclusion) was varied across rounds
1687
+ - (Logic-paths theme) Interactive mode bugs kept code compilable — no syntax errors introduced
1688
+ - (Logic-paths theme) Interactive mode bugs were in logic, not grammar — path-breaking but not crash-causing
1689
+ - (Logic-paths theme) Call chain was verified before presentation — no fabricated or approximated paths
1690
+ - (Logic-paths theme) The full path was revealed on skip or strike-3 with function names in order
1691
+ - (Logic-paths theme) Modified files were restored with `git checkout` on round end (or `edit_file` if pre-existing changes)
1692
+ - (Logic-paths theme) Thinking suppression was maintained — path, start/end points, and bug locations were not leaked into reasoning after presentation
1693
+ - (Score tracking) User was asked "Track your scores?" before the first round
1694
+ - (Score tracking) If user said yes, they were prompted for a name
1695
+ - (Score tracking) `scores-teach-me/` directory was created if it didn't exist
1696
+ - (Score tracking) Fresh score file was created for new users with correct initial format
1697
+ - (Score tracking) Existing score file was loaded and welcome-back summary shown for returning users
1698
+ - (Score tracking) If user said no, no score file was created or written
1699
+ - (Score tracking) Level defaulted to `last_level` for returning users (unless user overrode)
1700
+ - (Score tracking) Suggested next level was displayed but NOT auto-applied
1701
+ - (Score tracking) Session record was appended to `sessions` array on session end
1702
+ - (Score tracking) Stats were recalculated correctly after appending (totals, themes, modes)
1703
+ - (Score tracking) Strengths and weaknesses were merged and deduplicated across sessions
1704
+ - (Score tracking) Corrupted JSON was detected, user was warned, and a fresh file was created
1705
+ - (Score tracking) Score file was written to `<workspace>/scores-teach-me/<name>.json`
1706
+ - (Score tracking) "Scores saved for <name>" confirmation was shown on session end
1707
+ - (Score tracking) No PII beyond the user's chosen name was stored in the score file