codewhale.history 2.8.9 → 2.8.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codewhale.history",
3
- "version": "2.8.9",
3
+ "version": "2.8.11",
4
4
  "description": "CodeWhale utility commands: session history, tool listing, file snapshot, interactive code quiz — global install",
5
5
  "bin": {
6
6
  "codewhale-history": "./_list_sessions.js",
@@ -154,6 +154,8 @@ explanation. The model removes lines from the file and the user restores them.
154
154
 
155
155
  #### Interactive Mode Per-Round Flow
156
156
 
157
+ 0. **Snapshot git state.** Run `git status --porcelain <file>` before touching
158
+ it. Note whether the file was clean or already had uncommitted changes.
157
159
  1. **Select** a snippet using the standard rules (section 2).
158
160
  2. **Save** the original lines in memory.
159
161
  3. **Remove** 1–3 lines from the actual file on disk using `edit_file`.
@@ -165,17 +167,22 @@ explanation. The model removes lines from the file and the user restores them.
165
167
  completion.
166
168
  7. **Re-read** the file. Diff the user's restored lines against the saved
167
169
  original.
168
- 8. **Feedback** (see Interactive Evaluation below). Offer to restore the
169
- original if the user wants to undo.
170
+ 8. **Feedback** (see Interactive Evaluation below). After feedback, restore
171
+ the file with `git checkout -- <file>` for a byte-perfect reset. If the
172
+ file had pre-existing uncommitted changes (from step 0), restore the
173
+ original lines manually via `edit_file` instead and warn the user.
170
174
 
171
175
  #### Thinking Suppression (Interactive Mode)
172
176
 
173
- During steps 1–4 (selection through presentation), **suppress thinking
174
- entirely**. Do not include the selected snippet, the original lines, or
175
- which lines are being removed in your reasoning. The user can see the
176
- thinking block and it spoils the exercise. Use light thinking only for
177
- mechanical coordination (e.g., "reading file, selecting lines 42-55,
178
- removing 2 lines, presenting") — never the actual code.
177
+ During steps 1–4 (selection through presentation), use **Skip** thinking
178
+ depth — emit no reasoning_content at all. Do not include the selected
179
+ snippet, the original lines, or which lines are being removed. The
180
+ thinking block is visible to the user and spoils the exercise before it
181
+ begins. Resume normal thinking depth at step 5 (after presentation).
182
+
183
+ The `edit_file` diff output is unavoidably visible in the transcript
184
+ (CodeWhale transparency), but thinking control keeps the primary leak
185
+ closed.
179
186
 
180
187
  #### Interactive Mode Presentation Format
181
188
 
@@ -448,11 +455,16 @@ criteria for the Mechanics axis:
448
455
  teaching session unless the user explicitly asks to switch modes.
449
456
  - **Interactive mode file edits.** The model MAY remove lines from files to set
450
457
  up reconstruction exercises. The model MUST NOT add or modify lines — only
451
- the user restores code. After the session ends, offer to restore any
452
- remaining gapped files.
458
+ the user restores code.
459
+ - **Restore after each round.** After feedback in interactive mode, restore
460
+ each touched file with `git checkout -- <file>` for a byte-perfect reset
461
+ that leaves no git diff. If the file had pre-existing uncommitted changes
462
+ (noted in step 0), restore the original lines manually via `edit_file`
463
+ instead and warn the user.
453
464
  - **Restore on session end.** When the session ends, check whether any files
454
- still contain `# ... N lines removed ...` placeholders from interactive mode.
455
- If so, offer to restore the original lines.
465
+ still contain `# ... N lines removed ...` placeholders. If so, restore
466
+ them with `git checkout -- <file>` (or `edit_file` if pre-existing
467
+ changes were present).
456
468
 
457
469
  ## Verification
458
470