devlog-tracker 0.25.1 → 0.29.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.
Files changed (130) hide show
  1. package/README.md +131 -151
  2. package/README.zh-TW.md +235 -0
  3. package/claude/hooks.json +75 -0
  4. package/cli/agents-md.js +15 -8
  5. package/cli/agents-md.test.js +21 -1
  6. package/cli/init.js +6 -4
  7. package/cli/init.test.js +5 -4
  8. package/cli/merge-hooks.js +5 -2
  9. package/cli/merge-hooks.test.js +52 -0
  10. package/cli/platforms/claude.js +55 -0
  11. package/cli/platforms/claude.test.js +178 -0
  12. package/cli/platforms/codex.js +6 -18
  13. package/cli/skills-from-commands.js +32 -0
  14. package/cli/skills-from-commands.test.js +51 -0
  15. package/cli/vendor.js +8 -1
  16. package/cli/vendor.test.js +24 -5
  17. package/codex/hooks/on-pre-tool.sh +3 -3
  18. package/codex/hooks/on-session-end.sh +2 -2
  19. package/codex/hooks/on-session-start.sh +2 -2
  20. package/codex/hooks/on-stop.sh +3 -3
  21. package/codex/hooks/on-user-prompt-submit.sh +2 -2
  22. package/codex/hooks/test-adapters.sh +2 -2
  23. package/commands/checkpoint.md +2 -2
  24. package/commands/clean.md +3 -3
  25. package/commands/compact.md +3 -3
  26. package/commands/continue.md +4 -4
  27. package/commands/keep.md +21 -5
  28. package/commands/lessons-drift.md +4 -4
  29. package/commands/lessons-off.md +3 -3
  30. package/commands/lessons-on.md +3 -3
  31. package/commands/lessons.md +3 -3
  32. package/commands/overview.md +3 -3
  33. package/commands/pause.md +3 -3
  34. package/commands/resume.md +3 -3
  35. package/commands/search.md +22 -0
  36. package/commands/segment-watch.md +3 -3
  37. package/commands/span.md +2 -2
  38. package/commands/start.md +3 -3
  39. package/commands/status.md +5 -4
  40. package/{hooks → core}/scripts/await-open.sh +1 -1
  41. package/{hooks → core}/scripts/checkpoint-set.sh +1 -1
  42. package/{hooks → core}/scripts/clean-devlog.sh +2 -1
  43. package/{hooks → core}/scripts/close-open-round.sh +1 -1
  44. package/{hooks → core}/scripts/compact-devlog.sh +1 -1
  45. package/{hooks → core}/scripts/devlog-lock.sh +17 -1
  46. package/{hooks → core}/scripts/devlog-path.sh +15 -8
  47. package/{hooks → core}/scripts/enforce-devlog.sh +26 -1
  48. package/core/scripts/handoff-file.sh +106 -0
  49. package/{hooks → core}/scripts/keep-move.sh +1 -1
  50. package/{hooks → core}/scripts/kept-list.sh +1 -1
  51. package/core/scripts/lessons-advisory-state.sh +51 -0
  52. package/{hooks → core}/scripts/lessons-append.sh +18 -2
  53. package/core/scripts/lessons-drift-set.sh +46 -0
  54. package/{hooks → core}/scripts/lessons-off.sh +1 -1
  55. package/{hooks → core}/scripts/lessons-on.sh +9 -4
  56. package/{hooks → core}/scripts/lessons-read.sh +1 -1
  57. package/{hooks → core}/scripts/on-tool-failure.sh +1 -1
  58. package/{hooks → core}/scripts/pause-devlog.sh +1 -1
  59. package/core/scripts/project-dir.sh +19 -0
  60. package/{hooks → core}/scripts/resume-devlog.sh +1 -1
  61. package/{hooks → core}/scripts/round-start.sh +52 -17
  62. package/{hooks → core}/scripts/run-tests.sh +1 -1
  63. package/core/scripts/search-devlog.sh +63 -0
  64. package/{hooks → core}/scripts/segment-watch-set.sh +1 -1
  65. package/{hooks → core}/scripts/segment-watch.sh +1 -1
  66. package/{hooks → core}/scripts/session-start-devlog.sh +8 -1
  67. package/{hooks → core}/scripts/span-close.sh +1 -1
  68. package/{hooks → core}/scripts/span-open.sh +1 -1
  69. package/{hooks → core}/scripts/start-devlog.sh +1 -1
  70. package/{hooks → core}/scripts/status-devlog.sh +5 -5
  71. package/{hooks → core}/scripts/tests/test-clean-devlog.sh +12 -0
  72. package/core/scripts/tests/test-cli-init-e2e.sh +68 -0
  73. package/core/scripts/tests/test-devlog-lock.sh +76 -0
  74. package/{hooks → core}/scripts/tests/test-devlog-path.sh +44 -0
  75. package/{hooks → core}/scripts/tests/test-enforce-devlog-files.sh +11 -0
  76. package/core/scripts/tests/test-enforce-devlog-session-handoff.sh +178 -0
  77. package/{hooks → core}/scripts/tests/test-enforce-devlog-workspace.sh +35 -0
  78. package/{hooks → core}/scripts/tests/test-enforce-devlog.sh +174 -0
  79. package/core/scripts/tests/test-handoff-file.sh +98 -0
  80. package/core/scripts/tests/test-lessons-advisory-state.sh +55 -0
  81. package/{hooks → core}/scripts/tests/test-lessons-append.sh +18 -0
  82. package/{hooks → core}/scripts/tests/test-lessons-drift-set.sh +14 -5
  83. package/{hooks → core}/scripts/tests/test-lessons-on-off.sh +16 -6
  84. package/core/scripts/tests/test-project-dir.sh +30 -0
  85. package/{hooks → core}/scripts/tests/test-round-start.sh +247 -13
  86. package/core/scripts/tests/test-search-devlog.sh +126 -0
  87. package/{hooks → core}/scripts/tests/test-session-start-devlog.sh +61 -2
  88. package/{hooks → core}/scripts/tests/test-status-span.sh +3 -3
  89. package/{hooks → core}/scripts/workspace-snapshot.sh +2 -2
  90. package/cursor/hooks/on-pre-tool.sh +2 -2
  91. package/cursor/hooks/on-session-end.sh +2 -2
  92. package/cursor/hooks/on-session-start.sh +2 -2
  93. package/cursor/hooks/on-stop.sh +2 -2
  94. package/cursor/hooks/on-submit-prompt.sh +2 -2
  95. package/cursor/hooks/on-tool-failure.sh +2 -2
  96. package/package.json +5 -4
  97. package/skills/devlog-tracker/SKILL.md +90 -22
  98. package/skills/devlog-tracker/references/checkpoint-mode.md +21 -6
  99. package/skills/devlog-tracker/references/contract.md +83 -0
  100. package/skills/devlog-tracker/references/lessons-mode.md +33 -9
  101. package/skills/devlog-tracker/references/reply-fold.md +1 -1
  102. package/hooks/scripts/lessons-drift-set.sh +0 -42
  103. package/hooks/scripts/tests/test-cli-init-e2e.sh +0 -38
  104. package/hooks/scripts/tests/test-devlog-lock.sh +0 -37
  105. /package/{hooks → core}/scripts/detect-pending-question.sh +0 -0
  106. /package/{hooks → core}/scripts/devlog-md.sh +0 -0
  107. /package/{hooks → core}/scripts/files-snapshot.sh +0 -0
  108. /package/{hooks → core}/scripts/json-field.sh +0 -0
  109. /package/{hooks → core}/scripts/on-session-end.sh +0 -0
  110. /package/{hooks → core}/scripts/on-stop-failure.sh +0 -0
  111. /package/{hooks → core}/scripts/redact-prompt.sh +0 -0
  112. /package/{hooks → core}/scripts/tests/test-await-open.sh +0 -0
  113. /package/{hooks → core}/scripts/tests/test-branch-scoped-integration.sh +0 -0
  114. /package/{hooks → core}/scripts/tests/test-checkpoint-set.sh +0 -0
  115. /package/{hooks → core}/scripts/tests/test-close-open-round.sh +0 -0
  116. /package/{hooks → core}/scripts/tests/test-compact-devlog.sh +0 -0
  117. /package/{hooks → core}/scripts/tests/test-devlog-md.sh +0 -0
  118. /package/{hooks → core}/scripts/tests/test-enforce-devlog-handoff-order.sh +0 -0
  119. /package/{hooks → core}/scripts/tests/test-files-snapshot.sh +0 -0
  120. /package/{hooks → core}/scripts/tests/test-json-field.sh +0 -0
  121. /package/{hooks → core}/scripts/tests/test-keep-move.sh +0 -0
  122. /package/{hooks → core}/scripts/tests/test-kept-list.sh +0 -0
  123. /package/{hooks → core}/scripts/tests/test-lessons-read.sh +0 -0
  124. /package/{hooks → core}/scripts/tests/test-on-interrupt.sh +0 -0
  125. /package/{hooks → core}/scripts/tests/test-redact-prompt.sh +0 -0
  126. /package/{hooks → core}/scripts/tests/test-resume-devlog.sh +0 -0
  127. /package/{hooks → core}/scripts/tests/test-segment-watch-set.sh +0 -0
  128. /package/{hooks → core}/scripts/tests/test-segment-watch.sh +0 -0
  129. /package/{hooks → core}/scripts/tests/test-start-pause-devlog.sh +0 -0
  130. /package/{hooks → core}/scripts/tests/test-workspace-snapshot.sh +0 -0
