Skip to content

Architecture Overhaul , Stability Fixes and CUI Speech Checks #11

Open
Filipedavila wants to merge 32 commits intoqualweb:developfrom
Filipedavila:develop
Open

Architecture Overhaul , Stability Fixes and CUI Speech Checks #11
Filipedavila wants to merge 32 commits intoqualweb:developfrom
Filipedavila:develop

Conversation

@Filipedavila
Copy link
Copy Markdown
Collaborator

PR: Architecture Overhaul , Stability Fixes and CUI Speech Checks

Summary

This PR covers the transition from a more a structured, action-based engine. I’ve refactored the core to handle complex interaction flows and fixed the persistent "context invalidated" and "uncaught promise" errors we were seeing.
Additionally, a new suite of Speech Tests has been integrated to evaluate voice-based interactions.

Major Changes

Decoupled Architecture

Replaced singletons with Factory patterns. This makes the code immutable, significantly improves testability, and follows SOLID principles for better domain isolation.

Centralized Error Handling

Created a Single Source of Truth for errors. The Sidepanel, Background, and Content scripts now handle failures through a unified registry, ensuring consistent state across all extension components.

Action-Based Engine

The system now processes structured Action Objects instead of raw text. This decoupling allows for more complex agent behavior and better validation of interaction payloads.

Reliable Skip/Cancel Logic

Implemented centralized AbortController management. Skipping an objective now resets the internal state correctly, preventing UI hangs or loop breaks during user interruptions.

Communication & Resilience

  • Port Refactoring: Updated Background ports to prevent connection drops.
  • Promise Handling: Added a robust reject mechanism for failed background messages to ensure the UI remains responsive even on failure.

Extras

  • Data Export: Added a JSON button to download evaluation results for easier analysis.

…now produces actions as output, new speech tests
Establishes a single source of truth for error management across sidepanel, background, and content scripts. Includes predefined message handlers to standardize communication.
- Replace Singletons with Factory patterns to improve testability. - Implement immutability across core content components. - Rename and refactor OOP structures for better domain clarity.
- Replace raw text payloads with structured Action objects from background agents.
- Decouple interaction logic from message listeners.
- Improve modularity by isolating action execution from transport logic.
…vity

- Restructured project hierarchy for better domain isolation.
- Introduced Signal logic for granular state management.
- Optimized Mutation Objects to improve state predictability.
- Added a centralized AbortController manager to handle task cancellation.
- Replace Singletons with Factory patterns to improve testability.
- Implement immutability across core content components.
Updated content handlers to use factory-instantiated core components.
- Connected Vue's global error hook to the centralized error management system.
- Changed Background port handlers from async to sync to avoid context invalidation.
- Added explicit success message from Background to Content on skip events.
- Fixed 'ActionHandlerRegistry' to gracefully handle aborted signals without throwing.
- Ensured 'isSkipping' state resets correctly by resolving the pending promise.
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