paths
paths
¶
Path-related remedies for self-healing.
Provides automatic fixes for common path-related issues: - CreateMissingWorkspaceRemedy: Creates missing workspace directories - CreateMissingParentDirsRemedy: Creates missing parent directories - FixPathSeparatorsRemedy: Fixes Windows path separators on Unix
Classes¶
CreateMissingWorkspaceRemedy
¶
Bases: BaseRemedy
Creates missing workspace directories.
Triggers when: - Error code E601 (PREFLIGHT_PATH_MISSING) - Error message mentions workspace directory - Parent directory exists (so we're not creating deep trees)
This is the highest-confidence, lowest-risk remedy - creating a single directory is always safe and reversible.
Functions¶
diagnose
¶
Check if workspace is missing but parent exists.
Source code in src/marianne/healing/remedies/paths.py
apply
¶
Create the workspace directory.
Source code in src/marianne/healing/remedies/paths.py
CreateMissingParentDirsRemedy
¶
Bases: BaseRemedy
Creates missing parent directories for validation paths.
Triggers when: - Error relates to a file path that doesn't exist - The missing path is for an output/validation file - Multiple directories need to be created
Slightly lower confidence than workspace remedy since it creates potentially multiple directories.
Functions¶
diagnose
¶
Check for missing parent directories in validation paths.
Source code in src/marianne/healing/remedies/paths.py
apply
¶
Create missing parent directories.
Source code in src/marianne/healing/remedies/paths.py
FixPathSeparatorsRemedy
¶
Bases: BaseRemedy
Fixes Windows path separators on Unix systems.
Triggers when: - Running on Unix (not Windows) - Paths in config contain backslashes - Error relates to file not found
This is an automatic fix because it's non-destructive (only affects in-memory config, not files on disk).
Functions¶
diagnose
¶
Check for Windows path separators on Unix.
Source code in src/marianne/healing/remedies/paths.py
apply
¶
Note: This remedy doesn't modify files - it's informational.
The actual fix needs to be applied in the config loader. This remedy serves to diagnose and suggest the fix.