You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CLI can inject cwd/env in important paths, but production entrypoints still
default directly to process.cwd() and process.env. WesleyCommand.execute
also mutates process.env.WESLEY_LOG_FORMAT for JSON mode, which is awkward for
in-process command tests and repeated program invocations.
Hill
CLI startup uses an explicit runtime environment object so tests and embedded
callers can run commands without leaking process state.
Done looks like
a RuntimeEnvironment or equivalent object carries cwd, env, streams, logger,
fs, shell, importer, clock, and log-format settings
program(), module discovery, and WesleyCommand accept the runtime
environment while preserving default host-binary behavior
JSON/log-format handling no longer mutates global process env
tests prove repeated in-process command invocations do not leak env state
module discovery still works through injected cwd/env/importer fixtures
Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.
Create Plan
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your .coderabbit.yaml:
issue_enrichment:
auto_enrich:
enabled: false
💬 Have feedback or questions? Drop into our discord!
Migrated from a local Wesley Method backlog card after adopting METHOD v2.1.0 tracker doctrine.
docs/method/backlog/bad-code/RUNTIME_cli-runtime-environment-port.mdbad-codelane:bad-codeRUNTIMEOriginal Local Backlog Card
CLI runtime environment port
bad-codeRUNTIMEWhy now
The CLI can inject cwd/env in important paths, but production entrypoints still
default directly to
process.cwd()andprocess.env.WesleyCommand.executealso mutates
process.env.WESLEY_LOG_FORMATfor JSON mode, which is awkward forin-process command tests and repeated program invocations.
Hill
CLI startup uses an explicit runtime environment object so tests and embedded
callers can run commands without leaking process state.
Done looks like
RuntimeEnvironmentor equivalent object carries cwd, env, streams, logger,fs, shell, importer, clock, and log-format settings
program(), module discovery, andWesleyCommandaccept the runtimeenvironment while preserving default host-binary behavior
Repo Evidence
packages/wesley-cli/src/program.mjspackages/wesley-cli/src/framework/WesleyCommand.mjspackages/wesley-cli/src/framework/module-loader.mjspackages/wesley-runtime-node/src/ModuleEntryLoader.mjsdocs/audit/2026-05-05_code-quality.md