p-backlog 0.2.3 → 0.3.0

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 (43) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/README.md +40 -14
  3. package/README.ru.md +38 -13
  4. package/dist/cli.js +2544 -1536
  5. package/dist/web/assets/{ChartTooltip-BYCfK3J2.js → ChartTooltip-DwQKHXkN.js} +2 -2
  6. package/dist/web/assets/CodeTab-BGxsIZMH.js +1 -0
  7. package/dist/web/assets/CostTab-B21EB-7P.js +1 -0
  8. package/dist/web/assets/EffectTab-97OFZkWY.js +1 -0
  9. package/dist/web/assets/Figure-CiIqHKnb.js +1 -0
  10. package/dist/web/assets/OverviewTab-DeoTLTwg.css +1 -0
  11. package/dist/web/assets/OverviewTab-X_g8WfUl.js +1 -0
  12. package/dist/web/assets/QualityTab-DYnFz37G.js +1 -0
  13. package/dist/web/assets/StatsPage-D9gJHHQg.js +1 -0
  14. package/dist/web/assets/StatsTabState-DbuUIt-D.js +1 -0
  15. package/dist/web/assets/StatsTable-Bd3vAxKU.js +1 -0
  16. package/dist/web/assets/UnavailableRepos-D2iehY7u.js +1 -0
  17. package/dist/web/assets/cx-BZTW4xgb.js +58 -0
  18. package/dist/web/assets/index-BrkoyuWi.js +38 -0
  19. package/dist/web/assets/index-CAKUAPJF.css +1 -0
  20. package/dist/web/assets/paths-ZO6w2vYU.js +1 -0
  21. package/dist/web/assets/value-dot-kiMizZCu.js +1 -0
  22. package/dist/web/index.html +4 -4
  23. package/package.json +2 -3
  24. package/skill/backlog/SKILL.md +10 -5
  25. package/skill/backlog-en/SKILL.md +11 -6
  26. package/dist/server.js +0 -3887
  27. package/dist/web/assets/CodeTab-LYNoYtUt.js +0 -1
  28. package/dist/web/assets/CostTab-BNukfYQ_.js +0 -1
  29. package/dist/web/assets/CostTab-CtmH2WbT.css +0 -1
  30. package/dist/web/assets/EffectTab-Bk8BtfaR.js +0 -1
  31. package/dist/web/assets/Figure-BcMtR7CN.js +0 -1
  32. package/dist/web/assets/OverviewTab-Bv0rKc6p.js +0 -1
  33. package/dist/web/assets/OverviewTab-C-NPX9JB.css +0 -1
  34. package/dist/web/assets/QualityTab-N81paNFO.js +0 -1
  35. package/dist/web/assets/StatsPage-D4P63bqv.js +0 -1
  36. package/dist/web/assets/StatsTabState-BcFrx-N3.js +0 -1
  37. package/dist/web/assets/StatsTable-C8h-1NJ7.js +0 -1
  38. package/dist/web/assets/UnavailableRepos-COXy5-Dn.js +0 -1
  39. package/dist/web/assets/i18n-BO0kwLac.js +0 -58
  40. package/dist/web/assets/i18n-BlPq0Oql.css +0 -1
  41. package/dist/web/assets/index-C-8JzRpY.js +0 -38
  42. package/dist/web/assets/index-DyGLN1aL.css +0 -1
  43. package/dist/web/assets/value-dot-X354sZLx.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,10 +1,60 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ CLI contract changes (scripts that parse output or exit codes may need updating):
