修复 M1D-1 带进的 eslint 红:import 排序与 hook 依赖判据
Project CI / Repository checks (pull_request) Successful in 1m28s
Project CI / Frontend tests (pull_request) Successful in 3m45s
Project CI / Native shell tests (pull_request) Failing after 11m46s
Project CI / Backend tests (pull_request) Successful in 4m25s

CI task 3777 的 Repository checks 停在 lint:eslint,前面的 encoding / git-hooks /
rustfmt / spacetime schema / production-ops / preview-deployer / maintenance-page
全绿。三条问题全在 0052a80da 自己动的两个前端文件里。

- simple-import-sort:新加的 PlanGddDecisionAction / PlanGddStateViewV1 插在了
  PendingCommand 前面(ASCII 序 Pending < PlanGdd),ProjectWorkspaceChatPane 里
  GddApprovalCard 也落在同目录组末尾。autofix 修正

- react-hooks/exhaustive-deps 是 warning,但 lint 脚本带 --max-warnings 0,一样退 1。
  这条不能靠补依赖解决:该 effect 的依赖只挖 phase/status/updatedAt 三个标量,正是
  为了避开轮询每轮新建对象的身份变化;把 projectSupervisorRuntime 本体写进依赖会让
  每个 tick 都触发一次 hydrate。改的是判据侧——存在性从整个对象换成必选字段
  status(AgentRuntimeState.status: string 必选,为 undefined 当且仅当 runtime 为
  null),语义等价且不再引用裸对象

本地 npm run lint:eslint(全仓,--max-warnings 0)、npm run typecheck、
npm run check:encoding 均通过。typecheck 是 CI 未走到的下一步。

另记一笔:.husky/pre-commit -> lint-staged -> scripts/lint-staged-eslint.mjs 会拦这
两类(自动修 import,且 errorCount 或 warningCount 非零即置退出码),本 worktree 的
core.hooksPath 也确实指向 .husky/_。这三条能进库说明 0052a80da 绕过了钩子。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-18 08:08:57 +00:00
parent 0052a80dad
commit 5b11a05303
2 changed files with 13 additions and 6 deletions
+10 -3
View File
@@ -81,10 +81,10 @@ import type {
MemoryScope,
MemoryWriteMode,
OpenCanvasProjectResult,
PlanGddDecisionAction,
PlanGddStateViewV1,
PendingCommand,
PendingUiConfirmation,
PlanGddDecisionAction,
PlanGddStateViewV1,
ProjectPermissionPolicy,
ProjectPermissionPolicyView,
SyncCanvasProjectAssetsResult,
@@ -721,7 +721,14 @@ export function App({
}, [hydratePlanGddState, localProject?.projectPath]);
useEffect(() => {
if (!localProject?.projectPath || !projectSupervisorRuntime) {
// 存在性判据故意走 `status`(必选字段,为 `undefined` 当且仅当 runtime 为 null)而不是整个
// 对象:依赖里只挖 phase/status/updatedAt 三个标量,是为了只在监工状态真的动了时
// 重灌。把 `projectSupervisorRuntime` 本体写进依赖会让每一轮轮询新建的对象身份都触发一次
// hydrate,白烧 IPC。
if (
!localProject?.projectPath ||
projectSupervisorRuntime?.status === undefined
) {
return;
}
void hydratePlanGddState(localProject.projectPath);
@@ -23,10 +23,10 @@ import type {
LocalProjectCheckpointSummary,
LocalProjectFileEntry,
MemoryScope,
PlanGddDecisionAction,
PlanGddStateViewV1,
PendingCommand,
PendingUiConfirmation,
PlanGddDecisionAction,
PlanGddStateViewV1,
} from '../../app/types';
import type { ProjectAgentResultSummary } from '../../view/project-development';
import {
@@ -47,12 +47,12 @@ import {
taskGroupLabels,
taskStatusLabels,
} from '../project-summary/projectSummary';
import { GddApprovalCard } from './GddApprovalCard';
import {
pendingCommandDetail,
pendingCommandTitle,
} from './pendingCommandPresentation';
import { resolvePendingCommandProjectPath } from './projectCommandPolicy';
import { GddApprovalCard } from './GddApprovalCard';
type ProjectWorkspaceChatPaneProps = {
agentRunStatus: string;