@redue/cli 0.1.0-alpha.3 → 0.1.0-alpha.30

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 (67) hide show
  1. package/CHANGELOG.md +806 -0
  2. package/README.md +157 -99
  3. package/bin/redue.mjs +267 -61
  4. package/docs/README.md +3 -1
  5. package/docs/user/agents.md +333 -15
  6. package/docs/user/configuration.md +28 -2
  7. package/docs/user/direct-typescript.md +219 -0
  8. package/docs/user/getting-started.md +49 -7
  9. package/docs/user/json.md +4 -2
  10. package/docs/user/node-script.md +177 -0
  11. package/docs/user/npm-launcher-notice.md +42 -0
  12. package/docs/user/pilot.md +146 -0
  13. package/docs/user/sandbox.md +312 -0
  14. package/docs/user/shell.md +3 -3
  15. package/docs/user/supported-projects.md +69 -23
  16. package/docs/user/tests-direct.md +143 -0
  17. package/package.json +4 -3
  18. package/src/agent-integration.mjs +467 -0
  19. package/src/agent-policy.md +28 -0
  20. package/src/cached-state.mjs +24 -1
  21. package/src/claude-hook.mjs +616 -0
  22. package/src/cli.mjs +449 -54
  23. package/src/daemon.mjs +442 -93
  24. package/src/decision-profile.mjs +15 -1
  25. package/src/decision-validation.mjs +12 -1
  26. package/src/declared-plan.mjs +38 -6
  27. package/src/direct-run-certificate.mjs +254 -0
  28. package/src/direct-typescript-probe.mjs +27 -0
  29. package/src/direct-typescript.mjs +205 -0
  30. package/src/glob.mjs +8 -0
  31. package/src/history-worker.mjs +21 -13
  32. package/src/index.mjs +108 -21
  33. package/src/installed-inputs.mjs +7 -1
  34. package/src/installed-observation.mjs +23 -0
  35. package/src/landlock.py +527 -0
  36. package/src/linux-inotify.py +39 -10
  37. package/src/node-onboarding.mjs +203 -54
  38. package/src/node-script.mjs +406 -0
  39. package/src/npm-integrity.mjs +124 -0
  40. package/src/npm-typecheck-environment.mjs +36 -0
  41. package/src/npmrc.mjs +16 -0
  42. package/src/observation.mjs +34 -12
  43. package/src/path-identity.mjs +8 -0
  44. package/src/plan-worker.mjs +17 -17
  45. package/src/pnpm-inputs.mjs +122 -57
  46. package/src/pnpm-shim-templates.json +180 -0
  47. package/src/pnpm-shims.mjs +54 -0
  48. package/src/pnpm-typecheck-probe.mjs +11 -6
  49. package/src/presentation.mjs +13 -4
  50. package/src/probe-deadline.mjs +37 -0
  51. package/src/probe-result.mjs +7 -3
  52. package/src/project-location.mjs +34 -0
  53. package/src/python-onboarding.mjs +89 -0
  54. package/src/run-recorder.cjs +91 -0
  55. package/src/sandbox.mjs +653 -0
  56. package/src/setup.mjs +205 -0
  57. package/src/stats.mjs +72 -0
  58. package/src/test-direct.mjs +608 -0
  59. package/src/test-recorder.cjs +435 -0
  60. package/src/typescript-contract-probe.mjs +4 -187
  61. package/src/typescript-input-facts.mjs +92 -0
  62. package/src/typescript-invocation.mjs +92 -0
  63. package/src/typescript-list.mjs +118 -13
  64. package/src/typescript-qualification.mjs +29 -49
  65. package/src/workspace-manifests.mjs +24 -0
  66. package/src/yarn-workspace-inputs.mjs +3 -0
  67. package/src/yarn-workspace-typecheck-probe.mjs +2 -1
@@ -57,9 +57,36 @@ prefix. Uninstalling the package does not remove local verification evidence;
57
57
  `redue remove-state` is a separate, explicit action. Alpha.1 remains available as
58
58
  historical software and is superseded for package identity, not a runtime defect.
59
59
 
