artshelf 0.5.0 → 0.7.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 CHANGED
@@ -51,6 +51,30 @@
51
51
  available below the lead.
52
52
  - Tightened the portable agent skill description so the completion-gate trigger
53
53
  is visible before final responses, status updates, handoffs, and done reports.
54
+ - Added packaged `ArtshelfReviewReport` schema, canonical example files, and a
55
+ portable renderer script for deterministic agent review reports, plus
56
+ deterministic footnote guidance for `artshelf put --json` registrations.
57
+ - Split the agent docs into Create, Monitor, Review, and Clean workflow pages
58
+ backed by shared docs-site chrome, search, and navigation.
59
+
60
+ ## [0.7.0](https://github.com/calvinnwq/artshelf/compare/artshelf-v0.6.0...artshelf-v0.7.0) (2026-06-10)
61
+
62
+
63
+ ### Features
64
+
65
+ * **docs:** adopt Ledger redesign for docs site ([#32](https://github.com/calvinnwq/artshelf/issues/32)) ([155aaab](https://github.com/calvinnwq/artshelf/commit/155aaab8c44d1e1a2f373cd47e704dde301fc308))
66
+
67
+ ## [0.6.0](https://github.com/calvinnwq/artshelf/compare/artshelf-v0.5.0...artshelf-v0.6.0) (2026-06-07)
68
+
69
+
70
+ ### Features
71
+
72
+ * **artshelf:** add public review report assets ([6bc89ae](https://github.com/calvinnwq/artshelf/commit/6bc89ae78150bbb161a387f844f32c7ac23f30da))
73
+
74
+
75
+ ### Bug Fixes
76
+
77
+ * **docs:** constrain review approval targets ([eccc16d](https://github.com/calvinnwq/artshelf/commit/eccc16d019f1245a9ab052db51137654a2c3363b))
54
78
 
55
79
  ## [0.5.0](https://github.com/calvinnwq/artshelf/compare/artshelf-v0.4.1...artshelf-v0.5.0) (2026-06-05)
56
80
 
package/README.md CHANGED
@@ -3,10 +3,11 @@
3
3
  Artshelf is a tiny CLI for putting temporary artifacts, backups, and run outputs
4
4
  somewhere accountable, with an expiry tag and a cleanup plan.
5
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.
6
+ It is built for agents first. Coding agents, workflow runners, and review bots
7
+ create files in `tmp/`, repo folders, or backup locations and then lose context.
8
+ Artshelf gives them a small, auditable contract: record why an artifact exists
9
+ when it is created, monitor the ledgers later, present a review packet, and clean
10
+ only from explicit approvals.
10
11
 
11
12
  Artshelf centers on four approval-first workflows: **register a temp artifact** the
12
13
  moment it is created, **review everything safely** before anything moves,
@@ -22,6 +23,11 @@ as a fallback.
22
23
 
23
24
  ## Install
24
25
 
26
+ The intended install path is agent-led: ask your agent to install Artshelf,
27
+ verify it, install or reference the portable skill, and offer to schedule a
28
+ read-only review job in the host runtime. Humans can still run the commands
29
+ below directly.
30
+
25
31
  Install the npm package:
26
32
 
27
33
  ```bash
@@ -59,6 +65,17 @@ npm uninstall -g artshelf
59
65
  npm unlink -g artshelf
60
66
  ```
61
67
 
68
+ For agent setup, the agent should prompt before optional integration steps:
69
+
70
+ - install CLI from npm, or use a source checkout
71
+ - install/copy/reference the whole `skills/artshelf` directory
72
+ - register existing project ledgers
73
+ - schedule a read-only review job in the host runtime
74
+ - choose where review packets should be delivered
75
+
76
+ Agents should drive the selected setup steps explicitly and verify with
77
+ `artshelf doctor`.
78
+
62
79
  ## Core Workflows
63
80
 
64
81
  Artshelf is built around four approval-first workflows. Start here; the reference
@@ -72,7 +89,7 @@ Record an artifact the moment it is created, while the reason is still fresh:
72
89
  artshelf put tmp/run-output --reason "debug parser output" --ttl 3d --kind scratch --cleanup trash
73
90
  ```
74
91
 
75
- Artshelf returns an id. Capture it anywhere future cleanup context matters.
92
+ Artshelf returns an id. Capture it anywhere restart or cleanup context matters.
76
93
 
77
94
  ### 2. Review everything safely
78
95
 
@@ -114,6 +131,22 @@ artshelf trash purge --execute --plan-id purge_20260601_120000_ab12
114
131
 
115
132
  This adds a separate approval boundary between quarantine and destructive deletion.
116
133
 
134
+ ## Ideal Agent Loop
135
+
136
+ Agents should use Artshelf as a small lifecycle around their own work:
137
+
138
+ 1. **Create**: when a durable temp artifact, backup, debug output, report, or
139
+ quarantine folder is created, run lookup-before-put, then `artshelf put`, and
140
+ include the Artshelf id in the task summary or handoff.
141
+ 2. **Monitor**: run scheduled read-only checks such as `artshelf status --all --json`,
142
+ `artshelf review --all --json`, and `artshelf trash list --all --json`.
143
+ 3. **Review**: turn attention into a compact `ArtshelfReviewReport` decision
144
+ packet with registry health, affected ledgers, grouped candidates, exact
145
+ approval targets, and a clear safety line.
146
+ 4. **Clean**: after explicit approval for the reviewed ledger and plan id, run
147
+ cleanup or resolve, then verify the next review is quiet or explain what
148
+ remains.
149
+
117
150
  ## Explicit Ledgers
118
151
 
119
152
  By default, Artshelf writes repo-local `.artshelf/ledger.jsonl` inside a git repo and
@@ -127,20 +160,14 @@ artshelf list --ledger /tmp/artshelf-ledger.jsonl
127
160
 
128
161
  Artshelf also keeps a small global registry of known ledgers at
129
162
  `~/.artshelf/ledgers.json`. Override it with `--registry <path>` or
130
- `ARTSHELF_REGISTRY`; renamed installs still honor legacy `SHELF_REGISTRY` when
131
- `ARTSHELF_REGISTRY` is unset. `put` registers its ledger automatically, and you
132
- can register an existing ledger explicitly:
163
+ `ARTSHELF_REGISTRY`. `put` registers its ledger automatically, and you can
164
+ register an existing ledger explicitly:
133
165
 
134
166
  ```bash
135
167
  artshelf ledgers list
136
168
  artshelf ledgers add --ledger /path/to/repo/.artshelf/ledger.jsonl --name my-repo
137
169
  ```
138
170
 
139
- Renamed installs before `0.5.0` used `.shelf` storage paths. Migrate by copying
140
- each ledger directory to `.artshelf`, rewriting registry paths to the copied
141
- ledgers, validating with `artshelf ledgers list --json`, and keeping the old
142
- `.shelf` directories until rollback is no longer needed.
143
-
144
171
  `artshelf ledgers list` validates each registered ledger by default — reporting
145
172
  ok/missing/invalid status with entry counts, and exiting non-zero when the
146
173
  registry or any ledger is broken — so it doubles as a stale-entry check. Add
@@ -197,7 +224,7 @@ write a plan, it also records that plan in the ledger as an Artshelf-owned artif
197
224
 
198
225
  After `cleanup --execute`, Artshelf writes a receipt, records the receipt as a
199
226
  Artshelf-owned artifact, and updates touched ledger records. Handled records stop
200
- appearing in `due` and future dry-run cleanup plans, while `artshelf list` still
227
+ appearing in `due` and later dry-run cleanup plans, while `artshelf list` still
201
228
  keeps the audit trail visible.
202
229
 
203
230
  ## Commands
@@ -241,19 +268,23 @@ quickstart, agent usage, and CLI reference. The source repo also keeps the
241
268
 
242
269
  ## Agent Skill
243
270
 
244
- The package includes an agent-facing skill at `skills/artshelf/SKILL.md`. Agents
245
- that support local skills can copy or reference this file to learn when to call
246
- `artshelf put`, how to report Artshelf ids in handoffs and issue comments, why
247
- `artshelf find` / `artshelf get` are the read-only idempotency lookup surface, why
248
- `cleanup --execute` requires explicit approval for a reviewed plan id, how to
249
- review trashed records with `artshelf trash list` before a separately approved trash
250
- purge, and when `artshelf resolve <id> --status resolved --reason <text>` may mark
251
- confirmed handled, missing, or no-longer-needed records without moving or
252
- deleting files.
253
-
254
- The same skill ships in the npm package. From a source checkout, use
255
- `skills/artshelf/SKILL.md` directly. Agents should ask where the user wants
256
- Artshelf cloned before installing or linking it.
271
+ The package includes an agent-facing skill at `skills/artshelf`. Agents
272
+ that support local skills can copy or reference this directory to learn when to call
273
+ `artshelf put`, how to report deterministic Artshelf footnotes after JSON
274
+ registration, why `artshelf find` / `artshelf get` are the read-only idempotency
275
+ lookup surface, why `cleanup --execute` requires explicit approval for a
276
+ reviewed plan id, how to render dry-run cleanup and trash purge plans as
277
+ review-report decision packets, how to review trashed records with
278
+ `artshelf trash list` before a separately approved trash purge, and when
279
+ `artshelf resolve <id> --status resolved --reason <text>` may mark confirmed
280
+ handled, missing, or no-longer-needed records without moving or deleting files.
281
+
282
+ The same skill ships in the npm package alongside
283
+ `scripts/render-review-report.mjs`,
284
+ `schemas/artshelf-review-report.schema.json`, and the canonical
285
+ `examples/artshelf-review-report.json` packet. From a source checkout, use the
286
+ whole `skills/artshelf` directory directly. Agents should ask where the user
287
+ wants Artshelf cloned before installing or linking it.
257
288
 
258
289
  ## Development
259
290
 
package/SPEC.md CHANGED
@@ -597,11 +597,26 @@ Agents may run `artshelf find` and `artshelf get` before `put` to avoid duplicat
597
597
  registrations. `find`/`get` are read-only ledger queries; they must not be used
598
598
  as permission to clean up or resolve a record.
599
599
 
600
+ When `artshelf put --json` succeeds, agents should include a deterministic
601
+ Artshelf footnote in the same handoff, status, final response, or run summary
602
+ that mentions the artifact:
603
+
604
+ ```text
605
+ Artshelf footnote: registered <artifact-path> as <artshelf-id>; reason: <short reason>; due: <YYYY-MM-DD|manual-review>; cleanup=<cleanup-mode>.
606
+ ```
607
+
600
608
  Agents may run `artshelf resolve <id> --status resolved --reason <text>` only
601
609
  after explicit confirmation that the record has been handled, is missing, or is
602
610
  no longer needed. The reason must be specific; resolve does not move or delete
603
611
  files.
604
612
 
613
+ For batches of missing-path records, agents should ask for exact approval before
614
+ resolving:
615
+
616
+ ```text
617
+ approve artshelf resolve missing ledger <ledger-path> ids <id...>
618
+ ```
619
+
605
620
  Scheduled jobs may run:
606
621
 
607
622
  ```bash
@@ -626,6 +641,17 @@ registered-ledger discovery and should include trashed record counts and target
626
641
  ages. Purge dry-runs stay scoped to one explicit ledger and should report any
627
642
  plan id, matching entries, and skipped entries.
628
643
 
644
+ When a scheduled review or dry-run produces cleanup or trash purge plans,
645
+ deterministic integrations should build an `ArtshelfReviewReport` packet first,
646
+ then render a compact decision report from it. The packet schema is
647
+ `schemas/artshelf-review-report.schema.json`, the canonical example is
648
+ `examples/artshelf-review-report.json`, and the portable skill includes
649
+ `scripts/render-review-report.mjs` for deterministic text rendering. Packaged
650
+ docs/skills carry matching copies for browsable docs and portable agent
651
+ installs. The report groups decisions into ready-for-approval,
652
+ needs-review-first, and blocked sections, and must still include exact approval
653
+ targets in the message body.
654
+
629
655
  Scheduled jobs must never run `artshelf cleanup --execute` or
630
656
  `artshelf trash purge --execute`; they may only dry-run and report plans for later
631
657
  human review.
@@ -666,6 +692,8 @@ human review.
666
692
  - CLI can list trashed records (single ledger or `--all`) and purge them through
667
693
  an approval-first, ledger-scoped dry-run/execute boundary that writes a purge
668
694
  receipt; purge refuses `--all` and never deletes without a reviewed plan id.
695
+ - Package includes the deterministic `ArtshelfReviewReport` schema, canonical
696
+ example, and portable renderer script for agent-rendered review reports.
669
697
  - All core commands support `--json`.
670
698
  - Tests cover record/list/find/get/status-filter/due/validate/resolve/registry,
671
699
  `artshelf doctor`, the `artshelf status` dashboard, `--all` review, stale-registry,
@@ -0,0 +1,126 @@
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>Clean · Agent usage · Artshelf</title>
7
+ <meta name="description" content="How agents clean Artshelf artifacts after exact human approval.">
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-clean.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.4</span>Agents · Clean</p>
38
+ <h1>Execute only what was reviewed and approved.</h1>
39
+ <p class="lede">
40
+ Clean is meant to be boring. The human approves one plan, the agent runs
41
+ exactly that plan, writes a receipt, and checks that the next review
42
+ comes back quiet.
43
+ </p>
44
+
45
+ <section>
46
+ <h2>Cleanup boundary</h2>
47
+ <ul class="boundary-list">
48
+ <li>
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>
51
+ </li>
52
+ <li>
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>
55
+ </li>
56
+ <li>
57
+ <span class="stamp refused">Refused</span>
58
+ <span>No daemon, no auto-execute, no global execute, no fresh-plan-then-execute.</span>
59
+ </li>
60
+ </ul>
61
+ <pre><code><span class="c"># free to run any time: read-only checks and plan previews</span>
62
+ artshelf validate --json
63
+ artshelf review --all --json
64
+ artshelf cleanup --dry-run --json
65
+ artshelf cleanup --dry-run --all --json
66
+
67
+ <span class="c"># only after a human approves this exact plan id</span>
68
+ artshelf cleanup --execute --plan-id &lt;id&gt;</code></pre>
69
+ <div class="callout" data-kind="boundary">
70
+ <span class="callout-label">Hard boundary</span>
71
+ <p>
72
+ Cleanup execution needs explicit human approval for the reviewed plan id.
73
+ <code>cleanup=delete</code> stays refused instead of silently deleting files.
74
+ </p>
75
+ </div>
76
+ </section>
77
+
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
+ <section>
99
+ <h2>Resolve confirmed records</h2>
100
+ <p>Resolve only updates the ledger; it does not move or delete files.</p>
101
+ <pre><code><span class="c"># mark a record handled without touching the file</span>
102
+ artshelf resolve &lt;id&gt; --status resolved --reason &lt;text&gt;</code></pre>
103
+ <p>The approval wording for resolving a batch of missing records:</p>
104
+ <pre><code>approve artshelf resolve missing ledger &lt;ledger-path&gt; ids &lt;id...&gt;</code></pre>
105
+ </section>
106
+
107
+ <section>
108
+ <h2>Verify quiet</h2>
109
+ <p>After cleanup execute, trash purge, or resolve, verify with <code>artshelf review --all --json</code>.</p>
110
+ <p>
111
+ Execution writes a receipt and updates touched ledger records to
112
+ <code>trashed</code>, <code>review-required</code>, or
113
+ <code>cleanup-refused</code>. Generated plans and receipts are recorded as
114
+ <code>owner=artshelf</code> artifacts.
115
+ </p>
116
+ </section>
117
+ </article>
118
+ <footer class="pager" id="pager"></footer>
119
+ </main>
120
+
121
+ <aside class="toc-col"><p class="toc-title">On this page</p><nav id="toc" aria-label="On this page"></nav></aside>
122
+ </div>
123
+
124
+ <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>
125
+ </body>
126
+ </html>
@@ -0,0 +1,98 @@
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>Create · Agent usage · Artshelf</title>
7
+ <meta name="description" content="How agents create Artshelf records while artifact intent is fresh.">
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-create.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.1</span>Agents · Create</p>
38
+ <h1>Register artifacts while intent is fresh.</h1>
39
+ <p class="lede">
40
+ Create is one question: should this non-source artifact outlive the turn?
41
+ If yes, put it on the shelf while the reason is still obvious.
42
+ </p>
43
+
44
+ <section>
45
+ <h2>Completion gate</h2>
46
+ <p>
47
+ Before any final, status, handoff, or done report, check for files the agent
48
+ created, copied, exported, quarantined, backed up, or preserved.
49
+ </p>
50
+ <ul>
51
+ <li><strong>Register eligible artifact paths.</strong> Anything non-source that may outlive the command needs a record.</li>
52
+ <li><strong>State every skip reason.</strong> Source, cache, regeneratable, secret-bearing, or owned elsewhere.</li>
53
+ </ul>
54
+ <div class="callout" data-kind="boundary">
55
+ <span class="callout-label">Hard boundary</span>
56
+ <p>Do not call work done while known eligible artifacts are neither registered nor explicitly skipped.</p>
57
+ <p>Do not invent Artshelf entries after the fact just to make a handoff look tidy.</p>
58
+ </div>
59
+ </section>
60
+
61
+ <section>
62
+ <h2>Register these</h2>
63
+ <dl class="def-rows">
64
+ <div><dt>backup</dt><dd>rollback copy or snapshot</dd></div>
65
+ <div><dt>evidence</dt><dd>report, log, smoke output</dd></div>
66
+ <div><dt>quarantine</dt><dd>copied aside for review</dd></div>
67
+ <div><dt>run</dt><dd>artifact needed to resume a long task</dd></div>
68
+ </dl>
69
+ </section>
70
+
71
+ <section>
72
+ <h2>Lookup before put</h2>
73
+ <pre><code><span class="c"># is this path already on the shelf?</span>
74
+ artshelf find --path &lt;path&gt; --owner &lt;agent-or-runtime&gt; --label &lt;task-or-run-id&gt; --json
75
+
76
+ <span class="c"># inspect one record by its Artshelf id</span>
77
+ artshelf get &lt;id&gt; --json</code></pre>
78
+ <p>
79
+ If <code>find</code> returns a record, reuse that Artshelf id. If it returns
80
+ no entries, call <code>artshelf put --json</code> and report the new id.
81
+ </p>
82
+ </section>
83
+
84
+ <section>
85
+ <h2>Report the id</h2>
86
+ <p>Use a deterministic Artshelf footnote wherever restart or cleanup context will be read.</p>
87
+ <pre><code>Artshelf footnote: registered &lt;artifact-path&gt; as &lt;artshelf-id&gt;; reason: &lt;short reason&gt;; due: &lt;YYYY-MM-DD|manual-review&gt;; cleanup=&lt;cleanup-mode&gt;.</code></pre>
88
+ </section>
89
+ </article>
90
+ <footer class="pager" id="pager"></footer>
91
+ </main>
92
+
93
+ <aside class="toc-col"><p class="toc-title">On this page</p><nav id="toc" aria-label="On this page"></nav></aside>
94
+ </div>
95
+
96
+ <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>
97
+ </body>
98
+ </html>
@@ -0,0 +1,150 @@
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>Monitor · Agent usage · Artshelf</title>
7
+ <meta name="description" content="How agents monitor Artshelf ledgers without mutating files.">
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-monitor.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.2</span>Agents · Monitor</p>
38
+ <h1>Surface attention without touching artifacts.</h1>
39
+ <p class="lede">
40
+ Monitor jobs answer one question: does any ledger need attention?
41
+ They read, summarize, and stop.
42
+ </p>
43
+
44
+ <section>
45
+ <h2>Signals</h2>
46
+ <ul class="boundary-list">
47
+ <li>
48
+ <span class="stamp readonly">Quiet</span>
49
+ <span>Registry ok, affected ledgers zero, no old trash. Send nothing unless a summary was requested.</span>
50
+ </li>
51
+ <li>
52
+ <span class="stamp approval">Attention</span>
53
+ <span>Due, manual-review, missing-path, or purge candidates exist. Report ledger path and plan id.</span>
54
+ </li>
55
+ <li>
56
+ <span class="stamp refused">Repair</span>
57
+ <span>Registry stale, ledger invalid, or path state unsafe. Fix discovery before anything else.</span>
58
+ </li>
59
+ </ul>
60
+ </section>
61
+
62
+ <section>
63
+ <h2>Ledger registry</h2>
64
+ <p>
65
+ One registry lets an agent review known project ledgers without moving
66
+ records into a global ledger. Reports should include the ledger path and
67
+ plan id when attention exists.
68
+ </p>
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
71
+
72
+ <span class="c"># list registered ledgers and their health</span>
73
+ artshelf ledgers list --json
74
+
75
+ <span class="c"># review and due-check every registered ledger at once</span>
76
+ artshelf review --all --json
77
+ artshelf due --all --json
78
+
79
+ <span class="c"># find records this agent owns, across ledgers</span>
80
+ artshelf find --all --owner &lt;agent-or-runtime&gt; --json</code></pre>
81
+ <div class="callout" data-kind="note">
82
+ <span class="callout-label">Note</span>
83
+ <p><code>--all</code> is for discovery and review. It is never permission to mutate files.</p>
84
+ </div>
85
+ </section>
86
+
87
+ <section>
88
+ <h2>Scheduled review</h2>
89
+ <ul>
90
+ <li><strong>Read-only.</strong> Validate, status, due, review, doctor, and trash list are fine.</li>
91
+ <li><strong>Quiet by default.</strong> Send nothing when the review is clean unless a summary was requested.</li>
92
+ <li><strong>Never schedule execution.</strong> Scheduled jobs must not run cleanup execute or trash purge execute.</li>
93
+ </ul>
94
+ <pre><code><span class="c"># ledger health, current ledger or all registered ledgers</span>
95
+ artshelf validate --json
96
+ artshelf validate --all --json
97
+
98
+ <span class="c"># what is due, kept, or missing</span>
99
+ artshelf due --json
100
+ artshelf due --all --json
101
+
102
+ <span class="c"># the full read-only pass: validate + due + plan preview</span>
103
+ artshelf review --all --json
104
+
105
+ <span class="c"># CLI version, paths, registry health, safety posture</span>
106
+ artshelf doctor --json
107
+
108
+ <span class="c"># lightweight counts, cron-friendly</span>
109
+ artshelf status --all --json</code></pre>
110
+ </section>
111
+
112
+ <section>
113
+ <h2>Plan previews</h2>
114
+ <pre><code><span class="c"># preview cleanup and register a plan, current ledger or all</span>
115
+ artshelf cleanup --dry-run --json
116
+ artshelf cleanup --dry-run --all --json
117
+
118
+ <span class="c"># what is sitting in trash, and how old it is</span>
119
+ artshelf trash list --ledger &lt;ledger-path&gt; --json
120
+ artshelf trash list --all --json
121
+
122
+ <span class="c"># preview an age-based purge for one explicit ledger</span>
123
+ artshelf trash purge --older-than 7d --dry-run --ledger &lt;ledger-path&gt; --json</code></pre>
124
+ <p>
125
+ Dry-runs may write reusable plan files when entries exist. No-op dry-runs
126
+ report <code>not-created</code>. Matching cleanup dry-runs reuse the existing plan id.
127
+ </p>
128
+ </section>
129
+
130
+ <section>
131
+ <h2>Hard boundary</h2>
132
+ <p>Do not scan arbitrary filesystem locations unless the user opted into that discovery scope.</p>
133
+ <div class="callout" data-kind="boundary">
134
+ <span class="callout-label">Never scheduled</span>
135
+ <p>These two commands require exact human approval and must never run from a monitor job:</p>
136
+ </div>
137
+ <pre><code><span class="c"># mutating commands: approval only, never from a schedule</span>
138
+ artshelf cleanup --execute --plan-id &lt;id&gt;
139
+ artshelf trash purge --execute --plan-id &lt;id&gt;</code></pre>
140
+ </section>
141
+ </article>
142
+ <footer class="pager" id="pager"></footer>
143
+ </main>
144
+
145
+ <aside class="toc-col"><p class="toc-title">On this page</p><nav id="toc" aria-label="On this page"></nav></aside>
146
+ </div>
147
+
148
+ <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>
149
+ </body>
150
+ </html>