216 Commits

Author SHA1 Message Date
d-robotics
fc7786190f ⚡ Publish query reports and coalesce task pool reads 2026-11-13 22:31:44 -08:00
Codex
708b9bae3d ⚡ Add independent query database projection and guarded reads 2026-11-12 10:56:54 -08:00
Codex
a35e84163a 🛡️ Guard work availability and preserve release verification evidence 2026-11-11 22:28:17 -08:00
Codex
6b42476962 ♻️ Make annotator deletion handoffs recoverable 2026-11-11 03:51:18 -08:00
Codex
4810602703 🛡️ Keep annotation saves retryable after dependency read failures 2026-11-11 01:34:14 -08:00
Codex
d6dac755b9 🐛 Fix human release sweeper timeouts and duplicate unstarted capture prefix conflicts 2026-11-03 09:35:03 -08:00
d-robotics
b2a4f16a1f ⚡ Cache work-buffer display labels and keep dashboards cached across autosaves
- The work-buffer poll resolved each item's project, workflow and capture
  labels by reading the full run document (up to 6MB) every 3s. Cache the
  resolved labels per item for 2 minutes.
- Slots whose item the active scan already counted keep their slot without
  rereading the item and its claim receipt (same outcome as before).
- Draft, review-draft, review-session and work-buffer saves no longer flush
  the dashboard response cache; they change nothing a dashboard counts.

Local perf DB with a 6MB run: poll total p50 141ms -> 7ms (enrich 131 -> 0),
byte-identical response. Admin dashboard stays cached across draft and
session saves and is still recomputed after other writes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 00:49:09 +08:00
d-robotics
a777c42c4e 🚀 Prepare isolated v4 activation with safe workflow handoff and tag seeding 2026-10-22 00:58:27 +08:00
d-robotics
2876a14d4a 🐛 Separate administrative pool totals from bounded cursor pages
Administrator counters were derived from the stage-filtered first human-item page, while annotators used an aggregate. Add authorized whole-pool counters with a five-second bounded cache, page human items before joining task summaries, and search older metadata on the server. Cancel stale reads and preserve existing non-admin scope behavior. Cover permissions, mixed stages, real Mongo parity, old-page search, categories, pagination, stale responses and claim invalidation.
2026-10-21 15:31:05 +08:00
d-robotics
962ea6da3d ⚡ Share bounded dashboard snapshots across API instances 2026-10-20 22:47:45 +08:00
d-robotics
ac860d17f5 ♻️ Move API route registration out of NewHandlerWithConfig into routes.go
Pure move: NewHandlerWithConfig now only assembles the server and returns
server.routes(). Route snapshot unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 18:48:52 +08:00
d-robotics
7b739fd4c6 ⚡ Optimize annotation sidebar and progress reads 2026-10-17 13:11:00 +08:00
d-robotics
04e872ac85 ✨ Add gated source-backed slice revisions and capacity verification 2026-10-17 00:47:52 +08:00
d-robotics
9289a95d04 🐛 Recover annotation saves and separate pending task views 2026-10-16 16:13:41 +08:00
d-robotics
14d6ed9c0a 🐛 Fix October 15 annotation discard, claim and editing feedback 2026-10-15 17:06:17 +08:00
d-robotics
e60d2b6885 ✨ Add project dictionary batch import endpoint with create/reuse/skip semantics 2026-10-14 12:42:10 +08:00
d-robotics
daccd8dfbe 🔀 Release candidate: merge dev (hygiene/CI baselines) into inplace-slice-editing + acceptance-fixes 2026-10-14 05:00:33 +08:00
d-robotics
9eaead0b0c ✨ rework emphasis layer: opinions onto slices/actions/timeline, drop feedback editor
- 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
2026-10-13 10:47:27 +05:30
d-robotics
a45cbd79ac ✨ feat: B04 - acceptance source-opinion projection, pending-source gate detail, rework-review badge
- 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
2026-10-12 23:14:33 +05:30
d-robotics
177cf550e4 ✨ feat: B02 server layer - rework baseline freeze, handling feedback, review confirmations (D7)
- 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
2026-10-12 22:34:37 +05:30
d-robotics
58e0e50570 🧪 Retro 2026-10-12: CI gate, known-failure baselines, devboot regression test, workbench smoke, review standards
Six follow-ups from the round8-12 hotfix retrospective:

