@whittlelabs/sifter 0.30.7 → 0.30.9

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.
Files changed (4) hide show
  1. package/README.md +44 -4
  2. package/bin.js +4595 -3642
  3. package/bin.js.map +4 -4
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -4,14 +4,30 @@ The Whittle Sifter is a paired AI reviewer for [Whittle Sift](https://sift.whitt
4
4
 
5
5
  ## Install
6
6
 
7
- `@whittlelabs/sifter` is published publicly to npmjs.com (released by the
8
- delivery pipeline on a version bump):
7
+ The Sifter runs on macOS, Linux, and Windows through WSL. Native Windows is not supported: install [WSL](https://learn.microsoft.com/windows/wsl/install) and run everything below inside it.
8
+
9
+ It needs three things on the machine first:
10
+
11
+ | Prerequisite | Version | How to get it |
12
+ |---|---|---|
13
+ | Node.js | 20 or newer | [nodejs.org](https://nodejs.org), or a version manager such as [nvm](https://github.com/nvm-sh/nvm) or [fnm](https://github.com/Schniz/fnm) |
14
+ | git | 2.20 or newer | macOS: `xcode-select --install` (or Homebrew). Linux and WSL: your package manager, e.g. `sudo apt install git` |
15
+ | Claude Code | 2.0 or newer, signed in | `npm install -g @anthropic-ai/claude-code`, then run `claude` once and sign in |
16
+
17
+ On a Mac without the Command Line Tools, `/usr/bin/git` is only a placeholder that asks for them. The Sifter treats that as git not working, so install them first.
18
+
19
+ Then install the Sifter from npm:
9
20
 
10
21
  ```bash
11
22
  npm install -g @whittlelabs/sifter
12
23
  ```
13
24
 
14
- Requires Node 20+.
25
+ If that fails with `EACCES`, do not reach for `sudo`. npm is trying to write into a system directory; install Node through a version manager (which puts global packages in your home directory), or point npm at a directory you own:
26
+
27
+ ```bash
28
+ npm config set prefix ~/.npm-global
29
+ export PATH="$HOME/.npm-global/bin:$PATH" # add this line to your shell profile too
30
+ ```
15
31
 
16
32
  ## Pair
17
33
 
@@ -21,6 +37,8 @@ Visit Sift's **Settings → Pair a Sifter**. Sift will display a pairing code an
21
37
  whittle-sifter init --pairing-code=ABCD-1234
22
38
  ```
23
39
 
40
+ Before it spends the code, `init` checks what `run` will need: git, Claude Code, and a config directory and run root it can write to. If anything is missing it says what and stops with the code unspent, so fix it and run the same command again. Nothing is saved on your machine unless pairing succeeds all the way through.
41
+
24
42
  The Sifter defaults to production. To pair against another Whittle Labs environment, name it with `--profile`: the name selects the backend as well as the directory the pairing lands in.
25
43
 
26
44
  ```bash
@@ -59,13 +77,25 @@ whittle-sifter run
59
77
 
60
78
  The Sifter subscribes to your job pool and waits for review jobs. Leave it running in a terminal or wrap it in your favorite process supervisor.
61
79
 
80
+ ### When something goes away
81
+
82
+ A running Sifter deals with Sift or `claude` going away on its own, and says what it is doing:
83
+
84
+ - **Sift can't be reached** (a deploy, a network blip): it logs one warning, keeps trying, and says when Sift is back. This holds at startup too, so starting it during an outage is fine; it begins claiming once Sift answers.
85
+ - **`claude` stops working** (signed out, out of plan, or uninstalled): the review it was running fails with Claude's own message, and the Sifter stops taking new reviews so the rest of your queue waits for you instead of failing. It logs one line saying what to fix, checks again by itself (after 15 seconds at first, backing off to every 5 minutes), and starts claiming again once `claude` works. A check costs nothing while you are signed out, and one short turn once you are back.
86
+ - **Sift needs a newer Sifter**: it finishes the review in hand, installs the newest version with `npm install -g`, and restarts itself. If the install fails, it exits with code 2 and prints the command to run.
87
+ - **The pairing is revoked** (removed in Sift, or replaced by a newer pairing): it exits with code 3 and shows the two ways to pair again. A review it was running goes back to the queue for another Sifter.
88
+ - **It is decommissioned from Sift's settings page**: it finishes the review in hand and exits with code 0.
89
+
90
+ Ctrl-C stops it at any time, including while it waits.
91
+
62
92
  ## Check
63
93
 
64
94
  ```bash
65
95
  whittle-sifter doctor
66
96
  ```
67
97
 
68
- Fifteen checks over everything the Sifter needs before it can review anything: your pairing, your config, `git`, the `claude` CLI and its login, a writable run root, free disk, and whether Sift can be reached. One line per check, with a remedy under anything that failed. It exits 4 if something is wrong and 0 otherwise, so it works in a script.
98
+ Sixteen checks over everything the Sifter needs before it can review anything: a supported platform and Node version, your pairing, your config, `git`, the `claude` CLI and its login, a writable run root, free disk, and whether Sift can be reached. One line per check, with a remedy under anything that failed, and each problem reported once: a check that depends on one that failed is skipped and points back at it. It exits 4 if something is wrong and 0 otherwise, so it works in a script.
69
99
 
70
100
  `init` and `run` run the relevant subset themselves, so `doctor` is for when the Sifter looks healthy and nothing is happening.
71
101
 
@@ -74,6 +104,16 @@ whittle-sifter doctor --deep # also spend one real turn proving the claude l
74
104
  whittle-sifter doctor --json # the verdicts as JSON, and nothing else
75
105
  ```
76
106
 
107
+ ## Exit codes
108
+
109
+ | Code | Meaning |
110
+ |---|---|
111
+ | 0 | Success |
112
+ | 1 | A fatal error; the message says what went wrong |
113
+ | 2 | This version is older than Sift accepts: `npm install -g @whittlelabs/sifter@latest` |
114
+ | 3 | The pairing was revoked (removed in Sift, or replaced by a newer pairing): pair again |
115
+ | 4 | A pre-flight check failed; the report above it names the remedy |
116
+
77
117
  ## Other commands
78
118
 
79
119
  ```bash