fix: 集成返工复审、10月15日客户反馈与切片恢复及性能修复 #49

Closed
zhanghongming wants to merge 0 commits from codex/oct15-feedback-pr-20261015 into dev
Collaborator

Summary

整合返工/复审、切片编辑,以及 10 月 15 日客户反馈和线上性能修复。完整包含当前 #44、#45 的提交,并保留双方后续修复;目标为 dev,旧 PR 不自动关闭或合并。

个人任务池 → 独立加载本人任务;领取计数失败显示未知
审核意见定位 → 同时选择所属切片和对应时间
E 切片重设 → 字典/舍弃/冲突处置 → 服务端校验后保存
切片生成失败 → 明确选择保留已保存内容重试 → 持久作业与版本隔离
部署 → 处理器完整就绪 → API 更新

最近改动包括:

  • 自动保存按任务、账号和会话隔离,过期响应与旧请求收尾不能覆盖新任务;物化清理游标在分页、组织和状态之间公平推进,保留最近两代与源视频。
  • 修复返工 E→G 整片舍弃保存、切片/舍弃字典选择、边界冲突前后范围展示、未领取预览跳池及审核时间定位;领取资格继续由服务端提供。
  • 领取计数改为候选任务分组计数,再读取必要批次的精简权限元数据;列表不再扫描全部历史批次,不引入权限缓存。
  • 失败切片可显式重试服务端保留的工作区,冻结动作内容并保留 retryOf 失败证据;保留版本、归属、阶段、字典、源数据及重启恢复校验,不自动重试客户任务。
  • 补齐 #45 已合入的 #48:权限过滤后为空的分页仍保留游标,非管理员按任务池 ID 关联,避免旧返工任务被新导入窗口隐藏。冲突解决保留较新的“普通入口默认我的任务、未领取审核深链保留可领取预览”规则。

这是完整集成 PR,相对尚未合并上述工作的 dev 包含历史依赖,不能仅按最后一次计数补丁理解其范围。#44 的 P1 自动保存、P2 清理公平性修复分别保留独立提交 c09bcde0、23087c63,便于回溯。合并整合为 1660f73c;CI 所需既有格式整理单独在 3472c021,未改失败基线或依赖锁文件。

Evidence

  • Before: 本人任务等待计数;d8 线上计数 45.010 秒超时,可领取列表 7.954 秒。
    After: 已部署 2071b0a2 的真实 HTTP:本人任务 210ms;计数首轮 7.460 秒,重复三次 4.568 / 5.202 / 7.515 秒均返回 200;列表 3.484 秒,状态 62ms。计数仍慢,不能宣称性能优化全部完成;四次样本不是并发 P95。
  • Before: 稀疏候选场景扫描 1,200 个历史批次的元数据。
    After: 本地隔离 Mongo7/8 回归中候选与元数据读取各检查 1 条;Mongo8 的 12,000 条精确计数约 168ms,60 组实际 Count+List 角色/阶段用例通过。上述本地耗时不代表线上接口耗时。
  • Before: 切片生成失败后缺少保留已有动作的明确恢复入口,审核意见跳转可能选错所属切片。
    After: 本地合成失败任务通过新入口重新物化 8 个切片,31 个动作 ID/内容保留,原失败记录保留;实际本地审核跳转核对了所属切片、时间和字幕。历史数据、重启/重领、重复请求、过期作业与晚到草稿有定向回归。
  • 最终集成候选:分页/领取/持久切片恢复 Go 定向测试、12 项前端定向测试通过;npm run lint、npm run format:check、Web/Go 构建通过。完整前端门禁只有 13 个已知失败(基线 14 项),完整 Go 门禁只有 70 个已知失败;未新增失败,未修改 tests/known-failures.json。
  • 线上标注员、质检审核员、最终验收员的登录与只读列表/状态检查通过;公开健康与静态资源正常,匿名请求 401。生产 UI 刷新、写入/送检/审核、失败任务重试、视频播放及完整五角色/多供应商矩阵尚未验收。没有为本次验证改动客户任务。

当前 Fanyu API/处理器为 2071b0a2,镜像 sha256:aa98bafd954bc69284cf516ce8befc5f21f500345d952e6aefd98713add3846f;API 2/2、处理器 1/1。Worker 保持 54f4f490。本 PR 末尾的 #48 分页整合及格式提交尚未部署。本地核验说明见 .scratch/pr-integration-20261015/spec.md;业务与兼容性契约见 docs/annotation-operation-latency.md。

Merge Danger

Door: one-way

终态任务两代以前的历史物化目录清理不可通过回退代码恢复,最近两代和源视频受保护。其余代码可回退,但启用保留工作区重试后,回退旧处理器前必须先停用新重试入口,并完成或核对在途作业;不能恢复整库或覆盖客户新增数据。没有新增数据迁移、批量失败任务回填或自动重试。三个非唯一索引已按单独批准计划建立,旧索引保留;本次 PR 整合没有新增索引操作。

Blast Radius: annotation

涉及标注、返工、质检/终审任务池、异步切片恢复、Worker 历史物化清理及发布顺序。合并不构成再次部署或客户写入测试授权;上线状态仍为 deployed_pending_acceptance,计数剩余延迟继续跟踪。

