- 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>
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.
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>
- 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
- 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
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)
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)
- 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
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.
- 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.
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>
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>