- web-ci.yml: lint + Go/frontend tests on every push and PR (nothing ran
  app checks before; the round10 dev-mode regression shipped green)
- tests/known-failures.json + check-test-baseline.mjs: gate by exact
  failing-test id instead of hand-counted failure totals (14 frontend,
  70 Go upstream debts recorded from the dev tip)
- devboot.test.mjs: boots the real Vite dev server and pins the movi
  loader contract that broke round10 (query-less DEV url, /vendor stays
  off the module pipeline)
- scripts/local/smoke-workbench.mjs: pre-release smoke covering the
  seven recurring acceptance points (login/pool/claim/play-while-loading/
  captions/4x/playhead), 3x green against the local replica
- docs/CODING_STANDARDS.md + AGENTS pointer: eligibility flags are
  server-shipped, the UI renders them (rounds 9+12 lesson)
- vendor README host-element quirks section, HANDOFF gate pointers and
  movi-path verification rule, perf-audit report pinned with the
  post-round12 production 500 observation
- husky pre-commit: lint-staged (repo prettier scope) + tsc + gofmt
- gofmt: restore lint:go green on the dev tip (drift shipped silently
  in the perf merge and round12 because nothing gated it)
2026-10-12 18:07:02 +05:30
d-robotics
e07f3cac3b 🔀 Merge dev into codex/slow-page-performance-20261009
Resolve server.go and production_stats.go conflicts by combining both
sides' intents:
- routes: keep dev's /api/dashboard/workforce and wrap the production
  dashboard in the response cache
- dashboard loading: dev's parallel errgroup fetches, but the runs
  goroutine keeps the C4 cursor-paginated summary page (limit 50 +
  aggregates) instead of the unbounded list
- enrichDashboardHumanWork: keep the C4 aggregation-counter fast path;
  the legacy fallback (stores without the counting interface) now
  fetches items/packages in parallel like dev
- production_stats.go imports: our superset (time/sort/strings + cache)
2026-10-12 06:18:48 +05:30
d-robotics
ba5c9909e5 ⚡ Fix annotation-center slow loads across roles: filter pushdown, per-task draft join, manager fast path, workload cache, slow-request tracing
- Task pool: push status/supplier/workflow/run/node/artifact equality filters into ListAnnotationTasksFiltered (new store method, backed by organizationId+createdAt indexes) instead of post-filtering an organization-wide scan
- Human items join: ListHumanItemsByLegacyTaskIDs fetches only the listed tasks' items via the organizationId+legacyTaskId index; TaskListProjection now drops annotationDraft too
- Draft progress: ListHumanItemDraftProgress loads slice/segment drafts per filtered task only (batched $in, new projection reads just legacyTaskId + draft payload); draft overrides revision only when the human item was touched after the latest slice revision
- Manager fast path: admin views skip the request-scoped batch snapshot, membership and supplier-pool reads entirely
- Workload summary: 45s per-user response cache (any /api write invalidates), mirroring the dashboard workforce route
- Tracing: any /api request over 1s now logs method/path/duration so page-level latency regressions surface without per-handler instrumentation; task list log gains drafts_ms segment
- Tests: draft-progress override semantics, manager scan-free path, store filter pushdown; v5 fixture users get SupplierID to match the supplier-unified account model (pre-existing red since c92bca16, 18 stock failures recovered green)

Co-authored-by: AgentTeams slow-page-fix-round3
2026-10-11 22:14:43 +05:30
d-robotics
54e47906c1 🎬 movi-player D-layer: vendor 0.4.1 slim dist, MoviVideo wrapper on E′ direct pipeline, telemetry endpoint, spikes pass
- vendor public/vendor/movi-player-0.4.1/ (element.slim.js 4.9MB + movi.wasm 5.4MB,
  Apache-2.0, SHA-256 pinned, upgrade = new versioned dir + MOVI_VERSION bump)
- src/lib/movi-player.ts: lazy loader (@vite-ignore dynamic import), runtime
  force flag (movi default / native fleet kill-switch / wasm canary), throttled
  best-effort telemetry reporter