6
+
7
+ - `take --path --json` prints a single JSON array instead of several JSON objects separated by `---`.
8
+ - `new --json` prints the same task object as `show --json` and `take --json` (with progress, blockers and links) instead of the raw stored task.
9
+ - `deletesAt` in `--json` output is a local ISO time with offset, like `created` and `closed`, instead of UTC.
10
+ - `check` exits with `5` only when there are candidates or task problems; project setup problems (no repos, missing repo, shared prefix) are reported with exit code `0`.
11
+ - `service` on a system without autostart support exits with `4` (the command failed) instead of `3` (refused).
12
+ - `backlog`, `backlog --help` and `backlog <command> --help` print help to stdout with exit code `0`.
13
+ - Argument errors are shown in the interface language and followed by the command's usage. Arguments that used to be ignored are now rejected with exit code `1`: extra words after `project list`, `--confirm` outside `project delete`, an empty `list --status`, `take <ID> --project`, `take --next|--path --force`, a `serve --port` that is not a decimal number from 1 to 65535.
14
+ - `serve` and `service install` reject a `PORT` environment variable that is not a decimal number from 1 to 65535 with exit code `1` instead of silently using 4317. `serve` exits with `0` after a clean stop on SIGTERM, SIGINT or SIGHUP.
15
+ - `stats` prints warnings about unparsed task files and journal lines before the "Open" line; `stats --json` has `unparsedTasks` and `invalidJournalLines`. `totals.open`, the age median and the open weight now count tasks by their history, so an open task whose file cannot be parsed is still counted. `forecast.windowWeeks` is replaced by `forecast.windowDays` — the span the weekly rate is computed over.
16
+ - `stats --json` also has `unknownJournalLines`, and `stats` prints a matching warning. A journal line with a renamed or otherwise unrecognized category, "how found" or resolution value is now read as `unknown` and kept in the quality breakdowns (its own row or `byReason.unknown`) instead of silently dropping out.
17
+ - `hook stop` exits with `0` on internal failures (for example, an unreadable backlog directory) and only prints a warning to stderr, so Claude Code on Windows no longer reports a hook error on every turn.
18
+
19
+ Other changes:
20
+
21
+ - `setup` writes `~/.claude/settings.json` atomically, keeps its key order and file mode, and writes through a symlink (including a dangling one) instead of replacing it.
22
+ - Windows service: `service install|uninstall` stops the process from `server.pid` only after checking that it is this p-backlog server; if the check is impossible, the PID file is kept and a warning is printed.
23
+ - The CLI trims `.runs.jsonl` by itself, so the run log no longer grows without the web server.
24
+ - `dist/server.js` is no longer shipped in the npm package.
25
+ - The server stops cleanly on SIGTERM, SIGINT and SIGHUP: it finishes edits already in progress, closes open browser tabs' event streams and removes its PID file, instead of being killed mid-write.
26
+ - The web UI cannot be embedded in another site's frame (`X-Frame-Options: DENY`, CSP `frame-ancestors 'none'`). The CSP loads scripts, styles and images only from the server itself (images also from `data:`), so an external image in a task description is not shown: text written by an agent cannot make the browser contact a third-party host.
27
+ - A file locked by another process for more than 5 seconds is reported by the API as `503` with an explanation instead of `500`.
28
+
29
+ Fixes:
30
+
31
+ - Re-check: the symbol filter looks the task's symbol up at the task's current line, so a candidate is no longer
32
+ dropped (and the anchor re-attached to a neighbouring function) when lines above the task moved.
33
+ - Re-check: edits that arrive with a merge commit are seen; the diff base follows the first parent; a user's external
34
+ diff tool or `diff.suppressBlankEmpty` no longer breaks hunk parsing; `git log` is limited to the tasks' paths, and a
35
+ git failure is reported instead of silently producing no candidates.
36
+ - Re-check: `verify` clears the anchor when the task's line is past the end of the file, and moves `source` to the
37
+ task's current place when the lines shifted.
38
+ - Task numbers of deleted tasks are never reused, even when `backlog new` races with the cleanup.
39
+ - An unparseable `project.md` no longer makes `backlog new` create a second project with the same prefix.
40
+ - Git worktrees belong to the main repository's project; the hook and checks see commits made in the worktree.
41
+ - The Stop hook remembers what it already told each session separately, so parallel sessions don't repeat each other.
42
+ - Statistics: a task whose file can't be parsed keeps its last status instead of an invented "cancelled"; the open
43
+ count, forecast and debt curve use one history; model prices are matched by exact id (`claude-opus-5-5` added);
44
+ fixes are dated by when they landed on the main branch.
45
+ - Web UI: a focused field no longer overwrites an edit made by the agent meanwhile (a conflict is shown instead); a
46
+ failed background refresh no longer wipes the page and the description draft; errors are shown in the interface
47
+ language; all tabs share one live-update connection, so many open tabs no longer stall.
48
+
49
+ ## 0.2.4
50
+
51
+ - A clearer description on npm and GitHub, and a rewritten README introduction: out-of-scope fixes stay out of pull requests, audit findings don't get lost, tasks keep the context the agent needs. No code changes.
52
+
3
53
  ## 0.2.3
4
54
 
5
55
  - README: screenshots of the task list, a task card and statistics (English UI in README.md, Russian UI in README.ru.md), generated from fictional demo data with `npm run screenshots`. No code changes.
