@redue/cli 0.0.0-stage → 0.1.0-alpha.10

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 (64) hide show
  1. package/CHANGELOG.md +128 -0
  2. package/LICENSE +180 -0
  3. package/README.md +162 -2
  4. package/bin/redue.mjs +355 -0
  5. package/bin/vstate.mjs +3 -0
  6. package/docs/README.md +21 -0
  7. package/docs/user/agents.md +207 -0
  8. package/docs/user/configuration.md +60 -0
  9. package/docs/user/direct-typescript.md +96 -0
  10. package/docs/user/getting-started.md +148 -0
  11. package/docs/user/json.md +59 -0
  12. package/docs/user/npm-launcher-notice.md +42 -0
  13. package/docs/user/pilot.md +142 -0
  14. package/docs/user/receipt-selection-notice.md +60 -0
  15. package/docs/user/shell.md +25 -0
  16. package/docs/user/supported-projects.md +90 -0
  17. package/examples/redue.config.json +8 -0
  18. package/package.json +47 -4
  19. package/src/agent-integration.mjs +248 -0
  20. package/src/agent-policy.md +70 -0
  21. package/src/cached-state.mjs +42 -0
  22. package/src/cli.mjs +459 -0
  23. package/src/control-endpoint.mjs +11 -0
  24. package/src/daemon.mjs +1082 -0
  25. package/src/decision-profile.mjs +32 -0
  26. package/src/decision-validation.mjs +41 -0
  27. package/src/declared-plan.mjs +125 -0
  28. package/src/direct-run-certificate.mjs +40 -0
  29. package/src/direct-typescript-probe.mjs +56 -0
  30. package/src/direct-typescript.mjs +76 -0
  31. package/src/executable-lookup.mjs +18 -0
  32. package/src/glob.mjs +9 -0
  33. package/src/history-worker.mjs +23 -0
  34. package/src/index.mjs +306 -0
  35. package/src/installed-inputs.mjs +110 -0
  36. package/src/linux-inotify.py +228 -0
  37. package/src/linux-observer.mjs +79 -0
  38. package/src/node-onboarding.mjs +274 -0
  39. package/src/npm-typecheck-environment.mjs +36 -0
  40. package/src/npm-typecheck-probe.mjs +120 -0
  41. package/src/observation.mjs +39 -0
  42. package/src/owned-state.mjs +32 -0
  43. package/src/path-identity.mjs +43 -0
  44. package/src/plan-worker.mjs +140 -0
  45. package/src/plan.mjs +10 -0
  46. package/src/platform-observation.mjs +17 -0
  47. package/src/platform-state.mjs +14 -0
  48. package/src/pnpm-inputs.mjs +355 -0
  49. package/src/pnpm-typecheck-probe.mjs +47 -0
  50. package/src/presentation.mjs +53 -0
  51. package/src/probe-result.mjs +21 -0
  52. package/src/process-liveness.mjs +11 -0
  53. package/src/project-location.mjs +34 -0
  54. package/src/run-lock.mjs +77 -0
  55. package/src/state-store.mjs +73 -0
  56. package/src/toolchain-probe.mjs +21 -0
  57. package/src/typescript-contract-probe.mjs +5 -0
  58. package/src/typescript-input-facts.mjs +65 -0
  59. package/src/typescript-list.mjs +72 -0
  60. package/src/typescript-qualification.mjs +77 -0
  61. package/src/windows-command.mjs +16 -0
  62. package/src/windows-process.mjs +15 -0
  63. package/src/yarn-workspace-inputs.mjs +148 -0
  64. package/src/yarn-workspace-typecheck-probe.mjs +107 -0
