artshelf 0.7.0 → 0.9.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.
@@ -47,11 +47,11 @@
47
47
  <ul class="boundary-list">
48
48
  <li>
49
49
  <span class="stamp readonly">Allowed freely</span>
50
- <span><code>validate</code>, <code>review</code>, <code>cleanup --dry-run</code>, <code>trash list</code>, and <code>trash purge --dry-run</code>.</span>
50
+ <span><code>validate</code>, <code>review</code>, and <code>cleanup --dry-run</code>.</span>
51
51
  </li>
52
52
  <li>
53
53
  <span class="stamp approval">Needs approval</span>
54
- <span><code>cleanup --execute --plan-id</code> and <code>trash purge --execute --plan-id</code>, each for one reviewed plan.</span>
54
+ <span><code>cleanup --execute --plan-id</code> for one reviewed plan.</span>
55
55
  </li>
56
56
  <li>
57
57
  <span class="stamp refused">Refused</span>
@@ -70,31 +70,13 @@ artshelf cleanup --execute --plan-id &lt;id&gt;</code></pre>
70
70
  <span class="callout-label">Hard boundary</span>
71
71
  <p>
72
72
  Cleanup execution needs explicit human approval for the reviewed plan id.
73
- <code>cleanup=delete</code> stays refused instead of silently deleting files.
73
+ <code>cleanup=trash</code> quarantines files into Artshelf trash recoverable,
74
+ not deleted — and <code>cleanup=delete</code> stays refused. Emptying the trash
75
+ for good is a separate stage: see <a href="agent-purge.html">Purge</a>.
74
76
  </p>
75
77
  </div>
76
78
  </section>
77
79
 
78
- <section>
79
- <h2>Clear the trash</h2>
80
- <p>
81
- <code>cleanup=trash</code> moves artifacts into Artshelf trash, so Clean is
82
- not finished until the trash is cleared. Purging runs the loop one more
83
- time: list what is in trash, preview an age-based purge plan, and execute
84
- only after a human approves that purge plan id. Physical deletion never
85
- piggybacks on the cleanup plan that trashed the file; the purge plan is
86
- always separate and separately reviewed.
87
- </p>
88
- <pre><code><span class="c"># what is in trash for this ledger</span>
89
- artshelf trash list --ledger &lt;ledger-path&gt; --json
90
-
91
- <span class="c"># preview an age-based purge and get a purge plan id</span>
92
- artshelf trash purge --older-than 7d --dry-run --ledger &lt;ledger-path&gt; --json
93
-
94
- <span class="c"># delete for real, only with the reviewed purge plan id</span>
95
- artshelf trash purge --execute --plan-id &lt;purge-plan-id&gt; --ledger &lt;ledger-path&gt; --json</code></pre>
96
- </section>
97
-
98
80
  <section>
99
81
  <h2>Resolve confirmed records</h2>
100
82
  <p>Resolve only updates the ledger; it does not move or delete files.</p>
@@ -106,7 +88,7 @@ artshelf resolve &lt;id&gt; --status resolved --reason &lt;text&gt;</code></pre>
106
88
 
107
89
  <section>
108
90
  <h2>Verify quiet</h2>
109
- <p>After cleanup execute, trash purge, or resolve, verify with <code>artshelf review --all --json</code>.</p>
91
+ <p>After cleanup execute or resolve, verify with <code>artshelf review --all --json</code>.</p>
110
92
  <p>
111
93
  Execution writes a receipt and updates touched ledger records to
112
94
  <code>trashed</code>, <code>review-required</code>, or
@@ -67,7 +67,7 @@
67
67
  plan id when attention exists.
68
68
  </p>
69
69
  <pre><code><span class="c"># register a project ledger so --all review can see it</span>
70
- artshelf ledgers add --ledger &lt;repo&gt;/.artshelf/ledger.jsonl --name &lt;project&gt; --scope repo
70
+ artshelf ledgers add --ledger &lt;repo&gt;/.artshelf/ledger.jsonl --name &lt;project&gt; --scope repo --json
71
71
 
