Skip to content

fix: clear all 7 tracked tech-debt items#31

Merged
artyomsv merged 1 commit into
masterfrom
chore/clear-tech-debt
Apr 26, 2026
Merged

fix: clear all 7 tracked tech-debt items#31
artyomsv merged 1 commit into
masterfrom
chore/clear-tech-debt

Conversation

@artyomsv

Copy link
Copy Markdown
Owner

Resolves every entry tracked under techdebt/ — one high-priority goroutine-leak, four medium correctness/perf items, and two low-priority hardening items. Code-review findings on top of the initial cleanup are folded in.

Fixed

  • daemon: Stop() now closes d.shutdown via shutdownOnce + wraps teardown in stopOnce, so idleChecker / memReport ctx-bridge / sendGhostChunked exit on every Stop path. server.Stop() runs before the final snapshot so no IPC ACK can outlive the on-disk state. (techdebt 2-2)
  • daemon: snapshot() takes one consistent SnapshotState and reuses it for both workspace.json and ghost-buffer flush via the new workspaceStateFromSnapshot helper, eliminating the off-by-one pane-count drift between the two halves. Periodic ticker still calls snapshot() directly so the safety-net write cannot be starved by sustained event traffic resetting the debounce timer. (techdebt 3-2)
  • daemon: paneSourceAdapter collapsed from 7 methods (6 PluginMu acquisitions per pane per tick) to a single Snapshot() that acquires PluginMu once with defer-Unlock for panic safety. (techdebt 3-2)

Changed

  • mcp: get_memory_report halves IPC latency by embedding the tab list directly in MemoryReportRespPayload; the bridge falls back to bare tab IDs against pre-1.10 daemons. (techdebt 3-2)
  • tui: notes-mode header gains a persistent reverse-video focus badge (INPUT / PANE) with three-tier degrade for narrow widths. Defence-in-depth against synthesised mouse-click input redirection. (techdebt 4-2)

Tests

  • New daemon unit tests: TestIsValidHexID, TestWorkspaceStateFromSnapshot, TestStop_ClosesShutdownChannel, TestStop_Idempotent.
  • New cmd/quil unit tests: TestBuildTabMemSummaries (4 cases incl. pre-1.10 daemon nil-Tabs path).
  • New TUI tests: dialog handlers (settings/confirm), notes header badge focus + narrow-width truncation.
  • New Windows-tagged PTY tests covering SetCWD/SetEnv/newWithSize/ pre-start safety/WaitExit sentinel. (techdebt 4-2)
  • New //go:build integration suite for daemon Start/Stop and IPC-driven MemoryReport round-trip + snapshot consistency.

Resolves every entry tracked under techdebt/ — one high-priority
goroutine-leak, four medium correctness/perf items, and two low-priority
hardening items. Code-review findings on top of the initial cleanup are
folded in.

Fixed
- daemon: Stop() now closes d.shutdown via shutdownOnce + wraps
  teardown in stopOnce, so idleChecker / memReport ctx-bridge /
  sendGhostChunked exit on every Stop path. server.Stop() runs
  before the final snapshot so no IPC ACK can outlive the on-disk
  state. (techdebt 2-2)
- daemon: snapshot() takes one consistent SnapshotState and reuses
  it for both workspace.json and ghost-buffer flush via the new
  workspaceStateFromSnapshot helper, eliminating the off-by-one
  pane-count drift between the two halves. Periodic ticker still
  calls snapshot() directly so the safety-net write cannot be
  starved by sustained event traffic resetting the debounce timer.
  (techdebt 3-2)
- daemon: paneSourceAdapter collapsed from 7 methods (6 PluginMu
  acquisitions per pane per tick) to a single Snapshot() that
  acquires PluginMu once with defer-Unlock for panic safety.
  (techdebt 3-2)

Changed
- mcp: get_memory_report halves IPC latency by embedding the tab
  list directly in MemoryReportRespPayload; the bridge falls back
  to bare tab IDs against pre-1.10 daemons. (techdebt 3-2)
- tui: notes-mode header gains a persistent reverse-video focus
  badge (INPUT / PANE) with three-tier degrade for narrow widths.
  Defence-in-depth against synthesised mouse-click input redirection.
  (techdebt 4-2)

Tests
- New daemon unit tests: TestIsValidHexID, TestWorkspaceStateFromSnapshot,
  TestStop_ClosesShutdownChannel, TestStop_Idempotent.
- New cmd/quil unit tests: TestBuildTabMemSummaries (4 cases incl.
  pre-1.10 daemon nil-Tabs path).
- New TUI tests: dialog handlers (settings/confirm), notes header
  badge focus + narrow-width truncation.
- New Windows-tagged PTY tests covering SetCWD/SetEnv/newWithSize/
  pre-start safety/WaitExit sentinel. (techdebt 4-2)
- New //go:build integration suite for daemon Start/Stop and
  IPC-driven MemoryReport round-trip + snapshot consistency.
@artyomsv artyomsv force-pushed the chore/clear-tech-debt branch from cc69813 to 50404b0 Compare April 26, 2026 08:30
@artyomsv artyomsv merged commit 1f1b5e3 into master Apr 26, 2026
5 checks passed
@artyomsv artyomsv deleted the chore/clear-tech-debt branch April 26, 2026 08:38
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