@getpipher/armory-todo 0.5.4 → 0.6.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.
package/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
  </p>
17
17
 
18
18
  <p align="center">
19
- <strong>lifecycle boxes</strong> · <strong>title + notes</strong> · <strong>auto-prune</strong> · <strong>interactive panel</strong> · <strong>health diagnostics</strong> · <strong>hard-prune gate</strong>
19
+ <strong>lifecycle boxes</strong> · <strong>title + notes</strong> · <strong>auto-prune</strong> · <strong>source-aware reap safety</strong> · <strong>interactive panel</strong> · <strong>health diagnostics</strong> · <strong>hard-prune gate</strong>
20
20
  </p>
21
21
 
22
22
  ---
@@ -25,8 +25,9 @@
25
25
 
26
26
  The package `exports` entry (`./src/index.ts`) is the **stable public surface** —
27
27
  `addTodo`, `listTodos`, `updateTodo`, `getTodo`, `completeTodo`, `parkTodo`,
28
- `deleteTodo`, and the `Todo` / `AddInput` / `UpdateInput` / `ListFilter` /
29
- `Priority` / `Status` / `Store` types (plus `TodoError`). Other `src/*` paths
28
+ `deleteTodo`, `loadStore`, `saveStore`, and the `Todo` / `AddInput` /
29
+ `UpdateInput` / `ListFilter` / `Priority` / `Status` / `Store` /
30
+ `SaveStoreOptions` types (plus `TodoError`). Other `src/*` paths
30
31
  are internal and may change without notice. Depend on `@getpipher/armory-todo`
31
32
  (the public entry), never deep-import `src/*`.
32
33
 
@@ -77,6 +78,17 @@ reports what moved (`auto-pruned N stale done (>7d): …` + a `restore` hint);
77
78
  it's a transient message, not a prompt injection. Reversible via `restore <id>`.
78
79
  `prune --all` (move fresh done too) and `prune --hard` (irreversible) stay manual.
79
80
 
81
+ **Source-aware stale-active reap (v0.6.0):** producers can leave tracked todos
82
+ `open`/`in_progress` forever when a worker dies before reporting a terminal
83
+ status. On `session_start`, armory-todo now self-heals configured producer
84
+ sources: stale `armory-fleet` todos (default: untouched for 2d) become
85
+ `cancelled` and move directly to the archive, where `restore <id>` works
86
+ immediately. Real/manual todos are never auto-mutated; non-policy active todos
87
+ untouched for 14d get an advisory `ORPHAN` health flag and ⌛ panel marker.
88
+ Both thresholds are editable in the Config tab. Expected live→archive drops
89
+ keep rolling backup, drop-snapshot, and audit protection without emitting a
90
+ false wipe alert.
91
+
80
92
  The only irreversible action is `prune --hard` (hard-prune) — it requires an
81
93
  explicit `confirm: true` and is always user-confirmed. See **Self-awareness**
82
94
  below.
@@ -87,7 +99,7 @@ below.
87
99
  ~/.pi/agent/todo/
88
100
  todo.json # active + parked
89
101
  todo-archive.json # done + cancelled (sealed history)
90
- todo.config.json # prune ages + health thresholds
102
+ todo.config.json # prune/health/reap thresholds + notify settings
91
103
  ```
92
104
 
93
105
  A v1 single-file store at `~/.pi/agent/todo.json` is migrated automatically on
@@ -206,9 +218,11 @@ Each TODO carries `id, title (≤120 chars), notes (any length), project, tags,
206
218
  - **`todo` tool** — model CRUD + lifecycle (above).
207
219
  - **`/todo` command** — human triage (above).
208
220
  - **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.
221
+ - **Source-aware safety protocol** — on `session_start`, policy-source stale actives (default `armory-fleet` >2d) move live→archive as immediately-restorable `cancelled` records. Non-policy stale actives are flagged only; never mutated. The Archive tab reports the cumulative number of auto-reaped runs.
209
222
  - **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.
210
223
 
211
224
  Full design + decisions:
225
+ - v0.6.0 (source-aware reap safety protocol): [`docs/superpowers/specs/2026-07-29-reap-safety-protocol-design.md`](docs/superpowers/specs/2026-07-29-reap-safety-protocol-design.md)
212
226
  - v0.4.0 (project-scope management): [`docs/superpowers/specs/2026-07-21-project-scope-management-design.md`](docs/superpowers/specs/2026-07-21-project-scope-management-design.md)
213
227
  - v0.3.1 (auto-prune + unified Done view): [`docs/superpowers/specs/2026-07-21-auto-prune-done-view-design.md`](docs/superpowers/specs/2026-07-21-auto-prune-done-view-design.md)
214
228
  - v0.3.0 (title + notes split): [`docs/superpowers/specs/2026-07-21-title-notes-split-design.md`](docs/superpowers/specs/2026-07-21-title-notes-split-design.md)
@@ -221,7 +235,34 @@ Full design + decisions:
221
235
  |---|---|---|
222
236
  | `TODO_DIR` | `~/.pi/agent/todo/` | override the store folder (tests / multiple profiles) |
223
237
 
224
- Run the store tests: `npm test` (315/315 across 11 suites).
238
+ `todo.config.json` (in `TODO_DIR`) holds prune ages, health thresholds, and notify toggles. All values are optional — missing fields are merged with defaults on load.
239
+
240
+ ```jsonc
241
+ {
242
+ "version": 1,
243
+ "prune": { "defaultAgeDays": 7, "hardAgeDays": 180, "statuses": ["done", "cancelled"] },
244
+ "health": { "activeMaxOpen": 15, "activeStaleDays": 30, "parkedMax": 10,
245
+ "parkedStaleDays": 60, "archiveMax": 200, "archiveOldDays": 180,
246
+ "perProjectDefaultMax": 8, "maxNotesBytes": 8192 },
247
+ "notify": { "sessionStartCount": true },
248
+ "reap": {
249
+ "orphanFlagAfterDays": 14,
250
+ "policy": { "armory-fleet": { "reapAfterDays": 2, "reapTo": "cancelled" } }
251
+ }
252
+ }
253
+ ```
254
+
255
+ | `notify.*` | default | purpose |
256
+ |---|---|---|
257
+ | `sessionStartCount` | `true` | Show the `armory-todo: N open TODOs` startup line. Set `false` to silence it — safety messages (wipe recovery, auto-prune, reap) still surface. |
258
+
259
+ | `reap.*` | default | purpose |
260
+ |---|---:|---|
261
+ | `orphanFlagAfterDays` | `14` | Advisory ORPHAN threshold for active todos whose source is not auto-reaped; never mutates them. |
262
+ | `policy.armory-fleet.reapAfterDays` | `2` | Move stale fleet-tracked active todos directly to archive as cancelled. |
263
+ | `policy.armory-fleet.reapTo` | `cancelled` | Fixed reversible terminal status; `done` is intentionally unsupported. |
264
+
265
+ Run the store tests: `npm test` (497/497 across 15 suites).
225
266
 
226
267
  ## Known issues
227
268