## Summary 整合返工/复审、切片编辑,以及 10 月 15 日客户反馈和线上性能修复。完整包含当前 #44、#45 的提交,并保留双方后续修复;目标为 `dev`,旧 PR 不自动关闭或合并。 ```text 个人任务池 → 独立加载本人任务;领取计数失败显示未知 审核意见定位 → 同时选择所属切片和对应时间 E 切片重设 → 字典/舍弃/冲突处置 → 服务端校验后保存 切片生成失败 → 明确选择保留已保存内容重试 → 持久作业与版本隔离 部署 → 处理器完整就绪 → API 更新 ``` 最近改动包括: - 自动保存按任务、账号和会话隔离,过期响应与旧请求收尾不能覆盖新任务;物化清理游标在分页、组织和状态之间公平推进,保留最近两代与源视频。 - 修复返工 E→G 整片舍弃保存、切片/舍弃字典选择、边界冲突前后范围展示、未领取预览跳池及审核时间定位;领取资格继续由服务端提供。 - 领取计数改为候选任务分组计数,再读取必要批次的精简权限元数据;列表不再扫描全部历史批次,不引入权限缓存。 - 失败切片可显式重试服务端保留的工作区,冻结动作内容并保留 `retryOf` 失败证据;保留版本、归属、阶段、字典、源数据及重启恢复校验,不自动重试客户任务。 - 补齐 #45 已合入的 #48:权限过滤后为空的分页仍保留游标,非管理员按任务池 ID 关联,避免旧返工任务被新导入窗口隐藏。冲突解决保留较新的“普通入口默认我的任务、未领取审核深链保留可领取预览”规则。 这是完整集成 PR,相对尚未合并上述工作的 `dev` 包含历史依赖,不能仅按最后一次计数补丁理解其范围。#44 的 P1 自动保存、P2 清理公平性修复分别保留独立提交 `c09bcde0`、`23087c63`,便于回溯。合并整合为 `1660f73c`;CI 所需既有格式整理单独在 `3472c021`,未改失败基线或依赖锁文件。 ## Evidence - **Before:** 本人任务等待计数;d8 线上计数 45.010 秒超时,可领取列表 7.954 秒。 **After:** 已部署 `2071b0a2` 的真实 HTTP:本人任务 210ms;计数首轮 7.460 秒,重复三次 4.568 / 5.202 / 7.515 秒均返回 200;列表 3.484 秒,状态 62ms。计数仍慢,不能宣称性能优化全部完成;四次样本不是并发 P95。 - **Before:** 稀疏候选场景扫描 1,200 个历史批次的元数据。 **After:** 本地隔离 Mongo7/8 回归中候选与元数据读取各检查 1 条;Mongo8 的 12,000 条精确计数约 168ms,60 组实际 Count+List 角色/阶段用例通过。上述本地耗时不代表线上接口耗时。 - **Before:** 切片生成失败后缺少保留已有动作的明确恢复入口,审核意见跳转可能选错所属切片。 **After:** 本地合成失败任务通过新入口重新物化 8 个切片,31 个动作 ID/内容保留,原失败记录保留;实际本地审核跳转核对了所属切片、时间和字幕。历史数据、重启/重领、重复请求、过期作业与晚到草稿有定向回归。 - 最终集成候选:分页/领取/持久切片恢复 Go 定向测试、12 项前端定向测试通过;`npm run lint`、`npm run format:check`、Web/Go 构建通过。完整前端门禁只有 13 个已知失败(基线 14 项),完整 Go 门禁只有 70 个已知失败;未新增失败,未修改 `tests/known-failures.json`。 - 线上标注员、质检审核员、最终验收员的登录与只读列表/状态检查通过;公开健康与静态资源正常,匿名请求 401。**生产 UI 刷新、写入/送检/审核、失败任务重试、视频播放及完整五角色/多供应商矩阵尚未验收**。没有为本次验证改动客户任务。 当前 Fanyu API/处理器为 `2071b0a2`,镜像 `sha256:aa98bafd954bc69284cf516ce8befc5f21f500345d952e6aefd98713add3846f`;API 2/2、处理器 1/1。Worker 保持 `54f4f490`。**本 PR 末尾的 #48 分页整合及格式提交尚未部署**。本地核验说明见 `.scratch/pr-integration-20261015/spec.md`;业务与兼容性契约见 `docs/annotation-operation-latency.md`。 ## Merge Danger **Door:** one-way 终态任务两代以前的历史物化目录清理不可通过回退代码恢复,最近两代和源视频受保护。其余代码可回退,但启用保留工作区重试后,回退旧处理器前必须先停用新重试入口,并完成或核对在途作业;不能恢复整库或覆盖客户新增数据。没有新增数据迁移、批量失败任务回填或自动重试。三个非唯一索引已按单独批准计划建立,旧索引保留;本次 PR 整合没有新增索引操作。 **Blast Radius:** annotation 涉及标注、返工、质检/终审任务池、异步切片恢复、Worker 历史物化清理及发布顺序。合并不构成再次部署或客户写入测试授权;上线状态仍为 `deployed_pending_acceptance`,计数剩余延迟继续跟踪。
zhanghongming added 277 commits 2026-10-15 20:28:15 +08:00
Wire the existing zero-call saveCombinedDraft endpoint into the Capture
annotation workbench per .scratch/autosave-workbench spec:

- D1 triggers: slice switch (new onSelectedSliceChange workbench prop),
  20s idle debounce after the last edit, and visibilitychange(hidden)/
  pagehide immediate keepalive flush.
- D4 payload merge: unconfirmed workbench description drafts with a
  complete start<end range join segments; mid-selection drafts stay in
  the editor until their range completes.
- D2 conflict handling: 409 with a foreign server draft raises an
  explicit banner (load server draft via reload / overwrite with local
  content using the authoritative version); 409 without a server draft
  (our own formal confirmation cleared it) silently resyncs the version.
- Single in-flight PUT, formal mutations take priority (isBlocked),
  validation 4xx does not retry identical payloads, network errors do
  not block editing; monotonic version guard on apply; non-blocking
  "草稿已自动保存 HH:mm" status line.

Verification: tsc clean; 7 new unit tests (fake-clock scheduler, draft
fingerprint, merge/filter); full frontend suite 656 tests with a failure
set byte-identical to the pre-change baseline (14 pre-existing); Go
internal/api failures unchanged (no Go files touched). Manual E2E
evidence on the local replica stack remains open in the ticket.
Record the approved catch-up work order outcome: Go lane suites and the
28-test Python suite pass at c8794dd7; the retained 20260927 seeded
database replays the five-role HTTP workflow on current binaries (sl-2
snapshot full pass through final acceptance; sl-3 stops at quality as
designed; BLF scratch needs a fresh batch per the documented boundary).
Note the colima 27019 forward workaround (lane-mongo-2 on 27020, same
volumes), the session-sandbox localhost-TCP gating requirement, the
part-index delivery shape addition to the delivery-packaging coverage
gap, and the still-open movi browser smoke.
- extract domain-neutral idle flush scheduler to src/lib/idle-flush-scheduler.js;
  annotation-autosave.js delegates and keeps its 20s default (A01 tests unchanged)
