Skip to content

fix(issue-161): consolidate test harnesses and prune media#195

Merged
johannesjo merged 8 commits into
johannesjo:mainfrom
ASRagab:fix/issue-161-test-harness-media-hygiene
Jul 2, 2026
Merged

fix(issue-161): consolidate test harnesses and prune media#195
johannesjo merged 8 commits into
johannesjo:mainfrom
ASRagab:fix/issue-161-test-harness-media-hygiene

Conversation

@ASRagab

@ASRagab ASRagab commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #161.

  • Extract shared Vitest coordinator harness and migrate coordinator unit/sequence tests.
  • Add shared store test helper and migrate duplicated mocked-core store tests.
  • Prune high-confidence unreferenced raw/video screen alternates while keeping all README media refs.
  • Move routine renderer steps receive logging off console.warn.
  • Keep local openspec/ planning artifacts out of the remote branch via .gitignore.

Finding coverage

  • Finding 36: addressed via electron/mcp/coordinator-test-harness.ts and migrated coordinator tests.
  • Finding 37: addressed via src/store/test-helpers.ts and migrated high-duplication store tests.
  • Finding 40: addressed by removing unreferenced raw/video alternates; README media refs still exist.
  • Finding 42: main-process watcher warning spam was already resolved by fix: replace noisy console.warn with structured logger in steps.ts #186; this PR removes the remaining routine renderer [steps.recv] warning.

Deferred media variants

Kept ambiguous unreferenced PNG screenshots for maintainer confirmation/follow-up:

  • screens/diff-dialog-plain.png
  • screens/islands-focus-view-l.png
  • screens/islands-focus-view-l2.png
  • screens/islands-plan-review.png
  • screens/minimal-focus-view.png
  • screens/minimal-overview.png
  • screens/parallel-tasks.png
  • screens/status-dot-tooltip-example.png
  • screens/workbench-focus-view.png
  • screens/workbench-overview.png

Validation

  • openspec validate address-quality-audit-cleanup --strict (local only; openspec/ ignored in PR)
  • npm test -- electron/mcp/coordinator-sequence.test.ts electron/mcp/coordinator.test.ts → 272 tests passed
  • npm test -- electron/mcp/prompt-detect.test.ts electron/mcp/server.test.ts electron/remote/coordinator-scoping.test.ts → 141 tests passed
  • npm test -- src/store/ui.test.ts src/store/appearance-mode.test.ts src/store/focus.test.ts src/store/navigation.test.ts src/store/agents.test.ts src/store/notifications.test.ts src/store/taskStatus.test.ts src/store/tasks.test.ts src/store/sidebar-order.test.ts → 208 tests passed
  • npm run typecheck
  • README/tracked markdown media path check → 7 refs verified, missing refs 0
  • routine steps console.warn check → no [steps.recv] warning and no routine electron/ipc/steps.ts warning
  • du -sh screens → 18M after cleanup (54M before)
  • npm run check
  • pre-push hook ran full npm test → 76 files passed, 2 skipped; 1467 tests passed, 24 skipped

@johannesjo

Copy link
Copy Markdown
Owner

Review — quality-cleanup PR (issue #161)

Reviewed the code + verified the risky bits independently (media reference safety, the one production line, and the store/coordinator mock migrations). Net: the three code changes are solid and low-risk; the main thing worth a decision is the openspec/ artifacts.

What I verified ✅

  • Media pruning is safe. git grep for all 5 deleted files (demo.mov, demo.gif, longer-video.mp4, longer-video.mkv, best-video.mkv) across all tracked files returns zero matches, and every one of the 7 screens/ paths still referenced by README.md resolves to a surviving file. Nice touch keeping the .gif siblings while dropping the unreferenced .mp4/.mkv raws.
  • src/App.tsx log change is correct. log.debug('steps', 'recv', {…}) matches debug(category, msg, ctx?) in src/lib/log.ts, log is imported, and it's the only [steps.recv] call — demoting it from warndebug is exactly finding feat(terminal): paste clipboard images as temp file paths #42's intent.
  • Store + coordinator harness mechanics are sound. No broken reset/impl wiring, no Proxy-invariant violations, and createMockStoreHarness actually handles more setStore/produce forms than some of the per-file mocks it replaces. No test ends up asserting less than before.

One thing to decide 🧭

Should the openspec/changes/address-quality-audit-cleanup/ docs (5 files, ~349 lines) be in this PR? The base branch has no openspec/ directory and no tooling/package.json/.gitignore reference to it, so this introduces a brand-new top-level convention. The content also reads as author-workflow rather than durable project docs — e.g. tasks.md tracks the PR process itself ([x] Push the branch to ASRagab/parallel-code, [x] Rebase on upstream/main) and design.md references transient fork/PR state (#193, #179). The three code changes stand on their own without it. If OpenSpec isn't a convention you're adopting repo-wide, I'd suggest dropping this directory from the PR (or splitting it out).

Minor notes (non-blocking)

  • coordinator-sequence.test.ts prompt-detect mock is silently upgraded. It previously had a simpler mock (identity stripAnsi, -only detection); consolidation swaps in the fuller version. Behavior-preserving for the current plain-text test inputs, but it's a real semantic change to that file — worth a line in the PR description.
  • The consolidated prompt-detect mock re-implements production regexes (approximately — full-tail vs blockerTail, reordered checks). Pre-existing, not introduced here, and the PR reduces the copies. Since the goal is quality cleanup, importing the real (pure, side-effect-free) prompt-detect module would remove the copied-regex drift risk entirely — good follow-up.
  • setPath in test-helpers.ts no longer auto-creates missing intermediate path segments (the old per-file setStorePath in appearance-mode/focus/ui did). Confirmed inert — every migrated test pre-populates its nested containers, so results are identical, and the new behavior is closer to real Solid semantics anyway. A one-line comment noting the intentional divergence would help future readers.

Verdict

Code is effectively merge-ready. Recommend resolving the openspec/ question first, and letting the pending quality CI check go green. Nice reduction in duplicated test scaffolding (~380 lines out of the two coordinator tests) and ~37 MB off the checkout.

@ASRagab

ASRagab commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Ignored openspec

@johannesjo

Copy link
Copy Markdown
Owner

Thank you very much! <3

@johannesjo johannesjo merged commit 4619ce8 into johannesjo:main Jul 2, 2026
2 checks passed
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.

[Quality audit] Consolidate test harnesses and repository hygiene

2 participants