145 Commits

Author SHA1 Message Date
d-robotics
badabafb3b 🧪 Exercise draft activation with the supported streaming workflow type 2026-10-22 01:12:16 +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
15fc98ef3e 🐛 Stream authorized video directly from BOS and recover playback 2026-09-26 05:23:17 -07:00
eust-w
106235bb02 ✨ Remove Email field, complete phone-only account identity (ticket 05)
Contract step of the account-phone-login expand-migrate-contract rollout.
Phone is now the sole account identifier end to end:

- domain.UserRecord/CreateUserInput: delete Email, drop Phone's omitempty
  (required going forward).
- store: delete email_unique Mongo index; phone_unique is now non-sparse
  (unique, not sparse) since every account creation path requires a phone.
  Delete FindUserByEmail, ensureUserEmailAvailableLocked, and
  ErrDuplicateUserEmail (confirmed dead via grep - all real call sites were
  already migrated to the *Phone equivalents by tickets 01-03). Mongo
  duplicate-key fallback and the account-mutation-guard's stale-write
  snapshot/filter now key off Phone instead of Email.
- api: drop the now-impossible ErrDuplicateUserEmail branch in
  renderUserMutationError. The account-hierarchy audit endpoint and the
  supplier-deletion receipt struct both switch their identifying field from
  Email to Phone, since both are populated fresh from current account state
  (not frozen historical snapshots) - continuing to read a "email" key would
  silently go blank for every account created after this change.
- frontend: src/types.ts User.phone is now required (email removed);
  AccountHierarchyIssue.email -> .phone in services/api/users.ts and
  pages/Users.tsx to match the backend audit endpoint's renamed field.