72
72
  <span class="c"># list registered ledgers and their health</span>
73
73
  artshelf ledgers list --json
@@ -89,6 +89,7 @@ artshelf find --all --owner &lt;agent-or-runtime&gt; --json</code></pre>
89
89
  <ul>
90
90
  <li><strong>Read-only.</strong> Validate, status, due, review, doctor, and trash list are fine.</li>
91
91
  <li><strong>Quiet by default.</strong> Send nothing when the review is clean unless a summary was requested.</li>
92
+ <li><strong>No network mode.</strong> Set <code>ARTSHELF_NO_UPDATE_CHECK=1</code> when jobs must avoid npm update checks and cache writes.</li>
92
93
  <li><strong>Never schedule execution.</strong> Scheduled jobs must not run cleanup execute or trash purge execute.</li>
93
94
  </ul>
94
95
  <pre><code><span class="c"># ledger health, current ledger or all registered ledgers</span>
@@ -0,0 +1,111 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Purge · Agent usage · Artshelf</title>
7
+ <meta name="description" content="How agents purge Artshelf trash: physical deletion only from a separate, separately reviewed purge plan.">
8
+ <script>(function(){var stored=null;try{stored=localStorage.getItem("artshelf-docs-theme");}catch(e){}var dark=false;try{dark=matchMedia("(prefers-color-scheme: dark)").matches;}catch(e){}document.documentElement.dataset.theme=stored||(dark?"dark":"light");})();</script>
9
+ <link rel="preconnect" href="https://fonts.googleapis.com">
10
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11
+ <link href="https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,450..680;1,9..144,450..680&family=Newsreader:ital,opsz,wght@0,6..72,400..650;1,6..72,400..650&family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet">
12
+ <link rel="stylesheet" href="site.css">
13
+ <script src="site.js" defer></script>
14
+ </head>
15
+ <body data-page="agent-purge.html">
16
+ <a class="skip" href="#content">Skip to content</a>
17
+ <header class="masthead">
18
+ <div class="masthead-inner">
19
+ <button class="menu-btn" type="button" data-menu aria-label="Toggle navigation" aria-expanded="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M1 3.5h14M1 8h14M1 12.5h14" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg></button>
20
+ <a class="brand" href="index.html">Artshelf<span class="brand-tag">docs</span></a>
21
+ <button class="search-btn" type="button" data-search-open><span>Search docs</span><kbd>/</kbd></button>
22
+ <div class="masthead-tools">
23
+ <a class="gh" href="https://github.com/calvinnwq/artshelf">GitHub</a>
24
+ <button class="theme-btn" type="button" data-theme-toggle aria-label="Toggle color theme" aria-pressed="false">
25
+ <svg class="icon-moon" viewBox="0 0 20 20" aria-hidden="true"><path d="M14.6 12.1A6.5 6.5 0 0 1 7.4 2.7a6.5 6.5 0 1 0 7.2 9.4z" fill="currentColor"/></svg>
26
+ <svg class="icon-sun" viewBox="0 0 20 20" aria-hidden="true"><circle cx="10" cy="10" r="3.4" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="10" y1="2" x2="10" y2="4"/><line x1="10" y1="16" x2="10" y2="18"/><line x1="2" y1="10" x2="4" y2="10"/><line x1="16" y1="10" x2="18" y2="10"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="14.4" y1="14.4" x2="15.8" y2="15.8"/><line x1="4.2" y1="15.8" x2="5.6" y2="14.4"/><line x1="14.4" y1="5.6" x2="15.8" y2="4.2"/></g></svg>
27
+ </button>
28
+ </div>
29
+ </div>
30
+ </header>
31
+
32
+ <div class="frame">
33
+ <nav id="sidebar" class="sidebar" aria-label="Documentation"></nav>
34
+
35
+ <main id="content" class="article-col">
36
+ <article>
37
+ <p class="kicker"><span class="n">4.5</span>Agents · Purge</p>
38
+ <h1>Delete for real, from its own reviewed plan.</h1>
39
+ <p class="lede">
40
+ Purge is the only stage that physically deletes. Clean trashes; purge
41
+ empties the trash — and only from a separate plan a human reviewed and
42
+ approved. Trashed records stay discoverable until you deliberately
43
+ remove them.
44
+ </p>
45
+
46
+ <section>
47
+ <h2>Purge boundary</h2>
48
+ <ul class="boundary-list">
49
+ <li>
50
+ <span class="stamp readonly">Allowed freely</span>
51
+ <span><code>trash list</code> and <code>trash purge --dry-run</code> — discover and preview, moving nothing.</span>
52
+ </li>
53
+ <li>
54
+ <span class="stamp approval">Needs approval</span>
55
+ <span><code>trash purge --execute --plan-id</code> for one reviewed purge plan, on one ledger.</span>
56
+ </li>
57
+ <li>
58
+ <span class="stamp refused">Refused</span>
59
+ <span>No global purge — <code>--all</code> is not supported for purge — and no piggybacking on the cleanup plan that trashed the file.</span>
60
+ </li>
61
+ </ul>
62
+ <div class="callout" data-kind="boundary">
63
+ <span class="callout-label">Hard boundary</span>
64
+ <p>
65
+ The purge plan is always separate from the cleanup plan and separately
66
+ reviewed. Physical deletion never happens as a side effect of cleanup.
67
+ </p>
68
+ </div>
69
+ </section>
70
+
71
+ <section>
72
+ <h2>Preview, then purge</h2>
73
+ <p>
74
+ Purge runs the loop one more time: list what is in trash, preview an
75
+ age-based purge plan to get a purge plan id, then execute only that id
76
+ after a human approves it.
77
+ </p>
78
+ <pre><code><span class="c"># what is in trash for this ledger</span>
79
+ artshelf trash list --ledger &lt;ledger-path&gt; --json
80
+
81
+ <span class="c"># preview an age-based purge and get a purge plan id</span>
82
+ artshelf trash purge --older-than 7d --dry-run --ledger &lt;ledger-path&gt; --json
83
+
84
+ <span class="c"># delete for real, only with the reviewed purge plan id</span>
85
+ artshelf trash purge --execute --plan-id &lt;purge-plan-id&gt; --ledger &lt;ledger-path&gt; --json</code></pre>
86
+ <p>The approval wording for a purge:</p>
87
+ <pre><code>approve artshelf trash purge ledger &lt;ledger-path&gt; plan &lt;purge-plan-id&gt;</code></pre>
88
+ </section>
89
+
90
+ <section>
91
+ <h2>Verify quiet</h2>
92
+ <p>
93
+ After a purge executes, confirm the trash is empty and the shelf is
94
+ quiet with <code>artshelf trash list --all --json</code> and
95
+ <code>artshelf review --all --json</code>.
96
+ </p>
97
+ <p>
98
+ Purge writes a receipt and records it as an <code>owner=artshelf</code>
99
+ artifact, so the deletion stays auditable even after the files are gone.
100
+ </p>
101
+ </section>
102
+ </article>
103
+ <footer class="pager" id="pager"></footer>
104
+ </main>
105
+
106
+ <aside class="toc-col"><p class="toc-title">On this page</p><nav id="toc" aria-label="On this page"></nav></aside>
107
+ </div>
108
+
109
+ <footer class="colophon"><div class="colophon-inner"><span>Artshelf docs</span><span>MIT</span><a href="https://github.com/calvinnwq/artshelf">GitHub</a></div></footer>
110
+ </body>
111
+ </html>
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <title>Agent usage · Artshelf</title>
7
- <meta name="description" content="How agents use Artshelf safely: Create, Monitor, Review, Clean.">
7
+ <meta name="description" content="How agents use Artshelf safely: Create, Monitor, Review, Clean, Purge.">
8
8
  <script>(function(){var stored=null;try{stored=localStorage.getItem("artshelf-docs-theme");}catch(e){}var dark=false;try{dark=matchMedia("(prefers-color-scheme: dark)").matches;}catch(e){}document.documentElement.dataset.theme=stored||(dark?"dark":"light");})();</script>
