devlog-tracker 0.33.4 → 0.33.5

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  *English | [繁體中文](README.zh-TW.md)*
4
4
 
5
- **Version** 0.33.4
5
+ **Version** 0.33.5
6
6
 
7
7
  Maintains a `.devlog/devlog.md` in your project, turning each conversation round's requests, decisions, and outcomes into a permanent record. A conversation disappears the moment you `/clear` or switch sessions; this file fills that gap so work can pause and resume. Nothing is touched until you explicitly run `/devlog-tracker:start` — installing the plugin alone doesn't create or modify any files.
8
8
 
package/README.zh-TW.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  *[English](README.md) | 繁體中文*
4
4
 
5
- **版本** 0.33.4
5
+ **版本** 0.33.5
6
6
 
7
7
  在專案中維護一份 `.devlog/devlog.md`,把每一輪對話的請求、決策與結果寫成永久紀錄。對話一 `/clear` 或換 session 就沒了;這份檔案取代那個缺口,讓工作可以中斷再接。沒下過 `/devlog-tracker:start` 時,裝著也不會動任何檔案。
8
8
 
@@ -83,6 +83,38 @@ CLI_UNBORN="$(bash "$SCRIPT_DIR/workspace-snapshot.sh" "$UNBORN")"
83
83
  FUNC_UNBORN="$(workspace_snapshot "$UNBORN")"
84
84
  assert_eq "cli matches function (unborn dirty)" "$FUNC_UNBORN" "$CLI_UNBORN"
85
85
 
86
+ # --- .devlog/ changes are ignored (same rule as files-snapshot.sh) ----------
87
+ # The devlog is rewritten every round, so counting it would make every
88
+ # snapshot dirty and every Handoff 工作區 drift on its own write.
89
+ DL="$TMP_ROOT/devlog-ignored"
90
+ mkdir -p "$DL"
91
+ git -C "$DL" init -q -b main
92
+ git -C "$DL" config user.email test@example.com
93
+ git -C "$DL" config user.name test
94
+ echo hello > "$DL/a.txt"
95
+ mkdir -p "$DL/.devlog"
96
+ echo tracked > "$DL/.devlog/devlog.md"
97
+ git -C "$DL" add a.txt .devlog/devlog.md
98
+ git -C "$DL" commit -q -m init
99
+ DL_HASH="$(git -C "$DL" rev-parse --short HEAD)"
100
+ echo more >> "$DL/.devlog/devlog.md"
101
+ echo round > "$DL/.devlog/.round-current.md"
102
+ OUT="$(workspace_snapshot "$DL")"
103
+ assert_eq ".devlog-only changes count as clean" "main @ ${DL_HASH},工作樹乾淨" "$OUT"
104
+
105
+ echo change >> "$DL/a.txt"
106
+ OUT="$(workspace_snapshot "$DL")"
107
+ EXPECTED="main @ ${DL_HASH}
108
+ 未提交:a.txt"
109
+ assert_eq ".devlog changes omitted from 未提交" "$EXPECTED" "$OUT"
110
+
111
+ DL_UNBORN="$TMP_ROOT/devlog-unborn"
112
+ mkdir -p "$DL_UNBORN/.devlog"
113
+ git -C "$DL_UNBORN" init -q -b main
114
+ echo x > "$DL_UNBORN/.devlog/devlog.md"
115
+ OUT="$(workspace_snapshot "$DL_UNBORN")"
116
+ assert_eq "unborn with untracked .devlog/ only is clean" "main @ (尚無 commit),工作樹乾淨" "$OUT"
117
+
86
118
  # --- executable entry matches the sourced function --------------------------
87
119
  CLI_NONGIT="$(bash "$SCRIPT_DIR/workspace-snapshot.sh" "$NONGIT")"
88
120
  assert_eq "cli non-git directory" "非 git 工作區" "$CLI_NONGIT"
@@ -15,6 +15,19 @@
15
15
  # Known limitation: a dirty file path containing a space is not exactly
16
16
  # reversible from `git status --short`'s last-field extraction below — same
17
17
  # limitation the hand-written 工作區 convention already has.
