Skip to content

arch(#372): split _events.py by responsibility#377

Merged
voidfreud merged 1 commit intomainfrom
arch/events-split
Apr 14, 2026
Merged

arch(#372): split _events.py by responsibility#377
voidfreud merged 1 commit intomainfrom
arch/events-split

Conversation

@voidfreud
Copy link
Copy Markdown
Owner

Summary

Splits `src/ita/_events.py` (422 LOC) into responsibility-separated modules.

Module boundaries:

File LOC Owns
`_events.py` 212 `on` group + `_debug_warn` + command registration
`_on_session.py` 131 `on session new/end`, UUID extraction helpers
`_coprocess.py` 67 `coprocess-start`, `coprocess-stop`
`_on_prompt.py` 62 `on prompt` wait/timeout logic (from #247)

`init.py` gained three side-effect imports so the new modules register their Click commands on `cli`.

Import check: passed. No external callers of `ita._events.*` in tests, so no back-compat re-exports needed.

Fast-lane: 580 pass / 14 fail → 586 pass / 13 fail (no regressions).

Closes #372.

Test plan

🤖 Generated with Claude Code

422 LOC → 4 files, each ≤250 LOC. Pure reorganization, no behavior change.

  * _events.py (212)      — `on` group + on output/keystroke/focus/layout,
                            annotate, rpc, shared `_debug_warn`
  * _on_prompt.py  (62)   — `on prompt` (#247 timeout-as-ItaError lives here)
  * _on_session.py (131)  — `on session-new` / `on session-end` + UUID parser
  * _coprocess.py  (67)   — `coprocess` group

Sibling modules import `on` and `_debug_warn` from `_events`; __init__.py
imports them after `_events` so the parent group exists before children
register.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@voidfreud voidfreud merged commit 3729a9d into main Apr 14, 2026
1 of 3 checks passed
@voidfreud voidfreud deleted the arch/events-split branch April 14, 2026 08:25
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.

arch: _events.py at 422 LOC — split by responsibility

1 participant