41 Commits

Author SHA1 Message Date
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
fdb393644b 🩹 Restore legacy account login compatibility 2026-09-23 09:51:10 +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
6e66e37b0a ✨ Switch account management create/edit to phone (ticket 02)
Admin account-management UI and API now validate/enforce phone instead
of email on create/edit. Production Fanyu data migration deferred to
deployment time per spec decision 7 — not executed here.

Merge conflict resolution + gap fixes found while reconciling 02 and 04:
- src/types.ts / UserContext.tsx / users.ts: kept Email required + Phone
  optional (matches current migration state — login still uses email
  until ticket 03); createUser/updateCurrentUser signatures reconciled
  to the versions that are actually wired to real backend behavior.
- internal/api/project_members.go: projectMemberView never exposed
  Phone (ticket 04's frontend rename to userPhone had nothing to read).
  Renamed UserEmail->UserPhone and populated it from user.Phone.
- internal/store/memory.go + mongo.go: ListProjectMemberUsers's field
  whitelist projection dropped Phone entirely (pre-existed the Phone
  field, never updated) — same root cause as project_members.go, one
  layer down.
- internal/api/auth.go: handleCurrentUserProfileUpdate/
  currentUserProfilePatch still only supported Email; self-service
  profile edit silently no-opped on phone. Wired to phone validation
  mirroring the ticket-02 admin create/edit pattern.
- Updated 3 tests whose expectations depended on the self-profile-update
  gap above (TestSessionAuthTenantIsolationAndRolePermissions,
  TestUserEmailUniquenessValidation, TestProjectMemberDisplayScopedBatch)
  to phone; verified full internal/api suite back to the 75-failure
  baseline (byte-identical failing test names) and frontend suite at
  599/586/13 baseline.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 13:35:30 +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
026912a35c 🐛 Separate account deletion from disabling and preserve audit identity 2026-09-21 16:58:04 +08:00
eust-w
637f511b6a 🔒 Retire legacy organization console and platform administrator access 2026-09-21 16:40:41 +08:00
eust-w
a8830a6161 🗑️ Add resumable supplier cascade deletion with shared-data protection 2026-09-21 15:09:48 +08:00
eust-w
c92bca168d 👥 Unify supplier account management and enforce single account roles 2026-09-21 11:30:03 +08:00
eust-w
db9040ccb2 🔐 Enforce supplier account permissions and protect administrator lifecycle 2026-09-21 00:30:28 +08:00
eust-w
2b7e081c39 ✨ Automatically enroll default supplier staff in project memberships 2026-09-14 16:33:57 +08:00
eust-w
add1b0e7ac 🔒 Fix employee supplier ownership at creation and simplify membership routing 2026-09-14 15:47:44 +08:00
eust-w
a851d7d495 🔥 refactor(roles): completely delete legacy cutter role and references across frontend and backend 2026-09-03 06:11:16 +08:00
eust-w
d4801f6f81 👥 Align annotation roles and task pools 2026-08-24 05:15:52 +08:00
eust-w
18582a7880 ✨ Preview manifest members on workflow edges 2026-08-22 14:12:04 +08:00
eust-w
6d6858c6c5 ✨ Implement Fanyu v3 task pools and pose delivery 2026-08-19 17:30:53 +08:00
eust-w
bed632d355 ✨ Deliver RoboData Fanyu human-loop platform 2026-08-19 03:08:37 +08:00
eust-w
1ca8cfa5ff ✨ Implement drosync production v1 2026-07-28 20:43:46 +08:00
eust-w
bf36bf6086 ✨ optimize POC workflow performance and reliability 2026-07-10 17:16:38 +08:00
eust-w
08ae391e6c 🧪 Add POC operator workflow acceptance 2026-06-27 02:56:34 +08:00
eust-w
94fc8d26dc 🧪 Add token-based POC GPU workflow acceptance 2026-06-26 05:16:04 +08:00
eust-w
e442d37508 🔐 Expose token-readable POC readiness gate 2026-06-26 04:44:55 +08:00
eust-w
60fc78de48 🔎 Add artifact lineage audit API 2026-06-26 00:27:05 +08:00
eust-w
c83e86da08 🔐 Allow token artifact content reads 2026-06-25 16:51:39 +08:00
eust-w
be91466940 🔐 Allow token run monitoring reads 2026-06-25 14:09:56 +08:00
eust-w
47983d35f1 ✨ Add custom operator image archive import 2026-06-25 12:20:18 +08:00
eust-w
e935639be5 ✅ Allow tokenized POC acceptance import 2026-06-23 16:03:38 +08:00
eust-w
8b8c0b5275 ✅ Fix public preview auth context 2026-06-23 05:20:53 +08:00
eust-w
651dcd28c7 🧑‍🏭 Redesign embodied business roles 2026-06-22 12:25:52 +08:00
eust-w
34733b4b57 🔐 Normalize duplicate identity errors 2026-06-18 12:41:01 +08:00
eust-w
fa2f7110d1 🔐 Enforce unique user emails 2026-06-18 12:18:22 +08:00
eust-w
743dbcc9a1 🔐 Validate organization slugs 2026-06-18 12:13:09 +08:00
eust-w
27bdeec73b 🔐 Validate user profile fields 2026-06-18 11:01:16 +08:00
eust-w
172710842d 🔐 Reject blank account passwords 2026-06-18 06:29:55 +08:00
eust-w
a73169df85 🔐 Require CSRF for session logout 2026-06-18 01:45:27 +08:00
eust-w
d82989ae18 🔐 Tighten RBAC and acceptance checks 2026-06-17 20:06:31 +08:00
eust-w
0ef6b6be58 🔒 Tighten worker controls and production defaults 2026-06-16 13:04:46 +08:00
eust-w
0b543382b4 🔐 Harden public auth and GPU validation 2026-06-16 12:39:47 +08:00
eust-w
4d62a87f77 🔐 Harden auth and tenant scoped queries 2026-06-16 12:16:45 +08:00
eust-w
efaab18f63 🔐 Complete tenant auth hardening 2026-06-16 11:52:31 +08:00
eust-w
8a8e878c70 🔐 Add session auth foundation and runtime hardening 2026-06-15 19:13:28 +08:00