9
9
  <link rel="preconnect" href="https://fonts.googleapis.com">
10
10
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@@ -35,9 +35,9 @@
35
35
  <main id="content" class="article-col">
36
36
  <article>
37
37
  <p class="kicker"><span class="n">04</span>Agents · Overview</p>
38
- <h1>Create, monitor, review, clean.</h1>
38
+ <h1>Create, monitor, review, clean, purge.</h1>
39
39
  <p class="lede">
40
- An agent's whole relationship with Artshelf fits in four stages. Each stage
40
+ An agent's whole relationship with Artshelf fits in five stages. Each stage
41
41
  has its own page with the exact commands; this page is the contract that
42
42
  ties them together.
43
43
  </p>
@@ -63,14 +63,18 @@
63
63
  <a class="ledger-row" href="agent-clean.html">
64
64
  <span class="n">4.4</span>
65
65
  <span class="stage">Clean</span>
66
- <span class="what"><span class="cmdline">artshelf cleanup --execute --plan-id &lt;id&gt;</span>Run the one plan the human approved, clear old trash with its own reviewed purge plan, resolve confirmed ids, and verify the next review is quiet.</span>
66
+ <span class="what"><span class="cmdline">artshelf cleanup --execute --plan-id &lt;id&gt;</span>Run the one plan the human approved, resolve confirmed ids, and verify the next review is quiet.</span>
67
+ </a>
68
+ <a class="ledger-row" href="agent-purge.html">
69
+ <span class="n">4.5</span>
70
+ <span class="stage">Purge</span>
71
+ <span class="what"><span class="cmdline">artshelf trash purge --execute --plan-id &lt;id&gt;</span>Clear old trash through its own separately reviewed purge plan. Physical deletion never piggybacks on the cleanup plan that trashed the file.</span>
67
72
  </a>
