@getpipher/armory-todo 0.5.5 → 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 +31 -7
- package/docs/superpowers/plans/2026-07-29-reap-safety-protocol.md +858 -0
- package/docs/superpowers/specs/2026-07-29-reap-safety-protocol-design.md +187 -0
- package/extensions/todo.ts +22 -5
- package/package.json +2 -2
- package/src/archive.ts +1 -1
- package/src/config.ts +35 -2
- package/src/health.ts +21 -3
- package/src/index.d.ts +5 -1
- package/src/index.ts +1 -0
- package/src/panel-data.ts +26 -2
- package/src/panel.ts +22 -6
- package/src/reap.ts +90 -0
- package/src/todo-store.ts +8 -2
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` /
|
|
29
|
-
`
|
|
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
|
|
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)
|
|
@@ -230,15 +244,25 @@ Full design + decisions:
|
|
|
230
244
|
"health": { "activeMaxOpen": 15, "activeStaleDays": 30, "parkedMax": 10,
|
|
231
245
|
"parkedStaleDays": 60, "archiveMax": 200, "archiveOldDays": 180,
|
|
232
246
|
"perProjectDefaultMax": 8, "maxNotesBytes": 8192 },
|
|
233
|
-
"notify": { "sessionStartCount": true }
|
|
247
|
+
"notify": { "sessionStartCount": true },
|
|
248
|
+
"reap": {
|
|
249
|
+
"orphanFlagAfterDays": 14,
|
|
250
|
+
"policy": { "armory-fleet": { "reapAfterDays": 2, "reapTo": "cancelled" } }
|
|
251
|
+
}
|
|
234
252
|
}
|
|
235
253
|
```
|
|
236
254
|
|
|
237
255
|
| `notify.*` | default | purpose |
|
|
238
256
|
|---|---|---|
|
|
239
|
-
| `sessionStartCount` | `true` | Show the `armory-todo: N open TODOs` startup line. Set `false` to silence it — safety messages (wipe
|
|
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. |
|
|
240
264
|
|
|
241
|
-
Run the store tests: `npm test` (
|
|
265
|
+
Run the store tests: `npm test` (497/497 across 15 suites).
|
|
242
266
|
|
|
243
267
|
## Known issues
|
|
244
268
|
|