@redue/cli 0.1.0-alpha.2 → 0.1.0-alpha.21

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 (60) hide show
  1. package/CHANGELOG.md +491 -0
  2. package/README.md +107 -2
  3. package/bin/redue.mjs +132 -50
  4. package/docs/README.md +2 -1
  5. package/docs/user/agents.md +299 -15
  6. package/docs/user/configuration.md +28 -2
  7. package/docs/user/direct-typescript.md +209 -0
  8. package/docs/user/getting-started.md +23 -2
  9. package/docs/user/json.md +2 -0
  10. package/docs/user/node-script.md +154 -0
  11. package/docs/user/npm-launcher-notice.md +42 -0
  12. package/docs/user/pilot.md +146 -0
  13. package/docs/user/receipt-selection-notice.md +60 -0
  14. package/docs/user/supported-projects.md +56 -23
  15. package/docs/user/tests-direct.md +132 -0
  16. package/package.json +4 -3
  17. package/src/agent-integration.mjs +388 -0
  18. package/src/agent-policy.md +28 -0
  19. package/src/cached-state.mjs +46 -8
  20. package/src/claude-hook.mjs +449 -0
  21. package/src/cli.mjs +263 -40
  22. package/src/daemon.mjs +433 -94
  23. package/src/decision-profile.mjs +15 -1
  24. package/src/decision-validation.mjs +10 -0
  25. package/src/declared-plan.mjs +29 -6
  26. package/src/direct-run-certificate.mjs +252 -0
  27. package/src/direct-typescript-probe.mjs +24 -0
  28. package/src/direct-typescript.mjs +185 -0
  29. package/src/glob.mjs +8 -0
  30. package/src/history-worker.mjs +21 -13
  31. package/src/index.mjs +72 -19
  32. package/src/installed-inputs.mjs +7 -1
  33. package/src/linux-inotify.py +39 -10
  34. package/src/node-onboarding.mjs +172 -53
  35. package/src/node-script.mjs +364 -0
  36. package/src/npm-integrity.mjs +124 -0
  37. package/src/npm-typecheck-environment.mjs +36 -0
  38. package/src/npmrc.mjs +16 -0
  39. package/src/observation.mjs +34 -12
  40. package/src/path-identity.mjs +8 -0
  41. package/src/plan-worker.mjs +17 -17
  42. package/src/pnpm-inputs.mjs +114 -54
  43. package/src/pnpm-shim-templates.json +180 -0
  44. package/src/pnpm-shims.mjs +54 -0
  45. package/src/pnpm-typecheck-probe.mjs +11 -6
  46. package/src/presentation.mjs +9 -1
  47. package/src/probe-deadline.mjs +37 -0
  48. package/src/probe-result.mjs +7 -3
  49. package/src/project-location.mjs +34 -0
  50. package/src/run-recorder.cjs +91 -0
  51. package/src/state-store.mjs +37 -1
  52. package/src/test-direct.mjs +560 -0
  53. package/src/test-recorder.cjs +406 -0
  54. package/src/typescript-contract-probe.mjs +4 -187
  55. package/src/typescript-input-facts.mjs +92 -0
  56. package/src/typescript-invocation.mjs +92 -0
  57. package/src/typescript-list.mjs +108 -13
  58. package/src/typescript-qualification.mjs +29 -49
  59. package/src/workspace-manifests.mjs +24 -0
  60. package/src/yarn-workspace-typecheck-probe.mjs +2 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,496 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.21 — 2026-10-25
