{"record":{"id":"b69c58efa9c7a2c9","repo":"affaan-m/ECC","slug":"unwired-workflow-inputs-sorted-set-inputs-used","errorCode":null,"errorMessage":"Unwired workflow inputs: {sorted(set(inputs) - used)}","messagePattern":"Unwired workflow inputs: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/workflow_graphs.py","lineNumber":109,"sourceCode":"        if name not in ancestors:\n            deps = nodes[name].get('depends', [])\n            ancestors[name] = set(deps).union(*(visit(dep, stack | {name}) for dep in deps))\n        return ancestors[name]\n\n    for name, node in nodes.items():\n        reachable = visit(name, set())\n        for ref in references_in({'input': node.get('input'), 'fields': node.get('fields')}):\n            if ref[0] not in reachable:\n                raise ValueError(f'{name} references undeclared dependency: {ref[0]}')\n            if ref[0] == 'input':\n                if len(ref) < 2 or ref[1] not in inputs:\n                    raise ValueError('Unknown workflow input')\n                used.add(ref[1])\n    for ref in references_in(contents.get('output', {})):\n        if ref[0] not in nodes:\n            raise ValueError('Unknown output node')\n    if used != set(inputs):\n        raise ValueError(f'Unwired workflow inputs: {sorted(set(inputs) - used)}')\n\n\ndef load_graph(kind):\n    if kind not in ('apply', 'apply-motion', 'distill', 'prop3d'):\n        raise ValueError('Unknown workflow kind')\n    graph = json.loads((WORKFLOWS / f'taste-{kind}.json').read_text())\n    validate_graph(graph)\n    return graph\n\n\ndef main():\n    parser = argparse.ArgumentParser(description=__doc__)\n    parser.add_argument('--kind', choices=('apply', 'apply-bundle', 'distill'), required=True)\n    parser.add_argument('--config', type=Path, required=True)\n    parser.add_argument('--out', type=Path, required=True)\n    args = parser.parse_args()\n    try:\n        if args.kind == 'apply-bundle':","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/workflow_graphs.py#L91-L127","documentation":"validate_graph tracks which declared inputs are actually consumed by nodes (used set). After scanning node inputs/fields and the output section, if any declared input was never referenced, it raises ValueError listing the unwired input keys.","triggerScenarios":"The workflow's inputs object declares a key (e.g. 'motion_hint') that no node references via ['input','motion_hint'] anywhere in input, fields, or output sections.","commonSituations":"Deleting the node that consumed an input without removing the input declaration; adding a required input to support a new node but forgetting to reference it; copying a workflow and pruning nodes but not inputs.","solutions":["Reference the listed input in the appropriate node (e.g. a field like '{{input.<key>}}') or remove the key from the workflow's inputs object","Check which node previously consumed the input and restore that dependency edge/reference","Run the script's main entry again; the error message lists the exact unwired key names to fix"],"exampleFix":"// before\n{\"inputs\": {\"image\": \"...\", \"unused_hint\": \"...\"}}\n// after\n{\"inputs\": {\"image\": \"...\"}}  // or add {{input.unused_hint}} to a node field","handlingStrategy":"validation","validationCode":"declared = set(graph['inputs'])\nused = set(re.findall(r\"\\{\\{input\\.(\\w+)\\}\", json.dumps(graph)))\nunwired = declared - used\nassert not unwired, f'remove or wire inputs: {unwired}'","typeGuard":null,"tryCatchPattern":"try:\n    graph = load_graph(kind)\nexcept ValueError as e:\n    if str(e).startswith('Unwired workflow inputs'):\n        keys = eval(str(e).split(': ', 1)[1])  # or parse safely\n        for k in keys: graph['inputs'].pop(k, None)","preventionTips":["Treat the inputs section as derived: remove a declared input the same commit you remove its consumer","Add a CI lint that compares declared vs referenced inputs","Document each input next to the node that consumes it"],"tags":["graph","configuration","input-validation"],"backgroundTag":"missing-required-config-field","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"}