@@ -0,0 +1,96 @@
1
+ # Explicit local TypeScript verification
2
+
3
+ This check means: the reviewed local TypeScript compiler completed the configured
4
+ check against declared, observed inputs and relevant execution context. It does
5
+ not mean npm or npm lifecycle scripts completed.
6
+
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:
9
+
10
+ ```sh
11
+ redue init --recipe typescript-direct --check typecheck --dry-run
12
+ redue init --recipe typescript-direct --check typecheck
13
+ redue start
14
+ redue run typecheck
15
+ redue status --sync
16
+ ```
17
+
18
+ The preview shows the discovered script and recorded direct invocation. Nothing
19
+ executes during init. package.json, environment and dependencies remain unchanged.
20
+ A generated check contains:
21
+
22
+ ```json
23
+ {
24
+ "name": "typecheck",
25
+ "script": "typecheck",
26
+ "kind": "typecheck",
27
+ "command": ["@node", "@typescript-compiler:.", "--noEmit"],
28
+ "cwd": ".",
29
+ "qualification": "npm-typescript-direct-v1",
30
+ "inputs": ["package.json", "package-lock.json", "tsconfig.json", "**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs,json,jsonc}", "!node_modules/**", "!.git/**"]
31
+ }
32
+ ```
33
+
34
+ `script` identifies the reviewed source recipe; `command` is what actually runs:
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,
37
+ without its outer compile-cache-enabling shim. No compiler is fetched or bundled.
38
+ The entire installed package must match reviewed official distribution bytes.
39
+
40
+ Existing configs are never overwritten. To compare choices, use a new project-local
41
+ `--config redue.direct.config.json` with init; this explicitly selects separate
42
+ state. To replace an existing check deliberately, preview JSON, stop its observer,
43
+ review/edit that check's config, and restart using the same config/state. Existing
44
+ npm receipts remain historical; the new command/interpretation needs a fresh run.
45
+ Do not delete receipts. `redue run` always executes the configured command.
46
+
47
+ ## Existing npm configuration: deliberate replacement
48
+
49
+ First upgrade through the [alpha.4 containment](npm-launcher-notice.md), stopping
50
+ observers before the installation change and restarting with the same config/state.
51
+ The old npm check becomes recording-only; its receipts remain historical.
52
+ To opt into the direct recipe afterward:
53
+
54
+ 1. Stop the observer, install the selected released version into the same prefix,
55
+ and keep the original `redue.config.json` and any explicit `--state-dir` selection.
56
+ 2. Run `redue init --recipe typescript-direct --check typecheck --dry-run --json`
57
+ using that config selection. Inspect `proposed_config.checks` and the recorded
58
+ invocation. This does not write anything, even when the config already exists.
59
+ 3. In your editor, replace only the intended check object with the reviewed proposed
60
+ object. Preserve its name, the top-level project configuration, and every other
61
+ check. Do not replace the whole config with a one-check preview. Keep a local
62
+ backup outside observed inputs if desired.
63
+ 4. Run `redue start` with the same config/state. `redue status --sync --json` must
64
+ not treat the old npm receipt as eligible compiler evidence.
65
+ 5. Run `redue run typecheck`, then `redue status --sync --json`. A qualified success
66
+ now records the direct compiler recipe with a new run ID. Old npm runs remain
67
+ immutable history. Other check definitions are unchanged.
68
+
69
+ Substitute the actual selected check name throughout. Repeating plain `init`
70
+ does **not** migrate an existing config. A deliberately separate `--config` file
71
+ is useful for comparison, but has separate state by design. Do not create one
72
+ accidentally when intending to preserve the original selection.
73
+
74
+ Pre/post scripts, compound commands, wrappers, environment assignments, workspace
75
+ projects and unsupported compiler versions are not automatically converted.
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
80
+ exception. Relevant source, declaration, config, membership and installed-content
81
+ changes invalidate or withdraw applicability normally.
82
+
83
+ The versioned `npm-direct-typescript@1` interpretation retains relevant Node context
84
+ and identity. Reviewed compiler code does not parse npm settings or proxy variables;
85
+ these remain untouched in the child environment and are recorded only as a digest
86
+ of observed provenance. This is not an environment ignore option for arbitrary
87
+ commands or other providers. No remote service equivalence is claimed. Ordinary
88
+ cached status remains conservative; synchronize deliberately when worth the cost.
89
+
90
+ Explain/JSON report `verification_recipe: "npm-direct-typescript@1"` for receipts
91
+ recorded with this recipe. Report compiler evidence as compiler evidence. A user's
92
+ explicit request for `npm run typecheck` is not satisfied by this different command.
93
+
94
+ The injected `NODE_USE_ENV_PROXY=1` setting is admitted only on Node 22.13.0,
95
+ where it is inert; it remains strictly tracked. Other Node versions with this
96
+ setting need review and stay unqualified. REDUE does not alter the setting.
@@ -0,0 +1,148 @@
1
+ # Install and use REDUE
2
+
3
+ Requirements: Git; Node 22 or newer with npm; an existing local JS/TS checkout
4
+ with its dependencies installed. Linux additionally needs `python3`. Supported
5
+ storage is local APFS on macOS, NTFS on Windows, and the documented native Linux
6
+ filesystems. Network/FUSE/overlay mounts are not qualified Linux storage.
7
+ Node 22 and 24 are the release-test matrix; newer majors are not yet acceptance claims.
8
+
9
+ Install the public alpha:
10
+
11
+ ```sh
12
+ npm install --global @redue/cli@alpha
13
+ redue --version
14
+ ```
15
+
16
+ For an unpublished source candidate, run `npm ci` and `npm pack --json`, then
17
+ install the exact filename reported by npm with `npm install --global ./<filename>`.
18
+
19
+ These commands also work in PowerShell (use `npm.cmd`/`redue.cmd` when a local
20
+ PowerShell script policy blocks generated `.ps1` shims; do not change policy).
21
+ No build step, custom installer, account, or login service is required. Installing
22
+ npm dependencies uses the registry; normal local observation does not require network.
23
+
24
+ For a reversible user-owned prefix, POSIX shells:
25
+
26
+ ```sh
27
+ npm install --global --prefix "$HOME/.local/redue-alpha" @redue/cli@alpha
28
+ export PATH="$HOME/.local/redue-alpha/bin:$PATH"
29
+ ```
30
+
31
+ PowerShell:
32
+
33
+ ```powershell
34
+ $reduePrefix = Join-Path $env:LOCALAPPDATA 'redue-alpha-install'
35
+ npm.cmd install --global --prefix $reduePrefix @redue/cli@alpha
36
+ $env:PATH = "$reduePrefix;$env:PATH"
37
+ redue.cmd --help
38
+ ```
39
+
40
+ These PATH changes affect only the current shell. Alternatively invoke the
41
+ installed entry point directly: POSIX `node "$HOME/.local/redue-alpha/lib/node_modules/@redue/cli/bin/redue.mjs"`;
42
+ Windows `node "$reduePrefix/node_modules/@redue/cli/bin/redue.mjs"`.
43
+
44
+ ## Moving from alpha.1
45
+
46
+ If the personal-scope alpha.1 package is installed, stop the project's observer
47
+ and replace that package before installing the canonical command:
48
+
49
+ ```sh
50
+ redue stop
51
+ npm uninstall --global @msiric/redue
52
+ npm install --global @redue/cli@alpha
53
+ ```
54
+
55
+ Use the same `--prefix` on both npm commands if your installation has a custom
56
+ prefix. Uninstalling the package does not remove local verification evidence;
57
+ `redue remove-state` is a separate, explicit action. Alpha.1 remains available as
58
+ historical software and is superseded for package identity, not a runtime defect.
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
+
68
+ ## First project
69
+
70
+ From the project root:
71
+
72
+ ```sh
73
+ redue init --dry-run
74
+ redue init
75
+ redue start
76
+ redue run typecheck
77
+ redue status
78
+ redue explain typecheck
79
+ ```
80
+
81
+ Use a check actually printed by `init`. For a workspace:
82
+ `redue init --workspace @example/package --check typecheck`.
83
+ Initialization previews detected commands and qualification confidence before writing
84
+ `redue.config.json`. An existing config is never overwritten. No checks are run and
85
+ no dependencies installed. A missing/unsupported boundary is explained. Npm-launcher typechecks are
86
+ recording-only in alpha.4; a passed execution is historical PASS with UNVERIFIED
87
+ applicability, not reusable CURRENT.
88
+
89
+ “Ready to qualify” means REDUE has a supported recipe whose prerequisites will be
90
+ validated. It is not a receipt. “Recording-only” can record PASS/FAIL without claiming
91
+ reusability. Qualification can change when configuration or installation changes.
92
+
93
+ `run` streams normal output and preserves execution environment and cancellation.
94
+ For the narrow pnpm TypeScript contract, `init` explicitly shows the direct installed
95
+ compiler invocation it selects. Npm scripts remain recording-only;
96
+ use `redue init --recipe typescript-direct --dry-run` to preview a distinct,
97
+ explicit [local compiler recipe](direct-typescript.md). Other scripts run through
98
+ the package manager. No existing configuration is silently migrated.
99
+ Only use configs and probes from trusted repositories: these execute local code.
100
+
101
+ `status` is cached and conservative. `status --sync` and `explain` revalidate caller
102
+ context and may execute read-only probes. Synchronization can be slower than a cheap
103
+ check, especially on Windows. Choose deliberately. A timeout is UNVERIFIED, not green.
104
+
105
+ ## Lifecycle and removal
106
+
107
+ `start` starts this config's owned observer, or reports that it is already running.
108
+ If already running, use `status`; do not create a second state directory just to
109
+ start another observer. Startup may report initialization before inputs are ready.
110
+ `stop` stops that observer and retains historical evidence. After restart, observation
111
+ is reconciled before reuse.
112
+
113
+ ```sh
114
+ redue stop
115
+ redue start
116
+ redue remove-state
117
+ npm uninstall --global @redue/cli
118
+ ```
119
+
120
+ For an isolated installation, use the same `--prefix` on uninstall. Remove state
121
+ **before** uninstalling the command. No broad recursive deletion command is needed.
122
+ `remove-state` checks its ownership marker and stops only that observer. It does not
123
+ remove project files, dependencies, another tool's watches, or other REDUE configurations.
124
+ To remove project configuration, inspect and delete `redue.config.json` yourself.
125
+
126
+ Runtime state is separate from durable project config. Legacy directory spelling is
127
+ retained for compatibility, not copied into your config:
128
+
129
+ | OS | Default state base |
130
+ | --- | --- |
131
+ | macOS | `~/Library/Application Support/vstate/` |
132
+ | Linux | `$XDG_STATE_HOME/vstate/`, otherwise `~/.local/state/vstate/` |
133
+ | Windows | `%LOCALAPPDATA%/vstate/` |
134
+
135
+ A checkout/config identity selects a dedicated child directory. Use
136
+ `--state-dir /your/owned/redue-project-state` to choose a dedicated directory outside
137
+ all observed roots; its basename must start with `redue-` or legacy `vstate-`.
138
+ For a removed checkout, `redue --state-dir /your/owned/redue-project-state remove-state`
139
+ still works without rebuilding its compiler/configuration. Ownership/active-run conflicts
140
+ are actionable errors, never resolved merely by deleting an old lock.
141
+
142
+ ## Connect an agent explicitly
143
+
144
+ After initialization, use `redue agent setup codex --dry-run` (or `claude`) to
145
+ review project-local instructions, then repeat with `--apply`. Start a fresh host
146
+ session. `redue agent doctor` checks prerequisites without running verification.
147
+ See [agent activation](agents.md) for loading rules, generic agents, and removal.
148
+ For a fixed build and ordinary development evaluation, use the [opt-in pilot guide](pilot.md).
@@ -0,0 +1,59 @@
1
+ # Alpha JSON interface (schema 1)
2
+
3
+ Use `status --json` for cached state, `status --sync --json` for caller-aware
4
+ applicability, and `explain CHECK --json` for selected synchronized detail.
5
+ `detail` remains an alias. Successful reads emit one JSON object, no human prose.
6
+
7
+ ```json
8
+ {
9
+ "schema": 1,
10
+ "state": "stale",
11
+ "current": 0, "stale": 1, "failed": 0, "observed_failed": 0, "unverified": 0,
12
+ "checks": [{
13
+ "name": "typecheck",
14
+ "result": "PASS",
15
+ "freshness": "STALE",
16
+ "reason": "src/main.ts changed",
17
+ "changed_inputs": ["src/main.ts"],
18
+ "reuse_eligible": false,
19
+ "invocation": {"runId": "opaque-run-id", "status": "exited", "exitCode": 0, "durationMs": 940}
20
+ }],
21
+ "observation": {"healthy": true}
22
+ }
23
+ ```
24
+
25
+ Stable-enough-for-alpha fields:
26
+
27
+ | Field | Contract |
28
+ | --- | --- |
29
+ | `checks[].name` | Configured check identity. |
30
+ | `result` | Historical `PASS`, `FAIL`, or null. A failed invocation is not green even with CURRENT applicability. |
31
+ | `freshness` | `CURRENT`, `STALE`, or `UNVERIFIED`, independent of result. |
32
+ | `reuse_eligible` | True only for qualified, applicable passing evidence. Never derive permission to reuse from outcome alone. Missing means false. |
33
+ | `reason` | Human explanation; not a stable machine enum. Do not parse it to authorize reuse. |
34
+ | `changed_inputs` | Known changed relevant paths when available, possibly only the first difference; empty/missing is not proof of no changes. |
35
+ | `invocation` | Null without a receipt; otherwise run ID, completion `status`, duration, exit code/signal when known. Status distinguishes exited, interrupted, and start/capture failure. |
36
+ | `target_provenance` | Available target evidence. Unknown is not executed or cache-hit. |
37
+ | `observation.healthy` | False means no check is reusable. Additional reason/phase diagnostics may appear. |
38
+ | `state` | Aggregate lowercase current/stale/failed/unverified (and runtime pending states where applicable). Use per-check fields for decisions. |
39
+
40
+ Counts cover the whole configuration even when `explain CHECK` filters `checks`.
41
+ `failed` counts applicable failures; `observed_failed` preserves historical failures
42
+ regardless of applicability. Fields not listed here are diagnostic and may evolve.
43
+ Ignore unknown fields; reject unknown schema versions. These responses contain local
44
+ paths/check names and must not be uploaded automatically.
45
+
46
+ `init --json` returns discovery levels (`ready`, `recording`, `unsupported`),
47
+ reasons, workspace ownership, `written`, and `proposed_config`. Ready is not PASS.
48
+ `init --dry-run --json` writes no config and runs no check.
49
+
50
+ Read commands normally exit 0 even when the evidence is not current. Errors exit
51
+ nonzero; synchronized transport failures may still return conservative JSON.
52
+ Usage/configuration errors go to stderr and are not guaranteed JSON. Never treat
53
+ a failed read as authority from a previously cached answer.
54
+
55
+ `run CHECK --json` preserves ordinary command stdin/stdout/stderr and appends a
56
+ JSON summary. **Its stdout is not a JSON-only stream.** Query status/details after
57
+ completion for machine-readable evidence. Normal check exit codes are preserved;
58
+ interruption/process-start failures are nonzero. REDUE retains metadata and receipts,
59
+ not arbitrary terminal output. The CLI does not infer tests executed from prose.
@@ -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,142 @@
1
+ # Opt-in development pilot: alpha.10
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 the official, unchanged TypeScript
13
+ **5.5.2, 5.6.3 or 5.9.3** packages and Node **22 or 24**. No workspaces, named
14
+ tsconfig selection, emitted/incremental/composite builds, custom loaders or
15
+ outside-root inputs are added by this pilot. Do not downgrade or change your
16
+ project to fit; record an unsupported setup as feedback.
17
+
18
+ Development-mode source-map support, Node preloads/inspectors/compile-cache
19
+ overrides and `TS_ETW_MODULE_PATH` are unsupported. The injected
20
+ `NODE_USE_ENV_PROXY=1` context is reviewed only on Node **22.13.0**; leave the
21
+ environment and security controls intact. See the [full recipe boundary](direct-typescript.md).
22
+
23
+ CLI/package mechanics are tested on macOS/APFS, native Linux and Windows/NTFS;
24
+ Linux also needs Python 3 and [supported native storage](getting-started.md).
25
+ Actual fresh-session behavior was tested with Codex **0.162.0 on macOS**, Node
26
+ 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.
29
+
30
+ ## Install and connect explicitly
31
+
32
+ For a new default npm installation:
33
+
34
+ ```sh
35
+ npm install --global @redue/cli@0.1.0-alpha.10
36
+ redue --version
37
+ cd my-project
38
+ redue --config redue.config.json init --recipe typescript-direct --check typecheck --dry-run
39
+ redue --config redue.config.json init --recipe typescript-direct --check typecheck
40
+ redue --config redue.config.json agent setup codex --dry-run
41
+ redue --config redue.config.json agent setup codex --apply
42
+ redue --config redue.config.json start
43
+ redue --config redue.config.json agent doctor codex --json
44
+ ```
45
+
46
+ Use the discovered check name. Review both previews before applying. The recorded
47
+ invocation is the resolved local Node/compiler with `--noEmit`, **not npm or its
48
+ lifecycle scripts**. Neither init nor setup executes verification. An existing
49
+ config is never overwritten; use the [deliberate check replacement procedure](direct-typescript.md#existing-npm-configuration-deliberate-replacement)
50
+ without losing other checks or changing config/state identity. For an owned custom
51
+ installation prefix or Windows command shims, use the [installation instructions](getting-started.md).
52
+
53
+ Run doctor inside the agent's actual command boundary too. A healthy outside-shell
54
+ result does not prove access. The owner must grant only the intended checkout,
55
+ owned state directory and exact observer endpoint through supported host controls.
56
+ The observer can write its index, run trusted configured probes in its own process
57
+ context, reload receipts and stop; endpoint access is more than a file read.
58
+ Do not disable sandboxing, bypass the proxy, or allow all sockets. If access is
59
+ unavailable, record the limitation; an installed skill is not behavioral acceptance.
60
+ See [access and diagnostics](agents.md). Doctor does not run verification or sync.
61
+
62
+ Complete setup before the first real verification obligation. When that obligation
63
+ arises, record the configured compiler check in the intended execution context:
64
+
65
+ ```sh
66
+ redue --config redue.config.json run typecheck
67
+ redue --config redue.config.json status --sync --json
68
+ ```
69
+
70
+ A successful run may remain **UNVERIFIED**. Reuse needs understood schema, healthy
71
+ observation, CURRENT, PASS and `reuse_eligible: true`; a receipt or exit code alone
72
+ is insufficient. Recovery cannot repair a run's missing start observation. A later
73
+ fully observed run can create new eligible evidence. Do not erase receipts to get green.
74
+
75
+ Start a fresh agent session after connecting, then work normally. Keep ordinary
76
+ task requests and explicit fresh-verification obligations; an explicit npm-script
77
+ request still requires npm. Let later sessions occur naturally—do not manufacture
78
+ edits, restarts or repeated queries to inflate reuse. Configured compiler evidence
79
+ does not verify tests, npm lifecycle behavior or application correctness.
80
+
81
+ ## Update or leave without losing evidence
82
+
83
+ Keep the pilot version fixed unless a real defect requires a reviewed update.
84
+ Record any build boundary. Before replacing an installation, stop every observer
85
+ using it; keep the same npm prefix, config and any explicit state selection.
86
+
87
+ ```sh
88
+ redue --config redue.config.json stop
89
+ npm install --global @redue/cli@0.1.0-alpha.10
90
+ redue --config redue.config.json agent setup codex --dry-run
91
+ redue --config redue.config.json agent setup codex --apply
92
+ redue --config redue.config.json start
93
+ redue --config redue.config.json status --sync --json
94
+ ```
95
+
96
+ Package installation alone does not update project instructions. Setup updates
97
+ intact owned content, preserves unrelated text and refuses edited managed content.
98
+ Review conflicts; do not delete ownership records to force an update. Setup metadata
99
+ can invalidate prior applicability; reassess normally and start a fresh agent session.
100
+ Historical receipts remain. See [the complete update procedure](agents.md#update-an-existing-connection).
101
+
102
+ To disconnect and uninstall, using the same installation prefix when applicable:
103
+
104
+ ```sh
105
+ redue --config redue.config.json agent remove codex --dry-run
106
+ redue --config redue.config.json agent remove codex --apply
107
+ redue --config redue.config.json stop
108
+ npm uninstall --global @redue/cli
109
+ ```
110
+
111
+ This preserves project config and receipts. Do not use `remove-state` for an upgrade
112
+ or pilot exit. Edited managed content is left intact with a conflict for review.
113
+
114
+ ## Voluntary notes, reviewed before sharing
115
+
116
+ Keep a small local note per real verification obligation, including setup failures
117
+ and abandoned attempts. Use existing local receipts/tool history only when you
118
+ choose; do not enable automatic transcript capture. Suggested fields:
119
+
120
+ | Field | Record |
121
+ | --- | --- |
122
+ | Context | Build, OS/Node/compiler/host versions, anonymous project/session label |
123
+ | Obligation | What actually needed verification; explicit fresh execution if requested |
124
+ | Decision | Consulted? Agent-visible CURRENT/PASS/eligible, STALE, unsupported or unavailable? |
125
+ | Outcome | Actual reuse with no equivalent execution; wrapped run; execution outside REDUE; or unresolved |
126
+ | Evidence | Local before/after receipt IDs and actual commands, reviewed locally |
127
+ | Cost | Measured setup/restart/query/recording/execution durations, if available |
128
+ | Friction | What failed or confused; why you continued or stopped using REDUE |
129
+
130
+ A CURRENT query is not automatically a saved run; an inspection needing no
131
+ verification is not an avoided check. Do not infer a counterfactual from a receipt.
132
+ Label estimated avoided compiler cost and its assumptions separately from measured
133
+ time. Include recording, restarts and required reruns. Whole-task time alone does
134
+ not establish causal speedup. The question is whether natural later reuse repays
135
+ the cost of creating and maintaining evidence.
136
+
137
+ Share only a voluntary owner-reviewed, redacted summary through the
138
+ [existing issue tracker](https://github.com/msiric/redue/issues). Keep private source,
139
+ paths, configuration bodies, credentials, receipts and raw transcripts out of public
140
+ issues. Sensitive correctness/security reports use the repository's private security
141
+ reporting channel. Maintain one short friction list, prioritize correctness first,
142
+ and choose the next development task from observed usage rather than a benchmark target.
@@ -0,0 +1,60 @@
1
+ # Receipt selection correction in alpha.3
2
+
3
+ **Known affected release: `@redue/cli@0.1.0-alpha.2`. Fixed in
4
+ `@redue/cli@0.1.0-alpha.3`.** No exploit or affected-user count is established.
5
+ REDUE remains an alpha.
6
+
7
+ If a wrapper persisted a newer outcome but its observer reload notification
8
+ failed, the observer could continue selecting an older passing receipt. Cached
9
+ and synchronized status could then present that older result as CURRENT and
10
+ eligible for reuse. A separate reproduced write-failure window left a new
11
+ immutable outcome recorded while replacing the selected receipt failed.
12
+
13
+ Until upgraded, do not rely solely on affected CURRENT output to skip checks.
14
+ Run verification when needed and inspect its actual outcome; a successful status
15
+ command is not proof that the latest execution passed.
16
+
17
+ ## What changes
18
+
19
+ The observer refreshes REDUE-owned receipt selection before publishing status.
20
+ Clients check that a response represents the current readable selection. Missing,
21
+ unreadable, malformed, incompatible, or replaced selection cannot authorize
22
+ reuse. A new client connecting to an alpha.2 observer returns UNVERIFIED and
23
+ asks for a restart, even when the old response says CURRENT.
24
+
25
+ A small owned pending-update record also withholds applicability after an
26
+ incomplete receipt write. Successful recording clears only that check's pending
27
+ entry. It does not discard another check's incomplete outcome or automatically
28
+ promote an orphaned journal entry. Inspect the failed run and storage error, fix
29
+ the storage problem, then record that check again. An unreadable/malformed pending
30
+ record requires operator inspection; do not delete receipts to obtain green status.
31
+
32
+ Historical PASS/FAIL and immutable `runs-v1` files remain intact. Stable applicable
33
+ FAIL remains a failure and is never reuse-eligible. This guard tracks owned
34
+ receipt replacement; it does not replace input-content validation or promise an
35
+ atomic decision against concurrent edits/writes.
36
+
37
+ ## Upgrade and restart
38
+
39
+ From each initialized project, stop its observer before replacing the installation.
40
+ After all observers for that installation have stopped, upgrade it once, then
41
+ restart each observer with its existing configuration and state selection:
42
+
43
+ ```sh
44
+ redue stop
45
+ npm install --global @redue/cli@0.1.0-alpha.3
46
+ redue --version
47
+ redue start
48
+ redue status --sync --json
49
+ ```
50
+
51
+ Use the same npm `--prefix`, project `--config`, and `--state-dir` you already use,
52
+ if customized. On Windows use `npm.cmd`/`redue.cmd` where required by the existing
53
+ shell policy. Stop all observers belonging to the installation before replacing
54
+ it, then start each with the upgraded binary. For an independently installed
55
+ candidate, its `stop` command can stop the older observer in the same explicitly
56
+ selected owned state. Do not run `remove-state`; receipts need not be deleted.
57
+
58
+ Restart preserves historical receipts and reconciles inputs. It does not promise
59
+ CURRENT: a newer failure, unstable execution, incomplete contract, changed input,
60
+ or observation uncertainty remains visible under the normal rules.
@@ -0,0 +1,25 @@
1
+ # Shell usage
2
+
3
+ Run `redue start` once for the project/configuration you want to observe. A shell,
4
+ terminal multiplexer, and agent using that same config share its backend. Closing
5
+ the terminal does not stop the observer. `redue stop` does.
6
+
7
+ `redue status --short` is the intended small indicator:
8
+
9
+ ```text
10
+ REDUE UNVERIFIED
11
+ ```
12
+
13
+ It reads the cached snapshot, checks its expiry and observer liveness, and never
14
+ synchronizes, traverses installed packages, or runs probes/checks. Like ordinary
15
+ status, it can remain conservative when caller context or installed hardlinks
16
+ need a synchronized read. Do not turn that uncertainty into a green badge.
17
+
18
+ For an existing async/bounded prompt framework, use `redue status --short` from
19
+ the project root as the segment command and display unavailable on errors or
20
+ timeout. Node startup and configuration parsing still have a cost. REDUE does
21
+ not install a shell hook, edit global shell files, or provide its own prompt
22
+ scheduler. Running it manually is supported in PowerShell and POSIX shells.
23
+
24
+ Never put `status --sync` or `explain` in a prompt. Use those deliberately when
25
+ you need a decision and synchronization is worth its cost.