@theglitchking/persistent-planning 3.6.0 → 3.6.2

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.
@@ -6,13 +6,13 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Official marketplace for persistent-planning - Persistent markdown-based planning for Claude Code. Context engineering pattern with task directories, progress tracking, and working memory that persists across sessions.",
9
- "version": "3.6.0"
9
+ "version": "3.6.2"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "persistent-planning",
14
14
  "description": "Persistent markdown-based planning for Claude Code. Uses on-disk markdown files as working memory for planning, progress tracking, and knowledge storage. Plans persist across sessions and support multiple concurrent tasks.",
15
- "version": "3.6.0",
15
+ "version": "3.6.2",
16
16
  "author": {
17
17
  "name": "TheGlitchKing"
18
18
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "persistent-planning",
3
- "version": "3.6.0",
3
+ "version": "3.6.2",
4
4
  "description": "Persistent markdown-based planning with task directories, progress tracking, and context engineering for multi-step Claude Code workflows",
5
5
  "author": {
6
6
  "name": "TheGlitchKing"
@@ -128,7 +128,7 @@ purpose: Navigation hub for all documentation
128
128
 
129
129
  | Document | Tier | Status | Updated |
130
130
  |----------|------|--------|----------|
131
- | [Plan Completion and Archive](procedures/plan-completion-and-archive.md) | guide | active | 2026-08-31 |
131
+ | [Plan Completion and Archive](procedures/plan-completion-and-archive.md) | guide | active | 2026-10-23 |
132
132
  | [Plugin update delivery — what actually runs, and when](procedures/plugin-update-delivery.md) | guide | active | 2026-09-04 |
133
133
 
134
134
  ---
@@ -13,7 +13,7 @@ purpose: Auto-generated index of all facts in the knowledge base, grouped by tag
13
13
 
14
14
  <!-- Auto-generated by `hewtd maintain`. Do not edit by hand — changes will be overwritten. -->
15
15
 
16
- **Total facts:** 2
16
+ **Total facts:** 3
17
17
 
18
18
  ## babel-fish
19
19
 
@@ -35,18 +35,20 @@ purpose: Auto-generated index of all facts in the knowledge base, grouped by tag
35
35
 
36
36
  ### confidence: high
37
37
 
38
- | ID | Title | Last verified | Citers |
39
- |--------------------------------------|-----------------------------------------------------------------------------------------------|---------------|--------|
40
- | `babel-fish-hook-adds-untracked-map` | babel-fish's pre-commit hook commits an untracked project map into the next qualifying commit | 2026-10-23 | 0 |
38
+ | ID | Title | Last verified | Citers |
39
+ |-----------------------------------------|-----------------------------------------------------------------------------------------------|---------------|--------|
40
+ | `babel-fish-hook-adds-untracked-map` | babel-fish's pre-commit hook commits an untracked project map into the next qualifying commit | 2026-10-23 | 0 |
41
+ | `git-rm-cached-moved-path-drops-staged` | git rm --cached on a path whose files were moved away silently drops staged content | 2026-10-23 | 0 |
41
42
 
42
43
  ## gotcha
43
44
 
44
45
  ### confidence: high
45
46
 
46
- | ID | Title | Last verified | Citers |
47
- |--------------------------------------|-----------------------------------------------------------------------------------------------|---------------|--------|
48
- | `babel-fish-hook-adds-untracked-map` | babel-fish's pre-commit hook commits an untracked project map into the next qualifying commit | 2026-10-23 | 0 |
49
- | `claude-code-grep-v-exit-status` | In Claude Code's Bash tool, grep -v exits 1 when any line matches | 2026-10-23 | 0 |
47
+ | ID | Title | Last verified | Citers |
48
+ |-----------------------------------------|-----------------------------------------------------------------------------------------------|---------------|--------|
49
+ | `babel-fish-hook-adds-untracked-map` | babel-fish's pre-commit hook commits an untracked project map into the next qualifying commit | 2026-10-23 | 0 |
50
+ | `claude-code-grep-v-exit-status` | In Claude Code's Bash tool, grep -v exits 1 when any line matches | 2026-10-23 | 0 |
51
+ | `git-rm-cached-moved-path-drops-staged` | git rm --cached on a path whose files were moved away silently drops staged content | 2026-10-23 | 0 |
50
52
 
51
53
  ## shell
52
54
 
@@ -0,0 +1,56 @@
1
+ ---
2
+ title: git rm --cached on a path whose files were moved away silently drops staged content
3
+ tier: fact
4
+ domains:
5
+ - troubleshooting
6
+ status: active
7
+ last_updated: 2026-10-23
8
+ id: git-rm-cached-moved-path-drops-staged
9
+ confidence: high
10
+ last_verified: 2026-10-23
11
+ verify_command: |
12
+ #!/usr/bin/env bash
13
+ set -euo pipefail
14
+ d=$(mktemp -d); cd "$d"; git init -q; echo a > f; git add f; git -c user.name=t -c user.email=t@t commit -qm a
15
+ echo staged > f; git add f; echo a > f; mkdir moved; mv f moved/
16
+ git rm -q --cached f && echo "rm --cached succeeded: staged blob dropped from index"
17
+ cd /; rm -rf "${d:?}"
18
+ provenance:
19
+ - .planning/archive-plan-untracks-archived-plans-issue-26/
20
+ sources:
21
+ - scripts/archive-plan.sh
22
+ tags:
23
+ - gotcha
24
+ - git
25
+ invalidated_by:
26
+ - git rm --cached starts refusing when the index entry differs from HEAD regardless of the worktree
27
+ ---
28
+
29
+ # git rm --cached on a path whose files were moved away silently drops staged content
30
+
31
+ ## Claim
32
+
33
+ `git rm --cached <path>` refuses ("staged content different from both the file and the HEAD")
34
+ only when it can compare against a **worktree file**. If the files at `<path>` have already been
35
+ moved elsewhere (e.g. `mv .planning/x .planning/.archive/x`), there is nothing to compare, and git
36
+ untracks the path without complaint. Any staged content that differed from the worktree copy is
37
+ then gone from the index. Only a dangling blob is left, which `git fsck` can find.
38
+
39
+ Found while fixing #26: the first fix moved the plan, then relied on `git rm --cached` refusing to
40
+ protect staged changes. It never refused.
41
+
42
+ ## How to verify
43
+
44
+ Run `verify_command`. It stages content that differs from the worktree, moves the file away, and
45
+ `git rm --cached` succeeds.
46
+
47
+ ## Instead
48
+
49
+ Check for staged changes **before** moving: `git diff --cached --quiet -- <path>` (non-zero means
50
+ staged changes). If there are any, don't untrack. Warn and let the user commit or unstage first.
51
+ This is what `scripts/archive-plan.sh` does.
52
+
53
+ ## Consequences
54
+
55
+ Any "move, then untrack the old path" sequence needs its own staged-change check. Git's built-in
56
+ refusal won't protect it.
@@ -3,7 +3,7 @@ title: Procedures Documentation Index
3
3
  tier: reference
4
4
  domains: [procedures]
5
5
  status: active
6
- last_updated: '2026-09-26'
6
+ last_updated: '2026-10-23'
7
7
  version: '1.0.0'
8
8
  purpose: Complete listing of procedures documentation
9
9
  ---
@@ -25,7 +25,7 @@ purpose: Complete listing of procedures documentation
25
25
 
26
26
  | Document | Status | Updated | Words |
27
27
  |----------|--------|---------|-------|
28
- | [Plan Completion and Archive](plan-completion-and-archive.md) | active | 2026-08-31 | 812 |
28
+ | [Plan Completion and Archive](plan-completion-and-archive.md) | active | 2026-10-23 | 812 |
29
29
  | [Plugin update delivery — what actually runs, and when](plugin-update-delivery.md) | active | 2026-09-04 | 539 |
30
30
 
31
31
  ## Keywords
@@ -40,4 +40,4 @@ This domain covers: procedure, procedures, sop, standard-operating-procedure, st
40
40
 
41
41
  ---
42
42
 
43
- *Last updated: 2026-09-26*
43
+ *Last updated: 2026-10-23*
@@ -3,7 +3,7 @@ title: Procedures Registry
3
3
  tier: reference
4
4
  domains: [procedures]
5
5
  status: active
6
- last_updated: '2026-09-26'
6
+ last_updated: '2026-10-23'
7
7
  version: '1.0.0'
8
8
  purpose: Quick reference for procedures documentation
9
9
  ---
@@ -27,8 +27,8 @@ purpose: Quick reference for procedures documentation
27
27
 
28
28
  ## Recently Updated
29
29
 
30
+ - [Plan Completion and Archive](plan-completion-and-archive.md) - 2026-10-23
30
31
  - [Plugin update delivery — what actually runs, and when](plugin-update-delivery.md) - 2026-09-04
31
- - [Plan Completion and Archive](plan-completion-and-archive.md) - 2026-08-31
32
32
 
33
33
  ## By Status
34
34
 
@@ -50,4 +50,4 @@ purpose: Quick reference for procedures documentation
50
50
 
51
51
  ---
52
52
 
53
- *Last updated: 2026-09-26*
53
+ *Last updated: 2026-10-23*
@@ -7,7 +7,7 @@ audience:
7
7
  - developers
8
8
  tags: []
9
9
  status: active
10
- last_updated: '2026-08-31'
10
+ last_updated: '2026-10-23'
11
11
  version: 1.0.0
12
12
  purpose: How persistent-planning decides a plan is finished, how that reaches
13
13
  the agent automatically, and the procedure for retiring a completed plan into
@@ -104,17 +104,22 @@ Archiving performs four steps:
104
104
 
105
105
  1. Verifies completion (skipped under `--force`).
106
106
  2. Ensures `.planning/.archive/` exists and is in `.gitignore`.
107
- 3. Moves `.planning/<slug>/` → `.planning/.archive/<slug>/`, preferring `git mv`
108
- when the plan is tracked so history follows it.
107
+ 3. Moves `.planning/<slug>/` → `.planning/.archive/<slug>/`. If the plan is tracked,
108
+ it is also removed from git's index (`git rm -r --cached`; the files stay on
109
+ disk), so the archive is local history and the next commit shows the plan as
110
+ deleted. Its history stays in git. A plan with **staged** changes stays tracked
111
+ with a warning, because untracking would drop content that only the index holds.
112
+ Commit or unstage, then run `git rm -r --cached .planning/<slug>`.
109
113
  4. Stamps the top-level artifact: `status: archived` + `archived_on` in
110
114
  frontmatter, or a dated footer for sm plans that have none.
111
115
 
112
- **Nothing is ever deleted.** Archiving is a move plus a stamp.
116
+ **Nothing is ever deleted.** Archiving is a move plus a stamp; the git side is an untrack, not a delete.
113
117
 
114
118
  ## Restoring an archived plan
115
119
 
116
120
  ```bash
117
121
  mv .planning/.archive/<slug> .planning/<slug>
122
+ git add .planning/<slug> # it was untracked when archived
118
123
  ```
119
124
 
120
125
  Then set `status:` back to `active` and remove the `archived_on` stamp. The plan
@@ -129,7 +134,8 @@ resumes reading as in-progress the moment a box is unchecked.
129
134
  | `archive-plan.sh` refuses | The plan is genuinely incomplete | Finish it. `--force` exists for deliberate abandonment, not for impatience |
130
135
  | "Already archived: … exists" | A plan with that slug was archived before | Rename or move the existing entry under `.planning/.archive/` first |
131
136
  | Nudge never appears | No `.planning/` directory, or no plan is complete, or the hook is not registered | `npx persistent-planning status` reports hook registration |
132
- | Archived plans show up in `git status` | `.planning/` is tracked in this repo and the ignore line was added after the fact | Ensure `.gitignore` has `.planning/.archive/`; `git rm -r --cached .planning/.archive` if already tracked |
137
+ | Archived plans show up in `git status` / are tracked under `.archive/` | Archived before the fix for #26: `archive-plan.sh` used `git mv` and kept them tracked ([#26](https://github.com/the-glitch-kingdom/persistent-planning/issues/26)); or the ignore line was added after the fact | Ensure `.gitignore` has `.planning/.archive/`, then `git rm -r --cached .planning/.archive` (stage any pending stamp first: `git add -f .planning/.archive/*/phase.md`). Files stay on disk |
138
+ | "Archived on disk, but git still tracks …" warning | The plan had staged changes; untracking would have dropped them | Commit or unstage them, then `git rm -r --cached .planning/<slug>` |
133
139
 
134
140
  ## Design notes
135
141
 
package/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [3.6.2] - 2026-11-09
6
+
7
+ ### Changed
8
+
9
+ - **A plan's branch is cut from `main`.** Step 2 of the git-workflow section read
10
+ "Cut a new branch" and only implied `main` through step 1's sync. It now reads
11
+ "Cut a branch from `main`", with the base in the command
12
+ (`git checkout -b <type>/<plan-slug> main`). The section is appended once, so a
13
+ repo that already has it keeps the old wording until edited.
14
+
15
+ ## [3.6.1] - 2026-10-23
16
+
17
+ ### Fixed — archived plans stayed tracked in git (#26)
18
+
19
+ `archive-plan.sh` moved tracked plans with `git mv`, so they stayed tracked
20
+ inside the gitignored `.planning/.archive/`, because ignore rules never apply to
21
+ tracked files. It now moves the plan and untracks it (`git rm -r --cached`).
22
+ The files stay on disk and the next commit shows the plan as deleted. A plan
23
+ with staged changes stays tracked with a warning rather than losing content
24
+ only the index holds. Repos with plans archived earlier:
25
+ `git rm -r --cached .planning/.archive`.
26
+
5
27
  ## [3.6.0] - 2026-10-23
6
28
 
7
29
  ### Added — a full hit-em-with-the-docs pass as the last step, when the project uses it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theglitchking/persistent-planning",
3
- "version": "3.6.0",
3
+ "version": "3.6.2",
4
4
  "description": "Persistent markdown-based planning with task directories, progress tracking, and context engineering for multi-step Claude Code workflows",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,8 +12,8 @@
12
12
  # 1. Refuses unless the plan is complete (every checkbox checked, or the
13
13
  # top-level artifact declares `status: done`) -- override with --force.
14
14
  # 2. Ensures .planning/.archive/ exists and is gitignored.
15
- # 3. Moves .planning/<slug>/ to .planning/.archive/<slug>/ (git mv when the
16
- # plan is tracked, so history follows it).
15
+ # 3. Moves .planning/<slug>/ to .planning/.archive/<slug>/. A tracked plan is
16
+ # also removed from git's index (files stay on disk): archives are local.
17
17
  # 4. Stamps the plan's top-level artifact with status: archived + archived_on.
18
18
  #
19
19
  # Nothing is ever deleted. Restore by moving the directory back out.
@@ -111,18 +111,32 @@ archive_one() {
111
111
  fi
112
112
 
113
113
  if [[ $DRY_RUN -eq 1 ]]; then
114
- planning_log "[dry-run] would archive .planning/${slug}/ -> .planning/.archive/${slug}/"
114
+ planning_log "[dry-run] would archive .planning/${slug}/ -> .planning/.archive/${slug}/ (untracked from git if tracked)"
115
115
  return 0
116
116
  fi
117
117
 
118
118
  ensure_gitignored
119
119
  mkdir -p "$ARCHIVE"
120
120
 
121
+ local tracked=0 staged=0
121
122
  if git -C "$ROOT" rev-parse --git-dir >/dev/null 2>&1 \
122
123
  && [[ -n "$(git -C "$ROOT" ls-files ".planning/${slug}" 2>/dev/null)" ]]; then
123
- git -C "$ROOT" mv ".planning/${slug}" ".planning/.archive/${slug}"
124
- else
125
- mv "$src" "$dest"
124
+ tracked=1
125
+ git -C "$ROOT" diff --cached --quiet -- ".planning/${slug}" 2>/dev/null || staged=1
126
+ fi
127
+
128
+ mv "$src" "$dest"
129
+
130
+ # A tracked plan leaves the index: archived plans are local history (issue #26).
131
+ # git mv kept them tracked inside the gitignored .archive/, since ignore rules
132
+ # never apply to tracked files. Staged changes are checked first, because once
133
+ # the files have moved git rm --cached no longer refuses and would drop them.
134
+ if [[ $tracked -eq 1 && $staged -eq 1 ]]; then
135
+ planning_warn "Archived on disk, but git still tracks .planning/${slug}/ (it has staged changes)."
136
+ echo " Commit or unstage them, then untrack with: git rm -r --cached .planning/${slug}" >&2
137
+ elif [[ $tracked -eq 1 ]]; then
138
+ git -C "$ROOT" rm -r -q --cached ".planning/${slug}" >/dev/null 2>&1 \
139
+ || planning_warn "Archived on disk, but could not untrack .planning/${slug}/: git rm -r --cached .planning/${slug}"
126
140
  fi
127
141
 
128
142
  stamp_archived "$(plan_root_artifact "$dest")"
@@ -4,7 +4,7 @@
4
4
  These are hard requirements on every plan under `.planning/`:
5
5
 
6
6
  1. **Sync `main` first.** `git checkout main && git fetch origin main && git merge --ff-only origin/main`.
7
- 2. **Cut a new branch** for the plan before changing anything: `git checkout -b <type>/<plan-slug>`.
7
+ 2. **Cut a branch from `main`** for the plan before changing anything: `git checkout -b <type>/<plan-slug> main`.
8
8
  3. **Implement the plan through to completion**: every phase, including the mandatory cleanup,
9
9
  validation and documentation steps, until `/plan-status` reads COMPLETE.
10
10
  4. **Commit at the end of each phase** (sm: each item under `## Phases`; lg: each task).