def merge_findings(fast: list[dict], deep: list[dict]) -> list[dict]:
    """Merge findings from fast and deep layers, resolving overlaps.

    When two findings overlap in position, keep the one with higher weight.
    Non-overlapping findings are all kept.
    """
    all_findings = fast + deep
    if not all_findings:
        return []

    # Sort by start position, then by weight descending
    all_findings.sort(key=lambda f: (f["start"], -f.get("weight", 0)))

    result = []
    for finding in all_findings:
        overlapping = False
        for existing in result:
            if finding["start"] < existing["end"] and finding["end"] > existing["start"]:
                # Overlap found — keep higher weight
                if finding.get("weight", 0) > existing.get("weight", 0):
                    result.remove(existing)
                    result.append(finding)
                overlapping = True
                break
        if not overlapping:
            result.append(finding)

    return sorted(result, key=lambda f: f["start"])