18
+ #
19
+ # Paths under .devlog/ are left out (same rule as files-snapshot.sh): the
20
+ # devlog is rewritten every round, so counting it would make the snapshot
21
+ # dirty by its own write. A tree whose only changes are under .devlog/
22
+ # reports as clean.
23
+
24
+ # `git status --short` minus .devlog/ entries. Lines are "<XY> <path>".
25
+ _ws_status_short() {
26
+ git -C "$1" status --short 2>/dev/null \
27
+ | awk '{ p = substr($0, 4) } p == ".devlog" || p ~ /^\.devlog\// { next } { print }' \
28
+ || true
29
+ }
30
+
18
31
  workspace_snapshot() {
19
32
  local dir="${1:-.}"
20
33
  if ! git -C "$dir" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
@@ -37,7 +50,7 @@ workspace_snapshot() {
37
50
  printf '非 git 工作區\n'
38
51
  return 0
39
52
  fi
40
- status_out="$(git -C "$dir" status --short 2>/dev/null || echo '')"
53
+ status_out="$(_ws_status_short "$dir")"
41
54
  if [ -z "$status_out" ]; then
42
55
  printf '%s @ (尚無 commit),工作樹乾淨\n' "$unborn_branch"
43
56
  else
@@ -51,7 +64,7 @@ workspace_snapshot() {
51
64
  else
52
65
  label="$branch"
53
66
  fi
54
- status_out="$(git -C "$dir" status --short 2>/dev/null || echo '')"
67
+ status_out="$(_ws_status_short "$dir")"
55
68
  if [ -z "$status_out" ]; then
56
69
  if [ "$label" = "HEAD detached" ]; then
57
70
  printf '%s @ %s\n' "$label" "$hash"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devlog-tracker",
3
- "version": "0.33.4",
3
+ "version": "0.33.5",
4
4
  "description": "npx installer for devlog-tracker's Claude Code, Cursor and Codex adapters.",
5
5
  "bin": {
6
6
  "devlog-tracker": "bin/devlog-tracker.js"
@@ -245,7 +245,7 @@ Round 編號:讀取檔案中最後一個 `## Round <N>`,本輪用 N+1;檔
245
245
  `完成條件` 要寫到下一輪能對照判斷「可否 DONE」(例如「`bash core/scripts/tests/test-foo.sh` 全過」),
246
246
  不要只寫「功能完成」。`下一步` 要具體到下一輪打開就能做(路徑/反引號指令/skill 名),寫「繼續完成」不算完成;
247
247
  `IN_PROGRESS` 時 Stop 會做輕量可執行檢查(見下)。`BLOCKED` 的 `現況` 或 `下一步` 必須寫「缺什麼、出現長怎樣」。
248
- - **`工作區` 是收尾當下的 git 快照,給下一輪核對用。** 寫之前跑 `git status --short`、`git rev-parse --abbrev-ref HEAD`、`git rev-parse --short HEAD`,照輸出寫。`abbrev-ref` 為 `HEAD` 時用 detached 格式;`rev-parse --short HEAD` 失敗但 `git symbolic-ref --short HEAD` 抓得到分支名(尚無 commit,例如剛 `git init`)用 unborn 格式;兩者都失敗才是非 git。髒檔是整棵樹的未提交,不必跟「檔案」那輪 delta 相同。格式:
248
+ - **`工作區` 是收尾當下的 git 快照,給下一輪核對用。** 寫之前跑 `git status --short`、`git rev-parse --abbrev-ref HEAD`、`git rev-parse --short HEAD`,照輸出寫。`abbrev-ref` 為 `HEAD` 時用 detached 格式;`rev-parse --short HEAD` 失敗但 `git symbolic-ref --short HEAD` 抓得到分支名(尚無 commit,例如剛 `git init`)用 unborn 格式;兩者都失敗才是非 git。髒檔是整棵樹的未提交,不必跟「檔案」那輪 delta 相同;`.devlog/` 底下的路徑不列(devlog 每輪都會改,只有它髒時照「工作樹乾淨」寫)。格式:
249
249
  - 乾淨:`main @ a1b2c3d,工作樹乾淨`(一行)
250
250
  - 有未提交:第一行 `feat/foo @ a1b2c3d`,第二行 `未提交:src/a.ts, hooks/foo.sh`
251
251
  - 非 git:一行 `非 git 工作區`