- new review-draft-autosave.js: 8s constant + collector with write-guards,
  empty-text/legacy/clear-intent never auto-executed
- useReviewDraft: touch on edit, autosave enqueue isomorphic with manual save
  (background+autosave), settle keeps editor open with refreshed baseline,
  conflicts reuse existing blocked handling (no auto-retry), cancel on leave;
  beforeunload stays dirty-only
- 10 new node tests; full-suite failure set identical to pre-change baseline
  (14 known pre-existing); tsc clean; fixes one pre-existing prettier violation
- resolve autosave-workbench issue 02; fold browser E2E evidence into ticket 04
- A02 review autosave browser E2E 10/10: exactly one PUT after 8s idle, editor
  kept open, status text, reload restores opinion verbatim, no decision
  auto-submit, idle zero traffic
- A01 workbench E2E 4/5: claim/continue/render/idle-clean pass; typing->PUT->
  reload deferred to online verification (slice generation needs k8s worker
  runtime; company kubeconfig refused by policy)
- 50-user write-rate load test PASS: 350/350 draft PUTs 200 (4 cadence rounds
  at 20s + 3 synchronized bursts), p50 65ms / p99 1.1s, 0 failures, 0 5xx,
  0 Mongo slow ops (profiler slowms=100)
- regression: frontend failure set identical to baseline (14 known); Go 70
  failing subtests all pre-existing families, zero Go files changed
- fixture/loadtest/e2e tooling documented in local-data/verification/
  autosave-replica/ (untracked, referenced from ticket)
- server: timestamp scope in canonicalReviewProblems (identity = source +
  canonical frame, discard-slice/out-of-range/exclusive-end rejections with
  explicit messages, zero duration, dual basis conversion; fixes input
  timeBasis being clobbered by the shared branch) and reviewOpinionKey
  (microsecond frame identity); comment summary gains per-point labels;
  slice-id statistics cover timestamp problems
- rework routing: FANYU_REWORK_RETURN=directed|pool rollback switch applied
  at both decision entries (v5.8 plan + legacy /reviews); directed branch
  already existed (22ca5cd8) with 7-scenario matrix; new pool-branch test
  asserts public-pool restore + admin reassignment channel stays available
- frontend (D5): timestamp option in the F scope menu (three-card navigation
  untouched via opinionCardScopes), timestamp opinion list in the review
  panel with click-to-locate, independent G key jump command wired through
  quality + acceptance workbenches; scope type widened
- tests: 4 new Go tests (canonicalization, 6-case rejection table, per-frame
  uniqueness, pool switch) green; api suite failures identical to baseline
  (65); frontend failures subset of baseline 14, zero new; replica-stack
  live demo: save at 60.05s -> exclusive-end rejected -> formal rejection ->
  directed return to original annotator with labeled timestamp comment
- resolve review-rework-workflow issue 01; interactive rework-side point
  positioning handed to issue 02 (return-baseline view)
- ReworkBaselineRecord: frozen at formal quality rejection via a new decision
  effect (idempotent apply); embeds original opinions, reject comment, and the
  reviewed revision's slice/action summaries - self-contained by design so
  revision pruning can never orphan it and no customer data is deleted
- ReworkFeedbackRecord + GET/PUT /api/human-items/{id}/rework-feedback:
  writer restricted to the directed owner (incl. admin-reassigned owner) or
  manager; entries must reference baseline opinions; CAS version conflicts;
  readable by the reviewer; missing-baseline rounds return a graceful conflict
- GET /rework-baseline returns null baseline for legacy rounds (degraded read,
  never blocks the flow)
- ReviewDraft.Confirmations (D7): canonical validation against the current
  round's baseline (unknown/duplicate opinions rejected; unresolved requires
  note or a current-round opinion; no-baseline rounds must stay empty);
  frozen into AnnotationReviewRecord at the formal decision, matching the
  irreversible-verdict principle
- tests: baseline freeze+embedded evidence, feedback contract (403/400/CAS/
  reviewer-read), confirmation validation+freeze, graceful-missing - all
  green; internal/api failures identical to baseline (65), zero new
- rework API client (baseline/feedback GET + CAS save)
- useReworkReviewData: fetches current-round baseline + feedback when
  reviewRound >= 1, degrades to null on missing/legacy data
- ReviewProblemPanel: read-only original-opinion section with per-opinion
  annotator feedback, D7 confirmation controls (已解决 / 仍有问题+note) that
  upsert into the review draft confirmations and ride the existing 8s
  autosave + formal-decision freeze
- frontend failure set identical to baseline (14), tsc clean
- ReworkFeedbackEditor: read-only original opinions from the frozen
  baseline, per-opinion feedback textarea, 8s idle autosave via the shared
  scheduler, CAS conflict banner preserving local text, mounted above the
  annotate workbench for rework rounds
- replica-stack five-role demo (fresh binary after killing a stale go-run
  child that still held :3001): quality timestamp-opinion rejection ->
  baseline frozen (1 problem, 4 embedded slices, labeled comment) ->
  directed return -> admin reassignment -> annotator reads baseline +
  saves feedback (stale replay 409) -> resubmit -> reviewer reads feedback,
  D7 confirmation draft, formal approval, confirmations frozen in the
  review record
- resolve review-rework-workflow issue 02; frontend failures identical to
  baseline (14), tsc clean
- retention: baselines/feedback kept forever (<=0.3MB per task lifetime,
  no cleanup jobs); materialized slices keep K=2 generations, older-gen
  cleanup registered as a known-gap for the C-block maintenance track
