Module: Evilution Private

Defined in:
lib/evilution.rb,
lib/evilution/version.rb,
sig/evilution.rbs

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Evilution has no public Ruby API. The entire Evilution:: namespace is internal and may change in any release, including patches. The stable, SemVer-governed contract is the CLI, .evilution.yml config keys, session JSON files, the MCP tool schemas, and process exit codes. See docs/public_api.md and docs/versioning.md.

Defined Under Namespace

Modules: AST, ChildOutput, Compare, Coverage, Equivalent, Feedback, GemDetector, Git, Integration, Isolation, LoadPath, MCP, Memory, Mutator, Parallel, ParallelDbWarning, ProcessCleanup, RailsDetector, Reporter, Result, Session, TempDirTracker Classes: Baseline, CLI, Cache, Config, ConfigError, CoverageExampleFilter, DisableComment, Error, ExampleFilter, Hooks, IsolationError, Mutation, ParseError, ProcessSupervisor, RelatedSpecHeuristic, Runner, SourceAstCache, SpecAstCache, SpecResolver, SpecSelector, Subject

Constant Summary collapse

PROJECT_ROOT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Captured at load time, before any isolator can chdir into a per-mutation sandbox. Used as the anchor for resolving project-relative paths (spec files, source files for eval) from inside a chdir'd child so the CWD sandbox (EV-wqxu / GH #1278) cannot break spec resolution or eval FILE.

Dir.pwd.freeze
VERSION =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Returns:

  • (String)
"1.0.0"

Class Method Summary collapse

Class Method Details

.in_isolated_worker!Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Flag set by isolators (Evilution::Isolation::Fork in the forked child, Evilution::Isolation::InProcess around the test_command) so spec resolution and source eval anchor relative paths to PROJECT_ROOT instead of Dir.pwd. Without this gate, a caller that intentionally chdirs to a different project (e.g. a fixture layout in tests) would have its lookups inadvertently fall back to the evilution dev tree.



151
152
153
# File 'lib/evilution.rb', line 151

def self.in_isolated_worker!
  @in_isolated_worker = true
end

.in_isolated_worker?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


155
156
157
# File 'lib/evilution.rb', line 155

def self.in_isolated_worker?
  @in_isolated_worker == true
end

.project_base_dirObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Base directory for resolving project-relative paths. An isolated worker has chdir'd into a per-mutation sandbox (EV-wqxu / GH #1278), so callers in that context must anchor against PROJECT_ROOT rather than Dir.pwd — otherwise spec files, source eval FILE, and $LOAD_PATH entries resolve into the sandbox and break the run. In any other context (normal use, tests that intentionally chdir into a fixture project layout, etc.) the caller's Dir.pwd remains the truth.



174
175
176
# File 'lib/evilution.rb', line 174

def self.project_base_dir
  in_isolated_worker? ? PROJECT_ROOT : Dir.pwd
end

.with_isolated_workerObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



159
160
161
162
163
164
165
# File 'lib/evilution.rb', line 159

def self.with_isolated_worker
  previous = @in_isolated_worker
  @in_isolated_worker = true
  yield
ensure
  @in_isolated_worker = previous
end