@gatedpath/preflight 0.2.4 → 0.2.5

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/README.md CHANGED
@@ -64,7 +64,8 @@ passes; `--json` for agents. The fix text is the failure table's (`@gatedpath/ag
64
64
  | `forge`, `anvil`, `cast` | yes | each on PATH and answering `--version` |
65
65
  | `foundry-version` | yes | the three report one version |
66
66
  | `foundry-exit-code` | yes | each hands its exit code back. The `@foundry-rs` npm packages (1.7.1) install a Node shim that exits 0 whatever the binary returned, so a failed `forge build` reports success; doctor probes with a flag no binary knows (the real ones exit 2, the shim 0), names the shim, and prints the `ln -sf` line to the real binary it found in the platform package beside it |
67
- | `slither`, `aderyn` | no | on PATH; a warning when missing or not at the version CI pins (0.11.6, 0.6.8) |
67
+ | `slither` | no | on PATH; a warning when missing or not at the version CI pins (0.11.6) |
68
+ | `aderyn` | no | reported, never a warning: Cyfrin retired Aderyn in November 2026 and withdrew its binaries and npm archives, so the scaffold's CI no longer runs it (0.2.5). A copy already installed is named with its version |
68
69
  | `env-tracked` | yes | no `.env` or `.env.*` (other than `.env.example`) in `git ls-files` |
69
70
  | `vendor` | yes | in a scaffold, each `vendor/redbelly-*/package.json` version equals the record the scaffolder wrote under `redbelly.vendor` in the root `package.json`; a scaffold without the record warns |
