Skip to content

feat(fp): live AI activity feed, decision beacons and staggered mayor turns - #13

Merged
KunalSiyag merged 1 commit into
mainfrom
fp/ai-activity
Oct 20, 2026
Merged

KunalSiyag merged 1 commit into
mainfrom
fp/ai-activity

Conversation

@KunalSiyag

Copy link
Copy Markdown
Owner

What

Shows the city's AI at work from the street. This is the first of the PRs for the engagement feedback.

  • Activity feed (scripts/fp/activity/, top right):
    • One card per mayor turn, council ruling, Chaos Director pick, Grid Operator order and Gazette front page.
    • A card names who decided and the model they run on. A badge gives the source: live, replay, fallback (after a failed live call) or the offline planner. The card also shows what they did and why, any votes, and where.
    • The header says Offline, Live or Reconnecting, and who is deciding or goes next.
    • J cycles full, brief and hidden. The feed hides under menus and cards (at once under the pause menu), but not under the chat input.
  • Beacons and tags:
    • A decision with a place raises a light beacon in the agent's colour and pings the compass and minimap (ai:<agent>, no toast).
    • Within 30 tiles, a floating tag names the decision. A tag that would cover the top bar, feed, minimap or chat ticker is left out instead of being pushed to the screen edge. Tags hide while the chat drawer is open.
    • G routes the GPS to the newest decision with a place.
  • Staggered mayor turns (scripts/ai/mayor_turns.gd):
    • On foot, the five mayors take their turns spread over the first 90% of the day, in an order that rotates daily, instead of all at dawn.
    • A turn starts only while the sliced sim is idle, so its actions never force a synchronous finish. Before that fix, the new test measured 4 forced finishes in one day, the worst taking 51 ms in a single frame.
    • A mayor still deciding keeps the turn. A turn still waiting when the day ends runs on its own day. Saves keep the queue.
  • Refactor: prompt text helpers move from city_brain.gd to scripts/ai/brain_text.gd, since city_brain.gd was at the file-length limit.
  • Input: ai_feed (J, keyboard only, since every pad button is taken on foot). G reuses site_waypoint on foot.
  • Behind the activity flag (on by default).

Checks

  • tools/gate.sh full: PASS (no flaky retries).
  • pre-commit run --all-files and python tools/checks/run_all.py: PASS. API docs regenerated.
  • New fp_activity_test.
  • fp_brainspread_test adds a staggered-day check driven by the sim's own sliced clock at one job step per frame. The turns land at ticks 0, 1, 1, 2 and 3 with no forced finish.
  • Windowed 1600x900 photo tour, 3 days offline: 22 shots, no errors. Tags stay clear of the HUD and hide while the chat drawer is open.

… turns

Show the city's AI at work from the street. Every mayor turn, council
ruling, Chaos Director pick, Grid Operator order and Gazette front page
lands as a card in a feed at the top right. A card names who decided and
the model they run on, says whether the answer came live, from a replay,
from a fallback after a failed live call or from the offline planner,
and shows what they did, why, any votes and where. J cycles the feed
between full, brief and hidden.

A decision with a place raises a light beacon in the agent's colour and
pings the compass and minimap without a toast. Within 30 tiles a beacon
gets a floating tag that keeps clear of the HUD. G routes the GPS to the
newest decision with a place.

On foot the city brain spreads the five mayor turns over the day
(scripts/ai/mayor_turns.gd) instead of running them all at dawn. A turn
starts only while no sliced tick or spread work is in flight, so its
actions never force a synchronous finish, and a turn still waiting when
the day ends runs on its own day. The feed's header says who is deciding
or who goes next, and saves keep the waiting turns. Prompt text helpers
move to scripts/ai/brain_text.gd.

Behind the "activity" flag, with fp_activity_test and a staggered-day
check in fp_brainspread_test.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Automated review

No new findings on the 35 changed files (gdlint, complexity, TODO policy, dead code).

Run python3 tools/checks/run_all.py locally for the full set of checks.

@KunalSiyag
KunalSiyag merged commit fb04971 into main Oct 20, 2026
8 checks passed
@KunalSiyag
KunalSiyag deleted the fp/ai-activity branch October 20, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant