{"record":{"id":"872731596b81baec","repo":"Hmbown/CodeWhale","slug":"cargo-metadata-omits-workspace-package-ids-missi","errorCode":null,"errorMessage":"Cargo metadata omits workspace package ids: {missing_ids}","messagePattern":"Cargo metadata omits workspace package ids: (.+?)","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"scripts/release/validate-crate-publish-order.py","lineNumber":75,"sourceCode":"    if not isinstance(metadata, dict):\n        raise ValidationError(\"Cargo metadata root must be an object\")\n    return metadata\n\n\ndef workspace_packages(metadata: dict[str, Any]) -> list[dict[str, Any]]:\n    members = metadata.get(\"workspace_members\")\n    packages = metadata.get(\"packages\")\n    if not isinstance(members, list) or not isinstance(packages, list):\n        raise ValidationError(\"Cargo metadata must contain workspace_members and packages lists\")\n\n    packages_by_id = {\n        package.get(\"id\"): package\n        for package in packages\n        if isinstance(package, dict) and isinstance(package.get(\"id\"), str)\n    }\n    missing_ids = [member for member in members if member not in packages_by_id]\n    if missing_ids:\n        raise ValidationError(\n            \"Cargo metadata omits workspace package ids: \" + \", \".join(missing_ids)\n        )\n    return [packages_by_id[member] for member in members]\n\n\ndef validate_order(\n    packages: list[dict[str, Any]], ordered_crates: list[str]\n) -> tuple[str, dict[str, bool]]:\n    duplicate_crates = sorted(\n        {name for name in ordered_crates if ordered_crates.count(name) > 1}\n    )\n    if duplicate_crates:\n        raise ValidationError(\n            \"publish package list contains duplicates: \" + \", \".join(duplicate_crates)\n        )\n\n    names = [package.get(\"name\") for package in packages]\n    if any(not isinstance(name, str) or not name for name in names):","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/scripts/release/validate-crate-publish-order.py#L57-L93","documentation":"Some ids listed in workspace_members have no matching entry (by 'id') in the packages array. The member list and the package records are therefore inconsistent, and the validator cannot resolve those members; the message lists the offending member ids.","triggerScenarios":"A fixture whose packages array was trimmed while workspace_members still references the removed entries; mixing outputs captured from two different workspace states.","commonSituations":"Curating cargo-metadata fixtures for unit tests and deleting package entries without updating the member list.","solutions":["Regenerate the fixture in one shot from the same workspace state so members and packages agree","Or edit workspace_members to remove the ids you deleted from packages"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"def members_resolvable(metadata: dict) -> bool:\n    members = metadata.get(\"workspace_members\", [])\n    ids = {p.get(\"id\") for p in metadata.get(\"packages\", []) if isinstance(p, dict)}\n    return all(m in ids for m in members)","tryCatchPattern":null,"preventionTips":["Capture fixtures in one shot from a single workspace state","Never edit workspace_members and packages independently"],"tags":["json","cargo","release","consistency","python"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}