{"record":{"id":"e0fbe0ccc1a0764b","repo":"affaan-m/ECC","slug":"input-artifacts-must-be-a-list-of-local-paths","errorCode":null,"errorMessage":"input_artifacts must be a list of local paths","messagePattern":"input_artifacts must be a list of local paths","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/tasteforge/assets.py","lineNumber":201,"sourceCode":"    config = _load(config_file)\n    base = config_file.parent\n    output = _path(out_receipt, Path.cwd())\n    if output.exists():\n        raise ValueError(f'Receipt output already exists: {output}')\n    binding, requests = (_bundle(config['bundle_dir'], base, False)\n                         if 'bundle_dir' in config else (None, {}))\n    records = []\n    for asset in _assets(config.get('assets')):\n        record = {key: asset[key] for key in ('id', 'modality', 'origin')}\n        record.update(_taste(asset, requests, False))\n        record.update(_fingerprint(_path(asset.get('path'), base), asset['modality']))\n        provenance = _provenance(asset, base, False)\n        if provenance is not None:\n            record['provider_provenance'] = provenance\n        records.append(record)\n    inputs = config.get('input_artifacts', [])\n    if not isinstance(inputs, list):\n        raise ValueError('input_artifacts must be a list of local paths')\n    receipt = dict(schema=SCHEMA, provider_calls=0, provider_execution=False,\n                   assets=records, input_artifacts=[_fingerprint(_path(p, base)) for p in inputs])\n    if binding is not None:\n        receipt['bundle_receipt'] = binding\n    if 'genre_spec' in config:\n        receipt['genre_spec'] = _fingerprint(_path(config['genre_spec'], base))\n    # All inputs already exist, so the output-exists gate also prevents collisions.\n    try:\n        with output.open('x', encoding='utf-8') as stream:\n            json.dump(receipt, stream, indent=2, sort_keys=True)\n            stream.write('\\n')\n    except OSError as exc:\n        raise ValueError(f'Cannot create exclusive receipt: {output}') from exc\n    return receipt\n\n\ndef validate_assets(receipt_path: str | Path) -> dict[str, Any]:\n    \"\"\"Re-hash every bound file and validate receipt semantics; no remote calls.\"\"\"","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/tasteforge/assets.py#L183-L219","documentation":"ingest_assets validates the optional 'input_artifacts' key of the ingest config: it must be a list (of local path strings, each later fingerprinted). A non-list value (string, dict, null, number) is rejected before receipt construction.","triggerScenarios":"Passing config with input_artifacts set to a single string path instead of a list, a comma-joined string, null, or an object mapping names to paths; YAML/JSON configs where a single-entry list was written without brackets.","commonSituations":"Hand-written configs: input_artifacts: \"data/ref.png\" instead of [\"data/ref.png\"]; config generators emitting an object for named artifacts; null when the key is present but no artifacts exist (omit the key instead).","solutions":["Wrap the value in a list: input_artifacts must be an array of path strings.","If there are no input artifacts, omit the key entirely (it defaults to []).","Validate the config shape before calling ingest_assets."],"exampleFix":"# before\n{\"input_artifacts\": \"refs/style.png\"}\n# after\n{\"input_artifacts\": [\"refs/style.png\"]}","handlingStrategy":"validation","validationCode":"cfg = json.loads(open('config.json').read())\ninputs = cfg.get('input_artifacts', [])\nassert isinstance(inputs, list) and all(isinstance(p, str) for p in inputs)","typeGuard":"def valid_inputs(cfg) -> bool:\n    v = cfg.get('input_artifacts', [])\n    return isinstance(v, list) and all(isinstance(p, str) for p in v)","tryCatchPattern":null,"preventionTips":["Always write artifact lists as JSON arrays, even for single items.","Omit input_artifacts rather than setting it to null.","Schema-validate configs (e.g. jsonschema) before ingest."],"tags":["validation","config","type-error","json"],"backgroundTag":"config-type-mismatch","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}