{"record":{"id":"56f43c5f7173e3c0","repo":"nexu-io/open-design","slug":"job-args-job-id-is-not-ready-missing-dependency","errorCode":null,"errorMessage":"job {args.job_id} is not ready; missing dependency result(s): {', '.join(missing_deps)}","messagePattern":"job (.+?) is not ready; missing dependency result\\(s\\): (.+?)","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/record_imagegen_result.py","lineNumber":191,"sourceCode":"    if not source.is_file():\n        raise SystemExit(f\"source image not found: {source}\")\n    source_provenance = validate_source_path(\n        source=source,\n        run_dir=run_dir,\n        allow_synthetic_test_source=args.allow_synthetic_test_source,\n    )\n\n    manifest_path = run_dir / \"imagegen-jobs.json\"\n    manifest = load_jobs(manifest_path)\n    job = find_job(manifest, args.job_id)\n\n    missing_deps = [\n        dep\n        for dep in job.get(\"depends_on\", [])\n        if isinstance(dep, str) and dep not in completed_job_ids(manifest)\n    ]\n    if missing_deps:\n        raise SystemExit(\n            f\"job {args.job_id} is not ready; missing dependency result(s): {', '.join(missing_deps)}\"\n        )\n    validate_required_grounding(job, run_dir)\n\n    output_raw = job.get(\"output_path\")\n    if not isinstance(output_raw, str):\n        raise SystemExit(f\"job {args.job_id} has no output_path\")\n    output = run_dir / output_raw\n    if output.exists() and not args.force:\n        raise SystemExit(f\"{output} already exists; pass --force to replace it\")\n\n    output.parent.mkdir(parents=True, exist_ok=True)\n    shutil.copy2(source, output)\n    metadata = image_metadata(output)\n\n    job[\"status\"] = \"complete\"\n    job[\"source_path\"] = str(source)\n    job[\"source_provenance\"] = source_provenance","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/record_imagegen_result.py#L173-L209","documentation":"Raised in record_imagegen_result.py main() when a job's depends_on list references job ids that are not yet in completed_job_ids(manifest) (status == 'complete'). The recorder enforces DAG order so a row is never recorded before the jobs it derives from (e.g. base).","triggerScenarios":"Recording a row job that depends_on 'base' before the base job is recorded; a dependency failed QA and was reopened; depends_on lists a job id that was never defined.","commonSituations":"Skipping the base job and jumping to rows; re-recording after a repair reset a dependency to 'pending'.","solutions":["Record each dependency first (check order with jq '.jobs[] | {id, depends_on, status}').","Re-record any dependency whose status was reset to pending by a repair.","If a depends_on id is wrong/typo'd, fix it in imagegen-jobs.json.","If the dependency is genuinely optional, remove it from depends_on."],"exampleFix":"# before: recording 'idle' (depends_on base) before base is complete\n# after\nrecord_imagegen_result.py --job-id base  --source ig_base.png\nrecord_imagegen_result.py --job-id idle  --source ig_001.png","handlingStrategy":"validation","validationCode":"done = completed_job_ids(manifest)\nmissing = [d for d in job.get(\"depends_on\", []) if isinstance(d, str) and d not in done]\nif missing:\n    raise SystemExit(f\"record these first: {missing}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Record jobs in topological order (base first).","After a repair resets a dependency to pending, re-record it before dependents.","Keep depends_on minimal and accurate."],"tags":["data-validation","cli","hatch-pet","ordering"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}