[Quality audit] Fix correctness bug and red repository gates

Abierto
#157 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 4 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
20/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
electron, github-actions, node.js, typescript

Línea de trabajo

Start with CODE_QUALITY_FINDINGS.md and the cited areas: electron/mcp/coordinator.ts and replay-cache.ts, the listed store modules, .github/workflows/ci.yml, and the OpenSpec custom-themes change. Run the named lint, security-rule, OpenSpec, check, and test commands to establish the failures; done means the listed fixes are addressed and every acceptance check passes.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Derived from the local audit report CODE_QUALITY_FINDINGS.md created on 2026-05-30.

Scope

This issue tracks the highest-priority correctness and quality-gate failures found during the audit.

Findings

  • Finding 1: wait_for_signal_done timeout bypasses replay cache.
    • Evidence: electron/mcp/coordinator.ts:1626-1708, especially timeout path around 1685-1699; electron/mcp/replay-cache.ts.
    • Fix direction: use one complete(result) path for timer cleanup, replay-cache write, resolver removal, active-wait handling, and promise resolution.
    • Tests: add retry-after-timeout coverage for the same requestId.
  • Finding 2: store import cycles break lint:arch.
    • Evidence: npm run lint:arch reports 7 cycles across src/store/projects.ts, tasks.ts, focus.ts, navigation.ts, persistence.ts, and terminals.ts.
    • Fix direction: extract pure selectors/helpers so store modules flow one way.
  • Finding 3: CI skips major repo gates.
    • Evidence: .github/workflows/ci.yml runs typecheck/lint/format only; Electron code is mostly compiled by npm run compile.
    • Fix direction: run npm run check and npm test in CI; add npm run check:static after current failures are fixed.
  • Finding 7: Knip reports verified dead files, exports, types, dependency, and config drift.
    • Evidence: npm run lint:dead reports stale entry points, unused files, unused exports/types, unused @types/dompurify, and unlisted binaries.
    • Fix direction: update Knip entries, remove verified dead code/dependency, and keep the gate green.
  • Finding 38: OpenSpec validation is red and completed changes remain active.
    • Evidence: npx --no-install openspec spec validate custom-themes --strict fails with requirements.4.text: Requirement must contain SHALL or MUST keyword; npx --no-install openspec change validate custom-themes --strict fails because the change has no delta specs.
    • Fix direction: fix custom-theme spec structure, add/remove the dangling change, and archive completed changes.
  • Finding 41: npm config and security-rule script are noisy/brittle.
    • Evidence: .npmrc emits npm warnings; npm run test:security-rules fails with spawnSync semgrep ENOENT when semgrep is missing.
    • Fix direction: normalize/remove .npmrc; add a friendly semgrep preflight or install semgrep in CI.

Acceptance checks

  • npm run lint:arch
  • npm run lint:dead
  • npm run test:security-rules
  • npx openspec validate --all --strict
  • npm run check
  • npm test
Lenguaje dominante
TypeScript
Estrellas
1k
Forks
144
Merge medio
4 d 19 h
PR fusionados (30 d)
28

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de johannesjo/parallel-code

Todos los issues de johannesjo/parallel-code

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.