[Quality audit] Fix correctness bug and red repository gates

未关闭
#157 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
20/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
electron, github-actions, node.js, typescript

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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
主要语言
TypeScript
星标
1k
派生
144
平均合并
4 天 19 小时
30 天内合并 PR
28

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

johannesjo/parallel-code 的其他 Issue

查看 johannesjo/parallel-code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。