- comparison media: zero new video files - metadataOnly materialization
  references source run artifacts, manifestSha256 content-addressed reuse
  (existing code branch cited), playback over the existing presigned/direct
  pipeline
- capacity at 50 users: sequential two-stream comparison <=2x single path
  (~250Mbps peak), consistent with the C-block 50-user criteria; no new
  storage/bandwidth budget items for B03
- resolve issue 06; unblocks issue 03
- random-claims: my directed rework item is returned as-is (no version bump)
  before any random draw, and keeps priority on repeat claims until the
  rework is submitted; other annotators never receive someone else's
  directed item (assigned filter unchanged)
- quality pool rows gain a 返工复查 badge + detail line for round>0 items;
  workbench header shows the same state; DetailedTaskStatus widened
- pool list stable-sorts rework items to the top (先清自己的错再领新)
- tests: rework-first claim matrix (priority, idempotent resume, priority
  release after submit, invisible to others) green; api suite failures
  identical to baseline (65); frontend failures identical (14); tsc clean
- ReworkFeedbackEditor: 定位 button per timestamp opinion, seeking the
  annotate workbench player via the existing seekRequest channel
  (revision-deduped), same capture-seconds timeline; B03 全局导航 for the
  rework side without touching workbench internals
- tsc clean; frontend failures identical to baseline (14)
- adjustSlice: actions crossed by a moved slice boundary split into two
  source-positioned halves (deterministic :split: ids) marked status
  needs-check; touching boundaries still stretch; untouched actions kept
  verbatim (D2 ruling 2026-10-12)
- action list renders 待核对(边界拆分) with amber emphasis for
  needs-check segments
- ReworkComparisonPanel: structural baseline-vs-workspace diff (slice
  boundaries/names/dispositions, action text/boundaries, additions and
  removals, split detection) per spec §5.1/§5.3 + §11.2 zero-new-media
  conclusion; collapsible details region above the workbench
- tsc clean; frontend failures identical to baseline (14)
The 1d1c9f50 editor patch called s.replace() without reassigning the
variable, so the 定位 button never landed despite the commit message;
this adds it for real (verified: browser shows 定位钮 on the rework
feedback section, seek wired via seekRequest). Also recorded: Vite's
module cache served stale transforms until restart, and the app-level
project scope defaulted to review-focused (no rework rows there) —
both cost one debug cycle each.
- GET /api/human-items/{id}/source-opinions: per-source projection of
  rework baselines (round, frozen problems incl. timestamps, comment) and
  formal quality reviews (round, decision, reviewer, frozen D7
  confirmations); aggregate items only
- multi-source coordination detail: requireAcceptanceSourceReady and the
  decision gate now name the pending sources (itemKey + stage + status)
  instead of a generic message
- AcceptanceSourceOpinions panel in the final-acceptance workspace:
  collapsible per-source history labelled who/which-round
- rework_review badge extends to prepackage_acceptance rounds
- tests: pending-gate names source then approves after ready; projection
  carries baselines/reviews/confirmations and rejects non-aggregate items;
  api failures identical to baseline (65), frontend zero new, tsc clean
- B05 matrix (1413x615): five work modes incl. rework folding, dual-camera,
  legacy replay, keyboard-focus guard - 13/13 with two explicit deployment-
  time exemptions (D2 interactive drag, aggregate acceptance demo) routed to
  the established online-verification list
- known-gap table terminal: materialization cleanup -> formal backlog
  ticket; no silent downgrades outstanding
- docs/rework-review-manual.zh-CN.md: three-role manual (annotator rework /
  quality reject+recheck / acceptance batch recheck) aligned with CONTEXT.md
- compat evidence: optional-field read compat, rollback switch, legacy
  payload writes; asymmetry documented (timestamp/confirmation editing
  needs the new frontend by design)
- perf evidence: A04 50-user load + B06 capacity conclusions
- resolve issues 03 and 05; roadmap moves to the deployment phase
- rework_baseline: drop hand-rolled itoa for strconv.Itoa (P6 reuse)
- AcceptanceSourceOpinions goes through reworkApi.sourceOpinions instead
  of a direct apiRequest (API-wrapper layering)
- shared opinionScopeLabel in review-opinions.ts replaces the triplicated
  scope→label cascades
- rework-first scan limit named and justified in place
- feedback editor tracks conflict via state flag instead of matching
  human-readable error text
- kept: reworkReturnMode os.Getenv follows the 24-precedent api-package
  flag style (auth.go DROBOTICFLOW_ENABLE_LEGACY_ORGANIZATION_ADMIN);
  baseline double-fetch note (useReworkReviewData is review-stage gated,
  annotate mode needs its own fetch)
- c3 rework-first: drop the Limit-20 newest-first window that could bury an
  old returned task under newer claims (review finding: silent priority
  loss); full personal-item scan is the documented correct behavior
- c4 timestamp jump: per-source ordering (current source first, cycle
  within source before moving on) - never interleaves seconds from
  different sources on one axis (spec §4.3)
- c5 unresolved confirmation now requires an explicit note (spec §5.3
  明确引用; the any-opinion loophole closed)
- a1 D1 downgrade: opinions with saved handling feedback render amber
  有修改,待复核 instead of full red; unhandled keep the strong alert
- a2 reviewer-side structural comparison: ReworkComparisonPanel now also
  mounts beside the review panel for re-review rounds (§5.3)
- a3 D4 counters: reviewer header shows 待处理 N / 待复核 M (non-blocking)
- a5 confirmation-only autosave: idle flush now carries confirmation
  changes via an in-place opinion re-save; zero-opinion drafts degrade to
  an explicit message instead of silence (§5.4-8)
- a4 axis markers: backlog ticket maintenance-backlog#02 (visual
  enhancement; discovery already covered by list + G + locate)
