github/spec-kit · error · BundlerError

Each contributed component must be a mapping.

Error message

Each contributed component must be a mapping.

What it means

Error "Each contributed component must be a mapping." thrown in github/spec-kit.

Source

Thrown at src/specify_cli/bundler/models/records.py:203

    return needed


def _component_to_dict(ref: ComponentRef) -> dict[str, Any]:
    data: dict[str, Any] = {"kind": ref.kind, "id": ref.id}
    if ref.version is not None:
        data["version"] = ref.version
    if ref.source is not None:
        data["source"] = ref.source
    if ref.priority is not None:
        data["priority"] = ref.priority
    if ref.strategy is not None:
        data["strategy"] = ref.strategy
    return data


def _component_from_dict(data: Any) -> ComponentRef:
    if not isinstance(data, dict):
        raise BundlerError("Each contributed component must be a mapping.")
    kind = str(data.get("kind", "")).strip()
    cid = str(data.get("id", "")).strip()
    if kind not in COMPONENT_KINDS:
        raise BundlerError(
            f"Corrupt records file: component 'kind' must be one of "
            f"{list(COMPONENT_KINDS)}, got {kind or '<missing>'!r}."
        )
    if not cid:
        raise BundlerError(
            "Corrupt records file: a contributed component is missing its 'id'."
        )
    return ComponentRef(
        kind=kind,
        id=cid,
        version=(str(data["version"]) if data.get("version") else None),
        source=(str(data["source"]) if data.get("source") else None),
        priority=_parse_priority(data.get("priority")),
        strategy=(str(data["strategy"]) if data.get("strategy") else None),

View on GitHub (pinned to bf88c9f9a8)

Solutions

  1. Fix the bundle records file so every contributed component entry is a mapping with 'kind' and 'id' fields; otherwise delete the corrupt records file and reinstall.

When it happens

Trigger: Thrown at src/specify_cli/bundler/models/records.py:203 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of github/spec-kit@bf88c9f9a8 (2026-08-14). Data as JSON: /api/errors/78b84075be5ab487. Report an issue: GitHub.