6
56
 
7
- ## 0.2.2 (not published to npm; its changes ship in 0.2.3)
57
+ ## 0.2.2
8
58
 
9
59
  - README: npm, CI, Node and license badges; a section on using p-backlog together with code-review-graph (re-check by symbol). No code changes.
10
60
 
package/README.md CHANGED
@@ -4,14 +4,28 @@
4
4
 
5
5
  **[Русская версия](README.ru.md)**
6
6
 
7
- A task backlog that lives as markdown files: an AI agent creates them while working on code, and a human
8
- triages them in a local web app.
9
-
10
- - **`backlog` CLI** — creates tasks, takes them into progress, changes their status.
11
- - **`backlog` skill** for Claude Code — tells the agent when and how to call the CLI.
12
- - **Web app** — project list, search, filters, epics, links, progress; doesn't create tasks.
13
- - **Backlog hygiene** — the agent re-checks tasks whose code changed and closes the ones no longer needed;
14
- closed tasks are deleted after 7 days.
7
+ **Keep pull requests clean. Never lose an audit finding.**
8
+
9
+ A personal backlog for Claude Code that lives next to your code as Markdown files. When the agent notices a problem
10
+ outside the task at hand, it doesn't slip a fix into your pull request — it files a task with the file, the line and
11
+ what will break. Findings from audits and code reviews become tasks too, instead of getting lost in chat history.
12
+
13
+ - **Clean pull requests.** Out-of-scope fixes go to the backlog, not into the diff you review. The Effect tab in
14
+ statistics shows how many lines stayed out of your pull requests.
15
+ - **Nothing gets lost.** Every finding from an audit or a review is a task with its source (`file:line`), what it
16
+ risks and a checklist.
17
+ - **Context kept, tokens saved.** A task stores the context the agent needs to pick it up later. On a re-check the
18
+ agent gets the task's summary, the current code around its line and the diff since the last check — usually
19
+ enough to decide without re-reading the codebase.
20
+ - **Stays current by itself.** A Stop hook asks the agent to re-check tasks whose code changed. The agent closes
21
+ fixed ones with the commit as evidence; line numbers follow the code as it moves. Closed tasks are cleaned up
22
+ after 7 days.
23
+ - **Local and autonomous.** Plain files in `~/backlog`, no account, no cloud. The agent drives it through the skill,
24
+ so you don't have to touch the CLI — though you can.
25
+ - **Charts when you want them.** Start the local web app to browse and triage tasks and follow the metrics: debt by
26
+ week, where it hurts in the code, how accurate the checks are, what the hook costs in tokens.
27
+
28
+ It consists of the `backlog` CLI, the `backlog` skill and a Stop hook for Claude Code, and an optional web app.
15
29
 
16
30
  ## Screenshots
17
31
 
@@ -89,7 +103,7 @@ If there's no project yet, `backlog new` creates it.
89
103
  | `backlog new --title <t> --category <category> [--type task\|epic] [--priority low\|medium\|high\|critical] [--tags a,b] [--found review\|incidental] [--source file:line] [--epic ID] [--blocked-by ID,…] [--related ID,…] [--project id] [--force] [--json]` | Creates a task, the description is read from stdin; a similar open task refuses the command (code 3), `--force` creates it anyway; `--found review` marks a review finding, the default is `incidental` (noticed in passing) |
90
104
  | `backlog list [--query q] [--status s,…] [--tag t,…] [--project id \| --all-projects] [--json]` | Lists tasks, by default the open tasks of the current project |
91
105
  | `backlog show <ID> [--json]` | The full task: links, blockers, warnings |
92
- | `backlog take <ID> \| --next [--project id] [--force] [--json]` | Takes a task into progress, checking blockers |
106
+ | `backlog take <ID> [--force] [--json]` \| `--next [--project id] [--json]` | Takes a task into progress, checking blockers |
93
107
  | `backlog take --path <file\|directory> [--project id] [--json]` | Takes into progress every open task inside the path |
94
108
  | `backlog status <ID> <backlog\|in-progress\|blocked\|done\|cancelled>` | Changes the status |
95
109
  | `backlog priority <ID> <low\|medium\|high\|critical>` | Changes the priority |
@@ -108,8 +122,11 @@ If there's no project yet, `backlog new` creates it.
108
122
  | `backlog service install \| uninstall \| status` | Autostarts the web server at login: launchd on macOS, systemd --user on Linux, a Startup-folder script on Windows; `status` shows whether it is installed and responding |
109
123
 
110
124
  Exit codes: `0` success, `1` argument or rule error, `2` not found, `3` refused (the task is closed,
111
- blocked, or every matching task is blocked), `4` the command failed, `5` `check` found something to
112
- re-check.
125
+ blocked, or every matching task is blocked), `4` the command failed, `5` `check` found candidates or task problems to
126
+ work through.
127
+
128
+ With `--json`, `new`, `show`, and `take` print the same task object (with progress, blockers, and links),
129
+ while `list` and `take --path` print an array of such objects.
113
130
 
114
131
  A project that's no longer maintained is marked inactive: its tasks drop out of the combined "Projects"
115
132
  scope's list and statistics, but the project's own page works as usual. Checks (`backlog check`), the Stop
@@ -224,9 +241,18 @@ the Stop hook by hand:
224
241
  rm ~/.claude/skills/backlog # or $CLAUDE_SKILLS_DIR / $CLAUDE_CONFIG_DIR/skills, if set
225
242
  ```
226
243
 
227
- and delete the `Stop` hook entry from `~/.claude/settings.json` (or `$CLAUDE_SETTINGS_PATH`) — on
228
- macOS/Linux it's the command `command -v backlog >/dev/null && backlog hook stop || true`, on Windows a
229
- PowerShell command starting with `if (Get-Command backlog.cmd ...)`.
244
+ and delete the `Stop` hook entry from `~/.claude/settings.json` (or `$CLAUDE_SETTINGS_PATH`). On macOS/Linux
245
+ it is
246
+
247
+ ```json
248
+ { "type": "command", "command": "command -v backlog >/dev/null && backlog hook stop || true" }
249
+ ```
250
+
251
+ and on Windows
252
+
253
+ ```json
254
+ { "type": "command", "shell": "powershell", "command": "if (Get-Command backlog.cmd -ErrorAction SilentlyContinue) { backlog.cmd hook stop }" }
255
+ ```
230
256
 
231
257
  On Windows, the Startup-folder script does not restart a crashed server the way launchd `KeepAlive` or
232
258
  systemd `Restart=on-failure` do — after a crash, run `backlog service install` again or start it with
package/README.ru.md CHANGED
@@ -4,14 +4,27 @@
4
4
 
5
5
  **[English version](README.md)**
6
6
 
7
- Беклог задач, который живёт markdown-файлами: их создаёт ИИ-агент во время работы над кодом, а человек
8
- разбирает в локальном веб-приложении.
9
-
10
- - **CLI `backlog`** — создаёт задачи, берёт их в работу, меняет статусы.
11
- - **Скилл `backlog`** для Claude Code — объясняет агенту, когда и как звать CLI.
12
- - **Веб-приложение** — список проектов, поиск, фильтры, эпики, связи, прогресс; задачи не создаёт.
13
- - **Порядок в беклоге** — агент перепроверяет задачи, чей код изменился, и закрывает ненужные; закрытые
14
- задачи удаляются через 7 дней.
7
+ **Чистые пулреквесты. Находки аудитов не теряются.**
8
+
9
+ Личный беклог для Claude Code, который живёт рядом с кодом markdown-файлами. Когда агент замечает проблему вне
10
+ текущей задачи, он не протаскивает правку в ваш пулреквест, а заводит задачу: файл, строка и чем это грозит.
11
+ Находки аудитов и ревью тоже становятся задачами, а не теряются в истории чата.
12
+
13
+ - **Чистые пулреквесты.** Посторонние правки уходят в беклог, а не в дифф, который вы ревьюите. Вкладка «Эффект»
14
+ в статистике показывает, сколько строк не попало в пулреквесты.
15
+ - **Ничего не теряется.** Каждая находка аудита или ревью — задача с источником (`файл:строка`), описанием риска
16
+ и чеклистом.
17
+ - **Контекст сохранён, токены сэкономлены.** Задача хранит контекст, который нужен агенту, чтобы потом взять её
18
+ в работу. При перепроверке агент получает суть задачи, текущий код вокруг её строки и изменения с прошлой
19
+ проверки — обычно этого хватает, чтобы решить, не перечитывая кодовую базу.
20
+ - **Сам следит за актуальностью.** Stop-хук просит агента перепроверить задачи, чей код изменился. Агент закрывает
21
+ исправленные со ссылкой на коммит, номера строк следуют за кодом. Закрытые задачи удаляются через 7 дней.
22
+ - **Локальный и автономный.** Обычные файлы в `~/backlog`, без аккаунта и облака. Агент работает с ним через
23
+ скилл, так что трогать CLI не обязательно — но можно.
24
+ - **Графики — когда нужны.** Поднимите локальное веб-приложение, чтобы просматривать и разбирать задачи и следить
25
+ за метриками: долг по неделям, где болит в коде, насколько точны проверки, во что обходится хук в токенах.
26
+
27
+ Состоит из CLI `backlog`, скилла `backlog` и Stop-хука для Claude Code и веб-приложения по желанию.
15
28
 
16
29
  ## Скриншоты
17
30
 
@@ -88,7 +101,7 @@
88
101
  | `backlog new --title <t> --category <категория> [--type task\|epic] [--priority low\|medium\|high\|critical] [--tags a,b] [--found review\|incidental] [--source файл:строка] [--epic ID] [--blocked-by ID,…] [--related ID,…] [--project id] [--force] [--json]` | Создаёт задачу, описание читается из stdin; похожая открытая задача — отказ (код 3), `--force` создаёт всё равно; `--found review` — находка ревью, по умолчанию `incidental` (замечено попутно) |
89
102
  | `backlog list [--query q] [--status s,…] [--tag t,…] [--project id \| --all-projects] [--json]` | Список задач, по умолчанию открытые задачи текущего проекта |
90
103
  | `backlog show <ID> [--json]` | Задача целиком: связи, блокеры, предупреждения |
91
- | `backlog take <ID> \| --next [--project id] [--force] [--json]` | Берёт задачу в работу, проверяя блокеры |
104
+ | `backlog take <ID> [--force] [--json]` \| `--next [--project id] [--json]` | Берёт задачу в работу, проверяя блокеры |
92
105
  | `backlog take --path <файл\|каталог> [--project id] [--json]` | Берёт в работу все открытые задачи внутри пути |
93
106
  | `backlog status <ID> <backlog\|in-progress\|blocked\|done\|cancelled>` | Меняет статус |
94
107
  | `backlog priority <ID> <low\|medium\|high\|critical>` | Меняет приоритет |
@@ -108,7 +121,10 @@
108
121
 
109
122
  Коды выхода: `0` — успех, `1` — ошибка аргументов или правил, `2` — не найдено, `3` — отказ (задача
110
123
  закрыта, заблокирована или все подходящие заблокированы), `4` — команда не выполнилась, `5` — у `check`
111
- есть что перепроверить.
124
+ есть кандидаты или проблемы задач, которые надо разобрать.
125
+
126
+ С `--json` команды `new`, `show` и `take` печатают один и тот же объект задачи (с прогрессом, блокерами и
127
+ связями), а `list` и `take --path` — массив таких объектов.
112
128
 
113
129
  Проект, который больше не ведётся, помечается неактивным: его задачи не попадают в список и статистику
114
130
  режима «Проекты», но страница проекта работает как обычно. Проверки (`backlog check`), Stop-хук и
@@ -219,9 +235,18 @@ npm uninstall -g p-backlog
219
235
  rm ~/.claude/skills/backlog # или $CLAUDE_SKILLS_DIR / $CLAUDE_CONFIG_DIR/skills, если заданы
220
236
  ```
221
237
 
222
- и удалите запись хука `Stop` из `~/.claude/settings.json` (или `$CLAUDE_SETTINGS_PATH`) — на
223
- macOS/Linux это команда `command -v backlog >/dev/null && backlog hook stop || true`, на Windows —
224
- команда PowerShell, начинающаяся с `if (Get-Command backlog.cmd ...)`.
238
+ и удалите запись хука `Stop` из `~/.claude/settings.json` (или `$CLAUDE_SETTINGS_PATH`). На macOS/Linux
239
+ это
240
+
241
+ ```json
242
+ { "type": "command", "command": "command -v backlog >/dev/null && backlog hook stop || true" }
243
+ ```
244
+
245
+ а на Windows
246
+
247
+ ```json
248
+ { "type": "command", "shell": "powershell", "command": "if (Get-Command backlog.cmd -ErrorAction SilentlyContinue) { backlog.cmd hook stop }" }
249
+ ```
225
250
 
226
251
  На Windows скрипт в папке «Автозагрузка» не перезапускает сервер после падения — в отличие от `KeepAlive`
227
252
  у launchd или `Restart=on-failure` у systemd; после сбоя запустите `backlog service install` заново или