- regressions: api 65=65 zero new; frontend 14=14 zero new; tsc clean
Default proxy.golang.org is unreachable from some networks; the env value
now flows into the Dockerfile ARG (goproxy.cn mirror used for this
release build). No behavior change when GOPROXY is unset.
- worker maintenance job (hourly, batch of 3 tasks/tick): terminal-only
  (accepted/rejected) tasks keep the newest K=2 materialized generations,
  older generation directories are reclaimed from disk
- ownership filter by artifact ID marker prevents cross-task deletion;
  path traversal rejected at identifier level (Join-cleaning-proof) plus
  reconstructed-path prefix containment
- source video artifacts, rework baselines (embedded data), and formal
  records are never touched; artifact records stay as tombstones per
  spec §7 graceful-degradation semantics; rescans are idempotent no-ops
- tests: K=2 retention + source/other-task isolation, non-terminal and
  shallow-history skips, traversal rejection - all green
- thin marker strip atop the review slice timeline: orange dots at
  capture-seconds positions; near-neighbours (<0.8% track width) cluster
  into a count badge; single marker click seeks via reviewController,
  cluster click expands a popover listing each opinion (time + text)
- parent slices are never painted red (markers live on their own strip,
  visually distinct from the playhead)
- data flows through the new reviewTimestampOpinions prop mapped from
  reviewDraft.timestampProblems (same source as G-jump and locate)
- browser-verified on the replica stack: two nearby opinions (0.09s/
  0.14s) cluster into one '2 条' marker, expansion lists both; frontend
  regressions identical to baseline (14), tsc clean
- delete ReworkFeedback concept (editor, domain, API, store) per user decision
- add /rework-handling API: one-click skip ('no change') with CAS + trace for re-review
- add rework-emphasis pure lib: baseline-vs-workspace diff auto-clears red,
  merge reattach, multi-round (latest red, older dimmed), J/K jump order
- workbench: red slice blocks + count badges, red/gray action blocks,
  red timestamp markers, per-slice opinion cards, summary strip above track,
  soft submit gate, help entries, one-line notice pointer
- QC ripple: skipped chips replace feedback read in ReviewProblemPanel
- docs: CONTEXT.md glossary (意见处理状态), ADR 0006, manual rewrite
- new ReworkOpinionRail: all opinions in a scrollable right-column mini window
  (focused/compact layout only), grouped red → skipped → gray → old, click to locate
- jumpOrder extended from red-only to full navigation order with per-entry state;
  J/K walk the full list in both layouts (red first), gate dialog filters red
- focused layout: per-slice cards under the slice track removed (no stacking),
  summary strip slimmed to one line pointing at the rail
- docs: manual + ADR 0006 wording updated for the new J/K semantics
- remove the two annotate-phase stage locks in canonicalSliceDispositionState:
  boundary moves of discarded slices and explicit merges are now edited in
  place, first pass and rework share one server path (spec §3.4, R2-Q7:a)
- keep the bottom line untouched: every action must fall fully inside exactly
  one slice and carry a whitelisted status (annotation_operations.go /
  annotation_contiguous.go), pinned by new table-driven cases incl. half
  actions and the three triage products
- retire the reslice write endpoint: POST /slice-reset now answers 409
  slice_reset_disabled pointing at in-place editing and never writes;
  sliceResetHistory evidence and reads stay intact (R3-2:a)
- reset-family tests flipped to the disabled contract; historical post-reset
  invariants still covered via a legacy-state fixture helper
# Conflicts:
#	src/components/CaptureAnnotationWorkbench.tsx
One command now rebuilds TWO tasks sharing the org/accounts: task A
(unchanged, round-1 rework returned to the annotator) and new task B
on a second ise-demo-b-* capture driven through the full loop — first
submit, QC 8 opinions, reject, partial rework via real endpoints
(split S1 @15s, discard S3 via dictionary reason, act-07 description,
act-13 invalid), resubmit ending round-2 submitted awaiting QC
re-review with structureChangeSummary split=1/discarded=1. Deliberately
unresolved act-17, both timepoints and the overall opinion keep the QC
receive view red/gray mixed out of the box. Walkthrough §0 becomes a
two-task table and case-2 points at task B directly (manual path via A
kept as an optional note).
R1-Q8/R2-Q7 (spec slice-edit-ux-rework, seam ②):
- planQualityReviewDecision now builds the next rework baseline as
  unresolved prior opinions (same entry IDs, QC still-problem notes
  merged into the original text) followed by this round's new opinions;
  resolved opinions never enter the new baseline
- rework-baseline reads (any round) and the acceptance source-opinions
  baseline projection narrow to unresolved-only via the frozen round's
  review confirmations; frozen records stay untouched (B02)
- legacy fallback: missing confirmations mean unresolved and opinions
  keep carrying (documented + tested); missing prior baseline keeps the
  first-round fresh-only behavior
- ADR 0008 records the decision, consequences and the rejected
  collapsed-display alternative
# Conflicts:
#	src/components/CaptureAnnotationWorkbench.tsx
Removed with no feature flags: SliceTriageCard.tsx, slice-triage-card.js,
slice-triage-card-types.ts, slice-boundary-triage.js, the sliceTriage page
state + applySliceTriage/choose/dismiss, workbench card render + key-swallow
dispatch + props, triageCardShortcut/Help key tables, and the .slice-triage-*
CSS block. Commit-style boundary moves (slice-phase </>arrows and Shift+arrows)
now route through planSliceEditDragRelease into the 04 conflict list — the
same single disposition entry as drag release / hover+split / trash merge.

Grep evidence: src/ tests/ scripts/ have zero slice-boundary-triage /
slice-triage-card / SliceTriageCard / triageCardShortcut / triageCardAnchor /
sliceTriage / applySliceTriage / classifyBoundaryMove / applyBoundaryMove /
slice-triage references outside the new anti-resurrection guard test.
Dead helpers commitSliceBoundaryDraft / stepSliceBoundaryByFrame (unreferenced
since the numeric-draft sidebar was removed) deleted with their state.