- Rewrote the wide blast radius of Go test fixtures that constructed users
  by email across internal/api/*_test.go and internal/store/*_test.go,
  including the two dedicated memory-store uniqueness tests (merged into
  phone-only equivalents) and several opt-in "live" acceptance-fixture
  tests gated behind env vars for real Fanyu deployments.

Repo-wide grep of Go and TS/TSX for Email/email/邮箱 turned up no remaining
account-identifier references outside of a few harmless test-only cosmetic
labels (e.g. "Email Tenant" as an org display name in a seed helper) and
assertions that explicitly check "邮箱" text is absent from API responses.

go build/vet clean. go test ./internal/api/... ./internal/store/...
./internal/domain/... : 75 failures, identical test names to the
pre-ticket-05 baseline (diffed against a throwaway worktree at the prior
tip). npm run lint:web (tsc --noEmit) clean. npm run test:frontend:
599/586/13, matching the stated baseline exactly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 14:30:50 +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
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
637f511b6a 🔒 Retire legacy organization console and platform administrator access 2026-09-21 16:40:41 +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
b479c650b3 🐛 Fix claim initialization and sparse annotation submission 2026-09-06 09:16:42 +08:00
eust-w
f27afc66d8 🧹 refactor(auth): remove all legacy compatibility roles and enforce 5 standard roles 2026-09-03 11:58:59 +08:00
eust-w
1eda8f7827 🐛 Move Capture registry during version activation 2026-09-01 06:07:12 +08:00
eust-w
03f9419f8c 🚀 Run Fanyu pose services on demand 2026-09-01 04:02:18 +08:00
eust-w
23fde8ff4c 🗂️ Keep one active workflow version 2026-08-27 15:51:55 +08:00
eust-w
86befb1b35 🪣 Require project buckets and workflow artifact paths 2026-08-24 02:11:37 +08:00
eust-w
00cc2f0d95 🧩 Drive annotation surfaces from plugin contributions 2026-08-24 00:09:11 +08:00
eust-w
18582a7880 ✨ Preview manifest members on workflow edges 2026-08-22 14:12:04 +08:00
eust-w
b01c49d44e 🐛 Preserve human release trigger on package retry 2026-08-21 19:16:13 +08:00
eust-w
29cc8c533c 🐛 Recover workflow inputs for human package retry 2026-08-21 19:07:30 +08:00
eust-w
b7a68161b6 🐛 Permit current human package retry while parent waits 2026-08-21 18:56:15 +08:00
eust-w
c5ba06ac5c 🐛 Rebind package retries to human release partitions 2026-08-21 18:48:23 +08:00
eust-w
6aa4058e36 🚀 Build PTS-grounded Fanyu human workflow 2026-08-21 12:29:07 +08:00
eust-w
f31fd7ae55 🔀 Merge Fanyu full delivery baseline 2026-08-19 16:22:21 +08:00
eust-w
93e45e5c89 🐛 Scope artifact storage defaults by organization 2026-08-19 14:04:08 +08:00
eust-w
7e663344f2 ✨ Add versioned workflow input contracts 2026-08-19 12:57:20 +08:00
eust-w
0324b189e6 ✨ Add pluginized human-loop annotation workflows 2026-08-18 21:52:20 +08:00
eust-w
c7acea1d1a 🐛 Restore independent legacy artifact previews 2026-07-27 15:32:31 +08:00
eust-w
8fb456f3b0 🐛 Stream BOS artifacts through run content API 2026-07-27 12:29:19 +08:00
eust-w
89372faf6b 🧭 Validate deep object storage paths 2026-07-22 01:13:44 +08:00
eust-w
d092be1067 ✨ Add concurrent directory uploads 2026-07-14 16:14:39 +08:00
eust-w
ea401191e5 🧠 add operator-level shared memory settings 2026-07-13 19:21:12 +08:00
eust-w
9cb00828bb 📈 reset rerun progress timeline 2026-07-13 14:43:44 +08:00
eust-w
a9a545fe7c 📝 default PVC mounts to read-write 2026-07-13 11:07:32 +08:00
eust-w
66a15d4cf4 ⚡ tighten worker scheduling and runtime visibility 2026-07-11 00:10:34 +08:00
eust-w
a2423dafa7 ⚡ accelerate paginated run responses 2026-07-10 18:14:27 +08:00
eust-w
148b796543 ♻️ keep run polling independent from Kubernetes 2026-07-10 17:40:57 +08:00
eust-w
a8fcb04f52 🐛 Surface active Kubernetes job references 2026-07-10 17:34:14 +08:00
eust-w
bf36bf6086 ✨ optimize POC workflow performance and reliability 2026-07-10 17:16:38 +08:00
eust-w
3cda38c1b0 🐛 Load complete lightweight operator file trees 2026-07-10 14:04:56 +08:00
eust-w
dcb103d686 ✨ Add multi-PVC mounts for lightweight operators 2026-07-10 11:27:01 +08:00
eust-w
a34570f3ba ✨ Complete lightweight operator file manager 2026-07-08 21:16:42 +08:00
eust-w
ab18312122 ✨ Add lightweight operator code editor 2026-07-08 20:47:05 +08:00
eust-w
a20f1058b1 🐛 Allow object storage moves to bucket root 2026-07-08 20:38:43 +08:00
eust-w
220581dd79 ✨ Require explicit lightweight operator runtime 2026-07-08 18:42:31 +08:00
eust-w
26d24fc78d ✨ Let lightweight operators manage commands 2026-07-08 18:04:03 +08:00
eust-w
cbe634e307 ✨ Use editable lightweight entrypoint 2026-07-08 17:53:48 +08:00
eust-w
8417b2962e ✨ Add object storage move operations 2026-07-08 17:31:25 +08:00
eust-w
2a0def11b4 ✨ Add lightweight operator support 2026-07-08 16:46:43 +08:00
eust-w
caca28d62e ✨ Show project workflow status counts 2026-07-08 14:01:56 +08:00
eust-w
5289510260 🗂️ Reorganize BOS workspace layout 2026-07-07 18:57:49 +08:00