68
73
  </div>
69
74
  <p>
70
- Trash rides the same loop. Monitor lists what sits in Artshelf trash,
71
- Review previews an age-based purge plan, and Clean executes only the
72
- reviewed purge plan id. Clearing trash never piggybacks on the cleanup
73
- plan that trashed the file.
75
+ Clean trashes; Purge deletes. Cleanup quarantines artifacts into Artshelf
76
+ trash, and only a separate, separately reviewed purge plan removes them for
77
+ good a second approval boundary before destructive deletion.
74
78
  </p>
75
79
  </section>
76
80
 
@@ -78,7 +82,7 @@
78
82
  <h2>Operating principles</h2>
79
83
  <dl class="def-rows">
80
84
  <div><dt>agents remember</dt><dd>use the portable skill so final, status, and handoff turns check artifacts</dd></div>
81
- <div><dt>crons only read</dt><dd>scheduled jobs may validate, review, dry-run, and report, but never execute</dd></div>
85
+ <div><dt>crons only read</dt><dd>scheduled jobs may validate, review, dry-run, and report, but never execute; set <code>ARTSHELF_NO_UPDATE_CHECK=1</code> when they must avoid npm network checks and update-cache writes</dd></div>
82
86
  <div><dt>humans approve</dt><dd>mutation needs exact approval targets: ledger path, reviewed plan id, or record id list</dd></div>
83
87
  </dl>
84
88
  </section>
@@ -11,7 +11,7 @@ mutation.
11
11
 
12
12
  ## Workflow Summary
13
13
 
14
- Use Artshelf as a four-stage loop around agent work:
14
+ Use Artshelf as a five-stage loop around agent work:
15
15
 
16
16
  1. **Create**: register durable temp artifacts with lookup-before-put and
17
17
  `artshelf put`, or state the skip reason.
@@ -19,10 +19,12 @@ Use Artshelf as a four-stage loop around agent work:
19
19
  paths, and trash state.
20
20
  3. **Review**: turn raw output into an `ArtshelfReviewReport` decision packet
