Skip to content

Add modular mapper architecture for multiple data sources#42

Draft
Copilot wants to merge 11 commits intomasterfrom
copilot/explore-api-consumption
Draft

Add modular mapper architecture for multiple data sources#42
Copilot wants to merge 11 commits intomasterfrom
copilot/explore-api-consumption

Conversation

Copy link
Contributor

Copilot AI commented Feb 14, 2026

Modular Mapper Architecture Implementation

Recent Documentation Updates

  • Removed "implements MapperSource interface" from class docstrings (redundant)
  • Updated EveScout docstring to mention Turnur connections
  • Added TODO comment in NavProcessor about rethinking status bar
  • Created TODO.md for future enhancements (connection deduplication, UI improvements)
  • Updated MODULE_ARCHITECTURE.md to remove duplication and clarify current vs future state
  • Noted that multiple instances require table window interface (UI work)

Architecture Status

  • MapperSource interface: augment_map(), get_name(), validate_config()
  • Navigation reads config from app (QSettings)
  • NavProcessor aggregates results from all sources
  • Current: supports single Tripwire + Eve Scout
  • Architecture ready for multiple instances, requires UI implementation

Questions Raised

Several comments ask about design decisions:

  • validate_config() placement: currently in mapper, could move to UI
  • Navigation SRP: reads from app_obj for configuration access
  • Multiple Tripwire instances: architecture supports it, awaiting UI scope clarification

All documentation feedback addressed. Awaiting clarification on scope of multiple instance implementation.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 5 commits February 14, 2026 14:41
Co-authored-by: secondfry <400605+secondfry@users.noreply.github.com>
Co-authored-by: secondfry <400605+secondfry@users.noreply.github.com>
Co-authored-by: secondfry <400605+secondfry@users.noreply.github.com>
Co-authored-by: secondfry <400605+secondfry@users.noreply.github.com>
Co-authored-by: secondfry <400605+secondfry@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate API for shortcircuit consumption Add modular mapper architecture for multiple data sources Feb 14, 2026
Copilot AI requested a review from secondfry February 14, 2026 14:50
Copy link
Owner

@secondfry secondfry left a comment

Choose a reason for hiding this comment

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

@copilot it is kinda far from done.

Copy link
Owner

Choose a reason for hiding this comment

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

Unneeded examples.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in b93f2df

README.md Outdated
Comment on lines 149 to 150
Copy link
Owner

Choose a reason for hiding this comment

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

Don't mark Future development as complete. Instead document that it is done somewhere in README.md.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in b93f2df - removed completion marks from "Future development" section and added separate "Mapper Support" section documenting the feature.

README.md Outdated
Comment on lines 153 to 171
Copy link
Owner

Choose a reason for hiding this comment

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

Too much information, something like this would be enough:

Short Circuit supports consuming wormhole data from multiple instances of multiple mapper sources simultaneously:

  • Tripwire.
  • Eve Scout.

TBD:

  • pathfinder.
  • eve-whmapper - waiting for public API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simplified in b93f2df to match the suggested format.

Copy link
Owner

Choose a reason for hiding this comment

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

You should not commit such files to repository.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in b93f2df

Comment on lines 458 to 484
Copy link
Owner

Choose a reason for hiding this comment

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

This is unused, isn't it? Parent methods are unused too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These methods are part of the MapperSource interface and are used by MapperRegistry (lines 29-30, 37, 64, 73 in mapper_registry.py). However, MapperRegistry itself is not currently integrated into the main application code - it exists only for future use and in tests. The application still uses direct augment_map calls on Tripwire/EveScout instances.

Copy link
Owner

Choose a reason for hiding this comment

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

Looking forward to see how are you going integrate get_config with QT configs.

Copy link
Owner

Choose a reason for hiding this comment

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

You should use QT configs. If get_config is still needed, make it make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed get_config() from MapperSource interface in 57059bf. The interface now only includes essential methods: augment_map(), get_name(), and validate_config(). Configuration is managed through QSettings in the app, not through the mapper interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed get_config() in 57059bf. Configuration is now handled through QSettings in the app.

self.sources.clear()
Logger.info("Cleared all mapper sources")

def augment_map(self, solar_map: SolarMap) -> Dict[str, int]:
Copy link
Owner

Choose a reason for hiding this comment

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

I do not see invocations of this, where are they?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MapperRegistry.augment_map is currently only invoked in test_mapper_registry.py. The main application code (navigation.py, app.py) still uses direct augment_map calls on individual Tripwire/EveScout instances. The registry infrastructure exists but is not yet integrated into the actual application workflow.

Copy link
Owner

Choose a reason for hiding this comment

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

The main application code should be updated in this PR aswell.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in ca895d6. The MapperRegistry is now integrated into Navigation and NavProcessor. The main application workflow uses setup_mappers() to configure sources and augment_from_all_mappers() to fetch connections from all registered mappers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in ca895d6. The main application code now uses MapperRegistry through Navigation.setup_mappers() and Navigation.augment_from_all_mappers() methods.

Co-authored-by: secondfry <400605+secondfry@users.noreply.github.com>
self.sources.clear()
Logger.info("Cleared all mapper sources")

def augment_map(self, solar_map: SolarMap) -> Dict[str, int]:
Copy link
Owner

Choose a reason for hiding this comment

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

The main application code should be updated in this PR aswell.

