Skip to content

Split X-Large into freighter and capital tiers, and block unknown-size holes under "[Ignore wormholes]" - #66

Merged
secondfry merged 11 commits into
masterfrom
fix/ignore-wormholes-unknown-size
Nov 23, 2026
Merged

secondfry merged 11 commits into
masterfrom
fix/ignore-wormholes-unknown-size

Conversation

@secondfry

@secondfry secondfry commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Wormhole-sizing fixes found on #65 and during review of this PR:

  • "[Ignore wormholes]" now also blocks holes of unknown size, while Tripwire stargates stay routable.
  • Low-sec and null-sec are separate size classes, and the class-pair size guess is checked against game data.
  • Eve Scout's max_ship_size is used before the system-pair size guess.
  • The pilot chooses freighter or capital: "X-Large" is split into "X-Large (freighter)" and "X-Large (capital)", backed by a new WormholeSize.CAPITAL tier. 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_MATRIX holds 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_size was 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:

    • 1,000,000,000 kg: A641, B041, B449, B520, D792, E587, L031, M164, M555, R051, V283, V898. Every one touches high-sec or Thera. The SDE has no spawn data, so this rests on CCP's target classes plus the Tripwire and Wanderer spawn lists for M555, B041, R051 and V283.
    • 2,000,000,000 kg: C140, C248, C391, H296, N432, N944, S199, U319, V753, V911, W237, Z142. These only link low-sec, null-sec, C5 and C6.

    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

  • Unknown sizes. SolarMap._check_edge blocks 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 coded GATE, and those are exempt.
  • Size tiers. WormholeSize.XLARGE is the 1B kg (freighter) tier, and the new WormholeSize.CAPITAL is the 2B kg tier. statics.csv stores the 2B codes as CAPITAL. Each source knows the new tier:
    • Tripwire through the hole code
    • Eve Scout max_ship_size: "xlarge" is X-Large and "capital" is Capital
    • Wanderer ship_size_type: 3 ("freight") is X-Large and 4 ("capital") is Capital
  • Size choice. The "Wormhole size at least" combo reads Small [All] / Medium / Large / X-Large (freighter) / X-Large (capital) / [Ignore wormholes]. Each entry blocks the sizes below it, so X-Large (freighter) allows both X-Large tiers and X-Large (capital) allows only Capital holes. The route table labels holes "X-large (freighter)" and "X-large (capital)".
  • Saved settings. The new entry moved "[Ignore wormholes]" from index 4 to 5. The index is now saved under restrictions_whsize_v2. When only the old restrictions_whsize key 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.
  • Size matrix. It has separate lowsec and nullsec rows. Cells follow the smallest regular hole for each class pair:
    • Thera↔low-sec and Thera↔null-sec are X-Large (freighter). Thera↔high-sec is Medium (Q063, T458).
    • Null-sec↔C3, C5 and C6 are Medium. Tripwire and Wanderer list O883, L614 and S804 (62,000 t) as spawning in null-sec, although EVE University and anoik.is say only in C1. A code comment records this disagreement.
    • Pairs whose smallest regular hole is a 2B kg hole are Capital: low↔low, low↔null, null↔null, C5↔C5, C5↔C6 and C6↔C6.
    • Pairs that no regular hole links are left out of the table, so they size as unknown: C1↔Pochven, Thera↔Pochven, Thera↔Thera, Thera↔Drifter, Drifter↔Drifter, Drifter↔Pochven, and C13↔high-sec, low-sec, Drifter and Pochven. An unknown-size hole is usable under every size setting except "[Ignore wormholes]". The Pochven pairs may still get O753 or R327, whose spawn classes are unknown.
  • Eve Scout. Each hole is sized in this order:
    1. its type code
    2. max_ship_size
    3. the class guess
  • Design-review cleanups from Size wormholes by CCP's data and stop trusting Wanderer's default size #65:
    • EveDb.is_routable (in the SDE and on the map, so not abyssal or void) replaces SolarMap reading system_desc directly. get_whsize_by_system uses it in place of the "Unknown" class sentinel.
    • get_class builds on system_type, so the two mappings can't drift apart. Zarzakh now gets null-sec sizes instead of Unknown.
    • add_connection raises on an unknown connection type, which is a programming error. It returns False only for a system that isn't routable.
    • A test checks that SIZE_MATRIX is symmetric.
    • The SolarMap tests share a _restrictions helper.

Trade-offs

  • Ship classes are approximated by the two mass tiers. Freighters, jump freighters and the Bowhead use X-Large (freighter). The Rorqual and all other capitals use X-Large (capital). The Rorqual (0.8B kg) fits 1B kg holes by mass, but game rules bar it from Thera (CCP, Ascension 1.3, 2016) and, like other capitals, from high-sec, so it routes only through 2B kg holes, all of which it fits.
  • X-Large (capital) only filters holes. Capitals still get routed through high-sec stargates. A TODO bullet covers routing capital pilots around high-sec gates.
  • The gate exemption keys on Tripwire's GATE code. A TODO bullet records a related gap: a GATE edge with placeholder signatures can merge with another mapper's hole on the same pair and swap codes. GATE edges should never merge with wormhole reports.
  • SIZE_MATRIX stays a literal table rather than rows built from each other. The symmetry test guards against a missed mirror cell.
  • Per-system holes such as Turnur's J377 are still not modelled.
  • Planned follow-up, not in this PR:
    • one EveDb size helper to replace the three per-mapper fallbacks (code, then provider hint, then system pair)
    • flattening Eve Scout's nested if
    • checking whether the mapper-side system-id guards are still needed

Testing

  • test_solarmap.py:
    • unknown-size holes under "[Ignore wormholes]" versus other settings
    • the Tripwire GATE exemption
    • add_connection keeps X-Large holes into high-sec and Thera
    • abyssal systems are skipped
    • an unknown connection type raises
  • test_evedb.py:
    • every 1B code is X-Large and every 2B code is Capital
    • the Capital, Thera and null-sec↔C3/C5/C6 cells
    • low-sec↔C2/C5/C6 is Medium
    • pairs with no regular hole are unknown in both directions
    • is_routable
    • the matrix is symmetric
  • test_evescout.py, run through a real SolarMap:
    • an unknown code takes its size from max_ship_size
    • "xlarge" is X-Large and "capital" is Capital
    • a hole code beats max_ship_size
  • test_wanderer.py: ship_size_type 4 is Capital.
  • test_app_settings.py:
    • which sizes each combo entry allows
    • an old "[Ignore wormholes]" (4) is kept
    • an old X-Large (3) becomes X-Large (freighter)
    • the new key wins over the old one
  • I confirmed that each new behaviour test fails without its change. Full suite: 144 passed.

Manual checks

  • With an old saved "[Ignore wormholes]", the combo opens on "[Ignore wormholes]". With an old "X-Large", it opens on "X-Large (freighter)".
  • A route under X-Large (capital) avoids high-sec and Thera holes, and X-Large (freighter) uses them.

Risks

Low to moderate. Routes change only in these cases:

  • "[Ignore wormholes]" users
  • unidentified holes into low-sec, null-sec↔C3/C5/C6, Thera, and the class pairs no regular hole links
  • unidentified high-sec↔C6 holes
  • X-Large users, who become X-Large (freighter) and now also get the high-sec and Thera 1B kg holes
  • holes touching Zarzakh, which now get a size instead of Unknown (no hole reaches Zarzakh, so no live effect)

🤖 Generated with Claude Code

secondfry and others added 3 commits November 23, 2026 18:58
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>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 16:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T17:27:47.367002Z fc842e8 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI 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.

🟡 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 GATE edges.
  • Separates low-sec and null-sec size classes, making low-sec↔C1–C6 fallbacks Medium.
  • Uses Eve Scout’s max_ship_size before 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

Comment thread src/shortcircuit/model/evescout.py Resolved
secondfry and others added 2 commits November 23, 2026 19:15
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>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 16:16

Copilot AI 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.

🟢 Approval recommended

No active review issues block approval of the wormhole-routing changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

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>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 16:19

Copilot AI 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.

🟢 Approval recommended

The wormhole-routing changes have no active review issues requiring resolution.

No open issues 🎉

Review effort: Balanced

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>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 16:27

Copilot AI 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.

🟢 Approval recommended

No active review issues block approval of the wormhole sizing and route-filtering changes.

No open issues 🎉

Review effort: Balanced

secondfry and others added 4 commits November 23, 2026 20:12
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>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 17:26
@secondfry secondfry changed the title Block unknown-size holes under "[Ignore wormholes]" and fix low-sec hole sizes Split X-Large into freighter and capital tiers, and block unknown-size holes under "[Ignore wormholes]" Nov 23, 2026

Copilot AI 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.

🔵 Needs a closer look

Capital-route safety requires domain-owner validation of current CCP jump masses and conflicting provider spawn lists, since the supplied tests encode rather than validate those assumptions.

No open issues 🎉

Review effort: Balanced

@secondfry
secondfry merged commit bcbfc9e into master Nov 23, 2026
8 checks passed
@secondfry
secondfry deleted the fix/ignore-wormholes-unknown-size branch November 23, 2026 20:02
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>
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