ticket: use base32 project record ids
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
---
|
||||
title: "TUI: extract CLI parsing from main.rs"
|
||||
state: "closed"
|
||||
created_at: "2026-05-31T07:42:58Z"
|
||||
updated_at: "2026-05-31T13:38:30Z"
|
||||
---
|
||||
|
||||
## Background
|
||||
|
||||
A read-only investigation of `crates/tui` found that the TUI crate's flat module list is not only cosmetic: `main.rs` has accumulated entrypoint, CLI parsing, mode dispatch, terminal setup, Pod connection, single-Pod event loop, key/mouse handling, and tests.
|
||||
|
||||
This ticket is the first, lowest-risk cleanup step: move command-line parsing types/functions/tests out of `main.rs` so `main.rs` starts becoming a thin entrypoint without changing runtime behavior.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Extract the TUI CLI parsing code from `crates/tui/src/main.rs` into a focused module, likely `crates/tui/src/cli.rs`.
|
||||
- Move the related parse tests with the parsing implementation.
|
||||
- Keep external CLI behavior unchanged, including:
|
||||
- `insomnia pod ...` runtime dispatch;
|
||||
- `--pod`, `--session`, `-r`, `--multi`, profile/manifest-related arguments;
|
||||
- memory lint and other headless subcommands.
|
||||
- Keep this ticket to mechanical extraction plus names needed for clarity; do not reorganize the broader TUI module tree.
|
||||
- Do not rename the `tui` crate/package.
|
||||
|
||||
## Non-goals
|
||||
|
||||
- Moving terminal runtime/event-loop code.
|
||||
- Moving `ui::Mode` / view state.
|
||||
- Reworking CLI UX or flag semantics.
|
||||
- Introducing compatibility aliases for removed commands.
|
||||
|
||||
## Acceptance criteria
|
||||
|
||||
- `main.rs` no longer owns the core CLI parse type/function/test definitions.
|
||||
- `main.rs` uses the extracted CLI module for dispatch.
|
||||
- Behavior remains unchanged for normal TUI launch, Pod runtime launch, restore/attach options, multi-Pod launch, and memory lint.
|
||||
- Focused CLI parser tests pass.
|
||||
- `cargo fmt --check`, relevant `cargo test -p tui`, `cargo check -p tui`, `./tickets.sh doctor`, and `git diff --check` pass.
|
||||
@@ -0,0 +1,19 @@
|
||||
This ticket is completed/superseded by `insomnia-crate-cli-owner`.
|
||||
|
||||
The original goal was to remove CLI parsing from `crates/tui/src/main.rs` so the TUI crate would stop owning top-level product CLI parsing. The later `insomnia-crate-cli-owner` implementation went further:
|
||||
|
||||
- the product binary moved from package `tui` to package `insomnia`;
|
||||
- top-level CLI parsing and dispatch now live in `crates/insomnia/src/main.rs`;
|
||||
- `tui` is now a library implementation crate with no product `main.rs`;
|
||||
- `insomnia pod ...` and `insomnia memory lint ...` are routed by the `insomnia` crate;
|
||||
- normal TUI launch is delegated to `tui::launch(...)`.
|
||||
|
||||
Because the TUI crate no longer owns the product entrypoint or CLI parser, there is no remaining `tui/src/main.rs` CLI parsing extraction to implement under this ticket. Further CLI parser cleanup, if desired, belongs to the `insomnia` crate, not this TUI cleanup ticket.
|
||||
|
||||
Validation evidence from `insomnia-crate-cli-owner` closure:
|
||||
- `cargo test -p insomnia`
|
||||
- CLI smoke for `--help`, `pod --help`, `memory lint --help`, invalid `--session`, and resume/Pod selection conflicts
|
||||
- `cargo check -p client -p pod -p tui -p insomnia`
|
||||
- `nix build .#insomnia`
|
||||
- `./tickets.sh doctor`
|
||||
- `git diff --check`
|
||||
@@ -0,0 +1,34 @@
|
||||
<!-- event: create author: tickets.sh at: 2026-05-31T07:42:58Z -->
|
||||
|
||||
## Created
|
||||
|
||||
Created by tickets.sh create.
|
||||
|
||||
---
|
||||
|
||||
<!-- event: close author: hare at: 2026-05-31T13:38:30Z status: closed -->
|
||||
|
||||
## Closed
|
||||
|
||||
This ticket is completed/superseded by `insomnia-crate-cli-owner`.
|
||||
|
||||
The original goal was to remove CLI parsing from `crates/tui/src/main.rs` so the TUI crate would stop owning top-level product CLI parsing. The later `insomnia-crate-cli-owner` implementation went further:
|
||||
|
||||
- the product binary moved from package `tui` to package `insomnia`;
|
||||
- top-level CLI parsing and dispatch now live in `crates/insomnia/src/main.rs`;
|
||||
- `tui` is now a library implementation crate with no product `main.rs`;
|
||||
- `insomnia pod ...` and `insomnia memory lint ...` are routed by the `insomnia` crate;
|
||||
- normal TUI launch is delegated to `tui::launch(...)`.
|
||||
|
||||
Because the TUI crate no longer owns the product entrypoint or CLI parser, there is no remaining `tui/src/main.rs` CLI parsing extraction to implement under this ticket. Further CLI parser cleanup, if desired, belongs to the `insomnia` crate, not this TUI cleanup ticket.
|
||||
|
||||
Validation evidence from `insomnia-crate-cli-owner` closure:
|
||||
- `cargo test -p insomnia`
|
||||
- CLI smoke for `--help`, `pod --help`, `memory lint --help`, invalid `--session`, and resume/Pod selection conflicts
|
||||
- `cargo check -p client -p pod -p tui -p insomnia`
|
||||
- `nix build .#insomnia`
|
||||
- `./tickets.sh doctor`
|
||||
- `git diff --check`
|
||||
|
||||
|
||||
---
|
||||
Reference in New Issue
Block a user