@noego/trust 0.3.0 → 0.4.0
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 +32 -21
- package/dist/{chunk-APNT6ZSM.js → chunk-YJYGTNJD.js} +3 -3
- package/dist/chunk-YJYGTNJD.js.map +1 -0
- package/dist/cli/index.js +2 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/eslint/index.d.ts +3 -3
- package/dist/eslint/index.js +2 -2
- package/dist/eslint/index.js.map +1 -1
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -15
- package/dist/index.d.ts +42 -15
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-APNT6ZSM.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,59 +2,70 @@
|
|
|
2
2
|
|
|
3
3
|
Make the failure path explicit. Everything is untrusted by default: every call into untrusted code,
|
|
4
4
|
and every `throw`, must be handled locally by a `try` whose `catch` returns `Result.err(...)` (or by
|
|
5
|
-
`
|
|
5
|
+
`Trust.try` / `Trust.tryAsync`). The goal is prevention. When something on the trust list causes a
|
|
6
6
|
bug, remove it from the list, and the lint flags every call to it.
|
|
7
7
|
|
|
8
8
|
## Runtime: `@noego/trust`
|
|
9
9
|
|
|
10
|
-
Zero imports, safe in any bundle.
|
|
10
|
+
Zero imports, safe in any bundle. Two namespaces:
|
|
11
|
+
|
|
12
|
+
| | |
|
|
13
|
+
|---|---|
|
|
14
|
+
| `Result.ok(value)` / `Result.err(failure)` | make a result |
|
|
15
|
+
| `Trust.try(fn, onError)` / `Trust.tryAsync(fn, onError)` | the only boundary that may catch a throw |
|
|
16
|
+
| `Trust.decide(r, handlers)` | the only place a failure may stop |
|
|
17
|
+
| `Trust.translate(r, mappers)` | the only place a failure may change kind |
|
|
11
18
|
|
|
12
19
|
```ts
|
|
13
|
-
import { Result } from '@noego/trust';
|
|
14
|
-
|
|
15
|
-
function parse(text: string): Result<Config, ParseError> {
|
|
16
|
-
try {
|
|
17
|
-
return Result.ok(readConfig(text));
|
|
18
|
-
} catch (cause) {
|
|
19
|
-
return Result.err({ kind: 'parse_failed', message: String(cause) });
|
|
20
|
-
}
|
|
21
|
-
}
|
|
20
|
+
import { Result, Trust } from '@noego/trust';
|
|
22
21
|
|
|
23
|
-
const loaded =
|
|
24
|
-
const fetched = await
|
|
22
|
+
const loaded = Trust.try(() => JSON.parse(text), () => ({ kind: 'bad_json' }));
|
|
23
|
+
const fetched = await Trust.tryAsync(() => client.get(url), (cause) => ({ kind: 'http_failed', cause }));
|
|
25
24
|
```
|
|
26
25
|
|
|
27
26
|
## Handling a failure: return it or decide it
|
|
28
27
|
|
|
29
28
|
Rules:
|
|
30
29
|
|
|
31
|
-
1. A failure is an object with a literal `kind`: `{ kind: 'NotFound', id }`.
|
|
32
|
-
|
|
30
|
+
1. A failure is an object with a literal `kind`: `{ kind: 'NotFound', id }`. Write it as a plain object literal; the
|
|
31
|
+
kind stays literal without `as const`.
|
|
32
|
+
2. On failure either `return r` (pass it up) or `Trust.decide` it. Nothing else may stop a failure.
|
|
33
33
|
3. A `decide` handler returns a value (never `undefined`/`void`); that value says what replaced the failure.
|
|
34
34
|
4. Leave fallible functions' return types inferred so the failure kinds flow to the caller.
|
|
35
|
-
5. A thrown error from outside code becomes a named failure in `
|
|
35
|
+
5. A thrown error from outside code becomes a named failure in `Trust.try` / `Trust.tryAsync`. No other `try` is needed.
|
|
36
36
|
|
|
37
37
|
```ts
|
|
38
|
-
import { Result } from '@noego/trust';
|
|
38
|
+
import { Result, Trust } from '@noego/trust';
|
|
39
39
|
|
|
40
40
|
async function lookup(id: number) {
|
|
41
|
-
const found = await
|
|
41
|
+
const found = await Trust.tryAsync(
|
|
42
42
|
() => db.find(id),
|
|
43
43
|
(cause) => ({ kind: 'ConnectionFailed', cause }),
|
|
44
44
|
);
|
|
45
45
|
if (!found.ok) return found;
|
|
46
46
|
return found.value ? Result.ok(found.value) : Result.err({ kind: 'NotFound', id });
|
|
47
47
|
}
|
|
48
|
+
// inferred: Ok<Row> | Err<{ kind: 'ConnectionFailed'; cause: unknown }> | Err<{ kind: 'NotFound'; id: number }>
|
|
48
49
|
|
|
49
50
|
const r = await lookup(7);
|
|
50
51
|
// NotFound becomes a guest value; ConnectionFailed stays a failure in the type.
|
|
51
|
-
const user =
|
|
52
|
+
const user = Trust.decide(r, { NotFound: () => GUEST });
|
|
52
53
|
if (!user.ok) return user; // Err<{ kind: 'ConnectionFailed'; ... }>
|
|
53
54
|
```
|
|
54
55
|
|
|
55
|
-
`
|
|
56
|
+
`Trust.translate(r, { NotFound: (f) => ({ kind: 'Missing', id: f.id }) })` turns one failure into another.
|
|
56
57
|
Handlers and mappers are synchronous: async handlers are not supported.
|
|
57
58
|
|
|
59
|
+
A single declared failure whose `kind` is a union (`{ kind: 'missing' | 'locked'; path: string }`) is treated as one
|
|
60
|
+
failure per kind, so each handler narrows to its own kind.
|
|
61
|
+
|
|
62
|
+
### Breaking in 0.4.0
|
|
63
|
+
|
|
64
|
+
`Result` is now only `{ ok, err }`. `try`, `tryAsync`, `decide` and `translate` moved to `Trust`:
|
|
65
|
+
`Result.try` → `Trust.try`, `Result.tryAsync` → `Trust.tryAsync`, `Result.decide` → `Trust.decide`,
|
|
66
|
+
`Result.translate` → `Trust.translate`. The underlying functions (`ok`, `err`, `tryResult`, `tryResultAsync`,
|
|
67
|
+
`decide`, `translate`) stay exported for declaration identity; write the namespace form in application code.
|
|
68
|
+
|
|
58
69
|
### Breaking in 0.3.0
|
|
59
70
|
|
|
60
71
|
An inline `err({ kind: ... })` now keeps its literal kind, so a callback returning several different failures no longer collapses to `{ kind: string }`. Give the receiving function a union type, or let it infer the callback's whole return type.
|
|
@@ -100,7 +111,7 @@ export default [
|
|
|
100
111
|
config file's directory, matched on realpaths. A glob matching no file is a load error.
|
|
101
112
|
|
|
102
113
|
A call is also trusted when its declared return type is `Result` / `Promise<Result>` from `@noego/trust`,
|
|
103
|
-
unless its origin is explicitly distrusted. `Result.err`, `
|
|
114
|
+
unless its origin is explicitly distrusted. `Result.err`, `Trust.try` and `Trust.tryAsync` are recognised
|
|
104
115
|
by declaration, not by name.
|
|
105
116
|
|
|
106
117
|
### Presets
|
|
@@ -118,7 +118,7 @@ function namedTryKind(call) {
|
|
|
118
118
|
if (callee.type !== "MemberExpression") return null;
|
|
119
119
|
const object = callee.object;
|
|
120
120
|
const property = callee.property;
|
|
121
|
-
if (object.type !== "Identifier" || object.name !== "Result" || property.type !== "Identifier") return null;
|
|
121
|
+
if (object.type !== "Identifier" || object.name !== "Trust" && object.name !== "Result" || property.type !== "Identifier") return null;
|
|
122
122
|
if (property.name === "try") return "sync";
|
|
123
123
|
if (property.name === "tryAsync") return "async";
|
|
124
124
|
return null;
|
|
@@ -1924,7 +1924,7 @@ function withOrigin(template) {
|
|
|
1924
1924
|
return template.replace("{{target}}", 'the call into "{{origin}}"');
|
|
1925
1925
|
}
|
|
1926
1926
|
var UNTRUSTED_CALL_MESSAGES = {
|
|
1927
|
-
unguarded: 'Call into untrusted "{{origin}}" must be inside a `try` (same function) whose `catch` returns Result.err(...), or inside
|
|
1927
|
+
unguarded: 'Call into untrusted "{{origin}}" must be inside a `try` (same function) whose `catch` returns Result.err(...), or inside Trust.try/tryAsync. If "{{origin}}" cannot fail, trust it in trust.config.json.',
|
|
1928
1928
|
notAwaited: 'Async call into untrusted "{{origin}}" must be awaited inside the guard, or its rejection escapes the catch.',
|
|
1929
1929
|
callsIgnored: 'Call into "{{origin}}" is trusted only because its file is ignored. List that file under "passthrough" instead of "ignore" so calls into it must be handled.',
|
|
1930
1930
|
rethrow: withOrigin(CATCH_MESSAGES.rethrow),
|
|
@@ -2165,4 +2165,4 @@ export {
|
|
|
2165
2165
|
serializeBaseline,
|
|
2166
2166
|
parseBaseline
|
|
2167
2167
|
};
|
|
2168
|
-
//# sourceMappingURL=chunk-
|
|
2168
|
+
//# sourceMappingURL=chunk-YJYGTNJD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint/guard.ts","../src/eslint/node-preset.generated.ts","../src/eslint/presets.ts","../src/eslint/zones.ts","../src/eslint/config.ts","../src/eslint/origin.ts","../src/eslint/policy.ts","../src/eslint/rule-setup.ts","../src/eslint/typescript.ts","../src/eslint/rules/untrusted-call-must-return-result.ts","../src/eslint/baseline.ts"],"sourcesContent":["// \"Is this node guarded?\" A node is guarded when, within the same function, it sits in the `try`\n// block of a TryStatement whose `catch` returns Result.err(...) on every path, or when the function\n// it sits in is the callback passed directly to Trust.try / Trust.tryAsync.\n\n/** Minimal ESTree node shape (avoids coupling to a specific @types/estree version). */\nexport interface AstNode {\n readonly type: string;\n parent?: AstNode;\n readonly [key: string]: unknown;\n}\n\nexport type CatchProblem = 'rethrow' | 'notResultErr' | 'rawCatchValue' | 'notAllPaths';\n\nexport type Guard =\n | { readonly status: 'unguarded' }\n | { readonly status: 'guarded'; readonly via: 'try' | 'sync-callback' | 'async-callback' }\n | { readonly status: 'badCatch'; readonly problem: CatchProblem };\n\nexport interface GuardContext {\n /** The returned expression is an `Err` (typed: by declaration; untyped: `Result.err(...)`/`err(...)` by name). */\n isResultErr(expression: AstNode): boolean;\n /** The call is `Result.err(...)` / `err(...)` itself (for the raw-caught-value check). */\n isErrCall(expression: AstNode): boolean;\n /** 'sync' for Trust.try, 'async' for Trust.tryAsync, else null. */\n trustTryKind(call: AstNode): 'sync' | 'async' | null;\n}\n\nexport const FUNCTION_TYPES = new Set(['FunctionDeclaration', 'FunctionExpression', 'ArrowFunctionExpression']);\nconst LOOP_OR_SWITCH = new Set(['ForStatement', 'ForInStatement', 'ForOfStatement', 'WhileStatement', 'DoWhileStatement', 'SwitchStatement']);\n\nexport const CATCH_MESSAGES: Record<CatchProblem, string> = {\n rethrow: '`catch` guarding {{target}} must return Result.err(...), not re-throw.',\n notResultErr: '`catch` guarding {{target}} must return Result.err(...) on every return.',\n rawCatchValue: 'Result.err(...) guarding {{target}} must not pass the raw caught value; normalize it to a typed error.',\n notAllPaths: '`catch` guarding {{target}} must return Result.err(...) on every path.',\n};\n\nfunction children(node: AstNode): AstNode[] {\n const result: AstNode[] = [];\n for (const key of Object.keys(node)) {\n if (key === 'parent') continue;\n const value = node[key];\n if (Array.isArray(value)) {\n for (const item of value) if (item && typeof (item as AstNode).type === 'string') result.push(item as AstNode);\n } else if (value && typeof (value as AstNode).type === 'string') {\n result.push(value as AstNode);\n }\n }\n return result;\n}\n\nfunction collectExits(node: AstNode, exits: AstNode[]): void {\n if (FUNCTION_TYPES.has(node.type)) return;\n if (node.type === 'ReturnStatement' || node.type === 'ThrowStatement') exits.push(node);\n for (const child of children(node)) collectExits(child, exits);\n}\n\nfunction containsBreakFor(node: AstNode, isRoot = true): boolean {\n if (FUNCTION_TYPES.has(node.type)) return false;\n if (!isRoot && LOOP_OR_SWITCH.has(node.type)) return false;\n if (node.type === 'BreakStatement' && !node.label) return true;\n return children(node).some((child) => containsBreakFor(child, false));\n}\n\n/** Every path through `statement` ends in return (or throw). */\nexport function alwaysExits(statement: AstNode | null | undefined): boolean {\n if (!statement) return false;\n switch (statement.type) {\n case 'ReturnStatement':\n case 'ThrowStatement':\n return true;\n case 'BlockStatement':\n return (statement.body as AstNode[]).some((child) => alwaysExits(child));\n case 'IfStatement':\n return alwaysExits(statement.consequent as AstNode) && alwaysExits(statement.alternate as AstNode | null);\n case 'SwitchStatement': {\n const cases = statement.cases as AstNode[];\n if (!cases.some((entry) => entry.test === null)) return false;\n if (containsBreakFor(statement)) return false;\n const last = cases[cases.length - 1];\n return (last.consequent as AstNode[]).some((child) => alwaysExits(child));\n }\n case 'TryStatement': {\n if (alwaysExits(statement.finalizer as AstNode | null)) return true;\n const handler = statement.handler as AstNode | null;\n return alwaysExits(statement.block as AstNode) && (!handler || alwaysExits(handler.body as AstNode));\n }\n case 'LabeledStatement':\n return alwaysExits(statement.body as AstNode);\n default:\n return false;\n }\n}\n\n/** Null when the catch clause returns Result.err(...) on every path, else the problem. */\nexport function catchProblem(handler: AstNode, context: GuardContext): CatchProblem | null {\n const exits: AstNode[] = [];\n collectExits(handler.body as AstNode, exits);\n const param = handler.param as AstNode | null;\n const paramName = param?.type === 'Identifier' ? (param.name as string) : null;\n for (const exit of exits) {\n if (exit.type === 'ThrowStatement') return 'rethrow';\n const argument = exit.argument as AstNode | null;\n if (!argument || !context.isResultErr(argument)) return 'notResultErr';\n if (paramName && context.isErrCall(argument)) {\n const [first] = argument.arguments as AstNode[];\n if (first?.type === 'Identifier' && first.name === paramName) return 'rawCatchValue';\n }\n }\n return alwaysExits(handler.body as AstNode) ? null : 'notAllPaths';\n}\n\n/** Innermost guard of `node` within its own function. */\nexport function guardOf(node: AstNode, context: GuardContext): Guard {\n let child: AstNode = node;\n let current = node.parent;\n while (current) {\n if (FUNCTION_TYPES.has(current.type)) {\n const call = current.parent;\n if (call?.type === 'CallExpression' && (call.arguments as AstNode[])[0] === current) {\n const kind = context.trustTryKind(call);\n if (kind) return { status: 'guarded', via: kind === 'sync' ? 'sync-callback' : 'async-callback' };\n }\n return { status: 'unguarded' };\n }\n if (current.type === 'TryStatement' && current.block === child) {\n const handler = current.handler as AstNode | null;\n if (handler) {\n const problem = catchProblem(handler, context);\n return problem ? { status: 'badCatch', problem } : { status: 'guarded', via: 'try' };\n }\n }\n child = current;\n current = current.parent;\n }\n return { status: 'unguarded' };\n}\n\nfunction isNamedErrCall(node: AstNode): boolean {\n if (node.type !== 'CallExpression') return false;\n const callee = node.callee as AstNode;\n if (callee.type === 'Identifier') return callee.name === 'err';\n if (callee.type !== 'MemberExpression') return false;\n const object = callee.object as AstNode;\n const property = callee.property as AstNode;\n return object.type === 'Identifier' && object.name === 'Result' && property.type === 'Identifier' && property.name === 'err';\n}\n\nfunction namedTryKind(call: AstNode): 'sync' | 'async' | null {\n const callee = call.callee as AstNode;\n if (callee.type === 'Identifier') {\n if (callee.name === 'tryResult') return 'sync';\n if (callee.name === 'tryResultAsync') return 'async';\n return null;\n }\n if (callee.type !== 'MemberExpression') return null;\n const object = callee.object as AstNode;\n const property = callee.property as AstNode;\n // `Trust.try` / `Trust.tryAsync` is the current spelling; `Result.try` / `Result.tryAsync` is pre-0.4.\n if (object.type !== 'Identifier' || (object.name !== 'Trust' && object.name !== 'Result') || property.type !== 'Identifier') return null;\n if (property.name === 'try') return 'sync';\n if (property.name === 'tryAsync') return 'async';\n return null;\n}\n\n/** Name-based fallback for untyped linting. */\nexport const NAME_BASED_GUARD_CONTEXT: GuardContext = {\n isResultErr: isNamedErrCall,\n isErrCall: isNamedErrCall,\n trustTryKind: namedTryKind,\n};\n","// GENERATED by trust/research/node-api/tools/emit-preset.mjs. Do not edit by hand: change the audit and regenerate.\n//\n// Node built-in APIs audited member by member against the Node source (v24.21.0 decides, v26.10.0 recorded).\n// Trusted = a call whose arguments satisfy the TypeScript types cannot throw synchronously and cannot fail\n// asynchronously (rejected promise, error-first callback, call-caused 'error' event). I/O, native calls and\n// OS reads are fine on their own; only a reachable failure path disqualifies. Exceptions from callbacks or\n// listeners the caller passes count as failures. Implicit hooks (Proxy traps, getters, coercion) and\n// TypeScript-unsound inputs do not; engine resource limits (OOM, max string length) do not.\n//\n// 2411 callables audited: 641 trust, 1770 distrust. 541 trust entries (20 cover a whole\n// module or class), 6 distrust entries for distrusted members under a trusted entry.\n// Evidence for every entry: trust/research/node-api/out/verdicts.final.json.\n\nexport const NODE_TRUST: readonly string[] = [\n 'node:assert.assert.Assert', // Constructor merges options with defaults and stores them; diff is the literal union 'simple'|'full' so valida…\n 'node:assert.assert.CallTracker.report', // Deprecated (DEP0173); iterates the private SafeSet of contexts and builds plain report objects from private f…\n 'node:async_hooks.AsyncHook', // every member (2) audited trust; also trusts future members\n 'node:async_hooks.AsyncLocalStorage.bind', // Delegates to AsyncResource.bind(fn): type falls back to fn.name or 'bound-anonymous-fn', default trigger id i…\n 'node:async_hooks.AsyncLocalStorage.disable', // Deletes this store from the current AsyncContextFrame map (no-op when no frame); native getContinuationPreser…\n 'node:async_hooks.AsyncLocalStorage.enterWith', // Builds a new SafeMap frame copying the current frame and stores it via the native continuation-data setter; s…\n 'node:async_hooks.AsyncLocalStorage.getStore', // Reads the current frame via the native getter and returns frame.get(this) or the default value; SafeMap looku…\n 'node:async_hooks.AsyncLocalStorage.snapshot', // Binds an internal anonymous arrow through AsyncResource.bind and returns it; the user callback runs only when…\n 'node:async_hooks.AsyncLocalStorage.withScope', // v26-only (typed); constructs RunScope which calls getStore and enterWith, neither of which can fail; experime…\n 'node:async_hooks.AsyncResource.asyncId', // Returns a stored numeric field; no failure path (v24.21.0/lib/async_hooks.js:243; v26 :242).\n 'node:async_hooks.AsyncResource.bind', // Static bind: type ||= fn.name || 'bound-anonymous-fn' so validateString/ERR_ASYNC_TYPE are unreachable for ty…\n 'node:async_hooks.AsyncResource.emitDestroy', // Marks destroyed and, only if destroy hooks exist, queues the id natively for a later destroy callback; hook e…\n 'node:async_hooks.AsyncResource.triggerAsyncId', // Returns a stored numeric field; no failure path (v24.21.0/lib/async_hooks.js:247; v26 :246).\n 'node:async_hooks.RunScope.dispose', // v26-only; idempotent: returns if already disposed, else restores the previous store via enterWith, which cann…\n 'node:async_hooks.executionAsyncId', // Returns a field of the shared async_id_fields typed array; no failure path (v24.21.0/lib/internal/async_hooks…\n 'node:async_hooks.executionAsyncResource', // Returns the top-level resource or the stack entry; native ExecutionAsyncResource only converts an internal in…\n 'node:async_hooks.triggerAsyncId', // Returns a field of the shared async_id_fields typed array; no failure path (v24.21.0/lib/internal/async_hooks…\n 'node:buffer.Blob.slice', // WebIDL long long conversion clamps typed numbers (NaN->0), negatives/overflow are clamped to [0,size], conten…\n 'node:buffer.Blob.stream', // Gets a native reader and wraps it in a highWaterMark-0 ReadableStream, so nothing is read at call time; NotRe…\n 'node:buffer.Blob.textStream', // Creates the blob reader stream and pipes it through a non-fatal TextDecoderStream; invalid UTF-8 becomes U+FF…\n 'node:buffer.isAscii', // Typed ArrayBuffer/TypedArray always passes the JS guard (the INVALID_ARG_TYPE throw is type_only); native Val…\n 'node:buffer.isUtf8', // Typed ArrayBuffer/TypedArray always passes the JS guard (INVALID_ARG_TYPE is type_only); native ValidateUtf8 …\n 'node:buffer.resolveObjectURL', // The entire URL parse, nodedata lookup and blob creation run inside try/catch that swallows every error and re…\n 'node:buffer.valueOf', // Type-only member of the WithImplicitCoercion<T> object literal ({ valueOf(): T }) supplied by callers, not a …\n 'node:child_process.ChildProcess.ref', // No-op without a handle; native HandleWrap::Ref only uv_refs a live handle and returns silently otherwise (v24…\n 'node:child_process.ChildProcess.unref', // No-op without a handle; native HandleWrap::Unref only uv_unrefs a live handle (v24.21.0/lib/internal/child_pr…\n 'node:child_process.Control', // every member (2) audited trust; also trusts future members\n 'node:cluster.Worker.isConnected', // Returns this.process.connected, a plain boolean field on the ChildProcess; no failure path (v24.21.0/lib/inte…\n 'node:cluster.Worker.isDead', // Compares process.exitCode and signalCode against null; no failure path (v24.21.0/lib/internal/cluster/worker.…\n 'node:console.console.Console.countReset', // v24 implementation is present despite the bundle's absence flag: missing labels only warn, and Trace receives…\n 'node:console.console.Console.groupEnd', // Only slices the genuine receiver's indentation string; no callback or failure delivery (v26.10.0/lib/internal…\n 'node:console.console.Console.time', // Typed string labels produce nonempty trace names and safe timer-map updates; duplicate labels only warn; insp…\n 'node:console.console.Console.timeStamp', // Both runtimes use V8 ConsoleTimeStamp: typed string labels are returned directly and omitted/undefined labels…\n 'node:crypto.DiffieHellman.getGenerator', // Returns g, which every constructed DH has (constructor rejects missing params); 'g is null' throw (v24 crypto…\n 'node:crypto.Hmac.digest', // A repeated digest returns an empty buffer instead of throwing; native HMAC finalize failure (v24 crypto_hmac.…\n 'node:crypto.KeyObject.from', // v24: genuine CryptoKey always maps to a KeyObject (DEP0204 warning only; structural fake CryptoKey caveat at …\n 'node:crypto.X509Certificate.checkIssued', // With a genuine X509Certificate, native isIssuedBy returns a boolean (v24 crypto_x509.cc:452, v26 :431); only …\n 'node:crypto.X509Certificate.toJSON', // Returns the cached native PEM (v24 crypto_x509.cc:282, v26 :269); only allocation/string limits can fail, whi…\n 'node:crypto.X509Certificate.toLegacyObject', // Native X509ToObject has no throw besides allocation (excluded); empty result maps to null, and translatePeerC…\n 'node:crypto.X509Certificate.toString', // Returns the cached native PEM (v24 crypto_x509.cc:282, v26 :269); only allocation/string limits can fail, whi…\n 'node:crypto.createSecretKey', // bufferOnly path: typed ArrayBufferView passes, string+BufferEncoding goes through Buffer.from (no throw), nat…\n 'node:crypto.getCiphers', // Native enumeration converts available names into an array without exposing provider errors; v26 refreshes by …\n 'node:crypto.getCurves', // Native curve enumeration only collects names into an array; engine allocation/string limits excluded in both …\n 'node:crypto.getFips', // Reads forced-FIPS flag or native enabled boolean without exposing failure; engine allocation limits excluded …\n 'node:crypto.getHashes', // Native hash enumeration filters unavailable digests rather than throwing; v26 refreshes by FIPS generation; e…\n 'node:crypto.randomUUID', // Draws from the OpenSSL CSPRNG; the only failure is an OpenSSL install whose random provider cannot be instant…\n 'node:crypto.randomUUIDv7', // Same CSPRNG as randomUUID; the only failure is an OpenSSL random provider that cannot be instantiated (v24.21…\n 'node:crypto.secureHeapUsed', // Native secure-heap read returns a number and JS constructs statistics; no failure delivery in either version;…\n 'node:crypto.webcrypto.Crypto.randomUUID', // v24: cannot fail. v26: after crypto.setFips(true), webcrypto.randomUUID throws ERR_OSSL_EVP_UNSUPPORTED (v26.…\n 'node:dgram.Socket.ref', // No-op when closed; native HandleWrap ref only toggles loop reference (v24.21.0/src/handle_wrap.cc); identical…\n 'node:dgram.Socket.unref', // No-op when closed; native HandleWrap unref only toggles loop reference (v24.21.0/src/handle_wrap.cc:49); iden…\n 'node:diagnostics_channel.BoundedChannel.subscribe', // v26-only experimental: subscribes typed handler functions to start/end channels; no throws for typed input.\n 'node:diagnostics_channel.BoundedChannel.unsubscribe', // v26-only experimental: removes handlers and returns boolean; no throws for typed input.\n 'node:diagnostics_channel.BoundedChannel.withScope', // v26-only experimental: enters bound stores via AsyncLocalStorage.withScope and publishes start; subscriber an…\n 'node:diagnostics_channel.Channel.bindStore', // Records the store/transform in a map; the transform runs only later in runStores where its exceptions are cau…\n 'node:diagnostics_channel.Channel.publish', // Subscriber exceptions are caught and re-raised via process.nextTick as uncaught exceptions, never thrown or d…\n 'node:diagnostics_channel.Channel.subscribe', // validateFunction always passes for a typed listener; only array/map bookkeeping; identical in v26.\n 'node:diagnostics_channel.Channel.unbindStore', // Map lookup/delete returning boolean; no throws; identical in v26.\n 'node:diagnostics_channel.Channel.unsubscribe', // Array lookup/splice returning boolean; no throws; identical in v26.\n 'node:diagnostics_channel.Channel.withStoreScope', // v26-only experimental: inactive channel returns a no-op disposable; active channel enters stores with withSco…\n 'node:diagnostics_channel.TracingChannel.subscribe', // Subscribes typed handler functions to the per-event channels; no throws for typed input; v26 routes through B…\n 'node:diagnostics_channel.TracingChannel.unsubscribe', // Removes handlers and returns boolean; no throws for typed input; identical behavior in v26.\n 'node:diagnostics_channel.boundedChannel', // v26-only experimental: string names always create channels; a typed collection of genuine Channel objects pas…\n 'node:diagnostics_channel.channel', // Typed string|symbol always passes the type check; returns cached or new Channel; identical in v26 (lib/diagno…\n 'node:diagnostics_channel.hasSubscribers', // Map lookup returning boolean; no throws; identical in v26.\n 'node:diagnostics_channel.subscribe', // channel(name).subscribe with a typed function; no throws; identical in v26.\n 'node:diagnostics_channel.tracingChannel', // String names always create channels; a typed collection of genuine Channel objects passes assertChannel; same…\n 'node:diagnostics_channel.unsubscribe', // channel(name).unsubscribe returns boolean; no throws; identical in v26.\n 'node:dns.Resolver.cancel', // Native ares_cancel returns void; cancelled queries get ECANCELLED on their own callbacks/promises via SetImme…\n 'node:dns.getDefaultResultOrder', // Returns the stored order string; no throws; v26 initializes it to 'verbatim' (lib/internal/dns/utils.js:219).\n 'node:dns.getServers', // Bound ResolverBase.getServers on the default resolver; native read guarded only by internal CHECKs; identical…\n 'node:dns.setDefaultResultOrder', // validateOneOf accepts every member of the typed literal union; assignment only; identical in v26.\n 'node:dns/promises.Resolver.cancel', // Native ares_cancel returns void; cancelled queries get ECANCELLED on their own callbacks/promises via SetImme…\n 'node:dns/promises.getDefaultResultOrder', // Returns the stored order string; no throws; v26 initializes it to 'verbatim' (lib/internal/dns/utils.js:219).\n 'node:dns/promises.getServers', // Bound ResolverBase.getServers on the default resolver; native read guarded only by internal CHECKs; identical…\n 'node:dns/promises.setDefaultResultOrder', // validateOneOf accepts every member of the typed literal union; assignment only; identical in v26.\n 'node:domain.Domain.bind', // Deprecated; only creates a wrapper and defines its domain property; supplied callback is not invoked by bind …\n 'node:domain.Domain.enter', // Deprecated; updates stack and captured original exception callback after clearing it; analyzer confuses the s…\n 'node:domain.Domain.exit', // Deprecated; missing stack entry is a no-op; otherwise pops stack and safely clears/reinstalls captured origin…\n 'node:domain.Domain.intercept', // Deprecated; returns a wrapper without executing callback or forwarding an error during intercept in either ve…\n 'node:domain.create', // Deprecated; allocates genuine Domain and WeakRef and installs only internal hooks/listeners; native hook regi…\n 'node:events.EventEmitter.EventEmitterAsyncResource.emitDestroy', // Marks resource destroyed and queues native destroy notification; repeated calls do not throw and delayed dest…\n 'node:events.EventEmitter.InternalEventEmitter.listenerCount', // v26-only type interface inherits EventEmitter prototype listenerCount; reads/copies registrations without inv…\n 'node:events.EventEmitter.InternalEventEmitter.listeners', // v26-only type interface inherits EventEmitter prototype listeners; reads/copies registrations without invokin…\n 'node:events.EventEmitter.InternalEventEmitter.rawListeners', // v26-only type interface inherits EventEmitter prototype rawListeners; reads/copies registrations without invo…\n 'node:events.EventEmitter.NodeEventTarget.emit', // Genuine NodeEventTarget dispatch catches listener exceptions/rejections and schedules an uncaught nextTick th…\n 'node:events.EventEmitter.NodeEventTarget.eventNames', // Genuine NodeEventTarget only reads its listener map or numeric listener limit; no callback invocation or coun…\n 'node:events.EventEmitter.NodeEventTarget.getMaxListeners', // Genuine NodeEventTarget only reads its listener map or numeric listener limit; no callback invocation or coun…\n 'node:events.EventEmitter.NodeEventTarget.listenerCount', // Genuine NodeEventTarget only reads its listener map or numeric listener limit; no callback invocation or coun…\n 'node:events.EventEmitter.NodeEventTarget.off', // Genuine NodeEventTarget removes matching listener without invoking it or EventEmitter removeListener meta-lis…\n 'node:events.EventEmitter.NodeEventTarget.removeAllListeners', // Genuine NodeEventTarget clears/deletes listener map without invoking callbacks or emitting removal meta-event…\n 'node:events.EventEmitter.NodeEventTarget.removeListener', // Genuine NodeEventTarget removes matching listener without invoking it or EventEmitter removeListener meta-lis…\n 'node:events.EventEmitter.getEventListeners', // Returns copied listeners for genuine EventEmitter/EventTarget without invoking registered listeners; invalid-…\n 'node:events.EventEmitter.getMaxListeners', // Reads stored or default numeric limit on genuine EventEmitter/EventTarget; no counting failure in either vers…\n 'node:events.EventEmitter.listenerCount', // Static helper counts genuine emitter/target registrations without invoking listeners in both versions; bundle…\n 'node:ffi.DynamicLibrary.close', // v26-only experimental: native Close only marks functions closed and uv_dlclose()s once (idempotent, void), th…\n 'node:fs.Dirent', // every member (7) audited trust; also trusts future members\n 'node:fs.FSWatcher.ref', // Native watcher refs the HandleWrap only if open (v24 lib/internal/fs/watchers.js:357, src/handle_wrap.cc ref …\n 'node:fs.FSWatcher.unref', // Native watcher unrefs the HandleWrap only if open (v24 lib/internal/fs/watchers.js:362, src/handle_wrap.cc:49…\n 'node:fs.ReadStream.listenerCount', // v26-only typing: counts registered listeners (optionally matching one) without invoking them; no counting fai…\n 'node:fs.ReadStream.listeners', // v26-only typing: returns an unwrapped copy of the listener array without invoking listeners; no counting fail…\n 'node:fs.ReadStream.rawListeners', // v26-only typing: returns a copy of the raw listener array without invoking listeners; no counting failure pat…\n 'node:fs.StatWatcher', // every member (2) audited trust; also trusts future members\n 'node:fs.StatsBase.isBlockDevice', // Masks the numeric/bigint mode with S_IFMT and compares to S_IFBLK (false on Windows); no throw path (v24 lib/…\n 'node:fs.StatsBase.isCharacterDevice', // Masks the numeric/bigint mode with S_IFMT and compares to S_IFCHR; no throw path (v24 lib/internal/fs/utils.j…\n 'node:fs.StatsBase.isDirectory', // Masks the numeric/bigint mode with S_IFMT and compares to S_IFDIR; no throw path (v24 lib/internal/fs/utils.j…\n 'node:fs.StatsBase.isFIFO', // Masks the numeric/bigint mode with S_IFMT and compares to S_IFIFO (false on Windows); no throw path (v24 lib/…\n 'node:fs.StatsBase.isFile', // Masks the numeric/bigint mode with S_IFMT and compares to S_IFREG; no throw path (v24 lib/internal/fs/utils.j…\n 'node:fs.StatsBase.isSocket', // Masks the numeric/bigint mode with S_IFMT and compares to S_IFSOCK (false on Windows); no throw path (v24 lib…\n 'node:fs.StatsBase.isSymbolicLink', // Masks the numeric/bigint mode with S_IFMT and compares to S_IFLNK; no throw path (v24 lib/internal/fs/utils.j…\n 'node:fs.WriteStream.listenerCount', // v26-only typing: counts registered listeners (optionally matching one) without invoking them; no counting fai…\n 'node:fs.WriteStream.listeners', // v26-only typing: returns an unwrapped copy of the listener array without invoking listeners; no counting fail…\n 'node:fs.WriteStream.rawListeners', // v26-only typing: returns a copy of the raw listener array without invoking listeners; no counting failure pat…\n 'node:fs.data', // Trust as a type-only inventory artifact, not as a callable API: ReadStreamEvents.data describes the caller's …\n 'node:fs.drain', // Trust as a type-only inventory artifact, not a callable API: v24 fs.d.ts:714 declares a WriteStreamEvents lis…\n 'node:fs.existsSync', // Trust by explicit user policy: path validation errors return false (lib/fs.js:281-290) and native access/stat…\n 'node:fs.finish', // Trust only as a non-callable inventory artifact: fs.d.ts:716 describes a WriteStream finish listener, not fs.…\n 'node:fs.pipe', // Trust only this non-callable inventory artifact: fs.d.ts:718 is WriteStreamEvents.pipe, a listener type, and …\n 'node:fs.readable', // Forced binary trust for a type-only inventory artifact, not endorsement of a callable: readable is ReadStream…\n 'node:fs.ready', // Non-callable inventory artifact, not an endorsement of fs.ready(): v24 fs.d.ts:699,719 describe ready-event l…\n 'node:fs.resume', // Forced binary classification of a type-only inventory artifact: v24 fs.d.ts:700 describes a ReadStream 'resum…\n 'node:fs.unpipe', // Forced binary trust for a non-callable inventory artifact, not a runtime safety endorsement: fs.d.ts:720 is t…\n 'node:global.AbortController', // every member (2) audited trust; also trusts future members\n 'node:global.AbortSignal.abort', // Constructs an already-aborted AbortSignal with the given or default DOMException reason; no validation or lis…\n 'node:global.AbortSignal.addEventListener', // v26-only on AbortSignal: validates typed listener/options, registers a Listener; AbortSignal kNewListener onl…\n 'node:global.AbortSignal.any', // Converts a typed AbortSignal[] and builds a composite signal; genuine AbortSignal elements always pass the in…\n 'node:global.AbortSignal.removeEventListener', // v26-only on AbortSignal: unlinks a matching listener; AbortSignal kRemoveListener only updates gc-persistence…\n 'node:global.Buffer.equals', // Genuine Uint8Arrays are length-checked then compared natively without failure delivery in both versions (v24.…\n 'node:global.Buffer.includes', // Typed needles and BufferEncoding values reach bounded native searches; numeric offsets clamp and no failure i…\n 'node:global.Buffer.indexOf', // Typed needles and BufferEncoding values reach bounded native searches; numeric offsets clamp and no failure i…\n 'node:global.Buffer.isBuffer', // instanceof returns a boolean; implicit Proxy prototype traps are excluded and recorded in both versions.\n 'node:global.Buffer.isEncoding', // Primitive string normalization returns a boolean without failure in both versions (v24.21.0/lib/internal/util…\n 'node:global.Buffer.lastIndexOf', // Typed needles and BufferEncoding values reach bounded native searches; numeric offsets clamp and no failure i…\n 'node:global.Buffer.of', // Allocates a FastBuffer of items.length and assigns typed numbers to Uint8Array slots, which never throws; ide…\n 'node:global.Buffer.toJSON', // Copies bytes into a plain array; length getter returns 0 for detached buffers so no throw; identical in v26 (…\n 'node:global.Buffer.toString', // start/end are clamped in JS, every BufferEncoding literal is recognised by getEncodingOps, and native StringS…\n 'node:global.ByteLengthQueuingStrategy', // init.highWaterMark is a required typed number, so validateObject and ERR_MISSING_OPTION are type_only; the va…\n 'node:global.CallSite.getColumnNumber', // Both versions validate the genuine CallSite's private data then synchronously return a column number or null …\n 'node:global.CallSite.getEnclosingColumnNumber', // Both versions validate genuine CallSite receivers and return an enclosing column/Wasm offset or null without …\n 'node:global.CallSite.getEnclosingLineNumber', // Both versions only read internal frame/script source positions and return a positive line number or null (v24…\n 'node:global.CallSite.getEvalOrigin', // Both versions validate only CallSite receiver branding, then return undefined for non-eval frames or format i…\n 'node:global.CallSite.getFileName', // Both versions validate the genuine CallSite then read its script name or return null without invoking user co…\n 'node:global.CallSite.getFunctionName', // Both versions safely return a name or null for genuine CallSites (v24.21.0/deps/v8/src/objects/call-site-info…\n 'node:global.CallSite.getLineNumber', // Both versions return a line number or null for genuine CallSites (deps/v8/src/builtins/builtins-callsite.cc:1…\n 'node:global.CallSite.getMethodName', // Both versions validate the genuine CallSite then return a method name or null via internal metadata inspectio…\n 'node:global.CallSite.getPosition', // Genuine CallSites return an integer in both versions (v24.21.0/deps/v8/src/builtins/builtins-callsite.cc:120;…\n 'node:global.CallSite.getPromiseIndex', // Both versions return null for non-combinator frames or the stored promise index for genuine combinator frames…\n 'node:global.CallSite.getScriptHash', // For genuine CallSites both versions return an empty/cached string or synchronously hash valid source into a f…\n 'node:global.CallSite.getScriptNameOrSourceURL', // Both versions validate genuine CallSite receivers, then only read the stored script source_url/name or return…\n 'node:global.CallSite.getTypeName', // Genuine CallSites return null or a type-name string without a counting failure: v24.21.0/deps/v8/src/objects/…\n 'node:global.CallSite.isAsync', // Both versions validate the genuine CallSite's private frame then return its async flag as a boolean (v24.21.0…\n 'node:global.CallSite.isConstructor', // In both versions genuine CallSites have the own internal CallSiteInfo data property (v24.21.0/deps/v8/src/exe…\n 'node:global.CallSite.isEval', // Both versions only read the genuine CallSite's internal script compilation flag and return a boolean (v24.21.…\n 'node:global.CallSite.isNative', // Both versions validate genuine CallSite receivers and return a boolean from internal script metadata only (v2…\n 'node:global.CallSite.isPromiseAll', // Both versions only validate the genuine CallSite's internal data and return a boolean from an async flag and …\n 'node:global.CallSite.isToplevel', // Genuine CallSites carry the private frame property; receiver checks only reject invalid receivers, and isTopl…\n 'node:global.CountQueuingStrategy', // init.highWaterMark is a required typed number, so validateObject and ERR_MISSING_OPTION are type_only; no ran…\n 'node:global.CustomEvent', // Required typed type makes ERR_MISSING_ARGS type_only; stores detail and delegates to Event, which only reads …\n 'node:global.DOMException', // Creates an Error, stringifies typed message/name and optionally copies cause; no validation or native failure…\n 'node:global.Error.prepareStackTrace', // Default implementation formats error name/message and joins CallSites (source-map variant wraps lookups in tr…\n 'node:global.Event', // every member (6) audited trust; also trusts future members\n 'node:global.EventEmitter.eventNames', // Enumerates the genuine internal event table without invoking listeners or native code in both versions (v24.2…\n 'node:global.EventEmitter.getMaxListeners', // Reads the configured numeric limit or default without invoking callbacks in both versions (v24.21.0/lib/event…\n 'node:global.EventEmitter.listenerCount', // Counts registrations and compares listener identities without invoking listener functions in both versions; i…\n 'node:global.EventEmitter.listeners', // Copies and unwraps registered listener references without invoking them in both versions; implicit listener-p…\n 'node:global.EventEmitter.rawListeners', // Returns a copied array of registered function references without invoking callbacks in both versions (v24.21.…\n 'node:global.EventTarget', // Constructor only initialises internal fields via initEventTarget (identical v26 event_target.js:593).\n 'node:global.EventTarget.addEventListener', // Registers typed listeners without calling them; only type-only validations and warnings in both versions.\n 'node:global.EventTarget.removeEventListener', // Removes a registered listener without invoking it; v26 fixes boolean capture flattening without introducing f…\n 'node:global.HRTime.bigint', // Reads uv_hrtime into the binding buffer and returns its bigint; no error channel in either inspected native i…\n 'node:global.Immediate.hasRef', // Returns the internal reference-state boolean without callbacks in both versions (lib/internal/timers.js:786).\n 'node:global.Immediate.ref', // Only toggles reference state and the native idle handle; both versions' native toggle exposes no failure (src…\n 'node:global.Immediate.unref', // Only toggles reference state and the native idle handle; both versions' native toggle exposes no failure (src…\n 'node:global.MessageChannel', // Native constructor creates and entangles two MessagePorts; uv_async_init is a CHECK and internal construction…\n 'node:global.ProcessPermission', // every member (2) audited trust; also trusts future members\n 'node:global.ProcessReport.getReport', // Native report generation skips failed OS reads and catches Error inspection exceptions, then parses escaped J…\n 'node:global.ReadableStream.isPaused', // Reads genuine Node readable state and returns a boolean without events or callbacks in both versions.\n 'node:global.RefCounted', // every member (2) audited trust; also trusts future members\n 'node:global.RequireResolve.paths', // Computes search-path arrays or null without resolving files or reading cwd in both versions; typed string val…\n 'node:global.TextEncoder', // No-arg constructor only sets an internal marker (v26 uses a private #encoding field, lib/internal/encoding.js…\n 'node:global.TextEncoderStream', // Creates a TextEncoder and a TransformStream with Node's own transformer and default strategies, so no validat…\n 'node:global.Timeout.close', // Legacy cancellation delegates to clearTimeout, never invokes the timer callback, and exposes no native failur…\n 'node:global.Timeout.hasRef', // Returns genuine timer reference state without callbacks or native error delivery in both versions (lib/intern…\n 'node:global.Timeout.ref', // Only updates timer reference state; inspected native uv_ref toggle has no failure delivery in either version.\n 'node:global.Timeout.refresh', // Reschedules a genuine timer without calling its callback; native scheduling/ref changes deliver no failure an…\n 'node:global.Timeout.unref', // Only updates timer reference state; inspected native uv_unref toggle has no failure delivery in either versio…\n 'node:global.Timer', // every member (2) audited trust; also trusts future members\n 'node:global.clearImmediate', // Cancels a genuine Immediate or returns early; native toggleImmediateRef has no error delivery; async_hooks de…\n 'node:global.clearInterval', // Delegates to clearTimeout, which cancels or ignores a typed Timeout/string/number id without invoking callbac…\n 'node:global.clearTimeout', // Cancels a Timeout or looks up a typed id in knownTimersById and ignores unknown ids; no callback invocation (…\n 'node:global.console.time', // Both versions only store timestamps and emit duplicate-label warnings: Node time bookkeeping (v24.21.0/lib/in…\n 'node:global.console.timeStamp', // Both versions pass typed string/undefined labels without coercion (deps/v8/src/inspector/v8-console.cc:164,45…\n 'node:global.process.addUncaughtExceptionCaptureCallback', // v26-only registration validates a function and stores it without invocation; report flags only read/write nat…\n 'node:global.process.availableMemory', // Native code returns libuv's unsigned memory estimate directly without exception/error delivery in both versio…\n 'node:global.process.constrainedMemory', // Native code returns libuv's unsigned memory limit or zero without exception/error delivery in both versions (…\n 'node:global.process.emitWarning', // Typed warnings/options schedule warning delivery; ctor is only a stack cutoff, not invoked; warnings and dela…\n 'node:global.process.getActiveResourcesInfo', // Native code enumerates internal active resource names and creates an array without failure delivery in both v…\n 'node:global.process.getegid', // Where available, native getegid returns the unsigned effective group ID without an error path in both version…\n 'node:global.process.geteuid', // Direct native geteuid() cast to uint32 with no error path (POSIX-only; absent on Windows); identical in v26 a…\n 'node:global.process.getgid', // Direct native getgid() cast to uint32 with no error path (POSIX-only); identical in v26 at v26.10.0/src/node_…\n 'node:global.process.getuid', // Direct native getuid() cast to uint32 with no error path (POSIX-only); identical in v26 at v26.10.0/src/node_…\n 'node:global.process.hasUncaughtExceptionCaptureCallback', // Returns captureFn !== null; no failure path (v26 identical at v26.10.0/lib/internal/process/execution.js:155).\n 'node:global.process.hrtime', // Native uv_hrtime fill has no error; the only throws need a non-array or a length other than 2, which the [num…\n 'node:global.process.listenerCount', // v26-only typing; EventEmitter listenerCount only counts/compares listeners without invoking them (v26.10.0/li…\n 'node:global.process.listeners', // EventEmitter listeners returns an unwrapped copy of registered listeners without invoking them; same in v26 a…\n 'node:global.process.nextTick', // Typed Function passes validateFunction; callback is only queued for later, and async_hooks init throws are fa…\n 'node:global.process.rawListeners', // v26-only typing; returns a copy of raw listener array without invoking listeners (v26.10.0/lib/events.js:824).\n 'node:global.process.ref', // Experimental; null/primitive inputs are no-ops and genuine refables' ref() does not throw; a throwing user re…\n 'node:global.process.setSourceMapsEnabled', // Boolean validation is type-only; JS swaps support and native code only sets the environment flag (v24.21.0/sr…\n 'node:global.process.unref', // Nullish inputs are ignored; refable data methods are implicit hooks, not explicitly passed callbacks, and no …\n 'node:global.process.uptime', // Native code only updates the event-loop clock and returns elapsed uv_hrtime without failure delivery (v24.21.…\n 'node:global.queueMicrotask', // Only enqueues the callback (optionally wrapped in an AsyncResource); callback runs later and its errors are n…\n 'node:global.setImmediate', // Enqueues the callback without synchronous invocation or error delivery; async_hooks init errors are fatal, no…\n 'node:global.setInterval', // Schedules the callback for later; typed negative/NaN delays only warn and normalize (identical in v26 lib/tim…\n 'node:global.setTimeout', // Schedules the callback for later; typed negative/NaN delays only warn and normalize (identical in v26 lib/tim…\n 'node:http.Agent.getName', // Builds a key string by concatenating typed host/port/localAddress/family/socketPath fields; no validation or …\n 'node:http.ClientRequest.getRawHeaderNames', // Returns the stored raw header names from the null-prototype header map, or []; no failure path.\n 'node:http.ClientRequest.listenerCount', // v26-only typed overload of EventEmitter.listenerCount: counts stored listeners by identity without invoking t…\n 'node:http.ClientRequest.listeners', // v26-only typed overload of EventEmitter.listeners: returns an unwrapped copy of the listener array without in…\n 'node:http.ClientRequest.rawListeners', // v26-only typed overload of EventEmitter.rawListeners: returns a copy of listeners/wrappers without invoking t…\n 'node:http.IncomingMessage.listenerCount', // v26-only typed overload of EventEmitter.listenerCount: counts stored listeners by identity without invoking t…\n 'node:http.IncomingMessage.listeners', // v26-only typed overload of EventEmitter.listeners: returns an unwrapped copy of the listener array without in…\n 'node:http.IncomingMessage.rawListeners', // v26-only typed overload of EventEmitter.rawListeners: returns a copy of listeners/wrappers without invoking t…\n 'node:http.OutgoingMessage.getHeader', // validateString passes for typed string; looks up the lowercased name in the null-prototype header map.\n 'node:http.OutgoingMessage.getHeaderNames', // Returns ObjectKeys of the header map or []; no failure path.\n 'node:http.OutgoingMessage.getHeaders', // Builds a shallow null-prototype copy of stored header values; no failure path.\n 'node:http.OutgoingMessage.hasHeader', // validateString passes for typed string; boolean lookup in the header map.\n 'node:http.OutgoingMessage.listenerCount', // v26-only typed overload of EventEmitter.listenerCount: counts stored listeners by identity without invoking t…\n 'node:http.OutgoingMessage.listeners', // v26-only typed overload of EventEmitter.listeners: returns an unwrapped copy of the listener array without in…\n 'node:http.OutgoingMessage.rawListeners', // v26-only typing; inherited EventEmitter.rawListeners copies the listener array without invoking listeners (v2…\n 'node:http.Server.listenerCount', // v26-only typing; inherited listenerCount counts registered listeners without invoking them (v26.10.0/lib/even…\n 'node:http.Server.listeners', // v26-only typing; inherited listeners returns an unwrapped copy of the listener array without invoking listene…\n 'node:http.Server.rawListeners', // v26-only typing; inherited rawListeners copies the listener array without invoking listeners (v26.10.0/lib/ev…\n 'node:http2.ClientHttp2Session.listenerCount', // v26-only member: inherited EventEmitter.listenerCount counts registrations and compares identities without in…\n 'node:http2.ClientHttp2Session.listeners', // v26-only member: inherited EventEmitter.listeners copies/unwraps listener references without invoking them (v…\n 'node:http2.ClientHttp2Session.rawListeners', // v26-only member: inherited EventEmitter.rawListeners returns a copied array of registered functions without i…\n 'node:http2.ClientHttp2Stream.listenerCount', // v26-only typing: inherited EventEmitter.listenerCount counts registrations without invoking listeners (v26.10…\n 'node:http2.ClientHttp2Stream.listeners', // v26-only typing: inherited EventEmitter.listeners copies and unwraps registered references without invoking t…\n 'node:http2.ClientHttp2Stream.rawListeners', // v26-only typing: inherited EventEmitter.rawListeners returns a copied array of registered references without …\n 'node:http2.Http2SecureServer.listenerCount', // v26-only member: inherited EventEmitter.listenerCount counts registrations and compares identities without in…\n 'node:http2.Http2SecureServer.listeners', // v26-only member: inherited EventEmitter.listeners copies/unwraps listener references without invoking them (v…\n 'node:http2.Http2SecureServer.rawListeners', // v26-only member: inherited EventEmitter.rawListeners returns a copied array of registered functions without i…\n 'node:http2.Http2Server.listenerCount', // v26-only member: inherited EventEmitter.listenerCount counts registrations and compares identities without in…\n 'node:http2.Http2Server.listeners', // v26-only member: inherited EventEmitter.listeners copies/unwraps listener references without invoking them (v…\n 'node:http2.Http2Server.rawListeners', // v26-only member: inherited EventEmitter.rawListeners returns a copied array of registered functions without i…\n 'node:http2.Http2ServerRequest.listenerCount', // v26-only member: inherited EventEmitter.listenerCount counts registrations and compares identities without in…\n 'node:http2.Http2ServerRequest.listeners', // v26-only member: inherited EventEmitter.listeners copies/unwraps listener references without invoking them (v…\n 'node:http2.Http2ServerRequest.rawListeners', // v26-only member: inherited EventEmitter.rawListeners returns a copied array of registered functions without i…\n 'node:http2.Http2ServerResponse.getHeader', // validateString passes for typed strings; trims/lowercases and reads a null-prototype header map with no throw…\n 'node:http2.Http2ServerResponse.getHeaderNames', // Returns ObjectKeys of the internal null-prototype header map (v24.21.0/lib/internal/http2/compat.js:603); ide…\n 'node:http2.Http2ServerResponse.getHeaders', // Copies the internal null-prototype data-property header map with ObjectAssign (v24.21.0/lib/internal/http2/co…\n 'node:http2.Http2ServerResponse.hasHeader', // validateString passes for typed strings, then ObjectHasOwn on the internal header map (v24.21.0/lib/internal/…\n 'node:http2.Http2Stream.listenerCount', // v26-only typing: inherited EventEmitter.listenerCount counts registrations without invoking listeners (v26.10…\n 'node:http2.Http2Stream.listeners', // v26-only typing: inherited EventEmitter.listeners copies and unwraps registered references without invoking t…\n 'node:http2.Http2Stream.rawListeners', // v26-only typing: inherited EventEmitter.rawListeners returns a copied array of registered references without …\n 'node:http2.ServerHttp2Session.listenerCount', // v26-only typing: inherited EventEmitter.listenerCount counts registrations without invoking listeners (v26.10…\n 'node:http2.ServerHttp2Session.listeners', // v26-only typing: inherited EventEmitter.listeners copies and unwraps registered references without invoking t…\n 'node:http2.ServerHttp2Session.rawListeners', // v26-only typing: inherited EventEmitter.rawListeners returns a copied array of registered references without …\n 'node:http2.getDefaultSettings', // Native RefreshDefaults only writes compile-time defaults into the shared settings buffer, then JS builds a pl…\n 'node:https.Agent.getName', // Pure string concatenation of typed option fields over http Agent.getName; no validation or native calls; engi…\n 'node:https.Server.listenerCount', // v26-only typing; inherited listenerCount counts listeners without invoking them (v26.10.0/lib/events.js:835).\n 'node:https.Server.listeners', // v26-only typing; inherited listeners returns an unwrapped copy without invoking listeners (v26.10.0/lib/event…\n 'node:https.Server.rawListeners', // v26-only typing; inherited rawListeners copies the listener array without invoking listeners (v26.10.0/lib/ev…\n 'node:inspector.InspectorConsole.clear', // Both versions use the non-Formatter ConsoleClear builtin (deps/v8/src/builtins/builtins-console.cc:26); Clear…\n 'node:inspector.InspectorConsole.groupEnd', // Both versions use the non-Formatter ConsoleGroupEnd builtin (v24.21.0/deps/v8/src/builtins/builtins-console.c…\n 'node:inspector.Network.loadingFailed', // Typed params object passes validateObject; native loadingFailed only needs string requestId/type/errorText an…\n 'node:inspector.Network.loadingFinished', // Typed params object passes validateObject; native loadingFinished only needs string requestId and numeric tim…\n 'node:inspector.Network.webSocketClosed', // Typed params object passes validateObject; native webSocketClosed only needs string requestId and numeric tim…\n 'node:inspector.Network.webSocketCreated', // Typed params object passes validateObject; native webSocketCreated only needs string requestId and url, guara…\n 'node:inspector.NetworkResources.put', // Experimental; without --experimental-inspector-network-resource it only emits a warning; typed strings pass v…\n 'node:inspector.close', // close is native _debugEnd: if the agent IsListening it resets the IO thread (Agent::Stop is io_.reset()), oth…\n 'node:inspector.url', // Native Url returns undefined when not listening or a formatted ws:// string from host/port; no throw or error…\n 'node:module.Module.ModuleHooks.deregister', // Removes this hook instance from the resolve/load arrays via findIndex/splice; idempotent, no throw; v26 ident…\n 'node:module.Module.SourceMap', // every member (2) audited trust; also trusts future members\n 'node:module.Module.enableCompileCache', // Failures (NODE_DISABLE_COMPILE_CACHE, missing fs permission, mkdir error) are returned as a status/message re…\n 'node:module.Module.findSourceMap', // Non-strings return undefined and every conversion/lookup/SourceMap construction is inside a catch that return…\n 'node:module.Module.flushCompileCache', // Native FlushCompileCache only rejects non-boolean args (none passed by the typed signature); Persist logs and…\n 'node:module.Module.getCompileCacheDir', // Returns the native cache dir string or undefined; no failure path; identical in v26.\n 'node:module.Module.getSourceMapsSupport', // Returns a frozen module-level state object; no failure path; identical in v26.\n 'node:module.Module.isBuiltin', // SafeSet membership checks plus a typeof-guarded startsWith/slice; returns boolean for any string; identical i…\n 'node:module.Module.registerHooks', // Experimental; typed resolve/load are functions so validateFunction cannot fail; constructs and pushes a froze…\n 'node:module.Module.setSourceMapsSupport', // Typed boolean/options pass validation; native SetSourceMapsEnabled only sets a flag; swaps prepareStackTrace …\n 'node:module.Module.syncBuiltinESMExports', // Copies current builtin export values into existing ESM facades; ordinary builtin exports do not throw; a user…\n 'node:module.Module.wrap', // String concatenation of the CJS wrapper around script; only engine max-string-length limits apply (excluded);…\n 'node:net.BlockList.check', // String path calls native checkString which returns false for unparsable addresses; SocketAddress path is a pu…\n 'node:net.BlockList.isBlockList', // Optional-chained symbol property read returns a boolean for every ordinary value; only Proxy traps/getters co…\n 'node:net.BlockList.toJSON', // Experimental; returns this.rules from native GetRules/ListRules which only builds strings (engine allocation …\n 'node:net.Server.ref', // Sets a flag and, with a live handle, calls native HandleWrap ref which only toggles uv ref state (handle_wrap…\n 'node:net.Server.unref', // Sets a flag and, with a live handle, calls native HandleWrap unref which only toggles uv ref state (handle_wr…\n 'node:net.Socket.address', // _getsockname returns {} without a handle and ignores the native getsockname return code (FIXME at v26 net.js:…\n 'node:net.Socket.listenerCount', // v26-only declaration: EventEmitter.listenerCount only reads _events and compares listeners without invoking t…\n 'node:net.Socket.listeners', // v26-only declaration: EventEmitter.listeners returns an unwrapped copy of the listener array without invoking…\n 'node:net.Socket.rawListeners', // v26-only declaration: EventEmitter.rawListeners returns a copy of the listener array without invoking listene…\n 'node:net.Socket.setEncoding', // Readable.setEncoding builds a StringDecoder for a typed BufferEncoding (all supported) and re-decodes buffere…\n 'node:net.Socket.setKeepAlive', // Coerces typed inputs, caches without a handle, and ignores the native uv_tcp_keepalive_ex return code; option…\n 'node:net.Socket.setNoDelay', // Caches the flag without a handle and ignores the native uv_tcp_nodelay return code; no counting failure path;…\n 'node:net.SocketAddress.parse', // validateString on a typed string, then URL parsing and SocketAddress construction inside a catch-all that ret…\n 'node:net.createServer', // Constructs a Server: typed numeric options pass validateNumber (negatives clamp), listener registered on a fr…\n 'node:net.getDefaultAutoSelectFamily', // Returns a module-level boolean; identical in v26.\n 'node:net.getDefaultAutoSelectFamilyAttemptTimeout', // Returns a module-level number; identical in v26.\n 'node:net.isIP', // Two primordial RegExp tests on the string, returns 4/6/0; identical in v26.\n 'node:net.isIPv4', // Primordial RegExp test of a fixed IPv4 pattern; returns boolean; identical in v26.\n 'node:net.isIPv6', // Primordial RegExp test of a fixed IPv6 pattern; returns boolean; identical in v26.\n 'node:net.setDefaultAutoSelectFamily', // validateBoolean always passes for the typed boolean, then assigns module state; identical in v26.\n 'node:os.arch', // Returns process.arch; no counting failure path (v26 identical at v26.10.0/lib/os.js:166).\n 'node:os.availableParallelism', // Native uv_available_parallelism returns an unsigned count with no error path (v24.21.0/src/node_os.cc:413); v…\n 'node:os.cpus', // Native uv_cpu_info errors return undefined, which JS converts to [] (v24.21.0/lib/os.js:143); v26 identical.\n 'node:os.endianness', // Returns a constant computed at module load; no failure path; v26 identical.\n 'node:os.freemem', // Native uv_get_free_memory returns a number (0 on failure) with no throw (v24.21.0/src/node_os.cc:147); v26 id…\n 'node:os.loadavg', // Native uv_loadavg fills an internal Float64Array with no error path; CHECKs guard internal invariants only; v…\n 'node:os.machine', // Returns uname machine string cached at module load (v24.21.0/lib/os.js:101); no call-time failure; v26 identi…\n 'node:os.platform', // Returns process.platform; no counting failure path (v26 identical at v26.10.0/lib/os.js:174).\n 'node:os.release', // Returns uname release string cached at module load (v24.21.0/lib/os.js:89); no call-time failure; v26 identic…\n 'node:os.tmpdir', // Reads environment with '/tmp' fallback; native GetTempDir has no counting failure; engine string limits exclu…\n 'node:os.totalmem', // Native uv_get_total_memory returns a number with no throw (v24.21.0/src/node_os.cc:160); v26 identical.\n 'node:os.type', // Returns the OS type string captured once at module load from getOSInformation; the call itself has no failure…\n 'node:os.version', // Returns the OS version string captured once at module load from getOSInformation; the call itself has no fail…\n 'node:path.path.PlatformPath.basename', // Typed strings pass validateString; pure string scanning (posix and win32) with no other throw; absent from v2…\n 'node:path.path.PlatformPath.dirname', // Typed string passes validateString; pure string scanning with no other throw; absent from v26 typings.\n 'node:path.path.PlatformPath.extname', // Typed string passes validateString; pure string scanning with no other throw; absent from v26 typings.\n 'node:path.path.PlatformPath.format', // Typed object passes validateObject and fields are only concatenated; user getters on pathObject are implicit …\n 'node:path.path.PlatformPath.isAbsolute', // Typed string passes validateString; character checks only; absent from v26 typings.\n 'node:path.path.PlatformPath.join', // Typed strings pass validateString then pure normalize, no cwd read; engine string limits excluded; absent fro…\n 'node:path.path.PlatformPath.normalize', // Typed string passes validateString; pure normalizeString with no cwd read; absent from v26 typings.\n 'node:path.path.PlatformPath.parse', // Typed string passes validateString; pure string scanning returning a fresh object; absent from v26 typings.\n 'node:path.path.basename', // v26-only: validateString on typed strings only, then pure charCode scanning and slice; no counting failure pa…\n 'node:path.path.dirname', // v26-only: validateString on a typed string, then pure scanning and slice; no counting failure path.\n 'node:path.path.extname', // v26-only: validateString on a typed string, then pure character scanning; no counting failure path.\n 'node:path.path.format', // v26-only: bound _format validates the typed object then concatenates optional string fields; only getters/Pro…\n 'node:path.path.isAbsolute', // v26-only: validateString on a typed string then a first-char comparison; no counting failure path.\n 'node:path.path.join', // v26-only: validates typed strings, joins and runs pure posix.normalize (internal separator predicate, not use…\n 'node:path.path.normalize', // v26-only: validateString then pure normalizeString with the internal isPosixPathSeparator predicate (analyzer…\n 'node:path.path.parse', // v26-only: validateString on a typed string then pure scanning into a plain object; no counting failure path.\n 'node:path.path.toNamespacedPath', // v26-only: posix implementation returns its argument unchanged; no counting failure path.\n 'node:perf_hooks.ELDHistogram', // every member (2) audited trust; also trusts future members\n 'node:perf_hooks.Histogram.reset', // Genuine histogram calls native DoReset -> hdr_reset and field zeroing with no failure path (histogram-inl.h:3…\n 'node:perf_hooks.Performance.addEventListener', // v26-only on Performance; EventTarget.addEventListener validates typed options/listener, ignores aborted signa…\n 'node:perf_hooks.Performance.clearMeasures', // Filters or resets the measure buffer; no throw path on the genuine performance receiver; identical in v26.\n 'node:perf_hooks.Performance.clearResourceTimings', // Filters or resets the resource buffer; no throw path on the genuine performance receiver; identical in v26.\n 'node:perf_hooks.Performance.eventLoopUtilization', // Same function as perf_hooks.eventLoopUtilization: arithmetic over milestones, hrtime and native loopIdleTime …\n 'node:perf_hooks.Performance.getEntries', // Concatenates and sorts internal buffers; no throw path on the genuine performance receiver; identical in v26.\n 'node:perf_hooks.Performance.getEntriesByName', // Filters internal buffers by typed name/type; unknown types return []; ERR_MISSING_ARGS unreachable with the r…\n 'node:perf_hooks.Performance.getEntriesByType', // Filters internal buffers by typed EntryType; ERR_MISSING_ARGS unreachable with the required typed argument; i…\n 'node:perf_hooks.Performance.markResourceTiming', // v24: cacheMode is typed '' | 'local' so the internal assert holds and the call only enqueues/buffers (buffer-…\n 'node:perf_hooks.Performance.now', // Returns a monotonic hrtime-based number (node_perf.cc:315); no failure path on the genuine performance receiv…\n 'node:perf_hooks.Performance.removeEventListener', // v26-only on Performance; EventTarget.removeEventListener ignores nullish listeners, unlinks a matching handle…\n 'node:perf_hooks.Performance.setResourceTimingBufferSize', // Typed number goes through WebIDL 'unsigned long' without enforceRange (modular conversion, no throw; webidl.j…\n 'node:perf_hooks.Performance.timerify', // Same as perf_hooks.timerify: wraps fn without calling it; genuine RecordableHistogram passes (a structural fa…\n 'node:perf_hooks.Performance.toJSON', // Returns nodeTiming, timeOrigin and eventLoopUtilization() of the genuine performance object, none of which ca…\n 'node:perf_hooks.PerformanceEntry.toJSON', // Genuine entries pass validateThisInternalField and only read internal slots; unbound receivers are receiver m…\n 'node:perf_hooks.PerformanceObserver', // v26-only constructor; only validateFunction (type_only) then stores the callback; the callback runs later via…\n 'node:perf_hooks.PerformanceObserver.disconnect', // Clears private sets/buffers and may call native removeGarbageCollectionTracking, which only removes GC hooks …\n 'node:perf_hooks.PerformanceObserver.takeRecords', // Swaps and returns the private buffer; no throw path; identical in v26.\n 'node:perf_hooks.PerformanceObserverEntryList.getEntries', // Genuine list (delivered to observer callbacks) passes validateThisInternalField and returns a slice; identica…\n 'node:perf_hooks.PerformanceObserverEntryList.getEntriesByName', // Genuine list filters internal entries by typed name/type; ERR_MISSING_ARGS is unreachable with the required t…\n 'node:perf_hooks.PerformanceObserverEntryList.getEntriesByType', // Genuine list filters internal entries by typed EntryType; ERR_MISSING_ARGS is unreachable with the required t…\n 'node:perf_hooks.PerformanceResourceTiming.toJSON', // Genuine entry reads internal slots and timingInfo fields with optional chaining; no throw for ordinary timing…\n 'node:perf_hooks.RecordableHistogram.add', // Genuine RecordableHistogram other passes the kRecordable check and native hdr_add returns a dropped count wit…\n 'node:perf_hooks.RecordableHistogram.recordDelta', // Native RecordDelta records the monotonic hrtime delta; out-of-range values only bump exceeds (histogram-inl.h…\n 'node:perf_hooks.eventLoopUtilization', // Pure arithmetic over milestones, process.hrtime() and native loopIdleTime (uv_metrics_idle_time, no failure p…\n 'node:perf_hooks.timerify', // Validates and wraps fn without calling it; fn runs only when the caller invokes the wrapper; a genuine Record…\n 'node:punycode.ucs2.decode', // Deprecated (DEP0040); only charCodeAt loops and array pushes over a typed string, no throw path; engine alloc…\n 'node:querystring.parse', // Default decoder catches URIError and falls back to unescapeBuffer; a throwing custom decodeURIComponent is ca…\n 'node:querystring.unescape', // decodeURIComponent errors are caught and the input is decoded by unescapeBuffer, which never throws for a str…\n 'node:quic.listEndpoints', // v26-only: validates a typed options object, copies the internal SafeSet registry and filters with non-throwin…\n 'node:readline.Interface.getCursorPos', // Computes display width from prompt and line in JS plus ICU GetStringWidth, which only CHECKs an internal stri…\n 'node:readline.Interface.getPrompt', // Returns the stored prompt string; identical in v26.\n 'node:readline.Interface.setPrompt', // Only stores the prompt string; identical in v26.\n 'node:readline/promises.Readline.rollback', // Only replaces the private pending-action array and returns this; identical in v26.\n 'node:repl.REPLServer.clearBufferedCommand', // Only assigns '' to the internal buffered-command slot; no validation, callbacks or native calls (v26 class me…\n 'node:repl.REPLServer.defineCommand', // Function or REPLCommand with typed action passes validateFunction (type_only) and is stored on a null-prototy…\n 'node:repl.REPLServer.listenerCount', // v26-only typing; counts registered listeners (optionally matching a listener) without invoking them.\n 'node:repl.REPLServer.listeners', // v26-only typing; returns an unwrapped copy of the listener array without invoking listeners.\n 'node:repl.REPLServer.rawListeners', // v26-only typing; returns a copy of the raw listener array (including once wrappers) without invoking listener…\n 'node:repl.REPLServer.writer', // Default writer is util.inspect with showProxy:true, which returns a string for any value; only implicit custo…\n 'node:repl.writer', // Calls util.inspect with showProxy: true, so proxies are not trapped and inspect's own errors are handled; rem…\n 'node:sea.isSea', // Native IsSea returns IsSingleExecutable(), a postject sentinel check with no error path (v26 node_sea.cc:262,…\n 'node:sqlite.SQLTagStore.clear', // Only clears the LRU statement cache, dropping strong references without synchronous finalization or SQLite ca…\n 'node:stream.Stream.Duplex.listenerCount', // v26-only inventory member counts listeners without invoking them (events.js:835-865).\n 'node:stream.Stream.Duplex.listeners', // v26-only inventory member copies registered listeners without invoking them (events.js:791-805).\n 'node:stream.Stream.Duplex.rawListeners', // v26-only inventory member copies raw listeners without invoking them (events.js:791-805).\n 'node:stream.Stream.Pipe', // every member (4) audited trust; also trusts future members\n 'node:stream.Stream.Readable.isDisturbed', // Only reads disturbance/aborted flags in both versions (utils.js:299-304); implicit property hooks do not coun…\n 'node:stream.Stream.Readable.isPaused', // Reads genuine receiver pause/flow bit flags without invoking callbacks in both versions (readable.js:588; v26…\n 'node:stream.Stream.Readable.iterator', // Only creates a lazy iterator for a genuine Readable; later next/return operations own their failures (v24 rea…\n 'node:stream.Stream.Readable.listenerCount', // v26-only inventory member counts listeners without invoking them (events.js:835-865).\n 'node:stream.Stream.Readable.listeners', // v26-only inventory member copies listeners without invoking them (events.js:791-805).\n 'node:stream.Stream.Readable.rawListeners', // v26-only typing: inherited EventEmitter.rawListeners returns a copied listener array without invoking listene…\n 'node:stream.Stream.Readable.resume', // Only flips flowing flags and schedules resume_ via process.nextTick (v24 readable.js:1266; v26 :1303, also no…\n 'node:stream.Stream.Writable.cork', // Only sets the corked flag and increments the counter (v24/v26 writable.js:515-520); no validation, callbacks …\n 'node:stream.Stream.Writable.listenerCount', // v26-only typing: inherited EventEmitter.listenerCount counts registered (optionally matching) listeners witho…\n 'node:stream.Stream.Writable.listeners', // v26-only typing: inherited EventEmitter.listeners returns an unwrapped copy of the listener array without inv…\n 'node:stream.Stream.Writable.rawListeners', // v26-only typing: inherited EventEmitter.rawListeners returns a copied listener array without invoking listene…\n 'node:stream.Stream.Writable.setDefaultEncoding', // Lower-cases and checks Buffer.isEncoding, which accepts every BufferEncoding literal, so the ERR_UNKNOWN_ENCO…\n 'node:stream.Stream.getDefaultHighWaterMark', // Returns the selected mutable default numeric highWaterMark without failure (state.js:20-22) in both versions.\n 'node:stream.Stream.isErrored', // Only reads stream error flags in both versions (utils.js:306-316); implicit property hooks do not count.\n 'node:stream.Stream.isReadable', // Only tests readable lifecycle flags in both versions (utils.js:173-180); implicit property hooks do not count.\n 'node:stream.Stream.isWritable', // Only tests writable lifecycle flags in both versions (utils.js:182-189); implicit property hooks do not count.\n 'node:stream/iter.SyncShare.cancel', // v26-only experimental API: marks consumers detached, clears storage and catches iterator-return errors; no pr…\n 'node:stream/iter.SyncStatefulTransform.transform', // v26-only experimental interface: genuine Node sync zlib transforms return a suspended generator (v26.10.0/lib…\n 'node:stream/iter.Writer.endSync', // v26-only experimental API: Push/Broadcast return byte counts or -1 for non-closeable states; classic adapter …\n 'node:stream/iter.Writer.writeSync', // v26-only experimental API: converts typed strings/Uint8Arrays then queues or returns false, including closed/…\n 'node:stream/iter.Writer.writevSync', // v26-only experimental API: converts typed strings/Uint8Arrays then queues or returns false, including closed/…\n 'node:stream/iter.fromReadable', // v26-only experimental API: caches or builds a lazy iterator without reading or registering listeners; standar…\n 'node:stream/iter.tap', // v26-only experimental API: only validates the typed callback and returns a closure; callback is not invoked b…\n 'node:stream/iter.tapSync', // v26-only experimental API: only validates the typed callback and returns a closure; callback is not invoked b…\n 'node:stream/iter.toWritable', // v26-only experimental API: builds a Writable with fixed valid options and defers writer method invocation unt…\n 'node:stream/web.ByteLengthQueuingStrategy', // Both versions only store the required typed numeric highWaterMark without range validation; engine allocation…\n 'node:stream/web.CompressionStream', // Judged on v26 declaration availability (implementation also exists in v24): all four literal formats create c…\n 'node:stream/web.CountQueuingStrategy', // every member (2) audited trust; also trusts future members\n 'node:stream/web.DecompressionStream', // Judged on v26 declaration availability (implementation also exists in v24): all four literal formats create c…\n 'node:stream/web.TextEncoderStream', // Both versions create a state-only TextEncoder and fixed-valid TransformStream; encoding and user data handlin…\n 'node:string_decoder', // every member (2) audited trust; also trusts future members\n 'node:test.test.MockFunctionContext.callCount', // Returns the private call array length (mock.js:120, same in v26); no failure path.\n 'node:test.test.MockFunctionContext.mockImplementation', // validateFunction only rejects non-functions (type_only for typed F), then stores the implementation (mock.js:…\n 'node:test.test.MockFunctionContext.resetCalls', // Replaces the private call array (mock.js:165, same in v26); no failure path.\n 'node:test.test.MockModuleContext.restore', // Idempotent: only deletes/restores Module._cache entries, flips the mock record inactive and deletes shared ma…\n 'node:test.test.MockPropertyContext.accessCount', // Returns the private access array length (mock.js:380, same in v26); no failure path.\n 'node:test.test.MockPropertyContext.resetAccesses', // Replaces the private access array (mock.js:434, same in v26); no failure path.\n 'node:test.test.SuiteContext.diagnostic', // Only appends the typed message to the suite diagnostics array in both versions; engine allocation limits excl…\n 'node:test.test.TestContext.diagnostic', // Only appends the typed message to the test diagnostics array in both versions; engine allocation limits exclu…\n 'node:test.test.TestContext.runOnly', // Only assigns the boolean subtest filtering flag in both versions.\n 'node:test.test.TestContext.skip', // Only assigns the directive flag and optional typed message on the genuine test in both versions.\n 'node:test.test.TestContext.todo', // Only assigns the directive flag and optional typed message on the genuine test in both versions.\n 'node:test.test.TestsStream.listenerCount', // v26-only declaration: Reads listener bookkeeping without invoking listeners; engine allocation limits exclude…\n 'node:test.test.TestsStream.listeners', // v26-only declaration: Reads listener bookkeeping without invoking listeners; engine allocation limits exclude…\n 'node:test.test.TestsStream.rawListeners', // v26-only declaration: Reads listener bookkeeping without invoking listeners; engine allocation limits exclude…\n 'node:test.test.assert.register', // Validates typed name/function and stores the assertion without invoking it in both versions.\n 'node:test.test.getTestContext', // Looks up the active async resource and returns its lazily-created context or undefined without failure in bot…\n 'node:test.test.snapshot', // every member (2) audited trust; also trusts future members\n 'node:tls.Server.getTicketKeys', // Copies the genuine context's 48-byte ticket key into a new Buffer in both versions; engine allocation limits …\n 'node:tls.Server.listenerCount', // v26-only declaration: reads listener bookkeeping without invoking listeners; engine allocation limits exclude…\n 'node:tls.Server.listeners', // v26-only declaration: reads listener bookkeeping without invoking listeners; engine allocation limits exclude…\n 'node:tls.Server.rawListeners', // v26-only declaration: reads listener bookkeeping without invoking listeners; engine allocation limits exclude…\n 'node:tls.TLSSocket.disableRenegotiation', // Only sets an internal symbol flag; no native call or failure path (v24 wrap.js:790, v26 :799).\n 'node:tls.TLSSocket.enableTrace', // Proxy returns null without a handle; native EnableTrace only installs an SSL_trace message callback with erro…\n 'node:tls.TLSSocket.getCertificate', // Returns null without a handle; native GetCert returns undefined or an X509 dictionary from a locally loaded c…\n 'node:tls.TLSSocket.getCipher', // Proxy returns null without a handle; native GetCipherInfo returns undefined when no cipher is negotiated and …\n 'node:tls.TLSSocket.getEphemeralKeyInfo', // Proxy returns null without a handle; server returns null and client builds a dictionary from the peer temp ke…\n 'node:tls.TLSSocket.getFinished', // Proxy returns null without a handle; native returns undefined when no Finished message exists, else copies it…\n 'node:tls.TLSSocket.getPeerCertificate', // Returns null without a handle, {} or undefined without a peer cert; native GetPeerCert only returns empty May…\n 'node:tls.TLSSocket.getPeerFinished', // Proxy returns null without a handle; native returns undefined when no peer Finished exists, else copies it in…\n 'node:tls.TLSSocket.getPeerX509Certificate', // Optional-chains the handle and returns undefined when the native X509Certificate::GetPeerCert yields nothing;…\n 'node:tls.TLSSocket.getProtocol', // Proxy returns null without a handle; native returns SSL_get_version string (crypto_tls.cc:2115); identical v2…\n 'node:tls.TLSSocket.getSharedSigalgs', // Proxy returns null without a handle; native builds a string array from SSL_get_shared_sigalgs with UNDEF fall…\n 'node:tls.TLSSocket.getTLSTicket', // Proxy returns null without a handle; native returns undefined without a session/ticket else Buffer::Copy (cry…\n 'node:tls.TLSSocket.getX509Certificate', // Optional-chains the handle and returns undefined when no local certificate exists; native X509Certificate::Ge…\n 'node:tls.TLSSocket.isSessionReused', // Proxy returns null without a handle; native returns SSL_session_reused boolean (crypto_tls.cc:1855); identica…\n 'node:tls.TLSSocket.listenerCount', // v26-only typing: inherited EventEmitter.listenerCount counts registrations without invoking listeners (v26.10…\n 'node:tls.TLSSocket.listeners', // v26-only typing: inherited EventEmitter.listeners copies and unwraps registered references without invoking t…\n 'node:tls.TLSSocket.rawListeners', // v26-only typing: inherited EventEmitter.rawListeners returns a copied array of registered references without …\n 'node:tls.getCACertificates', // Typed selectors only return cached CA strings; loaders suppress OS/parse errors, and successfully decoded, un…\n 'node:tls.getCertificateCompressionAlgorithms', // Native code only checks compiled compression BIO availability and returns names in both versions; engine allo…\n 'node:trace_events.Tracing.disable', // No-op unless enabled; native Disable only removes categories from the default writer without throwing (node_t…\n 'node:trace_events.getEnabledCategories', // Native returns the agent's enabled category string or undefined, no throw (node_trace_events.cc:117); module-…\n 'node:tty.WriteStream.getWindowSize', // Returns the cached [columns, rows] properties without native calls (tty.js:187); identical v26.\n 'node:tty.WriteStream.listenerCount', // v26-only typing: inherited EventEmitter.listenerCount counts registrations without invoking listeners (v26.10…\n 'node:tty.WriteStream.listeners', // v26-only typing: inherited EventEmitter.listeners copies and unwraps registered references without invoking t…\n 'node:tty.WriteStream.rawListeners', // v26-only typing: inherited EventEmitter.rawListeners returns a copied array of registered references without …\n 'node:tty.isatty', // Range-checks the typed fd and returns false outside int32 >= 0; native IsTTY returns uv_guess_handle == UV_TT…\n 'node:url.URL.canParse', // Typed string input/base go to native CanParse, which returns ada::can_parse's boolean without throwing.\n 'node:url.URL.parse', // Calls the URL constructor with kParseURLSymbol so native Parse returns without raising, and invalid input yie…\n 'node:url.URL.revokeObjectURL', // Native RevokeObjectURL returns silently on unparsable URLs or unknown ids; nothing is thrown for a typed stri…\n 'node:url.URL.toJSON', // Returns href after lazy search sync; native Update returns false instead of throwing, and context update just…\n 'node:url.URL.toString', // Returns href after lazy search sync; native Update reports failure as false, not a throw. Not in the v26 inve…\n 'node:url.URLSearchParams.append', // Pushes well-formed strings and marks the linked URL dirty; native Update failure is returned as false, not th…\n 'node:url.URLSearchParams.delete', // Filters the in-memory list by typed name/value; the linked-URL update reports failure as false, never throws.\n 'node:url.URLSearchParams.entries', // Returns a new URLSearchParamsIterator for a genuine receiver; no counting failure path.\n 'node:url.URLSearchParams.get', // Linear lookup over the in-memory list; returns the value or null.\n 'node:url.URLSearchParams.getAll', // Collects matching values from the in-memory list; no counting failure path.\n 'node:url.URLSearchParams.has', // Linear membership test over the in-memory list; returns a boolean.\n 'node:url.URLSearchParams.keys', // Returns a new key iterator for a genuine receiver; no counting failure path.\n 'node:url.URLSearchParams.set', // Rewrites the in-memory list and marks the URL dirty; native Update failure is returned as false, not thrown.\n 'node:url.URLSearchParams.sort', // Stable insertion/merge sort over string pairs using primitive comparison; no user code or throw.\n 'node:url.URLSearchParams.toString', // Serializes stored strings, which are already well-formed (toUSVString), so encodeStr never sees lone surrogat…\n 'node:url.URLSearchParams.values', // Returns a new value iterator for a genuine receiver; no counting failure path.\n 'node:url.domainToASCII', // Native DomainToASCII returns '' for empty or invalid hostnames instead of throwing; only engine string limits…\n 'node:url.domainToUnicode', // Native DomainToUnicode returns '' for empty or invalid hostnames instead of throwing; only engine string limi…\n 'node:util.InspectStyles.regexp', // v26-only highlightRegExp is a pure string scanner; palette built from typed InspectColor names (all defined i…\n 'node:util.MIMEParams.delete', // Lowercases name and deletes from an internal SafeMap; lazy #parse never throws (QUOTED_VALUE_PATTERN always m…\n 'node:util.MIMEParams.entries', // Generator method; calling it only creates the iterator; lazy #parse never throws (QUOTED_VALUE_PATTERN always…\n 'node:util.MIMEParams.get', // Lowercases name and reads an internal SafeMap; lazy #parse never throws (QUOTED_VALUE_PATTERN always matches,…\n 'node:util.MIMEParams.has', // Lowercases name and checks an internal SafeMap; lazy #parse never throws (QUOTED_VALUE_PATTERN always matches…\n 'node:util.MIMEParams.keys', // Generator method; calling it only creates the iterator; lazy #parse never throws (QUOTED_VALUE_PATTERN always…\n 'node:util.MIMEParams.values', // Generator method; calling it only creates the iterator; lazy #parse never throws (QUOTED_VALUE_PATTERN always…\n 'node:util.MIMEType.toString', // Genuine MIMEType always holds parsed type/subtype and a MIMEParams; serialization concatenates strings withou…\n 'node:util.TextEncoder', // every member (3) audited trust; also trusts future members\n 'node:util.debuglog', // Only builds lazy closures and defines an enabled getter; section is uppercased and the callback runs only on …\n 'node:util.deprecate', // Validates typed string code then wraps fn (setPrototypeOf on a fresh function, copies prototype/length); miss…\n 'node:util.getSystemErrorMap', // Native GetErrMap builds a Map from the static uv_errors_map table with no failure return (v24.21.0/src/uv.cc:…\n 'node:util.parseEnv', // Typed string passes validateString; native Dotenv ParseContent/ToObject has no error path beyond engine alloc…\n 'node:util.stripVTControlCharacters', // Typed string passes validateString; indexOf and internal regex replace only; v26 same at v26.10.0/lib/interna…\n 'node:util.toUSVString', // Template-literal of a typed string then String.prototype.toWellFormed; no failure path; v26 same at v26.10.0/…\n 'node:util.transferableAbortController', // Constructs an AbortController with an internally created transferable AbortSignal; no failure path; v26 same …\n 'node:util/types', // every member (43) audited trust; also trusts future members\n 'node:v8.Deserializer.getWireFormatVersion', // Native getter returns the deserializer's parsed wire-format version (0 before readHeader); no throw path (v24…\n 'node:v8.Deserializer.transferArrayBuffer', // Typed number id converts via Uint32Value without throwing; typed ArrayBuffer is recorded in a transfer dictio…\n 'node:v8.GCProfiler', // every member (2) audited trust; also trusts future members\n 'node:v8.Serializer.releaseBuffer', // Releases the serializer's malloc buffer into a Buffer; repeated calls yield an empty buffer; only allocation …\n 'node:v8.Serializer.transferArrayBuffer', // Typed number id converts via Uint32Value without throwing and a typed ArrayBuffer passes IsArrayBuffer; V8 on…\n 'node:v8.Serializer.writeDouble', // NumberValue on a typed number cannot throw; V8 WriteDouble only appends bytes, allocation failure sets an out…\n 'node:v8.Serializer.writeHeader', // Appends the version header bytes; no throw path besides excluded allocation limits (node_serdes.cc:183); v26 …\n 'node:v8.Serializer.writeRawBytes', // Typed ArrayBufferView passes the IsArrayBufferView check and bytes are appended; only excluded allocation lim…\n 'node:v8.Serializer.writeUint32', // Uint32Value wraps any typed number without throwing; varint append has no error path (node_serdes.cc:240); v2…\n 'node:v8.Serializer.writeUint64', // Uint32Value on typed numbers cannot throw; varint append has no error path (node_serdes.cc:250); v26 same.\n 'node:v8.SyncCPUProfileHandle.stop', // A genuine handle holds an id from a successful start in the env's private CpuProfiler pending list; first sto…\n 'node:v8.cachedDataVersionTag', // Native returns ScriptCompiler::CachedDataVersionTag() as an unsigned integer with no failure path (v24.21.0/s…\n 'node:v8.getCppHeapStatistics', // Literal-union detail level passes validateOneOf; native CollectStatistics and object conversion have no expos…\n 'node:v8.getHeapCodeStatistics', // Native fills a Float64 buffer from GetHeapCodeAndMetadataStatistics without failure (v24.21.0/src/node_v8.cc:…\n 'node:v8.getHeapSnapshot', // Typed boolean options validate; native TakeHeapSnapshot failure is a CHECK abort (not a throw) and the stream…\n 'node:v8.getHeapSpaceStatistics', // Iterates known heap spaces filling a buffer via GetHeapSpaceStatistics, no failure path (v24.21.0/src/node_v8…\n 'node:v8.getHeapStatistics', // Native fills a Float64 buffer from Isolate::GetHeapStatistics, no failure path (v24.21.0/src/node_v8.cc:215).\n 'node:v8.isStringOneByteRepresentation', // Typed string passes validateString; native returns String::IsOneByte() (v24.21.0/src/node_v8.cc:296).\n 'node:v8.queryObjects', // Typed Function/format literal pass validation; native returns [] for non-object prototypes; experimental warn…\n 'node:v8.setFlagsFromString', // Typed string validated; V8::SetFlagsFromString reports unknown flags on stderr without throwing; behavior cha…\n 'node:v8.startupSnapshot.isBuildingSnapshot', // Reads a native flag buffer element; no throw path (startup_snapshot.js:21); v26 same.\n 'node:v8.stopCoverage', // No-op without NODE_V8_COVERAGE; otherwise dispatches Profiler.stopPreciseCoverage, with internal errors print…\n 'node:v8.takeCoverage', // No-op without NODE_V8_COVERAGE; otherwise takes precise coverage and write failures only print to stderr (v24…\n 'node:vfs', // every member (2) audited trust; also trusts future members\n 'node:vm.Script.createCachedData', // Native CreateCodeCache result is copied into a Buffer (empty when no cache); only allocation limits (excluded…\n 'node:vm.SourceTextModule.hasTopLevelAwait', // Genuine receiver passes the internal-field check and the call reads a boolean property of the module wrap; no…\n 'node:wasi.WASI.getImportObject', // Returns an object keyed by the constructor-chosen binding name; no throw path (wasi.js:161); v26 same.\n 'node:worker_threads.BroadcastChannel', // v26-only construct: typed string name is stringified and native BroadcastChannel joins a named SiblingGroup p…\n 'node:worker_threads.BroadcastChannel.addEventListener', // v26-only typed declaration of inherited EventTarget.addEventListener: registers the listener without calling …\n 'node:worker_threads.BroadcastChannel.close', // Detaches internal handlers and closes the internal MessagePort; repeated close returns early; native HandleWr…\n 'node:worker_threads.BroadcastChannel.removeEventListener', // v26-only typed declaration of inherited EventTarget.removeEventListener: unlinks a listener without invoking …\n 'node:worker_threads.MessageChannel', // v26-only construct: creates and entangles two native ports; failures are allocation/engine limits only (uv_as…\n 'node:worker_threads.MessagePort.addEventListener', // v26-only typed declaration of inherited EventTarget.addEventListener; MessagePort's kNewListener override onl…\n 'node:worker_threads.MessagePort.close', // Native HandleWrap close returns early unless initialized and schedules uv_close; the later 'close' dispatch c…\n 'node:worker_threads.MessagePort.emit', // NodeEventTarget.emit dispatch catches listener exceptions/rejections and reschedules them as uncaught nextTic…\n 'node:worker_threads.MessagePort.hasRef', // Calls native HandleWrap::HasRef, which returns silently for an unwrapped (closed) port and otherwise reads re…\n 'node:worker_threads.MessagePort.ref', // Native HandleWrap::Ref only uv_refs an alive handle and returns silently otherwise; identical in v26.\n 'node:worker_threads.MessagePort.removeEventListener', // v26-only typed declaration of inherited EventTarget.removeEventListener; MessagePort's kRemoveListener overri…\n 'node:worker_threads.MessagePort.start', // Native MessagePort::Start returns for closed/detached ports and otherwise sets receiving state and triggers a…\n 'node:worker_threads.MessagePort.unref', // Native HandleWrap::Unref only uv_unrefs an alive handle and returns silently otherwise; identical in v26.\n 'node:worker_threads.Worker.ref', // Returns after exit; otherwise native Worker::Ref only toggles has_ref_/env refs and MessagePort ref is a no-o…\n 'node:worker_threads.Worker.unref', // Returns after exit; otherwise native Worker::Unref only toggles has_ref_/env refs and MessagePort unref is a …\n 'node:worker_threads.getEnvironmentData', // Plain SafeMap lookup by key; no throw path (v24 lib/internal/worker.js:127, v26 :131).\n 'node:worker_threads.isMarkedAsUntransferable', // Reads a private symbol that never triggers Proxy traps or getters; returns false for nullish (v24 lib/interna…\n 'node:worker_threads.setEnvironmentData', // Plain SafeMap set/delete; values are cloned only later when a Worker is constructed (v24 lib/internal/worker.…\n 'node:zlib/iter', // every member (16) audited trust; also trusts future members\n];\n\nexport const NODE_DISTRUST: readonly string[] = [\n 'node:global.EventTarget.dispatchEvent', // Redispatch of the currently dispatched genuine Event throws ERR_EVENT_RECURSION in both versions; listener ex…\n 'node:perf_hooks.PerformanceObserver.observe', // Switching a single-type observer to entryTypes throws InvalidModificationError DOMException; passing both ent…\n 'node:stream/web.ByteLengthQueuingStrategy.size', // Detached or out-of-bounds DataView byteLength access throws in both versions.\n 'node:worker_threads.BroadcastChannel.onmessage', // v24-only handler property: invoking it calls the caller-assigned function directly (exceptions propagate), an…\n 'node:worker_threads.BroadcastChannel.onmessageerror', // v24-only handler property: invoking it calls the caller-assigned function directly (exceptions propagate), an…\n 'node:worker_threads.BroadcastChannel.postMessage', // Throws InvalidStateError DOMException after close() and DataCloneError for uncloneable values such as functio…\n];\n","// Built-in presets, referenced from a trust config as `\"extend\": \"<name>\"`.\n// Presets may only carry trust/distrust (no globs: those are relative to a project).\n//\n// js language built-ins, the same in every runtime\n// node js + Node built-in APIs (audited member by member, see node-preset.generated.ts)\n// web js + browser globals (none audited yet, so nothing beyond js)\n// default alias of node, kept for existing configs\n//\n// A project with several runtimes points each area at its own trust config (ESLint flat-config `files`\n// blocks with different `configFile` options): server code extends `node`, frontend code extends `web`,\n// shared code extends `js`.\n\nimport { NODE_DISTRUST, NODE_TRUST } from './node-preset.generated.js';\n\nexport interface PresetDefinition {\n readonly $comment?: string;\n readonly extend?: string;\n readonly trust?: readonly string[];\n readonly distrust?: readonly string[];\n}\n\nconst JS_PRESET: PresetDefinition = {\n $comment:\n 'Pure, in-memory JavaScript built-ins that cannot fail on typed input, in any runtime. ' +\n 'Deliberately NOT trusted: js:JSON (parse throws), js:URL, js:BigInt, js:structuredClone, ' +\n 'js:encodeURI*/decodeURI* (throw URIError), the AbortSignal constructor, AbortSignal.timeout ' +\n '(RangeError) and throwIfAborted (throws by design), the URLSearchParams constructor (a one-element ' +\n 'pair throws) and URLSearchParams.forEach (rethrows the callback), every npm package.',\n trust: [\n 'js:Array',\n 'js:ReadonlyArray',\n 'js:String',\n 'js:Number',\n 'js:Boolean',\n 'js:Math',\n 'js:Object',\n 'js:Map',\n 'js:ReadonlyMap',\n 'js:Set',\n 'js:ReadonlySet',\n 'js:WeakMap',\n 'js:WeakSet',\n 'js:Date',\n 'js:Error',\n 'js:RegExp',\n 'js:Promise',\n 'js:PromiseLike',\n 'js:Symbol',\n 'js:Iterator',\n 'js:IterableIterator',\n 'js:CallableFunction',\n 'js:Function',\n 'js:parseInt',\n 'js:parseFloat',\n 'js:isNaN',\n 'js:isFinite',\n // Web-standard classes, member-level where a member can fail (verified against Node's implementation\n // of the same WHATWG specs; see trust/research/node-api).\n 'js:AbortController',\n 'js:AbortSignal.abort',\n 'js:AbortSignal.any',\n 'js:AbortSignal.addEventListener',\n 'js:AbortSignal.removeEventListener',\n 'js:TextEncoder',\n 'js:URLSearchParams.append',\n 'js:URLSearchParams.delete',\n 'js:URLSearchParams.get',\n 'js:URLSearchParams.getAll',\n 'js:URLSearchParams.has',\n 'js:URLSearchParams.set',\n 'js:URLSearchParams.sort',\n 'js:URLSearchParams.toString',\n ],\n};\n\nconst NODE_PRESET: PresetDefinition = {\n $comment:\n 'js plus Node built-in APIs, audited member by member against the Node v24 source (v26 recorded): ' +\n 'a call is trusted only if typed arguments cannot make it throw or fail asynchronously. Whole-module ' +\n 'or whole-class entries are used only where every member was trusted. See node-preset.generated.ts.',\n extend: 'js',\n trust: NODE_TRUST,\n distrust: NODE_DISTRUST,\n};\n\nconst WEB_PRESET: PresetDefinition = {\n $comment: 'js for browser code. Browser globals (fetch, DOM, storage, ...) are not audited yet, so none are trusted.',\n extend: 'js',\n};\n\nconst DEFAULT_PRESET: PresetDefinition = {\n $comment: 'Alias of the node preset.',\n extend: 'node',\n};\n\nexport const PRESETS: Readonly<Record<string, PresetDefinition>> = {\n js: JS_PRESET,\n node: NODE_PRESET,\n web: WEB_PRESET,\n default: DEFAULT_PRESET,\n};\n","// Glob zones (passthrough / ignore), with the same matcher ESLint flat config uses for\n// `files`/`ignores`: minimatch with `{ dot: true }`, a leading `./` stripped, patterns relative\n// to the directory of the config file that declared them, `!pattern` re-includes (last match wins).\n// Paths are realpath-resolved and posix-normalized before matching.\nimport { readdirSync, realpathSync } from 'node:fs';\nimport { isAbsolute, join, relative, sep } from 'node:path';\nimport { Minimatch } from 'minimatch';\n\nexport type Zone = 'checked' | 'passthrough' | 'ignore' | 'external';\n\nexport interface ZoneGroup {\n /** Config file that declared the patterns (for error messages). */\n readonly source: string;\n /** Realpath of the directory the patterns are relative to. */\n readonly baseDir: string;\n readonly patterns: readonly string[];\n}\n\nconst MINIMATCH_OPTIONS = { dot: true } as const;\nconst SKIPPED_DIRECTORIES = new Set(['node_modules', '.git']);\nconst matcherCache = new Map<string, Minimatch>();\n\nfunction matcher(pattern: string): Minimatch {\n let cached = matcherCache.get(pattern);\n if (!cached) {\n cached = new Minimatch(pattern, MINIMATCH_OPTIONS);\n matcherCache.set(pattern, cached);\n }\n return cached;\n}\n\nexport function toPosix(path: string): string {\n return sep === '/' ? path : path.split(sep).join('/');\n}\n\nexport function realpathOrSelf(path: string): string {\n try {\n return realpathSync.native(path);\n } catch {\n return path;\n }\n}\n\n/** Normalizes one configured pattern; returns an error message for an invalid one. */\nexport function normalizePattern(raw: string): { pattern: string } | { error: string } {\n const negated = raw.startsWith('!');\n let body = negated ? raw.slice(1) : raw;\n if (body.startsWith('./')) body = body.slice(2);\n if (body.length === 0) return { error: `empty glob \"${raw}\"` };\n if (isAbsolute(body) || /^[A-Za-z]:[\\\\/]/.test(body)) {\n return { error: `glob \"${raw}\" must be relative to the config file's directory` };\n }\n if (body.startsWith('../')) return { error: `glob \"${raw}\" must not leave the config file's directory` };\n if (body.endsWith('/')) body = `${body}**`;\n return { pattern: negated ? `!${body}` : body };\n}\n\n/** Posix path of `absolutePath` relative to `baseDir`, or null when it lies outside. */\nexport function relativeInside(baseDir: string, absolutePath: string): string | null {\n const rel = toPosix(relative(baseDir, absolutePath));\n if (rel === '' || rel.startsWith('../') || rel === '..' || isAbsolute(rel)) return null;\n return rel;\n}\n\n/** ESLint `ignores` semantics: patterns apply in order, a `!pattern` match un-includes. */\nexport function matchesPatterns(patterns: readonly string[], rel: string): boolean {\n let included = false;\n for (const pattern of patterns) {\n if (pattern.startsWith('!')) {\n if (included && matcher(pattern.slice(1)).match(rel)) included = false;\n } else if (!included && matcher(pattern).match(rel)) {\n included = true;\n }\n }\n return included;\n}\n\nexport function groupMatches(group: ZoneGroup, absoluteRealPath: string): boolean {\n const rel = relativeInside(group.baseDir, absoluteRealPath);\n return rel !== null && matchesPatterns(group.patterns, rel);\n}\n\nconst MAGIC = /[*?[\\]{}()!+@]/;\n\nfunction staticPrefix(pattern: string): string {\n const parts = pattern.split('/');\n const fixed: string[] = [];\n for (let index = 0; index < parts.length - 1; index += 1) {\n if (MAGIC.test(parts[index])) break;\n fixed.push(parts[index]);\n }\n return fixed.join('/');\n}\n\nfunction* walkFiles(baseDir: string, prefix: string): Generator<string> {\n const start = prefix ? join(baseDir, prefix) : baseDir;\n const stack = [start];\n while (stack.length > 0) {\n const directory = stack.pop() as string;\n let entries;\n try {\n entries = readdirSync(directory, { withFileTypes: true });\n } catch {\n continue;\n }\n for (const entry of entries) {\n const full = join(directory, entry.name);\n if (entry.isDirectory()) {\n if (!SKIPPED_DIRECTORIES.has(entry.name)) stack.push(full);\n } else {\n yield toPosix(relative(baseDir, full));\n }\n }\n }\n}\n\n/** True when at least one file under `baseDir` (node_modules and .git skipped) matches `pattern`. */\nexport function patternMatchesAnyFile(baseDir: string, pattern: string): boolean {\n const body = pattern.startsWith('!') ? pattern.slice(1) : pattern;\n const compiled = matcher(body);\n for (const rel of walkFiles(baseDir, staticPrefix(body))) {\n if (compiled.match(rel)) return true;\n }\n return false;\n}\n\nexport class Zones {\n private readonly cache = new Map<string, Zone>();\n\n constructor(\n /** Realpath of the project root (directory of the leaf trust config). */\n readonly rootDir: string,\n private readonly passthrough: readonly ZoneGroup[],\n private readonly ignore: readonly ZoneGroup[],\n ) {}\n\n /** Zone of a file. Ignore wins over passthrough; files outside the root or in node_modules are external. */\n zoneOf(fileName: string): Zone {\n const cached = this.cache.get(fileName);\n if (cached) return cached;\n const zone = this.compute(fileName);\n this.cache.set(fileName, zone);\n return zone;\n }\n\n /** Project-relative posix path (for `local:` origins and baselines), or the absolute path when outside. */\n relativePath(fileName: string): string {\n const real = realpathOrSelf(fileName);\n return relativeInside(this.rootDir, real) ?? toPosix(real);\n }\n\n private compute(fileName: string): Zone {\n const real = realpathOrSelf(fileName);\n const rel = relativeInside(this.rootDir, real);\n if (rel === null || rel.split('/').includes('node_modules')) return 'external';\n if (this.ignore.some((group) => groupMatches(group, real))) return 'ignore';\n if (this.passthrough.some((group) => groupMatches(group, real))) return 'passthrough';\n return 'checked';\n }\n}\n","// Loads trust.config.json:\n//\n// {\n// \"extend\": \"default\", // preset name or a path relative to this file\n// \"trust\": [\"zod\", { \"origin\": \"@noego/ioc\", \"reason\": \"DI container, no I/O\" }],\n// \"distrust\": [\"builtin:Array.from\"], // remove something inherited from the extend chain\n// \"passthrough\": [\"server/repositories/**\"], // not checked inside; calls into them are untrusted\n// \"ignore\": [\"**/*.test.ts\"] // not checked inside; calls into them are reported\n// }\n//\n// Trust resolution walks the chain from this file toward the root preset: the first level whose\n// distrust matches wins (untrusted), else the first level whose trust matches wins (trusted).\n// So a file's `distrust` beats everything it inherits. Within one file the same origin may not be\n// both trusted and distrusted.\n//\n// Globs use ESLint flat-config semantics (see ./zones.ts) and are relative to the directory of the\n// file that declares them. A glob that matches no file is a load error (typo protection).\nimport { existsSync, readFileSync, statSync } from 'node:fs';\nimport { dirname, isAbsolute, resolve } from 'node:path';\nimport { PRESETS, type PresetDefinition } from './presets.js';\nimport { normalizePattern, patternMatchesAnyFile, realpathOrSelf, type ZoneGroup } from './zones.js';\n\nexport type TrustEntry = string | { readonly origin: string; readonly reason?: string };\n\nexport interface TrustLevel {\n /** Config file path or `preset:<name>`. */\n readonly source: string;\n readonly trust: readonly string[];\n readonly distrust: readonly string[];\n}\n\nexport interface TrustConfig {\n /** Absolute path of the leaf config file. */\n readonly file: string;\n /** Realpath of the leaf config file's directory: the project root for zones and `local:` origins. */\n readonly rootDir: string;\n /** Leaf first, root preset last. */\n readonly levels: readonly TrustLevel[];\n readonly passthrough: readonly ZoneGroup[];\n readonly ignore: readonly ZoneGroup[];\n}\n\nexport interface LoadTrustConfigOptions {\n /** Check that every glob matches at least one file (default true). */\n readonly validateGlobs?: boolean;\n}\n\nexport class TrustConfigError extends Error {\n override readonly name = 'TrustConfigError';\n}\n\nconst FILE_KEYS = new Set(['$comment', 'extend', 'trust', 'distrust', 'passthrough', 'ignore']);\nconst PRESET_KEYS = new Set(['$comment', 'extend', 'trust', 'distrust']);\nconst ENTRY_KEYS = new Set(['origin', 'reason']);\n\ninterface RawLevel {\n readonly source: string;\n readonly baseDir: string | null;\n readonly extend?: string;\n readonly trust: string[];\n readonly distrust: string[];\n readonly passthrough: string[];\n readonly ignore: string[];\n}\n\n/**\n * Trust entries are matched exactly as written. Origin namespaces:\n * js:JSON.parse JavaScript built-ins (TypeScript lib)\n * node:fs.existsSync Node built-in modules (the `node:` import specifier)\n * node:global.process.cwd Node globals\n * zod.object, @scope/pkg.fn npm packages (bare package name)\n */\nexport function normalizeOrigin(origin: string): string {\n return origin.trim();\n}\n\n/** Prefixes from earlier origin naming; rejected with the replacement so a stale entry never silently stops matching. */\nfunction legacyOriginHint(origin: string): string | null {\n if (origin.startsWith('builtin:')) return `\"${origin}\" uses the old \"builtin:\" prefix; use \"js:${origin.slice('builtin:'.length)}\"`;\n if (origin === 'node' || origin.startsWith('node.')) {\n return `\"${origin}\" uses the old \"node.\" prefix for Node globals; use \"node:global${origin.slice('node'.length)}\"`;\n }\n return null;\n}\n\nfunction fail(source: string, message: string): never {\n throw new TrustConfigError(`trust config ${source}: ${message}`);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction checkedOrigin(source: string, key: string, index: number, origin: string): string {\n const normalized = normalizeOrigin(origin);\n const hint = legacyOriginHint(normalized);\n if (hint) fail(source, `\"${key}[${index}]\": ${hint}`);\n return normalized;\n}\n\nfunction readEntries(source: string, key: string, value: unknown): string[] {\n if (value === undefined) return [];\n if (!Array.isArray(value)) fail(source, `\"${key}\" must be an array`);\n return value.map((entry, index) => {\n if (typeof entry === 'string') {\n if (!entry.trim()) fail(source, `\"${key}[${index}]\" must not be empty`);\n return checkedOrigin(source, key, index, entry);\n }\n if (!isRecord(entry)) fail(source, `\"${key}[${index}]\" must be a string or { origin, reason }`);\n for (const entryKey of Object.keys(entry)) {\n if (!ENTRY_KEYS.has(entryKey)) fail(source, `\"${key}[${index}]\" has unknown key \"${entryKey}\"`);\n }\n if (typeof entry.origin !== 'string' || !entry.origin.trim()) {\n fail(source, `\"${key}[${index}].origin\" must be a non-empty string`);\n }\n if (entry.reason !== undefined && typeof entry.reason !== 'string') {\n fail(source, `\"${key}[${index}].reason\" must be a string`);\n }\n return checkedOrigin(source, key, index, entry.origin);\n });\n}\n\nfunction readGlobs(source: string, key: string, value: unknown): string[] {\n if (value === undefined) return [];\n if (!Array.isArray(value)) fail(source, `\"${key}\" must be an array of globs`);\n return value.map((entry, index) => {\n if (typeof entry !== 'string') fail(source, `\"${key}[${index}]\" must be a string`);\n const normalized = normalizePattern(entry);\n if ('error' in normalized) fail(source, `\"${key}\": ${normalized.error}`);\n return normalized.pattern;\n });\n}\n\nfunction parseLevel(source: string, raw: unknown, allowedKeys: Set<string>, baseDir: string | null): RawLevel {\n if (!isRecord(raw)) fail(source, 'expected an object');\n for (const key of Object.keys(raw)) {\n if (!allowedKeys.has(key)) fail(source, `unknown key \"${key}\"`);\n }\n if (raw.extend !== undefined && (typeof raw.extend !== 'string' || !raw.extend)) {\n fail(source, '\"extend\" must be a non-empty string');\n }\n const trust = readEntries(source, 'trust', raw.trust);\n const distrust = readEntries(source, 'distrust', raw.distrust);\n const both = trust.filter((origin) => distrust.includes(origin));\n if (both.length > 0) fail(source, `\"${both[0]}\" is both trusted and distrusted`);\n return {\n source,\n baseDir,\n extend: raw.extend as string | undefined,\n trust,\n distrust,\n passthrough: readGlobs(source, 'passthrough', raw.passthrough),\n ignore: readGlobs(source, 'ignore', raw.ignore),\n };\n}\n\nfunction readFileLevel(file: string): RawLevel {\n if (!existsSync(file)) throw new TrustConfigError(`trust config not found: ${file}`);\n let raw: unknown;\n try {\n raw = JSON.parse(readFileSync(file, 'utf8'));\n } catch (error) {\n fail(file, `invalid JSON (${error instanceof Error ? error.message : String(error)})`);\n }\n return parseLevel(file, raw, FILE_KEYS, realpathOrSelf(dirname(file)));\n}\n\nfunction readPresetLevel(name: string): RawLevel {\n const preset: PresetDefinition | undefined = PRESETS[name];\n if (!preset) throw new TrustConfigError(`unknown preset \"${name}\"`);\n return parseLevel(`preset:${name}`, preset, PRESET_KEYS, null);\n}\n\nfunction nextSource(level: RawLevel): string | null {\n const extend = level.extend;\n if (!extend) return null;\n if (extend.startsWith('.') || isAbsolute(extend)) {\n if (level.baseDir === null) fail(level.source, `presets may only extend presets, not \"${extend}\"`);\n return resolve(level.baseDir, extend);\n }\n if (!PRESETS[extend]) fail(level.source, `unknown preset \"${extend}\"`);\n return `preset:${extend}`;\n}\n\nfunction readChain(configFile: string): RawLevel[] {\n const chain: RawLevel[] = [];\n const visited: string[] = [];\n let source: string | null = resolve(configFile);\n while (source) {\n if (visited.includes(source)) {\n throw new TrustConfigError(`trust config cycle: ${[...visited, source].join(' -> ')}`);\n }\n visited.push(source);\n const level = source.startsWith('preset:') ? readPresetLevel(source.slice('preset:'.length)) : readFileLevel(source);\n chain.push(level);\n source = nextSource(level);\n }\n return chain;\n}\n\nfunction zoneGroups(chain: RawLevel[], key: 'passthrough' | 'ignore', validate: boolean): ZoneGroup[] {\n const groups: ZoneGroup[] = [];\n for (const level of chain) {\n const patterns = level[key];\n if (patterns.length === 0 || level.baseDir === null) continue;\n if (validate) {\n for (const pattern of patterns) {\n if (!patternMatchesAnyFile(level.baseDir, pattern)) {\n fail(level.source, `${key} glob \"${pattern}\" matches no files under ${level.baseDir}`);\n }\n }\n }\n groups.push({ source: level.source, baseDir: level.baseDir, patterns });\n }\n return groups;\n}\n\n/** Loads and validates a trust config file and its `extend` chain. Throws TrustConfigError. */\nexport function loadTrustConfig(configFile: string, options: LoadTrustConfigOptions = {}): TrustConfig {\n const file = resolve(configFile);\n const chain = readChain(file);\n const validate = options.validateGlobs ?? true;\n return {\n file,\n rootDir: realpathOrSelf(dirname(file)),\n levels: chain.map(({ source, trust, distrust }) => ({ source, trust, distrust })),\n passthrough: zoneGroups(chain, 'passthrough', validate),\n ignore: zoneGroups(chain, 'ignore', validate),\n };\n}\n\nconst cache = new Map<string, { mtimeMs: number; config: TrustConfig }>();\n\n/** Cached by path + mtime of the leaf file, so long-lived ESLint servers pick up edits. */\nexport function loadTrustConfigCached(configFile: string): TrustConfig {\n const file = resolve(configFile);\n const mtimeMs = existsSync(file) ? statSync(file).mtimeMs : -1;\n const hit = cache.get(file);\n if (hit && hit.mtimeMs === mtimeMs) return hit.config;\n const config = loadTrustConfig(file);\n cache.set(file, { mtimeMs, config });\n return config;\n}\n\n/** Union of every trust entry in the chain (for tooling and tests). */\nexport function effectiveTrustList(config: TrustConfig): string[] {\n return [...new Set(config.levels.flatMap((level) => level.trust))];\n}\n","// Where does a callee come from? An \"origin\" is the string trust entries match against.\n//\n// JS built-in (TypeScript lib) js:JSON.parse, js:Array.map, js:Reflect.get, js:URL\n// Node built-in module node:fs.readFileSync, node:fs/promises.readFile, node:child_process.spawn\n// Node global (@types/node) node:global.setTimeout, node:global.Buffer.from, node:global.process.cwd\n// other declare module \"x\" x.member (ambient modules outside @types/node keep their name)\n// npm package zod.object, better-sqlite3.Database.prepare, @scope/pkg.fn\n// first-party, passthrough zone local:server/repositories/x.ts#XRepository.find\n// first-party, ignore zone local:server/testing/fixture.ts#makeThing\n// first-party, checked zone (no origin: trusted, it is checked itself)\n//\n// The `node:` prefix keeps Node's own modules apart from npm packages of the same name (`path`,\n// `events`, `util`, `buffer`, … all exist on npm). Member paths are the named containers from the\n// module down to the declaration, so trusting `js:JSON` covers `js:JSON.parse` while\n// `js:JSON.stringify` alone does not. Linked packages (npm link, file:) resolve to paths outside\n// node_modules; they are recognised by their nearest package.json being outside the project root.\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport type * as TS from 'typescript';\nimport type { TypeScript } from './typescript.js';\nimport { realpathOrSelf, toPosix, type Zone, type Zones } from './zones.js';\n\nexport type OriginInfo =\n // `base` is the package/module/namespace part of `origin`, before any member path (`js:`,\n // `node:fs/promises`, `node:global`, `lodash.merge`). Trust entries may extend the base only with\n // `/` (subpath), so `lodash` never covers the package `lodash.merge`.\n | { readonly kind: 'external'; readonly origin: string; readonly base: string; readonly fileName: string }\n | { readonly kind: 'local'; readonly zone: Exclude<Zone, 'external'>; readonly origin: string; readonly fileName: string };\n\nconst NODE_MODULES = '/node_modules/';\nconst TS_LIB_FILE = /\\/typescript\\/lib\\/lib\\.[^/]*\\.d\\.ts$/;\nexport const TRUST_PACKAGE = '@noego/trust';\nconst JS_BASE = 'js:';\nconst NODE_PREFIX = 'node:';\nconst NODE_GLOBAL_BASE = 'node:global';\n/** packageFromNodeModulesPath maps `@types/node` to this name. */\nconst NODE_TYPES_PACKAGE = 'node';\n/**\n * @types/node declares several globals through interfaces (`var process: NodeJS.Process`); name them\n * by the global you write, not the interface: `NodeJS.Process.cwd` → `process.cwd`.\n */\nconst NODE_GLOBAL_INTERFACES: Readonly<Record<string, string>> = {\n Process: 'process',\n Require: 'require',\n Module: 'module',\n Console: 'console',\n Global: 'global',\n};\n\nfunction nodeGlobalPath(members: readonly string[]): string[] {\n const path = members[0] === 'NodeJS' ? members.slice(1) : [...members];\n if (path.length > 0 && NODE_GLOBAL_INTERFACES[path[0]]) path[0] = NODE_GLOBAL_INTERFACES[path[0]];\n return path;\n}\n\nconst manifestNameCache = new Map<string, string | null>();\n\nfunction readManifestName(directory: string): string | null {\n const file = join(directory, 'package.json');\n if (!existsSync(file)) return null;\n try {\n const manifest: unknown = JSON.parse(readFileSync(file, 'utf8'));\n if (manifest && typeof manifest === 'object' && 'name' in manifest && typeof manifest.name === 'string') {\n return manifest.name;\n }\n } catch {\n return null;\n }\n return null;\n}\n\n/** Name in the nearest package.json that has one, walking up from the file. */\nexport function nearestPackageName(fileName: string): string | null {\n const visited: string[] = [];\n let directory = dirname(fileName);\n let result: string | null = null;\n for (;;) {\n const cached = manifestNameCache.get(directory);\n if (cached !== undefined) {\n result = cached;\n break;\n }\n visited.push(directory);\n const name = readManifestName(directory);\n if (name) {\n result = name;\n break;\n }\n const parent = dirname(directory);\n if (parent === directory) break;\n directory = parent;\n }\n for (const entry of visited) manifestNameCache.set(entry, result);\n return result;\n}\n\nfunction packageOrigin(name: string): string {\n if (!name.startsWith('@types/')) return name;\n const bare = name.slice('@types/'.length);\n return bare.includes('__') ? `@${bare.replace('__', '/')}` : bare;\n}\n\nfunction packageFromNodeModulesPath(fileName: string): string | null {\n const index = fileName.lastIndexOf(NODE_MODULES);\n if (index < 0) return null;\n const parts = fileName.slice(index + NODE_MODULES.length).split('/');\n return packageOrigin(parts[0].startsWith('@') ? `${parts[0]}/${parts[1]}` : parts[0]);\n}\n\n/** True when the file belongs to the @noego/trust package (installed, linked, or its own source). */\nexport function isTrustPackageFile(fileName: string): boolean {\n return packageFromNodeModulesPath(toPosix(fileName)) === TRUST_PACKAGE || nearestPackageName(fileName) === TRUST_PACKAGE;\n}\n\nexport class OriginResolver {\n constructor(\n private readonly ts: TypeScript,\n private readonly zones: Zones,\n ) {}\n\n originOf(declaration: TS.Node): OriginInfo {\n const fileName = toPosix(declaration.getSourceFile().fileName);\n const members = this.memberPath(declaration);\n const external = (base: string, path: readonly string[] = members): OriginInfo => ({\n kind: 'external',\n // A namespace base (`js:`) takes its first member directly: `js:JSON.parse`, not `js:.JSON.parse`.\n origin: path.length > 0 ? `${base}${base.endsWith(':') ? '' : '.'}${path.join('.')}` : base,\n base,\n fileName,\n });\n if (TS_LIB_FILE.test(fileName)) return external(JS_BASE);\n const fromNodeModules = packageFromNodeModulesPath(fileName);\n const fromNodeTypes = fromNodeModules === NODE_TYPES_PACKAGE;\n const moduleName = this.ambientModuleName(declaration);\n if (moduleName) return external(fromNodeTypes ? `${NODE_PREFIX}${moduleName}` : moduleName);\n if (fromNodeTypes) return external(NODE_GLOBAL_BASE, nodeGlobalPath(members));\n if (fromNodeModules) return external(fromNodeModules);\n const zone = this.zones.zoneOf(fileName);\n if (zone === 'external') {\n const name = nearestPackageName(realpathOrSelf(fileName));\n return external(name ? packageOrigin(name) : `external:${fileName}`);\n }\n const path = this.zones.relativePath(fileName);\n const origin = members.length > 0 ? `local:${path}#${members.join('.')}` : `local:${path}`;\n return { kind: 'local', zone, origin, fileName };\n }\n\n /** Named containers from the module down to (and including) the declaration. */\n memberPath(declaration: TS.Node): string[] {\n const ts = this.ts;\n const names: string[] = [];\n for (let node: TS.Node | undefined = declaration; node && !ts.isSourceFile(node); node = node.parent) {\n if (ts.isModuleDeclaration(node)) {\n if (ts.isStringLiteral(node.name)) break;\n if (node.flags & ts.NodeFlags.GlobalAugmentation) continue;\n }\n const name = this.containerName(node);\n if (name) names.push(name);\n }\n return names.reverse();\n }\n\n private containerName(node: TS.Node): string | null {\n const ts = this.ts;\n const named =\n ts.isInterfaceDeclaration(node) ||\n ts.isClassDeclaration(node) ||\n ts.isClassExpression(node) ||\n ts.isFunctionDeclaration(node) ||\n ts.isModuleDeclaration(node) ||\n ts.isVariableDeclaration(node) ||\n ts.isMethodSignature(node) ||\n ts.isMethodDeclaration(node) ||\n ts.isPropertySignature(node) ||\n ts.isPropertyDeclaration(node) ||\n ts.isPropertyAssignment(node) ||\n ts.isGetAccessorDeclaration(node) ||\n ts.isEnumDeclaration(node);\n if (!named) return null;\n const name = (node as TS.NamedDeclaration).name;\n if (!name) return null;\n if (ts.isIdentifier(name) || ts.isStringLiteral(name) || ts.isPrivateIdentifier(name)) {\n return ts.isInterfaceDeclaration(node) ? name.text.replace(/Constructor$/, '') : name.text;\n }\n return null;\n }\n\n private ambientModuleName(declaration: TS.Node): string | null {\n const ts = this.ts;\n for (let node: TS.Node | undefined = declaration; node; node = node.parent) {\n // `declare module \"module\" { global { … } }` declares globals, not exports of \"module\":\n // fall back to the declaring package (`node.NodeJS.Require.resolve`).\n if (ts.isModuleDeclaration(node) && node.flags & ts.NodeFlags.GlobalAugmentation) return null;\n if (ts.isModuleDeclaration(node) && ts.isStringLiteral(node.name)) return node.name.text.replace(/^node:/, '');\n }\n return null;\n }\n}\n","// Decides whether one call/new expression is trusted. Shared by the lint rule and `trust explain`.\nimport type * as TS from 'typescript';\nimport type { TrustConfig, TrustLevel } from './config.js';\nimport { isTrustPackageFile, OriginResolver, type OriginInfo } from './origin.js';\nimport type { TypeScript } from './typescript.js';\nimport { Zones } from './zones.js';\n\nexport interface MatchedEntry {\n readonly source: string;\n readonly entry: string;\n}\n\nexport type Verdict =\n | { readonly kind: 'unresolved' }\n | { readonly kind: 'first-party'; readonly origin: OriginInfo }\n | { readonly kind: 'returns-result'; readonly origin: OriginInfo }\n | { readonly kind: 'trusted'; readonly origin: OriginInfo; readonly by: MatchedEntry }\n | { readonly kind: 'untrusted'; readonly origin: OriginInfo; readonly distrustedBy?: MatchedEntry }\n | { readonly kind: 'calls-ignored'; readonly origin: OriginInfo };\n\n/**\n * `entry` covers `origin` itself, its subpaths (`fs` → `fs/promises`) and members (`builtin:JSON` →\n * `builtin:JSON.parse`). When the origin's `base` (package/module part) is known, an entry that stops\n * inside the base may only continue with `/`, so `lodash` does not cover the package `lodash.merge`.\n */\nexport function entryMatches(entry: string, origin: string, base?: string): boolean {\n if (origin === entry) return true;\n if (!origin.startsWith(entry)) return false;\n const next = origin[entry.length];\n if (base !== undefined && entry.length < base.length) return next === '/';\n return next === '/' || next === '.' || next === '#';\n}\n\n/** The most specific (longest) entry covering `origin`. */\nfunction bestMatch(entries: readonly string[], origin: string, base?: string): string | undefined {\n let best: string | undefined;\n for (const entry of entries) {\n if (entryMatches(entry, origin, base) && (best === undefined || entry.length > best.length)) best = entry;\n }\n return best;\n}\n\nexport class TrustPolicy {\n readonly zones: Zones;\n readonly origins: OriginResolver;\n private readonly levels: readonly TrustLevel[];\n\n constructor(\n private readonly ts: TypeScript,\n private readonly checker: TS.TypeChecker,\n config: TrustConfig,\n extraTrust: readonly string[] = [],\n ) {\n this.zones = new Zones(config.rootDir, config.passthrough, config.ignore);\n this.origins = new OriginResolver(ts, this.zones);\n this.levels = extraTrust.length > 0 ? [{ source: 'rule options', trust: extraTrust, distrust: [] }, ...config.levels] : config.levels;\n }\n\n /**\n * Walks leaf → root; the first level with a matching entry decides. Within a level the most specific\n * entry wins (`distrust @noego/wood` + `trust @noego/wood.TraceProvider` trusts only the tracer);\n * on equal specificity distrust wins.\n */\n lookup(origin: string, base?: string): { trusted: true; by: MatchedEntry } | { trusted: false; distrustedBy?: MatchedEntry } {\n for (const level of this.levels) {\n const distrusted = bestMatch(level.distrust, origin, base);\n const trusted = bestMatch(level.trust, origin, base);\n if (trusted && (!distrusted || trusted.length > distrusted.length)) {\n return { trusted: true, by: { source: level.source, entry: trusted } };\n }\n if (distrusted) return { trusted: false, distrustedBy: { source: level.source, entry: distrusted } };\n }\n return { trusted: false };\n }\n\n classify(node: TS.CallExpression | TS.NewExpression): Verdict {\n const resolved = this.calleeDeclaration(node);\n if (!resolved) return { kind: 'unresolved' };\n const origin = this.origins.originOf(resolved.declaration);\n if (origin.kind === 'local' && origin.zone === 'checked') return { kind: 'first-party', origin };\n if (origin.kind === 'local' && origin.zone === 'ignore') return { kind: 'calls-ignored', origin };\n const decision = this.lookup(origin.origin, origin.kind === 'external' ? origin.base : undefined);\n if (!decision.trusted && decision.distrustedBy) return { kind: 'untrusted', origin, distrustedBy: decision.distrustedBy };\n if (resolved.signature && this.returnsResult(resolved.signature)) return { kind: 'returns-result', origin };\n if (decision.trusted) return { kind: 'trusted', origin, by: decision.by };\n return { kind: 'untrusted', origin };\n }\n\n calleeDeclaration(node: TS.CallExpression | TS.NewExpression): { declaration: TS.Node; signature?: TS.Signature } | null {\n const ts = this.ts;\n const signature = this.checker.getResolvedSignature(node);\n const fromSignature = signature?.declaration && !ts.isJSDocSignature(signature.declaration) ? signature.declaration : undefined;\n // An unnamed call/construct signature (`const statSync: StatSyncFn`, `declare var URL: { new(): URL }`)\n // names its interface, not the callee; prefer the callee's own declaration (`fs.statSync`).\n const anonymous =\n !fromSignature || ts.isCallSignatureDeclaration(fromSignature) || ts.isConstructSignatureDeclaration(fromSignature) || ts.isFunctionTypeNode(fromSignature);\n if (fromSignature && !anonymous) return { declaration: fromSignature, signature };\n let symbol = this.checker.getSymbolAtLocation(node.expression);\n if (symbol && symbol.flags & ts.SymbolFlags.Alias) symbol = this.checker.getAliasedSymbol(symbol);\n const fromSymbol = symbol?.declarations?.[0];\n // Only rename within the declaring file: a first-party parameter typed by a package's function\n // interface keeps the package origin.\n const sameFile = fromSymbol && fromSignature && fromSymbol.getSourceFile() === fromSignature.getSourceFile();\n const declaration = !fromSignature || sameFile ? fromSymbol : fromSignature;\n return declaration ? { declaration, signature } : null;\n }\n\n /** Declared return type is Result / Promise<Result> from @noego/trust (every union member is Ok or Err). */\n returnsResult(signature: TS.Signature): boolean {\n const returnType = this.checker.getReturnTypeOfSignature(signature);\n const awaited = this.checker.getAwaitedType(returnType) ?? returnType;\n return this.isResultType(awaited);\n }\n\n isResultType(type: TS.Type): boolean {\n const members = type.isUnion() ? type.types : [type];\n return members.length > 0 && members.every((member) => this.resultVariant(member) !== null);\n }\n\n /** True when every member of the type is an `Err` from @noego/trust. */\n isErrType(type: TS.Type): boolean {\n const members = type.isUnion() ? type.types : [type];\n return members.length > 0 && members.every((member) => this.resultVariant(member) === 'err');\n }\n\n /** 'ok' | 'err' when the type is @noego/trust's Ok/Err (by the declaration of its `ok` property). */\n resultVariant(type: TS.Type): 'ok' | 'err' | null {\n const property = type.getProperty('ok');\n const declaration = property?.valueDeclaration ?? property?.declarations?.[0];\n if (!property || !declaration || !isTrustPackageFile(declaration.getSourceFile().fileName)) return null;\n const discriminant = this.checker.typeToString(this.checker.getTypeOfSymbol(property));\n if (discriminant === 'true') return 'ok';\n if (discriminant === 'false') return 'err';\n return null;\n }\n\n /** Name of the @noego/trust function a call resolves to (`err`, `tryResult`, …), else null. */\n trustFunctionName(node: TS.CallExpression): string | null {\n const resolved = this.calleeDeclaration(node);\n if (!resolved || !isTrustPackageFile(resolved.declaration.getSourceFile().fileName)) return null;\n const name = (resolved.declaration as TS.NamedDeclaration).name;\n return name && this.ts.isIdentifier(name) ? name.text : null;\n }\n}\n","// Shared per-file setup for both rules: trust config, file zone, typed guard context.\nimport { resolve } from 'node:path';\nimport type { Rule } from 'eslint';\nimport type * as TS from 'typescript';\nimport { loadTrustConfigCached, normalizeOrigin, type TrustConfig } from './config.js';\nimport { NAME_BASED_GUARD_CONTEXT, type AstNode, type GuardContext } from './guard.js';\nimport { TrustPolicy } from './policy.js';\nimport { loadTypeScript } from './typescript.js';\nimport { realpathOrSelf, Zones, type Zone } from './zones.js';\n\nexport interface TrustRuleOptions {\n /** trust.config.json path, relative to the ESLint cwd. */\n readonly configFile?: string;\n /** Extra trusted origins (applied before the config chain). */\n readonly trust?: readonly string[];\n}\n\nexport const OPTIONS_SCHEMA = [\n {\n type: 'object',\n properties: {\n configFile: { type: 'string' },\n trust: { type: 'array', items: { type: 'string' } },\n },\n additionalProperties: false,\n },\n] as const;\n\ninterface ParserServices {\n readonly program?: TS.Program | null;\n readonly esTreeNodeToTSNodeMap?: { get(node: unknown): TS.Node };\n}\n\nexport interface RuleSetup {\n readonly zone: Zone;\n readonly policy: TrustPolicy | null;\n readonly guardContext: GuardContext;\n /** Maps an ESTree node to its TypeScript node (typed linting only). */\n readonly tsNode: ((node: AstNode) => TS.Node) | null;\n readonly checker: TS.TypeChecker | null;\n}\n\nconst emptyConfigs = new Map<string, TrustConfig>();\n\nfunction emptyConfig(cwd: string): TrustConfig {\n let config = emptyConfigs.get(cwd);\n if (!config) {\n config = { file: '', rootDir: realpathOrSelf(cwd), levels: [], passthrough: [], ignore: [] };\n emptyConfigs.set(cwd, config);\n }\n return config;\n}\n\nconst policies = new WeakMap<TS.TypeChecker, Map<string, { config: TrustConfig; policy: TrustPolicy }>>();\n\n/** One policy per checker + config + extra trust, so zone/origin caches survive across files. */\nfunction policyFor(cwd: string, checker: TS.TypeChecker, config: TrustConfig, extraTrust: string[]): TrustPolicy {\n let byKey = policies.get(checker);\n if (!byKey) {\n byKey = new Map();\n policies.set(checker, byKey);\n }\n const key = `${config.file}\\u0000${extraTrust.join('\\u0000')}`;\n const hit = byKey.get(key);\n if (hit && hit.config === config) return hit.policy;\n const policy = new TrustPolicy(loadTypeScript(cwd), checker, config, extraTrust);\n byKey.set(key, { config, policy });\n return policy;\n}\n\nexport function setupRule(context: Rule.RuleContext): RuleSetup {\n const options = (context.options[0] ?? {}) as TrustRuleOptions;\n const config = options.configFile ? loadTrustConfigCached(resolve(context.cwd, options.configFile)) : emptyConfig(context.cwd);\n const services = context.sourceCode.parserServices as ParserServices | undefined;\n const program = services?.program ?? null;\n const map = services?.esTreeNodeToTSNodeMap;\n if (!program || !map) {\n const zones = new Zones(config.rootDir, config.passthrough, config.ignore);\n return { zone: zones.zoneOf(context.filename), policy: null, guardContext: NAME_BASED_GUARD_CONTEXT, tsNode: null, checker: null };\n }\n const checker = program.getTypeChecker();\n const policy = policyFor(context.cwd, checker, config, (options.trust ?? []).map(normalizeOrigin));\n const tsNode = (node: AstNode) => map.get(node);\n const guardContext: GuardContext = {\n isResultErr: (expression) => policy.isErrType(checker.getTypeAtLocation(tsNode(expression))),\n isErrCall: (expression) =>\n expression.type === 'CallExpression' && policy.trustFunctionName(tsNode(expression) as TS.CallExpression) === 'err',\n trustTryKind: (call) => {\n const name = policy.trustFunctionName(tsNode(call) as TS.CallExpression);\n if (name === 'tryResult') return 'sync';\n if (name === 'tryResultAsync') return 'async';\n return null;\n },\n };\n return { zone: policy.zones.zoneOf(context.filename), policy, guardContext, tsNode, checker };\n}\n","// Resolve the consumer's `typescript` (the one typescript-eslint built the Program with), so\n// SyntaxKind values and node guards match the checker we are handed. Falls back to our own copy.\nimport { createRequire } from 'node:module';\nimport { join } from 'node:path';\nimport type * as TS from 'typescript';\n\nexport type TypeScript = typeof TS;\n\nconst cache = new Map<string, TypeScript>();\n\nexport function loadTypeScript(cwd: string): TypeScript {\n const cached = cache.get(cwd);\n if (cached) return cached;\n let ts: TypeScript;\n try {\n ts = createRequire(join(cwd, '__noego_trust__.cjs'))('typescript') as TypeScript;\n } catch {\n ts = createRequire(import.meta.url)('typescript') as TypeScript;\n }\n cache.set(cwd, ts);\n return ts;\n}\n","// Every call or `new` whose callee is untrusted must be guarded: inside a `try` (same function)\n// whose `catch` returns Result.err(...) on every path, or inside a Trust.try / Trust.tryAsync\n// callback. Trust comes from trust.config.json (see ../config.ts), from first-party checked code,\n// or from a declared return type of Result / Promise<Result> from @noego/trust.\n// Requires typed linting (parserOptions.projectService or project).\nimport type { Rule } from 'eslint';\nimport type * as TS from 'typescript';\nimport { CATCH_MESSAGES, guardOf, type AstNode, type CatchProblem, type Guard } from '../guard.js';\nimport { OPTIONS_SCHEMA, setupRule } from '../rule-setup.js';\n\nconst PROMISE_COMBINATORS = new Set(['all', 'allSettled', 'race', 'any']);\n\nfunction withOrigin(template: string): string {\n return template.replace('{{target}}', 'the call into \"{{origin}}\"');\n}\n\nexport const UNTRUSTED_CALL_MESSAGES = {\n unguarded:\n 'Call into untrusted \"{{origin}}\" must be inside a `try` (same function) whose `catch` returns Result.err(...), or inside Trust.try/tryAsync. If \"{{origin}}\" cannot fail, trust it in trust.config.json.',\n notAwaited:\n 'Async call into untrusted \"{{origin}}\" must be awaited inside the guard, or its rejection escapes the catch.',\n callsIgnored:\n 'Call into \"{{origin}}\" is trusted only because its file is ignored. List that file under \"passthrough\" instead of \"ignore\" so calls into it must be handled.',\n rethrow: withOrigin(CATCH_MESSAGES.rethrow),\n notResultErr: withOrigin(CATCH_MESSAGES.notResultErr),\n rawCatchValue: withOrigin(CATCH_MESSAGES.rawCatchValue),\n notAllPaths: withOrigin(CATCH_MESSAGES.notAllPaths),\n} as const satisfies Record<string, string> & Record<CatchProblem, string>;\n\n/** Outermost expression of a `.then()/.catch()` chain started by `node`. */\nfunction chainTop(node: AstNode): AstNode {\n let current = node;\n for (;;) {\n const member = current.parent;\n const call = member?.parent;\n if (member?.type === 'MemberExpression' && member.object === current && call?.type === 'CallExpression' && call.callee === member) {\n current = call;\n } else {\n return current;\n }\n }\n}\n\nfunction isPromiseCombinator(call: AstNode | undefined): boolean {\n if (call?.type !== 'CallExpression') return false;\n const callee = call.callee as AstNode;\n if (callee.type !== 'MemberExpression') return false;\n const object = callee.object as AstNode;\n const property = callee.property as AstNode;\n return object.type === 'Identifier' && object.name === 'Promise' && property.type === 'Identifier' && PROMISE_COMBINATORS.has(property.name as string);\n}\n\n/** The promise produced by `expression` settles inside the guard (awaited, or returned to Trust.tryAsync). */\nfunction isConsumed(expression: AstNode, guard: Guard): boolean {\n const top = chainTop(expression);\n const parent = top.parent;\n if (!parent) return false;\n if (parent.type === 'AwaitExpression') return true;\n if (parent.type === 'ArrayExpression' && isPromiseCombinator(parent.parent)) return isConsumed(parent.parent as AstNode, guard);\n if (guard.status === 'guarded' && guard.via === 'async-callback') {\n if (parent.type === 'ReturnStatement') return true;\n if (parent.type === 'ArrowFunctionExpression' && parent.body === top) return true;\n }\n return false;\n}\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: { description: 'Require calls into untrusted code to be handled locally and returned as Result.err.' },\n schema: OPTIONS_SCHEMA as unknown as Rule.RuleMetaData['schema'],\n messages: UNTRUSTED_CALL_MESSAGES,\n },\n create(context) {\n const setup = setupRule(context);\n if (!setup.policy || !setup.tsNode || !setup.checker) {\n throw new Error('untrusted-call-must-return-result requires typed linting (parserOptions.projectService or project).');\n }\n if (setup.zone !== 'checked') return {};\n const { policy, tsNode, checker, guardContext } = setup;\n\n function check(esNode: Rule.Node): void {\n const node = esNode as unknown as AstNode;\n const target = tsNode(node) as TS.CallExpression | TS.NewExpression;\n const verdict = policy.classify(target);\n if (verdict.kind === 'calls-ignored') {\n context.report({ node: esNode, messageId: 'callsIgnored', data: { origin: verdict.origin.origin } });\n return;\n }\n if (verdict.kind !== 'untrusted') return;\n const origin = verdict.origin.origin;\n const guard = guardOf(node, guardContext);\n if (guard.status === 'unguarded') {\n context.report({ node: esNode, messageId: 'unguarded', data: { origin } });\n } else if (guard.status === 'badCatch') {\n context.report({ node: esNode, messageId: guard.problem, data: { origin } });\n } else if (checker.getTypeAtLocation(target).getProperty('then') && !isConsumed(node, guard)) {\n context.report({ node: esNode, messageId: 'notAwaited', data: { origin } });\n }\n }\n\n return { CallExpression: check, NewExpression: check };\n },\n};\n\nexport default rule;\n","// Baseline of existing violations, keyed by file + rule + origin with a count.\n// A check fails only when some key's current count exceeds its baselined count, so:\n// - existing violations do not block CI;\n// - a new unguarded call (or a new call in a file that already had one) fails;\n// - removing an origin from the trust list makes all of its calls new violations.\nimport type { ESLint, Linter } from 'eslint';\nimport { UNTRUSTED_CALL_MESSAGES } from './rules/untrusted-call-must-return-result.js';\nimport { relativeInside, realpathOrSelf, toPosix } from './zones.js';\n\nexport const UNTRUSTED_CALL_RULE = 'untrusted-call-must-return-result';\nexport const THROW_RULE = 'throw-must-return-result';\nconst THROW_ORIGIN = 'throw';\n\nexport interface Finding {\n readonly file: string;\n readonly rule: string;\n readonly origin: string;\n readonly line: number;\n readonly column: number;\n readonly message: string;\n}\n\n/** file → rule → origin → count */\nexport type BaselineCounts = Record<string, Record<string, Record<string, number>>>;\n\nexport interface BaselineDelta {\n readonly file: string;\n readonly rule: string;\n readonly origin: string;\n readonly allowed: number;\n readonly found: number;\n readonly findings: readonly Finding[];\n}\n\nfunction escapeRegExp(text: string): string {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nfunction templateRegExp(template: string): RegExp {\n let groupUsed = false;\n const source = template\n .split('{{origin}}')\n .map(escapeRegExp)\n .reduce((acc, part) => {\n if (acc === null) return part;\n const placeholder = groupUsed ? '.+?' : '(.+?)';\n groupUsed = true;\n return `${acc}${placeholder}${part}`;\n }, null as string | null);\n return new RegExp(`^${source}$`);\n}\n\nconst UNTRUSTED_PATTERNS = new Map(Object.entries(UNTRUSTED_CALL_MESSAGES).map(([id, text]) => [id, templateRegExp(text)]));\n\n/**\n * typescript-eslint promise rules counted in the baseline too: an un-awaited or misused promise\n * escapes every try/catch, so it is the async form of an unguarded call. Keyed by the full rule id;\n * their \"origin\" is the rule's messageId.\n */\nexport const BASELINED_PROMISE_RULES: ReadonlySet<string> = new Set([\n '@typescript-eslint/no-floating-promises',\n '@typescript-eslint/no-misused-promises',\n]);\n\n/** The origin a baselined rule message is about (\"throw\" for the throw rule, messageId for promise rules). */\nexport function originFromMessage(rule: string, messageId: string | undefined, message: string): string {\n if (rule === THROW_RULE) return THROW_ORIGIN;\n if (BASELINED_PROMISE_RULES.has(rule)) return messageId ?? 'promise';\n const pattern = messageId ? UNTRUSTED_PATTERNS.get(messageId) : undefined;\n return pattern?.exec(message)?.[1] ?? `unknown:${messageId ?? 'message'}`;\n}\n\nexport function ruleNameOf(ruleId: string | null | undefined): string | null {\n if (!ruleId) return null;\n if (BASELINED_PROMISE_RULES.has(ruleId)) return ruleId;\n const name = ruleId.slice(ruleId.lastIndexOf('/') + 1);\n return name === UNTRUSTED_CALL_RULE || name === THROW_RULE ? name : null;\n}\n\n/** Trust-rule findings from ESLint results, with paths relative to `rootDir`. */\nexport function findingsFromResults(results: readonly ESLint.LintResult[], rootDir: string): Finding[] {\n const root = realpathOrSelf(rootDir);\n const findings: Finding[] = [];\n for (const result of results) {\n const real = realpathOrSelf(result.filePath);\n const file = relativeInside(root, real) ?? toPosix(real);\n for (const message of result.messages as Linter.LintMessage[]) {\n const rule = ruleNameOf(message.ruleId);\n if (!rule) continue;\n findings.push({\n file,\n rule,\n origin: originFromMessage(rule, message.messageId, message.message),\n line: message.line,\n column: message.column,\n message: message.message,\n });\n }\n }\n return findings;\n}\n\n/** Fatal parse/config errors (no ruleId) — a baseline built over these would be wrong. */\nexport function fatalMessages(results: readonly ESLint.LintResult[]): string[] {\n return results.flatMap((result) =>\n (result.messages as Linter.LintMessage[])\n .filter((message) => message.fatal)\n .map((message) => `${result.filePath}:${message.line}:${message.column} ${message.message}`),\n );\n}\n\nexport function countFindings(findings: readonly Finding[]): BaselineCounts {\n const counts: BaselineCounts = {};\n for (const finding of findings) {\n const byRule = (counts[finding.file] ??= {});\n const byOrigin = (byRule[finding.rule] ??= {});\n byOrigin[finding.origin] = (byOrigin[finding.origin] ?? 0) + 1;\n }\n return counts;\n}\n\nexport function compareToBaseline(\n findings: readonly Finding[],\n baseline: BaselineCounts,\n): { readonly added: BaselineDelta[]; readonly stale: BaselineDelta[] } {\n const groups = new Map<string, Finding[]>();\n for (const finding of findings) {\n const key = JSON.stringify([finding.file, finding.rule, finding.origin]);\n const list = groups.get(key) ?? [];\n list.push(finding);\n groups.set(key, list);\n }\n const added: BaselineDelta[] = [];\n for (const list of groups.values()) {\n const { file, rule, origin } = list[0];\n const allowed = baseline[file]?.[rule]?.[origin] ?? 0;\n if (list.length > allowed) added.push({ file, rule, origin, allowed, found: list.length, findings: list });\n }\n const stale: BaselineDelta[] = [];\n for (const [file, byRule] of Object.entries(baseline)) {\n for (const [rule, byOrigin] of Object.entries(byRule)) {\n for (const [origin, allowed] of Object.entries(byOrigin)) {\n const found = groups.get(JSON.stringify([file, rule, origin]))?.length ?? 0;\n if (found < allowed) stale.push({ file, rule, origin, allowed, found, findings: [] });\n }\n }\n }\n return { added, stale };\n}\n\nfunction sortObject<T>(record: Record<string, T>, map: (value: T) => unknown): Record<string, unknown> {\n return Object.fromEntries(\n Object.keys(record)\n .sort()\n .map((key) => [key, map(record[key])]),\n );\n}\n\nexport function serializeBaseline(counts: BaselineCounts): string {\n const violations = sortObject(counts, (byRule) => sortObject(byRule, (byOrigin) => sortObject(byOrigin, (count) => count)));\n const document = {\n $comment:\n 'Generated by `trust baseline --update`. Existing @noego/trust violations, counted per file + rule + origin. ' +\n 'CI fails when a count grows. Shrink it by fixing calls and re-running --update; never hand-raise a count.',\n version: 1,\n violations,\n };\n return `${JSON.stringify(document, null, 2)}\\n`;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nexport function parseBaseline(text: string, source: string): BaselineCounts {\n const document: unknown = JSON.parse(text);\n if (!isRecord(document) || document.version !== 1 || !isRecord(document.violations)) {\n throw new Error(`${source}: expected { \"version\": 1, \"violations\": { … } }`);\n }\n const counts: BaselineCounts = {};\n for (const [file, byRule] of Object.entries(document.violations)) {\n if (!isRecord(byRule)) throw new Error(`${source}: violations[\"${file}\"] must be an object`);\n for (const [rule, byOrigin] of Object.entries(byRule)) {\n if (!isRecord(byOrigin)) throw new Error(`${source}: violations[\"${file}\"][\"${rule}\"] must be an object`);\n for (const [origin, count] of Object.entries(byOrigin)) {\n if (typeof count !== 'number' || !Number.isInteger(count) || count < 0) {\n throw new Error(`${source}: count for ${file} ${rule} ${origin} must be a non-negative integer`);\n }\n ((counts[file] ??= {})[rule] ??= {})[origin] = count;\n }\n }\n }\n return counts;\n}\n"],"mappings":";AA2BO,IAAM,iBAAiB,oBAAI,IAAI,CAAC,uBAAuB,sBAAsB,yBAAyB,CAAC;AAC9G,IAAM,iBAAiB,oBAAI,IAAI,CAAC,gBAAg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AAiB,IAAI,OAAOD,KAAI,sBAAsB;AACxG,iBAAW,CAAC,QAAQ,KAAK,KAAK,OAAO,QAAQ,QAAQ,GAAG;AACtD,YAAI,OAAO,UAAU,YAAY,CAAC,OAAO,UAAU,KAAK,KAAK,QAAQ,GAAG;AACtE,gBAAM,IAAI,MAAM,GAAG,MAAM,eAAe,IAAI,IAAIA,KAAI,IAAI,MAAM,iCAAiC;AAAA,QACjG;AACA,UAAE,OAAO,IAAI,MAAM,CAAC,GAAGA,KAAI,MAAM,CAAC,GAAG,MAAM,IAAI;AAAA,MACjD;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":["isAbsolute","isAbsolute","existsSync","readFileSync","dirname","join","join","existsSync","readFileSync","dirname","path","resolve","join","cache","resolve","rule","isRecord"]}
|