70
71
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- export declare const DOCTOR_HELP = "redbelly-doctor [options]\n\nChecks the machine before the first command: Node 22 or later; forge, anvil and cast on\nPATH, one version, and the real binaries rather than the @foundry-rs npm shim that exits 0\nwhatever the binary returned; slither and aderyn (optional); git; no .env tracked by git;\nand, in a scaffold, vendor/ matching the versions the scaffolder recorded. One line per\ncheck with the fix on the same line. Touches no network and no key.\n\n --project <dir> scaffold root, its contracts/ folder, or any directory (default: cwd)\n --json print the report as JSON\n --version, --help\n\nExit 0 when every required check passes (optional checks may warn), 1 otherwise, 2 on bad arguments.\n";
2
+ export declare const DOCTOR_HELP = "redbelly-doctor [options]\n\nChecks the machine before the first command: Node 22 or later; forge, anvil and cast on\nPATH, one version, and the real binaries rather than the @foundry-rs npm shim that exits 0\nwhatever the binary returned; slither (optional); git; no .env tracked by git;\nand, in a scaffold, vendor/ matching the versions the scaffolder recorded. One line per\ncheck with the fix on the same line. Touches no network and no key.\n\n --project <dir> scaffold root, its contracts/ folder, or any directory (default: cwd)\n --json print the report as JSON\n --version, --help\n\nExit 0 when every required check passes (optional checks may warn), 1 otherwise, 2 on bad arguments.\n";
3
3
  export declare function parseDoctorArgs(argv: readonly string[]): {
4
4
  project?: string;
5
5
  json: boolean;
@@ -8,7 +8,7 @@ export const DOCTOR_HELP = `redbelly-doctor [options]
8
8
 
9
9
  Checks the machine before the first command: Node 22 or later; forge, anvil and cast on
10
10
  PATH, one version, and the real binaries rather than the @foundry-rs npm shim that exits 0
11
- whatever the binary returned; slither and aderyn (optional); git; no .env tracked by git;
11
+ whatever the binary returned; slither (optional); git; no .env tracked by git;
12
12
  and, in a scaffold, vendor/ matching the versions the scaffolder recorded. One line per
13
13
  check with the fix on the same line. Touches no network and no key.
14
14
 
package/dist/doctor.d.ts CHANGED
@@ -37,6 +37,10 @@ export interface DoctorReport {
37
37
  }
38
38
  export declare const NODE_MIN_MAJOR = 22;
39
39
  export declare const SLITHER_PIN = "0.11.6";
40
+ /**
41
+ * @deprecated Cyfrin retired Aderyn in November 2026 and withdrew its binaries and npm archives, so
42
+ * CI no longer runs it and doctor no longer compares against a pin. Kept so imports of 0.2.4 still resolve.
43
+ */
40
44
  export declare const ADERYN_PIN = "0.6.8";
41
45
  declare const FOUNDRY_TOOLS: readonly ["forge", "anvil", "cast"];
42
46
  type FoundryTool = (typeof FOUNDRY_TOOLS)[number];
package/dist/doctor.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // redbelly-doctor: the machine before the first command. Node 22 or later; forge, anvil and cast
2
2
  // present, one version, and the real binaries rather than the @foundry-rs npm shim that exits 0
3
- // whatever the binary returned; slither and aderyn optional; git; no .env tracked; and, in a
3
+ // whatever the binary returned; slither optional; aderyn reported, never warned on (retired); git; no .env tracked; and, in a
4
4
  // scaffold, vendor/ matching the versions the scaffolder recorded. One line per check with the fix
5
5
  // on the same line. The fix text comes from the failure table in @gatedpath/agent-rules, so
6
6
  // explain_failure and doctor use the same words. Nothing here touches a network or a key.
@@ -14,6 +14,10 @@ export const DOCTOR_VERSION = require('../package.json').version;
14
14
  export const DOCTOR_CHECK_IDS = ['node', 'git', 'forge', 'anvil', 'cast', 'foundry-version', 'foundry-exit-code', 'slither', 'aderyn', 'env-tracked', 'vendor'];
15
15
  export const NODE_MIN_MAJOR = 22;
16
16
  export const SLITHER_PIN = '0.11.6';
17
+ /**
18
+ * @deprecated Cyfrin retired Aderyn in November 2026 and withdrew its binaries and npm archives, so
19
+ * CI no longer runs it and doctor no longer compares against a pin. Kept so imports of 0.2.4 still resolve.
20
+ */
17
21
  export const ADERYN_PIN = '0.6.8';
18
22
  const FOUNDRY_TOOLS = ['forge', 'anvil', 'cast'];
19
23
  /** The flag no Foundry binary knows. clap exits 2 on it; the npm shim exits 0. */
@@ -160,20 +164,34 @@ export async function runDoctor(opts = {}) {
160
164
  const concrete = shims.map((t) => (found[t].real ? `ln -sf ${found[t].real} ${found[t].path}` : null)).filter(Boolean).join(' && ');
161
165
  checks.push({ id: 'foundry-exit-code', required: true, status: 'fail', reason: `${detail}. A failed forge build or test reports success through it.`, fix: concrete || fixFor('foundry-exit-code-shim'), kind: 'foundry-exit-code-shim', data: { shims: shims.map((t) => ({ tool: t, path: found[t].path, real: found[t].real })) } });
162
166
  }
163
- // slither, aderyn (optional)
164
- for (const [tool, pin, kind] of [['slither', SLITHER_PIN, 'slither-not-found'], ['aderyn', ADERYN_PIN, 'aderyn-not-found']]) {
165
- const path = whichOnPath(tool, env, platform);
167
+ // slither (optional)
168
+ {
169
+ const path = whichOnPath('slither', env, platform);
166
170
  if (!path) {
167
- checks.push({ id: tool, required: false, status: 'warn', reason: `not found on PATH (optional${tool === 'slither' ? '; pre-flight wants its report before a deploy' : ''}).`, fix: fixFor(kind), kind });
168
- continue;
171
+ checks.push({ id: 'slither', required: false, status: 'warn', reason: 'not found on PATH (optional; pre-flight wants its report before a deploy).', fix: fixFor('slither-not-found'), kind: 'slither-not-found' });
172
+ }
173
+ else {
174
+ const v = await toolVersion(path);
175
+ if (!v.version)
176
+ checks.push({ id: 'slither', required: false, status: 'warn', reason: `${path} did not answer --version (optional).`, fix: fixFor('slither-not-found'), kind: 'slither-not-found', data: { path } });
177
+ else if (v.version !== SLITHER_PIN)
178
+ checks.push({ id: 'slither', required: false, status: 'warn', reason: `${v.version} at ${path}; CI pins ${SLITHER_PIN}, so findings may differ.`, fix: null, kind: null, data: { path, version: v.version, pin: SLITHER_PIN } });
179
+ else
180
+ checks.push({ id: 'slither', required: false, status: 'pass', reason: `${v.version} at ${path}`, fix: null, kind: null, data: { path, version: v.version } });
181
+ }
182
+ }
183
+ // aderyn: reported, never warned on. Cyfrin retired it in November 2026 and withdrew every install route,
184
+ // so a missing copy is the normal case and there is nothing for the builder to fix. The id stays so the
185
+ // report keeps its shape for agents that read it.
186
+ {
187
+ const path = whichOnPath('aderyn', env, platform);
188
+ if (!path) {
189
+ checks.push({ id: 'aderyn', required: false, status: 'pass', reason: 'not installed, and not needed: Cyfrin retired Aderyn in November 2026; Slither is the analyser CI and pre-flight use.', fix: null, kind: null });
190
+ }
191
+ else {
192
+ const v = await toolVersion(path);
193
+ checks.push({ id: 'aderyn', required: false, status: 'pass', reason: `${v.version ?? 'a copy'} at ${path}; retired by Cyfrin in November 2026, so CI no longer runs it, but npm run lint:aderyn still does.`, fix: null, kind: null, data: { path, version: v.version } });
169
194
  }
170
- const v = await toolVersion(path);
171
- if (!v.version)
172
- checks.push({ id: tool, required: false, status: 'warn', reason: `${path} did not answer --version (optional).`, fix: fixFor(kind), kind, data: { path } });
173
- else if (v.version !== pin)
174
- checks.push({ id: tool, required: false, status: 'warn', reason: `${v.version} at ${path}; CI pins ${pin}, so findings may differ.`, fix: null, kind: null, data: { path, version: v.version, pin } });
175
- else
176
- checks.push({ id: tool, required: false, status: 'pass', reason: `${v.version} at ${path}`, fix: null, kind: null, data: { path, version: v.version } });
177
195
  }
178
196
  // no .env tracked
179
197
  if (!gitPath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gatedpath/preflight",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Pre-flight checks before deploying to Redbelly Network (151 mainnet, 153 testnet): chain ID, deployer verification, Safe admin, compiler pins, secrets in git history, RBNT balance, Slither report.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -40,8 +40,8 @@
40
40
  "prepack": "npm run build"
41
41
  },
42
42
  "dependencies": {
43
- "@gatedpath/agent-rules": "0.2.4",
44
- "@gatedpath/chains": "0.2.4"
43
+ "@gatedpath/agent-rules": "0.2.5",
44
+ "@gatedpath/chains": "0.2.5"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/node": "^22.20.2",