artshelf 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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,103 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ - Added a user-level ledger registry plus `--all` review commands so Artshelf can
6
+ discover known project/user ledgers from one CLI entry point.
7
+ - Added read-only `find` and `get` commands for ledger lookup and idempotent
8
+ agent integrations.
9
+ - Documented `find` / `get` as the lookup surface agents should use before
10
+ creating duplicate records with `put`.
11
+ - Tightened portable agent trigger guidance and removed setup-specific docs so
12
+ Artshelf remains workflow-agnostic.
13
+ - Added `pnpm docs:serve` for local static docs preview.
14
+ - Changed cleanup dry-run to avoid writing plan files when there are no
15
+ executable cleanup entries, and registered Artshelf-created plans/receipts as
16
+ Artshelf-owned ledger artifacts.
17
+ - Reuse unchanged cleanup dry-run plans by refreshing the existing plan timestamp
18
+ and Artshelf-owned plan record instead of creating duplicate plan files.
19
+ - Added a read-only `artshelf doctor` command that reports CLI and runtime version,
20
+ the selected/default ledger path, selected/global registry path,
21
+ registered-ledger health (stale or invalid entries), and the cleanup safety
22
+ posture, exiting non-zero when the registry or a registered ledger is broken.
23
+ - Added a read-only `artshelf status` dashboard: single-ledger mode reports
24
+ selected-ledger counts, while `--all` adds registry health, total ledgers, and
25
+ aggregated active, kept, due, manual-review, missing-path, and pending-cleanup
26
+ counts, with `--all --json` suited to cron and human output short enough to
27
+ paste into a chat.
28
+ - Changed `artshelf ledgers list` to validate each registered ledger by default,
29
+ reporting ok/missing/invalid status, entry counts, and warning/error counts in
30
+ both human and JSON output and exiting non-zero when the registry or any
31
+ registered ledger is broken, so agents can detect stale registry entries
32
+ without a separate validate pass. Added `--plain` for the backward-compatible
33
+ fast path that lists registered ledgers without reading them.
34
+ - Changed `artshelf review --all` to emit an aggregate triage summary alongside the
35
+ existing per-ledger detail: JSON gains a `summary` block (affected ledgers,
36
+ due, manual-review, missing-path, executable, skipped counts, and plan ids) and
37
+ human output adds a triage line plus the next safe action. Review stays
38
+ read-only and never writes cleanup plans.
39
+ - Added approval-first `artshelf trash list` and `artshelf trash purge` commands for
40
+ reviewing quarantined trash and physically deleting it only from a reviewed,
41
+ ledger-scoped purge plan.
42
+ - Changed ledger validation to require cleanup metadata on trashed records and
43
+ warn when a trashed target path is missing.
44
+ - Hardened trash purge execution with ledger-local path checks, durable failure
45
+ receipts, interrupted-run resume, and refusal of completed purge receipts.
46
+ - Reorganized the README and docs quickstart to lead with the approval-first
47
+ workflows — register a temp artifact, review everything safely, approve
48
+ cleanup safely, and purge old trash explicitly — keeping reference material
49
+ available below the lead.
50
+ - Tightened the portable agent skill description so the completion-gate trigger
51
+ is visible before final responses, status updates, handoffs, and done reports.
52
+
53
+ ## [0.3.0](https://github.com/calvinnwq/artshelf/compare/artshelf-v0.2.0...artshelf-v0.3.0) (2026-06-05)
54
+
55
+
56
+ ### Features
57
+
58
+ * **cli:** add approval-first trash list and purge workflow ([20405db](https://github.com/calvinnwq/artshelf/commit/20405db8a7856440afe6aaf487cc156e6c66245d))
59
+ * **cli:** add approval-first trash list and purge workflow ([5a389f3](https://github.com/calvinnwq/artshelf/commit/5a389f3e4f18c75973f29dc727969063e3b3f54b))
60
+
61
+
62
+ ### Bug Fixes
63
+
64
+ * **trash:** harden purge execution guardrails ([e569b1b](https://github.com/calvinnwq/artshelf/commit/e569b1be4a4f931f856fa9683afcb14023724ad9))
65
+
66
+ ## [0.2.0](https://github.com/calvinnwq/artshelf/compare/artshelf-v0.1.0...artshelf-v0.2.0) (2026-06-04)
67
+
68
+
69
+ ### Features
70
+
71
+ * **cli:** add ledger registry review ([0cbdcc6](https://github.com/calvinnwq/artshelf/commit/0cbdcc6c1c1706b78e84a738fd8dfef900459045))
72
+ * **cli:** add ledger registry review ([d070131](https://github.com/calvinnwq/artshelf/commit/d0701317514f36ee266ca06c30b4ee67a6e45e42))
73
+ * **cli:** add read-only `artshelf doctor` health command ([0ce18ea](https://github.com/calvinnwq/artshelf/commit/0ce18ea560ae7f870ea68b7248d097f4c7033b91))
74
+ * **cli:** add read-only `artshelf status` dashboard command ([699035c](https://github.com/calvinnwq/artshelf/commit/699035c97009cb29caa0c995025a2d74533e21f1))
75
+ * **cli:** add artshelf doctor and status commands ([c0f9a10](https://github.com/calvinnwq/artshelf/commit/c0f9a109cee58de7d7e8cf27e3860fee62941686))
76
+ * **cli:** add artshelf lookup commands ([9092ea7](https://github.com/calvinnwq/artshelf/commit/9092ea72695b6b383a8ff3b74ccaabc2974e67fb))
77
+ * **cli:** improve artshelf review triage and ledger listing ([6dc3c65](https://github.com/calvinnwq/artshelf/commit/6dc3c65e6837e542510d53890f1f49d3a28e0878))
78
+ * **cli:** optimize cleanup plan lifecycle ([f78773c](https://github.com/calvinnwq/artshelf/commit/f78773ca737b9d7a8318725d63590c9ed8184ba5))
79
+ * **cli:** resolve artshelf records ([f21318d](https://github.com/calvinnwq/artshelf/commit/f21318d6edd16a170fcb6539c40899ec8b83c1ba))
80
+ * **cli:** summarize all-ledger review triage ([3284bd8](https://github.com/calvinnwq/artshelf/commit/3284bd886998777bd06a681ab3bfe0b819938c84))
81
+ * **cli:** validate registered ledgers in ledgers list ([327e4f8](https://github.com/calvinnwq/artshelf/commit/327e4f815c814c6b540fcbae8b42dbd8873fb4ab))
82
+ * optimize cleanup plan lifecycle ([4d77b2b](https://github.com/calvinnwq/artshelf/commit/4d77b2bed4a7bc963d2e9900a4dbbf3fed672514))
83
+ * resolve artshelf records ([dcd5109](https://github.com/calvinnwq/artshelf/commit/dcd5109c5a73f5080d89db51f375b9a5e307c65b))
84
+ * update ledger state after cleanup ([#7](https://github.com/calvinnwq/artshelf/issues/7)) ([31add84](https://github.com/calvinnwq/artshelf/commit/31add8466f0e37e397cfaf3dc146bd8060f57717))
85
+
86
+
87
+ ### Bug Fixes
88
+
89
+ * clarify approval-only cleanup safety model ([20b8258](https://github.com/calvinnwq/artshelf/commit/20b82584e86a0a8f9b4067d2fbdc94d2c8064253))
90
+ * **cli:** align cleanup preview reuse ([b918a5d](https://github.com/calvinnwq/artshelf/commit/b918a5dc09536a9b87964fbf552b66ea16c0c62a))
91
+ * **cli:** harden registry diagnostics ([098f88e](https://github.com/calvinnwq/artshelf/commit/098f88e9ec8167333cb4d8f67876054b1076f922))
92
+ * **cli:** keep artshelf review read-only ([8c417c2](https://github.com/calvinnwq/artshelf/commit/8c417c2e5737ee778c6f7a86b0c7e559d3cae7dc))
93
+ * **cli:** normalize review no-plan output ([57a6275](https://github.com/calvinnwq/artshelf/commit/57a6275b5960385102e8e4c54cfa498404df562d))
94
+ * **cli:** report stale ledgers in all-mode reads ([bc035ef](https://github.com/calvinnwq/artshelf/commit/bc035efbc15ba7877634cb7ec6c0702416d8510b))
95
+
96
+ ## 0.1.0 - 2026-06-01
97
+
98
+ - Initial Artshelf CLI MVP.
99
+ - Added JSONL ledger writes, `put`, `list`, `due`, `validate`, cleanup dry-run
100
+ plans, plan-id-based cleanup execution, `list --status`, and manual `resolve`.
101
+ - Added Node test coverage and public-ready repository bootstrap.
102
+ - Added GitHub Pages docs, source-install instructions, packaged agent skill,
103
+ and scheduled-review guidance for agents.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Calvin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,282 @@
1
+ # Artshelf
2
+
3
+ Artshelf is a tiny CLI for putting temporary artifacts, backups, and run outputs
4
+ somewhere accountable, with an expiry tag and a cleanup plan.
5
+
6
+ It is built for agent-heavy workflows where files and directories are often
7
+ created in `tmp/`, repo folders, or backup locations and then forgotten. Artshelf
8
+ records why an artifact exists at creation time, then makes later cleanup
9
+ visible and reviewable.
10
+
11
+ Artshelf centers on four approval-first workflows: **register a temp artifact** the
12
+ moment it is created, **review everything safely** before anything moves,
13
+ **approve cleanup safely** from a reviewed plan, and **purge old trash
14
+ explicitly** from a separate reviewed plan. The reference sections further down
15
+ stay out of the way until you need them.
16
+
17
+ ## Status
18
+
19
+ Artshelf is an early v1 MVP. The CLI is being prepared for npm distribution
20
+ under the unscoped `artshelf` package name. The existing local/source install
21
+ path remains supported as a fallback while npm publishing is wired up.
22
+
23
+ ## Install
24
+
25
+ Use the npm package once it is published:
26
+
27
+ ```bash
28
+ npm install -g artshelf
29
+ artshelf --version
30
+ artshelf doctor
31
+ ```
32
+
33
+ With pnpm:
34
+
35
+ ```bash
36
+ pnpm add -g artshelf
37
+ artshelf --version
38
+ artshelf doctor
39
+ ```
40
+
41
+ Source install remains the fallback path: clone the repo, build it, and link the
42
+ CLI with `npm link`.
43
+
44
+ ```bash
45
+ git clone https://github.com/calvinnwq/artshelf.git
46
+ cd artshelf
47
+ corepack enable
48
+ pnpm install --frozen-lockfile
49
+ pnpm run build
50
+ npm link
51
+ artshelf --version
52
+ artshelf doctor
53
+ ```
54
+
55
+ To remove the linked command later:
56
+
57
+ ```bash
58
+ npm uninstall -g artshelf
59
+ npm unlink -g artshelf
60
+ ```
61
+
62
+ ## Core Workflows
63
+
64
+ Artshelf is built around four approval-first workflows. Start here; the reference
65
+ sections below are there when you need them, not before.
66
+
67
+ ### 1. Register a temp artifact
68
+
69
+ Record an artifact the moment it is created, while the reason is still fresh:
70
+
71
+ ```bash
72
+ artshelf put tmp/run-output --reason "debug parser output" --ttl 3d --kind scratch --cleanup trash
73
+ ```
74
+
75
+ Artshelf returns an id. Capture it anywhere future cleanup context matters.
76
+
77
+ ### 2. Review everything safely
78
+
79
+ Inspect the ledger and preview cleanup without moving anything:
80
+
81
+ ```bash
82
+ artshelf list
83
+ artshelf status
84
+ artshelf due
85
+ artshelf cleanup --dry-run
86
+ ```
87
+
88
+ Because this example keeps the artifact for three days, an immediate dry-run
89
+ reports `not-created` and writes no plan. A dry-run returns a real plan id only
90
+ after `due` shows cleanup entries.
91
+
92
+ ### 3. Approve cleanup safely
93
+
94
+ Execute only from a reviewed plan id, and only after a human approves it:
95
+
96
+ ```bash
97
+ artshelf cleanup --execute --plan-id plan_20260601_120000_ab12
98
+ ```
99
+
100
+ There is no auto-execute, no global execute, and no fresh-plan-then-execute
101
+ shortcut. Execution writes a receipt and updates the touched ledger records.
102
+
103
+ ### 4. Purge old trash explicitly
104
+
105
+ Cleanup execution with `cleanup=trash` moves artifacts into Artshelf's local trash
106
+ folder. Those trashed records remain discoverable (`artshelf trash list`) for review
107
+ and should only be physically removed through a separately reviewed trash purge
108
+ plan:
109
+
110
+ ```bash
111
+ artshelf trash purge --older-than 30d --dry-run --json
112
+ artshelf trash purge --execute --plan-id purge_20260601_120000_ab12
113
+ ```
114
+
115
+ This adds a separate approval boundary between quarantine and destructive deletion.
116
+
117
+ ## Explicit Ledgers
118
+
119
+ By default, Artshelf writes repo-local `.shelf/ledger.jsonl` inside a git repo and
120
+ `~/.shelf/ledger.jsonl` outside one. Use `--ledger <path>` and an isolated
121
+ `--registry <path>` for tests, demos, and unusual workflows:
122
+
123
+ ```bash
124
+ artshelf put /tmp/parser-output --reason "parser fixture" --ttl 1d --ledger /tmp/artshelf-ledger.jsonl --registry /tmp/artshelf-registry.json --json
125
+ artshelf list --ledger /tmp/artshelf-ledger.jsonl
126
+ ```
127
+
128
+ Artshelf also keeps a small global registry of known ledgers at
129
+ `~/.shelf/ledgers.json`. Override it with `--registry <path>` or
130
+ `ARTSHELF_REGISTRY`. `put` registers its ledger automatically, and you can register
131
+ an existing ledger explicitly:
132
+
133
+ ```bash
134
+ artshelf ledgers list
135
+ artshelf ledgers add --ledger /path/to/repo/.shelf/ledger.jsonl --name my-repo
136
+ ```
137
+
138
+ `artshelf ledgers list` validates each registered ledger by default — reporting
139
+ ok/missing/invalid status with entry counts, and exiting non-zero when the
140
+ registry or any ledger is broken — so it doubles as a stale-entry check. Add
141
+ `--plain` for the fast listing that skips validation.
142
+
143
+ Use `--all` for one read-only discovery entry point across registered ledgers:
144
+
145
+ ```bash
146
+ artshelf review --all --json
147
+ artshelf status --all --json
148
+ artshelf due --all --json
149
+ artshelf trash list --all --json
150
+ artshelf find --all --owner <agent-or-runtime> --json
151
+ ```
152
+
153
+ `artshelf review --all` adds an aggregate triage summary (affected ledgers, due,
154
+ manual-review, missing-path, executable, and skipped counts plus preview plan
155
+ ids) and states the next safe action, while staying read-only.
156
+
157
+ Use global dry-run cleanup when you want Artshelf to write cleanup plans for
158
+ registered ledgers with cleanup entries, without moving files:
159
+
160
+ ```bash
161
+ artshelf cleanup --dry-run --all --json
162
+ ```
163
+
164
+ Global execution is intentionally refused. To mutate files, review a dry-run
165
+ plan, then execute it against the specific ledger that produced it.
166
+ Repeated dry-runs with the same executable cleanup entries reuse the existing
167
+ plan id and refresh its timestamp instead of creating duplicate plan files.
168
+
169
+ ## Safety Model
170
+
171
+ - Ledger-first, not filesystem-scan-first.
172
+ - Dry-run before mutation.
173
+ - Execute only from a reviewed plan id.
174
+ - No daemon or auto-execute path.
175
+ - No global execute; cleanup execute and trash purge refuse `--all`.
176
+ `--all` is read-only or dry-run reporting only.
177
+ - No fresh-plan-then-execute shortcut.
178
+ - Trash/review by default, not delete.
179
+ - No silent deletion; `cleanup=delete` stays refused, and trash purge needs its own reviewed plan.
180
+ - Agent-friendly JSON output from every command.
181
+ - Small enough to actually use.
182
+
183
+ V1 only moves `cleanup=trash` entries into Artshelf's local trash folder. Entries
184
+ marked `cleanup=review` become `review-required`, and `cleanup=delete` is
185
+ refused as `cleanup-refused`; physical deletion only happens through a separate
186
+ reviewed `artshelf trash purge --execute` plan.
187
+
188
+ Dry-run cleanup writes a plan only when there are executable cleanup entries.
189
+ No-op dry-runs report `not-created` and avoid writing plan files. When Artshelf does
190
+ write a plan, it also records that plan in the ledger as an Artshelf-owned artifact.
191
+
192
+ After `cleanup --execute`, Artshelf writes a receipt, records the receipt as a
193
+ Artshelf-owned artifact, and updates touched ledger records. Handled records stop
194
+ appearing in `due` and future dry-run cleanup plans, while `artshelf list` still
195
+ keeps the audit trail visible.
196
+
197
+ ## Commands
198
+
199
+ ```bash
200
+ artshelf put <path> --reason "debug parser output" --ttl 3d --kind scratch
201
+ artshelf ledgers list
202
+ artshelf ledgers list --plain
203
+ artshelf ledgers add --ledger <path>
204
+ artshelf list
205
+ artshelf list --all
206
+ artshelf list --status active
207
+ artshelf find --path <path> --owner <agent-or-runtime> --label <task-or-run-id>
208
+ artshelf find --all --owner <agent-or-runtime>
209
+ artshelf get <id>
210
+ artshelf get <id> --all
211
+ artshelf due
212
+ artshelf due --all
213
+ artshelf validate
214
+ artshelf validate --all
215
+ artshelf review
216
+ artshelf review --all
217
+ artshelf doctor
218
+ artshelf status
219
+ artshelf status --all
220
+ artshelf cleanup --dry-run
221
+ artshelf cleanup --dry-run --all
222
+ artshelf cleanup --execute --plan-id <id>
223
+ artshelf trash list [--all] [--ledger <path>] [--json]
224
+ artshelf trash purge --older-than <ttl> --dry-run [--ledger <path>] [--json]
225
+ artshelf trash purge --execute --plan-id <id> [--ledger <path>] [--json]
226
+ artshelf resolve <id> --status resolved --reason "inspected and no longer needed"
227
+ ```
228
+
229
+ Use `artshelf help` or `artshelf help <command>` for command details. All core
230
+ commands support `--json`.
231
+
232
+ See the [docs site](https://calvinnwq.github.io/artshelf/) for install,
233
+ quickstart, agent usage, and CLI reference. The source repo also keeps the
234
+ [v1 spec](SPEC.md) and [agent usage guide](docs/agent-usage.md).
235
+
236
+ ## Agent Skill
237
+
238
+ The package includes an agent-facing skill at `skills/artshelf/SKILL.md`. Agents
239
+ that support local skills can copy or reference this file to learn when to call
240
+ `artshelf put`, how to report Artshelf ids in handoffs and issue comments, why
241
+ `artshelf find` / `artshelf get` are the read-only idempotency lookup surface, why
242
+ `cleanup --execute` requires explicit approval for a reviewed plan id, how to
243
+ review trashed records with `artshelf trash list` before a separately approved trash
244
+ purge, and when `artshelf resolve <id> --status resolved --reason <text>` may mark
245
+ confirmed handled, missing, or no-longer-needed records without moving or
246
+ deleting files.
247
+
248
+ From a source checkout, use `skills/artshelf/SKILL.md` directly. Agents should ask
249
+ where the user wants Artshelf cloned before installing or linking it. Package-manager
250
+ distribution for agent skills can come later.
251
+
252
+ ## Development
253
+
254
+ ```bash
255
+ pnpm install
256
+ pnpm check
257
+ ```
258
+
259
+ Preview the static docs site locally:
260
+
261
+ ```bash
262
+ pnpm docs:serve
263
+ ```
264
+
265
+ Then open <http://127.0.0.1:8080/>.
266
+
267
+ During tests or one-off runs, pass both `--ledger <path>` and `--registry <path>`
268
+ to keep entries and registry updates out of default Artshelf storage.
269
+
270
+ ## Contributing
271
+
272
+ Artshelf is small on purpose. Keep new behavior ledger-first, previewable, and
273
+ covered by tests. See [CONTRIBUTING.md](CONTRIBUTING.md).
274
+
275
+ ## Support And Security
276
+
277
+ Use GitHub issues for bugs and feature ideas once the public remote exists. See
278
+ [SUPPORT.md](SUPPORT.md) and [SECURITY.md](SECURITY.md).
279
+
280
+ ## License
281
+
282
+ MIT. See [LICENSE](LICENSE).