Gates: tsc exit 0; frontend 775/760/15 — failure set identical to baseline by
name except the intentionally-red ticket-06 guard (old E-mode still present,
next commit).
Removed with no feature flags: sliceEditActive state + auto-exit effect,
enter/exit/nudge/switch boundary helpers, the sliceEditShortcut dispatch
branch + key table + help rows, the slice-edit-mode-banner render, and the
in-mode highlighted-boundary overlay. E opens the 04 reconfig panel only
(toggle-slice-edit / slice-edit-unavailable dispatch unchanged); the batch-0
constant slot stays and still hosts the single-slice E notice and the
panel lock notice with zero layout shift.

Keymap finalized per ticket 04's judgments, pinned by tests: panel-internal
E = cancel; panel keys C/G/arrows/Enter/Esc; list keys up/down/1/2/3/Enter/
Esc; outside-mode keys unchanged incl. Shift+arrow action boundary (I3).

Grep evidence: src/ tests/ scripts/ have zero sliceEditActive /
sliceEditShortcut / slice-edit-mode-banner / enterSliceEditMode /
nudgeSliceEditBoundary / slice-edit-highlighted-boundary references outside
the anti-resurrection guard test and one explanatory comment.

Gates: tsc exit 0; frontend 774/760/14 — failure set identical to the
pre-change baseline by name (14 known upstream debts).
Acceptance finding (ticket 09 scope 5): the QC review view showed no action rail —
and neither did the annotator side. Root cause was NOT a review-phase render gate:
continuousActionsForItem derives task.continuousActions from
batch.processingProfile === raw_human + the three-role stage list, and the seeded
ise-demo(-b) batches never set the profile, so the workbench gate
continuousActions && phase === annotate was false everywhere.

- seed: perCapture.batch now carries processingProfile: raw_human (stages already
  matched IsFanyuV58ThreeRoleHumanLoop).
- new static test pins the demo-data contract (ise-demo-seed.test.mjs).
- live stack patched in-place (db.humanBatches updateMany on ise-demo-batch /
  ise-demo-b-batch) so the user's in-flight acceptance progress is preserved.
User reported the two timeline tracks nearly overlapping in the QC review view at
narrower viewports. Reproduced in the review-focused layout (reviewFocus=1): the
workbench grid pinned row 4 (slice timeline editor) at 66px and row 5 (action
timeline) at 90px — both smaller than their content (slider + heading + 46px slice
track ≈ 104px; action timeline min-h-40 = 160px). Flex children with min-height:0
were crushed (heading ≈ 4px, banner slot 32→18px, slice track 46→42px) and the
slice blocks overflowed onto the action blocks: 24px container gap, ~6px block
overlap at every viewport ≥1413. Same family as ticket 01's focused-mode
regression (fixed-height rows + absolutely positioned tracks + a dead slot).

- rows 4/5 now content-driven (auto); the video row (1fr) absorbs the difference.
- the slice-edit banner slot is display:none under [data-review-focused]: both
  notices are unreachable in review (E and the panel are gated by the review
  keymap), so the slot is dead weight there; annotator-side constant-slot
  semantics in capture-workspace.css are untouched.
- measured gap after: 44px at 1680/1440/1366/1280 (focused), 173px unfocused;
  evidence under .scratch/slice-edit-ux-rework/probe-out/fix-afterB-*.json
User: E almost never opened (「E 老是按不出来,操作暂时没有完成」). Two defects:

1) openSliceEditPanel hard-blocked on outstandingDrafts — but parked drafts are
   the normal state during continuous annotation, so E was almost always dead.
   The blocked notice also never reached the user: it starts with 请, and
   userErrorMessage's instructive-copy rule replaces such messages with the
   generic 「操作暂时未完成」 fallback.

   Design change (ticket 04): OPEN despite parked drafts. New
   onSliceEditSessionChange channel tells the page when the panel session is
   open; the page extends the autosave isBlocked gate (panel session OR any
   conflict list) so drafts stay in workbench state and the structure snapshot
   reference stays stable, then flushes once immediately on release
   (slice-edit-close edge via sliceEditSessionFlushEdge). Guards kept:
   slices<2, and the non-continuous active-editor block with unchanged copy.
   The apply-time drafts guard stays (applying structure edits while draft
   intervals reference the pre-apply layout can orphan content); the docs now
   spell out that split.

2) The E-panel sanity walk exposed a pre-existing dead Enter: the
   applySliceEditPanel workspace-drift guard compared prop references against
   panel.snapshot.slices/actions, but snapshotSliceEditWorkspace deep-copies, so
   Enter was ALWAYS rejected with 「面板期间工作区发生了其它修改」. The guard now
   compares by value (same sorted-JSON convention as the preview-equality check
   below it); genuine external changes still fail the check.

Verified live (probe-e-walk): E open → ←/→ nudge (red block) → Shift coarse →
Enter → conflict list → 1+Enter applied → E reopen → Esc; task A structure
round-trips byte-identically.
User: 「shift 左右能改变切片或标注动作的边界…这个也没有做」. The global map
returned null for every shift+arrow outside the panel (line ~68), and in
continuousActions mode the early adjust-boundary return fired regardless of
whether an action editor was open — startBoundaryHold then silently no-oped
without editingAnnotation, so the key looked dead in both shapes.

- annotation-shortcuts: shift+arrows in annotate phase now resolve to
  coarse-nudge-boundary unless (continuousActions && actionEditor) keeps the I3
  action-boundary binding; slice-phase behaviour unchanged either way; repeats
  consume; modifiers still fall through natively.
- workbench dispatch: coarseNudgeSliceBoundary nudges the selected slice's
  boundary 0.5s (selectedBoundary if one was clicked/dragged, else the panel's
  default-focus rule: selected slice end, last slice falls back to start) and
  commits through onSliceBoundaryChange — the same committed pipeline the slice
  phase uses (clean → immediate apply, conflict → the ticket 04 list,
  Esc = nudge never happened).
