Skip to main content

Module fixes

Module fixes 

Source
Expand description

Environment-repair engine for limit fix.

Models an actionable repair as a Fix (a description of what changes and how), then applies it through execute_fix:

  1. Validate the fix is safe (source exists / PID is plausible).
  2. Preview the before/after state.
  3. Execute the underlying command or file operation.
  4. Capture stdout/stderr into the result logs.
  5. Verify the fix actually worked (re-check the file system / process).
  6. Roll back automatically when a reversible fix fails.

The four built-in fixes are:

All file operations are non-destructive by default: execute_fix refuses to overwrite an existing target; pass an overwrite-acknowledging variant (see execute_fix_with) after the user has been asked.

Structs§

Fix
A single, idempotent repair with enough metadata for safe auto-application.

Enums§

FixCommand
The concrete action a Fix performs, expressed against the repo root.

Constants§

DEFAULT_EDITORCONFIG
Default .editorconfig with sensible cross-editor settings.
DEFAULT_GITIGNORE
Default .gitignore coverage for common stacks.

Functions§

copy_env_from_example
Builds the reversible .env.example → .env copy fix, if applicable.
execute_fix
Applies fix inside repo_path, refusing to overwrite existing files.
execute_fix_with
Applies fix, allowing overwrite when allow_overwrite is set.
install_fix_for_stack
Builds the missing-dependencies install fix for a detected stack.
kill_ghost_process
Builds the kill-ghost-process fix for a blocked port.
missing_config_files
Builds [fixes] that create well-known config files when they are missing (.gitignore and .editorconfig). Existing files are never offered for recreation.
preview_fix
Renders a before/after preview of what fix will do in repo_path.
process_exists
Whether a process with pid currently exists (best effort).
recommended_fixes
Collects every fix applicable to an EnvironmentState snapshot:
run_fix
Runs limit fix: scans for issues, builds the concrete fixes, asks for approval and applies them.
verify_copy
Verifies dst is a file whose bytes match src.
verify_deleted
Verifies path no longer exists.
verify_process_gone
Verifies the process with pid is gone.
verify_written
Verifies path is a file with exactly expected content.