{"record":{"id":"468ccca82b2f4d02","repo":"bmad-code-org/BMAD-METHOD","slug":"failed-to-verify-destination-name-error","errorCode":null,"errorMessage":"failed to verify {destination / name}: {error}","messagePattern":"failed to verify (.+?): (.+?)","errorType":"exception","errorClass":"RenderError","httpStatus":null,"severity":"error","filePath":"src/scripts/render_skill.py","lineNumber":290,"sourceCode":"    try:\n        existing = json.loads(manifest_path.read_text(encoding=\"utf-8\"))\n    except (OSError, UnicodeError, json.JSONDecodeError) as error:\n        raise RenderError(f\"corrupt existing generation {destination}: {error}\") from error\n    if existing != manifest:\n        raise RenderError(f\"generation collision or corruption at {destination}\")\n    expected_files = set(manifest[\"outputs\"]) | {\"manifest.json\"}\n    actual_files = {\n        path.relative_to(destination).as_posix()\n        for path in destination.rglob(\"*\")\n        if path.is_file()\n    }\n    if actual_files != expected_files:\n        raise RenderError(f\"generation contains unexpected or missing files: {destination}\")\n    for name, expected_hash in manifest[\"outputs\"].items():\n        try:\n            actual_hash = _hash_bytes((destination / name).read_bytes())\n        except OSError as error:\n            raise RenderError(f\"failed to verify {destination / name}: {error}\") from error\n        if actual_hash != expected_hash:\n            raise RenderError(f\"generation output hash mismatch: {destination / name}\")\n\n\ndef _publish(destination: Path, outputs: dict[str, bytes], manifest: dict[str, Any]) -> None:\n    destination.parent.mkdir(parents=True, exist_ok=True)\n    if destination.exists():\n        _verify_existing(destination, manifest)\n        return\n    staging = Path(tempfile.mkdtemp(prefix=\".staging-\", dir=destination.parent))\n    try:\n        for name, content in outputs.items():\n            path = staging / name\n            path.parent.mkdir(parents=True, exist_ok=True)\n            path.write_bytes(content)\n        (staging / \"manifest.json\").write_bytes(\n            json.dumps(manifest, ensure_ascii=False, indent=2, sort_keys=True).encode(\"utf-8\")\n            + b\"\\n\"","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/bmad-code-org/BMAD-METHOD/blob/b70486b9bdcb0a404d329e2a763b57964e7f1360/src/scripts/render_skill.py#L272-L308","documentation":"During hash verification, reading an output file's bytes raised OSError (permission denied, file vanished between listing and read). The renderer reports which output file failed.","triggerScenarios":"A file listed in the manifest became unreadable during the verification loop -- permissions changed, or a race with another process removed the file after the directory listing.","commonSituations":"Permission changes between run stages; concurrent modification of the generation dir; flaky or networked filesystems.","solutions":["Fix read permissions on the named file (chmod 644).","Ensure no concurrent process touches the generation directory during render.","Regenerate the directory if the file is gone."],"exampleFix":"# before: output file mode 000 (unreadable)\n# after\nchmod 644 _bmad/render/<skill>/<slug>-<hash>/workflow.md","handlingStrategy":"try-catch","validationCode":"from pathlib import Path\n\ndef ensure_outputs_readable(dest: Path, names: list[str]) -> None:\n    for name in names:\n        p = dest / name\n        try:\n            p.read_bytes()\n        except OSError as e:\n            raise SystemExit(f\"unreadable {p}: {e}\")","typeGuard":null,"tryCatchPattern":"from render_skill import render, RenderError\n\ntry:\n    entry = render(project_root, skill_dir)\nexcept RenderError as e:\n    if \"failed to verify\" in str(e):\n        # fix permissions / remove blockers on the named file, then retry\n        ...\n    raise","preventionTips":["Keep generation files world-readable.","Prevent concurrent processes from mutating generation dirs.","On verification failure, regenerate the directory."],"tags":["python","filesystem","permissions","integrity","manifest"],"backgroundTag":null,"analyzedSha":"b70486b9bdcb0a404d329e2a763b57964e7f1360","analyzedAt":"2026-08-13T01:21:12.247Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}