21
21
  with exact approval targets.
22
- 4. **Clean**: execute approved plans, clear trash only from a separate
23
- reviewed purge plan, resolve confirmed ids, then verify quiet.
22
+ 4. **Clean**: execute approved cleanup plans (which trash, never delete),
23
+ resolve confirmed ids, then verify quiet.
24
+ 5. **Purge**: clear old trash only from a separate, separately reviewed purge
25
+ plan; physical deletion never piggybacks on the cleanup plan.
24
26
 
25
- This maps to the product loop: **Create -> Monitor -> Review -> Clean**.
27
+ This maps to the product loop: **Create -> Monitor -> Review -> Clean -> Purge**.
26
28
 
27
29
  ## Child Pages
28
30
 
@@ -34,13 +36,16 @@ The browsable docs split the workflow into focused child pages:
34
36
  and preview plans.
35
37
  - [Review](agent-review.html): decision packet schema, classifications, and
36
38
  exact approval wording.
37
- - [Clean](agent-clean.html): approval-only cleanup, trash purge, resolve,
38
- receipts, and verify-quiet checks.
39
+ - [Clean](agent-clean.html): approval-only cleanup, resolve, receipts, and
40
+ verify-quiet checks.
41
+ - [Purge](agent-purge.html): separately reviewed trash purge that physically
42
+ deletes, with its own approval target and receipts.
39
43
 
40
44
  ## Operating Principles
41
45
 
42
46
  - Agents remember with the portable skill.
43
- - Scheduled checks read and report only.
47
+ - Scheduled checks read and report only; set `ARTSHELF_NO_UPDATE_CHECK=1` when
48
+ they must avoid npm network checks and update-cache writes.
44
49
  - Review output is a decision packet, not raw counts.
45
50
  - Approval names the exact ledger, plan id, or record ids.
46
51
  - Every approved action ends with a read-only verification.
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 four stages: Create, Monitor, Review, Clean.
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 only read, so agents and cron jobs can run them safely.</span>
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 &lt;id&gt;</span>Run the one plan the human approved, then clear trash with its own reviewed purge plan. Artshelf writes receipts, and a follow-up review confirms the shelf is quiet.</span>
88
+ <span class="what"><span class="cmdline">artshelf cleanup --execute --plan-id &lt;id&gt;</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 &lt;id&gt;</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>
@@ -153,7 +158,7 @@ artshelf review --json</code></pre>
153
158
  ~/.artshelf/ledgers.json
154
159
 
155
160
  <span class="c"># put registers its ledger automatically; add existing ones explicitly</span>
156
- artshelf ledgers add --ledger &lt;repo&gt;/.artshelf/ledger.jsonl --name &lt;project&gt; --scope repo
161
+ artshelf ledgers add --ledger &lt;repo&gt;/.artshelf/ledger.jsonl --name &lt;project&gt; --scope repo --json
157
162
 
158
163
  <span class="c"># --all commands read across every registered ledger</span>
159
164
  artshelf review --all --json</code></pre>
@@ -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</code></pre>
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
 
@@ -40,7 +40,14 @@
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
+ </p>
45
+ <p>
46
+ Run <code>artshelf help</code> for the grouped command list. Use
47
+ <code>artshelf &lt;command&gt; --help</code> or
48
+ <code>artshelf help &lt;command&gt;</code> for focused help; nested commands
49
+ such as <code>artshelf trash purge --help</code> and
50
+ <code>artshelf ledgers add --help</code> show only that subcommand.
44
51
  </p>
45
52
 
46
53
  <section class="cmd">
@@ -70,7 +77,7 @@ artshelf ledgers list [--plain] [--json]</code></pre>
70
77
  <section class="cmd">
71
78
  <div class="cmd-head"><h2>artshelf ledgers add</h2><span class="cmd-flag plan">writes registry</span></div>
72
79
  <pre><code><span class="c"># register an existing ledger for --all review</span>
73
- artshelf ledgers add --ledger &lt;path&gt; [--name &lt;project&gt;] [--scope repo|user|other]</code></pre>
80
+ artshelf ledgers add --ledger &lt;path&gt; [--name &lt;project&gt;] [--scope repo|user|other] [--json]</code></pre>
74
81
  <p>
75
82
  <code>add</code> registers an existing ledger so Artshelf can review it through one
76
83
  entry point; scope is inferred from the path when omitted.
@@ -129,13 +136,31 @@ artshelf doctor [--json]</code></pre>
129
136
  </p>
130
137
  </section>
131
138
 
139
+ <section class="cmd">
140
+ <div class="cmd-head"><h2>artshelf update</h2><span class="cmd-flag plan">npm install</span></div>
141
+ <pre><code><span class="c"># install the latest published npm package</span>
142
+ artshelf update [--json]</code></pre>
143
+ <p>
144
+ Normal commands may print a non-blocking notice to stderr when npm has a
145
+ newer published version. <code>artshelf update</code> runs
146
+ <code>npm install -g artshelf@latest</code> and is for npm global installs
147
+ only. pnpm global installs should update with
148
+ <code>pnpm add -g artshelf@latest</code>. Source installs should update by
149
+ pulling, rebuilding, and linking the checkout. Notices are cached in
150
+ <code>~/.artshelf/update-check.json</code>; set
151
+ <code>ARTSHELF_NO_UPDATE_CHECK=1</code> to disable automatic checks for
152
+ no-network scripts and scheduled jobs. Read-only command labels refer
153
+ to ledger and artifact mutation, not this optional update-check cache.
154
+ </p>
155
+ </section>
156
+
132
157
  <section class="cmd">
133
158
  <div class="cmd-head"><h2>artshelf cleanup</h2><span class="cmd-flag approval">approval-gated</span></div>
134
159
  <pre><code><span class="c"># preview cleanup and register a reviewed plan</span>
135
160
  artshelf cleanup --dry-run [--all] [--json]
136
161
 
137
162
  <span class="c"># execute exactly one reviewed plan (approval only)</span>
138
- artshelf cleanup --execute --plan-id &lt;id&gt; [--ledger &lt;path&gt;]</code></pre>
163
+ artshelf cleanup --execute --plan-id &lt;id&gt; [--ledger &lt;path&gt;] [--json]</code></pre>
139
164
  <p>
140
165
  <code>--dry-run</code> creates and registers a cleanup plan without moving files;
141
166
  no-op dry-runs report <code>not-created</code>, and matching dry-runs reuse the
