configproof 0.3.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.
Files changed (115) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +217 -0
  3. package/dist/adapters/dotenv.d.ts +3 -0
  4. package/dist/adapters/dotenv.js +277 -0
  5. package/dist/adapters/dotenv.js.map +1 -0
  6. package/dist/adapters/native-env.d.ts +7 -0
  7. package/dist/adapters/native-env.js +196 -0
  8. package/dist/adapters/native-env.js.map +1 -0
  9. package/dist/adapters/registry.d.ts +7 -0
  10. package/dist/adapters/registry.js +30 -0
  11. package/dist/adapters/registry.js.map +1 -0
  12. package/dist/agent/server.d.ts +15 -0
  13. package/dist/agent/server.js +254 -0
  14. package/dist/agent/server.js.map +1 -0
  15. package/dist/analysis/diagnose.d.ts +64 -0
  16. package/dist/analysis/diagnose.js +142 -0
  17. package/dist/analysis/diagnose.js.map +1 -0
  18. package/dist/analysis/history.d.ts +52 -0
  19. package/dist/analysis/history.js +119 -0
  20. package/dist/analysis/history.js.map +1 -0
  21. package/dist/analysis/policy.d.ts +161 -0
  22. package/dist/analysis/policy.js +192 -0
  23. package/dist/analysis/policy.js.map +1 -0
  24. package/dist/analysis/provenance.d.ts +45 -0
  25. package/dist/analysis/provenance.js +144 -0
  26. package/dist/analysis/provenance.js.map +1 -0
  27. package/dist/cli.d.ts +2 -0
  28. package/dist/cli.js +286 -0
  29. package/dist/cli.js.map +1 -0
  30. package/dist/core/analyze.d.ts +46 -0
  31. package/dist/core/analyze.js +168 -0
  32. package/dist/core/analyze.js.map +1 -0
  33. package/dist/core/collect.d.ts +5 -0
  34. package/dist/core/collect.js +147 -0
  35. package/dist/core/collect.js.map +1 -0
  36. package/dist/core/export.d.ts +53 -0
  37. package/dist/core/export.js +155 -0
  38. package/dist/core/export.js.map +1 -0
  39. package/dist/core/io.d.ts +13 -0
  40. package/dist/core/io.js +100 -0
  41. package/dist/core/io.js.map +1 -0
  42. package/dist/core/privacy.d.ts +25 -0
  43. package/dist/core/privacy.js +113 -0
  44. package/dist/core/privacy.js.map +1 -0
  45. package/dist/core/schema.d.ts +2149 -0
  46. package/dist/core/schema.js +181 -0
  47. package/dist/core/schema.js.map +1 -0
  48. package/dist/demo.d.ts +1 -0
  49. package/dist/demo.js +45 -0
  50. package/dist/demo.js.map +1 -0
  51. package/dist/index.d.ts +23 -0
  52. package/dist/index.js +63 -0
  53. package/dist/index.js.map +1 -0
  54. package/dist/launcher.d.ts +27 -0
  55. package/dist/launcher.js +122 -0
  56. package/dist/launcher.js.map +1 -0
  57. package/dist/report/html.d.ts +5 -0
  58. package/dist/report/html.js +109 -0
  59. package/dist/report/html.js.map +1 -0
  60. package/dist/runtime/api.d.ts +44 -0
  61. package/dist/runtime/api.js +29 -0
  62. package/dist/runtime/api.js.map +1 -0
  63. package/dist/runtime/callsite.d.ts +3 -0
  64. package/dist/runtime/callsite.js +61 -0
  65. package/dist/runtime/callsite.js.map +1 -0
  66. package/dist/runtime/children.d.ts +8 -0
  67. package/dist/runtime/children.js +69 -0
  68. package/dist/runtime/children.js.map +1 -0
  69. package/dist/runtime/environment.d.ts +3 -0
  70. package/dist/runtime/environment.js +53 -0
  71. package/dist/runtime/environment.js.map +1 -0
  72. package/dist/runtime/preload.d.ts +1 -0
  73. package/dist/runtime/preload.js +117 -0
  74. package/dist/runtime/preload.js.map +1 -0
  75. package/dist/runtime/recorder.d.ts +59 -0
  76. package/dist/runtime/recorder.js +254 -0
  77. package/dist/runtime/recorder.js.map +1 -0
  78. package/dist/runtime/workers.d.ts +12 -0
  79. package/dist/runtime/workers.js +127 -0
  80. package/dist/runtime/workers.js.map +1 -0
  81. package/docs/ARCHITECTURE.md +54 -0
  82. package/docs/COMPATIBILITY.md +24 -0
  83. package/docs/PRIVACY.md +17 -0
  84. package/docs/VALIDATION.md +42 -0
  85. package/fixtures/bypass/app.cjs +6 -0
  86. package/fixtures/bypass/early.cjs +2 -0
  87. package/fixtures/child-process/child.cjs +2 -0
  88. package/fixtures/child-process/parent.cjs +5 -0
  89. package/fixtures/custom-target/app.cjs +4 -0
  90. package/fixtures/custom-target/sample.env +1 -0
  91. package/fixtures/esm/app.mjs +5 -0
  92. package/fixtures/exit-code/app.cjs +4 -0
  93. package/fixtures/failure-boundary/app.cjs +7 -0
  94. package/fixtures/load-order/app.cjs +9 -0
  95. package/fixtures/load-order/first.env +1 -0
  96. package/fixtures/load-order/second.env +1 -0
  97. package/fixtures/manifest.json +16 -0
  98. package/fixtures/native-env/app.cjs +6 -0
  99. package/fixtures/native-env/failure.cjs +4 -0
  100. package/fixtures/native-env/sample.env +1 -0
  101. package/fixtures/native-env/startup.cjs +2 -0
  102. package/fixtures/runtime-mutation/app.cjs +12 -0
  103. package/fixtures/source-map/input.ts +5 -0
  104. package/fixtures/source-map/tsconfig.json +7 -0
  105. package/fixtures/stale-inheritance/app.cjs +4 -0
  106. package/fixtures/stale-inheritance/sample.env +1 -0
  107. package/fixtures/v03-manifest.json +32 -0
  108. package/fixtures/worker/parent.cjs +3 -0
  109. package/fixtures/worker/worker.cjs +2 -0
  110. package/fixtures/worker-modes/parent.cjs +17 -0
  111. package/fixtures/worker-modes/worker.cjs +4 -0
  112. package/package.json +64 -0
  113. package/policies/configtrace-policy.yaml +23 -0
  114. package/policies/issue-share.yaml +12 -0
  115. package/policies/minimal.yaml +8 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ConfigTrace contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,217 @@