- src/components/MoviVideo.tsx: engine="native wasm" + nohotkeys, HTMLMediaElement
  event bridge, #t= fragment split (startat + wrapper-managed end bound),
  in-place custom-element upgrade preserving node identity, wasmurl before connect
- mount points: LazyVideoPreview (evidence/artifact/object-storage previews),
  MaterializedSliceWorkbench dual-camera, CaptureAnnotationWorkbench main videos
  (moviElementReady gate: transport seek queue needs the element on first render;
  falls back to native E′ path until defined), page-level preload on
  AnnotationOperations
- POST /api/client/movi-stats: session-attributed, field-truncated, store errors
  swallowed (202); Mongo clientMoviStats collection w/ 14d TTL + org/kind indexes
- spikes (CDP, headless Edge 155, production hev1 480p30 sample): key conflicts
  PASS (17 keys all reach container dispatcher, zero playback-state interference,
  nohotkeys effective); frame-seek parity PASS (movi deltas identical to native
  <video>, ±1/30s steps both directions); deep probe: engine=native-wasm hands
  playback to shadow <video> with zero WASM fetches on HW-decode clients
- verification: tsc clean, gofmt/build/vet pass, frontend 644 tests net-zero new
  failures vs E′ baseline (6 new pass), Go API suite net-zero new failures
  (75 pre-existing; the one delta traced to a colleague's uncommitted part-index
  working-tree change), replica E2E: vendor assets served, module registers,
  telemetry lands in Mongo with TTL
2026-10-11 20:06:22 +05:30
d-robotics
54e3840e4a ⚡ direct-only video playback: strip transcode=browser, drop warmup, proposal v4 (E'+D fused plan)
E' foundation (per proposal v4, user constraints: no server-side transcode
fallback, no upstream format talks, fast ship):
- video-preview.js: buildBrowserPlayableVideoURL no longer appends
  transcode=browser; legacy param is defensively stripped; bos:// proxy
  URLs are direct too
- LazyVideoPreview.tsx: remove useProxy transcode retry (sync=1 blocking
  stream); direct playback only; error copy points to browser update
- annotation_operations.go: drop unconditional task-detail warmup call
  (<=2 ffmpeg per GET, C-1 complete)
- server.go: mark warmAnnotationVideoPreviews dormant (kept one release
  cycle as rollback hatch)
- video-preview.test.mjs: flip 7 assertions to direct/no-param, add
  bos:// + legacy-strip coverage (14/14 green)

Verified: tsc clean, go build cmd+internal ok, targeted Go tests green
(1 baseline pre-existing failure unchanged via stash A/B), full frontend
suite failures identical to baseline (14), local replica: task GET has
zero warmup/cache/ffmpeg activity, direct artifact content returns 307
presigned redirect, transcode=browser mechanism retained and produces
H.264 960px 12fps cache artifact (rollback path intact).

