@aryasaatvik/scratchpad 0.6.1 → 0.6.3

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.
@@ -0,0 +1,75 @@
1
+ # Production Smoke
2
+
3
+ This is an operator-driven Chrome/Codex smoke for `https://scratchpad.arya.sh`. It is not an
4
+ automated deployment or rollback procedure. Do not start until all of these are confirmed:
5
+
6
+ - the intended Worker deployment is active at `scratchpad.arya.sh`;
7
+ - Cloudflare Access credentials work for both Chrome and the CLI profile;
8
+ - wildcard renderer DNS resolves to the isolated HTML renderer;
9
+ - the `ARTIFACT_AGENT` Durable Object migration and `ARTIFACTS` R2 binding exist.
10
+
11
+ Production checkpoint (2026-07-16): those prerequisites are live. Worker deployment
12
+ `e93ed81d-5530-4b0b-810c-97634616ec15`, built from `main` at `034f214`, passed focused Chrome and
13
+ CLI smoke for catalog/Trash, Markdown review, HTML element anchors, revision comparison, the mobile
14
+ review drawer, anonymous sharing and revocation, CSP boundaries, and exact-slug pruning. This is a
15
+ checkpoint for that deployment, not a substitute for rerunning the complete checklist below after
16
+ future changes.
17
+
18
+ ## Create unique fixtures
19
+
20
+ ```sh
21
+ bun run scripts/smoke-fixtures.ts
22
+ ```
23
+
24
+ The command prints the run directory and two unique slugs. Keep its `evidence.json` current. Store
25
+ screenshots, response bodies, CLI stderr, and other failure details under its `diagnostics/`
26
+ directory. Never reuse slugs from an earlier run.
27
+
28
+ Record before testing:
29
+
30
+ - Worker deployment ID and application/package version;
31
+ - exact CLI commit or standalone binary version;
32
+ - Chrome version and Access identity;
33
+ - every command, outcome, retained remote artifact, and cleanup attempt.
34
+
35
+ ## CLI and browser checklist
36
+
37
+ Use the configured production profile and the generated paths/slugs below. Append exact commands to
38
+ `evidence.json`; do not put Access secrets in evidence.
39
+
40
+ 1. Push `artifact.md` with `--review --wait` in one terminal. Open its authenticated review URL in
41
+ Chrome, add a general note and an anchored note over the unique anchor phrase, then disconnect
42
+ and restart the waiting CLI before completing the review. Confirm the reconnected wait returns
43
+ the same closed review exactly once.
44
+ 2. Push `artifact.html` with `--review`. Open it through the wildcard renderer host. Confirm the
45
+ iframe is isolated, the unique DOM text renders, and an element-anchored review survives reload
46
+ before completing the review.
47
+ 3. Run `artifact show` and `artifact list` for both fixtures. Confirm titles, formats, revisions,
48
+ source paths, visibility, and review history match the pushed fixtures.
49
+ 4. Share each artifact. Open the public URL in a signed-out/incognito Chrome window, verify the
50
+ content and security headers, then unshare it and confirm the same public request is denied.
51
+ 5. Pull the Markdown and HTML revisions to a new empty local directory and compare their SHA-256
52
+ hashes with the push results.
53
+ 6. Export the production workspace to a schema-1 ZIP. Keep the ZIP digest in evidence. Import it
54
+ into a newly started, disposable local Worker state and confirm catalog/review/visibility/hash
55
+ parity. An import against production itself must fail because the target is nonempty.
56
+ 7. Move both unique fixtures to Trash. Prune each by exact slug only after every earlier check has
57
+ passed. Confirm neither catalog, Trash, nor R2-backed asset URLs retain the fixtures.
58
+
59
+ ## Failure and cleanup contract
60
+
61
+ On any failure, stop the sequence. Do not automatically roll back the Worker, prune the fixture, or
62
+ rewrite evidence. Preserve:
63
+
64
+ - the failed command's stdout, stderr, exit code, and timestamp;
65
+ - Chrome screenshots and relevant Network/Console details;
66
+ - the archive or pulled files involved in the failure;
67
+ - every still-live slug/revision/share URL in `retainedArtifacts`.
68
+
69
+ Set `status` to `failed`, leave `cleanup.completed` false, and hand the run directory to the
70
+ operator investigating the failure. After an investigation, cleanup remains explicit and must be
71
+ recorded.
72
+
73
+ For a successful run, set every outcome to `passed`, record the two exact prune responses, set
74
+ `cleanup.attempted` and `cleanup.completed` true, set `status` to `passed`, and record
75
+ `operator.completedAt`. Keep the evidence directory; only the unique remote fixtures are pruned.
package/docs/release.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Release
2
2
 
