Skip to content

Refactor runtime.rs into responsibility-owned modules #75

Closed

Description

@yansfil

Context

herdr-core/src/runtime.rs has grown to more than 23,000 lines and currently combines runtime state, event handling, session projection, editor, terminal, project, agent, snapshot delta, and extensive tests.

Scope

  • Split runtime implementation into responsibility-owned modules under herdr-core/src/runtime/.
  • Keep Runtime state authority and the single mutex architecture unchanged.
  • Move tests beside their owning runtime modules without reducing behavioral coverage.
  • Update structural checks that intentionally encode the old file layout.
  • Delete obsolete definitions after each responsibility moves.

Invariants

  • Preserve the notifier latch ordering and serialization outside Mutex<Runtime>.
  • Preserve one-event atomic user actions.
  • Preserve core-owned focus and visible-tab behavior.
  • Preserve INV-herdr-unseen-token: Herdr seen tokens must not become Hide pane-read authority.
  • Do not change the public C ABI or snapshot schema.

Acceptance criteria

  • runtime.rs becomes a small module root and composition boundary.
  • Each extracted module has one named responsibility and no duplicate implementation remains.
  • Rust formatting, clippy, structural checks, core tests, release build, and affected Swift tests pass, or unrelated pre-existing failures are documented with reproduced baseline evidence.
  • The final diff contains no screenshots, run artifacts, or unrelated concurrent changes.

Activity

  1. added
    rust
    on Sep 16, 2026
  2. added a commit that references this issue on Oct 29, 2026
    d2a2066
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    rust

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions