@redue/cli 0.1.0-alpha.10 → 0.1.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,111 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.12 — 2026-10-19
4
+
5
+ Bench numbers below are from one 800-file project on macOS arm64, Node 22.13.0.
6
+ Released alpha.11 and this build ran interleaved on the same machine; the
7
+ decision path is unchanged within noise (warm `status --sync` 183/410 ms on
8
+ alpha.11, 298/174 ms on alpha.12; states correct, no idle probe launches).
9
+ On a screen of 38 public TypeScript projects in CI, 10 qualified for the
10
+ direct recipe before the run-facts change, 17 after it and 19 after incremental
11
+ and references support. worldmonitor and Recordly now stop at the 5 s probe
12
+ timeout, and open-cowork at its end-checkpoint probe.
13
+
14
+ - Large installations reach ready quickly. Installed files are observed by
15
+ identity (inode, size, mode, link count, times), not by hashing their contents;
16
+ the compiler's own reads stay content-checked by the probe. On macOS:
17
+ Recordly (75k files in `node_modules`) ready in 7 s instead of failing after
18
+ 120 s; worldmonitor (143k) in 30 s instead of not ready after 15 min.
19
+ Behavior change: reinstalling identical packages, restoring an installed
20
+ file's bytes or copying the installation now makes the check STALE once.
21
+ - The direct TypeScript recipe supports TypeScript 6.0.2 and 6.0.3.
22
+ - Claude Code: the typecheck hook also matches a typecheck that starts a `;` or
23
+ `&&` chain. When it skips one, the message names the rest of the chain. The
24
+ skill lists the exact commands the hook matches for the selected config.
25
+ - Shorter agent instructions: the CLAUDE.md block is 235 bytes instead of 739,
26
+ the skill 1.8 KB instead of 5 KB. The reuse rules are unchanged. When the
27
+ Claude Code hook matches a typecheck, the block no longer points to the
28
+ skill; the skill stays for agents that look for it.
29
+ - Claude Code hook: it waits for status up to half the last completed run's
30
+ duration, at most 10 s, instead of a fixed 2 s. Run `redue agent setup claude
31
+ --apply` again to raise the hook's Claude Code timeout from 5 s to 15 s.
32
+ - Linux: the observer no longer watches `.git` directories. Before, each new
33
+ directory git created there (on most commits) was an observation gap: status
34
+ was UNVERIFIED until a full reindex and probe finished, about 5 s on a
35
+ 26k-file project. Input patterns that name a `.git` directory are now
36
+ refused; REDUE never observed changes there.
37
+ - Direct TypeScript recipe: runs with `declaration: true` are reusable. tsc's
38
+ declaration checks look up files that building the program does not, and
39
+ read dependencies' `package.json`; before, any such lookup made the run
40
+ UNVERIFIED. The receipt now keeps those existence, `realpath` and
41
+ `package.json` answers as run facts, and status asks them again before every
42
+ CURRENT answer, including when a cached status is read. Every direct run is
43
+ now recorded, also one checked by full probes. The probe also records
44
+ `realpath` while it parses a tsconfig `extends` from a package.
45
+ Behavior change: a direct receipt recorded by an earlier version is
46
+ UNVERIFIED until the check runs again (macOS and Linux). Limit: Windows does
47
+ not record direct runs, so declaration-only lookups are not checked there.
48
+ - Direct TypeScript recipe: a root tsconfig with `incremental: true` is
49
+ supported. Its build-info file is left out of the inputs, and the run may
50
+ write only that file. A root tsconfig that references a composite config
51
+ (such as Vite's `tsconfig.node.json`) is supported when the program does not
52
+ use the referenced project's files. A `composite` root is still refused.
53
+ - Releases are published to the `latest` npm tag as well as `alpha`, so
54
+ `npm install -g @redue/cli` installs the newest release.
55
+
56
+ ## 0.1.0-alpha.11 — 2026-10-18
57
+
58
+ Bench numbers below are from one 800-file project on macOS arm64, Node 22.13.0.
59
+ Released alpha.10 and this build ran back to back on the same machine.
60
+
61
+ - Faster status decisions for the direct TypeScript recipe on macOS and Linux.
62
+ The observer checks the compiler's recorded filesystem questions in-process
63
+ instead of starting a probe that rebuilds the whole program. A full probe runs
64
+ only when that check fails, the plan or toolchain changes, or observation was
65
+ interrupted. While idle it no longer starts any probe process.
66
+ - warm `status --sync`: 741 → 194 ms (+683 → +154 ms over cached `status`)
67
+ - `status --sync` after an unrelated edit: 619 → 219 ms
68
+ - `status --sync` after a relevant edit: 1472 → 321 ms. It answers STALE without
69
+ a full probe when the edited inputs already differ from the receipt.
70
+ - probe processes started in 20 s idle: 4 → 0
71
+ - Cheaper `redue run` on macOS and Linux. The compiler records its own inputs
72
+ while it runs, so REDUE no longer probes before and after the compile. After
73
+ a relevant edit, the run builds the new certificate from that recording instead
74
+ of running a full probe. Output and exit code are those of plain `tsc`.
75
+ - repeat run: 4143 → 2752 ms, overhead over plain `tsc` 72% → 16%
76
+ - run right after a relevant edit: 3990 → 2802 ms, overhead 65% → 18%
77
+ - The direct TypeScript recipe accepts inert Node settings. Before, any non-empty
78
+ `NODE_*` setting other than `NODE_ENV` kept a check from becoming CURRENT.
79
+ Now accepted: `NODE_EXTRA_CA_CERTS`, `NODE_PATH`, and `NODE_OPTIONS` made only of
80
+ `--max-old-space-size`, `--max-semi-space-size`, `--use-openssl-ca`,
81
+ `--use-bundled-ca`, `--use-system-ca` and `--dns-result-order`. A run under one
82
+ value is not reused under another. See [Node settings](docs/user/direct-typescript.md#node-settings).
83
+ - `redue agent setup claude --apply` adds a Claude Code hook to
84
+ `.claude/settings.local.json`. When the agent reruns a configured typecheck
85
+ that is CURRENT and PASS, the hook blocks it and names the passing run. When
86
+ the check is not CURRENT, it rewrites the command to `redue run CHECK`, so the
87
+ result is recorded and the next identical command can be skipped. Prefix a
88
+ command with `REDUE_FORCE=1` to always run it. On the bench: a skip decision
89
+ takes about 155 ms; a forced command adds 39 ms. Tested live with Claude Code
90
+ 2.1.302 (`claude -p`). See [the hook](docs/user/agents.md#claude-code-typecheck-hook).
91
+ - Unstable-run and observation-gap reasons now name the failed check or operation.
92
+ - macOS counts each input event once, which removes an intermittent UNVERIFIED
93
+ after an edit.
94
+
95
+ Known limits:
96
+
97
+ - Two bench targets are still missed: warm sync adds 154 ms over cached status
98
+ (target < 100 ms), and `redue run` adds 16–18% over plain `tsc` (target < 10%).
99
+ - An edit that changes imports, configuration or lib files still costs one full
100
+ probe, at the end of the next run.
101
+ - Windows keeps the earlier probe-based path, except the STALE shortcut. Yarn
102
+ and pnpm recipes still probe on each decision. The bench was not run on Linux.
103
+ - The Claude hook covers the Bash tool only, from the project root. It allows the
104
+ rewritten command without a permission prompt. It judges its own environment,
105
+ not variables the Bash tool adds from your shell profile.
106
+ - To upgrade, stop observers, install into the same prefix, and keep config, state
107
+ and receipts. Rerun `redue agent setup claude --apply` to add the hook.
108
+
3
109
  ## 0.1.0-alpha.10 — 2026-10-10
4
110
 
5
111
  - Combine guarded caller-discovery reuse and cheaper non-reusable recording on
package/README.md CHANGED
@@ -37,7 +37,7 @@ it; relevant source edits make it stale. [Run the reproducible demo](docs/contri
37
37
 
38
38
  ## Install the alpha
39
39
 
40
- The opt-in pilot uses **0.1.0-alpha.10**. Follow the
40
+ The opt-in pilot uses **0.1.0-alpha.12**. Follow the
41
41
  [fixed-version pilot guide](docs/user/pilot.md) for supported projects, setup,
42
42
  updates and voluntary feedback. No external usage results are claimed yet.
43
43
 
package/bin/redue.mjs CHANGED
@@ -9,12 +9,10 @@ import path from 'node:path';
9
9
  import {createHash} from 'node:crypto';
10
10
  import {spawn,spawnSync} from 'node:child_process';
11
11
  import {createRequire} from 'node:module';
12
- import {fileURLToPath} from 'node:url';
13
- import {discoverNodeProject} from '../src/node-onboarding.mjs';
12
+ import {fileURLToPath,pathToFileURL} from 'node:url';
14
13
  import {processAlive} from '../src/process-liveness.mjs';
15
14
  import {samePath,withinPath,realObservedPath} from '../src/path-identity.mjs';
16
15
  import {discoverConfig,projectState,canonicalConfig} from '../src/project-location.mjs';
17
- import {agentCommand} from '../src/agent-integration.mjs';
18
16
  import {findExecutable} from '../src/executable-lookup.mjs';
19
17
  import {readCachedStatus} from '../src/cached-state.mjs';
20
18
  import {assertOwnedStatePlacement} from '../src/owned-state.mjs';
@@ -46,6 +44,12 @@ No checks run in the background. Direct commands outside redue create no receipt
46
44
 
47
45
  function error(message){console.error(`redue: ${message}`);process.exit(2);}
48
46
  const args=process.argv.slice(2);
47
+ if(args.length===3&&args[0]==='agent'&&args[1]==='hook'&&args[2]==='claude'){
48
+ // Runs before config discovery: the hook must exit 0 on every failure,
49
+ // because Claude Code treats exit 2 as a block.
50
+ const {runClaudeHook}=await import('../src/claude-hook.mjs');
51
+ await runClaudeHook(fileURLToPath(import.meta.url));process.exit(0);
52
+ }
49
53
  if(args.length===1&&args[0]==='--version'){console.log(version);process.exit(0);}
50
54
  if(args.includes('--help')||args.includes('-h')||!args.length){console.log(help);process.exit(0);}
51
55
  let configFile=null,stateOverride=null;
@@ -62,8 +66,12 @@ try{configFile??=command==='init'||stateOverride&&['stop','remove-state'].includ
62
66
  catch(e){error(e.message);}
63
67
  if(fs.existsSync(path.dirname(configFile)))configFile=canonicalConfig(configFile);
64
68
  if(command==='agent'){
69
+ // Loaded on demand: onboarding and agent setup are not on the run/status path.
70
+ const {agentCommand}=await import('../src/agent-integration.mjs');
65
71
  try{await agentCommand(args,{configFile,stateOverride,entry:fileURLToPath(import.meta.url)});}
66
72
  catch(e){error(e.message);}
73
+ // Exiting with piped output still queued truncates it (8 KB on macOS).
74
+ await new Promise(resolve=>process.stdout.write('',resolve));
67
75
  process.exit(0);
68
76
  }
69
77
  if(!['init','start','stop','status','detail','explain','run','remove-state'].includes(command))
@@ -88,6 +96,7 @@ if(short&&(command!=='status'||json||sync))error('--short is a cached status opt
88
96
  if(dryRun&&command!=='init')error('--dry-run is for init');
89
97
 
90
98
  if(command==='init'){
99
+ const {discoverNodeProject}=await import('../src/node-onboarding.mjs');
91
100
  let discovery;try{discovery=discoverNodeProject(process.cwd(),{recipe:recipeSelection});}
92
101
  catch(e){error(e.message);}
93
102
  if(workspaceSelection||checkSelection){
@@ -322,7 +331,13 @@ if(command==='status'&&!sync){
322
331
  const details=command==='detail'||command==='explain';
323
332
  const internal=command==='remove-state'?'uninstall':
324
333
  details?'sync':command==='status'&&sync?'sync':command;
325
- if(command==='run'){
334
+ // On macOS and Linux the engine runs in this process, which saves a Node startup
335
+ // on every run; its own handlers receive SIGINT and SIGTERM. Windows keeps a
336
+ // child engine because cancellation reaches it over IPC.
337
+ if(command==='run'&&process.platform!=='win32'){
338
+ process.argv=[process.argv[0],engine,runtimeFile,internal,check,...(!json?['--human']:[])];
339
+ await import(pathToFileURL(engine).href);
340
+ }else if(command==='run'){
326
341
  const child=spawn(process.execPath,[engine,runtimeFile,internal,check,...(!json?['--human']:[])],
327
342
  {stdio:['inherit','inherit','inherit','ipc'],env:process.env});
328
343
  const forward=signal=>{if(child.exitCode!==null)return;
@@ -337,19 +352,20 @@ if(command==='run'){
337
352
  process.off('SIGINT',interrupt);process.off('SIGTERM',terminate);
338
353
  if(outcome.error)error(outcome.error.message);
339
354
  process.exit(outcome.status??(outcome.signal?128+os.constants.signals[outcome.signal]:1));
355
+ }else{
356
+ mark('client.engine_submit');
357
+ const result=spawnSync(process.execPath,[engine,runtimeFile,internal,...(check?[check]:[])],
358
+ {stdio:['inherit','pipe','inherit'],
359
+ encoding:'utf8',env:traceEnvironment()});
360
+ mark('client.engine_complete',{exit:result.status,signal:result.signal});
361
+ if(result.error)error(result.error.message);
362
+ if(result.stdout){
363
+ if(['status','detail','explain'].includes(command)){
364
+ let value;try{value=JSON.parse(result.stdout);}catch{error('status response could not be read; applicability is unknown');}
365
+ if(details&&check)value={...value,checks:value.checks.filter(row=>row.name===check)};
366
+ if(json)console.log(JSON.stringify(value));
367
+ else console.log(details?renderExplain(value,check):renderStatus(value,{short}));
368
+ }else printLifecycle(result.stdout,command,json);
369
+ }
370
+ process.exit(result.status??1);
340
371
  }
341
- mark('client.engine_submit');
342
- const result=spawnSync(process.execPath,[engine,runtimeFile,internal,...(check?[check]:[])],
343
- {stdio:['inherit','pipe','inherit'],
344
- encoding:'utf8',env:traceEnvironment()});
345
- mark('client.engine_complete',{exit:result.status,signal:result.signal});
346
- if(result.error)error(result.error.message);
347
- if(result.stdout){
348
- if(['status','detail','explain'].includes(command)){
349
- let value;try{value=JSON.parse(result.stdout);}catch{error('status response could not be read; applicability is unknown');}
350
- if(details&&check)value={...value,checks:value.checks.filter(row=>row.name===check)};
351
- if(json)console.log(JSON.stringify(value));
352
- else console.log(details?renderExplain(value,check):renderStatus(value,{short}));
353
- }else printLifecycle(result.stdout,command,json);
354
- }
355
- process.exit(result.status??1);
@@ -71,6 +71,65 @@ setup requires `--apply`. `--dry-run` never writes. Installing REDUE or running
71
71
  `init` does not connect an agent automatically. Setup does not start an observer
72
72
  or execute verification. Use `redue start` when you want observation.
73
73
 
74
+ ## Claude Code typecheck hook
75
+
76
+ `redue agent setup claude --apply` also adds a PreToolUse hook to
77
+ `.claude/settings.local.json`. The hook needs a local REDUE install, so it is
78
+ per-developer; keep that file out of commits. Other settings in the file are kept,
79
+ but the file is rewritten as 2-space JSON. `.claude/settings.json` is not touched.
80
+ `redue agent remove claude --apply` removes only the entry REDUE added.
81
+
82
+ The hook skips an exact rerun of a configured typecheck: a check with
83
+ `kind: "typecheck"` or named `typecheck`. It matches these commands, run from the
84
+ project root:
85
+
86
+ - `redue run CHECK`, or `redue --config FILE run CHECK` when the config is not
87
+ `redue.config.json`
88
+ - `npm run SCRIPT`, when the check has an npm script
89
+ - `npx tsc --noEmit`, for the direct-TypeScript recipe
90
+ - the check's `command`, when it has no `@` tokens
91
+
92
+ Each form may end with `2>&1` and then one `| tail -n N`, `| head -n N`,
93
+ `| tail -N` or `| head -N`. It may also be the first command of a `;` or `&&`
94
+ chain. Nothing else matches. Each form has its own `if` rule, so other Bash
95
+ commands never start the hook. The installed skill lists these exact commands,
96
+ so the agent uses forms the hook recognizes.
97
+
98
+ On a match, the hook runs `redue status --sync --json`. It waits up to half the
99
+ duration of the check's last completed run, at most 10 seconds, so waiting never
100
+ costs more than half a run. With no completed run it waits 2 seconds. A check
101
+ that takes a few hundred milliseconds is therefore rarely skipped; skipping it
102
+ would save almost nothing, and the hook does not rewrite it to `redue run`
103
+ either. Claude Code's own limit for the hook is 15 seconds.
104
+ It blocks the command only when the check is CURRENT, PASS and
105
+ `reuse_eligible: true`. The message names the check and the receipt's run ID. Every
106
+ other result allows the command: STALE, UNVERIFIED, FAILED, a timeout, an error, or
107
+ a missing `redue`. A command that starts with `REDUE_FORCE=1` always runs. A
108
+ blocked chain runs none of its commands; the message names the rest of the chain
109
+ so the agent can run it on its own.
110
+
111
+ When the check is not CURRENT but the observer answered for it, the hook rewrites
112
+ the command to `redue run CHECK` and allows it, keeping any `2>&1` and
113
+ `| tail`/`| head` suffix. It adds `--config FILE` when the config is not
114
+ `redue.config.json`. The run is recorded, so the next identical command can be
115
+ skipped. Without a healthy answer (timeout, error, no observer) the command runs
116
+ as typed. Claude Code still applies deny and ask rules to the rewritten command.
117
+ A chain is never rewritten: the rewrite is allowed without a prompt, and that
118
+ would also skip the prompt for the rest of the chain.
119
+
120
+ Limits:
121
+
122
+ - The hook judges its own environment, which Claude Code passes to it. The Bash
123
+ tool can add variables from your shell profile. The hook cannot see those.
124
+ - Commands run from a subdirectory, after another command (`cd x && tsc`), or
125
+ combined with `||`, `&` or other pipes, are not matched.
126
+ - A skip writes nothing. If a typecheck command also emits files, later
127
+ commands see the files from its last run.
128
+ - Only the Bash tool is covered, not PowerShell.
129
+ - Run setup again after you rename a check or script.
130
+ - The rewrite is allowed without a permission prompt, even where the original
131
+ command would have prompted.
132
+
74
133
  ## Update an existing connection
75
134
 
76
135
  Installing a newer package does **not** rewrite project instructions. From the
@@ -107,10 +166,13 @@ historical evidence, but setup may make them STALE or UNVERIFIED. Reassess norma
107
166
  and run required checks; an upgrade is not a promise that existing receipts remain
108
167
  CURRENT. Do not suppress that invalidation or reset state.
109
168
 
110
- Codex gets a short managed section in project `AGENTS.md` and
111
- `.agents/skills/redue-verification/SKILL.md`. Claude Code gets a managed section
112
- in `CLAUDE.md` and `.claude/skills/redue-verification/SKILL.md`. Each uses the same
113
- policy source; detailed guidance is loaded when verification is relevant. Small
169
+ Codex gets a short managed section in project `AGENTS.md` that points to
170
+ `.agents/skills/redue-verification/SKILL.md`. Claude Code gets one in `CLAUDE.md`
171
+ that names the typecheck command the hook matches and says what a skip means,
172
+ plus `.claude/skills/redue-verification/SKILL.md`. The skill holds the reuse
173
+ rules and the exact commands for the selected config. When the hook matches a
174
+ typecheck, the `CLAUDE.md` section does not point to the skill: the hook does
175
+ the work, and the skill is there for agents that look for it. Small
114
176
  ownership records in `.redue/agents/` support safe updates/removal. These are
115
177
  portable project files, not receipts; review and commit them if the team wants
116
178
  this integration. Do not ignore just the ownership records while committing the
@@ -138,7 +200,8 @@ request; it does not synchronize or run these probes.
138
200
  config resolution, cached observer health, a bounded read-only control-access probe,
139
201
  managed-file integrity, detected host
140
202
  version, and loading guidance. `behavior_verified: false` is deliberate: intact
141
- files do not prove the agent followed them. No hooks are installed. Doctor neither
203
+ files do not prove the agent followed them. For Claude, doctor reports whether the
204
+ typecheck hook is installed. Doctor neither
142
205
  executes checks nor starts observers, reconciles inputs, or installs a host.
143
206
 
144
207
  Doctor separates missing/unreadable state, a missing or refused endpoint, an
@@ -192,8 +255,8 @@ instruction file containing user content.
192
255
 
193
256
  Commands from nested directories search toward the nearest Git root. If more than
194
257
  one configuration applies, select one with `--config FILE`; REDUE refuses to guess.
195
- The generated instruction names its project-relative configuration and applies it
196
- to status/run/explain. External configs or custom machine-local `--state-dir`
258
+ The generated skill names its project-relative configuration and gives the exact
259
+ status and run commands for it. External configs or custom machine-local `--state-dir`
197
260
  setups should use a reviewed generic instruction instead of committing absolute
198
261
  paths. Other worktrees and remote containers have separate local evidence.
199
262
 
@@ -56,5 +56,22 @@ Advanced explicit contracts may declare `generatedInputs`, `installedInputs`, na
56
56
  reviewed escape hatches, not onboarding requirements. A coverage rationale cannot
57
57
  override unsupported storage, unresolved links, missing inputs, or observation failure.
58
58
 
59
+ Input patterns are relative to the project root. They cannot name a `.git`
60
+ directory, because REDUE does not observe one; `!.git/**` is fine.
61
+
59
62
  Changing commands, relevant configuration, installed material, or consumed inputs
60
63
  invalidates prior applicability. It does not erase historical execution outcomes.
64
+
65
+ Installed inputs (under `node_modules` or other installed roots) are observed by
66
+ file identity: inode, size, mode, link count, and modification and change times.
67
+ REDUE does not read every installed file, so large installations become ready
68
+ quickly. Any write to an installed file makes dependent checks STALE until they
69
+ run again, even when it restores earlier bytes, reinstalls identical packages
70
+ (`npm ci`), copies the installation, or remounts it under another device. Timestamps tick in milliseconds, so a file
71
+ changed in the last 2 seconds could be rewritten at the same size without a new
72
+ identity; `redue run` waits until such files are 2 seconds old before it records
73
+ a checkpoint, which adds up to 2 seconds right after an install. Source files are
74
+ content-hashed, and the direct TypeScript recipe's probe content-checks every file
75
+ the compiler reads. The 2-second window assumes the filesystem clock matches this
76
+ machine's; on a network or VM-shared mount whose clock runs behind, keep the
77
+ installation on a local disk.
@@ -5,7 +5,7 @@ check against declared, observed inputs and relevant execution context. It does
5
5
  not mean npm or npm lifecycle scripts completed.
6
6
 
7
7
  For a supported single-package npm project with an existing standalone
8
- `tsc --noEmit` script, installed dependencies, Node 22/24 and TypeScript 5.5.2/5.6.3/5.9.3:
8
+ `tsc --noEmit` script, installed dependencies, Node 22/24 and TypeScript 5.5.2/5.6.3/5.9.3/6.0.2/6.0.3:
9
9
 
10
10
  ```sh
11
11
  redue init --recipe typescript-direct --check typecheck --dry-run
@@ -33,7 +33,7 @@ A generated check contains:
33
33
 
34
34
  `script` identifies the reviewed source recipe; `command` is what actually runs:
35
35
  the resolved Node executable and local TypeScript implementation, with exact argv
36
- and no shell. TypeScript 5.5.2 and 5.6.3 use `lib/tsc.js`; 5.9.3 uses `lib/_tsc.js` directly,
36
+ and no shell. TypeScript 5.5.2 and 5.6.3 use `lib/tsc.js`; 5.9.3, 6.0.2 and 6.0.3 use `lib/_tsc.js` directly,
37
37
  without its outer compile-cache-enabling shim. No compiler is fetched or bundled.
38
38
  The entire installed package must match reviewed official distribution bytes.
39
39
 
@@ -74,11 +74,49 @@ accidentally when intending to preserve the original selection.
74
74
  Pre/post scripts, compound commands, wrappers, environment assignments, workspace
75
75
  projects and unsupported compiler versions are not automatically converted.
76
76
  Init retains the original script with a reason. Development-mode source-map helpers,
77
- Node preloads/loaders/compile-cache settings, `TS_ETW_MODULE_PATH` (including empty or case aliases), unsupported compiler plugins or
78
- incremental/composite configuration, outside-root inputs and uncertain observation
79
- withhold applicability. Extra custom probes cannot inherit this recipe's context
77
+ Node preloads/loaders/compile-cache settings, `TS_ETW_MODULE_PATH` (including empty or case aliases), unsupported compiler plugins, a
78
+ `composite` root tsconfig, a program that uses a referenced project's files,
79
+ outside-root inputs and uncertain observation withhold applicability. Extra custom probes cannot inherit this recipe's context
80
80
  exception. Relevant source, declaration, config, membership and installed-content
81
- changes invalidate or withdraw applicability normally.
81
+ changes invalidate or withdraw applicability normally. Installed files are observed
82
+ by identity, so reinstalling identical packages or restoring an installed file's
83
+ bytes also needs one rerun (see [configuration](configuration.md)).
84
+
85
+ A root tsconfig with `incremental: true` is supported. tsc reads and writes
86
+ its build-info file (`tsBuildInfoFile`, or the default next to the config) on
87
+ each run, so REDUE leaves that file out of the inputs and lets the run write
88
+ only that file and the directories it needs; any other write makes the run
89
+ non-reusable. The result is what your own incremental tsc reports, so it
90
+ trusts TypeScript's build-info cache, which TypeScript discards after a
91
+ compiler or option change. The file must be inside the checkout and named
92
+ `*.tsbuildinfo`, with no glob characters in its path.
93
+ `assumeChangesOnlyAffectDirectDependencies` is refused: with it, the result
94
+ depends on earlier runs. REDUE reads the setting when the observer starts:
95
+ after turning `incremental` on or moving the file, restart the observer;
96
+ status says so until then. On Linux, a run that creates the build-info directory is an
97
+ observation gap, so the first run after that is not reusable.
98
+
99
+ A root tsconfig may reference other configs (`references`), for example a
100
+ composite `tsconfig.node.json`. Plain `tsc --noEmit` reads those configs but
101
+ does not build them, so REDUE treats them as configuration. If the program
102
+ uses a referenced project's sources or built outputs, the check is not
103
+ qualified.
104
+
105
+ On macOS and Linux, `redue run` records which files the compiler looked up and
106
+ compares them with what the observer's last probe saw. The probe only builds the
107
+ program. With `declaration: true`, tsc also resolves the project's dependencies
108
+ while it checks declarations, so the run looks up files the probe never did,
109
+ some outside the checkout, and reads those dependencies' `package.json`. The
110
+ receipt keeps the run's answers to those existence, `realpath` and
111
+ `package.json` lookups as run facts. Before every CURRENT answer, status asks
112
+ each one again; a cached `redue status` asks them again when it is read. If any
113
+ now answers differently, the check is STALE and the reason names the path. Any
114
+ other file the run read, or a directory it listed, that the probe never did
115
+ still makes the run non-reusable, as do more than 10,000 run facts. Receipts
116
+ with run facts use a new format, so earlier observers do not reuse them. A
117
+ direct receipt recorded before run facts is UNVERIFIED until the check runs
118
+ again. Windows does not record direct runs, so it has no run facts: there, a
119
+ lookup only declaration checks make is not checked again.
82
120
 
83
121
  The versioned `npm-direct-typescript@1` interpretation retains relevant Node context
84
122
  and identity. Reviewed compiler code does not parse npm settings or proxy variables;
@@ -94,3 +132,21 @@ explicit request for `npm run typecheck` is not satisfied by this different comm
94
132
  The injected `NODE_USE_ENV_PROXY=1` setting is admitted only on Node 22.13.0,
95
133
  where it is inert; it remains strictly tracked. Other Node versions with this
96
134
  setting need review and stay unqualified. REDUE does not alter the setting.
135
+
136
+ ## Node settings
137
+
138
+ Since alpha.11 the direct recipe accepts these `NODE_*` settings:
139
+
140
+ - `NODE_OPTIONS`, when every token is one of `--max-old-space-size=<n>`,
141
+ `--max-semi-space-size=<n>`, `--use-openssl-ca`, `--use-bundled-ca`,
142
+ `--use-system-ca` or `--dns-result-order=ipv4first|ipv6first|verbatim`.
143
+ Any other flag, quotes, backslashes or tabs are refused.
144
+ - `NODE_EXTRA_CA_CERTS`.
145
+ - `NODE_PATH`.
146
+
147
+ `NODE_ENV` set to `production`, `test` or empty was already accepted. Every other non-empty
148
+ `NODE_*` setting withholds applicability. The values are part of the recorded
149
+ execution context: a run under one value is not reusable under another. A
150
+ `--require` in `NODE_OPTIONS` still runs inside REDUE's own process before REDUE
151
+ refuses it. The npm, pnpm and Yarn recipes still refuse `NODE_OPTIONS` and
152
+ `NODE_PATH`.
package/docs/user/json.md CHANGED
@@ -30,6 +30,7 @@ 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. |
33
34
  | `reason` | Human explanation; not a stable machine enum. Do not parse it to authorize reuse. |
34
35
  | `changed_inputs` | Known changed relevant paths when available, possibly only the first difference; empty/missing is not proof of no changes. |
35
36
  | `invocation` | Null without a receipt; otherwise run ID, completion `status`, duration, exit code/signal when known. Status distinguishes exited, interrupted, and start/capture failure. |
@@ -1,4 +1,4 @@
1
- # Opt-in development pilot: alpha.10
1
+ # Opt-in development pilot: alpha.12
2
2
 
3
3
  Use one fixed build for several ordinary development sessions. The owner will
4
4
  invite two or three willing testers and approve their projects; nothing is
@@ -10,13 +10,14 @@ controlled compiler/agent trials are acceptance evidence, not independent adopti
10
10
  Start with a trusted, single-package npm Git checkout, normally installed locked
11
11
  dependencies, and an existing standalone `tsc --noEmit` script without pre/post
12
12
  scripts. The direct recipe accepts only the official, unchanged TypeScript
13
- **5.5.2, 5.6.3 or 5.9.3** packages and Node **22 or 24**. No workspaces, named
13
+ **5.5.2, 5.6.3, 5.9.3, 6.0.2 or 6.0.3** packages and Node **22 or 24**. No workspaces, named
14
14
  tsconfig selection, emitted/incremental/composite builds, custom loaders or
15
15
  outside-root inputs are added by this pilot. Do not downgrade or change your
16
16
  project to fit; record an unsupported setup as feedback.
17
17
 
18
18
  Development-mode source-map support, Node preloads/inspectors/compile-cache
19
- overrides and `TS_ETW_MODULE_PATH` are unsupported. The injected
19
+ overrides and `TS_ETW_MODULE_PATH` are unsupported. A few inert Node settings
20
+ are accepted; see [Node settings](direct-typescript.md#node-settings). The injected
20
21
  `NODE_USE_ENV_PROXY=1` context is reviewed only on Node **22.13.0**; leave the
21
22
  environment and security controls intact. See the [full recipe boundary](direct-typescript.md).
22
23
 
@@ -24,15 +25,17 @@ CLI/package mechanics are tested on macOS/APFS, native Linux and Windows/NTFS;
24
25
  Linux also needs Python 3 and [supported native storage](getting-started.md).
25
26
  Actual fresh-session behavior was tested with Codex **0.162.0 on macOS**, Node
26
27
  22.13.0 and the approved exact checkout/state/socket access. This is not general
27
- sandbox compatibility. Claude mechanics are tested; Claude behavior and cross-host
28
- handoff are **NOT RUN**. The recording shortcut is macOS/direct-recipe only.
28
+ sandbox compatibility. Claude mechanics are tested, and the
29
+ [Claude Code typecheck hook](agents.md#claude-code-typecheck-hook) was exercised in
30
+ Claude Code 2.1.302 (`claude -p`). Broader Claude behavior and cross-host handoff
31
+ are **NOT RUN**. The recording shortcut is macOS/direct-recipe only.
29
32
 
30
33
  ## Install and connect explicitly
31
34
 
32
35
  For a new default npm installation:
33
36
 
34
37
  ```sh
35
- npm install --global @redue/cli@0.1.0-alpha.10
38
+ npm install --global @redue/cli@0.1.0-alpha.12
36
39
  redue --version
37
40
  cd my-project
38
41
  redue --config redue.config.json init --recipe typescript-direct --check typecheck --dry-run
@@ -86,7 +89,7 @@ using it; keep the same npm prefix, config and any explicit state selection.
86
89
 
87
90
  ```sh
88
91
  redue --config redue.config.json stop
89
- npm install --global @redue/cli@0.1.0-alpha.10
92
+ npm install --global @redue/cli@0.1.0-alpha.12
90
93
  redue --config redue.config.json agent setup codex --dry-run
91
94
  redue --config redue.config.json agent setup codex --apply
92
95
  redue --config redue.config.json start
@@ -19,7 +19,7 @@ project script. Automatic npm-launcher applicability was withdrawn in alpha.4;
19
19
  ordinary npm scripts remain recording-only. See the [maintainer notice](npm-launcher-notice.md).
20
20
  The direct recipe is opt-in, available since alpha.5. The opt-in `init --recipe typescript-direct` supports
21
21
  a standalone `tsc --noEmit` script in a single-package npm installation using
22
- reviewed TypeScript 5.5.2/5.6.3/5.9.3 and Node 22/24. It executes the local compiler,
22
+ reviewed TypeScript 5.5.2/5.6.3/5.9.3/6.0.2/6.0.3 and Node 22/24. It executes the local compiler,
23
23
  not npm. Full installed compiler identity, config/membership, installed inputs
24
24
  and relevant Node environment are checked before reuse. See the
25
25
  [exact direct boundary](direct-typescript.md). Unsupported plugins, preloads,
@@ -62,10 +62,10 @@ global virtual stores, injected workspace dependencies, and external links
62
62
  without an observed boundary remain recording-only with a reason. Installed
63
63
  files with hard-linked aliases outside the checkout remain recording-only on
64
64
  macOS: writes through an unseen alias cannot support CURRENT there. On Linux,
65
- redue watches project-installed file inodes and rehashes the selected
66
- installed inputs on every synchronized read. A cached read remains UNVERIFIED
67
- for these pnpm checks; a synchronized read can establish CURRENT after the
68
- rehash. If an inode watch cannot be installed, observation becomes unavailable
65
+ redue watches project-installed file inodes and re-reads the identity of the
66
+ selected installed inputs on every synchronized read. A cached read remains UNVERIFIED
67
+ for these pnpm checks; a synchronized read can establish CURRENT after that
68
+ re-read. If an inode watch cannot be installed, observation becomes unavailable
69
69
  instead of dropping that file. The global store is not watched. An absent
70
70
  optional package remains unqualified when Node could later
71
71
  resolve it from an unobserved ancestor `node_modules`; project-local candidate
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@redue/cli",
3
3
  "private": false,
4
- "version": "0.1.0-alpha.10",
4
+ "version": "0.1.0-alpha.12",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "tag": "alpha"
@@ -14,7 +14,7 @@
14
14
  "test": "node --test --test-concurrency=1 test/*.test.mjs",
15
15
  "test:package": "node test/acceptance/package-smoke.mjs",
16
16
  "demo": "node test/acceptance/package-smoke.mjs --demo",
17
- "pretest": "npm --prefix test/fixtures/typescript-5-5-2 ci --no-audit --no-fund"
17
+ "pretest": "npm --prefix test/fixtures/typescript-5-5-2 ci --no-audit --no-fund && npm --prefix test/fixtures/typescript-6-0-2 ci --no-audit --no-fund && npm --prefix test/fixtures/typescript-6-0-3 ci --no-audit --no-fund"
18
18
  },
19
19
  "dependencies": {
20
20
  "@parcel/watcher": "2.5.6",