- help table: new annotate row for the slice-boundary nudge; the continuous
  context relabels it to the dual semantics; the old continuous extra row is now
  slice-phase only.
- keyboard guide: the committed-nudge paragraph and the panel prerequisites
  (drafts no longer block opening; apply still requires them) updated.

Tests: annotation-shortcuts (new dispatch matrix incl. no cross-talk with the
panel table, editable inert, modifiers) + continuous-shortcuts pins updated to
the actionEditor-aware contract.
The captions-visibility static guard pinned '((isQualityReview || captionsViewable)'
byte-for-byte. Prettier's paren wrapping for that expression depends on the
surrounding line-width context; after the acceptance-fix edits it now emits the
single-paren form (both are valid prettier output — HEAD's double-paren form was
also clean). The assertion now pins the condition composition, not the paren
shape. No behavior change.
✅ ticket 11: close slice-edit UX feature — user acceptance rounds + online deployment verified
Some checks failed
web-ci / checks (push) Waiting to run
web-ci / checks (pull_request) Has been cancelled
04f28c4fce
🛡️ retro F2: release check --local refuses images without a linux/amd64 manifest entry (arm64-only wedge prevention)
Some checks failed
web-ci / checks (push) Has been cancelled
web-ci / checks (pull_request) Has been cancelled
4fdecd8e07
✨ Add dictionary CSV export, bulk import and batch remove to labels panel
Some checks failed
web-ci / checks (push) Has been cancelled
web-ci / checks (pull_request) Has been cancelled
5bba40e9e0
Clicking an unclaimed row in the claimable pool wrote its id into the URL,
which an effect misread as ownership and flipped the list to My Tasks; the
selection sync then dropped the previewed task entirely. Gate the flip on
confirmed assignment (pools.mine / task detail), and start review
workspaces on the claimable pool for URL arrivals, so owned deep links
still land in My Tasks via the ownership effect. Claim-without-preview
keeps preserving the current list view.
🐛 Keep returned annotations visible to annotators when import waves bury their tasks
Some checks failed
web-ci / checks (push) Has been cancelled
web-ci / checks (pull_request) Has been cancelled
90d5c0c5a2
A quality rejection reassigns the ORIGINAL annotation task, whose
createdAt keeps the original import date. The task list pages
org-wide newest-first and then role-filters each window, so once newer
import waves fill the window with unreadable foreign tasks the
annotator's own returned task can no longer be fetched: each page
filtered to empty, and the filtered-empty response dropped the
continuation cursor so paging stopped for good (production incident
2026-10-14: reviewer saw the return, annotator saw nothing).

- server: authorization-empty pages now carry the store window's
  nextCursor/hasMore (taskPageCursor helper shared with the success
  path) so limited consumers can always continue paging
- client: non-manager workspaces (annotators included, previously
  review-only) fetch tasks by pool legacyTaskIds via the existing
  ids= join instead of the newest-first window, mirroring the
  任务关联数据缺失 fix
- tests: Go windowed-paging contract test (empty page keeps cursor,
  page 2 returns the rework task, ids join reaches it directly) and a
  frontend source pin for the ids-join condition
D7 layout fixes, zero interaction changes: a panel-scoped rule
neutralizes the shared inset:0 dictionary base (it covered boundary
rows and every panel button because the panel root is the nearest
positioned ancestor), the panel header and Enter-apply footer become
sticky within the panel's own scroll container, and the compact
disposition dialog ends 138px above the viewport bottom so it clears
the 126px submit rail instead of overlapping its top. Pin tests guard
the scoped rule, the sticky edges, the unchanged Esc/Ctrl+Enter key
contract, and the compact dialog offset.
- mergeDegenerateProducts: straddle pieces within EPS merge into a
  same-status neighbour (coverage unchanged) so degenerate boundary
  structures can no longer persist invisible zero-width segments that
  intervalStyle renders as display:none
- scanSliceEditConflicts now returns autoFollows (silently-following
  edge-glued invalid actions) + conflictAutoFollowHint derivation for
  the collapsed conflict-list hint row (panel and drag quick paths)
- invalid track blocks get a min-width visibility marker so needle-width
  invalid intervals stay visible on the track
- 5 new engine tests (guard x3, autoFollows, hint); workbench source
  guards updated to pin the corrected wiring; repro record updated with
  post-fix matrix
D1: single-slice tasks open the slice-edit panel on E (panel supports
adding boundaries); the slice-edit-unavailable toast branch is deleted
outright (key table context, notice state, dispatch and UI).

D6: J/K landing on slice problems auto-opens/switches the panel target
(reworkLocatePlan now carries a sliceEdit intent on jump plans); landing
on action/timestamp problems collapses the panel with pendingSlices
stashed and restored on reopen while the workspace is unchanged; Esc
remains the explicit full discard. Panel-open J/K passes through to the
rework navigator instead of locking; conflict-list J/K stays locked and
mouse-path locks are untouched (jump selects bypass the click lock via
an explicit flag only).
Server: reject NEW task-scope problems on draft PUT (409
review_task_scope_deprecated, ID-matched against stored entries;
existing entries round-trip unchanged, full-replace semantics kept);
formal-rejection flattening no longer emits 整体任务 lines or
expands ProblemSliceIDs; rework-baseline reads hide task problems
(read-only narrowing); workforce stats stop counting task scope.

Frontend: remove task from composer scope lists and card cycle;
hide stored task opinions in rework banner/soft reminder/rail,
QC panel groups and history, acceptance source projection, stats
panel rows, frozen-comment displays (stripTaskOpinionLines);
submit/approve gates count visible problems only; stats panel
documents the 2026-10-14 scope switch.

Data untouched: no migration, no deletion, audit trail intact.
- server: handleSliceResetCreate splits on submission history using the
  established isRework signals (task revision fence, rework status, human
  annotation revision via fanyuV5CombinedSubmissionIsRework); first pass
  runs the original reset write path with sliceResetHistory audit, history
  keeps 409 slice_reset_disabled with in-place guidance (spec D1 revised)