@@ -1,38 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -uo pipefail
3
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
4
- REPO_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
5
- TMP="$(mktemp -d)"
6
- trap 'rm -rf "$TMP"' EXIT
7
- FAIL=0
8
-
9
- command -v node >/dev/null 2>&1 || { echo "SKIP: node not installed"; exit 0; }
10
-
11
- PROJECT="$TMP/project"
12
- mkdir -p "$PROJECT"
13
-
14
- cd "$PROJECT" || exit 1
15
- NODE_BIN="$(command -v node)"
16
- "$NODE_BIN" "$REPO_ROOT/bin/devlog-tracker.js" init --codex --cursor >/dev/null 2>"$TMP/stderr" \
17
- || { echo "FAIL: init exited non-zero"; cat "$TMP/stderr"; FAIL=1; }
18
-
19
- [ -f "$PROJECT/.devlog-tracker/VERSION" ] && echo "PASS: vendored VERSION exists" || { echo "FAIL: no VERSION"; FAIL=1; }
20
- [ -f "$PROJECT/.devlog-tracker/env.sh" ] && echo "PASS: vendored env.sh exists" || { echo "FAIL: no env.sh"; FAIL=1; }
21
- [ -f "$PROJECT/.codex/hooks.json" ] && echo "PASS: .codex/hooks.json written" || { echo "FAIL: no .codex/hooks.json"; FAIL=1; }
22
- [ -f "$PROJECT/.agents/skills/devlog-start/SKILL.md" ] && echo "PASS: Codex start skill written" || { echo "FAIL: no Codex start skill"; FAIL=1; }
23
- [ -f "$PROJECT/.cursor/hooks.json" ] && echo "PASS: .cursor/hooks.json written" || { echo "FAIL: no .cursor/hooks.json"; FAIL=1; }
24
-
25
- # re-running must not duplicate entries
26
- COUNT_BEFORE=$(node -e "console.log(JSON.parse(require('fs').readFileSync('$PROJECT/.codex/hooks.json')).hooks.Stop.length)")
27
- "$NODE_BIN" "$REPO_ROOT/bin/devlog-tracker.js" init --codex --cursor >/dev/null 2>"$TMP/stderr" \
28
- || { echo "FAIL: second init exited non-zero"; cat "$TMP/stderr"; FAIL=1; }
29
- COUNT_AFTER=$(node -e "console.log(JSON.parse(require('fs').readFileSync('$PROJECT/.codex/hooks.json')).hooks.Stop.length)")
30
- if [ "$COUNT_BEFORE" = "$COUNT_AFTER" ]; then
31
- echo "PASS: re-running init does not duplicate hook entries"
32
- else
33
- echo "FAIL: hook entries duplicated ($COUNT_BEFORE -> $COUNT_AFTER)"; FAIL=1
34
- fi
35
-
36
- if [ "$FAIL" -eq 0 ]; then echo "All checks passed."; exit 0
37
- else echo "Some checks FAILED."; exit 1
38
- fi
@@ -1,37 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -uo pipefail
3
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
4
- . "$SCRIPT_DIR/devlog-lock.sh"
5
- TMP="$(mktemp -d)"
6
- trap 'rm -rf "$TMP"' EXIT
7
- DEVLOG_DIR="$TMP/.devlog"
8
- mkdir -p "$DEVLOG_DIR"
9
- FAIL=0
10
-
11
- devlog_lock_acquire
12
- [ "${LOCK_HELD:-0}" -eq 1 ] && [ -d "$DEVLOG_DIR/.lock" ] \
13
- && echo "PASS: acquired" || { echo "FAIL: acquire"; FAIL=1; }
14
- mkdir "$DEVLOG_DIR/.lock" >/dev/null 2>&1
15
- [ "$?" -ne 0 ] && echo "PASS: second mkdir excluded" || { echo "FAIL: duplicate mkdir"; FAIL=1; }
16
- devlog_lock_release
17
- devlog_lock_acquire
18
- [ "${LOCK_HELD:-0}" -eq 1 ] && echo "PASS: reacquired after release" || { echo "FAIL: reacquire"; FAIL=1; }
19
- devlog_lock_release
20
-
21
- mkdir "$DEVLOG_DIR/.lock"
22
- START="$(date +%s)"
23
- devlog_lock_acquire
24
- END="$(date +%s)"
25
- ELAPSED=$((END - START))
26
- [ "${LOCK_HELD:-0}" -eq 0 ] && [ "$ELAPSED" -ge 2 ] && [ "$ELAPSED" -le 3 ] \
27
- && echo "PASS: contention fails open" || { echo "FAIL: contention held=$LOCK_HELD elapsed=$ELAPSED"; FAIL=1; }
28
- rmdir "$DEVLOG_DIR/.lock"
29
-
30
- MIN_PATH="$TMP/min-path"
31
- mkdir "$MIN_PATH"
32
- ln -s "$(command -v bash)" "$MIN_PATH/bash"
33
- HELD="$(PATH="$MIN_PATH" bash -c '. "$1"; DEVLOG_DIR="$2"; devlog_lock_acquire; echo "${LOCK_HELD:-0}"' _ "$SCRIPT_DIR/devlog-lock.sh" "$DEVLOG_DIR")"
34
- [ "$HELD" = "0" ] && echo "PASS: missing lock tools fails open" || { echo "FAIL: restricted path held=$HELD"; FAIL=1; }
35
-
36
- if [ "$FAIL" -eq 0 ]; then echo "All checks passed."; exit 0
37
- else echo "Some checks FAILED."; exit 1; fi
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes