@getpipher/armory-todo 0.4.0 → 0.5.1
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 +15 -3
- package/docs/superpowers/plans/2026-07-21-caps-release.md +1113 -0
- package/docs/superpowers/specs/2026-07-21-caps-release-design.md +222 -0
- package/extensions/todo.ts +2 -2
- package/package.json +4 -4
- package/src/archive.ts +7 -0
- package/src/backup.ts +83 -0
- package/src/caps.ts +71 -0
- package/src/config.ts +5 -0
- package/src/health.ts +20 -4
- package/src/panel-data.ts +1 -0
- package/src/panel.ts +2 -0
- package/src/todo-store.ts +81 -12
package/README.md
CHANGED
|
@@ -111,7 +111,19 @@ A project registry (`~/.pi/agent/todo/projects.json`, lazy-synced on read) track
|
|
|
111
111
|
|
|
112
112
|
The interactive `/todo` panel gains a 6th tab — **Projects** — listing the overview rows + a `(no project)` summary, with an action submenu per project: **Rename / merge** (inline input), **Set maxOpen** (number or `clear`), **Filter active to project** (jump to the Active tab scoped). A thin `/todo projects` slash mirrors the overview as text.
|
|
113
113
|
|
|
114
|
-
**Advisory
|
|
114
|
+
**Advisory in v0.4.0 → enforced in v0.5.0** — `maxOpen` now blocks `add` (and project-move) when a project is at its cap. See the [Caps enforcement (v0.5.0)](#caps-enforcement-v050) section below.
|
|
115
|
+
|
|
116
|
+
## Caps enforcement (v0.5.0)
|
|
117
|
+
|
|
118
|
+
Three caps keep the store (and its auto-injected prompt block) from bloating silently — the forcing-function half of [issue #1](https://github.com/getpither/armory-todo/issues/1):
|
|
119
|
+
|
|
120
|
+
1. **Count cap (per-project `maxOpen`, enforced).** A project's `maxOpen` slot (set via the Projects tab → Set maxOpen, or `setProjectMaxOpen`) **blocks `add`** when the project is at its cap, and **blocks a project-move** of an `open`/`in_progress` todo into a capped project. The cap is on the `open` count (matches the `PROJECT_OVER` health flag); `in_progress` doesn't count. Un-park (`parked→open`) is intentionally **not** blocked — reactivating deferred work isn't adding new work. The block message tells you how to raise/clear the cap. `maxOpen: null` (default) = uncapped.
|
|
121
|
+
|
|
122
|
+
2. **Notes cap (`health.maxNotesBytes`, default 8192 bytes, enforced).** Oversize notes are rejected at `add`/`update` (only when `notes` is being written — a title edit on a grandfathered oversize note isn't trapped). Byte-length, not char-length (notes can hold Unicode). Existing oversize notes are grandfathered; `health` surfaces the worst offender via the `NOTES_OVER` flag + an actionable `todo update <id> notes:…` suggestion.
|
|
123
|
+
|
|
124
|
+
3. **Over-cap injection truncation.** When actionable > `health.activeMaxOpen` (default 15), the auto-injected `## Open TODOs (N)` block collapses to a ~4-line summary (total + project span + over-budget projects + a `todo list` pointer) instead of the row list. Under the cap → the familiar row list. `activeMaxOpen` itself stays **advisory** (it drives the `ACTIVE_LARGE` flag and the truncation trigger; it is not a hard global block).
|
|
125
|
+
|
|
126
|
+
**Backwards-compat:** zero migration (store v3, config v1, registry v1 unchanged in shape). Oversize notes grandfathered. The `maxOpen` advisory→enforced graduation is a documented behavior change for any v0.4.0 user who set a slot (the block message tells them how to raise/clear).
|
|
115
127
|
|
|
116
128
|
## Interactive panel (SPEC-3)
|
|
117
129
|
|
|
@@ -182,7 +194,7 @@ Each TODO carries `id, title (≤120 chars), notes (any length), project, tags,
|
|
|
182
194
|
- **Disk store** — `~/.pi/agent/todo/` folder: `todo.json` (live: active + parked), `todo-archive.json` (sealed: done + cancelled), `todo.config.json` (prune ages + health thresholds), `projects.json` (project registry: canonical names + advisory `maxOpen` slots, v0.4.0). Atomic `0600` writes, corrupt-file auto-recovery, `version: 3` store schema (`title` ≤120 chars + `notes` any length; v2 `text`-only stores migrate to v3 on first load). Not pi session entries, so it outlives any conversation.
|
|
183
195
|
- **`todo` tool** — model CRUD + lifecycle (above).
|
|
184
196
|
- **`/todo` command** — human triage (above).
|
|
185
|
-
- **Auto-inject** — on every `before_agent_start`, a compact `## Open TODOs (N)` block (titles + ids,
|
|
197
|
+
- **Auto-inject** — on every `before_agent_start`, a compact `## Open TODOs (N)` block (titles + ids, sorted by priority) is appended to the system prompt, so the agent starts every turn already aware of pending work. The block is **cap-aware** (v0.5.0): under `health.activeMaxOpen` (default 15) it lists the rows; **over** the cap it collapses to a lean summary (counts + over-budget projects + a `todo list` pointer) so the prompt stays bounded when the store bloats. Only `open` + `in_progress` are injected — `parked` and archived todos are excluded (the lifecycle-box boundary). Mutations refresh it on the next turn.
|
|
186
198
|
- **Archive query** — `list` with `archived:true` is summary-first (counts by project + month) then filtered/paginated on demand, so a large archive never bloats a single query.
|
|
187
199
|
|
|
188
200
|
Full design + decisions:
|
|
@@ -203,7 +215,7 @@ Run the store tests: `npm test` (315/315 across 11 suites).
|
|
|
203
215
|
## Known issues
|
|
204
216
|
|
|
205
217
|
- **No in-panel multi-line `notes` editing.** The panel's inline Edit is single-line (`Input`) for `title` only; `ctx.ui.editor()` from inside `ctx.ui.custom()` triggers a nested-UI bug (`/todo` won't reopen). `notes` is model-managed via the `todo` tool (`action: update, id, notes`). When a safe `ctx.ui.editor()`-from-`custom()` pattern lands in pi-tui, in-panel notes editing is a clean follow-up.
|
|
206
|
-
- **
|
|
218
|
+
- **Caps enforcement shipped in v0.5.0.** Per-project `maxOpen` blocks `add`/move; `health.maxNotesBytes` (default 8KB) rejects oversize notes at write; the auto-injected block collapses to a lean summary over `activeMaxOpen`. See [Caps enforcement (v0.5.0)](#caps-enforcement-v050) above.
|
|
207
219
|
|
|
208
220
|
## Security
|
|
209
221
|
|