Skip to content

Phase 13 - Refactoring: Final integration and cleanup#189

Open
lorenzoberts wants to merge 10 commits into
lorenzo/actor-refactor-phase-12from
lorenzo/actor-refactor-phase-13
Open

Phase 13 - Refactoring: Final integration and cleanup#189
lorenzoberts wants to merge 10 commits into
lorenzo/actor-refactor-phase-12from
lorenzo/actor-refactor-phase-13

Conversation

@lorenzoberts

@lorenzoberts lorenzoberts commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Goal

Remove all remnants of the old architecture and ensure global coherence of the hybrid actor model. Actor boundaries should expose only what production uses, cross-actor communication should go through typed handles, and the codebase should document the design it actually runs.

What this PR does

Trims unused scaffolding from Phase 12: AppCommand, AppTransition, and the AppMessage control channel are removed; AppHandle narrows to run_until_done and shutdown is driven by closing the input subscriber channel. LoreApiHandle and RenderHandle lose methods with no production callers; explicit Shutdown messages and ordered teardown replace implicit drop-based actor shutdown in main.

Keeps ratatui types out of PatchsetDetailsState, replaces bare unwraps with documented expect invariants, and adds tracing at Lore, Render, and Config boundaries. Adds multi-actor integration tests for AppActor startup and InputActor error propagation. Documents the hybrid actor model in README and module comments, then removes leftover placeholder types, dead error variants, and stale migration comments. Runtime behavior is unchanged.

This commit removes placeholder command-dispatch and transition types that
were never wired into the App actor loop. AppMessage is trimmed to the
variants the runtime actually uses, simplifying the actor control path ahead
of the AppHandle surface cleanup in the follow-up commit.

This commit is part of the architecture's refactoring phase 13.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
… channel

This commit resolves the Phase 12 follow-up by narrowing AppHandle to the
single method main actually uses. The AppMessage control channel and its
matching actor select branch are removed; the app loop runs on input events
alone, and shutdown is driven by closing the input subscriber channel.

This commit is part of the architecture's refactoring phase 13.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
…no callers

This commit trims LoreApiHandle and RenderHandle to the methods exercised by
production flows. Unused message variants, handle methods, and their
test-only paths are removed, and stale dead_code suppressions on the actor
protocol modules are dropped now that every remaining item has a caller.

This commit is part of the architecture's refactoring phase 13.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit removes a ratatui dependency from application state by storing
rendered preview content as raw strings and deferring Text conversion to the
view-model projection layer. from_rendered_preview becomes infallible, keeping
presentation types on the UI side of the actor boundary.

This commit is part of the architecture's refactoring phase 13.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
…xpect

This commit replaces silent unwrap calls in production app and config paths
with expect messages that document the program invariants each site depends
on. Success-path is_ok plus unwrap pairs in screen flows are collapsed into
straightforward Result handling.

This commit is part of the architecture's refactoring phase 13.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit adds structured tracing at LoreAPI, Render, and Config boundaries
inside the main application flows. Patchset loading, list refresh, bookmark
persistence, and configuration saves are now observable in the log stream
without changing behavior.

This commit is part of the architecture's refactoring phase 13.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
…rdown

This commit replaces implicit actor teardown on channel drop with explicit
Shutdown messages on LoreApiActor and RenderActor. main retains handles to
those actors after AppActor finishes and shuts them down in a documented order
before UI and terminal teardown, so long-running actor tasks stop predictably.

This commit is part of the architecture's refactoring phase 13.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit adds integration tests that exercise real LoreApiActor and
RenderActor instances through AppActor startup, and verifies that a terminal
poll error propagates through InputActor to close the app subscriber channel.
These paths were previously covered only with stub channels or left untested.

This commit is part of the architecture's refactoring phase 13.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit documents the hybrid actor model where developers read code:
module-level comments on each actor describe responsibility and handle
boundaries, and README adds an Architecture section covering actor roles,
communication rules, and the shutdown order after run_until_done.

This commit is part of the architecture's refactoring phase 13.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit removes leftover placeholder types, unused error variants, and
stale migration comments so the codebase reflects what is actually wired
today. Test-only protocol surface is moved behind cfg(test), and error enums
are trimmed to variants that production code constructs.

This commit completes the architecture's refactoring phase 13.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
@lorenzoberts lorenzoberts marked this pull request as ready for review July 9, 2026 13:53
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