3
- `@aryasaatvik/scratchpad` is a Bun-first npm package. The current version is
4
- `0.2.1`.
3
+ `@aryasaatvik/scratchpad` is a Bun-first npm package. The current version is the `version` in
4
+ [`package.json`](../package.json).
5
5
 
6
6
  ## Preflight and dry-run
7
7
 
@@ -39,7 +39,7 @@ binary. The compiled binaries and npm `dist/scratchpad.js` remain independent su
39
39
  Recommended repository description:
40
40
 
41
41
  ```text
42
- Local-first GitHub issue and milestone tracking through Markdown files.
42
+ 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.
43
43
  ```
44
44
 
45
45
  Recommended topics:
package/docs/search.md ADDED
@@ -0,0 +1,48 @@
1
+ # Search
2
+
3
+ `scratchpad search` finds project notes with hybrid text and vector retrieval over a derived,
4
+ rebuildable index.
5
+
6
+ ```sh
7
+ scratchpad index --rebuild --json
8
+ scratchpad search "deployment decision" --limit 10 --kind decision --json
9
+ scratchpad search "instruction feedback" --global
10
+ ```
11
+
12
+ ## Behavior
13
+
14
+ Search scans the resolved project's Markdown notes before every query, including edits and
15
+ removals. `--kind` matches front matter `kind` exactly; notes without a kind are excluded when
16
+ filtering. Results include the physical path, heading, snippet and reciprocal rank fusion score.
17
+ `--global` also includes `feedback/` under `SCRATCHPAD_GLOBAL_HOME` (default `~/.scratchpad`).
18
+
19
+ ## FTS-only fallback
20
+
21
+ Without credentials, commands use SQLite FTS5 and print a notice on stderr (also included in
22
+ JSON). Ordinary FTS-only search does not load native bindings.
23
+
24
+ ## Embeddings
25
+
26
+ Hybrid search shares the classifier's OpenRouter key: set `SCRATCHPAD_OPENROUTER_API_KEY` or put
27
+ it in `$XDG_CONFIG_HOME/scratchpad/secrets/openrouter-api-key` (default `~/.config/...`), with
28
+ mode `0600`. Hybrid indexing sends note title, heading and chunk text to OpenRouter's
29
+ `qwen/qwen3-embedding-8b` model at 1024 dimensions; queries are sent there too.
30
+
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.
33
+
34
+ ## Index location
35
+
36
+ The rebuildable index lives in `$XDG_STATE_HOME/scratchpad/<project hash>/search/`, beside the
37
+ project sync database. Private (`0700`) caches are separated by the selected physical notes roots,
38
+ so toggling `--global` or switching worktrees retains each scope's index. `index --rebuild`
39
+ recreates that scope's text and vector stores, including corrupt stores.
40
+
41
+ ## Concurrency and platform
42
+
43
+ A concurrent refresh or native writer returns a busy error; retry after the other operation
44
+ exits. Rebuilding a scope with existing vector state briefly loads zvec to check that no native
45
+ reader or writer has it open, even without a key. Linux x64 vector search requires an AVX2-capable
46
+ CPU.
47
+
48
+ See [ADR 0012](adr/0012-local-hybrid-search.md) for the design.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aryasaatvik/scratchpad",
3
- "version": "0.6.1",
4
- "description": "Local-first GitHub issue and milestone tracking, hosted artifacts and uploads, and local architecture codemaps.",
3
+ "version": "0.6.3",
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",
7
7
  "cli",
@@ -40,8 +40,7 @@
40
40
  "LICENSE",
41
41
  "CHANGELOG.md",
42
42
  "SECURITY.md",
43
- "docs/adr",
44
- "docs/release.md"
43
+ "docs"
45
44
  ],
46
45
  "type": "module",
47
46
  "publishConfig": {