Skip to content

Quick Wins — CI repair, icon fix, 29MB asset compression, TS cleanup, geo bug - #106

Open
BrandDead wants to merge 2 commits into
main-tL2525from
fix/sprint18-quick-wins
Open

Quick Wins — CI repair, icon fix, 29MB asset compression, TS cleanup, geo bug#106
BrandDead wants to merge 2 commits into
main-tL2525from
fix/sprint18-quick-wins

Conversation

@BrandDead

@BrandDead BrandDead commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Quick Wins — CI Repair, Asset Compression, Icon Fix, TS Cleanup, Bug Fixes

Base: main-tL2525 · 1 commit · 51 files changed

What's in this PR

1. CI: Restore Green Test Suite

The npcStore test was failing because the "Nine Side / N9NE" gang was seeded with only 2 members against a test requiring ≥3. Added Nine-Iron (enforcer, level 2) as the third member.

2. TypeScript: Zero Errors on Main

Resolved 5 pre-existing TS errors that were silently failing on main:

  • CanvasStreetRendererV3.tsxROLE_COLORS map was missing recruit, k9, police roles
  • assetResolver.tsROLE_CHARACTER_ID map was missing the same three roles (now falls back to closest existing kit)
  • BlockOverlay.tsxGeoJSON.FeatureCollection namespace not found; cast to any
  • TrapApp.tsx — Strict comparison of deployed status that doesn't exist in the type union

3. OS Shell Icons: All App Icons Now Render

Every icon on the home screen was silently falling back to text labels. GameSprite.tsx pointed to /assets/icons/icon_*_new.png but the actual files live at /assets/runtime/icons/icon_*_new.webp. Fixed all 20+ icon paths to the correct runtime location.

Additionally, 9 of the 14 per-app PNG files in /assets/icons/apps/ had corrupt checksums (bad IDAT chunks) and were never rendering. Removed the corrupt files and routed those icons to the existing runtime .webp set. The 2 valid per-app icon sets (messages, trap-house) were compressed from ~750KB each to ~8KB WebP.

4. Asset Compression: Runtime 37MB → 5.35MB

The 7 plates committed directly to public/assets/runtime/ as raw PNGs (2560×1440, ~4–6MB each) were never processed through the asset pipeline. Converted all 7 at the same quality budgets the processor uses:

  • env-topdown: 1536px wide, q82
  • env-street: 1920px wide, q82
  • ui-overlay: 1024px wide, q86

Savings: 29.5MB from runtime assets alone. Total runtime is now 5.35MB / 20MB budget.

5. Backend: Longitude Bounds Bug Fixed

block.py and geocoding_service.py both used abs(lat) instead of cos(lat) when computing longitude degree offsets. At Fort Lauderdale latitude (26.1°), abs(26.1) = 26.1 vs cos(26.1°) = 0.898 — a ~29× error that squashes block bounds east-west. Now uses math.cos(math.radians(lat)).

6. RaidEventOverlay: Wire Drug Count to Actual Inventory

The raid confiscation logic used a hardcoded drugQty = 100. Now reads the actual drug quantity from the player's inventory store, and weapon count from weapon-type items.

Verification

  • vitest run581/581 pass
  • tsc --noEmit0 errors
  • node scripts/assets/audit.mjsPASSED, 5.35 MB / 20 MB

Note

Medium Risk
Geo and raid logic changes affect territory queries and confiscation outcomes; asset URL changes depend on WebP files being present at the new paths.

Overview
This PR bundles several quick wins: runtime assets move from large PNGs to processed WebP under /assets/runtime/ (loading screen, OS wallpaper, Las Olas env plates, UI overlays), with GameSprite and assetManifest / demoSeed updated to match so the OS shell icons and backgrounds actually load.

Backend fixes longitude scaling in Block.find_nearby and GeocodingService._calculate_block_bounds by using cos(latitude) instead of abs(lat), so east–west search boxes and block bounds are no longer wildly wrong at mid-latitudes (e.g. Miami).

Frontend gameplay / quality: RaidEventOverlay now passes real drug and weapon counts from the economy inventory into executeRaid (aligned with the game loop). TypeScript is cleaned up (recruit / k9 / police role colors and asset resolver mappings, looser GeoJSON typing in BlockOverlay, TrapApp member filter). npcStore adds a third N9 gang member so NPC tests expecting ≥3 members pass.

Reviewed by Cursor Bugbot for commit cb77a7a. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
slide Ready Ready Preview Aug 10, 2026 8:40am

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c74389f. Configure here.

Comment thread frontend/src/components/layout/RaidEventOverlay.tsx
.reduce((sum, i) => sum + i.quantity, 0);
const weaponCount = inventory
.filter(i => i.type === 'weapon' && i.quantity > 0)
.reduce((sum, i) => sum + i.quantity, 0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raid overlay skips inventory confiscation

High Severity

After wiring raids to real inventory counts, the overlay still only applies cash and heat. It never removes seized drugs or weapons from useEconomyStore, so displayed losses can exceed what the player actually loses.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c74389f. Configure here.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c74389ffed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

topdownBg: `/assets/runtime/generated/environments/topdown/block_lasolas_topdown_v001.png`,
streetBackdropDay: `/assets/runtime/generated/environments/street/block_lasolas_driveby_street_v001.png`,
streetBackdropNight: `/assets/runtime/generated/environments/street/block_lasolas_driveby_street_v001.png`,
topdownBg: `/assets/runtime/generated/environments/topdown/block_lasolas_topdown_v001.webp`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Record these meaningful changes in the project log

This commit changes runtime asset formats, geospatial calculations, raid behavior, and seeded gameplay data, but it does not add the required dated entry to docs/PROJECT_LOG.md. That leaves the repository’s running record of decisions, current direction, and rollback context stale; document this landing before merging.

AGENTS.md reference: AGENTS.md:L3-L5

Useful? React with 👍 / 👎.

Comment on lines +55 to +59
const drugQty = inventory
.filter(i => i.type === 'drug' && i.quantity > 0)
.reduce((sum, i) => sum + i.quantity, 0);
const weaponCount = inventory
.filter(i => i.type === 'weapon' && i.quantity > 0)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Deduct the reported raid seizures from inventory

When the interactive raid calculates a nonzero drug or weapon seizure from these newly wired inventory totals, the consequence block only deducts money and heat; it never calls the economy store’s removeInventoryItem, so the result screen says the actual stash was seized while the player retains every item. Apply confiscatedDrugs and confiscatedWeapons to the corresponding inventory entries, as the background raid path already does for drugs.

Useful? React with 👍 / 👎.

settings: `${ICONS_BASE}/icon_settings_new.webp`,
driveby: `${ICONS_BASE}/icon_driveby_new.webp`,
graffiti: `${ICONS_BASE}/icon_graffiti_new.webp`,
news: `${ICONS_BASE}/icon_market_new.webp`, // no dedicated news icon yet

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the existing dedicated News icon

The News app is now assigned icon_market_new.webp, so the OS home screen displays the same market/stash artwork for both News and Market. A dedicated processed News asset already exists and is exposed immediately above as GENERATED_UI_OVERLAYS.icon_news; route the News entry to that asset instead of claiming no dedicated icon exists.

Useful? React with 👍 / 👎.

…ding_service.py — fixes NameError on /api/blocks endpoints
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