Route mill/bakery ticks through BuildingCapability, key conversion st… - #734
Merged
Merged
Conversation
gaidheal1
force-pushed
the
feat/building_capabilities_tasks
branch
from
August 9, 2026 17:37
5d3b06a to
2af31f6
Compare
…ate by activity advance_mill_economy_tick/advance_bakery_economy_tick now iterate buildings by capabilities__activity instead of building_type, so a building with multiple capabilities (e.g. a communal building that both mills and bakes) gets ticked for each one. GoodsConversionState moves from a per-building OneToOneField to a per-(building, activity) ForeignKey + unique constraint, with a backfill migration mapping existing rows by their building's building_type. This is required alongside the tick change: with a single per-building flag, the first tick to run today would mark the building "processed" and the second would silently skip - see .claude/plans/building-capabilities-plan.md's Edge Cases. Added a regression test (MultiCapabilityBuildingTests) covering exactly this: a communal building with both capabilities produces bread on the same day, which is only possible if both ticks ran. economy_status now prints every conversion state on a building instead of assuming one. Step 3 of the plan. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LxvVvCwZw9HrxFcspgbmSK
gaidheal1
force-pushed
the
feat/building_capabilities_tasks
branch
from
August 9, 2026 17:51
2af31f6 to
0c6f02f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ate by activity
advance_mill_economy_tick/advance_bakery_economy_tick now iterate buildings by capabilities__activity instead of building_type, so a building with multiple capabilities (e.g. a communal building that both mills and bakes) gets ticked for each one.
GoodsConversionState moves from a per-building OneToOneField to a per-(building, activity) ForeignKey + unique constraint, with a backfill migration mapping existing rows by their building's building_type. This is required alongside the tick change: with a single per-building flag, the first tick to run today would mark the building "processed" and the second would silently skip - see .claude/plans/building-capabilities-plan.md's Edge Cases. Added a regression test (MultiCapabilityBuildingTests) covering exactly this: a communal building with both capabilities produces bread on the same day, which is only possible if both ticks ran.
economy_status now prints every conversion state on a building instead of assuming one. Step 3 of the plan.
Claude-Session: https://claude.ai/code/session_01LxvVvCwZw9HrxFcspgbmSK