From 80734d9a9816b83e491f2be5d3654fb1d1b6c1d7 Mon Sep 17 00:00:00 2001 From: Jason Mulligan Date: Mon, 10 Aug 2026 01:21:09 -0400 Subject: [PATCH] chore: add OpenSpec for TUI redundant re-export cleanup - Create proposal, design, tasks, and spec artifacts - Plan removal of hooks.js re-exports and components.js --- .../.openspec.yaml | 2 ++ .../remove-tui-redundant-reexports/design.md | 29 +++++++++++++++++ .../proposal.md | 29 +++++++++++++++++ .../specs/tui-cleanup/spec.md | 31 +++++++++++++++++++ .../remove-tui-redundant-reexports/tasks.md | 28 +++++++++++++++++ 5 files changed, 119 insertions(+) create mode 100644 openspec/changes/remove-tui-redundant-reexports/.openspec.yaml create mode 100644 openspec/changes/remove-tui-redundant-reexports/design.md create mode 100644 openspec/changes/remove-tui-redundant-reexports/proposal.md create mode 100644 openspec/changes/remove-tui-redundant-reexports/specs/tui-cleanup/spec.md create mode 100644 openspec/changes/remove-tui-redundant-reexports/tasks.md diff --git a/openspec/changes/remove-tui-redundant-reexports/.openspec.yaml b/openspec/changes/remove-tui-redundant-reexports/.openspec.yaml new file mode 100644 index 00000000..d7bc0110 --- /dev/null +++ b/openspec/changes/remove-tui-redundant-reexports/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-08-10 diff --git a/openspec/changes/remove-tui-redundant-reexports/design.md b/openspec/changes/remove-tui-redundant-reexports/design.md new file mode 100644 index 00000000..3bd4f095 --- /dev/null +++ b/openspec/changes/remove-tui-redundant-reexports/design.md @@ -0,0 +1,29 @@ +## Context + +The `src/tui` module has two redundancy issues: +1. `hooks.js` exports `nextPanel` and `prevPanel` which are just pass-through re-exports from `panels.js` +2. `components.js` re-exports 7 components that are also re-exported via `index.js` + +## Goals / Non-Goals + +**Goals:** +- Remove redundant re-exports from hooks.js +- Remove or merge components.js +- Update all consumer import paths + +**Non-Goals:** +- Any other TUI restructuring +- Behavioral changes + +## Decisions + +1. **Remove from hooks.js:** Since `nextPanel` and `prevPanel` add no logic, consumers should import directly from `panels.js`. + +2. **Audit components.js:** Before removing, grep the entire codebase for imports of `components.js`. If unused, delete it. If used, merge its exports into `index.js`. + +3. **No new barrel file:** Don't create a new intermediate barrel — consumers should import from the source file directly. + +## Risks / Trade-offs + +- **Consumer breakage:** Any file importing from `hooks.js` or `components.js` needs to update its import path. Mitigation: grep the entire codebase before making changes. +- **components.js might be used externally:** If external packages import from `components.js`, removal would be a breaking change. Mitigation: grep the entire codebase including node_modules references. diff --git a/openspec/changes/remove-tui-redundant-reexports/proposal.md b/openspec/changes/remove-tui-redundant-reexports/proposal.md new file mode 100644 index 00000000..4c183e4d --- /dev/null +++ b/openspec/changes/remove-tui-redundant-reexports/proposal.md @@ -0,0 +1,29 @@ +## Why + +The `src/tui` module contains redundant re-exports that add no value: `hooks.js` re-exports `nextPanel` and `prevPanel` from `panels.js` with no added logic, and `components.js` re-exports 7 components that are also re-exported via `index.js`. These dead re-exports increase cognitive load and maintenance burden for no benefit. + +## What Changes + +- Remove `nextPanel` and `prevPanel` from `src/tui/hooks.js` +- Update consumers to import from `panels.js` directly +- Check if `src/tui/components.js` is imported anywhere; remove or merge into `index.js` + +## Capabilities + +### New Capabilities +- None + +### Modified Capabilities +- None — structural cleanup with no spec-level behavior changes + +## Impact + +- Affected code: `src/tui/hooks.js`, `src/tui/components.js`, `src/tui/index.js`, any file importing from hooks.js or components.js +- No API changes — function names preserved, just import paths change +- No dependency changes + +## Non-goals + +- Renaming any TUI modules +- Changing TUI behavior or component logic +- Restructuring other directories diff --git a/openspec/changes/remove-tui-redundant-reexports/specs/tui-cleanup/spec.md b/openspec/changes/remove-tui-redundant-reexports/specs/tui-cleanup/spec.md new file mode 100644 index 00000000..9b01620e --- /dev/null +++ b/openspec/changes/remove-tui-redundant-reexports/specs/tui-cleanup/spec.md @@ -0,0 +1,31 @@ +## ADDED Requirement: hooks.js has no redundant re-exports + +The system SHALL remove the `nextPanel` and `prevPanel` functions from `src/tui/hooks.js` since they are pass-through re-exports from `panels.js` with no added logic. + +### Requirement: Consumers import from panels.js + +The system SHALL update all import paths that reference `nextPanel` or `prevPanel` from `hooks.js` to import from `panels.js` directly. + +#### Scenario: No broken imports +- **WHEN** the application loads the TUI module +- **THEN** no import errors occur + +#### Scenario: No remaining stale imports +- **WHEN** searching for imports of `nextPanel` or `prevPanel` from `hooks.js` +- **THEN** no such imports exist + +### Requirement: components.js removed or merged + +The system SHALL either remove `src/tui/components.js` (if unused) or merge its exports into `src/tui/index.js` (if used). + +#### Scenario: components.js is removed +- **WHEN** `components.js` is not imported anywhere in the codebase +- **THEN** the file is deleted + +#### Scenario: components.js is merged +- **WHEN** `components.js` is imported by other files +- **THEN** its exports are moved to `index.js` and `components.js` is deleted + +#### Scenario: No broken imports after cleanup +- **WHEN** the application loads the TUI module +- **THEN** no import errors occur diff --git a/openspec/changes/remove-tui-redundant-reexports/tasks.md b/openspec/changes/remove-tui-redundant-reexports/tasks.md new file mode 100644 index 00000000..9f5f6706 --- /dev/null +++ b/openspec/changes/remove-tui-redundant-reexports/tasks.md @@ -0,0 +1,28 @@ +## 1. Remove redundant exports from hooks.js + +- [ ] 1.1 Remove `nextPanel` and `prevPanel` exports from `src/tui/hooks.js` +- [ ] 1.2 Verify hooks.js still exports all other necessary functions + +## 2. Update hooks.js consumers + +- [ ] 2.1 Grep the codebase for imports of `nextPanel` or `prevPanel` from `hooks.js` +- [ ] 2.2 Update import paths to use `panels.js` instead +- [ ] 2.3 Verify no remaining imports of these names from `hooks.js` + +## 3. Audit components.js + +- [ ] 3.1 Grep the entire codebase for imports of `components.js` from the tui module +- [ ] 3.2 If unused: delete `src/tui/components.js` +- [ ] 3.3 If used: merge its exports into `src/tui/index.js` and delete `components.js` +- [ ] 3.4 Update any consumers of components.js to use index.js instead + +## 4. Verify no broken imports + +- [ ] 4.1 Grep for any remaining imports of `hooks.js` that reference `nextPanel` or `prevPanel` +- [ ] 4.2 Grep for any remaining imports of `components.js` +- [ ] 4.3 Confirm zero stale imports remain + +## 5. Test + +- [ ] 5.1 Run `npm test` to verify all tests pass +- [ ] 5.2 Run `npm start` with timeout to verify application starts