@aryasaatvik/scratchpad 0.6.2 → 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.
@@ -61,6 +61,28 @@ reports the planned delete without mutating anything. Remote deletion is availab
61
61
  this explicit command, not through filesystem removal. See
62
62
  [ADR 0007](adr/0007-explicit-remote-delete.md).
63
63
 
64
+ ## Recovering a missing mount directory
65
+
66
+ Losing a whole mount directory is not a deletion. While the store still maps objects to a missing
67
+ mount directory, `pull`, `push` and `sync` refuse to run, so the loss can never read as "close
68
+ every issue". The one recovery is a full pull, which recreates the directories and re-projects
69
+ every open object from GitHub (and recent closures into the archive mount) in one pass:
70
+
71
+ ```sh
72
+ scratchpad pull --full --dry-run # preview the writes and retirements; changes nothing
73
+ scratchpad pull --full # recreate the directory and its files
74
+ scratchpad push --dry-run # should plan no closes
75
+ ```
76
+
77
+ Only a full listing proves which objects belong in the directory, so an incremental `pull` and
78
+ `sync --full` keep refusing. While a restore runs, the directory holds a
79
+ `.scratchpad-restore-pending` marker that is removed only when the pull succeeds; if the restore is
80
+ interrupted, every other command keeps refusing until `scratchpad pull --full` is re-run. Objects
81
+ deleted or transferred on GitHub have nothing to restore: a full pull retires their mappings
82
+ (`remote-missing`) so the next push doesn't try to close them. Local edits that were never pushed went with the directory; a pull
83
+ restores the provider's copy. `scratchpad sweep` never offers files under a configured mount,
84
+ because trashing one would close its remote object on the next push.
85
+
64
86
  ## Backlog file contract
65
87
 
66
88
  Backlog files follow the Scratchpad skill's contract: `status` is free text in the repository's