- table tests pin both classes incl. the system-suggestion edge; the four
  retired-contract test files flip to split-flow assertions
- frontend: restore the reslice button, warning dialog with both reset
  modes, and authoritative reconciliation from f980696f~1; entry is gated
  client-side by the same signals (resliceEligible), normal and focused
  layouts share the restored footer entry; E-mode changes untouched
- dev preview regains the entry; two retirement-era nail assertions flip
  back with the gate asserted in their place
- opinionCardScopes: three cards (slice/action/timestamp), same visual spec
  (role=option + aria-selected highlight, click enters target editing)
- timestamp card entries = timestamp opinions owned by the current action,
  atSeconds ascending; current action resolved from the same position data
  as the D5 target model (new reviewPositionAction in review-navigation.js,
  range reported with ReviewPosition by the viewing surface)
- timestampProblemsOfAction pure helper in review-opinions.ts, table-driven
  tests; slice identity guards cross-slice leakage in slice-seconds basis
- remove the all-task flat timestamp list from ReviewProblemPanel (G-jump
  and timeline markers keep the full-task set from the hook)
- entry click keeps selectProblem anchoring; J/K focus emphasis preserved on
  in-card entries; anchored-target entry stays emphasized
- names: timestamp -> 当前时间点意见 (no task revival)
Reviewed-on: #48
🎨 Normalize existing formatting for PR CI
Some checks failed
web-ci / checks (push) Has been cancelled
web-ci / checks (pull_request) Has been cancelled
3472c021de
Owner

@zhanghongming 审查固定 head=3472c021,目标 dev=03db2a28。结论:暂缓合入 dev,仍有 1 项 P2 权限阻断。

Standards

此前 P1 自动保存跨任务污染已增加 task/user/enabled 会话隔离,P2 物化清理已增加组织/状态轮转与分页游标,代码层确认两项修复保留。
尚未解决:internal/api/rework_handling.go:50-53、69-74 的 PUT 仅检查当前归属人/管理员,未限制角色、返工阶段及当前轮次。

Spec

ADR 0007 §9 明确 QC 无“不改了”操作。已通过实际 HTTP handler 和隔离内存数据复现:第2轮、quality_review阶段、当前领取人为质检员时,PUT 当前轮与 ?round=1 均返回200并写入 skippedOpinionIds/version=1。外层 loadHumanItemForRequest 未阻止。#49/#50 对应文件相同。
请限制 PUT 为当前可编辑返工阶段、合法标注处理人及当前轮次,历史 GET 保持只读,补质检写入和历史轮写入拒绝回归。

验证:包含本 PR 的 #50 候选 TypeScript、API/store/worker 定向 Go 测试、47项相关前端测试通过。完整前端895项:881通过、13个既有失败、1个devboot在60秒上限取消,因此不能宣称全量通过。未部署,未修改客户数据。

@zhanghongming 审查固定 head=3472c021,目标 dev=03db2a28。结论:暂缓合入 dev,仍有 1 项 P2 权限阻断。 ## Standards 此前 P1 自动保存跨任务污染已增加 task/user/enabled 会话隔离,P2 物化清理已增加组织/状态轮转与分页游标,代码层确认两项修复保留。 尚未解决:internal/api/rework_handling.go:50-53、69-74 的 PUT 仅检查当前归属人/管理员,未限制角色、返工阶段及当前轮次。 ## Spec ADR 0007 §9 明确 QC 无“不改了”操作。已通过实际 HTTP handler 和隔离内存数据复现:第2轮、quality_review阶段、当前领取人为质检员时,PUT 当前轮与 ?round=1 均返回200并写入 skippedOpinionIds/version=1。外层 loadHumanItemForRequest 未阻止。#49/#50 对应文件相同。 请限制 PUT 为当前可编辑返工阶段、合法标注处理人及当前轮次,历史 GET 保持只读,补质检写入和历史轮写入拒绝回归。 验证:包含本 PR 的 #50 候选 TypeScript、API/store/worker 定向 Go 测试、47项相关前端测试通过。完整前端895项:881通过、13个既有失败、1个devboot在60秒上限取消,因此不能宣称全量通过。未部署,未修改客户数据。
longtao.wu added 5 commits 2026-10-17 14:58:35 +08:00
🐛 Fix discard confirmation focus and reset restored action tracks
Some checks failed
web-ci / checks (push) Has been cancelled
52dcb53a8c
🐛 Allow legacy editable tasks to undo persisted slice changes
Some checks failed
web-ci / checks (push) Has been cancelled
89164601af
🐳 Include hook bootstrap in API dependency build layer
Some checks failed
web-ci / checks (push) Has been cancelled
web-ci / checks (pull_request) Has been cancelled
45981287be
Reviewed-on: #50
Owner

@zhanghongming 本 PR 的全部提交已通过 #52 整合进入 dev=1aad4029,Git merge-base --is-ancestor 10b0dddd origin/dev 已确认。原返工权限阻断已由 #53 的630a95c8修复,并随 #53/#54/#55 一并进入主线;本轮15场景权限回归通过。此处按“已由整合PR覆盖”关闭重复入口,不再单独合并旧状态;源分支保留。后续 #56/#57 独立保留,部署/客户数据未改。

@zhanghongming 本 PR 的全部提交已通过 #52 整合进入 dev=1aad4029,Git merge-base --is-ancestor 10b0dddd origin/dev 已确认。原返工权限阻断已由 #53 的630a95c8修复,并随 #53/#54/#55 一并进入主线;本轮15场景权限回归通过。此处按“已由整合PR覆盖”关闭重复入口,不再单独合并旧状态;源分支保留。后续 #56/#57 独立保留,部署/客户数据未改。
longtao.wu closed this pull request 2026-10-22 13:00:18 +08:00
Some checks failed
web-ci / checks (push) Has been cancelled
web-ci / checks (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: longtao.wu/droboticflow#49
No description provided.