From 3472c021def90134cf6aabdf20fedaa336b0e1ff Mon Sep 17 00:00:00 2001 From: d-robotics Date: Thu, 15 Oct 2026 20:26:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Normalize=20existing=20formattin?= =?UTF-8?q?g=20for=20PR=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .scratch/pr-integration-20261015/spec.md | 11 ++++++++ internal/domain/review_decision.go | 28 ++++++++++----------- internal/domain/review_draft.go | 30 +++++++++++----------- src/components/RerunArtifactPreview.tsx | 4 ++- src/hooks/useAnnotationAutosave.ts | 7 +++++- src/hooks/useAnnotationWorkSession.ts | 3 ++- src/hooks/useReworkReviewEmphasis.ts | 4 +-- src/pages/ObjectSync.tsx | 10 +++++++- src/pages/WorkflowEditor.tsx | 8 +++++- src/types.ts | 32 +++++++++++++++++++++--- 10 files changed, 97 insertions(+), 40 deletions(-) diff --git a/.scratch/pr-integration-20261015/spec.md b/.scratch/pr-integration-20261015/spec.md index 97776e30..65d7b515 100644 --- a/.scratch/pr-integration-20261015/spec.md +++ b/.scratch/pr-integration-20261015/spec.md @@ -45,3 +45,14 @@ claim-count samples4.568/5.202/7.515s succeed but remain slow; list3.484s, owned tasks210ms. Production UI, write/retry and playback acceptance are still unverified. This integrated PR head has not been deployed. No production writes, old-PR closure or merge is included in submission. + +## Final CI preparation + +Normalized the7 pre-existing frontend files and2 Go files in a separate follow-up +commit. Each source exactly matches applying the existing formatter to the prior +committed source; no runtime logic was edited. Complete npm run lint and +npm run format:check now pass. Final frontend baseline gate still reports only13 +known failures; the70-known-failure Go gate passed on the integrated runtime +before this formatting-only follow-up. Both Web and Go builds passed. Original +local API/processor were restored after the Go gate. The deployed2071b0a2 worktree +was not modified; the PR integration worktree and personal branch are isolated. diff --git a/internal/domain/review_decision.go b/internal/domain/review_decision.go index 83488a75..7a53d558 100644 --- a/internal/domain/review_decision.go +++ b/internal/domain/review_decision.go @@ -38,18 +38,18 @@ type ReviewOperation struct { } type ReviewDecisionEffect struct { - Draft *ReviewDraft `bson:"draft,omitempty"` - ReworkBaseline *ReworkBaselineRecord `bson:"reworkBaseline,omitempty"` - Review *AnnotationReviewRecord `bson:"review,omitempty"` - BeforeTask *AnnotationTaskRecord `bson:"beforeTask,omitempty"` - Task *AnnotationTaskRecord `bson:"task,omitempty"` - BeforeItem *HumanItemRecord `bson:"beforeItem,omitempty"` - Item *HumanItemRecord `bson:"item,omitempty"` - Attempt *HumanStageAttemptRecord `bson:"attempt,omitempty"` - Reject *HumanRejectRecord `bson:"reject,omitempty"` - Event *HumanEventRecord `bson:"event,omitempty"` - Worklog *AnnotationWorklogEventRecord `bson:"worklog,omitempty"` - Batch *HumanBatchRecord `bson:"batch,omitempty"` - FlushBatchID string `bson:"flushBatchId,omitempty"` - FlushForce bool `bson:"flushForce,omitempty"` + Draft *ReviewDraft `bson:"draft,omitempty"` + ReworkBaseline *ReworkBaselineRecord `bson:"reworkBaseline,omitempty"` + Review *AnnotationReviewRecord `bson:"review,omitempty"` + BeforeTask *AnnotationTaskRecord `bson:"beforeTask,omitempty"` + Task *AnnotationTaskRecord `bson:"task,omitempty"` + BeforeItem *HumanItemRecord `bson:"beforeItem,omitempty"` + Item *HumanItemRecord `bson:"item,omitempty"` + Attempt *HumanStageAttemptRecord `bson:"attempt,omitempty"` + Reject *HumanRejectRecord `bson:"reject,omitempty"` + Event *HumanEventRecord `bson:"event,omitempty"` + Worklog *AnnotationWorklogEventRecord `bson:"worklog,omitempty"` + Batch *HumanBatchRecord `bson:"batch,omitempty"` + FlushBatchID string `bson:"flushBatchId,omitempty"` + FlushForce bool `bson:"flushForce,omitempty"` } diff --git a/internal/domain/review_draft.go b/internal/domain/review_draft.go index ed27ac6d..40982e94 100644 --- a/internal/domain/review_draft.go +++ b/internal/domain/review_draft.go @@ -25,21 +25,21 @@ type ReviewProblem struct { ViewAnchor *ReviewViewAnchor `json:"viewAnchor,omitempty" bson:"viewAnchor,omitempty"` } type ReviewDraft struct { - ModelVersion int `json:"modelVersion,omitempty" bson:"modelVersion,omitempty"` - LegacyBackupID string `json:"legacyBackupId,omitempty" bson:"legacyBackupId,omitempty"` - ID string `json:"-" bson:"_id"` - OrganizationID string `json:"-" bson:"organizationId"` - ProjectID string `json:"-" bson:"projectId"` - UserID string `json:"-" bson:"userId"` - ItemID string `json:"itemId" bson:"itemId"` - StageID string `json:"stageId" bson:"stageId"` - ReviewRound int `json:"reviewRound" bson:"reviewRound"` - ResultVersion string `json:"resultVersion" bson:"resultVersion"` - Version int `json:"version" bson:"version"` - Problems []ReviewProblem `json:"problems" bson:"problems"` + ModelVersion int `json:"modelVersion,omitempty" bson:"modelVersion,omitempty"` + LegacyBackupID string `json:"legacyBackupId,omitempty" bson:"legacyBackupId,omitempty"` + ID string `json:"-" bson:"_id"` + OrganizationID string `json:"-" bson:"organizationId"` + ProjectID string `json:"-" bson:"projectId"` + UserID string `json:"-" bson:"userId"` + ItemID string `json:"itemId" bson:"itemId"` + StageID string `json:"stageId" bson:"stageId"` + ReviewRound int `json:"reviewRound" bson:"reviewRound"` + ResultVersion string `json:"resultVersion" bson:"resultVersion"` + Version int `json:"version" bson:"version"` + Problems []ReviewProblem `json:"problems" bson:"problems"` // D7 复审核对结论(B02):仅在有退回基线的轮次非空;随正式决定冻结后不可撤销。 Confirmations []ReviewConfirmation `json:"confirmations,omitempty" bson:"confirmations,omitempty"` - LastOperationID string `json:"operationId,omitempty" bson:"lastOperationId"` - LastOperationDigest string `json:"-" bson:"lastOperationDigest"` - UpdatedAt string `json:"updatedAt" bson:"updatedAt"` + LastOperationID string `json:"operationId,omitempty" bson:"lastOperationId"` + LastOperationDigest string `json:"-" bson:"lastOperationDigest"` + UpdatedAt string `json:"updatedAt" bson:"updatedAt"` } diff --git a/src/components/RerunArtifactPreview.tsx b/src/components/RerunArtifactPreview.tsx index a12aed04..af0d5736 100644 --- a/src/components/RerunArtifactPreview.tsx +++ b/src/components/RerunArtifactPreview.tsx @@ -3,7 +3,9 @@ import { useEffect, useState } from "react"; import { Box, CheckCircle2, Download, Loader2, TriangleAlert } from "lucide-react"; type ValidationState = - { status: "loading" } | { status: "ready"; bytes: number } | { status: "error"; message: string }; + | { status: "loading" } + | { status: "ready"; bytes: number } + | { status: "error"; message: string }; export default function RerunArtifactPreview({ src, name }: { src: string; name: string }) { const [state, setState] = useState({ status: "loading" }); diff --git a/src/hooks/useAnnotationAutosave.ts b/src/hooks/useAnnotationAutosave.ts index 638eb484..e7d613fa 100644 --- a/src/hooks/useAnnotationAutosave.ts +++ b/src/hooks/useAnnotationAutosave.ts @@ -36,7 +36,12 @@ export type AnnotationAutosaveWorkspace = { }; export type AnnotationAutosaveFlushReason = - "idle" | "slice-switch" | "hidden" | "pagehide" | "conflict-overwrite" | "slice-edit-close"; + | "idle" + | "slice-switch" + | "hidden" + | "pagehide" + | "conflict-overwrite" + | "slice-edit-close"; export type UseAnnotationAutosaveArgs = { enabled: boolean; diff --git a/src/hooks/useAnnotationWorkSession.ts b/src/hooks/useAnnotationWorkSession.ts index fbfd0e41..bd9cf73f 100644 --- a/src/hooks/useAnnotationWorkSession.ts +++ b/src/hooks/useAnnotationWorkSession.ts @@ -6,7 +6,8 @@ export type AnnotationWorkSession = { }; type AcquisitionResult = - { status: "acquired"; session: AnnotationWorkSession } | { status: "unsupported" | "blocked" | "error" | "stale" }; + | { status: "acquired"; session: AnnotationWorkSession } + | { status: "unsupported" | "blocked" | "error" | "stale" }; type OwnedSession = AnnotationWorkSession & { active: boolean; diff --git a/src/hooks/useReworkReviewEmphasis.ts b/src/hooks/useReworkReviewEmphasis.ts index 23b948ef..2ccac0ff 100644 --- a/src/hooks/useReworkReviewEmphasis.ts +++ b/src/hooks/useReworkReviewEmphasis.ts @@ -54,8 +54,8 @@ export function useReworkReviewEmphasis(itemId: string, round: number, taskId: s slices: (sliceRevision?.segments as SliceSegment[] | undefined) || [], actions: (annotationRevision?.segments as - Array<{ id: string; description?: string; start: number; end: number; status?: string }> | undefined) || - [], + | Array<{ id: string; description?: string; start: number; end: number; status?: string }> + | undefined) || [], structureChangeSummary: sliceRevision?.structureChangeSummary, }); } else { diff --git a/src/pages/ObjectSync.tsx b/src/pages/ObjectSync.tsx index 486e2169..5b18ce4f 100644 --- a/src/pages/ObjectSync.tsx +++ b/src/pages/ObjectSync.tsx @@ -45,7 +45,15 @@ import type { StorageConnection, User } from "../types"; import { useSearchParams } from "react-router-dom"; type ViewKey = - "overview" | "access" | "spaces" | "devices" | "sessions" | "conflicts" | "releases" | "audit" | "updates"; + | "overview" + | "access" + | "spaces" + | "devices" + | "sessions" + | "conflicts" + | "releases" + | "audit" + | "updates"; const capabilityLabels: Record = { unverified: { label: "未探测", className: "text-slate-300 bg-slate-500/10 border-slate-500/20" }, diff --git a/src/pages/WorkflowEditor.tsx b/src/pages/WorkflowEditor.tsx index d0abe682..ef4df9fd 100644 --- a/src/pages/WorkflowEditor.tsx +++ b/src/pages/WorkflowEditor.tsx @@ -200,7 +200,13 @@ import { operatorsApi } from "../services/api/operators"; import { usersApi } from "../services/api/users"; type OperatorExecutionState = - "idle" | "running" | "cancelled" | "waiting_for_audit" | "waiting_for_human" | "completed" | "failed"; + | "idle" + | "running" + | "cancelled" + | "waiting_for_audit" + | "waiting_for_human" + | "completed" + | "failed"; type EditorSaveState = "idle" | "dirty" | "saving" | "saved" | "error"; type EditorDraftRecovery = { diff --git a/src/types.ts b/src/types.ts index 033ad0b1..0044fb37 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1113,7 +1113,12 @@ export type CaptureRecordStatus = | "discarded"; export type CaptureActionType = - "reprocess_requested" | "reprocess_queued" | "reprocess_failed" | "cancelled" | "discarded" | "restored"; + | "reprocess_requested" + | "reprocess_queued" + | "reprocess_failed" + | "cancelled" + | "discarded" + | "restored"; export interface CaptureActionRecord { id: string; @@ -1355,7 +1360,13 @@ export interface SamplingTask { } export type NodeExecutionStatus = - "queued" | "running" | "cancelled" | "waiting_for_audit" | "waiting_for_human" | "completed" | "failed"; + | "queued" + | "running" + | "cancelled" + | "waiting_for_audit" + | "waiting_for_human" + | "completed" + | "failed"; export interface NodeExecution { nodeId: string; @@ -1806,7 +1817,12 @@ export interface AuditTask { export type AnnotationAssignmentRole = "annotator" | "quality_reviewer" | "acceptance_reviewer" | "vendor_manager"; export type AnnotationTaskStatus = - "pending_annotation" | "pending_quality" | "pending_acceptance" | "rework" | "accepted" | "rejected"; + | "pending_annotation" + | "pending_quality" + | "pending_acceptance" + | "rework" + | "accepted" + | "rejected"; export type ProjectMemberRole = "annotator" | "quality_reviewer" | "acceptance_reviewer"; @@ -2156,7 +2172,15 @@ export interface AnnotationWorkloadSummary { } export type HumanItemStatus = - "ready" | "claimed" | "in_progress" | "submitted" | "rework" | "escalated" | "accepted" | "rejected" | "cancelled"; + | "ready" + | "claimed" + | "in_progress" + | "submitted" + | "rework" + | "escalated" + | "accepted" + | "rejected" + | "cancelled"; export interface HumanTaskDisplayContext { projectName?: string;