proposal-final.md v4: new Part E row + §6.6 (E'+D fused decode chain),
recommendation reworked (A backlog, E'+D single-ship, C accelerated,
B dormant pending open question 13), appendices D.8 + full attachment D
implementation & verification record. Not pushed, not deployed.
2026-10-11 18:46:03 +05:30
d-robotics
da446d13b5 ⚡ Fix slow page loading: static gzip, list pagination, auth cache, dashboard aggregation, video direct link
- C1/S3: build-time precompressed .gz served by spaHandler (writeBundle plugin), motion-vendor chunk rule fix
- C3/S1: /api/runs default cursor pagination (byte-compatible), /api/human-items limit/cursor + Mongo projection + filter pushdown
- C2/S5: in-process principal TTL cache (45s) with full invalidation paths; /api/users limit+q with org isolation
- C4/S2: dashboard counter pushdown ($group/CountDocuments), 45s response/snapshot caches, production stats snapshot cache
- C5: BOS presigned direct-link video preview (307) with background pre-transcode, /tmp cache TTL+LRU, gzip bypass, sync=1 rollback
- S4/S6: POC readiness point queries, human-batches GET no longer writes (60s sweeper), admin ops page N+1 fan-out removed
- Fixes found en route: BSON cursor self-reference recursion, backfill loop cursor advance, supplier cascade session flush
- Frontend: nextCursor passthrough (human-loop/users), acceptance pool no longer truncated at 500

Co-authored-by: AgentTeams slow-page-fix
2026-10-09 17:45:27 -07:00
d-robotics
b9ce40d1ae ⚡ Warm browser video previews on task open and speed up the transcode 2026-10-09 04:16:58 -07:00
d-robotics
9bd38d0c86 🐛 Keep long-video browser preview alive past the write deadline and cache it by object 2026-10-09 04:16:49 -07:00
bd253016f4 Merge pull request '⚡ 加速生产统计与首页摘要加载' (#35) from codex/dashboard-load-parallel-20261007 into dev
Reviewed-on: longtao.wu/droboticflow#35
2026-10-08 11:20:41 +08:00
d-robotics
5a925af060 ⚡ Parallelize dashboard statistics reads 2026-10-07 18:51:18 -07:00
d-robotics
2623bc2915 ✨ Converge production dashboard reporting 2026-10-07 10:45:47 -07:00
d-robotics
2335bf16f3 ✨ Add supplier authorization and shared final acceptance pool 2026-09-29 22:04:45 -07:00
d-robotics
a824c7c414 🐛 Correct workforce submission and return statistics 2026-09-29 04:10:01 -07:00
d-robotics
48bdddbffd 📊 Add scoped project and supplier production dashboard 2026-09-28 09:49:44 -07:00
d-robotics
8888bac685 ✨ Add scoped supplier project authorizations and public task pool 2026-09-27 09:06:33 -07:00
d-robotics
949daabd02 🔒 Enable scoped internal test slicing and delivery 2026-09-27 07:09:58 -07:00
d-robotics
d739cfd8d9 🩺 Add read-only customer connection diagnostics and request tracing 2026-09-26 06:18:49 -07:00
d-robotics
608480e75b 🔀 Merge deployed phone-login updates into review workspace 2026-09-22 19:27:04 +08:00
d-robotics
a108e8f6df ✨ Add focused review workspaces and durable review workflows 2026-09-22 19:26:33 +08:00
eust-w
d4c768475b ✨ Switch login to phone-based lookup (ticket 03)
- handleAuthLogin now authenticates via store.FindUserByPhone instead of
  FindUserByEmail; the login/bootstrap-super-admin request payload field
  is now `phone`. Old email addresses are no longer valid login credentials.
- bootstrap-super-admin now validates phone format (isValidChinaMobilePhone)
  instead of net/mail.ParseAddress; net/mail is fully removed from
  internal/api.
- Same-class gap fix: handleAdminOrganizationUsersCreate (the legacy
  per-organization admin endpoint, not touched by ticket 02) still created
  users by email only, which would have left them unable to log in under
  the new phone-only login. Switched it to phone validation/uniqueness too,
  and removed the now-dead normalizeUserInput/validateUserEmailAvailable
  helpers.
- Frontend: authApi.login, UserContext's login signature, and
  UserBootstrapPanel's submit handler now send `phone` instead of `email`
  (the form/labels were already phone-based from ticket 04).
- Updated ~20 Go test files whose fixtures/helpers logged in via
  user.Email; adminCreateUser/loginSession/bootstrapSuperAdminSession now
  work in terms of phone (deterministically derived from existing
  email-shaped test identities via testPhoneFromSeed, to avoid rewriting
  every call site). Added internal/api/auth_phone_login_test.go covering
  phone login success/failure and old-email rejection.

go test ./internal/api/... and npm run test:frontend match their
pre-ticket baselines exactly (75 Go failures / 599 frontend tests with
586 pass, 13 fail) by failing test name, not just count.
2026-09-22 14:04:59 +08:00
eust-w
412c94fa70 ✨ Switch account management create/edit to phone identifier (ticket 02)
Wires the Phone field/validation/uniqueness helpers added in ticket 01
into the account-management create/edit path, per the
account-phone-login migration spec.

Backend (internal/api/server.go, internal/domain/types.go,
internal/store/{memory,mongo}.go, internal/api/store_errors.go):
- handleUsersCreate/handleUsersUpdate now validate and enforce phone
  (^1[3-9]\d{9}$, uniqueness) instead of email; duplicate-phone errors
  return field "phone" with no "邮箱" wording.
- CreateUserInput gained a Phone field, wired through both store
  backends' CreateUser.
- Email remains on UserRecord (still used by login/self-profile,
  untouched here) but is no longer required/validated on account
  create/edit.

Frontend (src/pages/Users.tsx, src/services/api/users.ts,
src/types.ts, src/context/UserContext.tsx):
- Account management create/edit form, search box, and table column
  switch from email to phone (type="tel", client-side
  ^1[3-9]\d{9}$ validation, Chinese labels updated to "手机号").
- User type gained an optional `phone` field; usersApi.create's
  payload field renamed from email to phone to match.
- UserContext's createUser helper type/impl updated to match (dead
  code today, unused by any caller, but kept building); login/session
  bootstrap logic in UserContext.tsx is untouched.

Explicitly out of scope, per the research notes' scope boundary and
spec decision 7: the real "存量账号迁移" (migrating Fanyu's live
accounts to real phone numbers) is a human-supervised, deployment-time
operation, not something this session executed. No production Fanyu
Mongo/kubeconfig was touched. This ticket only makes the admin
UI/API *capable* of setting a phone number on new or existing
accounts, verified against the in-memory store and local fixtures.

Also left untouched, per scope: login page/flow, auth.ts,
UserContext's login/session logic (ticket 03); Sidebar.tsx,
ProjectMembersPanel.tsx, UserBootstrapPanel.tsx (ticket 04).

Verified: go build ./... clean; go vet ./... clean; gofmt clean on
touched files; go test ./internal/api/... and ./internal/store/...
produce the exact same 75 pre-existing failing test names as the
ticket-01 baseline (only two account/edit-adjacent tests updated to
assert phone instead of email behavior, plus a new
TestUserPhoneValidationAndUniquenessOnCreateAndEdit covering
create/edit phone format + uniqueness + role/supplier preservation);
npm run lint:web (tsc --noEmit) clean; node --test
tests/frontend/*.test.mjs matches the pre-existing baseline exactly
(599 tests, 586 pass, 13 fail, identical failing test names).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 12:28:58 +08:00
eust-w
fa5b73bf7f ✨ Add Phone field, index, validation, and lookup alongside Email
Expand step of the account-phone-login migration (ticket 01): adds
UserRecord.Phone, a sparse phone_unique Mongo index, a China mainland
mobile regex validator (^1[3-9]\d{9}$), FindUserByPhone (Mongo +
memory), and phone uniqueness helpers (ensureUserPhoneAvailableLocked,
validateUserPhoneAvailable) mirroring the existing Email plumbing.

Nothing wires Phone into login, account creation, or account editing
yet — Email remains the sole identifier used by existing flows, so
behavior is unchanged from a user's perspective. That's tickets
02/03/05.

Verified: go build ./... clean; new tests
(TestMemoryStoreFindUserByPhoneAndEnforcesUniqueness,
TestIsValidChinaMobilePhone, TestValidateUserPhoneAvailable) pass;
full internal/api suite has the same 75 pre-existing failures
(identical names) before and after this change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 12:09:29 +08:00
eust-w
d84b83c94d 🐛 Preserve discard evidence and persist slice undo history 2026-09-22 00:47:33 +08:00
eust-w
026912a35c 🐛 Separate account deletion from disabling and preserve audit identity 2026-09-21 16:58:04 +08:00
d-robotics
4f7274b2df 🔀 Merge latest dev supplier deletion and empty annotation fixes 2026-09-21 15:45:58 +08:00
d-robotics
4afea34547 🔀 Merge supplier account management with annotation workspace improvements 2026-09-21 15:16:11 +08:00
eust-w
a8830a6161 🗑️ Add resumable supplier cascade deletion with shared-data protection 2026-09-21 15:09:48 +08:00
eust-w
9fc2586af3 🔒 Support standalone MongoDB account mutations and audit Fanyu rollout 2026-09-21 11:48:37 +08:00
eust-w
c92bca168d 👥 Unify supplier account management and enforce single account roles 2026-09-21 11:30:03 +08:00
d-robotics
7d1c1e7fe2 ✨ Add bounded annotation work buffers and continuous task handoff 2026-09-21 02:38:16 +08:00