60
+ ## Upgrading REDUE
61
+
62
+ Stop every observer using the installation before upgrading, then restart each
63
+ with the same config/state selection. See [the npm launcher notice](npm-launcher-notice.md)
64
+ for exact commands. Do not remove state or delete receipts. Existing agent connections require a separate
65
+ [preview/apply policy update](agents.md#update-an-existing-connection); installing
66
+ the package alone does not update project instructions.
67
+
60
68
  ## First project
61
69
 
62
- From the project root:
70
+ With Claude Code, one command does the steps below and connects the agent:
71
+
72
+ ```sh
73
+ redue setup claude # asks once; --yes for no prompts
74
+ ```
75
+
76
+ It runs `init` when the project has no `redue.config.json`, `agent setup
77
+ claude`, and `start`, then records each check that can qualify once, unless
78
+ it is already CURRENT. It prints every file it writes, and running it again
79
+ changes nothing that is already set up. When `.claude/settings.local.json`
80
+ is not ignored by Git, it adds it to `.git/info/exclude`; it refuses when
81
+ that file is committed. What setup created is noted in the clone's Git
82
+ directory (`.git/redue-setup-<id>.json`, never committed). `redue remove`
83
+ undoes exactly that: the integration (or only this machine's hooks, when the
84
+ integration was already in the project), the observer and its state
85
+ (receipts included), the local ignore line, and the config if setup wrote it
86
+ and it has not been edited since. A config or observer state that existed
87
+ before setup stays. `remove` asks before it deletes; Enter means no.
88
+
89
+ Step by step, from the project root:
63
90
 
64
91
  ```sh
65
92
  redue init --dry-run
@@ -73,8 +100,12 @@ redue explain typecheck
73
100
  Use a check actually printed by `init`. For a workspace:
74
101
  `redue init --workspace @example/package --check typecheck`.
75
102
  Initialization previews detected commands and qualification confidence before writing
76
- `redue.config.json`. An existing config is never overwritten. No checks are run and
77
- no dependencies installed. A missing/unsupported boundary is explained.
103
+ `redue.config.json`. An existing config is never overwritten. No dependencies are
104
+ installed; a check proposed for the sandboxed recipe runs once plainly and once or
105
+ twice in the sandbox, and no results are recorded. A missing/unsupported boundary is explained. `init` tries
106
+ the strict recipes first and uses the [general recipe](node-script.md) for a root
107
+ typecheck or lint script none of them takes. Test scripts use the
108
+ [sandboxed recipe](sandbox.md) first, then the [direct test recipe](tests-direct.md).
78
109
 
79
110
  “Ready to qualify” means REDUE has a supported recipe whose prerequisites will be
80
111
  validated. It is not a receipt. “Recording-only” can record PASS/FAIL without claiming
@@ -82,12 +113,15 @@ reusability. Qualification can change when configuration or installation changes
82
113
 
83
114
  `run` streams normal output and preserves execution environment and cancellation.
84
115
  For the narrow pnpm TypeScript contract, `init` explicitly shows the direct installed
85
- compiler invocation it selects; other scripts run through the package manager.
116
+ compiler invocation it selects, and for npm the
117
+ [local compiler recipe](direct-typescript.md). General checks and other scripts
118
+ run through the package manager. No existing configuration is silently migrated.
86
119
  Only use configs and probes from trusted repositories: these execute local code.
87
120
 
88
- `status` is cached and conservative. `status --sync` and `explain` revalidate caller
89
- context and may execute read-only probes. Synchronization can be slower than a cheap
90
- check, especially on Windows. Choose deliberately. A timeout is UNVERIFIED, not green.
121
+ `status` and `explain` revalidate caller context and may execute read-only probes
122
+ (`status --sync` is the same as `status`). `status --cached` is the cached,
123
+ conservative answer, without revalidating. Synchronization can be slower than a
124
+ cheap check, especially on Windows. A timeout is UNVERIFIED, not green.
91
125
 
92
126
  ## Lifecycle and removal
93
127
 
@@ -125,3 +159,11 @@ all observed roots; its basename must start with `redue-` or legacy `vstate-`.
125
159
  For a removed checkout, `redue --state-dir /your/owned/redue-project-state remove-state`
126
160
  still works without rebuilding its compiler/configuration. Ownership/active-run conflicts
127
161
  are actionable errors, never resolved merely by deleting an old lock.
162
+
163
+ ## Connect an agent explicitly
164
+
165
+ After initialization, use `redue agent setup codex --dry-run` (or `claude`) to
166
+ review project-local instructions, then repeat with `--apply`. Start a fresh host
167
+ session. `redue agent doctor` checks prerequisites without running verification.
168
+ See [agent activation](agents.md) for loading rules, generic agents, and removal.
169
+ For a fixed build and ordinary development evaluation, use the [opt-in pilot guide](pilot.md).
package/docs/user/json.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Alpha JSON interface (schema 1)
2
2
 
3
- Use `status --json` for cached state, `status --sync --json` for caller-aware
4
- applicability, and `explain CHECK --json` for selected synchronized detail.
3
+ Use `status --json` (or `status --sync --json`) for caller-aware applicability,
4
+ `status --cached --json` for cached state, and `explain CHECK --json` for selected synchronized detail.
5
5
  `detail` remains an alias. Successful reads emit one JSON object, no human prose.
6
6
 
7
7
  ```json
@@ -30,6 +30,8 @@ Stable-enough-for-alpha fields:
30
30
  | `result` | Historical `PASS`, `FAIL`, or null. A failed invocation is not green even with CURRENT applicability. |
31
31
  | `freshness` | `CURRENT`, `STALE`, or `UNVERIFIED`, independent of result. |
32
32
  | `reuse_eligible` | True only for qualified, applicable passing evidence. Never derive permission to reuse from outcome alone. Missing means false. |
33
+ | `run_facts` | Number of lookups outside the discovery certificate that the receipt's run made (direct TypeScript recipe). Status asks each again before answering CURRENT. Absent when there are none. |
34
+ | `probe_deadline_ms` | Top level. How long the full state probes of one decision may take in total: each check's deadline (5 s to 60 s, from earlier probes and runs) times its probe count, summed. Callers wait at least this long plus 10 s for a synchronized answer. |
33
35
  | `reason` | Human explanation; not a stable machine enum. Do not parse it to authorize reuse. |
34
36
  | `changed_inputs` | Known changed relevant paths when available, possibly only the first difference; empty/missing is not proof of no changes. |
35
37
  | `invocation` | Null without a receipt; otherwise run ID, completion `status`, duration, exit code/signal when known. Status distinguishes exited, interrupted, and start/capture failure. |
@@ -0,0 +1,177 @@
1
+ # General recipe (typecheck and lint scripts)
2
+
3
+ The general recipe records a project's own typecheck or lint script, run
4
+ through its package manager, and reports later whether that result still
5
+ applies to the files you have. It is a lower tier than the strict recipes:
6
+ `redue init` tries the [direct TypeScript recipe](direct-typescript.md), the
7
+ pnpm and Yarn TypeScript recipes, the [direct test recipe](tests-direct.md)
8
+ and, on macOS and Linux, the [sandboxed recipe](sandbox.md) first. It uses
9
+ the general recipe for a root typecheck or lint script none of them takes,
10
+ and where the sandbox cannot run (at init, or at run time inside Claude
11
+ Code's macOS sandbox). Test scripts use the direct test recipe or the
12
+ sandboxed recipe; `init` does not propose the general recipe for them.
13
+
14
+ It supports a project installed by npm, pnpm 9-12 (isolated or hoisted
15
+ `node_modules`) or Yarn with the `node-modules` linker, with one lockfile kind
16
+ matching any `packageManager` declaration, on macOS and Linux with Node 22 or
17
+ 24. Workspaces are supported for root scripts. `init --recipe node-script`
18
+ writes general checks only.
19
+
20
+ ## Setup
21
+
22
+ ```sh
23
+ redue init
24
+ redue start
25
+ redue run lint
26
+ redue status --sync
27
+ ```
28
+
29
+ The config gets one field for the recipe, written by `init`:
30
+
31
+ ```json
32
+ {"name": "lint", "script": "lint", "kind": "lint", "qualification": "node-script-v1", "inputs": ["**", "..."]}
33
+ ```
34
+
35
+ `redue run lint` runs `npm run lint` (or `pnpm run lint`, `yarn run lint`) with
36
+ REDUE's recorder loaded in every Node process, and npm's and pnpm's update
37
+ checks turned off. With the Claude Code hook, `npm run lint`, `pnpm lint` and,
38
+ for a script that is one plain command such as `eslint .`, that command itself
39
+ and `npx eslint .` are recognized like typecheck and test commands.
40
+ `status` and the hook's skip message name the recipe that made the receipt.
41
+
42
+ ## What REDUE claims
43
+
44
+ CURRENT means the last run's inputs are unchanged:
45
+
46
+ - every file in the checkout, except `.git`, every `node_modules`, the runner
47
+ caches listed below and the files the run itself wrote;
48
+ - the installed files in the root's and every workspace package's
49
+ `node_modules`, and Yarn's install state, by file identity;
50
+ - the lockfile and `package.json`, as files of the checkout;
51
+ - the package manager's executable and Node, by file identity, and the exact
52
+ script;
53
+ - every environment variable the run's JavaScript read directly, and always
54
+ `TZ`, `LANG`, `PATH`, `HOME`, `CI`, `XDG_CONFIG_HOME` and every `NODE_*`,
55
+ `LC_*`, `VITE_*`, `DYLD_*`, `LD_*`, `npm_config_*`, `pnpm_config_*`,
56
+ `PNPM_*`, `COREPACK_*` and `YARN_*` variable;
57
+ - the executables of npm, pnpm, Yarn and Corepack on PATH, by file identity,
58
+ since a script may run another package manager;
59
+ - small files read outside the checkout (up to 1 MB), by content, and lookups
60
+ outside it, asked again before each answer.
61
+
62
+ Runner caches are not inputs, and a run may read and write them: `.cache`,
63
+ `.vite`, `.vitest`, `.turbo`, `.nx`, `.swc`, `.jest-cache`, `.parcel-cache`,
64
+ `.angular/cache`, `.next/cache` and `.tmp` directories, `*.tsbuildinfo`,
65
+ `.eslintcache`, `.stylelintcache`, `.prettiercache`, and the
66
+ `_tmp_<pid>_<hex>` files pnpm writes and removes at every run. A file with
67
+ such a path that git does not ignore is source: reading it makes the run
68
+ UNVERIFIED. At the top of each `node_modules`, only `.cache`, `.vite`,
69
+ `.vite-temp`, `.vitest` and `.vitest-cache` are left out, and `*.tsbuildinfo`
70
+ anywhere in it.
71
+
72
+ Two installed files are rewritten by tools during a run. pnpm rewrites
73
+ `node_modules/.pnpm-workspace-state-v1.json` at the first run after an
74
+ install, through a temporary `node_modules/.tmpXXXXXX` file, and on Linux
75
+ writes a file with no name there (`O_TMPFILE`), whose writes the file
76
+ watcher reports as `node_modules/#NUMBER`. vue-tsc writes
77
+ `node_modules/.vue-global-types/*.d.ts` before it reads them. These files stay
78
+ inputs. When they are the only files a run changed, and the run wrote them,
79
+ the result is kept with the files as the run left them. A recorded process
80
+ counts as writing a file it wrote; for pnpm's files, the pnpm executable must
81
+ have run. A `#NUMBER` event counts only directly in the root `node_modules`,
82
+ on Linux, when no file has that name. A later change to them makes the
83
+ result STALE.
84
+
85
+ It does not mean a rerun would give the same result: a test that depends on
86
+ the time or on randomness can pass now and fail later on the same inputs.
87
+
88
+ ## Programs
89
+
90
+ The recorder sees only Node processes. Every other program a run starts must be
91
+ one REDUE can account for:
92
+
93
+ - `sh` or `dash`, or `bash` without `BASH_ENV`, running a command that, read
94
+ as text, starts only Node programs, package managers and shell builtins
95
+ (`cd`, `echo`, `true`, `export`, `exec` and a few more). Words are looked up
96
+ on the PATH the shell got. A Node program is the Node executable, a file
97
+ whose `#!` line runs Node, or a pnpm launcher. A version manager's `node`
98
+ shim (asdf, nodenv) is a script and does not count. Other shells read
99
+ startup files and are refused. The shell must still have REDUE's recorder in
100
+ `NODE_OPTIONS`: npm's and pnpm's `node-options` setting replaces it, and a
101
+ run under such a setting is UNVERIFIED;
102
+ - a pnpm launcher in `node_modules/.bin`: the `#!/bin/sh` script pnpm writes,
103
+ which runs `sed`, `dirname`, `uname` or `readlink` before it starts Node. It
104
+ is trusted only when its text is exactly one of the templates pnpm 8.0 to
105
+ 12.14 write (`src/pnpm-shim-templates.json`), with only the bin file and
106
+ `NODE_PATH` filled in;
107
+ - the pnpm executable (pnpm 12, also the copy Corepack downloads): REDUE cannot
108
+ see what it does, so the scripts it runs are read as text the same way,
109
+ their `pre` and `post` scripts included. Filters and recursive runs
110
+ (`--filter`, `-r`) are refused. At least one Node process it starts must
111
+ have loaded the recorder, and its configuration files outside the checkout
112
+ (`pnpm/rc`, `pnpm/config.yaml`, `~/.npmrc`, the global `npmrc`) are kept by
113
+ content;
114
+ - `ps -A -o ppid,pid`, which pnpm loaded into Corepack runs.
115
+
116
+ A process that replaces itself with another program through
117
+ `process.execve` (TypeScript 7's `tsc` does this to start its native
118
+ compiler) is judged the same way as a program it starts. `init` reads
119
+ TypeScript 7's launchers (`tsc` from `typescript@7`, `tsgo` from
120
+ `@typescript/native-preview`) as that native compiler and keeps such a script
121
+ recording-only.
122
+
123
+ Anything else makes the result UNVERIFIED and names the program: `git`,
124
+ `sleep`, `find`, and native programs from installed packages such as esbuild,
125
+ turbo, tsgo, tsgolint and biome, whose reads, writes and network use REDUE
126
+ cannot see. `init` reads the script the same way. A typecheck or lint script
127
+ gets the [sandboxed recipe](sandbox.md) first where it can run, which covers
128
+ such programs; otherwise a script that starts one stays recording-only, with
129
+ the program in the reason.
130
+
131
+ A command line may use `&&`, `||`, `;`, `|`, quotes without expansions,
132
+ globs in arguments and redirection to `/dev/null`. Variables, command
133
+ substitution, input redirection, subshells, here-documents and `command -p`
134
+ are refused. Setting or clearing `NODE_OPTIONS`, `PATH`, `REDUE_RUN_RECORD`,
135
+ `BASH_ENV`, `ENV`, or npm's or pnpm's `node-options` or `script-shell` is
136
+ refused, since it could stop a Node process from loading the recorder.
137
+ `node --env-file` and Node's config-file options are refused: Node reads those
138
+ files natively. `process.loadEnvFile` is recorded as a read.
139
+
140
+ ## The guard
141
+
142
+ As in the [direct test recipe](tests-direct.md#the-guard), the result is kept
143
+ but marked UNVERIFIED, with the reason, when the run read a git-ignored file
144
+ REDUE does not observe and did not create first, changed an input during the
145
+ run (a formatter's `--write`, a generated `version.ts`), listed a directory or
146
+ read a large file outside the checkout, used the network, or started a program
147
+ REDUE does not account for. Reads through a workspace package's link in
148
+ `node_modules` count where the link leads.
149
+
150
+ The package managers' own installations, Corepack's downloads and npm's log
151
+ directory are toolchain, identified by the package manager's executable, not
152
+ inputs.
153
+
154
+ ## Limits
155
+
156
+ - On macOS, a file created and removed directly in the project root during a
157
+ run (pnpm 12 does this) can be reported by the file watcher as an event on
158
+ the root itself, an observation gap that makes the run UNVERIFIED. Linux
159
+ reports the file, which is not an input.
160
+ - On Linux, any program's file with no name in the root `node_modules`,
161
+ written during a run that started the pnpm executable, is taken as pnpm's.
162
+ If that program gives the file a real name (any name, `node_modules`
163
+ included) and then writes through the open file, REDUE misses those
164
+ writes. A real file named `node_modules/#NUMBER` that is created and
165
+ removed within such a run is treated the same way. Outside a pnpm run,
166
+ these writes leave the run UNVERIFIED.
167
+ - The pnpm executable and the pnpm launchers' helpers are trusted as
168
+ toolchain: what they read is not checked.
169
+ - Code that copies the environment and reads the copy, and native code that
170
+ reads files or variables or starts programs (native addons such as
171
+ Rust-based resolvers), is not seen. Neither are files opened by
172
+ `node:sqlite` or preopened for `node:wasi`.
173
+ - A project whose `.npmrc` sets `node-options` stays UNVERIFIED: npm replaces
174
+ `NODE_OPTIONS` with it, which drops REDUE's recorder.
175
+ - A script that runs a build first (`npm run build && tsc --noEmit`) usually
176
+ starts esbuild or another native bundler and stays UNVERIFIED.
177
+ - Windows is not supported; the check stays recording-only there.
@@ -0,0 +1,42 @@
1
+ # npm launcher applicability correction — alpha.4
2
+
3
+ Alpha.4 withdraws automatic applicability for npm-backed TypeScript checks using
4
+ `typescript-noemit-v1`. Alpha.3 was demonstrated to admit an npm invocation whose
5
+ update notification consumes unobserved remote responses, cache and time. Those
6
+ inputs can change the outer npm result without changing the tracked project or
7
+ caller identity. The controlled reproduction does not establish a public registry
8
+ malfunction, affected-user count, or compiler completion in the failing npm case.
9
+
10
+ Npm commands still execute exactly as configured through `redue run CHECK`.
11
+ They still record PASS/FAIL. Previous PASS remains historical PASS; applicability
12
+ is now UNVERIFIED, including after synchronization or a successful new npm run.
13
+ This is a correction to the claimed boundary, not evidence that the code failed.
14
+ Supported Yarn/pnpm and independently reviewed explicit contracts are unchanged.
15
+
16
+ Until upgraded, do not rely solely on automatic npm CURRENT to skip the npm
17
+ invocation. A different verification recipe requires explicit selection and fresh
18
+ evidence; it cannot reinterpret an old npm receipt. Alpha.4 does not ship the
19
+ experimental npm direct-compiler recipe or agent activation.
20
+
21
+ ## Upgrade without losing history
22
+
23
+ First stop **every observer using this installation**, using each original config
24
+ and any explicit state directory. Then upgrade that same installation and restart
25
+ each observer with the same selections:
26
+
27
+ ```sh
28
+ redue --config /path/to/project/redue.config.json stop
29
+ npm install --global @redue/cli@0.1.0-alpha.4
30
+ redue --config /path/to/project/redue.config.json start
31
+ redue --config /path/to/project/redue.config.json status --sync
32
+ ```
33
+
34
+ Repeat the stop/start commands for each project. If you originally used
35
+ `--state-dir`, supply the identical directory on every REDUE command. If installed
36
+ with a custom npm `--prefix`, supply the same prefix during installation. On Windows
37
+ use `npm.cmd`/`redue.cmd` if required by existing PowerShell policy; do not change it.
38
+
39
+ **Do not delete receipts or use `remove-state` as an upgrade step.** An upgraded
40
+ client refuses an obsolete running observer interpretation and asks for stop/start.
41
+ Restart reconciles existing state and preserves immutable historical runs. This
42
+ correction does not silently change your project config or configured command.
@@ -0,0 +1,146 @@
1
+ # Opt-in development pilot: alpha.18
2
+
3
+ Use one fixed build for several ordinary development sessions. The owner will
4
+ invite two or three willing testers and approve their projects; nothing is
5
+ collected or uploaded automatically. External usage has **not started**. Earlier
6
+ controlled compiler/agent trials are acceptance evidence, not independent adoption.
7
+
8
+ ## Check the boundary first
9
+
10
+ Start with a trusted, single-package npm Git checkout, normally installed locked
11
+ dependencies, and an existing standalone `tsc --noEmit` script without pre/post
12
+ scripts. The direct recipe accepts only an official, unchanged TypeScript **5.x or
13
+ 6.0** package (a reviewed release, or one matching the tarball package-lock.json
14
+ names in npm's cache) and Node **22 or 24**. No workspaces, named
15
+ tsconfig selection, emitted/incremental/composite builds, custom loaders or
16
+ outside-root inputs are added by this pilot. Do not downgrade or change your
17
+ project to fit; record an unsupported setup as feedback.
18
+
19
+ Development-mode source-map support, Node preloads/inspectors/compile-cache
20
+ overrides and `TS_ETW_MODULE_PATH` are unsupported. A few inert Node settings
21
+ are accepted; see [Node settings](direct-typescript.md#node-settings). The injected
22
+ `NODE_USE_ENV_PROXY=1` context is reviewed only on Node **22.13.0**; leave the
23
+ environment and security controls intact. See the [full recipe boundary](direct-typescript.md).
24
+
25
+ CLI/package mechanics are tested on macOS/APFS, native Linux and Windows/NTFS;
26
+ Linux also needs Python 3 and [supported native storage](getting-started.md).
27
+ Actual fresh-session behavior was tested with Codex **0.162.0 on macOS**, Node
28
+ 22.13.0 and the approved exact checkout/state/socket access. This is not general
29
+ sandbox compatibility. Claude mechanics are tested, and the
30
+ [Claude Code typecheck hook](agents.md#claude-code-typecheck-hook) was exercised in
31
+ Claude Code 2.1.302 (`claude -p`). Broader Claude behavior and cross-host handoff
32
+ are **NOT RUN**. The recording shortcut is macOS/direct-recipe only.
33
+
34
+ ## Install and connect explicitly
35
+
36
+ For a new default npm installation:
37
+
38
+ ```sh
39
+ npm install --global @redue/cli@0.1.0-alpha.18
40
+ redue --version
41
+ cd my-project
42
+ redue --config redue.config.json init --recipe typescript-direct --check typecheck --dry-run
43
+ redue --config redue.config.json init --recipe typescript-direct --check typecheck
44
+ redue --config redue.config.json agent setup codex --dry-run
45
+ redue --config redue.config.json agent setup codex --apply
46
+ redue --config redue.config.json start
47
+ redue --config redue.config.json agent doctor codex --json
48
+ ```
49
+
50
+ Use the discovered check name. Review both previews before applying. The recorded
51
+ invocation is the resolved local Node/compiler with `--noEmit`, **not npm or its
52
+ lifecycle scripts**. Neither init nor setup executes verification. An existing
53
+ config is never overwritten; use the [deliberate check replacement procedure](direct-typescript.md#existing-npm-configuration-deliberate-replacement)
54
+ without losing other checks or changing config/state identity. For an owned custom
55
+ installation prefix or Windows command shims, use the [installation instructions](getting-started.md).
56
+
57
+ Run doctor inside the agent's actual command boundary too. A healthy outside-shell
58
+ result does not prove access. The owner must grant only the intended checkout,
59
+ owned state directory and exact observer endpoint through supported host controls.
60
+ The observer can write its index, run trusted configured probes in its own process
61
+ context, reload receipts and stop; endpoint access is more than a file read.
62
+ Do not disable sandboxing, bypass the proxy, or allow all sockets. If access is
63
+ unavailable, record the limitation; an installed skill is not behavioral acceptance.
64
+ See [access and diagnostics](agents.md). Doctor does not run verification or sync.
65
+
66
+ Complete setup before the first real verification obligation. When that obligation
67
+ arises, record the configured compiler check in the intended execution context:
68
+
69
+ ```sh
70
+ redue --config redue.config.json run typecheck
71
+ redue --config redue.config.json status --sync --json
72
+ ```
73
+
74
+ A successful run may remain **UNVERIFIED**. Reuse needs understood schema, healthy
75
+ observation, CURRENT, PASS and `reuse_eligible: true`; a receipt or exit code alone
76
+ is insufficient. Recovery cannot repair a run's missing start observation. A later
77
+ fully observed run can create new eligible evidence. Do not erase receipts to get green.
78
+
79
+ Start a fresh agent session after connecting, then work normally. Keep ordinary
80
+ task requests and explicit fresh-verification obligations; an explicit npm-script
81
+ request still requires npm. Let later sessions occur naturally—do not manufacture
82
+ edits, restarts or repeated queries to inflate reuse. Configured compiler evidence
83
+ does not verify tests, npm lifecycle behavior or application correctness.
84
+
85
+ ## Update or leave without losing evidence
86
+
87
+ Keep the pilot version fixed unless a real defect requires a reviewed update.
88
+ Record any build boundary. Before replacing an installation, stop every observer
89
+ using it; keep the same npm prefix, config and any explicit state selection.
90
+
91
+ ```sh
92
+ redue --config redue.config.json stop
93
+ npm install --global @redue/cli@0.1.0-alpha.18
94
+ redue --config redue.config.json agent setup codex --dry-run
95
+ redue --config redue.config.json agent setup codex --apply
96
+ redue --config redue.config.json start
97
+ redue --config redue.config.json status --sync --json
98
+ ```
99
+
100
+ Package installation alone does not update project instructions. Setup updates
101
+ intact owned content, preserves unrelated text and refuses edited managed content.
102
+ Review conflicts; do not delete ownership records to force an update. Setup metadata
103
+ can invalidate prior applicability; reassess normally and start a fresh agent session.
104
+ Historical receipts remain. See [the complete update procedure](agents.md#update-an-existing-connection).
105
+
106
+ To disconnect and uninstall, using the same installation prefix when applicable:
107
+
108
+ ```sh
109
+ redue --config redue.config.json agent remove codex --dry-run
110
+ redue --config redue.config.json agent remove codex --apply
111
+ redue --config redue.config.json stop
112
+ npm uninstall --global @redue/cli
113
+ ```
114
+
115
+ This preserves project config and receipts. Do not use `remove-state` for an upgrade
116
+ or pilot exit. Edited managed content is left intact with a conflict for review.
117
+
118
+ ## Voluntary notes, reviewed before sharing
119
+
120
+ Keep a small local note per real verification obligation, including setup failures
121
+ and abandoned attempts. Use existing local receipts/tool history only when you
122
+ choose; do not enable automatic transcript capture. Suggested fields:
123
+
124
+ | Field | Record |
125
+ | --- | --- |
126
+ | Context | Build, OS/Node/compiler/host versions, anonymous project/session label |
127
+ | Obligation | What actually needed verification; explicit fresh execution if requested |
128
+ | Decision | Consulted? Agent-visible CURRENT/PASS/eligible, STALE, unsupported or unavailable? |
129
+ | Outcome | Actual reuse with no equivalent execution; wrapped run; execution outside REDUE; or unresolved |
130
+ | Evidence | Local before/after receipt IDs and actual commands, reviewed locally |
131
+ | Cost | Measured setup/restart/query/recording/execution durations, if available |
132
+ | Friction | What failed or confused; why you continued or stopped using REDUE |
133
+
134
+ A CURRENT query is not automatically a saved run; an inspection needing no
135
+ verification is not an avoided check. Do not infer a counterfactual from a receipt.
136
+ Label estimated avoided compiler cost and its assumptions separately from measured
137
+ time. Include recording, restarts and required reruns. Whole-task time alone does
138
+ not establish causal speedup. The question is whether natural later reuse repays
139
+ the cost of creating and maintaining evidence.
140
+
141
+ Share only a voluntary owner-reviewed, redacted summary through the
142
+ [existing issue tracker](https://github.com/msiric/redue/issues). Keep private source,
143
+ paths, configuration bodies, credentials, receipts and raw transcripts out of public
144
+ issues. Sensitive correctness/security reports use the repository's private security
145
+ reporting channel. Maintain one short friction list, prioritize correctness first,
146
+ and choose the next development task from observed usage rather than a benchmark target.