{"record":{"id":"8d1ff66d0716854a","repo":"affaan-m/ECC","slug":"missing-value-for-family","errorCode":null,"errorMessage":"Missing value for --family","messagePattern":"Missing value for --family","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/catalog.js","lineNumber":79,"sourceCode":"  };\n\n  if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {\n    parsed.help = true;\n    return parsed;\n  }\n\n  parsed.command = args[0];\n\n  for (let index = 1; index < args.length; index += 1) {\n    const arg = args[index];\n\n    if (arg === '--help' || arg === '-h') {\n      parsed.help = true;\n    } else if (arg === '--json') {\n      parsed.json = true;\n    } else if (arg === '--family') {\n      if (!args[index + 1]) {\n        throw new Error('Missing value for --family');\n      }\n      parsed.family = normalizeFamily(args[index + 1]);\n      index += 1;\n    } else if (arg === '--target') {\n      if (!args[index + 1]) {\n        throw new Error('Missing value for --target');\n      }\n      parsed.target = args[index + 1];\n      index += 1;\n    } else if (parsed.command === 'show' && !parsed.componentId) {\n      parsed.componentId = arg;\n    } else {\n      throw new Error(`Unknown argument: ${arg}`);\n    }\n  }\n\n  return parsed;\n}","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/catalog.js#L61-L97","documentation":"When _validate_file_path() is called with must_exist=True, it raises ValueError if the resolved path does not exist on disk. This is used for import/read targets that must already be present, as opposed to output paths that may be created on write. The error reports the fully resolved path.","triggerScenarios":"Importing an instinct file that was moved or deleted; a typo in the filename; a relative path resolved from the wrong working directory; a file that exists only on a different machine/branch.","commonSituations":"The file was deleted between listing and import; the script's cwd differs from what the caller assumed; a stale path reference persisted after a refactor/rename.","solutions":["Verify the file exists with Path(path).exists() before calling with must_exist=True.","Correct the path or re-detect it from the source directory listing.","Ensure the script runs from the intended working directory, or pass an absolute path."],"exampleFix":"# before\n_validate_file_path(instinct_path, must_exist=True)  # file moved\n\n# after\nfrom pathlib import Path\np = Path(instinct_path).expanduser().resolve()\nif not p.exists():\n    raise SystemExit(f'Instinct file not found: {p}')\n_validate_file_path(str(p), must_exist=True)","handlingStrategy":"validation","validationCode":"# Confirm the file exists before importing with must_exist=True.\nfrom pathlib import Path\np = Path(instinct_path).expanduser().resolve()\nif not p.exists():\n    raise SystemExit(f'cannot import: file does not exist: {p}')\n_validate_file_path(str(p), must_exist=True)","typeGuard":"from pathlib import Path\n\ndef file_exists(p) -> bool:\n    return Path(p).expanduser().resolve().exists()","tryCatchPattern":"try:\n    _validate_file_path(path, must_exist=True)\nexcept ValueError as e:\n    if 'does not exist' in str(e):\n        # re-list the directory to suggest the correct filename\n        log.error('file missing; available: %s', list(parent_dir.iterdir()))\n    raise","preventionTips":["Pass absolute paths to avoid cwd mismatches.","Re-list the source directory if a file is reported missing — it may have been renamed.","Distinguish must_exist=True (read/import) from output paths that are created on write."],"tags":["filesystem","validation","missing-file"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}