@@ -76,6 +76,10 @@ the default list. `scratchpad doctor` reports drift; see [notes.md](notes.md#doc
76
76
  - `notes.minFreshDays`: at least 0, default 7. Recently updated notes are protected.
77
77
  - `notes.estimatedCostPerCall`: at least 0, USD, default 0.001. Fallback when OpenRouter reports
78
78
  no cost; labeled an estimate.
79
+ - `storage.budgetMB`: greater than 0, default 1024. `doctor` and `du` warn when the notes root is
80
+ larger.
81
+ - `storage.bulkMB`: greater than 0, default 5. Traces, videos, archives, and executables at or over
82
+ it are bulk; `sweep` retires bulk whose owning records are closed.
79
83
  - `protect`: globs of notes and artifacts that `sweep` never removes. Manual `archive` does not
80
84
  check these globs.
81
85
 
@@ -83,8 +87,10 @@ Behavior: [lifecycle.md](lifecycle.md).
83
87
 
84
88
  ### `search`
85
89
 
86
- `embeddings: false` opts out of hybrid search even when an OpenRouter key is present. Config
87
- discovery walks upward, so ancestor opt-outs apply too. See [search.md](search.md).
90
+ `embeddings: false` opts out of hybrid search even when an OpenRouter key is present. Discovery
91
+ selects the nearest `scratchpad.config.ts` and does not merge ancestors, so an ancestor opt-out
92
+ applies only when that config is selected; a nearer config without `embeddings: false` does not
93
+ inherit it. See [search.md](search.md).
88
94
 
89
95
  ### `classifier`
90
96
 
package/docs/feedback.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # Instruction feedback and routing
2
2
 
3
3
  Agents record corrections and friction as feedback notes. The CLI writes them deterministically and
4
- may classify them with an optional decision model.
4
+ may classify them with an optional decision model. An occurrence's body is immutable after capture:
5
+ corrections and new evidence go in the linked review record, and the CLI only manages front matter.
5
6
 
6
7
  ## Commands
7
8
 
@@ -16,20 +17,36 @@ scratchpad route "<correction>" [--write] [--json]
16
17
 
17
18
  - `feedback new` writes a feedback file under the notes root's `feedback/`; `--slug` overrides the
18
19
  file-name slug derived from the text.
19
- - `feedback normalize` adopts legacy feedback without changing bodies; preview with
20
- `feedback normalize --global --dry-run --json`.
20
+ - `feedback normalize` adopts only the legacy classes it can decode safely: `no-front-matter`,
21
+ `legacy-recorded` (a `recorded` header with no `kind`), and `missing-occurred_at`. It refuses
22
+ ambiguous or undecodable headers and occurrences with no derivable `occurred_at`. Adopted bodies
23
+ keep their bytes, already valid occurrences are unchanged, and `--dry-run` previews the result.
21
24
  - `feedback review` lists feedback with no disposition or an open disposition; `--classify`
22
25
  classifies unclassified entries first and needs a classifier.
23
26
  - `feedback list` filters by status (`new`, `review`, `classified`) and disposition (repeatable);
24
27
  `--all` includes dismissed, installed, and verified occurrences.
25
28
  - `feedback resolve` records a review disposition (`open`, `deferred`, `dismissed`, `source-fixed`,
26
29
  `installed`, `verified`) on one occurrence. The occurrence is the id after the last `-` in the
27
- file name, the file name with or without `.md`, or a path. `--review` names the review record in
28
- `feedback/reviews/` (this scope's, then the global one) or a path; `--evidence` takes a commit,
29
- PR URL, or path and is repeatable.
30
+ file name, the file name with or without `.md`, or a path. `--review` must resolve to an existing
31
+ `.md` file directly inside `feedback/reviews/` (this scope's, then the global one). A bare name,
32
+ with or without `.md`, or a path is accepted; directories and globs are not. `--evidence` takes a
33
+ commit, PR URL, or path and is repeatable.
30
34
  - `route` suggests which instruction layer a correction belongs to; `--write` also records it as a
31
35
  feedback file.
32
36
 
37
+ ## Dispositions
38
+
39
+ `feedback resolve` records what a review concluded, in the front matter of the occurrence:
40
+
41
+ - `open`: not yet decided.
42
+ - `deferred`: accepted, but not acted on yet.
43
+ - `dismissed`: no change is warranted.
44
+ - `source-fixed`: the source change has landed, with evidence linked from the review record;
45
+ an unlanded working-tree edit or unmerged branch does not qualify.
46
+ - `installed`: the installed copy in use is updated and matches the reviewed source.
47
+ - `verified`: representative behavior was exercised with the applicable installed version;
48
+ static inspection alone does not qualify.
49
+
33
50
  ## Global feedback home
34
51
 
35
52
  `--global` feedback lives in `~/.scratchpad` (override with `SCRATCHPAD_GLOBAL_HOME`). Use it for
package/docs/lifecycle.md CHANGED
@@ -6,7 +6,7 @@ stale ones to the operating system's Trash, where they stay recoverable.
6
6
  ```
7
7
  scratchpad archive <paths...> --reason "<why>" # move notes or directories to the OS Trash
8
8
  scratchpad review [paths...] [--apply] [--json] [--limit 100] # classify notes; --apply writes metadata
9
- scratchpad sweep [--apply] [--json] # preview expired artifacts; --apply moves to Trash
9
+ scratchpad sweep [--apply] [--json] # preview expired artifacts and closed bulk; --apply moves to Trash
10
10
  ```
11
11
 
12
12
  `archive` moves the given paths to Trash immediately; it has no preview. `sweep --apply` moves
@@ -46,6 +46,18 @@ artifacts. Symlinks are not traversed or swept. Windows come from `lifecycle.art
46
46
  `sweep` also consumes cached note verdicts, as described under [Review](#review). It never calls
47
47
  the model.
48
48
 
49
+ ### Bulk
50
+
51
+ Run artifacts copied into the notes root are swept by ownership rather than age, in the `bulk`
52
+ group. Bulk is what `scratchpad du` flags (see [notes.md](notes.md#du)). A record owns a bulk file
53
+ when it is a note linking the file or one of its folders, or the `README.md` of the file's nearest
54
+ folder below the notes root. Links to the notes root itself, and notes inside copied trees, are not
55
+ owners. A bulk file is a candidate when it has at least one owner and every owner's front matter
56
+ `status` is closed (`backlog.closedStatuses`, defaulting to `done`, `complete`, `merged`, and the
57
+ rest of the backlog list). Links protect artifacts from expiry but not bulk from this group;
58
+ `lifecycle.protect` globs, `README.md`, `STATE.md`, and the receipt log still protect it. Bulk with
59
+ no owner is left to artifact expiry.
60
+
49
61
  ### Sweep JSON, version 1
50
62
 
51
63
  `sweep --json` emits version 1 of the report: `version: 1`, `apply`, `groups`, `totalBytes`,
package/docs/notes.md CHANGED
@@ -55,6 +55,24 @@ A list given in config replaces the corresponding default list; see
55
55
 
56
56
  `doctor` also reports the project id, notes root and its source, whether a config was found, the
57
57
  state store, the selected classifier model and whether it is enabled, and GitHub auth availability.
58
+ Its `storage` section gives the total size, the budget, and the flagged bulk, and warns on stderr
59
+ when either needs attention; `scratchpad du` has the detail.
60
+
61
+ ### `du`
62
+
63
+ ```
64
+ scratchpad du [--depth 2] [--top 10] [--json]
65
+ ```
66
+
67
+ `du` totals the notes root, lists the largest folders (to `--depth`) and files, and lists the run
68
+ artifacts the evidence policy flags as bulk: traces, videos, archives, and executables at or over
69
+ `lifecycle.storage.bulkMB` (default 5), and copied trees (`node_modules`, `.git`, `test-results`,
70
+ `playwright-report`, `blob-report`, `.next`, `.turbo`, `*.app`, `*.framework`) collapsed to their
71
+ root folder. Markdown and HTML are never bulk. It warns when the total exceeds
72
+ `lifecycle.storage.budgetMB` (default 1024). JSON version 1 holds `totalBytes`, `fileCount`,
73
+ `budgetBytes`, `overBudget`, `bulkThresholdBytes`, `folders`, `files`, and `bulk` (`bytes`,
74
+ `count`, `entries`). Warnings are not failures; `du` exits 0. See
75
+ [lifecycle.md](lifecycle.md#bulk) for how `sweep` retires bulk.
58
76
 
59
77
  ### Skills
60
78
 
package/docs/search.md CHANGED
@@ -29,7 +29,9 @@ mode `0600`. Hybrid indexing sends note title, heading and chunk text to OpenRou
29
29
  `qwen/qwen3-embedding-8b` model at 1024 dimensions; queries are sent there too.
30
30
 
31
31
  To opt out even when a key is present, set `search: { embeddings: false }` in
32
- `scratchpad.config.ts`. Config discovery walks upward, so ancestor opt-outs apply too.
32
+ `scratchpad.config.ts`. Discovery selects the nearest config and does not merge ancestors, so an
33
+ ancestor opt-out applies only when that config is the one selected; a nearer config that omits
34
+ `embeddings` does not inherit it.
33
35
 
34
36
  ## Index location
35
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aryasaatvik/scratchpad",
3
- "version": "0.6.2",
3
+ "version": "0.7.0",
4
4
  "description": "Working memory for coding agents: project notes shared across worktrees, instruction feedback, note search and lifecycle cleanup, plus GitHub backlog sync, hosted artifacts and codemaps.",
5
5
  "keywords": [
6
6
  "bun",