SAVE SKY provenance + sky→hex (not sky→sea) transition — TDD
Some checks failed
ci/woodpecker/push/pyswiss Pipeline was successful
ci/woodpecker/push/main Pipeline failed

- drama.GameEvent.SKY_SAVED verb + to_prose branch: "X beholds the skyscape of {poss} birth, which yields {obj} a unique {Cap} capacity."; tied highest scores switch "a unique" → "equal", join w. "and" (2-way) or Oxford comma (3+), and pluralize "capacity" → "capacities"; pronouns resolved from actor.pronouns at render time, same machinery as SIG_READY/ROLE_SELECTED
- epic.utils.ELEMENT_CAPACITOR_NAMES + ELEMENT_ORDER + top_capacitors(elements) helper: maps Fire→Ardor Stone→Ossum Time→Tempo Space→Nexus Air→Pneuma Water→Humor; tolerates both flat-int and enriched-dict (`{count, contributors}`) chart_data shapes; returns capacitor names tied for highest count, ordered by canonical wheel ring
- epic.natus_save: on action=confirm, records GameEvent.SKY_SAVED w. top_capacitors=[…] before _notify_sky_confirmed; per-room billscroll AND billboard Most Recent Scroll pick up the new prose
- _natus_overlay.html _onSkyConfirmed: removed sea-partial fetch+inject; now calls closeNatus() + window.location.reload() so the gamer lands on the table hex w. the PICK SKY → PICK SEA btn swap (server-side, driven by sky_confirmed=True), then opts into the sea overlay manually. The auto-launch via 39e12d6 was buried by FTs that were pinning the wrong contract — gamer never had a chance to witness PICK SEA on the hex
- test_room_sea_select.py: three FTs renamed/rewired from auto-launch assertions (sea_overlay_appears_without_page_refresh, natus_overlay_not_visible_after_sky_confirm, sea_open_class_on_html_after_confirm) to (pick_sea_btn_visible_after_sky_confirm, natus_overlay_closed_after_sky_confirm, clicking_pick_sea_btn_opens_sea_overlay) — sea overlay now requires explicit PICK SEA click

Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-05-04 01:57:35 -04:00
parent 5413e63585
commit c9563308d8
7 changed files with 238 additions and 53 deletions

View File

@@ -25,6 +25,43 @@ def stack_reversal_probability(user=None, room=None):
# Element key → in-game capacitor name (mirrors ELEMENT_INFO in natus-wheel.js).
# Used by the SKY_SAVED provenance event to render prose like
# "yields them a unique Ardor capacity."
ELEMENT_CAPACITOR_NAMES = {
"Fire": "Ardor",
"Stone": "Ossum",
"Time": "Tempo",
"Space": "Nexus",
"Air": "Pneuma",
"Water": "Humor",
}
# Canonical clockwise-ring ordering for tie-break and prose joining.
ELEMENT_ORDER = ["Fire", "Stone", "Time", "Space", "Air", "Water"]
def top_capacitors(elements):
"""Return capacitor names tied for the highest count in `elements`.
`elements` is the chart-data dict whose values are either ints (raw counts)
or {"count": int, ...} enriched dicts. Order follows ELEMENT_ORDER so tied
output is deterministic across runs and matches the wheel's visual order.
"""
if not elements:
return []
def _count(v):
return v.get("count", 0) if isinstance(v, dict) else (v or 0)
counts = {k: _count(v) for k, v in elements.items()}
if not counts or max(counts.values()) <= 0:
return []
top = max(counts.values())
return [
ELEMENT_CAPACITOR_NAMES[k]
for k in ELEMENT_ORDER
if counts.get(k) == top and k in ELEMENT_CAPACITOR_NAMES
]
def _planet_house(degree, cusps):
"""Return 1-based house number for a planet at ecliptic degree.