4
+
5
+ `init` finds more typecheck scripts and no longer stops in large monorepos.
6
+ In the census of 108 public TypeScript repos, the general recipe qualifies 26
7
+ typecheck scripts (was 23) and 20 lint scripts.
8
+
9
+ - `init` prefers typecheck scripts named `tsc`, `types` or `lint:types`, then
10
+ takes one script named under a typecheck name (`typecheck:test`,
11
+ `tsc:build`, ...), watch scripts aside. Two such scripts are reported as
12
+ ambiguous unless a command alone decides. Scripts named `build` or `dev`
13
+ that run tsc are not taken: they write output.
14
+ - A workspace of more than 50 packages no longer stops `init`. It reads up to
15
+ 1000 packages, proposes the root's checks, and past 50 packages skips
16
+ per-package checks and says so (`skipped` in `--json`, a "Skipped:" line
17
+ otherwise). Five census repos got no check at all before.
18
+ - General recipe: pnpm 12 writes its workspace state through a temporary
19
+ `node_modules/.tmpXXXXXX` file. Like the state file, it counts as the run's
20
+ output when the pnpm executable ran. Known limit: the agent eval's seed lint
21
+ run on one pnpm 12 project is still UNVERIFIED for an input event REDUE does
22
+ not yet name.
23
+
24
+ - Contributors: the agent eval records each run's seed and final receipt,
25
+ and the files a session changed when its seed run is not stable.
26
+
27
+ ## 0.1.0-alpha.20 — 2026-10-24
28
+
29
+ A fix for agents on macOS.
30
+
31
+ - Fixed: on macOS, `redue status --sync --json`, `status --json` and
32
+ `explain --json` read by an agent's shell tool stopped at 8 KB, leaving
33
+ invalid JSON. The agent instructions REDUE installs run `status --sync
34
+ --json`; its output passes 8 KB at about 25 checks, or sooner when STALE
35
+ checks list many changed files. Through a shell pipe, `init --json`
36
+ stopped at 64 KB. The CLI exited with output still queued; it now writes
37
+ all of it first. Linux and Windows were not affected.
38
+
39
+ ## 0.1.0-alpha.19 — 2026-10-24
40
+
41
+ A general recipe for typecheck and lint scripts that the strict recipes do not
42
+ take. Test scripts stay on the direct test recipe (Vitest, Jest).
43
+
44
+ - `redue init` tries the strict recipes first, then writes a general check
45
+ (`"qualification": "node-script-v1"`) for a root typecheck or lint script.
46
+ `redue run` runs the script through the project's package manager (npm,
47
+ pnpm 9-12 or Yarn with the `node-modules` linker) with REDUE's recorder in
48
+ every Node process, on macOS and Linux. The input is the whole checkout but
49
+ `.git`, `node_modules` and runner caches, plus every workspace
50
+ `node_modules` observed as installed files, the package manager and its
51
+ version, and the environment. See docs/user/node-script.md.
52
+ - pnpm's launchers are trusted only when their text matches a template a pnpm
53
+ release writes (pnpm 8.0 to 12.14). The pnpm executable, Corepack's
54
+ pnpm-native included, is toolchain; its configuration files are kept by
55
+ content.
56
+ - A run that starts a program REDUE does not record is UNVERIFIED and the
57
+ reason names it: native programs from installed packages (esbuild, turbo,
58
+ tsgolint, biome), git, find, and shells that read startup files.
59
+ - `status` and the hook's skip message name the recipe that made the receipt
60
+ ("general recipe"). The Claude Code hook recognizes lint commands as it does
61
+ typecheck and test commands: `npm run lint`, `pnpm lint`, and for a script
62
+ that is one plain command, that command and its `npx` form.
63
+ - In the census of 108 public TypeScript repos, the general recipe qualifies
64
+ 23 typecheck and 21 lint scripts (both recorded runs clean, CURRENT after
65
+ the second). Of the scripts whose runs start only Node and the package
66
+ manager's own launchers (35 typecheck, 37 lint, measured with strace), init
67
+ proposes and observes about 21 and 22, and 18 of each qualify. The rest:
68
+ init does not pick script names such as `tsc:build`, fails in monorepos
69
+ over 50 packages, or refuses source directory links and custom install
70
+ setups; plans with submodules or dangling links are unavailable.
71
+ - Known limits: on macOS, pnpm 12's temporary files in the project root can
72
+ arrive as an event on the root and make a run UNVERIFIED. Writes into
73
+ `node_modules` during a run make it UNVERIFIED, except pnpm's workspace
74
+ state and vue-tsc's global types, which stay inputs and are kept as the run
75
+ left them. A workspace's recording checks now leave out nested
76
+ `node_modules`, so `redue init` rewrites them once.
77
+
78
+ - Contributors: `census.mjs --product` applies the product's own rule and
79
+ lists the files an unstable run touched; the eval kills a timed-out
80
+ command's whole process group; the agent eval has lint tasks.
81
+
82
+ ## 0.1.0-alpha.18 — 2026-10-23
83
+
84
+ Typecheck in more project shapes, and pnpm test reuse on Linux. In the census
85
+ of 108 public TypeScript repos, the ones `init` makes ready went from 8 to 11
86
+ for typecheck (the census clones each repo's current head, so one or two
87
+ repos move between runs) and stayed at 22 for tests.
88
+
89
+ - pnpm test checks are reused on Linux. A recorded run accepts an installed
90
+ file hard-linked into the pnpm store the install recorded, when the store
91
+ holds it at its content address (pnpm names store files by their sha512).
92
+ Links anywhere else stay UNVERIFIED. Each file is hashed once; REDUE keeps
93
+ its identity and store path in its state and hashes it again only when the
94
+ identity changes. A 46 MB install takes about 160 ms to check the first
95
+ time. Limit: an in-place edit of an installed file in another project that
96
+ shares the store file is not seen until the next recorded run.
97
+
98
+ - Typecheck scripts in more shapes. A script of `tsc --noEmit` runs with
99
+ `-p`/`--project`, `--skipLibCheck` or `--pretty`, in any argument order,
100
+ qualifies for the direct npm recipe and the pnpm contract. A chain of such
101
+ runs joined by `&&` becomes one check per run (`typecheck.1`,
102
+ `typecheck.2`); the hook skips the script only when every run is CURRENT
103
+ and otherwise runs the stale ones through `redue run`. `check-types` joins
104
+ the recognized script names.
105
+ - The hook acts on a typecheck script's form only while the script in
106
+ package.json still has exactly the configured `tsc` runs. Before, a script
107
+ changed to `tsc --noEmit && eslint .` was rewritten to `redue run
108
+ typecheck`, which ran tsc alone.
109
+ - Without a typecheck script, `init` proposes a `tsc --noEmit` check for a
110
+ root `tsconfig.json` (direct npm recipe, pnpm) and for each pnpm workspace
111
+ package with one, unless a script runs a TypeScript checker in another form
112
+ (`tsc -b`, `vue-tsc`, ...). package.json is not changed; the check is
113
+ written only when the contract holds.
114
+ - The pnpm contract no longer needs `include: ["src"]`. Its source inputs are
115
+ the directories the config's `include` covers, as TypeScript computes them
116
+ for new files, minus `node_modules`. `exclude` entries stay inputs, since an
117
+ import can still reach an excluded file. A config extended from an installed
118
+ package is an installed input.
119
+ - Fixed: a config with three or more pnpm or test checks never got a
120
+ synchronized answer. The observer dropped control requests over 4 KB, and a
121
+ sync request carries about 1.5 KB of context digests per check; status
122
+ showed "Unexpected end of JSON input" for every check. The limit is 1 MiB.
123
+
124
+ - The direct npm TypeScript recipe takes any TypeScript 5.x or 6.0, not only
125
+ the five reviewed releases. Another release qualifies when package-lock.json
126
+ records the registry's `typescript` at that version with an integrity
127
+ (sha512, or sha1 from registries that record only sha1), npm's cache holds
128
+ the tarball under it, and the installed package is exactly the tarball's
129
+ files. Nothing is downloaded; a missing tarball
130
+ keeps the check recording-only with `npm-tarball-uncached`. The check takes
131
+ about 100 ms per full probe (TypeScript 5.x and 6.0 tarballs, 120-140 files).
132
+ CI runs the direct contract suite against 5.0.4, 5.1.6, 5.2.2, 5.3.3, 5.4.5,
133
+ 5.5.4, 5.7.3 and 5.8.3.
134
+
135
+ - Contributors: `npm test` runs up to four test files at a time, keeping two
136
+ cores free (a 3-core CI macOS runner runs one at a time), and takes about
137
+ 6 minutes on the owner's Mac (was 19.6). The two TypeScript 6 fixture
138
+ suites are separate files so they run side by side.
139
+
140
+ ## 0.1.0-alpha.17 — 2026-10-22
141
+
142
+ Workspaces and package managers beyond npm. In the census of 108 public
143
+ TypeScript repos, the ones `init` makes ready went from 5 to 8 for typecheck
144
+ and from 6 to 22 for tests.
145
+
146
+ - pnpm 9-12 for the pnpm TypeScript contract (it took only an exact pnpm 12
147
+ pin). The installed `.modules.yaml` names the version; a pin is optional,
148
+ with or without Corepack's `+sha512` hash (pins with a hash never matched
149
+ before). `.npmrc` settings that only change what gets installed are
150
+ accepted; settings that move or copy installed files, or run code during
151
+ install, are refused in either file: custom modules, virtual-store or
152
+ lockfile directories, the global virtual store, injected workspace
153
+ packages, separate lockfiles, pnpmfile hooks, `configDependencies`.
154
+ - The tests recipe takes single-package pnpm 9-12 and Yarn `node-modules`
155
+ installs, and gives each workspace package (npm or Yarn `workspaces`, pnpm
156
+ `packages`) whose test script runs Vitest directly its own `PACKAGE:test`
157
+ check, run in the package directory. Inputs stay the whole checkout; every
158
+ package's node_modules is an installed input. Jest and root test scripts in
159
+ workspaces stay recording-only. A package added later makes the
160
+ workspace's checks UNVERIFIED until `init` runs again.
161
+ - A recorded test run is UNVERIFIED when an installed file has another hard
162
+ link: a package store outside the checkout (pnpm's default on Linux, Yarn's
163
+ hardlinks modes) could change it unseen. pnpm on macOS clones files and is
164
+ not affected; on Linux, pnpm test checks qualify but are not reused unless
165
+ pnpm copies files.
166
+ - Observer: an installed link to a directory (pnpm links every package) is
167
+ observed by its link chain when the target is itself observed installed;
168
+ any other directory link still makes observation unavailable.
169
+ - Workspace patterns honour `!pattern` exclusions; before, a negated pattern
170
+ matched every directory.
171
+ - Fixed: a new workspace package manifest did not re-plan a test check, for
172
+ npm workspaces too.
173
+
174
+ Eval on alpha.17 code (CI 39828002753, 84 sessions, test tasks on twilio,
175
+ cheerio and SwitchHosts plus the pnpm project devops-daily): 0 critical
176
+ findings; 23 skipped test runs, each passing three plain reruns; nothing was
177
+ skipped on devops-daily, whose recorded runs were UNVERIFIED on the Linux
178
+ runner.
179
+ ## 0.1.0-alpha.16 — 2026-10-22
180
+
181
+ Changes to the Claude Code integration, and one fix for commands that meet
182
+ on fresh state. Run `redue agent setup claude --apply` again to get the new
183
+ hook entries.
184
+
185
+ - A SessionStart hook starts the project's observer when a session starts,
186
+ resumes, clears or compacts, if none is running. It returns at once and
187
+ prints nothing. Without a running observer every check was UNVERIFIED, so
188
+ the hook could neither skip nor record. `agent doctor` reports it.
189
+ - The hook matches more command forms, each mapping to one configured check:
190
+ `pnpm SCRIPT`, `pnpm run SCRIPT`, `yarn SCRIPT`, `yarn run SCRIPT`,
191
+ `pnpm exec tsc ...`; for a workspace package's check, `pnpm --filter NAME
192
+ SCRIPT`, `yarn workspace NAME SCRIPT`, `npm run SCRIPT -w NAME`, and its
193
+ script after a `cd` into the package. In the census of 108 public
194
+ TypeScript repos, 61 use pnpm or Yarn.
195
+ - `turbo run TASK` and, in pnpm projects, `pnpm -r TASK` (or a root script
196
+ that is one of them) are skipped only when every workspace package with the
197
+ task's script has a check and all are CURRENT; otherwise they run as typed,
198
+ never rewritten. No skip when turbo may run more (other `dependsOn` tasks,
199
+ `with`, package-scoped keys, a package turbo.json), when pnpm includes the
200
+ workspace root, or for a root script with pre/post scripts. Filters and nx
201
+ are not matched.
202
+ - Fixed: when two commands met on fresh state (SessionStart's `start` and the
203
+ first `status`), the second failed and no observer started.
204
+
205
+ Pilot eval on alpha.16 code (CI 39799994225, 96 sessions over twilio,
206
+ semiotic, Ultra-Card and SwitchHosts): 0 critical findings; 29 skipped
207
+ typechecks, each confirmed by a plain rerun.
208
+ ## 0.1.0-alpha.15 — 2026-10-22
209
+
210
+ No change to observation, status or `redue run` since alpha.14; the changes
211
+ are to the Claude Code integration.
212
+
213
+ - The CLAUDE.md block now tells agents to run the typecheck or test command
214
+ before saying it passes, even after an edit that seems irrelevant, and to
215
+ leave skipping to REDUE's hook. In the alpha.14 eval, two of six mixed-task
216
+ sessions skipped their final test run on their own after a README edit;
217
+ with the new block, none of six did (twilio and SwitchHosts, CI
218
+ 39702429765), at the same token cost. Run `redue agent setup claude --apply`
219
+ again to update the block; the earlier wording is recognized and replaced.
220
+ - The hook also matches a typecheck or test command after a leading
221
+ `cd <project root>;` or `cd <project root> &&`. A skip denies the whole
222
+ command; a rewrite keeps the `cd`. A `cd` to any other directory matches
223
+ nothing.
224
+
225
+ ## 0.1.0-alpha.14 — 2026-10-21
226
+
227
+ Bench numbers below are from one 800-file project on macOS arm64, Node 22.13.0.
228
+ Released alpha.13 and this build ran interleaved on the same machine; the
229
+ typecheck decision path is unchanged within noise (warm `status --sync` 162/157
230
+ ms on alpha.13, 169/166/289 ms on alpha.14; `redue run` overhead 12/14% and
231
+ 12/7/18%; states correct, no idle probe launches).
232
+
233
+ - New opt-in recipe for unit tests: `redue init --recipe tests-direct --check
234
+ test` records a single-package npm project's Vitest 4/5 or Jest 29 run on
235
+ macOS and Linux. The check's inputs are the whole checkout (minus `*.md`,
236
+ `*.mdx` and, with `--coverage`, `coverage/`), the installed files, the Node
237
+ binary, the exact command, and every environment variable the run's
238
+ JavaScript reads directly, compared by value. A recorder loaded into every
239
+ Node process and worker thread of the run guards the rest: reading an
240
+ excluded or git-ignored file, a directory listing or large file outside the
241
+ checkout, network use other than loopback, or a process that escaped the
242
+ recorder makes the result UNVERIFIED with the reason. Lookups outside the
243
+ checkout become run facts that status checks again. Two runs on the same
244
+ inputs with different results make the check UNVERIFIED until the inputs
245
+ change. See [direct tests](docs/user/tests-direct.md) for the claim and its
246
+ limits.
247
+ - Claude Code: the hook skips or records a direct test check's runs (`npm run
248
+ <script>`, `npm test`, the script's own command) like the typecheck's.
249
+ - Linux: a directory created or deleted in the checkout is now an event, not
250
+ an observation gap. Before, every new directory forced a full reconciliation,
251
+ and a second one during it left the observer UNVERIFIED (`plan_gap`).
252
+ - An excluded installed path appearing (a runner cache, a TypeScript build-info
253
+ file) no longer changes the input plan. Checks with such an exclusion are
254
+ STALE with "input plan changed" once after the upgrade, until their next run.
255
+ - Measured with Claude Code on three public projects (Sonnet 5.5, CI Linux,
256
+ 72 sessions): agents skipped 21 test runs, every skip confirmed by three
257
+ plain reruns on its tree, and session time fell from 515 to 295 s summed over
258
+ the task medians. In two sessions the agent itself left out its final test
259
+ run after a README-only edit, without asking REDUE; both said so, and the
260
+ final trees passed.
261
+
262
+ ## 0.1.0-alpha.13 — 2026-10-19
263
+
264
+ Bench numbers below are from one 800-file project on macOS arm64, Node 22.13.0.
265
+ Released alpha.12 and this build ran interleaved on the same machine; the
266
+ decision path is unchanged within noise (warm `status --sync` 192/197 ms on
267
+ alpha.12, 174/198 ms on alpha.13; states correct, no idle probe launches).
268
+ On the CI screen of 38 public TypeScript projects, 22 qualify for the direct
269
+ recipe, up from 19 at alpha.12: worldmonitor, Recordly and open-cowork, which
270
+ the fixed 5 s probe deadline blocked.
271
+
272
+ - A full state probe may run longer on large projects. Its deadline was a
273
+ fixed 5 s (10 s on Windows and for pnpm); now it is the larger of twice the
274
+ last successful probe and the last completed run, at least that floor and at
275
+ most 60 s, doubling after a timeout. A probe that never finishes is still
276
+ killed at its deadline and the check stays UNVERIFIED. `redue status --sync`
277
+ and `redue run` wait for the observer up to the sum of its checks' probe
278
+ deadlines plus 10 s (`probe_deadline_ms` in status JSON), never less than
279
+ before. While a full probe runs the observer does not answer, so with a hung
280
+ probe a decision can wait up to 60 s per check before it is UNVERIFIED.
281
+
282
+ ## 0.1.0-alpha.12 — 2026-10-19
283
+
284
+ Bench numbers below are from one 800-file project on macOS arm64, Node 22.13.0.
285
+ Released alpha.11 and this build ran interleaved on the same machine; the
286
+ decision path is unchanged within noise (warm `status --sync` 183/410 ms on
287
+ alpha.11, 298/174 ms on alpha.12; states correct, no idle probe launches).
288
+ On a screen of 38 public TypeScript projects in CI, 10 qualified for the
289
+ direct recipe before the run-facts change, 17 after it and 19 after incremental
290
+ and references support. worldmonitor and Recordly now stop at the 5 s probe
291
+ timeout, and open-cowork at its end-checkpoint probe.
292
+
293
+ - Large installations reach ready quickly. Installed files are observed by
294
+ identity (inode, size, mode, link count, times), not by hashing their contents;
295
+ the compiler's own reads stay content-checked by the probe. On macOS:
296
+ Recordly (75k files in `node_modules`) ready in 7 s instead of failing after
297
+ 120 s; worldmonitor (143k) in 30 s instead of not ready after 15 min.
298
+ Behavior change: reinstalling identical packages, restoring an installed
299
+ file's bytes or copying the installation now makes the check STALE once.
300
+ - The direct TypeScript recipe supports TypeScript 6.0.2 and 6.0.3.
301
+ - Claude Code: the typecheck hook also matches a typecheck that starts a `;` or
302
+ `&&` chain. When it skips one, the message names the rest of the chain. The
303
+ skill lists the exact commands the hook matches for the selected config.
304
+ - Shorter agent instructions: the CLAUDE.md block is 235 bytes instead of 739,
305
+ the skill 1.8 KB instead of 5 KB. The reuse rules are unchanged. When the
306
+ Claude Code hook matches a typecheck, the block no longer points to the
307
+ skill; the skill stays for agents that look for it.
308
+ - Claude Code hook: it waits for status up to half the last completed run's
309
+ duration, at most 10 s, instead of a fixed 2 s. Run `redue agent setup claude
310
+ --apply` again to raise the hook's Claude Code timeout from 5 s to 15 s.
311
+ - Linux: the observer no longer watches `.git` directories. Before, each new
312
+ directory git created there (on most commits) was an observation gap: status
313
+ was UNVERIFIED until a full reindex and probe finished, about 5 s on a
314
+ 26k-file project. Input patterns that name a `.git` directory are now
315
+ refused; REDUE never observed changes there.
316
+ - Direct TypeScript recipe: runs with `declaration: true` are reusable. tsc's
317
+ declaration checks look up files that building the program does not, and
318
+ read dependencies' `package.json`; before, any such lookup made the run
319
+ UNVERIFIED. The receipt now keeps those existence, `realpath` and
320
+ `package.json` answers as run facts, and status asks them again before every
321
+ CURRENT answer, including when a cached status is read. Every direct run is
322
+ now recorded, also one checked by full probes. The probe also records
323
+ `realpath` while it parses a tsconfig `extends` from a package.
324
+ Behavior change: a direct receipt recorded by an earlier version is
325
+ UNVERIFIED until the check runs again (macOS and Linux). Limit: Windows does
326
+ not record direct runs, so declaration-only lookups are not checked there.
327
+ - Direct TypeScript recipe: a root tsconfig with `incremental: true` is
328
+ supported. Its build-info file is left out of the inputs, and the run may
329
+ write only that file. A root tsconfig that references a composite config
330
+ (such as Vite's `tsconfig.node.json`) is supported when the program does not
331
+ use the referenced project's files. A `composite` root is still refused.
332
+ - Releases are published to the `latest` npm tag as well as `alpha`, so
333
+ `npm install -g @redue/cli` installs the newest release.
334
+
335
+ ## 0.1.0-alpha.11 — 2026-10-18
336
+
337
+ Bench numbers below are from one 800-file project on macOS arm64, Node 22.13.0.
338
+ Released alpha.10 and this build ran back to back on the same machine.
339
+
340
+ - Faster status decisions for the direct TypeScript recipe on macOS and Linux.
341
+ The observer checks the compiler's recorded filesystem questions in-process
342
+ instead of starting a probe that rebuilds the whole program. A full probe runs
343
+ only when that check fails, the plan or toolchain changes, or observation was
344
+ interrupted. While idle it no longer starts any probe process.
345
+ - warm `status --sync`: 741 → 194 ms (+683 → +154 ms over cached `status`)
346
+ - `status --sync` after an unrelated edit: 619 → 219 ms
347
+ - `status --sync` after a relevant edit: 1472 → 321 ms. It answers STALE without
348
+ a full probe when the edited inputs already differ from the receipt.
349
+ - probe processes started in 20 s idle: 4 → 0
350
+ - Cheaper `redue run` on macOS and Linux. The compiler records its own inputs
351
+ while it runs, so REDUE no longer probes before and after the compile. After
352
+ a relevant edit, the run builds the new certificate from that recording instead
353
+ of running a full probe. Output and exit code are those of plain `tsc`.
354
+ - repeat run: 4143 → 2752 ms, overhead over plain `tsc` 72% → 16%
355
+ - run right after a relevant edit: 3990 → 2802 ms, overhead 65% → 18%
356
+ - The direct TypeScript recipe accepts inert Node settings. Before, any non-empty
357
+ `NODE_*` setting other than `NODE_ENV` kept a check from becoming CURRENT.
358
+ Now accepted: `NODE_EXTRA_CA_CERTS`, `NODE_PATH`, and `NODE_OPTIONS` made only of
359
+ `--max-old-space-size`, `--max-semi-space-size`, `--use-openssl-ca`,
360
+ `--use-bundled-ca`, `--use-system-ca` and `--dns-result-order`. A run under one
361
+ value is not reused under another. See [Node settings](docs/user/direct-typescript.md#node-settings).
362
+ - `redue agent setup claude --apply` adds a Claude Code hook to
363
+ `.claude/settings.local.json`. When the agent reruns a configured typecheck
364
+ that is CURRENT and PASS, the hook blocks it and names the passing run. When
365
+ the check is not CURRENT, it rewrites the command to `redue run CHECK`, so the
366
+ result is recorded and the next identical command can be skipped. Prefix a
367
+ command with `REDUE_FORCE=1` to always run it. On the bench: a skip decision
368
+ takes about 155 ms; a forced command adds 39 ms. Tested live with Claude Code
369
+ 2.1.302 (`claude -p`). See [the hook](docs/user/agents.md#claude-code-typecheck-hook).
370
+ - Unstable-run and observation-gap reasons now name the failed check or operation.
371
+ - macOS counts each input event once, which removes an intermittent UNVERIFIED
372
+ after an edit.
373
+
374
+ Known limits:
375
+
376
+ - Two bench targets are still missed: warm sync adds 154 ms over cached status
377
+ (target < 100 ms), and `redue run` adds 16–18% over plain `tsc` (target < 10%).
378
+ - An edit that changes imports, configuration or lib files still costs one full
379
+ probe, at the end of the next run.
380
+ - Windows keeps the earlier probe-based path, except the STALE shortcut. Yarn
381
+ and pnpm recipes still probe on each decision. The bench was not run on Linux.
382
+ - The Claude hook covers the Bash tool only, from the project root. It allows the
383
+ rewritten command without a permission prompt. It judges its own environment,
384
+ not variables the Bash tool adds from your shell profile.
385
+ - To upgrade, stop observers, install into the same prefix, and keep config, state
386
+ and receipts. Rerun `redue agent setup claude --apply` to add the hook.
387
+
388
+ ## 0.1.0-alpha.10 — 2026-10-10
389
+
390
+ - Combine guarded caller-discovery reuse and cheaper non-reusable recording on
391
+ the existing macOS direct-TypeScript path. Healthy runs still validate both
392
+ boundaries in the caller context, falling back to full probes when necessary.
393
+ - Once a healthy start observation is missing, omit qualification-only work that
394
+ cannot repair it. Execute the configured compiler and durably record its true
395
+ outcome; later observer recovery cannot make that invocation reusable.
396
+ - Refuse missing, malformed or mismatched state ownership before execution.
397
+ Preserve cancellation, immutable history and newest-receipt selection.
398
+ - Three fixed A–H cycles cost 15.16/15.35/15.82 seconds versus matched ordinary
399
+ compiler totals of 16.69/16.66/16.56 seconds. These modest CLI savings do not
400
+ establish real-world reuse frequency, CPU/memory or whole-agent benefit.
401
+ - Provide a [fixed-build opt-in pilot guide](docs/user/pilot.md). External usage
402
+ has not started. No compiler/platform expansion or policy redesign is included;
403
+ Claude behavior and cross-host handoff remain untested.
404
+ - Stop observers before upgrading in the same prefix, preserve config/state and
405
+ receipts, preview/apply project-local policy updates, then restart and reassess.
406
+ Never silently migrate a check. Alpha.9 remains an unshipped candidate.
407
+
408
+ ## 0.1.0-alpha.9 — unshipped candidate (2026-10-09)
409
+
410
+ - Reduce repeated caller discovery on the guarded macOS direct-TypeScript path.
411
+ Both execution boundaries still validate in the actual caller environment,
412
+ with full-probe fallback when a discovery certificate cannot be used.
413
+ - Preserve required content/membership, compiler/context, observation and durable
414
+ receipt-selection guards. The configured compiler still executes on every run.
415
+ - Recording overhead fell in the measured debugger-project sample, but every
416
+ complete A–H candidate cycle remained slower than eight ordinary compiler runs.
417
+ No net workflow saving, broader support or CPU/memory improvement is claimed.
418
+ - Stop observers before upgrading in the existing prefix, retain config/state
419
+ and receipts, then restart. No automatic migration is performed.
420
+
421
+ ## 0.1.0-alpha.8 — 2026-10-08
422
+
423
+ - Consume compiler-certificate input asynchronously while preserving the input-size
424
+ limit, parent deadline, complete-input validation and conservative fallbacks.
425
+ - Support the exact reviewed TypeScript 5.5.2 distribution in the explicitly selected
426
+ single-package npm direct-compiler recipe. Enforce implementation membership and
427
+ reject ETW module overrides before compiler API loading.
428
+ - Real independent Codex/macOS sessions reused compiler evidence on the pinned
429
+ vscode-js-debug project. Cross-platform CLI/package acceptance is separate;
430
+ Claude behavior and cross-host handoff remain untested.
431
+ - The measured eight-case workflow avoided four compiler executions but cost
432
+ 20.01 seconds versus 16.97 seconds for eight ordinary compiler runs. No net
433
+ workflow or whole-agent speedup is claimed. This verifies compiler inputs only,
434
+ not npm lifecycle behavior or application correctness.
435
+ - Stop observers before upgrading, retain the same configuration/state, then
436
+ restart. Do not delete receipts or automatically convert existing checks.
437
+
438
+ ## 0.1.0-alpha.7 — 2026-10-07
439
+
440
+ - Guide explicitly configured direct-compiler reuse through one caller-aware
441
+ synchronized query; skip reuse queries when fresh execution is already required.
442
+ - Update intact project-local agent instructions safely; installation alone does
443
+ not update them. See the [existing-user procedure](docs/user/agents.md#update-an-existing-connection).
444
+ - In the finite Codex/macOS comparison, revised guidance reached eligible evidence
445
+ and reused it in 4/4 opportunities versus 1/4; verification tool calls fell
446
+ from 28 to 14. Evidence semantics are unchanged. No universal compliance,
447
+ tail-latency or causal agent-task speedup is claimed. Claude behavior and
448
+ cross-host handoff remain untested.
449
+
450
+ ## 0.1.0-alpha.6 — 2026-10-07
451
+
452
+ - Reuse guarded compiler discovery for warm direct-TypeScript decisions on macOS
453
+ with healthy historical observation. Membership, absence, compiler bytes,
454
+ caller context and receipt selection remain validated independently.
455
+ - Keep full discovery/reconciliation fallbacks and existing platform boundaries.
456
+ - On one measured project, complete warm decision median fell from roughly
457
+ 791 to 474 ms. This is not a universal speedup, agent-task acceleration,
458
+ memory improvement, or a faster relevant-edit/rebuild claim.
459
+ - Stop observers before upgrading and restart with the same config/state.
460
+ Preserve receipts; no configuration migration is performed.
461
+
462
+ ## 0.1.0-alpha.5 — 2026-10-07
463
+
464
+ - Add opt-in project-local agent activation and direct TypeScript evidence, with
465
+ fresh-session reuse demonstrated in the tested Codex/macOS configuration.
466
+ - Preserve ordinary npm execution as a separate, recording-only obligation.
467
+ Direct compilation requires explicit selection and a fresh baseline receipt.
468
+ - Initial direct recipe supports reviewed TypeScript 5.6.3/5.9.3 in single-package
469
+ npm projects, with documented Node/environment restrictions.
470
+ - Claude integration mechanics are tested; Claude behavior and cross-host reuse
471
+ remain untested. No universal compliance or inexpensive-check speedup is claimed.
472
+
473
+ ## 0.1.0-alpha.4 — 2026-10-07
474
+
475
+ - Withdraw automatic npm-launcher applicability because update notifications consume
476
+ unobserved remote/cache/time state. Npm scripts still run and record outcomes.
477
+ - Preserve historical PASS/FAIL and require stop/start when upgrading an observer.
478
+ Do not delete receipts. See the [maintainer notice](docs/user/npm-launcher-notice.md).
479
+ - Supported Yarn/pnpm and explicit reviewed contracts are unchanged. No agent
480
+ activation or npm direct-compiler recipe is included in this correction.
481
+
482
+ ## 0.1.0-alpha.3 — 2026-10-06
483
+
484
+ Install: `npm install --global @redue/cli@alpha`.
485
+
486
+ - Fix selected execution outcomes remaining hidden behind an older observer/cache
487
+ after a missed reload notification. A newer failure must not leave an older
488
+ passing receipt eligible for reuse.
489
+ - Withhold applicability during incomplete receipt persistence, unreadable or
490
+ changing selection, and client connections to an older observer.
491
+ - Preserve immutable run history. Upgrade requires an observer stop/start;
492
+ receipts need not be deleted. See the [maintainer notice](docs/user/receipt-selection-notice.md).
493
+
3
494
  ## 0.1.0-alpha.2 — 2026-10-06
4
495
 
5
496
  Install: `npm install --global @redue/cli@alpha`.
package/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # REDUE
2
2
 
3
+ Maintainer notice: alpha.4 withdraws automatic npm-launcher applicability.
4
+ Npm commands still execute and record historical outcomes, but remain UNVERIFIED.
5
+ [Why this changed and how to upgrade without deleting receipts](docs/user/npm-launcher-notice.md).
6
+ Alpha.2 users should also review the [receipt correction](docs/user/receipt-selection-notice.md).
7
+
3
8
  **Know what still holds. Redo what's due.**
4
9
 
5
10
  You ran the checks. Then the code changed—or a new coding agent started with no
@@ -9,6 +14,8 @@ REDUE keeps persistent verification state for your codebase so developers and
9
14
  coding agents can see which previous checks still apply to the code they have now.
10
15
  It records evidence, not proofs of correctness.
11
16
 
17
+ For a qualified direct-compiler or supported Yarn/pnpm check (ordinary npm scripts are recording-only):
18
+
12
19
  ```text
