Repository navigation
Split X-Large into freighter and capital tiers, and block unknown-size holes under "[Ignore wormholes]" - #66
Merged
Conversation
Pre-existing bug flagged on PR #65 by Codex and Copilot. The size filter only knows SMALL..XLARGE, so a hole of unknown size slipped through every setting, including "[Ignore wormholes]": users who asked for no wormholes were still routed through holes whose size could not be resolved (e.g. into systems with no row in the size table). The rule lives in SolarMap rather than in MainWindow's size dict: an unknown-size hole is blocked only when every known size is blocked, so the other size settings keep allowing unknown-size holes as before. Tripwire records stargates as size-less WORMHOLE edges coded GATE; those stay exempt, since they are not wormholes and must remain routable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot pointed out after PR #65 merged that J492 (62,000 t, wandering, C1-C6 -> low-sec) is a regular Medium hole. SIZE_MATRIX holds the smallest regular hole for each class pair, so low-sec<->C1-C6 must be Medium; lumping low-sec and null-sec into one row hid that and let the class fallback promise Large or X-Large holes into low-sec. Low-sec and null-sec now have separate rows. Null-sec keeps the old values exactly, and low-sec differs only on C1-C6. This guess is only the fallback: every mapper sizes a hole from its scanned type (or Wanderer's explicit ship size) first, so scanned holes keep their real size and only unidentified ones get the more cautious Medium. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The low-sec<->C1-C6 change relies on providers' own sizes taking precedence over the system-pair guess, but Eve Scout ignored the max_ship_size it sends with every signature: a hole whose type code we don't recognise fell straight through to the class matrix, so a Medium Turnur hole could be reported Large or X-Large. max_ship_size now sits between the hole-code lookup and the class fallback. The code lookup stays first so the capital-ban shortcut (B520/L031/M164/V898 stored as Large) still wins over the "xlarge" Eve Scout reports for those holes; unknown or missing values fall through to the class guess. "small" is mapped too, though not yet seen live, so frigate holes are covered when they appear. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
An unresolved critical fallback bug allows unknown-code Thera connections to be used by X-Large routes even though capitals cannot enter Thera.
1 open issue
What changed in this PR
This follow-up to #65 improves wormhole sizing and route filtering in Short Circuit, addressing unknown-size holes and refining mapper size fallbacks.
Changes:
- Blocks unknown-size holes under “[Ignore wormholes]” while exempting Tripwire
GATEedges. - Separates low-sec and null-sec size classes, making low-sec↔C1–C6 fallbacks Medium.
- Uses Eve Scout’s
max_ship_sizebefore system-pair guesses and adds regression tests.
| File | Description |
|---|---|
TODO.md |
Documents gate-merging risks and remaining per-system sizing limitations. |
src/shortcircuit/model/test_solarmap.py |
Tests unknown-size filtering and Tripwire gate exemption. |
src/shortcircuit/model/test_evescout.py |
Tests provider-size fallback and hole-code precedence. |
src/shortcircuit/model/test_evedb.py |
Tests revised low-sec sizes and unchanged null-sec values. |
src/shortcircuit/model/solarmap.py |
Applies the unknown-size filtering rule. |
src/shortcircuit/model/evescout.py |
Adds max_ship_size as a sizing fallback. |
src/shortcircuit/model/evedb.py |
Splits low-sec and null-sec matrix entries and classification. |
Review effort: Balanced
Copilot on #66 showed the capital-ban shortcut leaked: it was encoded per hole code (B520/L031/M164/V898 stored as Large) and per matrix cell (highsec<->C6), so Eve Scout's max_ship_size "xlarge" into Thera and the highsec<->C5 cell still offered X-Large routes capitals cannot fly. Every mapper's connection passes through SolarMap.add_connection, so the ban is now one EveDb rule applied there, whatever source sized the hole. The rule lives in EveDb with the other size knowledge; mappers keep reporting their provider's size and know nothing of the cap. That lets statics.csv and highsec<->C6 match CCP's data again. Still a shortcut until routing filters capitals by destination system. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The design-principles review of #65 asked for these. SolarMap read EveDb.system_desc directly to check whether a system exists, which ties the graph to EveDb's storage; has_system keeps that knowledge in EveDb. add_connection now rejects every bad input in guard clauses up front, so its happy path, and the capital-ban cap, read straight through. get_class returns per case like its neighbour system_type instead of threading a variable to the bottom. SIZE_MATRIX states each class pair twice, and the low-sec/null-sec split edited dozens of cells by hand, so a test now checks the matrix is square and symmetric to catch a missed mirror cell. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These address a fresh design-principles review of #65. get_class and system_type each mapped the raw SDE class string on their own and had drifted apart (Zarzakh was null-sec to routing but had no size class). get_class now refines system_type, so the two cannot disagree, and Zarzakh holes get null-sec sizes instead of Unknown. SolarMap only checked that a mapper's system was in the SDE, but abyssal and void systems are in the SDE too and make system_type raise once routing reaches them. EveDb.is_routable answers that one question for add_connection and get_whsize_by_system, which replaces the "Unknown" class sentinel. An unknown connection type is a programming error, so add_connection raises instead of returning the same False that means "skipped system". The capital-ban reasoning now lives only at the cap's shortcut comment; TODO.md and tests point to it. The SolarMap tests share one _restrictions helper instead of eleven copies of the default dict. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tier-two review of #66 found no correctness bugs but several places where the new code leaned on details it shouldn't: - The graph matched Tripwire's stargate code through a bare 'GATE' literal; GATE_CODE now names that contract once for both sides. - The cap rebuilt con_info by slicing before _add_wormhole unpacked it. It now runs on the unpacked size, still once per report and before any merge. - _check_edge kept a non-WORMHOLE branch that add_connection's raise has made unreachable. - The "[Ignore wormholes]" check spelled out the four sizes instead of asking WormholeSize which sizes are real. The new tests reuse the existing payload and edge helpers instead of hand-built lists. MAPPER_MODULES.md now says what add_connection does besides dedup. TODO.md no longer claims low-sec<->C1-C6 is the only Medium cell, since C1 is Medium in every row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The central capital cap stored every 1,000,000,000 kg hole touching high-sec or Thera as Large, so freighters (at most 0.96B kg) were routed around holes they can take. CCP's max jump mass has only two tiers at or above 1B kg: the 1B holes all touch high-sec or Thera, and the 2B holes only link low-sec, null-sec, C5 and C6. Capitals weigh at least 1.1B kg, so the tier alone tells freighter holes from capital ones, and the destination ban needs no special case: X-Large (freighter) allows both tiers, X-Large (capital) only the 2B one. Every size source now knows the capital tier: statics codes, Eve Scout's max_ship_size "capital" and Wanderer's ship_size_type 4. The class-pair fallback is checked against game data: Thera to low/null is the freighter tier and to high-sec Medium; null-sec to C3/C5/C6 is Medium because Tripwire and Wanderer list O883/L614/S804 spawning there; pairs whose smallest regular hole is 2B are the capital tier; pairs no regular hole links are left out, so they size as unknown. Adding a combo entry moved "[Ignore wormholes]" from index 4 to 5, so the index is saved under a new key and an old saved 4 is read as 5; an old X-Large (3) becomes X-Large (freighter), which allows the same holes. Capitals still get routed through high-sec stargates; that is in TODO.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two Eve Scout assertions and the "[Ignore wormholes]" route test passed without the code they cover: the class-pair fallback happened to give the same size, and an empty path satisfied the "no hole hop" check. They now use system pairs whose fallback differs and require a route to Jita. The legacy size key is no longer deleted on save. The new key already wins, so deleting the old one bought nothing and cost a downgrade the saved choice; the decision was to migrate, not to remove. The known-size list, the size labels and Tripwire's GATE code each had copies that the capital tier would have had to keep in step, so they now have one definition each. The SIZE_MATRIX header and the mapper doc named sources that no longer match how the cells and tiers are derived. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The docs said freighters fit 1B kg holes and capitals don't, which left the Rorqual (0.8B kg) looking like a freighter-tier ship. It fits those holes by mass, but game rules bar it from Thera and high-sec, where every 1B kg hole leads, so its pilots need "X-Large (capital)", and every 2B kg hole that choice allows fits it. The docs now say which ships belong to each choice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The high-sec C5/C6 test comment still said capitals don't fit, which now reads as the Rorqual-excluding rule the docs dropped; it names the tier instead. The GATE route test used the literal while every other caller uses GATE_CODE, so a rename would have left it testing nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mogglemoss
added a commit
to mogglemoss/shortcircuit
that referenced
this pull request
Nov 23, 2026
…ondfry#65, secondfry#66) Brings in secondfry's merged Wanderer mapper and his two sizing follow-ups. They fix a bug in the fork's 3.0.3: Wanderer's ship_size_type 2 is its "don't know" default, which the fork read as Large, so unscanned Wanderer holes shut out freighters and capitals and could overwrite Tripwire's correct size. They also correct the size table against CCP's max-jump-mass data, split X-Large into a freighter tier (1B kg) and a capital tier (2B kg), make "No Wormholes" also block holes of unknown size, and use Eve Scout's own ship size first. Conflicts, resolved toward the fork where it has its own version: - wanderer.py, test_wanderer.py: upstream's. The fork's copies were identical to the PR head upstream built on. - app.py: the fork's, which builds its own window. Upstream's size changes are ported under the same names (WHSIZE_KEY, read_whsize_index, size_restriction_for_index), so upstream's test_app_settings runs against the fork unchanged. The size choice becomes Frigate, Cruiser, Battleship, Freighter (XL), Capital (XL), No Wormholes; a saved "No Wormholes" moves from index 4 to 5. Upstream's WandererDialog is already in the fork's mapper_dialogs. - navigation.py, mapper_config.py, generate_gui.*: upstream's changes plus the fork's Pathfinder and is_configured additions. - README.md, AGENTS.md: the fork's (its own README; AGENTS.md holds the commit guidelines the fork's CLAUDE.md loads). - MAPPER_MODULES.md: upstream's Wanderer sizing note plus the fork's Pathfinder section. 262 tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Summary
Wormhole-sizing fixes found on #65 and during review of this PR:
max_ship_sizeis used before the system-pair size guess.WormholeSize.CAPITALtier. This replaces a central cap that hid high-sec and Thera holes from freighters.Context
Unknown-size holes (pre-existing, flagged by Codex and Copilot on Size wormholes by CCP's data and stop trusting Wanderer's default size #65). The size filter only knew Small to X-Large. A hole of unknown size passed every setting, including "[Ignore wormholes]", so users who asked for no wormholes could still be routed through one.
Low-sec↔C1–C6 (Copilot, after Size wormholes by CCP's data and stop trusting Wanderer's default size #65 merged). J492 is a regular 62,000 t hole from C1–C6 to low-sec.
SIZE_MATRIXholds the smallest regular hole for each class pair, so low-sec↔C1–C6 must be Medium. We chose to split low-sec from null-sec because providers' own sizes take precedence, so only unidentified holes get the more cautious Medium.Eve Scout's
max_ship_sizewas ignored, so that precedence was missing for Eve Scout.Capitals versus freighters. Master stored the 1B kg codes B520/L031/M164/V898 and the high-sec↔C6 and low/null↔Thera cells as Large, because capitals can't enter high-sec or Thera; an earlier version of this PR moved that into one central cap. Both hid those holes from freighters. CCP's max jump mass (SDE attribute 1385) has only two values at or above 1B kg:
Capitals weigh at least 1.1B kg and freighters at most 0.96B kg. So the hole's tier alone separates the two, and the destination ban needs no special case.
Approach
SolarMap._check_edgeblocks an unknown-size hole only when every known size is blocked, which is what "[Ignore wormholes]" sets. Tripwire records stargates as size-less WORMHOLE edges codedGATE, and those are exempt.WormholeSize.XLARGEis the 1B kg (freighter) tier, and the newWormholeSize.CAPITALis the 2B kg tier.statics.csvstores the 2B codes asCAPITAL. Each source knows the new tier:max_ship_size: "xlarge" is X-Large and "capital" is Capitalship_size_type: 3 ("freight") is X-Large and 4 ("capital") is Capitalrestrictions_whsize_v2. When only the oldrestrictions_whsizekey exists, a saved 4 is read as 5. Any other old index keeps its position, so an old X-Large (3) becomes X-Large (freighter), which allows the same holes as before. The old key is left alone, so a downgrade reads the choice saved before the upgrade.lowsecandnullsecrows. Cells follow the smallest regular hole for each class pair:max_ship_sizeEveDb.is_routable(in the SDE and on the map, so not abyssal or void) replaces SolarMap readingsystem_descdirectly.get_whsize_by_systemuses it in place of the"Unknown"class sentinel.get_classbuilds onsystem_type, so the two mappings can't drift apart. Zarzakh now gets null-sec sizes instead of Unknown.add_connectionraises on an unknown connection type, which is a programming error. It returns False only for a system that isn't routable.SIZE_MATRIXis symmetric._restrictionshelper.Trade-offs
GATEcode. A TODO bullet records a related gap: aGATEedge with placeholder signatures can merge with another mapper's hole on the same pair and swap codes.GATEedges should never merge with wormhole reports.SIZE_MATRIXstays a literal table rather than rows built from each other. The symmetry test guards against a missed mirror cell.EveDbsize helper to replace the three per-mapper fallbacks (code, then provider hint, then system pair)ifTesting
test_solarmap.py:GATEexemptionadd_connectionkeeps X-Large holes into high-sec and Theratest_evedb.py:is_routabletest_evescout.py, run through a real SolarMap:max_ship_sizemax_ship_sizetest_wanderer.py:ship_size_type4 is Capital.test_app_settings.py:Manual checks
Risks
Low to moderate. Routes change only in these cases:
🤖 Generated with Claude Code