affaan-m/ECC · error · FileNotFoundError

FileNotFoundError

Error message

FileNotFoundError: {path}

What it means

For every path listed in config['evidence_files'], run_workflow resolves it via resolve_input and requires it to be an existing regular file (path.is_file()). If the resolved path does not exist or is a directory/symlink-to-nothing, FileNotFoundError is raised with the path. Evidence files are hashed and probed, so they must be readable files.

Solutions

  1. Check the file exists at the exact resolved path: ls the path from config['evidence_files']
  2. Confirm the working directory / resolve_input base path matches where evidence files actually live
  3. Correct typos in the evidence path in the workflow config
  4. Replace directory entries with the actual file paths inside that directory

Example fix

// before
evidence_files = ['out/collateral/report']
// after
evidence_files = ['out/collateral/report.pdf']
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
for raw in config.get('evidence_files', []):
    p = Path(raw)
    if not p.is_file():
        raise FileNotFoundError(f'evidence file missing: {p.resolve()}')

Type guard

def evidence_files_exist(config) -> bool:
    return all(Path(p).is_file() for p in config.get('evidence_files', []))

Try / catch

try:
    run_workflow(config, out_dir)
except FileNotFoundError as e:
    print(f'Evidence file not found: {e.filename}; check paths and working directory')

Prevention

When it happens

Trigger: config['evidence_files'] contains a path that does not exist on disk, points to a directory, or is a broken symlink, after resolve_input processing.

Common situations: Evidence file moved or deleted after the config was written; relative path resolved against a different working directory than expected; typo in filename or extension; passing a directory instead of a file.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/726805d7c834ec01. Report an issue: GitHub.

Appendix: source

Thrown at skills/taste-application/scripts/tasteforge/workflow.py:569

    specs: list[dict[str, Any]] = []
    manifests: dict[str, dict[str, Any]] = {
        modality: {
            "schema_version": 1,
            "modality": modality,
            "dry_run": True,
            "submit": False,
            "provider_calls": 0,
            "provider_execution": False,
            "requests": [],
        }
        for modality in _MODALITIES
    }
    provenance_rules: list[dict[str, Any]] = []
    evidence_files: list[dict[str, Any]] = []
    for raw_path in config.get("evidence_files", []):
        path = resolve_input(raw_path)
        if not path.is_file():
            raise FileNotFoundError(path)
        suffix = path.suffix.lower()
        evidence_files.append({
            "path": str(path),
            "bytes": path.stat().st_size,
            "sha256": _sha256(path),
            "kind": (
                "editorial" if suffix in {".edl", ".fcpxml"}
                else "archive" if suffix == ".zip"
                else "workflow_record"
            ),
        })

    for genre in genres:
        genre_refs: list[dict[str, Any]] = []
        for raw_path in genre.get("references", []):
            path = resolve_input(raw_path)
            if not path.is_file():
                raise FileNotFoundError(path)

View on GitHub (pinned to 8321021c54)