13
20
  $ redue status --sync
14
21
  ✓ typecheck CURRENT / PASS
@@ -30,6 +37,11 @@ it; relevant source edits make it stale. [Run the reproducible demo](docs/contri
30
37
 
31
38
  ## Install the alpha
32
39
 
40
+ The opt-in pilot uses **0.1.0-alpha.18**. Follow the
41
+ [fixed-version pilot guide](docs/user/pilot.md) for supported projects, setup,
42
+ updates and voluntary feedback. No external usage results are claimed yet.
43
+
44
+
33
45
  REDUE is published on npm as `@redue/cli`. The installed command is `redue`.
34
46
 
35
47
  ```sh
@@ -64,6 +76,94 @@ Start with ordinary `status`. When it cannot establish caller context, use
64
76
  **Synchronization can cost more than rerunning a cheap check, particularly on
65
77
  Windows.** REDUE does not choose or execute that tradeoff for you.
66
78
 
79
+ `init` tries the strict recipes first: the [direct compiler recipe](docs/user/direct-typescript.md)
80
+ for npm typechecks, the pnpm and Yarn TypeScript recipes, and the
81
+ [direct test recipe](docs/user/tests-direct.md). A root typecheck or lint
82
+ script none of them takes can use the [general recipe](docs/user/node-script.md),
83
+ which runs the script through the package manager and records every Node
84
+ process; a script that starts another program (git, esbuild, turbo) stays
85
+ UNVERIFIED and the reason names it. Test scripts use the direct test recipe
86
+ (Vitest, Jest); other test scripts stay recording-only.
87
+
88
+ ## Connect your agent (experimental)
89
+
90
+ ```sh
91
+ redue agent setup codex --dry-run
92
+ redue agent setup codex --apply # or claude
93
+ redue agent doctor
94
+ ```
95
+
96
+ Start a fresh agent session and give it an ordinary task. Project-local guidance
97
+ teaches it to inspect evidence before deciding whether verification needs repeating.
98
+ Setup is explicit, reversible, and does not change tool permissions or run checks.
99
+ [Activation, removal, and generic-agent guidance](docs/user/agents.md).
100
+
101
+ The experimental claim is **opt-in project-local agent activation and direct TypeScript
102
+ evidence, with fresh-session reuse demonstrated in the tested Codex/macOS
103
+ configuration and measured for Claude Code below**. Cross-host reuse is not
104
+ tested. This is experimental guidance, not guaranteed agent compliance, general
105
+ sandbox compatibility, or a promise of time savings.
106
+
107
+ ### Measured with Claude Code
108
+
109
+ Four public TypeScript projects, four tasks each, three sessions per task with
110
+ and without REDUE: 96 headless Claude Code sessions (Sonnet 5.5, CI Linux
111
+ runner, alpha.12 code, October 2026). Plain `tsc --noEmit` takes 10–19 s on
112
+ these projects. Medians per task, summed over the four projects:
113
+
114
+ | Task | Session time, without → with REDUE | Input tokens | Typechecks skipped |
115
+ |---|---|---|---|
116
+ | Docs edit, then "make sure it still typechecks" | 97 → 45 s | 169k → 162k | 12 of 12 |
117
+ | "Does it still typecheck?" after a pull | 74 → 22 s | 117k → 89k | 12 of 12 |
118
+ | Source change, typecheck, then a docs edit | 141 → 112 s | 210k → 200k | 9 of 12 |
119
+ | Source change with tests | 152 → 151 s | 269k → 234k | 0 of 12 |
120
+ | **All tasks** | **464 → 330 s** | **765k → 685k** | 33 |
121
+
122
+ - **Correctness:** every typecheck REDUE skipped was checked afterwards with
123
+ plain tsc on the exact tree it was skipped on. All 33 agreed, and all 96
124
+ final trees passed plain tsc and the task checks in both arms.
125
+ - **Cost:** API cost was the same ($0.65 without, $0.66 with). One-time setup
126
+ per checkout was 3–5 s, plus one recorded typecheck; the CLAUDE.md section
127
+ REDUE adds is about 60 tokens.
128
+ - **How:** each session gets a fresh clone at a pinned commit; the REDUE arm
129
+ first runs `redue init`, `agent setup claude`, `start` and one
130
+ `redue run typecheck`, standing for an earlier session's passing check.
131
+ The harness, tasks and raw results are in [`eval/`](eval/README.md).
132
+ - **Limits:** four projects and three runs per cell show direction, not a
133
+ general rate. Savings come only when an earlier pass still applies: tasks
134
+ that change source code save nothing, and on one project the docs edit came
135
+ after source edits that made the result STALE, so nothing was skipped. The
136
+ projects were chosen because they qualify for the direct TypeScript recipe;
137
+ of 38 screened projects, 19 qualified at alpha.12 and 22 at alpha.13. Times are agent session
138
+ time only, on one runner type.
139
+
140
+ ### Unit tests, measured with Claude Code
141
+
142
+ Three public projects (cheerio with Vitest 4, SwitchHosts with Vitest 5, twilio
143
+ with Jest 29), four tasks each, three sessions per task with and without REDUE:
144
+ 72 headless Claude Code sessions (Sonnet 5.5, CI Linux runner, alpha.14 code,
145
+ October 2026), using the opt-in [direct test recipe](docs/user/tests-direct.md).
146
+ Medians per task, summed over the three projects:
147
+
148
+ | Task | Session time, without → with REDUE | Input tokens | Test runs skipped |
149
+ |---|---|---|---|
150
+ | Docs edit, then "make sure the unit tests still pass" | 95 → 41 s | 131k → 121k | 9 of 9 |
151
+ | "Do the unit tests still pass?" after a pull | 80 → 22 s | 62k → 63k | 9 of 9 |
152
+ | Source change, tests, then a docs edit | 171 → 111 s | 224k → 213k | 3 of 9 |
153
+ | Source change with tests | 169 → 120 s | 172k → 164k | 0 of 9 |
154
+ | **All tasks** | **515 → 295 s** | **589k → 559k** | 21 |
155
+
156
+ - **Correctness:** every skipped test run was rerun plainly three times on the
157
+ exact tree it was skipped on; all 21 passed every time. All 72 final trees
158
+ passed the tests and the task checks in both arms.
159
+ - **Limits:** one run of three projects shows direction, not a rate. The
160
+ source-change task skipped nothing; its time difference is session variance.
161
+ In two mixed-task sessions the agent left out its final test run on its own
162
+ after a README-only edit, without asking REDUE, and said so; the eval report
163
+ lists such sessions. Since alpha.15 the agent instructions ask agents to run
164
+ the check and leave skipping to REDUE; in a 12-session rerun of that task,
165
+ no agent left it out. Cost was the same ($0.54 without, $0.56 with).
166
+
67
167
  ## What the states mean
68
168
 
69
169
  | State | Meaning | Normal next step |
@@ -82,9 +182,14 @@ has been verified.
82
182
  - macOS, Linux, and Windows on supported local filesystems; Node 22+.
83
183
  - Linux also requires Python 3 for observation. No WSL or Git Bash needed on Windows.
84
184
  - npm, pinned Yarn `node-modules`, and pinned pnpm 12 isolated/hoisted layouts.
85
- - Automatic qualification for supported TypeScript invocations; workspace
185
+ - Automatic qualification for supported Yarn/pnpm TypeScript invocations; ordinary npm
186
+ launcher checks remain recording-only. Explicitly select the
187
+ [direct local compiler recipe](docs/user/direct-typescript.md) for the reviewed
188
+ npm/TypeScript boundary. Workspace
86
189
  boundaries follow the files actually consumed, including built declarations.
87
- - Existing test/lint/build and arbitrary commands can record results while
190
+ - Opt-in [direct test recipe](docs/user/tests-direct.md) for Vitest 4/5 and
191
+ Jest 29 in single-package npm projects on macOS and Linux.
192
+ - Other test/lint/build and arbitrary commands can record results while
88
193
  their applicability remains unqualified.
89
194
 
90
195
  The [supported-project boundary](docs/user/supported-projects.md) is deliberately