@@ -170,20 +195,59 @@ artshelf trash purge --execute --plan-id &lt;id&gt; [--ledger &lt;path&gt;] [--j
170
195
 
171
196
  <section class="cmd">
172
197
  <div class="cmd-head"><h2>artshelf resolve</h2><span class="cmd-flag plan">writes ledger</span></div>
173
- <pre><code>artshelf resolve &lt;id&gt; --status resolved --reason &lt;text&gt;</code></pre>
198
+ <pre><code>artshelf resolve &lt;id&gt; --status resolved --reason &lt;text&gt; [--json]</code></pre>
174
199
  <p>Mark a handled, missing, or no-longer-needed record as manually resolved. Updates the ledger only; never moves or deletes files.</p>
175
200
  </section>
176
201
 
177
202
  <section>
178
- <h2>Global options</h2>
203
+ <h2>Global flags</h2>
204
+ <p>Only these apply to every command.</p>
205
+ <table class="opts">
206
+ <tr><th>option</th><th>meaning</th></tr>
207
+ <tr><td>-h, --help</td><td>show help for artshelf or a specific command</td></tr>
208
+ <tr><td>-v, --version</td><td>show the Artshelf version</td></tr>
209
+ </table>
210
+ </section>
211
+
212
+ <section>
213
+ <h2>Output mode</h2>
214
+ <p>
215
+ <code>--json</code> is the agent contract: it switches commands that return data,
216
+ records, plans, receipts, or health output to machine-readable JSON on stdout.
217
+ Update notices and other diagnostics stay on stderr and never corrupt JSON output.
218
+ </p>
179
219
  <table class="opts">
180
220
  <tr><th>option</th><th>meaning</th></tr>
181
- <tr><td>--ledger &lt;path&gt;</td><td>use an explicit JSONL ledger</td></tr>
182
- <tr><td>--registry &lt;path&gt;</td><td>use an explicit ledger registry</td></tr>
183
- <tr><td>--all</td><td>read all registered ledgers for supported commands</td></tr>
184
- <tr><td>--json</td><td>emit machine-readable JSON</td></tr>
221
+ <tr><td>--json</td><td>emit machine-readable JSON on commands that return data</td></tr>
222
+ </table>
223
+ </section>
224
+
225
+ <section>
226
+ <h2>Scope flags (command-specific)</h2>
227
+ <p>
228
+ These select which ledger or registry a command reads or writes. They are not
229
+ universal global flags; each only applies to the commands that support it.
230
+ </p>
231
+ <table class="opts">
232
+ <tr><th>option</th><th>meaning</th></tr>
233
+ <tr><td>--ledger &lt;path&gt;</td><td>target an explicit JSONL ledger</td></tr>
234
+ <tr><td>--registry &lt;path&gt;</td><td>target an explicit ledger registry</td></tr>
235
+ <tr><td>--all</td><td>read every registered ledger on commands that support discovery (<code>list</code>, <code>find</code>, <code>get</code>, <code>due</code>, <code>validate</code>, <code>review</code>, <code>status</code>, <code>cleanup --dry-run</code>, <code>trash list</code>)</td></tr>
236
+ </table>
237
+ </section>
238
+
239
+ <section>
240
+ <h2>Environment</h2>
241
+ <table class="opts">
242
+ <tr><th>variable</th><th>meaning</th></tr>
185
243
  <tr><td>ARTSHELF_REGISTRY</td><td>override the default ledger registry path</td></tr>
186
244
  <tr><td>ARTSHELF_NOW</td><td>override current time for retention and due calculations</td></tr>
245
+ <tr><td>ARTSHELF_NO_UPDATE_CHECK=1</td><td>disable automatic npm update checks</td></tr>
246
+ <tr><td>ARTSHELF_UPDATE_CACHE</td><td>override the update-check cache path</td></tr>
247
+ <tr><td>ARTSHELF_UPDATE_CHECK_TTL_MS</td><td>override the update-check cache TTL</td></tr>
248
+ <tr><td>ARTSHELF_NPM_REGISTRY_URL</td><td>override the npm latest-version endpoint</td></tr>
249
+ <tr><td>ARTSHELF_UPDATE_DRY_RUN=1</td><td>print the npm update command without running it</td></tr>
250
+ <tr><td>ARTSHELF_LATEST_VERSION</td><td>override the latest-version value for tests</td></tr>
187
251
  </table>
188
252
  </section>
189
253
 
@@ -208,7 +272,8 @@ artshelf trash purge --execute --plan-id &lt;id&gt; [--ledger &lt;path&gt;] [--j
208
272
  repo it defaults to <code>~/.artshelf/ledger.jsonl</code>. A user-level registry at
209
273
  <code>~/.artshelf/ledgers.json</code> is the discovery index for <code>--all</code>
210
274
  review, status, cleanup dry-run, and trash-list; project records stay in their own
211
- repo-local ledgers.
275
+ repo-local ledgers. Automatic update checks cache their last npm result at
276
+ <code>~/.artshelf/update-check.json</code> by default.
212
277
  </p>
213
278
  <div class="callout" data-kind="boundary">
214
279
  <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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artshelf",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Tiny CLI for accountable temporary artifact retention.",
5
5
  "type": "module",
6
6
  "author": "Calvin",
@@ -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. Reports should name the ledger path and
113
- plan id when attention exists. They may run:
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 any approved action, verify with `artshelf review --all --json` and report whether the review is quiet.
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
- Trash purge is separate from cleanup and needs its own reviewed purge plan:
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.