Hoist consumed-group lookup out of the phase-2 comprehension 🟪

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-09 11:45:56 +00:00
parent 012b0b03ba
commit 4d7434a954

View file

@ -260,10 +260,9 @@ def optimise_package_fabric_first(
# with the phase-1 overlays, so candidates are valued against the
# fabric-applied dwelling and the resulting package score stays the
# truthful whole-package figure against the original baseline.
consumed: set[int] = _used_group_indices(groups, fabric_package.selected)
remaining_groups: list[list[ScoredOption]] = [
group
for index, group in enumerate(groups)
if index not in _used_group_indices(groups, fabric_package.selected)
group for index, group in enumerate(groups) if index not in consumed
]
post_fabric_scorer = _PrefixedScorer(
scorer, [scored.option.overlay for scored in fabric_package.selected]