@aryasaatvik/scratchpad 0.0.0-tegami-trusted-publish-setup → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,61 @@
1
+ ## @aryasaatvik/scratchpad@0.2.1
2
+
3
+ ### Report the released version
4
+
5
+ `scratchpad --version` and artifact metadata report the installed release instead of `0.1.0`.
6
+
7
+ ## @aryasaatvik/scratchpad@0.2.0
8
+
9
+ ### Run the scratchpad workflow through the CLI
10
+
11
+ The CLI now owns the deterministic `.scratchpad` procedures that agents used to follow from prose:
12
+
13
+ - `scratchpad skills get scratchpad [--ref <name>]` serves the scratchpad skill and its references
14
+ from the binary, so the installed skill and the CLI cannot drift. `scratchpad skills get codemap`
15
+ replaces `scratchpad codemap skill`.
16
+ - Notes resolve to per-project storage keyed by a stable project id under the XDG data directory,
17
+ with shared global notes in `~/.scratchpad` (override with `SCRATCHPAD_GLOBAL_HOME`). Notes
18
+ commands work outside a Git repository. `scratchpad path` prints the resolved root and
19
+ `scratchpad doctor` checks it.
20
+ - Backlog issues and milestones use the skill's contract files. `scratchpad backlog new` writes the
21
+ contract sections, and backlog validation checks per-type fields, milestone `depends_on` targets,
22
+ and dependency cycles.
23
+ - `scratchpad feedback new|list|review|resolve` captures instruction feedback in the contract
24
+ format, reports why a file is skipped, and records dispositions with atomic, conflict-checked
25
+ rewrites. An optional decision model classifies new feedback, and `scratchpad route` suggests
26
+ where a correction belongs.
27
+ - `scratchpad archive` moves notes-root files into a dated archive folder.
28
+
29
+ ### Add portable artifact workspaces
30
+
31
+ Publish, render, review, share, export, import, trash, and prune Markdown and isolated HTML
32
+ artifacts through the Scratchpad CLI and Worker.
33
+
34
+ # Changelog
35
+
36
+ All notable changes to this package are documented here.
37
+
38
+ ## 0.1.0 - 2026-07-02
39
+
40
+ Initial public release candidate.
41
+
42
+ ### Added
43
+
44
+ - Markdown projection for GitHub issues and milestones.
45
+ - Local SQLite durability for provider mappings, sync cursors, outbox operations,
46
+ and conflict records.
47
+ - `scratchpad init`, `status`, `pull`, `push`, `sync`, `watch`, `repair`, and
48
+ `delete` commands.
49
+ - `--json` output for machine-readable workflows.
50
+ - `--dry-run` plans for pull, push, sync, and explicit remote delete.
51
+ - Conflict detection with interactive and non-interactive repair paths.
52
+ - Read-only archive projection for recently closed issues and milestones.
53
+ - Explicit destructive remote delete via `scratchpad delete --file <path>
54
+ --remote`.
55
+
56
+ ### Notes
57
+
58
+ - The 0.1.x line is early software intended for Bun users.
59
+ - The first provider is GitHub; other providers are future work.
60
+ - Normal filesystem deletion closes or archives provider objects. Hard remote
61
+ deletion is only available through the explicit `delete --remote` command.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Saatvik Arya
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,6 +1,278 @@
1
- # Placeholder package
2
-
3
- This empty package was published by [Tegami](https://tegami.fuma-nama.dev) to configure npm trusted publishing.
4
-
5
- The real package contents will be published via CI with OIDC.
6
-
1
+ # Scratchpad
2
+
3
+ Local-first project tracking through Markdown files backed by provider services,
4
+ plus hosted immutable artifacts, unlisted file uploads, and local architecture
5
+ codemaps. Issues and milestones are projected to Markdown with typed YAML front
6
+ matter; the first provider is GitHub. Artifacts and uploads target a deployed
7
+ Worker (for example `scratchpad.arya.sh`). Codemaps stay on disk under
8
+ `.scratchpad/codemaps/`.
9
+
10
+ Status: 0.1.0 early release. Scratchpad is Bun-first.
11
+
12
+ ## Packages
13
+
14
+ - `packages/core`: domain model, front matter codecs, SQLite projection store,
15
+ the `Provider` seam (GitHub + in-memory layers), sync engine, watcher, artifact
16
+ client contracts, and codemap schemas.
17
+ - `packages/cli`: the `scratchpad` command tree, config discovery, and XDG paths.
18
+ - `apps/worker`: Cloudflare Worker for the hosted catalog, review UI, HTML
19
+ renderer, and unlisted uploads.
20
+ - `examples/basic`: minimal local-first project with sample issue and milestone
21
+ files.
22
+
23
+ The SQLite store builds on drizzle-orm's native `effect-sqlite-bun` integration
24
+ (`drizzle-orm/effect-sqlite-bun`).
25
+
26
+ ## Install
27
+
28
+ Run with Bun:
29
+
30
+ ```sh
31
+ bunx @aryasaatvik/scratchpad --help
32
+ ```
33
+
34
+ Or install the checksummed standalone binary without Bun:
35
+
36
+ ```sh
37
+ curl -fsSL https://github.com/aryasaatvik/scratchpad/releases/latest/download/install.sh | sh
38
+ ```
39
+
40
+ Or from a local checkout:
41
+
42
+ ```sh
43
+ bun install
44
+ bun run dev:prepare
45
+ bun run cli -- --help
46
+ ```
47
+
48
+ ## Quickstart
49
+
50
+ In a project directory:
51
+
52
+ ```sh
53
+ bunx @aryasaatvik/scratchpad init
54
+ ```
55
+
56
+ Edit `scratchpad.config.ts` and set `repo` to `owner/name`, then pull GitHub
57
+ issues and milestones into Markdown:
58
+
59
+ ```sh
60
+ bunx @aryasaatvik/scratchpad pull
61
+ ```
62
+
63
+ Make local edits under the configured `.scratchpad/backlog` mount, then preview
64
+ and apply the provider updates:
65
+
66
+ ```sh
67
+ bunx @aryasaatvik/scratchpad push --dry-run
68
+ bunx @aryasaatvik/scratchpad push
69
+ ```
70
+
71
+ Auth resolves `GITHUB_TOKEN` / `GH_TOKEN`, then `gh auth token`.
72
+
73
+ ## Example
74
+
75
+ The repo includes a basic example:
76
+
77
+ ```sh
78
+ cd examples/basic
79
+ bun run status
80
+ bun run plan
81
+ ```
82
+
83
+ `plan` runs `scratchpad push --dry-run`, so it shows the GitHub create operations
84
+ Scratchpad would perform without calling the provider.
85
+
86
+ ## CLI
87
+
88
+ ### Backlog sync
89
+
90
+ ```
91
+ scratchpad init # scaffold scratchpad.config.ts + mount dirs + local store
92
+ scratchpad status # repo, mounts, pending pushes, open conflicts
93
+ scratchpad pull # GitHub -> Markdown files (incremental, by cursor)
94
+ scratchpad push # queued local changes -> GitHub
95
+ scratchpad sync # pull then push
96
+ scratchpad watch # daemon: turn local file edits into queued changes
97
+ scratchpad repair # resolve conflicts (interactive, or --take-local/--take-remote)
98
+ scratchpad delete # explicitly delete a mapped remote issue/milestone (--remote)
99
+ ```
100
+
101
+ `pull` / `push` / `sync` accept `--dry-run`, which prints the planned actions
102
+ without mutating files, the queue, or the provider.
103
+
104
+ Deleting a tracked backlog file is non-destructive remotely: `push` closes the
105
+ issue or archives the milestone. Hard provider deletion is deliberately
106
+ separate: `scratchpad delete --file <path> --remote` deletes the mapped remote
107
+ object, removes the local file, and removes the projection mapping. Live remote
108
+ deletes require `--yes` or an interactive TTY confirmation; `--dry-run` reports
109
+ the planned delete without mutating anything.
110
+
111
+ Backlog files follow the Scratchpad skill's contract: `status` is free text in
112
+ the repository's own vocabulary, the title is the first `# ` heading, and
113
+ `milestone` / `depends_on` are relative paths. A status whose first word is in
114
+ `backlog.closedStatuses` (default `done`, `complete(d)`, `closed`, `merged`,
115
+ `landed`, `delivered`, `cancel(l)ed`, `superseded`, `implemented`, `historical`,
116
+ `moved`) syncs as closed; anything else is open. Files in the older shape
117
+ (`title`, `state: open|closed` in front matter) still read, and are rewritten in
118
+ the new shape on the next sync.
119
+
120
+ ### Agent notes
121
+
122
+ These commands need no config. They work on the project's notes root: the
123
+ checkout's `.scratchpad`, else the primary checkout's, else
124
+ `$XDG_DATA_HOME/scratchpad/projects/<project-id>` (project id = the origin
125
+ remote, e.g. `github.com/owner/repo`).
126
+
127
+ ```
128
+ scratchpad path [--global] # print the notes root in use
129
+ scratchpad doctor # project id, notes root, store, token
130
+ scratchpad skills list | path # skills embedded in this CLI
131
+ scratchpad skills get <name> [--full | --ref <reference>]
132
+ scratchpad backlog new <issue|milestone> "<title>" [--milestone <slug>] [--depends-on <path>]
133
+ scratchpad backlog validate | graph # decode, check fields, links and cycles; show the tree
134
+ scratchpad feedback new "<text>" [--global] [--harness <h>] [--model <m>] [--session <id>]
135
+ scratchpad feedback review [--global] [--classify] [--json]
136
+ scratchpad feedback list [--global] [--status <s>] [--disposition <d>]... [--all]
137
+ scratchpad feedback resolve <id-or-path> --disposition <d> --review <record> [--evidence <e>]...
138
+ scratchpad route "<correction>" [--write] [--json]
139
+ scratchpad archive <paths...> --reason "<why>" # move into archive/<date>-<reason>/
140
+ ```
141
+
142
+ `scratchpad skills get scratchpad` prints the agent skill that drives these commands; its source is
143
+ [`packages/cli/skill-data/scratchpad/`](packages/cli/skill-data/scratchpad/). Outside a Git
144
+ repository the project id is local to the directory. `--global` feedback lives in `~/.scratchpad`
145
+ (override with `SCRATCHPAD_GLOBAL_HOME`).
146
+
147
+ The classifier is opt-in: set `TYPESAFE_API_KEY` and optionally choose a model
148
+ with `SCRATCHPAD_CLASSIFIER` or `classifier.model` in `scratchpad.config.ts`
149
+ (`SCRATCHPAD_CLASSIFIER=none` disables it). Feedback is redacted before it is
150
+ sent for classification. Feedback files are written first, and classifier
151
+ failures never block or undo those writes.
152
+
153
+ Every checkout of a project whose mounts resolve to the same files (for example
154
+ `wt` worktrees linking `.scratchpad` to the primary) shares one local store.
155
+
156
+ ### Artifacts
157
+
158
+ Hosted immutable Markdown/HTML revisions with review, share, Trash, and
159
+ export/import. Requires a deployment profile (or `--url` on each command).
160
+
161
+ ```
162
+ scratchpad artifact profile set <name> --url <https://…> [--default]
163
+ scratchpad artifact push <path> --slug <slug> [--kind delivery] [--review] [--wait]
164
+ scratchpad artifact list | show <slug>
165
+ scratchpad artifact open <slug>
166
+ scratchpad artifact wait <slug> --json
167
+ scratchpad artifact share | unshare <slug>
168
+ scratchpad artifact delete | restore <slug>
169
+ scratchpad artifact prune --slug <slug> # or --sweep-orphans for abandoned uploads
170
+ scratchpad artifact pull <slug> [--revision <n>]
171
+ scratchpad artifact export | import <zip>
172
+ scratchpad artifact annotations <slug>
173
+ scratchpad artifact resolve <slug> <ordinal> [--dismiss|--reopen] [--reply <text>]
174
+ ```
175
+
176
+ Profiles live at `$XDG_CONFIG_HOME/scratchpad/deployments.json` and may include
177
+ Cloudflare Access service-token fields for non-interactive CLI auth. See
178
+ [`docs/deploy.md`](docs/deploy.md) for the Worker and Access bypass rules, and
179
+ [`docs/production-smoke.md`](docs/production-smoke.md) for an end-to-end checklist.
180
+
181
+ ### Codemaps
182
+
183
+ Local, evidence-backed architecture maps. Canonical JSON plus a self-contained
184
+ HTML viewer live under ignored `.scratchpad/codemaps/<name>/<timestamp>/`. No Worker
185
+ profile is required.
186
+
187
+ ```
188
+ scratchpad skills get codemap # print the bundled producer skill
189
+ scratchpad codemap create --name <name> --input <draft.json>
190
+ scratchpad codemap validate --name <name> [--snapshot <ts>]
191
+ scratchpad codemap render --name <name> [--snapshot <ts>]
192
+ scratchpad codemap list [--name <name>] [--json]
193
+ scratchpad codemap open --name <name> [--snapshot <ts>] [--editor auto|code|cursor|zed]
194
+ ```
195
+
196
+ Typical flow: emit the producer skill, have an agent write a `CodemapDraft`, create
197
+ the bundle, then open the newest snapshot on a secured loopback session. Source
198
+ clicks use a per-session token to open paths inside the scanned repository only.
199
+ Validation reports `fresh` / `stale` / `unverifiable` against the current HEAD
200
+ and dirty fingerprint; stale snapshots still open with a warning.
201
+
202
+ ### Uploads
203
+
204
+ Unlisted public file URLs (for example PR screenshots) on the same Worker as
205
+ artifacts. Also require a profile or `--url`.
206
+
207
+ ```
208
+ scratchpad upload <file...> [--name <name>] [--ttl-days <n>] [--profile <name>]
209
+ scratchpad uploads list [--json]
210
+ scratchpad uploads delete <id>
211
+ ```
212
+
213
+ Uploaded bodies are served under `/f/*`. Soft-deleted artifacts go to Trash via
214
+ `artifact delete`; abandoned upload blobs are reclaimed with
215
+ `artifact prune --sweep-orphans`.
216
+
217
+ Most commands accept `--json` for machine-readable output.
218
+
219
+ ## Config
220
+
221
+ `scratchpad.config.ts` at the project root:
222
+
223
+ ```ts
224
+ export default {
225
+ repo: "owner/name",
226
+ mounts: [
227
+ {
228
+ provider: "github",
229
+ issues: ".scratchpad/backlog/issues",
230
+ milestones: ".scratchpad/backlog/milestones",
231
+ // Optional: project recently-closed objects to a read-only archive.
232
+ archive: {
233
+ issues: ".scratchpad/archive/issues",
234
+ milestones: ".scratchpad/archive/milestones",
235
+ closedWithinDays: 7,
236
+ },
237
+ },
238
+ ],
239
+ };
240
+ ```
241
+
242
+ The backlog mount holds open work only. With an optional `archive` block, objects
243
+ closed within `closedWithinDays` project to a separate read-only mount (older
244
+ closures project nowhere, and aged-out files are pruned on the next `pull`).
245
+ Editing or deleting an archived file does nothing — only the backlog mount is
246
+ writable. See [ADR 0005](docs/adr/0005-closed-object-archive.md).
247
+
248
+ Remote deletion is available only through the explicit `delete --remote` command,
249
+ not through filesystem removal. See [ADR 0007](docs/adr/0007-explicit-remote-delete.md).
250
+
251
+ Auth resolves `GITHUB_TOKEN` / `GH_TOKEN`, then `gh auth token`. The SQLite store
252
+ lives under `$XDG_STATE_HOME/scratchpad/<project-hash>/store.db`, never in the repo.
253
+
254
+ ## Design
255
+
256
+ Architecture decisions are tracked in [`docs/adr/`](docs/adr/). The runtime is
257
+ Bun + Effect v4; SQLite is local durability (mappings, cursors, outbox, conflicts),
258
+ not product truth — the Markdown files and the provider are the system of record
259
+ for backlog sync. Hosted artifacts are immutable presentation and review surfaces
260
+ over that execution graph; local codemaps are ignored working memory until an
261
+ explicit later publish path exists.
262
+
263
+ ## Development
264
+
265
+ ```
266
+ bun install
267
+ bun run dev:prepare
268
+ bun run check # format + lint + typecheck + tests
269
+ bun run build # build the npm package CLI into dist/
270
+ bun run test:worker-integration # ephemeral Worker + paired HTML bridge; requires Google Chrome
271
+ ```
272
+
273
+ ## Release
274
+
275
+ The npm package is `@aryasaatvik/scratchpad`. See
276
+ [`docs/release.md`](docs/release.md) for the 0.1.0 preflight, publish, public
277
+ repository, and tag checklist. Worker deploy steps live in
278
+ [`docs/deploy.md`](docs/deploy.md).
package/SECURITY.md ADDED
@@ -0,0 +1,19 @@
1
+ # Security
2
+
3
+ Scratchpad is early local-first software. Please do not use public GitHub issues
4
+ for sensitive vulnerability details.
5
+
6
+ Report security concerns through GitHub's private vulnerability reporting flow
7
+ for this repository.
8
+
9
+ ## Supported Versions
10
+
11
+ | Version | Supported |
12
+ | ------- | --------- |
13
+ | 0.1.x | Yes |
14
+
15
+ ## Token Handling
16
+
17
+ Scratchpad reads GitHub credentials from `gh auth token`, `GITHUB_TOKEN`, or
18
+ `GH_TOKEN`. It does not store those tokens in the project repository. Local sync
19
+ state is stored under `$XDG_STATE_HOME/scratchpad/<project-hash>/store.db`.