[Quality audit] Fix correctness bug and red repository gates

Aperta
#157 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
electron, github-actions, node.js, typescript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
TypeScript
Stelle
1k
Fork
144
Merge medio
4g 19h
PR unite (30g)
28

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di johannesjo/parallel-code

Tutte le issue di johannesjo/parallel-code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.