Skip to content

Export supply hub links for the web map - #91

Merged
Drefvelin merged 1 commit into
mainfrom
feat/hub-links-export
Oct 1, 2026
Merged

Drefvelin merged 1 commit into
mainfrom
feat/hub-links-export

Conversation

@Drefvelin

Copy link
Copy Markdown
Contributor

Adds supply hub connections to map_markers.json so the web map can draw them. No gameplay change.

Export

  • New top-level hub_links array: one entry per connected pair of a guild's active hubs, with guild_id, guild_name, faction_id, mode (rail, sea, air), distance, trade_share, production_share, and from / to installations (id, owning faction, name, province, centre). from is the end with the lower province id.
  • Each installations row gains hub_slots and hubs.
  • The export is queued when a hub is built or removed or a hub permit changes.

Testing

mvn verify: 2461 tests, 0 failures. New tests cover the link and endpoint rows, share rounding and the new installation fields.

🤖 Generated with Claude Code

The map export now lists each guild's connected hub pairs, with the two
installations, the mode, the distance and the shares carried, so the web
map can draw them. Each installation row also carries its hub slots and
how many hubs it hosts.

The export is queued when a hub is built or removed or a permit changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: d68ae845-e802-43af-b582-0cf1a7a9c3da

📥 Commits

Reviewing files that changed from the base of the PR and between 7dc5eb2 and 85a4954.

📒 Files selected for processing (3)
  • src/main/java/net/tfminecraft/simplefactions/guild/hub/SupplyHubCommands.java
  • src/main/java/net/tfminecraft/simplefactions/map/export/Markers.java
  • src/test/java/net/tfminecraft/simplefactions/map/export/MarkersInstallationKindTest.java

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features
    • Map exports now include hub capacity and current usage for installations, plus links between active hubs with guild, faction, mode, distance, trade and production shares, and endpoint details.
    • Nation map updates are now queued for factions with an assigned colour when trade recalculations run and map data is available.

Walkthrough

The change queues faction nation map updates during trade recalculation. Map exports now include installation hub capacity and usage, plus guild hub links with endpoint and link details.

Changes

Hub map data

Layer / File(s) Summary
Queue faction nation map updates
src/main/java/net/tfminecraft/simplefactions/guild/hub/SupplyHubCommands.java
When the map and faction list are available, trade recalculation queues a nation update for each faction with a non-null RGB value.
Export hub capacity and links
src/main/java/net/tfminecraft/simplefactions/map/export/Markers.java, src/test/java/net/tfminecraft/simplefactions/map/export/MarkersInstallationKindTest.java
Installation rows include hub slot capacity and current hub count. The export adds validated guild hub-link rows with mode, distance, rounded shares and endpoint details. Tests check installation capacity and hub-link fields.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 85a49

The change adds hub capacity and connection details to map exports and queues refreshes after hub changes. No concrete merge-blocking issue remains; merge after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 85a49

The change adds hub relationships to an existing map export without an evidenced gameplay authorization bypass. Risk remains bounded but not fully resolved because the receiving map’s access policy and rendering behavior were unavailable.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The producer creates one map-wide snapshot across factions and guilds, not a viewer-specific result. New hub relationships and shares join installation locations and guild identities already exported through the existing integration. The effective downstream readership remains unknown.

Security Findings and Attack Paths

  • observed — The inspected producer serializes guild and endpoint names as JSON values. Its located production caller uses a fixed marker-file path, so these names do not select output paths or commands in this flow. Downstream rendering was unavailable, so this does not establish browser-side safety.

Trust Boundaries and Controls

  • observed — The inspected permit, build, and removal callers retain leadership checks. The new refresh trigger does not carry permit authority, and marker endpoint eligibility is independently checked against current state. Gameplay ownership permission is distinct from authorization to read the resulting map data.

Resilience and Maintainability Implications

  • inferred — Best-effort export and upload can leave previously published hub state visible after a mutation. This follows an unchanged publication mechanism; without an evidenced security-authoritative map consumer, it is a consistency limitation rather than a demonstrated gameplay authorization bypass.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@Drefvelin
Drefvelin merged commit 5b51b53 into main Oct 1, 2026
2 checks passed
@Drefvelin
Drefvelin deleted the feat/hub-links-export branch October 1, 2026 12:37
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.

2 participants