Comment on lines 458 to 484
Copy link
Owner

Choose a reason for hiding this comment

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

Looking forward to see how are you going integrate get_config with QT configs.

Co-authored-by: secondfry <400605+secondfry@users.noreply.github.com>
Copy link
Owner

Choose a reason for hiding this comment

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

Either evescout_enable: bool = False shouldn't be a param to this function, or all the configs for all the mappers should be passed here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 57059bf. Removed the evescout_enable parameter. setup_mappers() now reads all configuration directly from app_obj (Tripwire credentials from instance variables, Eve Scout enabled from state_evescout["enabled"]).

Comment on lines 64 to 72
Copy link
Owner

Choose a reason for hiding this comment

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

Doesn't seem to allow multiple Tripwire instances, but it should.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The current implementation supports one Tripwire instance based on the existing UI configuration. Supporting multiple instances would require UI changes to manage multiple sets of credentials. This is documented as a future enhancement in docs/MODULE_ARCHITECTURE.md (see "Multiple Tripwire Instances" section).

Comment on lines 91 to 102
Copy link
Owner

Choose a reason for hiding this comment

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

There is no need to keep legacy methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed tripwire_augment() legacy method in 57059bf.

Comment on lines 34 to 40
Copy link
Owner

Choose a reason for hiding this comment

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

It should really iterate over entire result, not just there two mappers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 57059bf. NavProcessor now calculates total_connections by summing all values from results dict, not just two specific mappers. The UI signal still sends (tripwire_connections, evescout_connections) for backward compatibility, but the map update logic uses the total.

Comment on lines 79 to 89
Copy link
Owner

Choose a reason for hiding this comment

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

Seems like it should be named augment_map.

Also this is a good moment to create a documentation for connections between modules in docs. Current control path seems strange with all these navigation, navprocessor, tripwire, solarmap juggling.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to augment_map() in 57059bf. Also created comprehensive documentation in docs/MODULE_ARCHITECTURE.md explaining the control flow between navigation, navprocessor, tripwire, and solarmap modules.

Comment on lines 458 to 484
Copy link
Owner

Choose a reason for hiding this comment

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

You should use QT configs. If get_config is still needed, make it make sense.

Copy link
Owner

Choose a reason for hiding this comment

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

Remove this file, it is too much. mapper_base.py and actual implementations of other mappers is quite enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed mapper_template.py in 57059bf. The actual implementations (tripwire.py, evescout.py) serve as sufficient examples.

Copilot AI and others added 2 commits February 14, 2026 15:15
…prove integration

Co-authored-by: secondfry <400605+secondfry@users.noreply.github.com>
Co-authored-by: secondfry <400605+secondfry@users.noreply.github.com>

Configuration is:
1. Loaded from QSettings in `app.py.__init__()` → `read_settings()`
2. Stored in MainWindow instance variables
Copy link
Owner

Choose a reason for hiding this comment

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

This seems kinda wrong and violating SRP. Is there a better way to manage this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Navigation reading from app_obj is necessary to access QSettings-based configuration. An alternative would be to pass a configuration object to setup_mappers(), but that would require creating a new configuration structure. The current approach keeps configuration centralized in MainWindow/QSettings.

Comment on lines +68 to +76
# Add Tripwire if configured
if self.tripwire_url and self.tripwire_user and self.tripwire_password:
tripwire = Tripwire(
self.tripwire_user,
self.tripwire_password,
self.tripwire_url,
name="Tripwire"
)
self.mapper_registry.register(tripwire)
Copy link
Owner

Choose a reason for hiding this comment

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

This code still does not support multiple Tripwire instances, because it clears entire registry on L66.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct - the current implementation clears the registry and adds mappers based on single-instance configuration. Supporting multiple instances requires storing and iterating through multiple configuration sets. What level of implementation is expected for this PR?

Comment on lines 36 to 39
# For backward compatibility with UI, extract specific mapper counts
# The UI expects (tripwire_connections, evescout_connections)
tripwire_connections = results.get("Tripwire", 0)
evescout_connections = results.get("Eve Scout", 0)
Copy link
Owner

Choose a reason for hiding this comment

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

This should have a TODO: rethink status bar

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added TODO comment in 2f08706.

Copy link
Owner

Choose a reason for hiding this comment

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

implements MapperSource interface is unneeded info, we can see that in it's definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in 2f08706.

Comment on lines +458 to +471
def validate_config(self) -> tuple[bool, Optional[str]]:
"""
Validate the Tripwire configuration.

Returns:
Tuple of (is_valid, error_message)
"""
if not self.url:
return False, "URL is required"
if not self.username:
return False, "Username is required"
if not self.password:
return False, "Password is required"
return True, None
Copy link
Owner

Choose a reason for hiding this comment

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

Should validate_config really be a part of Mapper interface? It feels like this validation should happen much earlier, closer to user UI and QSettings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

validate_config() is used by MapperRegistry for logging. UI validation would be preferred, but this provides a fallback for programmatic usage.

Comment on lines +465 to +466
if not self.url:
return False, "URL is required"
Copy link
Owner

Choose a reason for hiding this comment

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

Also URLs should be validated to be URLs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

URL validation would require additional validation logic. Added to TODO.md in 2f08706 as future enhancement.

…ate architecture docs

Co-authored-by: secondfry <400605+secondfry@users.noreply.github.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

Comments