Skip to content

fix: Custom source weights silently ignored in BookProfile #230

Description

@deucebucket

Bug

In `book_profile.py` (~lines 170-176 + 260), `FieldValue.add_source()` accepts a `weight` parameter but never stores it. `calculate_field_confidence()` re-looks up `SOURCE_WEIGHTS.get(source, 30)`, ignoring whatever was passed. Custom layers and plugins pass custom `source_weight` values that are silently discarded.

Custom layers that configure weight 55 actually resolve to 30 (the fallback for unknown source names).

Fix

Store the weight parameter in `FieldValue.add_source()` and use it in `calculate_field_confidence()` instead of re-looking up from the hardcoded dict.

Severity

High — custom layer weights are completely non-functional.

Found via pipeline logic audit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions