codewhale.history 2.8.10 → 2.8.12

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/README.md CHANGED
@@ -116,4 +116,4 @@ what you're strong on, what to review, and a suggested next level.
116
116
 
117
117
  ## Requirements
118
118
  - Node.js (for the `codewhale-history` command)
119
- - CodeWhale
119
+ - [CodeWhale](https://codewhale.net/en/docs)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codewhale.history",
3
- "version": "2.8.10",
3
+ "version": "2.8.12",
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,8 +167,10 @@ 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
 
@@ -451,11 +455,16 @@ criteria for the Mechanics axis:
451
455
  teaching session unless the user explicitly asks to switch modes.
452
456
  - **Interactive mode file edits.** The model MAY remove lines from files to set
453
457
  up reconstruction exercises. The model MUST NOT add or modify lines — only
454
- the user restores code. After the session ends, offer to restore any
455
- 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.
456
464
  - **Restore on session end.** When the session ends, check whether any files
457
- still contain `# ... N lines removed ...` placeholders from interactive mode.
458
- 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).
459
468
 
460
469
  ## Verification
461
470