1
+ # ConfigTrace
2
+
3
+ [![npm version](https://img.shields.io/npm/v/configproof.svg)](https://www.npmjs.com/package/configproof)
4
+ [![license](https://img.shields.io/npm/l/configproof.svg)](LICENSE)
5
+ [![Node.js validation](https://github.com/sonusharma26/configtrace/actions/workflows/validate.yml/badge.svg)](https://github.com/sonusharma26/configtrace/actions/workflows/validate.yml)
6
+
7
+ Understand where your Node.js configuration came from, where it was read, and why two runs behaved differently—without printing the underlying values.
8
+
9
+ ConfigTrace is a local-first debugging tool for environment-based configuration. It records evidence for only the keys you select, then lets you explain a key, compare runs, diagnose differences, verify configuration rules, and create an offline report.
10
+
11
+ ## Why ConfigTrace?
12
+
13
+ Configuration bugs often look like application bugs:
14
+
15
+ - The same build works locally but fails in another environment.
16
+ - A `.env` file loads, but the application reads an older value.
17
+ - A required variable exists at startup and changes later.
18
+ - A Worker or child process sees different configuration.
19
+ - Two deployments appear identical, but read different settings.
20
+
21
+ ConfigTrace helps answer:
22
+
23
+ - Was this key present when the application started?
24
+ - Was it loaded from a supported environment file?
25
+ - Where did the application read it?
26
+ - Did it change during the run?
27
+ - What differs between a failing run and a working run?
28
+
29
+ ## Features
30
+
31
+ - **Focused tracing** — watch specific keys or patterns instead of dumping the environment.
32
+ - **Safe evidence** — captured artifacts and reports do not contain the selected raw values.
33
+ - **Source clues** — observe supported `dotenv` and Node.js environment-file loading.
34
+ - **Run comparison** — compare failing and working runs without exposing their values.
35
+ - **Guided diagnosis** — rank relevant configuration differences with supporting evidence.
36
+ - **Configuration checks** — verify required, forbidden, immutable, and source-related rules in CI.
37
+ - **Offline reports** — generate a self-contained HTML report with no hosted service or telemetry.
38
+ - **Process coverage** — optionally trace supported Node.js Workers and direct child processes.
39
+ - **Library and agent access** — use the JavaScript API or expose reviewed traces through a read-only MCP server.
40
+
41
+ ## Requirements
42
+
43
+ - Node.js `22.14+` within the 22.x line, or Node.js 24.x
44
+ - A direct CommonJS or ESM Node.js entry point
45
+
46
+ ConfigTrace launches Node directly. If your application normally starts with `npm start`, use the underlying command, such as `node server.js`, after `--`.
47
+
48
+ ## Installation
49
+
50
+ Install ConfigTrace as a development dependency:
51
+
52
+ ```sh
53
+ npm install --save-dev configproof
54
+ ```
55
+
56
+ Run it with `npx configtrace`. You can also install it globally with `npm install --global configproof` and use `configtrace` directly.
57
+
58
+ ## Quick start
59
+
60
+ Capture how your application uses selected configuration keys:
61
+
62
+ ```sh
63
+ npx configtrace run --watch DATABASE_URL,API_URL --out .configtrace/run.ct.json -- node app.js
64
+ ```
65
+
66
+ Explain one key:
67
+
68
+ ```sh
69
+ npx configtrace explain DATABASE_URL --from .configtrace/run.ct.json
70
+ ```
71
+
72
+ Create an offline report:
73
+
74
+ ```sh
75
+ npx configtrace report .configtrace/run.ct.json --out .configtrace/report.html
76
+ ```
77
+
78
+ ConfigTrace creates new output files and will not overwrite existing ones. Add `.configtrace/` to your application's `.gitignore` and keep trace artifacts private unless you have reviewed them for sharing.
79
+
80
+ ## Compare a failing run with a working run
81
+
82
+ Create a private comparison key once:
83
+
84
+ ```sh
85
+ npx configtrace keygen --out .configtrace/pair.key.json
86
+ ```
87
+
88
+ Capture the failing run:
89
+
90
+ ```sh
91
+ npx configtrace run --watch DATABASE_URL,API_URL --key .configtrace/pair.key.json --out .configtrace/broken.ct.json -- node app.js
92
+ ```
93
+
94
+ Correct the launch environment or configuration, then capture the working run with the same comparison key:
95
+
96
+ ```sh
97
+ npx configtrace run --watch DATABASE_URL,API_URL --key .configtrace/pair.key.json --out .configtrace/working.ct.json -- node app.js
98
+ ```
99
+
100
+ Compare and diagnose the runs:
101
+
102
+ ```sh
103
+ npx configtrace diff .configtrace/broken.ct.json .configtrace/working.ct.json
104
+ npx configtrace diagnose .configtrace/broken.ct.json .configtrace/working.ct.json
105
+ npx configtrace report .configtrace/broken.ct.json .configtrace/working.ct.json --out .configtrace/comparison.html
106
+ ```
107
+
108
+ Do not commit or share `pair.key.json`. ConfigTrace needs the same private key to compare protected value identities across two runs.
109
+
110
+ ## Watch patterns and process options
111
+
112
+ Use `*` and `?` to select groups of keys. Quote patterns so your shell does not expand them:
113
+
114
+ ```sh
115
+ npx configtrace run --watch "DB_*,API_URL" --workers --children --source-maps --out .configtrace/run.ct.json -- node app.js
116
+ ```
117
+
118
+ Worker and child-process tracing are opt-in. ConfigTrace reports incomplete coverage instead of pretending an unsupported process was observed.
119
+
120
+ ## Verify configuration rules
121
+
122
+ Create a policy file such as `configtrace-policy.yaml`:
123
+
124
+ ```yaml
125
+ version: 1
126
+ coverage:
127
+ requireComplete: true
128
+ rules:
129
+ DATABASE_URL:
130
+ required: true
131
+ read: required
132
+ immutableAfterFirstRead: true
133
+ LEGACY_API_KEY:
134
+ missing: true
135
+ read: forbidden
136
+ ```
137
+
138
+ Run the check:
139
+
140
+ ```sh
141
+ npx configtrace verify .configtrace/run.ct.json --policy configtrace-policy.yaml
142
+ ```
143
+
144
+ The command exits with `0` when checks pass, `2` for a verified violation, and `3` when the available evidence is incomplete or inconclusive. This makes it suitable for CI without treating missing evidence as a pass.
145
+
146
+ ## Common commands
147
+
148
+ | Command | What it does |
149
+ |---|---|
150
+ | `run` | Capture selected configuration activity while a Node.js application runs. |
151
+ | `explain` | Show the available source and read evidence for one key. |
152
+ | `diff` | Compare configuration behavior across two captures. |
153
+ | `diagnose` | Rank differences that may be relevant to a failing run. |
154
+ | `verify` | Check a capture against a YAML configuration policy. |
155
+ | `report` | Create a private, offline HTML report. |
156
+ | `doctor` | Check capture completeness and observation boundaries. |
157
+ | `history` | Store and compare an explicitly ordered series of local captures. |
158
+ | `export` | Create a reduced artifact for review before sharing. |
159
+
160
+ Run `npx configtrace --help` for every command and option.
161
+
162
+ ## Use ConfigTrace as a library
163
+
164
+ ```js
165
+ const {
166
+ readTrace,
167
+ buildProvenance,
168
+ diagnoseTraces,
169
+ verifyTrace
170
+ } = require('configproof');
171
+
172
+ const broken = readTrace('.configtrace/broken.ct.json');
173
+ const working = readTrace('.configtrace/working.ct.json');
174
+
175
+ const graph = buildProvenance(broken, { key: 'DATABASE_URL' });
176
+ const diagnosis = diagnoseTraces(broken, working, { limit: 5 });
177
+ const verification = verifyTrace(broken, {
178
+ rules: {
179
+ DATABASE_URL: {
180
+ required: true,
181
+ immutableAfterFirstRead: true
182
+ }
183
+ }
184
+ });
185
+ ```
186
+
187
+ TypeScript declarations are included with the package.
188
+
189
+ ## Read-only MCP access
190
+
191
+ ConfigTrace can expose explicitly selected trace files to compatible coding tools through a local, read-only MCP server:
192
+
193
+ ```sh
194
+ npx configtrace mcp --trace broken=/absolute/path/broken.ct.json --trace working=/absolute/path/working.ct.json
195
+ ```
196
+
197
+ The server can explain and compare authorized traces. It cannot discover arbitrary files, run shell commands, launch applications, or return raw configuration values. See [the MCP example](examples/mcp/stdio-server.json) for a generic process definition.
198
+
199
+ ## Privacy and safety
200
+
201
+ ConfigTrace is local-first: it has no telemetry, upload service, or remote assets in generated reports.
202
+
203
+ Captured values are protected, but metadata can still be sensitive. Key names, paths, timestamps, source labels, and application output may reveal information about your system. ConfigTrace does not sanitize your application's stdout or stderr. Review every artifact or export before sharing it.
204
+
205
+ ConfigTrace provides evidence for debugging; it does not change your configuration or prove a single root cause automatically.
206
+
207
+ Read the [privacy model](docs/PRIVACY.md) and [architecture overview](docs/ARCHITECTURE.md) for deeper technical detail.
208
+
209
+ ## Support and contributing
210
+
211
+ - Report bugs or request features through [GitHub Issues](https://github.com/sonusharma26/configtrace/issues).
212
+ - See [CONTRIBUTING.md](CONTRIBUTING.md) before submitting a change.
213
+ - Review [SECURITY.md](SECURITY.md) for security-reporting guidance.
214
+
215
+ ## License
216
+
217
+ [MIT](LICENSE)
@@ -0,0 +1,3 @@
1
+ import type { AdapterContext } from '../runtime/api';
2
+ /** Observe the installed dotenv implementation; do not replace its parser or populate logic. */
3
+ export declare function installDotenv(context: AdapterContext): () => void;
@@ -0,0 +1,277 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.installDotenv = installDotenv;
40
+ const node_fs_1 = __importDefault(require("node:fs"));
41
+ const node_path_1 = __importDefault(require("node:path"));
42
+ const node_module_1 = __importStar(require("node:module"));
43
+ const node_url_1 = require("node:url");
44
+ const registry_1 = require("./registry");
45
+ /** Observe the installed dotenv implementation; do not replace its parser or populate logic. */
46
+ function installDotenv(context) {
47
+ const { recorder, originalEnv, root } = context;
48
+ const internals = node_module_1.default;
49
+ const originalLoad = internals._load;
50
+ const originalRead = node_fs_1.default.readFileSync;
51
+ const frames = [];
52
+ const origins = new WeakMap();
53
+ const patched = new WeakSet();
54
+ const cleanups = [];
55
+ let copies = 0;
56
+ const readHook = function (...args) {
57
+ const frame = frames.at(-1);
58
+ if (!frame || recorder.suppressed)
59
+ return Reflect.apply(originalRead, node_fs_1.default, args);
60
+ let file;
61
+ if (typeof args[0] === 'string')
62
+ file = node_path_1.default.resolve(process.cwd(), args[0]);
63
+ else if (args[0] instanceof URL && args[0].protocol === 'file:')
64
+ file = (0, node_url_1.fileURLToPath)(args[0]);
65
+ try {
66
+ const result = Reflect.apply(originalRead, node_fs_1.default, args);
67
+ frame.lastRead = { result, file };
68
+ recorder.loader(file, 'read-success');
69
+ return result;
70
+ }
71
+ catch (error) {
72
+ frame.lastRead = undefined;
73
+ recorder.loader(file, 'read-failed');
74
+ throw error; // Preserve the loader's original exception, without recording its message.
75
+ }
76
+ };
77
+ node_fs_1.default.readFileSync = readHook;
78
+ function patch(filename, exported) {
79
+ if (!exported || typeof exported !== 'object' || patched.has(exported) || copies >= 8)
80
+ return;
81
+ let version;
82
+ try {
83
+ const packageFile = node_path_1.default.resolve(node_path_1.default.dirname(filename), '../package.json');
84
+ const pkg = JSON.parse(Reflect.apply(originalRead, node_fs_1.default, [packageFile, 'utf8']));
85
+ if (pkg.name !== 'dotenv' || typeof pkg.version !== 'string')
86
+ return;
87
+ version = pkg.version;
88
+ }
89
+ catch {
90
+ return;
91
+ }
92
+ if (!/^(16|17)\./.test(version) || typeof exported.populate !== 'function' || typeof exported.parse !== 'function') {
93
+ recorder.notice('dotenv_version_unverified');
94
+ return;
95
+ }
96
+ patched.add(exported);
97
+ copies++;
98
+ recorder.notice('dotenv_attached');
99
+ recorder.declareAdapter(registry_1.DOTENV_MANIFEST, version);
100
+ function replace(name, make) {
101
+ const original = exported[name];
102
+ if (typeof original !== 'function')
103
+ return;
104
+ const wrapped = make(original);
105
+ exported[name] = wrapped;
106
+ cleanups.push(() => { if (exported[name] === wrapped)
107
+ exported[name] = original; });
108
+ }
109
+ replace('parse', original => function (...args) {
110
+ const parsed = Reflect.apply(original, this, args);
111
+ try {
112
+ const read = frames.at(-1)?.lastRead;
113
+ // Only associate a file when the exact result of the observed read was parsed.
114
+ const file = read && read.result === args[0] ? read.file : undefined;
115
+ const map = new Map();
116
+ if (parsed && typeof parsed === 'object') {
117
+ for (const key of Object.keys(parsed))
118
+ if (recorder.watch.matches(key) && map.size < 256) {
119
+ map.set(recorder.watch.canonical(key), { kind: 'dotenv', confidence: file ? 'observed' : 'unknown', file });
120
+ }
121
+ origins.set(parsed, map);
122
+ }
123
+ if (!file)
124
+ recorder.notice('dotenv_source_unknown');
125
+ }
126
+ catch {
127
+ recorder.notice('adapter_failed');
128
+ }
129
+ return parsed;
130
+ });
131
+ replace('populate', original => function (...args) {
132
+ const [target, parsed, options] = args;
133
+ const isEnvironment = target === process.env;
134
+ const originalTarget = target === originalEnv;
135
+ const candidates = [];
136
+ let canInspect = false;
137
+ let override = false;
138
+ try {
139
+ if (options !== undefined) {
140
+ const descriptor = Object.getOwnPropertyDescriptor(options, 'override');
141
+ if (descriptor && (!('value' in descriptor) || typeof descriptor.value !== 'boolean'))
142
+ override = undefined;
143
+ else
144
+ override = descriptor?.value ?? false;
145
+ }
146
+ const proto = parsed && Object.getPrototypeOf(parsed);
147
+ canInspect = !!target && !!parsed && (proto === Object.prototype || proto === null);
148
+ if (canInspect) {
149
+ const map = origins.get(parsed);
150
+ recorder.suppress(() => {
151
+ for (const key of Object.keys(parsed)) {
152
+ if (!recorder.watch.matches(key))
153
+ continue;
154
+ if (candidates.length >= 256) {
155
+ recorder.notice('key_limit');
156
+ break;
157
+ }
158
+ const item = Object.getOwnPropertyDescriptor(parsed, key);
159
+ if (!item || !('value' in item) || typeof item.value !== 'string')
160
+ continue;
161
+ const before = Object.getOwnPropertyDescriptor(target, key);
162
+ if (before && !('value' in before)) {
163
+ canInspect = false;
164
+ continue;
165
+ }
166
+ candidates.push({ key, raw: item.value, before: before?.value, had: !!before,
167
+ previousId: recorder.latestId(key),
168
+ origin: map?.get(recorder.watch.canonical(key)) ?? { kind: 'dotenv', confidence: 'unknown' },
169
+ });
170
+ }
171
+ });
172
+ }
173
+ if (override === undefined || !canInspect)
174
+ recorder.notice('dotenv_options_unsupported');
175
+ if (originalTarget && !isEnvironment)
176
+ recorder.notice('dotenv_custom_target');
177
+ }
178
+ catch {
179
+ canInspect = false;
180
+ recorder.notice('adapter_failed');
181
+ }
182
+ if (isEnvironment && canInspect) {
183
+ for (const item of candidates)
184
+ recorder.observe('candidate', item.key, item.raw, { origin: item.origin });
185
+ }
186
+ const originFor = (key) => candidates.find(c => recorder.watch.canonical(c.key) === recorder.watch.canonical(key))?.origin
187
+ ?? { kind: 'dotenv', confidence: 'unknown' };
188
+ const result = isEnvironment
189
+ ? recorder.withOrigin(originFor, () => Reflect.apply(original, this, args))
190
+ : Reflect.apply(original, this, args);
191
+ try {
192
+ if (canInspect) {
193
+ const targetOrigins = origins.get(target) ?? new Map();
194
+ for (const item of candidates) {
195
+ const after = recorder.suppress(() => Object.getOwnPropertyDescriptor(target, item.key)?.value);
196
+ if (isEnvironment && item.had && recorder.latestId(item.key) === item.previousId && after === item.before) {
197
+ // Observation: this supported populate call performed no captured assignment for the candidate.
198
+ // We do not claim to have intercepted an internal "if (override)" branch.
199
+ recorder.observe('skip', item.key, after, { origin: item.origin, candidate: item.raw, hasCandidate: true, outcome: 'not-applied' });
200
+ }
201
+ if (!isEnvironment && !originalTarget && after === item.raw && (!item.had || item.before !== after)) {
202
+ // Intermediate multi-file merges use dotenv's documented precedence, hence inferred.
203
+ targetOrigins.set(recorder.watch.canonical(item.key), { ...item.origin, confidence: item.origin.file ? 'inferred' : 'unknown' });
204
+ }
205
+ else if (!isEnvironment && !originalTarget && item.had && item.before === after && after === item.raw) {
206
+ // Equal-valued candidates from different files cannot be disambiguated by a net snapshot.
207
+ targetOrigins.set(recorder.watch.canonical(item.key), { kind: 'dotenv', confidence: 'unknown' });
208
+ }
209
+ }
210
+ if (!isEnvironment && !originalTarget)
211
+ origins.set(target, targetOrigins);
212
+ }
213
+ }
214
+ catch {
215
+ recorder.notice('adapter_failed');
216
+ }
217
+ return result;
218
+ });
219
+ for (const name of ['config', 'configDotenv'])
220
+ replace(name, original => function (...args) {
221
+ frames.push({});
222
+ try {
223
+ const opts = args[0];
224
+ const desc = opts && typeof opts === 'object' ? Object.getOwnPropertyDescriptor(opts, 'processEnv') : undefined;
225
+ if (desc && (!('value' in desc) || (desc.value && desc.value !== process.env)))
226
+ recorder.notice('dotenv_custom_target');
227
+ }
228
+ catch {
229
+ recorder.notice('dotenv_options_unsupported');
230
+ }
231
+ try {
232
+ return Reflect.apply(original, this, args);
233
+ }
234
+ finally {
235
+ frames.pop();
236
+ }
237
+ });
238
+ }
239
+ const loadHook = function (request, parent, isMain) {
240
+ const result = Reflect.apply(originalLoad, internals, [request, parent, isMain]);
241
+ const relevant = request === 'dotenv' || request.startsWith('dotenv/') || /[/\\]dotenv[/\\]/.test(request)
242
+ || !!parent?.filename?.match(/[/\\]dotenv[/\\]/);
243
+ if (relevant) {
244
+ try {
245
+ const resolved = internals._resolveFilename(request, parent);
246
+ if (/[/\\]lib[/\\]main\.js$/.test(resolved))
247
+ patch(resolved, result);
248
+ }
249
+ catch {
250
+ recorder.notice('adapter_failed');
251
+ }
252
+ }
253
+ return result;
254
+ };
255
+ internals._load = loadHook;
256
+ // Eagerly patch the cwd-resolved CJS dotenv export before ESM namespace snapshots can form.
257
+ // This intentionally loads dotenv's main module early; it does not invoke config().
258
+ try {
259
+ const appRequire = (0, node_module_1.createRequire)(node_path_1.default.join(root, '__configtrace_resolve__.cjs'));
260
+ const resolved = appRequire.resolve('dotenv');
261
+ const exported = appRequire(resolved);
262
+ patch(resolved, exported);
263
+ recorder.notice('dotenv_eager_load');
264
+ }
265
+ catch {
266
+ recorder.notice('dotenv_not_seen');
267
+ }
268
+ return () => {
269
+ for (const cleanup of cleanups.reverse())
270
+ cleanup();
271
+ if (internals._load === loadHook)
272
+ internals._load = originalLoad;
273
+ if (node_fs_1.default.readFileSync === readHook)
274
+ node_fs_1.default.readFileSync = originalRead;
275
+ };
276
+ }
277
+ //# sourceMappingURL=dotenv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dotenv.js","sourceRoot":"","sources":["../../src/adapters/dotenv.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,sCAqLC;AAtMD,sDAAyB;AACzB,0DAA6B;AAC7B,2DAAoD;AACpD,uCAAyC;AAEzC,yCAA6C;AAW7C,gGAAgG;AAChG,SAAgB,aAAa,CAAC,OAAuB;IACnD,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAChD,MAAM,SAAS,GAAG,qBAAoC,CAAC;IACvD,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC;IACrC,MAAM,YAAY,GAAG,iBAAE,CAAC,YAAY,CAAC;IACrC,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,MAAM,OAAO,GAAG,IAAI,OAAO,EAA+B,CAAC;IAC3D,MAAM,OAAO,GAAG,IAAI,OAAO,EAAU,CAAC;IACtC,MAAM,QAAQ,GAAsB,EAAE,CAAC;IACvC,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,MAAM,QAAQ,GAAG,UAAwB,GAAG,IAAW;QACrD,MAAM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AAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;QACtC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC1B,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAAC,CAAC;IAC/C,OAAO,GAAG,EAAE;QACV,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE;YAAE,OAAO,EAAE,CAAC;QACpD,IAAI,SAAS,CAAC,KAAK,KAAK,QAAQ;YAAE,SAAS,CAAC,KAAK,GAAG,YAAY,CAAC;QACjE,IAAI,iBAAE,CAAC,YAAY,KAAK,QAAQ;YAAE,iBAAE,CAAC,YAAY,GAAG,YAAY,CAAC;IACnE,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { AdapterContext } from '../runtime/api';
2
+ /** Only describes the options Node exposes. It does not re-run startup parsing. */
3
+ export declare function nativeEnvFlags(argv: readonly string[]): Array<{
4
+ file: string;
5
+ method: '--env-file' | '--env-file-if-exists';
6
+ }>;
7
+ export declare function installNativeEnv({ recorder, originalEnv }: AdapterContext): () => void;