artshelf 0.7.0 → 0.8.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 +11 -2
- package/README.md +144 -245
- package/SPEC.md +48 -0
- package/dist/src/cli.js +258 -19
- package/docs/agent-clean.html +6 -24
- package/docs/agent-monitor.html +1 -0
- package/docs/agent-purge.html +111 -0
- package/docs/agent-usage.html +13 -9
- package/docs/agent-usage.md +12 -7
- package/docs/index.html +9 -4
- package/docs/install.html +28 -2
- package/docs/reference.html +27 -2
- package/docs/site.js +2 -1
- package/package.json +1 -1
- package/skills/artshelf/SKILL.md +16 -13
package/docs/index.html
CHANGED
|
@@ -63,7 +63,7 @@ artshelf review --json</code></pre>
|
|
|
63
63
|
<section>
|
|
64
64
|
<h2>The loop</h2>
|
|
65
65
|
<p>
|
|
66
|
-
Everything in Artshelf follows
|
|
66
|
+
Everything in Artshelf follows five stages: Create, Monitor, Review, Clean, Purge.
|
|
67
67
|
The agent docs use the same names, and each stage links to its page.
|
|
68
68
|
</p>
|
|
69
69
|
<div class="ledger">
|
|
@@ -75,7 +75,7 @@ artshelf review --json</code></pre>
|
|
|
75
75
|
<a class="ledger-row" href="agent-monitor.html">
|
|
76
76
|
<span class="n">4.2</span>
|
|
77
77
|
<span class="stage">Monitor</span>
|
|
78
|
-
<span class="what"><span class="cmdline">artshelf review --all --json</span>Check the shelf on a schedule. Monitor commands
|
|
78
|
+
<span class="what"><span class="cmdline">artshelf review --all --json</span>Check the shelf on a schedule. Monitor commands do not mutate ledgers or artifacts, so agents and cron jobs can run them safely.</span>
|
|
79
79
|
</a>
|
|
80
80
|
<a class="ledger-row" href="agent-review.html">
|
|
81
81
|
<span class="n">4.3</span>
|
|
@@ -85,7 +85,12 @@ artshelf review --json</code></pre>
|
|
|
85
85
|
<a class="ledger-row" href="agent-clean.html">
|
|
86
86
|
<span class="n">4.4</span>
|
|
87
87
|
<span class="stage">Clean</span>
|
|
88
|
-
<span class="what"><span class="cmdline">artshelf cleanup --execute --plan-id <id></span>Run the one plan the human approved
|
|
88
|
+
<span class="what"><span class="cmdline">artshelf cleanup --execute --plan-id <id></span>Run the one plan the human approved. Artshelf trashes the file, writes receipts, and a follow-up review confirms the shelf is quiet.</span>
|
|
89
|
+
</a>
|
|
90
|
+
<a class="ledger-row" href="agent-purge.html">
|
|
91
|
+
<span class="n">4.5</span>
|
|
92
|
+
<span class="stage">Purge</span>
|
|
93
|
+
<span class="what"><span class="cmdline">artshelf trash purge --execute --plan-id <id></span>Permanently remove old trashed artifacts through a separate, separately reviewed purge plan. Physical deletion never piggybacks on the cleanup plan.</span>
|
|
89
94
|
</a>
|
|
90
95
|
</div>
|
|
91
96
|
</section>
|
|
@@ -164,7 +169,7 @@ artshelf review --all --json</code></pre>
|
|
|
164
169
|
<ul>
|
|
165
170
|
<li><a href="install.html">Install</a>: get the CLI from npm and check it with <code>artshelf doctor</code>.</li>
|
|
166
171
|
<li><a href="quickstart.html">Quickstart</a>: walk one real artifact through the whole loop in five minutes.</li>
|
|
167
|
-
<li><a href="agent-usage.html">Agent usage</a>: the Create, Monitor, Review, Clean contract for coding agents.</li>
|
|
172
|
+
<li><a href="agent-usage.html">Agent usage</a>: the Create, Monitor, Review, Clean, Purge contract for coding agents.</li>
|
|
168
173
|
<li><a href="reference.html">CLI reference</a>: every command on one page.</li>
|
|
169
174
|
</ul>
|
|
170
175
|
</section>
|
package/docs/install.html
CHANGED
|
@@ -69,13 +69,26 @@ npm link
|
|
|
69
69
|
|
|
70
70
|
<span class="c"># verify whichever you picked</span>
|
|
71
71
|
artshelf --version
|
|
72
|
-
artshelf doctor
|
|
72
|
+
artshelf doctor
|
|
73
|
+
|
|
74
|
+
<span class="c"># later, for npm installs only</span>
|
|
75
|
+
artshelf update</code></pre>
|
|
73
76
|
<p>
|
|
74
77
|
<code>npm link</code> connects the local checkout to your global npm bin, so
|
|
75
78
|
later rebuilds update the <code>artshelf</code> command. To remove an npm
|
|
76
79
|
install, run <code>npm uninstall -g artshelf</code>; for a source install,
|
|
77
80
|
run <code>npm unlink -g artshelf</code>.
|
|
78
81
|
</p>
|
|
82
|
+
<p>
|
|
83
|
+
Artshelf checks npm occasionally and prints update notices to stderr, so
|
|
84
|
+
scripted JSON output stays clean. <code>artshelf update</code> is for npm
|
|
85
|
+
global installs only and runs <code>npm install -g artshelf@latest</code>.
|
|
86
|
+
pnpm global installs should update with
|
|
87
|
+
<code>pnpm add -g artshelf@latest</code>; source installs should update
|
|
88
|
+
by pulling, rebuilding, and linking again. Set
|
|
89
|
+
<code>ARTSHELF_NO_UPDATE_CHECK=1</code> for scheduled jobs that must
|
|
90
|
+
avoid network and update-cache writes.
|
|
91
|
+
</p>
|
|
79
92
|
</section>
|
|
80
93
|
|
|
81
94
|
<section>
|
|
@@ -127,6 +140,18 @@ artshelf --version
|
|
|
127
140
|
artshelf doctor
|
|
128
141
|
```
|
|
129
142
|
|
|
143
|
+
If Artshelf says a newer version is available and you used npm, update the npm
|
|
144
|
+
install and verify again:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
artshelf update
|
|
148
|
+
artshelf --version
|
|
149
|
+
artshelf doctor
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
If you used pnpm, update with `pnpm add -g artshelf@latest` instead.
|
|
153
|
+
For source installs, pull, rebuild, and run `npm link` again.
|
|
154
|
+
|
|
130
155
|
Only use a source install when the user asks for one, and ask the user where
|
|
131
156
|
to clone the repo first instead of assuming a repo path:
|
|
132
157
|
|
|
@@ -176,9 +201,10 @@ artshelf ledgers list --json
|
|
|
176
201
|
|
|
177
202
|
Ask the user whether they want a scheduled review job before creating one.
|
|
178
203
|
If they approve, schedule a read-only review job (daily works well) in your
|
|
179
|
-
host runtime that runs:
|
|
204
|
+
host runtime that disables update checks and runs:
|
|
180
205
|
|
|
181
206
|
```bash
|
|
207
|
+
ARTSHELF_NO_UPDATE_CHECK=1 \
|
|
182
208
|
artshelf review --all --json
|
|
183
209
|
```
|
|
184
210
|
|
package/docs/reference.html
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
Artshelf v1 keeps the API narrow: put entries in a ledger, query existing
|
|
41
41
|
records, write a cleanup plan, and use separate reviewed plan ids for
|
|
42
42
|
cleanup execution and trash purge. Every command below is tagged read-only,
|
|
43
|
-
writes ledger, writes registry, or approval-gated.
|
|
43
|
+
writes ledger, writes registry, npm install, or approval-gated.
|
|
44
44
|
</p>
|
|
45
45
|
|
|
46
46
|
<section class="cmd">
|
|
@@ -129,6 +129,24 @@ artshelf doctor [--json]</code></pre>
|
|
|
129
129
|
</p>
|
|
130
130
|
</section>
|
|
131
131
|
|
|
132
|
+
<section class="cmd">
|
|
133
|
+
<div class="cmd-head"><h2>artshelf update</h2><span class="cmd-flag plan">npm install</span></div>
|
|
134
|
+
<pre><code><span class="c"># install the latest published npm package</span>
|
|
135
|
+
artshelf update [--json]</code></pre>
|
|
136
|
+
<p>
|
|
137
|
+
Normal commands may print a non-blocking notice to stderr when npm has a
|
|
138
|
+
newer published version. <code>artshelf update</code> runs
|
|
139
|
+
<code>npm install -g artshelf@latest</code> and is for npm global installs
|
|
140
|
+
only. pnpm global installs should update with
|
|
141
|
+
<code>pnpm add -g artshelf@latest</code>. Source installs should update by
|
|
142
|
+
pulling, rebuilding, and linking the checkout. Notices are cached in
|
|
143
|
+
<code>~/.artshelf/update-check.json</code>; set
|
|
144
|
+
<code>ARTSHELF_NO_UPDATE_CHECK=1</code> to disable automatic checks for
|
|
145
|
+
no-network scripts and scheduled jobs. Read-only command labels refer
|
|
146
|
+
to ledger and artifact mutation, not this optional update-check cache.
|
|
147
|
+
</p>
|
|
148
|
+
</section>
|
|
149
|
+
|
|
132
150
|
<section class="cmd">
|
|
133
151
|
<div class="cmd-head"><h2>artshelf cleanup</h2><span class="cmd-flag approval">approval-gated</span></div>
|
|
134
152
|
<pre><code><span class="c"># preview cleanup and register a reviewed plan</span>
|
|
@@ -184,6 +202,12 @@ artshelf trash purge --execute --plan-id <id> [--ledger <path>] [--j
|
|
|
184
202
|
<tr><td>--json</td><td>emit machine-readable JSON</td></tr>
|
|
185
203
|
<tr><td>ARTSHELF_REGISTRY</td><td>override the default ledger registry path</td></tr>
|
|
186
204
|
<tr><td>ARTSHELF_NOW</td><td>override current time for retention and due calculations</td></tr>
|
|
205
|
+
<tr><td>ARTSHELF_NO_UPDATE_CHECK=1</td><td>disable automatic npm update checks</td></tr>
|
|
206
|
+
<tr><td>ARTSHELF_UPDATE_CACHE</td><td>override the update-check cache path</td></tr>
|
|
207
|
+
<tr><td>ARTSHELF_UPDATE_CHECK_TTL_MS</td><td>override the update-check cache TTL</td></tr>
|
|
208
|
+
<tr><td>ARTSHELF_NPM_REGISTRY_URL</td><td>override the npm latest-version endpoint</td></tr>
|
|
209
|
+
<tr><td>ARTSHELF_UPDATE_DRY_RUN=1</td><td>print the npm update command without running it</td></tr>
|
|
210
|
+
<tr><td>ARTSHELF_LATEST_VERSION</td><td>override the latest-version value for tests</td></tr>
|
|
187
211
|
</table>
|
|
188
212
|
</section>
|
|
189
213
|
|
|
@@ -208,7 +232,8 @@ artshelf trash purge --execute --plan-id <id> [--ledger <path>] [--j
|
|
|
208
232
|
repo it defaults to <code>~/.artshelf/ledger.jsonl</code>. A user-level registry at
|
|
209
233
|
<code>~/.artshelf/ledgers.json</code> is the discovery index for <code>--all</code>
|
|
210
234
|
review, status, cleanup dry-run, and trash-list; project records stay in their own
|
|
211
|
-
repo-local ledgers.
|
|
235
|
+
repo-local ledgers. Automatic update checks cache their last npm result at
|
|
236
|
+
<code>~/.artshelf/update-check.json</code> by default.
|
|
212
237
|
</p>
|
|
213
238
|
<div class="callout" data-kind="boundary">
|
|
214
239
|
<span class="callout-label">Hard boundary</span>
|
package/docs/site.js
CHANGED
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
{ n: "4.1", t: "Create", h: "agent-create.html" },
|
|
21
21
|
{ n: "4.2", t: "Monitor", h: "agent-monitor.html" },
|
|
22
22
|
{ n: "4.3", t: "Review", h: "agent-review.html" },
|
|
23
|
-
{ n: "4.4", t: "Clean", h: "agent-clean.html" }
|
|
23
|
+
{ n: "4.4", t: "Clean", h: "agent-clean.html" },
|
|
24
|
+
{ n: "4.5", t: "Purge", h: "agent-purge.html" }
|
|
24
25
|
]
|
|
25
26
|
},
|
|
26
27
|
{ t: "Agent skill", h: "https://github.com/calvinnwq/artshelf/tree/main/skills/artshelf", ext: true }
|
package/package.json
CHANGED
package/skills/artshelf/SKILL.md
CHANGED
|
@@ -34,7 +34,6 @@ Check for the CLI first:
|
|
|
34
34
|
```bash
|
|
35
35
|
artshelf --version
|
|
36
36
|
artshelf doctor
|
|
37
|
-
artshelf help put
|
|
38
37
|
```
|
|
39
38
|
|
|
40
39
|
If missing, install from npm when appropriate:
|
|
@@ -44,6 +43,9 @@ npm install -g artshelf
|
|
|
44
43
|
artshelf doctor
|
|
45
44
|
```
|
|
46
45
|
|
|
46
|
+
Update npm globals with `artshelf update` when a notice appears; use
|
|
47
|
+
`pnpm add -g artshelf@latest` for pnpm or pull/rebuild/`npm link` for source.
|
|
48
|
+
|
|
47
49
|
For source installs, ask where to clone the repo. Do not hard-code a personal
|
|
48
50
|
repo path or create a custom shim.
|
|
49
51
|
|
|
@@ -58,8 +60,7 @@ artshelf doctor
|
|
|
58
60
|
```
|
|
59
61
|
|
|
60
62
|
Install, copy, or reference this portable skill only after the user chooses the
|
|
61
|
-
integration path. Offer to schedule read-only review job delivery in the host
|
|
62
|
-
runtime.
|
|
63
|
+
integration path. Offer to schedule read-only review job delivery in the host runtime.
|
|
63
64
|
|
|
64
65
|
## Create
|
|
65
66
|
|
|
@@ -109,8 +110,8 @@ artshelf ledgers add --ledger <repo>/.artshelf/ledger.jsonl --name <project> --s
|
|
|
109
110
|
|
|
110
111
|
### Scheduled Review
|
|
111
112
|
|
|
112
|
-
Scheduled jobs are review/report only.
|
|
113
|
-
|
|
113
|
+
Scheduled jobs are review/report only. Set `ARTSHELF_NO_UPDATE_CHECK=1` for no
|
|
114
|
+
npm network/cache writes. Reports should name the ledger path and plan ids. They may run:
|
|
114
115
|
|
|
115
116
|
```bash
|
|
116
117
|
artshelf validate --json
|
|
@@ -205,7 +206,7 @@ approve artshelf resolve missing ledger <ledger-path> ids <id...>
|
|
|
205
206
|
```
|
|
206
207
|
|
|
207
208
|
Never execute from a read-only preview id. Never generate a fresh plan and
|
|
208
|
-
execute it in the same step. After
|
|
209
|
+
execute it in the same step. After cleanup or resolve approval, verify with `artshelf review --all --json`; after trash purge approval, also run `artshelf trash list --all --json`.
|
|
209
210
|
|
|
210
211
|
## Clean
|
|
211
212
|
|
|
@@ -226,13 +227,8 @@ Cleanup execution requires approval naming the reviewed ledger and plan id:
|
|
|
226
227
|
artshelf cleanup --execute --plan-id <id> --ledger <ledger-path> --json
|
|
227
228
|
```
|
|
228
229
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
artshelf trash list --ledger <ledger-path> --json
|
|
233
|
-
artshelf trash purge --older-than 7d --dry-run --ledger <ledger-path> --json
|
|
234
|
-
artshelf trash purge --execute --plan-id <purge-plan-id> --ledger <ledger-path> --json
|
|
235
|
-
```
|
|
230
|
+
Cleanup with `cleanup=trash` quarantines files into Artshelf trash. Physical
|
|
231
|
+
deletion belongs to the separate Purge stage.
|
|
236
232
|
|
|
237
233
|
Resolve only after confirmation; it updates the ledger and does not move or
|
|
238
234
|
delete files:
|
|
@@ -247,6 +243,13 @@ For batches, ask for exact approval:
|
|
|
247
243
|
approve artshelf resolve missing ledger <ledger-path> ids <id...>
|
|
248
244
|
```
|
|
249
245
|
|
|
246
|
+
## Purge
|
|
247
|
+
|
|
248
|
+
Trash purge is separate from cleanup and needs its own reviewed purge plan. List
|
|
249
|
+
trash and dry-run purge freely; execute `artshelf trash purge --execute --plan-id <purge-plan-id> --ledger <ledger-path> --json` only after exact approval:
|
|
250
|
+
`approve artshelf trash purge ledger <ledger-path> plan <purge-plan-id>`. After
|
|
251
|
+
purge execute, verify quiet with `artshelf trash list --all --json` and `artshelf review --all --json`.
|
|
252
|
+
|
|
250
253
|
## Safety
|
|
251
254
|
|
|
252
255
|
- Do not register secrets or credential dumps.
|